Posts

Why jQuery .data() function is not accessing HTML5 camel-case data attribute -

i have button in web page: <button class="slidetoggle" data-slidetoggle="slider">slidetoggle</button> when button clicked trying access data stored inside data-slidetoggle attribute useing following code, nothing. $('body').on('click', '.slidetoggle', function(){ alert($(this).data('slidetoggle')); }); but works when use: alert($(this).attr('data-slidetoggle')); this problem occurs when use camel-case data attribute. new html5 , jquery , can not figure out going wrong it. all previous answers miss 1 thing: can work existing html structure. consider this: $('body').on('click', '.slidetoggle', function(){ alert($(this).data('slidetoggle')); // wait, what? }); to understand happens here, it's crucial check following lines in jquery source code : name = "data-" + key.replace( rmultidash, "-$1" ).tolowercase(); data = elem.get...

PHP Difference of two assoc Arrays -

i have 2 arrays of assoc arrays: first one: array ( [0] => array ( [24] => s [23] => czarny ) [1] => array ( [24] => m [23] => czarny ) [2] => array ( [24] => l [23] => czarny ) ) and second: array ( [0] => array ( [24] => l [23] => czarny ) [1] => array ( [23] => czarny [24] => m ) ) in output get: array ( [24] => s [23] => czarny ) because 2 of arrays: [0] => array ( [23] => czarny [24] => m ) and [0] => array ( [24] => m [23] => czarny ) are same me. have idea how deal that? tried fourth nested foreach got confused.. this little loop crazy, work. $array1[0][23] = ...

c++ - Eigen elements manipulation without loop -

i want check if elements of matrix smaller 0 want assign 0 them, in matlab done using this: ind = find(floatframe < 0); floatframe(ind) = 0; is there equivalent eigen matrices? you can use select function , similar ternary ?: operator in c. example: floatframe = (floatframe < 0).select(0, floatframe)

unix - commandline output lines that are specified in another file -

iam searching command line takes text file , file line numbers (one on each line) (alternatively stdin) , outputs lines first file. the text file may several hundreds of mb large , line list may contains several thousands of entries (but sorted ascending) in short: one file contains data another file contains indexes a command should extract indexed lines first file: many lines of course different , contain important data ... more lines ... more lines second file 1 5 7 expected output many lines more lines more lines the second (line number) file not have exist. data may come stdin (in deed optimum). format of data may vary shown if make task easier. this can approach: $ awk 'fnr==nr {a[$1]; next} fnr in a' file_with_line_numbers file_with_data many lines more lines more lines it reads file_with_line_numbers , stores lines in array a[] . reads other file , keeps checking if line number in array, in case line printed. the trick use...

google app engine - How often should you backup appengine HRD data -

we have appengine app, has 300gb of data in hrd.. performed full backup google-cloud-storage every night. has become costly, costing 100 dollar per day. i moved backup once per week. since data in hrd (high replication datastore)... there need backing data? we cannot afford losing data of more day. thats why did daily backup. costs 100 dollar per day. regarding hrd, iare backups needed? recommend. i know business question too, has technical aspects. data stored in hrd replicated in various regions, there no need perform backups, unless you're afraid data can modified / deleted via app or developers console.

gridextra - R: Wrap text within grid.table when string exceeds set length -

i using grid.table within gridextra package display list of survey comments in table format. when comments(string variable) exceeds given length want automatically insert line break "\n". library(gridextra) df<-data.frame(comments = c("here short string", "here long string needs broken in half doesn't run off page", "here short string")) grid.newpage() print(grid.table(df$comments)) i open using different table package if feature available elsewhere. you can use strwrap, d = sapply(lapply(df$comments, strwrap, width=50), paste, collapse="\n") grid.table(d)

java - Remove log debug displaytag -

in application java use library displaytag version 1.2. when execute application, it's appears: 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) 10:50:09.258 [http-8080-1] debug org.displaytag.tags.tabletag - [objeto] first iteration=false (row number=82) how remove because not necessary show debug log. in application , have logging.properties: handlers = org.apach...