Posts

javascript - Swap divs (rows) only in tablet view -

i have 2 basic divs display side side in bootstrap layout. in using mobile first, have search panel div display first, followed div. in desktop mode, using push/pull correctly first div go right. in middle view, tablet view, divs stacked, want swap order. i've created bootply: http://www.bootply.com/i8iuuyntwk# in summary: mobile: [search] [slideshow] tablet: [slideshow] [search] desktop: [slideshow] [search] <div class="container"> <div class="row"> <div id="search_div" class="col-md-3 col-md-push-9"> search form here (this should on right on desktop, on top mobile, , second tablet) </div> <div id="slideshow_div" class="col-md-9 col-md-pull-3"> slide show here (this should on left desktop, second mobile , on top tablet) </div> </div> </div> i've seen dozens of ways attempt...

django - Python package always trying to install latest version of requirement -

i'm developing application based on django==1.7.x . the problem have setup.py of 1 of dependencies (let's call foo ) specifies django>=1.3 1 of requirements, when such foo being installed, tries install latest version of django, of 1.8.3. i thought when specifying dependencies package>=min_version in setup.py file, pip see package installed, installed version suffies minimum required version , respect installation of package . why pip trying install latest version? , how can force respect current installed version? update: fyi, i'm using pip==7.1.0 update: happens when installing manually, pip install foo==x.y . when dependency in requirements file , installed via pip install -r requirements.txt , installed versions of required packages respected pip. thanks!

Java android eclipse, starting activity in thread: application stopped working -

hey doing simple android app , trying start new activity thread this: public void startui (){ thread t = new thread(){ public void run () { runonuithread(new runnable() { @override public void run() { intent gotomenu = new intent(getapplicationcontext(), mainmenu.class); startactivity(gotomenu); } }); ;} }; t.start; } but when code comes line intent gotomenu = new intent(getapplicationcontext(), mainmenu.class); it crashes , writes: "application stopped working". if want start activity need use activity context first parameter. if use application context mainmenu activity must have flag_activity_new_task flag set. cannot start new activity in same task application context. refer: http://developer.android.com/reference/android/content/intent.html#flag_activity_new_task as @raghunandan mentioned, if want delay...

gulp.watch only runs once when passed a run-sequence task -

i have gulpfile , uses run sequence , gulp.watch(). here example task uses run sequence. gulp.task('rebuild', function (callback) { runsequence('clean', 'lint', ['process-js', 'process-styles', 'move-fonts', 'move-static-content']); }); when make change file, watch task run task specified once. in case, task should executed "run", same default task except doesn't run dev server , watch task again. nothing happens when make further edits, whether in same file or different one. if pass gulp.watch plain gulp task (without run sequence), example clean task, watch run clean task every time. i'm sure i'm doing wrong, don't understand what. think might silently erroring , disconnecting stream, can't figure out how debug this. you aren't passing callback run-sequence, therefore task never completes. - overzealous so run sequence task needs ...

python - How to groubpy with hierarchical columns? -

i have dataframe multi-level columns, , not able find way groupby columns. there addressing columns or should go route of joining names in this question ? solution: addressing columns ['a','x'] instead of ('a','x') you can still use .groupby on columns. below simple example. import pandas pd import numpy np # data # ========================================== np.random.seed(0) multi_col = pd.multiindex.from_product([['a', 'b'], ['x', 'y']], names=['ab', 'xy']) df = pd.dataframe(np.random.randint(1,5, (10,4)), columns=multi_col) df ab b xy x y x y 0 1 4 2 1 1 4 4 4 4 2 2 4 2 3 3 1 4 3 1 4 1 1 3 2 5 3 4 4 3 6 1 2 2 2 7 2 1 2 1 8 4 1 4 2 9 3 4 4 1 # groupby 1 column # =================================== g_name, g in df.groupby([('a', 'x')]): print(g_name) print(g) 1 ab b xy x y x y 0 1 ...

Random number array without duplicates in C -

i trying create random integer array generator no duplicate using this: int pt_rand(int nbits) { int mask; if (0 < nbits && nbits < sizeof(int)*8) { mask = ~(~((unsigned int) 0) << nbits); } else { mask = ~((unsigned int) 0); } return rand() & mask; } int *gen_rand_int_array_nodups(int length, int nbits) { int * = malloc(sizeof(int)*length); (int = 0; < length; i++) { a[i] = pt_rand(nbits); (int j = 0; j < i; j++) { { a[i] = pt_rand(nbits); } while (a[i] == a[j]); } } shuffle_int_array(a, length); return a; } this code trying generate unique random integers within given nbits checking elements 1 one. however, i'm still getting duplicates in result , i've not figured out why. know bad practice of using method generate unique random numbers requirement of assignment requires me somehow make use of nbits param. i've...

.net - Get paper size of the layer in autocad c# -

i have method create layout. want set width , height of layout can't find properties. how , set dimension of layout ? you need call setcanonicalmedianame correct paper size available. check sample below [commandmethod("setclosestmedianamecmd")] public void setclosestmedianamecmd() { document doc = application.documentmanager.mdiactivedocument; database db = doc.database; editor ed = doc.editor; plotsettingsvalidator psv = plotsettingsvalidator.current; // let's first select device stringcollection devlist = psv.getplotdevicelist(); ed.writemessage("\n--- plotting devices ---"); (int = 0; < devlist.count; ++i) { ed.writemessage("\n{0} - {1}", i+1, devlist[i]); } promptintegeroptions opts = new promptintegeroptions( "\nenter device number: "); opts.lowerlimit = 1; opts.upperlimit = devlist.count; promptintegerresult pir = ed.getinteger(opts); ...