Posts

javascript - doesn't work within a -

javascript - <a> doesn't work within a <div> - i have button 3 states (three different images) , works , looks great except primary function of button - link other document:) when it's clicked, nil happens. need utilize javascript or <input> or <button> ? i've tried <button> tag, 3 states didn't work. and <a id="backbutton"> ... doesn't work either. #backbutton{ width: 100px; height:100px; background-image: url('../obrazky/fs/back_up100.png'); } #backbutton:hover{ background-image: url('../obrazky/fs/back_hover100.png'); } #backbutton:active{ background-image: url('../obrazky/fs/back_down100.png'); } <div id="backbutton"><a href="index.html"></a></div> use #backbutton a{display:block;width:100%;height:100%;} to create link within div fit container.. javascript html css

c - Are Wndproc and hook in the main thread? -

c - Are Wndproc and hook in the main thread? - sorry dumb question, wndproc , hooks in main thread (when called)? if mean can not utilize them build buffer keyboard input? your window procedure (and subclassed window procedures, hooks, etc) run in thread called createwindow (it's requirement same thread later process message queue, window procedures run when main message dispatch loop calls dispatchmessage ). not sure mean "build buffer keyboard input". c windows

java - Package modifier produces error -

java - Package modifier produces error - eclipse giving me error when defining top level class bundle modifier, error : syntax error on token "package", delete token. my code simpy: package class myclass { ... } my google-foo seems broken, help great! please inquire questions necessary... thanks! when want delcare class bundle private, should omit modifier. package keyword used define packages. java package access-modifiers

cocoa - NSFetchRequest with distinct values and expression -

cocoa - NSFetchRequest with distinct values and expression - i have create nsfetchrequest iphone app returns same results next sql statement: select week , year , sum(duration) totalduration mytable grouping year , week i've tried solve next code: nsexpression * durationexpression = [nsexpression expressionforfunction:@"sum:" arguments:[nsarray arraywithobject:[nsexpression expressionforkeypath:@"duration"]]]; nsexpressiondescription * durationexpressiondescription = [[[nsexpressiondescription alloc] init] autorelease]; [durationexpressiondescription setexpression:durationexpression]; [durationexpressiondescription setexpressionresulttype:nsdoubleattributetype]; [durationexpressiondescription setname:@"totalduration"]; nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] init]; nsentitydescription *entity = [nsentitydescription entityforname:@"myentity" inmanagedobjectcontext:managedobjectcontext]; nsarra...

CUDA: How to check for the right compute capability? -

CUDA: How to check for the right compute capability? - cuda code compiled higher compute capability execute long time on device lower compute capability, before silently failing 1 day in kernel. spent half day chasing elusive bug realize build rule had sm_21 while device (tesla c2050) 2.0 . is there cuda api code can add together can self-check if running on device compatible compute capability? need compile , work devices of many compute capabilities. there other action can take ensure such errors not occur? in runtime api, cudagetdeviceproperties returns 2 fields major , minor homecoming compute capability given enumerated cuda device. can utilize parse compute capability of gpu before establishing context on create sure right architecture code does. nvcc can generate object file containing multiple architectures single invocation using -gencode option, example: nvcc -c -gencode arch=compute_20,code=sm_20 \ -gencode arch=compute_13,code=sm_13 ...

objective c - Memory Leak with SubstringWithRange NSString -

objective c - Memory Leak with SubstringWithRange NSString - running programme through leaks tool in x-code, points function main cause of memory leaks. + (nsmutablearray *) getcolumns:(nsstring *) devicehtml { nsmutablearray *ret = [[[nsmutablearray alloc] init] autorelease]; nsregularexpression *m = [[nsregularexpression alloc] initwithpattern:@"<td[\\w\\w\\d\\s</>]*?>[\\w\\w\\d\\s]+?</td>" options:nsregularexpressioncaseinsensitive error:nil]; nsarray *results = [m matchesinstring:devicehtml options:nsmatchingcompleted range:nsmakerange(0, [devicehtml length])]; [m release]; (nstextcheckingresult * res in results) { nsstring *cleaned = [devicehtml substringwithrange:[res range]]; int firstclose = [cleaned rangeofstring:@">"].location; int cleanedlength = [cleaned length]; nsstring *cleaned1 = [cleaned substringwithrange:nsmakerange(firstclo...

Replace only whole word in javascript -

Replace only whole word in javascript - possible duplicate: match , replace whole words in javascript i want replace in javascript word "microsoft" "stackoverflow". but want replace whole word - don't want "microsoft microsftttt" turned "stackoverflow stackoverflowttt". you can add together ' ' begin of string & end of string, replace ' microsoft ' ' stackoverflow ' , cutting ' ' , added before it javascript