Posts

jquery select appended elements -

jquery select appended elements - this question has reply here: event binding on dynamically created elements? 13 answers faced problem jquery doesn't allow select appended element. i've seen lot of advices how solve it. example: var $li = $('<li><span>' + html + '</span></li>'); $('.top').append($li); but can't help me in way. server list of records database in json format , in view , loop list , generate html structure. for example: $.getjson( "/searchbytype", data, function( info ) { $.each( data, function( key, val ) { $('items').append('<li class="item">'+ val.name + '</li>'); }); }); and want next click on li item , manipulation. ul list may contain 100-200 li tags. ideas appreciated! i think need event-del...

numeric limits - How double can store 1024 bits in just 8 bytes in C++? -

numeric limits - How double can store 1024 bits in just 8 bytes in C++? - i can't figure what's going on here. i find size of next info types in bytes: char:1 int:4 float:4 double:8 long long int:8 long long int max size 9223372036854775807 whereas double max size 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000 what!!! how mr. double storing such big value in 8 bytes ??? how many decimal digits need represent every integer between 0 , 10100 - 1? the reply should obvious: 100 digits. how many decimal digits need represent integral values between 0 , 10100 - 1, if need 7 important digits? you need 9. every number can represented abcdefg * 10hi. double s work in same way. ...

c# - How to find the difference between two images? -

c# - How to find the difference between two images? - i'm developing screen-sharing application. in project need transport images on internet. obviously, can't send new image on net every few seconds, extremely slow. want send 1 image of server's screen client, , afterwards, instead of sending new image sending pixels have been changed since lastly image (the 1 client has). i have written code: private list<color> comparebitmaps(image old, image _new) { list<color> returnlist = new list<color>(); for(int = 0; < old.width; i++) (int j = 0; j < old.height; j++) { if (((bitmap)old).getpixel(i, j) != ((bitmap)_new).getpixel(i, j)) { returnlist.add(((bitmap)_new).getpixel(i, j)); } } homecoming returnlist; } however, works way slow. i'm looking faster algorithm, 1 improve complexity. note: don't want built library that. need algorithm. ...

Groovy - Extract and display a substring from a String -

Groovy - Extract and display a substring from a String - i find pattern below string. words containing "match.text3", perchance latest 1 matching ending number. {match.text1.1=[1, admin, 07/10/14 09:29:34], match.text2.2=[2, admin, 07/10/14 10:01:08], match.text3.3=[3, admin, 07/10/14 10:08:01], match.text3.4=[4, admin, 07/10/14 11:08:01], match=[text3]} expected output: match.text3.4 or match.text3.3 match.text3.4 you can utilize findall() method on string extract tokens match given pattern: string s = '{match.text1.1=[1, admin, 07/10/14 09:29:34], match.text2.2=[2, admin, 07/10/14 10:01:08], match.text3.3=[3, admin, 07/10/14 10:08:01], match.text3.4=[4, admin, 07/10/14 11:08:01], match=[text3]}' list<string> tokens = s.findall(/match\.text3(\.[0-9]+)?/) assert tokens == ['match.text3.3', 'match.text3.4'] string lastly = tokens.last() assert lastly == 'match.text3.4' groovy

maven - bowerInstall task alternative for Java? -

maven - bowerInstall task alternative for Java? - i'm working on springmvc project , i'm organising project construction "client" module. i'm using webjars , wro4j projects great, organise javascript dependencies , concatenate , minimise css/js code. what miss exists in "javascript" world allows utilize html code depending on environment. i'm talking bowerinstall task. have in jsp code: * includes js files 1 one, when working in "development" profile * single file, concatenation , minification, when working in "production" profile. next lines html file in yeoman based project: ... <!-- build:css styles/vendor.css --> <!-- bower:css --> <link rel="stylesheet" href="../bower_components/bootstrap/dist/css/bootstrap.css" /> <link rel="stylesheet" href="../bower_components/highlightjs/styles/monokai.css" /> <link rel="stylesheet" href="../...

scala - Why can't I access my objects member variable? -

scala - Why can't I access my objects member variable? - i have next class setup: class myclass { class myinnerclass(membervar: string) def getainner: myinnerclass = { new myinnerclass("hello") } } then have next code outside of class: def myfunction = { val = new myclass val b = a.getainner.membervar // value membervar not fellow member of a.myinnerclass } why this? you need add together keyword val create membervar public otherwise it's private value: class myclass { class myinnerclass(val membervar: string) def getainner: myinnerclass = { new myinnerclass("hello") } } scala

python - How to ensure that script only executes subsequent methods after subprocess.Popen has completed execution -

python - How to ensure that script only executes subsequent methods after subprocess.Popen has completed execution - i'm running problems here trying utilize subprocess.popen. cannot utilize subprocess.call script i'm writing because i'd able specify environment execution, can in popen through argument method. i've noticed subprocess.popen takes longer finish subprocess.call, , creates problems downstream in script because rest of script relies on exit code (return code) spawned process decide (through set of conditional if statements) on suitable action. the method involves using subprocess is: def execute_local(self): ''' spawns test execution process locally , directs standard output , error streams process appropriate log files. ''' self.return_code = subprocess.popen(args = self.cmd_string, stdout = open(self.out_log_filepath, 'w'), stderr = open(s...