Posts

css - Add active class to element according to URL Jquery Django -

how can add "active" class element according href i have django template this: <div class="panel side-panel-1 category"> <h4 class="title1">Разделы</h4> <ul class="clear-list"> {% section in sections %} <li> <a href="/advert/adverts.aspx&sec{{ section.id }}">{{ section.name }} ({{ section.advert_set.count }})</a> </li> {% endfor %} </ul> so urls formed section.id example: mysite.com/advert/adverts.aspx&sec1 in cases be: mysite.com/advert/adverts.aspx&sec1&cat10&page1 maybe want this. use class="{{ section.id ? 'active' : '' }}" . if section.id exists, active wile add. <div class="panel side-panel-1 category"> <h4 class="title1">Разделы</h4> <ul class="clear-list"> {% section in sections %} <li class="{{ section.id ? 'a...

Is is possible to get keywords used to land on my Google play page? -

is possible keywords user uses land on google play page. have linked google analytics , google play page, still not able this. on website, data using google analytics. wondering why google aint providing on play store. i realise question posted earlier - google analytics google play app page . pretty old post(2012). wondering if google has come solution recently. it appears still isn't possible. the answer provided stefan link still seems hold true: you don't have direct access source code of app page there no way include necessary js [to track keywords] the closest might (and may terrible idea since may divert clicks google play storefront) create landing page outside of google play, capture search keywords there ga + webmaster tools, , extrapolate.

sql server - CASE expression for two unique values being compared to another table -

using sql-server 2008 / t-sql background: my query seeks compare codes assigned across 2 versions (highest value vs next highest). versions assigned same id (i.e. versions of id). however, final piece in jigsaw (where struggling) see if code assigned version of same id other previous version. way dataset built (through use of temp tables) previous version never have same code current version. table 1: id | curver | curcode | prevver | prevcode | ------------------------ 1 | 4 | 1234 | 3 | 4321 basically, although 1234 assigned version 4 not 3, want run yes/no or 1/0 checker on table, table 2, see if assigned versions 1 or 2 of same id . table 2: id | ver | code ------------------------ 1 | 1 | 1234 1 | 2 | 4321 1 | 3 | 4321 1 | 4 | 1234 so, want join table 2 table 1 , introduce column table 1 gives '1' if code assigned versions not curver in table 2. my query goes this: select d...

java - Why is one TimerTask slowing down another? -

i have got timer task, updates player positions: public void run(){ {updatewatcher = new timertask() { public void run() { update(0.1); } }; t.scheduleatfixedrate(updatewatcher, 5, 5);} and have timertask right under one, updates projectile positions: updatewatcher = new timertask() { //different variable. note capital u. public void run() { (bullet b : bullets){ b.update(); } } }; t.scheduleatfixedrate(updatewatcher, 5, 5); } however, second timertask slowing down first one. if delete iteration, this: updatewatcher = new timertask() { public void run() { } }; t.scheduleatfixedrate(updatewatcher, 5, 5); } the player moves @ correct speed. however, re-add code (using eclipse de-bugging add live), delayed task executes lot less often, causing players moving more 10 times slower usual. what causing this, , how fix it?

bash - Why extglob except breaking except condition? -

i run in debian 8.1, gnu bash, version 4.3.30(1)-release (x86_64-pc-linux-gnu) , lenovo g50-30 500 gb ssd , 8 gb flash memory: shopt -s extglob cp -r !(backups.backupdb/) /home/masi/documents/ but copy directory backups.backupdb/ , confirmed @ end of copying. messages during copying process after 2h copying cp: cannot stat ‘backups.backupdb/masi\’s macbook air/2015-06-25-233115/macintosh hd/system/library/image capture/automatic tasks/makepdf.app/contents/resources/ko.lproj/3x5로 자르기.mkpdf’: no such file or directory cp: cannot stat ‘backups.backupdb/masi\’s macbook air/2015-06-25-233115/macintosh hd/system/library/image capture/automatic tasks/makepdf.app/contents/resources/ko.lproj/3x5에 맞추기.mkpdf’: no such file or directory ... cp: cannot stat ‘camera uploads/2015-06-29 11.51.36.jpg’: invalid argument cp: cannot stat ‘camera uploads/2015-06-29 11.51.53.jpg’: invalid argument cp: cannot stat ‘camera uploads/icon\r’: invalid argument cp: cannot stat ‘cancer’: invalid argum...

javascript - Can someone tell me how to make an image inside a canvas move? -

can tell me how make image on canvas move? in previous version of game made image div moved fine can't figure out. making me write more please ignore part: //this variable image want move var blinky = { x: 0, y: 0 }; //this makes image appear when page loaded var byready = false; var byimage = new image(); byimage.onload = function(){ byready = true; }; byimage.src = "blinky.jpg" //this puts images on canvas var render = function(){ if(bgready){ ctx.drawimage(bgimage,0,0); } if(hrready){ ctx.drawimage(hrimage,hero.x, hero.y); } if(emready){ ctx.drawimage(emimage,monster.x, monster.y); } if(byready){ ctx.drawimage(byimage,blinky.x,blinky.y); } //this moves div around screen randomly $(document).ready(function(){ animatediv(); }); function makenewposition(){ // viewport dimensions (remove dimension of div) var h = $(window).height() - 30; var w = $(window)....

jquery mobile - JQM: Adding click function to a button AFTER Page load via Ajax -

html: <div data-role="page" id="main"> <a href="#" id="menubtn" class="ui-btn">menu</a> <script>$(document).on("pageshow", menu);</script> </div> js: function menu() { $('#menubtn').on('click', function () { ... }); alert("menu"); } does work first pageload, after clicking link jqm loads link via ajax... menu() called, alert viewable... no click event added link any ideas?