Posts

android - Fire iblazr programmatically -

how fire iblazr programmatically? no api can find, they're not responding inquiry. i'm looking solution iphone , android. since have enable flash device media volume @ max, suspected must have volume output triggers it. so, plugged in, started music player, , started flashing music part. turning down volume stopped flashing , turning caused led again start flashing. based on assume have output loud audio clip turn on while media volume set max. update: after experimenting on theory, device have (iblazr compatible 16 led chinese version), frequency of tone key , determines brightness. using windows api beep(frequency, duration) function, light first turns on @ frequency of 6500 , gets brighter frequency increases. seems pretty bright @ 7000!

Jquery .off vs dojo? -

what equivalent of jquery $.off(event) remove event on element passing event name in dojo? i tried : dojo.disconnect(handle) // dont have handle event how handle or there better way to it? there no out of box solution far know of, have implement 1 yourself. however, dangerous feature, if disconnect event handlers of specific type. however, use dojo/aspect module intercept calls dojo/on module, example: aspect.around(arguments, 0, function(original) { on.signals = [ ]; return function(dom, name, handler) { console.log(arguments); on.signals.push({ signal: original.apply(this, arguments), name: name }); }; }, true); i didn't find proper way put aspect around function itself, rather function wrapped inside object. used dirty trick , used arguments array , because on module first argument, put aspect around dojo/on reference. what happens when bind event handler using dojo/on , save inside a...

python - pandas: groupby and unstack to create feature vector for classification -

i have pandas dataframe displaying users' performance on test questions. looks this: userid questionid correct ------------------------------- 1 1 1 1 5 1 1 6 0 1 8 0 1 10 1 2 3 1 2 5 1 2 6 0 . . . . . . . . . i want make feature vector each user saying whether or not got each question right, looks this: questionid 1 2 3 4 5 6 ... userid ------------------------------------------------- 1 1 nan nan nan 1 0 ... 2 nan nan 1 nan 1 0 ... . ... . ... . each user gets shown subset of questions, it's sparse matrix. how can make above table in pandas? i wanted below - grouping us...

Is there an ABI compatibility issue if part of the code of a C project is rewritten in C++, but with the same API left out? -

for shared library project written in c, if rewrite part of code in c++, same apis kept, have abi compatibility issues? if keep same api (function names , parameter types) should go. what will need wrap header files (copy & pasted here ) : #ifdef __cplusplus extern "c" { #endif // of legacy c code here #ifdef __cplusplus } #endif this makes sure c++ compiler doesn't mangle names, c compiler's extern symbols can still linked against exports.

php - Server side varification after client side done -

suppose have login form 2 form elements i.e username , password. in client side verification not set required option in username. target after make client side verification want varify server side through ajax, username field verified in server side,if username blank php check , response json. want parse data , show validation error , show if login authentication error message different div element in login form. not this. please me issue. $(document).ready(function(){ // initialize validator , add custom form submission logic $("#loginform").validator().submit(function(e) { var form = $(this); // client-side validation passed if (!e.isdefaultprevented()) { $.ajax({ type: "post", url: "process.login.php", data: $('#loginform').serial...

Will performance vary depends on 32bit/64 bit IEDriverServer in selenium webdriver -

for ie10,with iedriverserver 2.42.0(64 bit) sendkeys command executed slow(almost taking 3-4seconds type each character).i tried 32 bit iedriverserver 2.42.0.the problem got resolved. wanted know,whether there performance issue if use 32 bit version instead of 64 bit.my machine 64bit windows 7. i use ie9 , there big difference between 32bit , 64bit drivers versions. far remember due javascript handling introduced in 32bit. anyway should ok ie10 not - there performance issue reported here btw:try paste string or use javascriptexecutor set element's value in case longer strings instead of using sendkeys. should faster.

c# - Replace a Word, but Only on a Specific Line -

in application have replace words text appears more 1 line.my text is most at-home desensitizing toothpastes work numbing nerve , masking pain traditional potassium iron-based toothpastes in form of potassium nitrate, potassium citrate. i want replace "potassium" in 3rd line "" only.my code is string text = t.replace("potassium", ""); the problem word removed lines. how replace 1 word paragraph specific line ? let's first @ regex ( demo here ). can change parameters programmatically. this regex targets first potassium on third line: (?<=\a(?:[^\r\n]*\r?\n+){2}[^\r\n]*?)potassium this replaces bromide : replaced = regex.replace(yourstring, @"(?<=\a(?:[^\r\n]*\r?\n+){2}[^\r\n]*?)potassium", "bromide"); to replace potassium on third line, use \g : (?<=\a([^\r\n]*\r?\n+){2}[^\r\n]*?|\g[^\r\n]*?)potassium with parameters: replacing word on line to replace word someword on line...