Posts

javascript - Count number of rows inside a div element -

Image
as shown in image below, have several div inside div (outer div). need count number of rows outer div have. in example row count 5. note:the inner div floated left , content created dynamically. does has ideas? perhaps along lines of: demo fiddle var minleft = null, rows = 0; $('div div').each(function () { var left = $(this).offset().left; if (left <= minleft || minleft==null) { rows++; minleft=left; } }); console.log(rows);

google app engine - Separate datastore data from debug and live versions of app -

what best approach separate data debug version , live one? the question , answers here describe how separate code logic: https://stackoverflow.com/a/8550105/129202 still datastore data shared between versions. i imagine of these: some nice setting in dashboard automatically separate data between versions, ignorant of each other. no changes needed in code, unless expect versions share data :-p get version number in code , use "physically" organize data, ie putting data in subfolders/subkeys per version... i'm not experienced datastore yet , don't know if have significant impact on performance. you can't seperate data based on versions. you use name space, wouldn't i use different instance , copy production data instance, run testing there, complete confidence working separate data set. some of projects, data specific companies/users , set test companies , test users, approach dependent on types of updates, , how segmented data is. ...

clojure - let forms : How to access destructured symbols in a macro? -

i'm trying write macro expands let form destructuring. problem have list of symbols defined in let form, including obtained destruturing. use case i'm trying factor out kind of behavior, validation example : (let [a (foo bar) {x :x, y :y, {u :u, v: v :as nested-map} :nested} some-map] (and x y nested-map u v ; testing truthiness (valid-a? a) (valid-x? x) (valid-y? y) (valid-nested? nested-map) (valid-u-and-v? u v) )) proposed solution it nice achieve through sort of and-let macro call this: (and-let [a (foo bar) {x :x, y :y, {u :u, v: v :as nested-map} :nested} some-map] (valid-a? a) (valid-x? x) (valid-nested? nested-map) (valid-u-and-v? u v)) what i'm missing but i'm missing way of accessing list of symbols bound in let form. if had list-bound-symbols function, : (defmacro and-let "expands , close previouly ...

php - Display current post on single template -

i have plugin automatically expires posts , changes it's post status "archive" on date. we have archive section houses these posts. still want display data post gives page not found. can alter query display post on single template? i've tried following pulls in archive posts rather page you're on. <?php $my_query = new wp_query('post_status=archive'); ?> <div> <?php if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post(); ?> <ul> <li> <?php the_title(); ?> </li> </ul> <?php endwhile; else: ?> <div> <ul> <li><?php _e('no upcoming posts'); ?></li> </ul> </div> <?php endif; ?> </div> post status allows users set workflow status post in wordpress. there 8 default st...

r - Subset rows which have a column inside numeral interval -

i subset lines have "chr" column 1 29, in "cnv1" dataframe. i tried it: cnvk <- cnv1[cnv1$chr==1:29,] but not lines have 1,2,3...29. cheers! try cnvk <- cnv1[cnv1$chr %in% 1:29,] or cnvk <- cnv1[cnv1$chr>=1 & cnv1$chr<=29,] (the latter might quicker if you're checking against large range of values)

angularjs - Implementing keyboard shortcuts in Angular apps -

i using directive implement keyboard shortcuts in angular app. directive called "keycapture". included in body tag of index page. <body ng-controller="mainctrl" key-capture> this directive uses mix of $broadcast , other methods things done. angular.module('plunker').directive('keycapture',['$state','$rootscope',function($state, $rootscope){ var shortcutkeys = []; return { link: function(scope,element,attrs,controller){ element.on('keydown',function(e){ shortcutkeys.push(e.keycode); if (shortcutkeys.length === 2){ var key2 = shortcutkeys.pop(); var key1 = shortcutkeys.pop(); /*press g , 1 - navigate different state*/ if (key1 === 71 && key2 == 49) { $state.transitionto('option1'); } /*press g , 2 - navigate different state*/ if (key1 === 71 && key2 == 50) { ...

Is there an equivalent of Androids ShowcaseView for iOS? -

there project android on github: https://github.com/amlcurran/showcaseview according readme: the showcaseview library designed highlight , showcase specific parts of apps user distinctive , attractive overlay. library great pointing out points of interest users, gestures, or obscure useful items. i know if functionally equivalent 1 exists ios. useful give users quick tour of app. typically app intros handled few swipe screens. think uber , duolingo. google , stackoverflow searching returns nothing meaningful. if had time i'd work on side project. edit: i've ended using github.com/ifttt/razzledazzle works both swift , objective-c. you can try https://github.com/rahuliyer95/ishowcase similar implementation of showcaseview android on ios.