Posts

Android Alert Box Wont Stay Open -

as title says alert box in app wont stay open. box nested within loop checked when button clicked. when loop goes alert box flashes on screen before disappearing straight away. is there sort of timer can put on alert box keep open or have implemented box incorrectly? button w/ loop , nested alert box button button= (button) findviewbyid(r.id.cookbutton); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { finish(); //deducting 1 ingredient final cursor ingredients = adapter.getrecipesingredients(recipecode); final cursor missing = adapter.missingingredients(recipecode); if(missing.getcount() == 0) { toast.maketext(getapplicationcontext(), "haveeverything", toast.length_short).show(); ingredients.movetofirst(); string ingredient = ingredients.getstring(ingredients.getcolumnindex("i...

maven - Spring Boot Dev Tools: Crash on hot reload with CommandLineRunners and Spring Data Repositories -

i'm developing project spring boot 1.3.2, spring data mongodb , spring security, using dev tools, intellij idea 15.0.3, using maven. i did read spring boot developer tools documentation , , configured indicated, , hot reload worked fine. then, since needed perform tasks during application startup, connecting database , perform validations, , insertions if needed, decided use commandlinerunner beans this: @configuration public class databaseinitializer { @bean commandlinerunner verifyconfiguration(configurationrepository repository) { return args -> { // id provided 1 , can't modify it. if (repository.findone(...) == null) { // offending line //perform tasks here } }; } // more commandlinerunners following same approach } if restart application, works fine, no crashes, no errors, when trigger dev tools hot reload, fails, , throws stacktrace: java.lang.illegalstateexception: failed ...

function - How can I convert a string converted using toLocaleString() in javascript back to Date Object? -

i using javascript function tolocalestring() convert date object string (as it's output user friendly), storage purpose, , want fetch saved data (obviously in form of string) later, , want compare such dates. i have date stored in format : february 5, 2016 7:04:40 pm ist but that's not possible directly, tried convert string date object using both implicit (using date constructor) , explicit (using date object) methods. gives invalid date, output, when printed. google lot find out how can convert date format directly date object can perform desired date operations. couldn't found worth using. please me came out solution problem, can complete project. if need use pure javascript should create function parses string in order use arguments create date object. var months = { 'january': 0, 'february': 1, 'march': 2, 'april': 3, 'may': 4, 'june': 5, 'july': 6, 'august': 7, ...

php - Laravel eloquent query issue -

i trying users images relation 1 many. in images table column type equal 1. closest created. user::with('images')->has('images')->get(); but return images not type 1; also tried $a = user::defaultimage()->get(); and in user model def scope public function scopedefaultimage($query) { $query->wherehas('images', function ($query) { $query->where('default', 1); })->get(); return $query; } but doesn't return relation images, user you want modify way using with function. make images returned of type 1. user::with(['images' => function($q) { $q->where('type', 1); }])->wherehas('images', function($q) { $q->where('type', 1); })->get(); by adding wherehas , return users have image type of 1 attached. i make sure in database have users , attached images image type of 1 know sure sho...

android - How to pass data between fragments of a FragmentTabHost? -

i'm trying learn android , having issue project. have set fragment tab host 4 fragments. have first 3 fragments interactive user , when tab on 4th tab, display information put in on first three. figured can pass info overriding on onpause() trigger don't want use button press. right now, i'm trying edittext work make sure i'm doing right. i'm not sure if i'm using fragment transaction correctly, or way i'm trying collect edit text field. later on hope pass information via bundle. appreciated. main: package valdes.fragmenttabsmenu; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmenttabhost; import android.app.fragmenttransaction; public class mainactivity extends fragmentactivity implements welcomefragment.welcomelistener { private fragmenttabhost mtabhost; private string firstname; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate)...

jquery - How to make a navigation menu dynamic? -

how make following navigation dynamic, doesn't break if add navigation element. nav { position: relative; height: 57px; line-height: 57px; width: 100%; background-color: #fff; font-weight: 500; text-transform: uppercase; font-size: 14px; overflow: hidden; } nav ul { position: relative; display: -ms-flexbox; display: -webkit-flex; display: -moz-flex; display: -ms-flex; display: flex; margin: 0 auto; padding: 0; list-style: none; -ms-box-orient: horizontal; -ms-box-pack: center; -webkit-flex-flow: row wrap; -moz-flex-flow: row wrap; -ms-flex-flow: row wrap; flex-flow: row wrap; -webkit-justify-content: center; -moz-justify-content: center; -ms-justify-content: center; justify-content: center; text-align: center; width: 100%; height: 100%; } nav ul li { position: relative; margin: 0; text-align: center; -webkit-flex: 1; -moz-flex: 1; -ms-flex: 1; flex: 1; ...

ruby - rbenv: bundle: command not found -

i trying create bosh release using command bosh create release --force --final --with-tarball i got following error error: > + bundle package --all > rbenv: bundle: command not found > > `bundle' command exists in these ruby versions: > 2.2.4 'admin_ui' pre-packaging failed in linux machine following version of software installed. which ruby /root/.rbenv/shims/ruby ruby --version ruby 2.2.4p230 (2015-12-16 revision 53155) bundle /root/.rbenv/shims/bundle bundle --version bundler version 1.11.2 update: ~/.profile file export path="$home/.rbenv/bin:$path" eval "$(rbenv init -)" i source file before creating bosh release error: > using membrane 0.0.5 > installing mime-types-data 3.2015.1120 > > gem::installerror: mime-types-data requires ruby version >= 2.0. looks bosh runs in it’s own environment (read: not load .bashrc etc configs.) one might...