Posts

jQuery disable enable click event with fade -

how can disable click event before fadein , enable after fadeout? my js code: $('a').click(function(){ // disable click $('div').fadeout(400, function(){ $(this) .css('background','yellow') .fadein(1800, function(){} // enable click );}); }); i coulda use stop() need disable/enable plz modify http://jsfiddle.net/wbwrm/1/ thx add class element, , don't run event when class there. $('a').click(function () { var $this = $(this); if ($this.hasclass('noclick')) return; // disable click $this.addclass('noclick'); $('div').fadeout(400, function () { $(this).css('background', 'yellow').fadein(1800, function () { // enable click $this.removeclass('noclick'); }); }); });

How to programmatically determine when a rollover happened in log4j? -

i attempting use log4j write csv files. csv header must written top of log file every time created. example, of these rolled files must have following first line in log file: log.0 timestamp, name, min, max log.1 timestamp, name, min, max log.2 timestamp, name, min, max is possible determine when rollover has occurred can append header? thanks. p.s: know there lots of open source csv writers prefer not use them because use existing log functionality in our software. if @ log4j documentation rollingfileappender, has method called rollover. http://logging.apache.org/log4j/1.2/apidocs/index.html you need implement custom file appender inherits rollingfileappender, , override rollover method. imagine call super.rollover, , write whatever want header new file before gets logged it.

objective c - NSSortDescriptor Not Working to Organize TableView -

i working on sorting tableview cells , not working reason. had earlier revision of exact same code , exact same plist have sworn worked several months. refuses sort. sorting code inside numberofrowsinsection method: nsstring *date = [self.months objectatindex:sectionnumber]; nsdictionary *monthdata = [self.sportdictionary objectforkey:date]; nssortdescriptor *sortdescriptor2 = [[nssortdescriptor alloc] initwithkey: nil ascending: yes]; nsarray *days = (nsarray *)[[monthdata allkeys]sortedarrayusingdescriptors:[nsarray arraywithobject:sortdescriptor2]]; for(int x = 0; x < [days count]; x++) { nslog(@"day: %@", [days objectatindex:x]); } when @ output of nslog, not right. getting 15, 22, 29, 3, 8 the part of plist it's sorting shown: <dict> <key>1 september 2012</key> <dict> <key>3</key> <array> <string>georgia tech (orange effect)</string> <string>8:00 pm </string> <string>home</string> ...

asp.net - MVC4 Mobile environment on xp -

i trying develop simple sample mobile web app using mvc4, provide small demo team. following machine config os: windows xp vs: vs 2010 express emulator: android (i couldn't find windows7 emulator xp) problem: android emulator needs (as far know) application hosted iis application when create virtual directory mvc4 , try access, simple throws 403 error, thats because (again far know) iis 5.1 doesn't know mvc4 request handling question: how proceed in situation test application on latest mobile (of kind windows7, android or apple) emulator browser ? i tried iis express, android emulator didn't it. have tried mapping requests aspnet_isapi.dll? see blog post instructions: http://itscommonsensestupid.blogspot.in/2008/11/deploy-aspnet-mvc-app-on-windows-xp-iis.html?m=1

python - Making a sprite character jump naturally with pyglet and pymunk -

this code displays image assassin1.png on black screen. image has pymunk body , shape associated it. there invisible static pymunk object called floor present beneath it. gravity induced on image , resting on invisible floor. i make image jump naturally when press up key. how can implement this? import pyglet import pymunk def assassin_space(space): mass = 91 radius = 14 inertia = pymunk.moment_for_circle(mass, 0, radius) body = pymunk.body(mass, inertia) body.position = 50, 80 shape = pymunk.circle(body, radius) space.add(body, shape) return shape def add_static_line(space): body = pymunk.body() body.position = (0,0) floor = pymunk.segment(body, (0, 20), (300, 20), 0) space.add_static(floor) return floor class assassin(pyglet.sprite.sprite): def __init__(self, batch, img, space): self.space = space pyglet.sprite.sprite.__init__(self, img, self.space.body.position.x, self.space.body.position.y) def update(self): self.x = self.space.body.position.x self.y = self.space.body.positio...

python - set axis limits in loglog plot with matplotlib -

Image
how create space around points i've plotted matplotlib? for example, in plot, bottom left point cutoff axis, little more space between point , axis. import matplotlib.pyplot plt x = [2**i in xrange(4,14)] y = [i**2 in x] plt.loglog(x,y,'ro',basex=2,basey=2) plt.xlim([0, 2**14]) # <--- line nothing plt.show() in interactive mode, xlim line returns (16.0, 16384) , old values instead of new values i'm trying set. zero can not plotted on loglog graph (log(0) = -inf). silently failing because can not use 0 limit. try plt.xlim([1,2**14]) instead.

php - want to display the download link whenever there is a file to download -

my problem is, title say, want display download link file when file available is... i dont know error is: <?php $doc = get_post_meta(get_the_id(), 'wp_custom_attachment', true); ?> <div id="custom_pdf"> <a href="<?php echo $doc['url']; ?> "> download pdf here </a> </div><!-- #custom_pdf --> this normal code.. work fine, here displayed unconditionally... , code conditionally is: <?php $doc = get_post_meta(get_the_id(), 'wp_custom_attachment', true); ?> <? if(strlen(trim(<?php $doc['url'] ?>)) > 0) { <div id="custom_pdf"> <a href="<?php echo $doc['url']; ?> "> download pdf here </a> </div><!-- #custom_pdf --> } ; ?> // end if and here somewhere error, dont know where. can please me. thanks. your php tags not correctly placed in html code: <?php $doc = get_post_meta(get_the_id(), 'wp_custom_att...