Posts

javascript - smooth button grow and button shrink animation on hover -

i trying make simple animation; on mouse over, button animate bigger. when not hovering, return it's original size. however, whenever when try sample code, warps button odd sizes $('.btn').hover(function() { $(this).removeclass('btn-primary').addclass('btn-warning'); $(this).stop().animate({ 'height': $(this).height() * 2, 'width': $(this).width() * 1.3 }, 300); }, function() { $(this).removeclass('btn-warning').addclass('btn-primary'); $(this).stop().animate({ height: $(this).height(), width: $(this).width() }, 300); }); http://jsfiddle.net/rblqy/1/ how problem solved? i'm not entirely sure why code failing, seems have sort of calculation error when returning original size. after fiddling around bit found solution. animating padding instead of height , width don't have worry height width ratio when comes resizing link. $('.btn').hov...

ios - NSString stringWithFormat cant set precision for exponential record -

i'm trying display small double value on textfield . example, docalculationforequalpressed function returns 0.00008, when display on text field shows exponential record (8e-05). don't need number shown in exponential view. how set precision when use exponential record ??? using specifier %.9g - doesn't help. double result; result = [self.brain docalculationforequalpressed:[self.brain operationarray]]; if (result == infinity || result == -infinity || isnan(result)){ nsstring *infinity = @"\u221e"; self.displayfield.text = [nsstring stringwithformat:@"%@", infinity]; } else self.displayfield.text = [nsstring stringwithformat:@"%.9g", result]; it can't done format specifier default. you need use sprintf , remove trailing zeros yourself. char str[50]; sprintf (str,"%.20g",num); // make number. morphnumericstring (str, 3); void morphnumericstring (char *s, int n) { char *p; int count; ...

How do I implement this array in Javascript -

array ( [254] => onjob [251] => verified [250] => verified [249] => onjob [248] => onjob [247] => onjob [244] => onjob ) i have array , want each value respective array key . how in javascript ? create object my_object={254: 'onjob',251: 'verified', 250: 'verified',249: 'onjob'}; my_object[251]; //return "verified"

svg - Dynamic fill with transition d3 -

i want dynamic fill transition using d3. http://tributary.io/inlet/11094354 how transition on load 0-60% on first load?? thanks , best regards moyeen all need add transition stop : grad.append("stop").attr("offset", "0%").style("stop-color", "red") .transition().duration(1000).attr("offset", "60%"); complete demo here .

hibernate - How to load global settings frequently used in application in Java -

1) in application have table stores settings detail used heavily every functionality.basically conditions set in table checked. now doing making db call every , fetch details , check condition.this has resulted in lot of db calls , repetitive calls same condition.there quite lot of condition records in table.we need change make perform better. 2) in previous project had same requirement have configuration table such settings configured,there implemented load configuration table @ start of application , store them in system.setproperty(name,value)..and later use system.getproperty(name) retrieve it.in case settings changed update in system property.this worked charm. however,in current case(point 1 above) don't think prev way best way because lot of records present in table having lot of columns. can suggest way how achieve such kind of behavior in java? of them can think of is 1) using system.setproperty explained. 2) using caching ehcache - standalone or hibernate(as u...

sql server - SQL query to split a comma separated column into many-to-many relationships -

i given 3gb csv file need import in sql server 2012. i have 5 million rows data in staging table looks (simplified). staging table: +-------------------+------------+---------------+------------+ | name | thumbnail | tags | categories | +-------------------+------------+---------------+------------+ | history | thumb1.jpg | history,essay | history | | nutricion lecture | thumb2.jpg | food,essay | health | +-------------------+------------+---------------+------------+ the question tags , categories column in staging table. how can transfer information staging table actual table , create unique record each tag , category -- and create needed many-to-many relationships? it need check each tag against existing tags either create new record -or- fetch id of existing tag. programs : +----+-----------+------------+ | id | program | thumbnail | +----+-----------+------------+ | 1 | history | thumb1.jpg | | 2 | nutrici...

Petite chez scheme confusing function with variable? (variable ___ is not bound) -

i've started learning scheme , i'm having trouble. using petite chez scheme (64-bit) windows. have been reading on examples using functions 'every' , 'keep' , 'accumulate' , understand built in , known petite (i.e. not have defined before use). when enter examples have read test them, error returned. example- ;; make nouns plural (define (plural noun) (if (equal? (last noun) ’y) (word (bl noun) ’ies) (word noun ’s))) > (every plural ’(beatle turtle holly kink zombie)) ;; example input (beatles turtles hollies kinks zombies) ;; expected output instead receive error "variable every not bound". if 'every' being treated variable rather known function. receive same error when try examples 'keep' , 'accumulate'. coding correct assume (since copied book i'm reading). wrong in thinking these functions built in , not need defined or there other issue? hope can shed light on this. the...