Posts

How to stop jQuery Mobile calling $.mobile.loading('hide') during changePage? -

i'm trying stop jquery mobile hiding loading spinner when changepage called. the program flow goes this, starting clicking link, has click event defined this: $('body').delegate('.library-link', 'click', function() { $.mobile.loading( 'show' ); $.mobile.changepage($('#page-library')); return false; }); upon clicking link, pagebeforeshow event fired, triggers function populate page local storage, or else make ajax call data. $(document).on('pagebeforeshow', '#page-library', function(event){ ui.populate_data(); }); in ui.populate_data() data local storage or make ajax call. ui.populate_data = function() { if (localdata) { // populate ui on page $.mobile.loading( 'hide' ); } else { // make ajax call } }; if data there, load data container , hide loading spinner. if not makes ajax call, on complete saves data in local storage, , calls ui.populate_data...

python - How to find the two indexes from a list whos values are closest to zero -

i'm working on piece ga (fitness calculation actually) , need indexes of 2 values list whos values closest zero. have been looking hour on internet , though seems have become extremely close, , looks should work, testing print statements show code isnt working.. my process right is: find closest index , store it delete original array find new closest this code in question: closest = min(range(len(fitness_levels)), key=lambda i: abs(fitness_levels[i]-0)) fitness_levels.pop(closest) second_closest = min(range(len(fitness_levels)), key=lambda i: abs(fitness_levels[i]-0)) when fitness_levels = [-20, 23, -55, 11, 10, -18, -48, 16, -60, 20, 22, 16, 21, 66, 10, 46, -42] granted numbers generated @ random. like said, when checking print statements find method doensnt work in multiple ways, @ 1 point ended same index different values. have better workable way this? - python 2.7.x side note- come php background, still warming python, syntax wrong... while sort...

c# - Transistion from Winforms to WPF MVVM -

i have program @ heart fancy keyboard hook , wedge. keyboard hook portion separate library main program. in main program gather keys want monitor config file , instantiate keyboard hook. keys monitoring have tasks can perform when key pressed and/or when released. (tasks such open program, turn on scanner..etc) since project started in winforms felt idea make folder in library called controls. made dialog form user select task wanted perform. there has been need me switch winforms wpf. nothing add winform controls class library. trial , error appears doing same thing wpf user controls different story. decided easier created new wpf usercontrol project. (if possible can please leave comment how to?) so new wpf, , decided particular library use mvvm pattern feet wet. small in have 6 subclasses of type abstracttask . part of me itching use abstract task model. i'm not sure how yet, think model. i'll have add description string field view, shouldn't problem. since atleast...

mysql - Multiple Where clause with decryption -

would query decrypt usernames each condition or once , apply each condition? select * tablea ( concat_ws( ' ', aes_decrypt(tablea.firstname, "fnkey"), aes_decrypt(tablea.lastname, "lnkey") ) '%ray%' or concat_ws( ' ', aes_decrypt(tablea.lastname, "lnkey"), aes_decrypt(tablea.firstname, "fnkey") ) '%ray%' ); i cannot tell if function evaluated once each row or more. depends on query optimizer. establish benchmark. anyway, query inefficient. full table scan , calculate function each row. cannot use index here. not implement query on table more couple of rows.

css - Html file works locally on IE, but not on server. Works fine for Opera, Chrome, Safari and Firefox -

Image
basically, title states, file works locally, not when uploaded server. here's live working version: jsfiddle code extracted http://www.onextrapixel.com/2013/07/31/creating-content-tabs-with-pure-css/ *the divs displaying right below parent tab. that's ok, striped down code post question. this in 1 file, there's no reference external files, path problems should ruled out. thanks. google chrome ie local ie when uploaded webserver <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>pure css tabs fade animation demo 1</title> <style type="text/css"> body, html { height: 100%; margin: 0; -webkit-font-smoothing: antialiased; font-weight: 100; background: #aadfeb; text-align: center; font-family: helvetica; } .tabs input[type=radio] { position: absolu...

frameworks - Why "no such file or directory ... autoload.php" when accessing Laravel app? -

i newbie laravel, have been trying install laravel, wasted 3 hours unfortunately didn't work. when access through public directory, these errors: warning: require(c:\wamp\www\laravel\bootstrap/../vendor/autoload.php): failed open stream: no such file or directory in c:\wamp\www\laravel\bootstrap\autoload.php on line 17 call stack and following: fatal error: require(): failed opening required 'c:\wamp\www\laravel\bootstrap/../vendor/autoload.php' (include_path='.;c:\php\pear') in c did install laravel's dependencies? when unzip framework in work environment (i.g. htdocs) must install necesary dependencies command php composer.phar install (assuming have installed composer , git). when done, able see home page of framework.

visual studio - Post-build event command fails -

i have project creates dll intended used powershell profile; whenever finish creating new version of it, have copy/paste bin directory (which powershell profile looks these little toys of mine). one day thought myself, "self, why not use post-build event command automatically?" ...well, answer question "because doesn't damn work, that's why." among simplest commands on planet , exits code 1, whatever means. cp originpath destinationpath if run in ps, turns out fine. have quotes in paths , everything. on earth wrong? my mistake: have never used build events before , guess misunderstood supposed typing, apparently this works: powershell cp originpath destinationpath so, else might confused, that's how that. >.> guess it's not powershell command? not sure is, exactly.