Posts

plugins - Toolbar button that injects HTML in Internet Explorer -

i'm building browser extension internet explorer. goal have user able click toolbar button , inject html on site user might visiting @ moment. my class implementing iolecommandtarget , iobjectwithsite , have managed toolbar button showing adding info registry, cannot access html document can manipulate it. debugging have shown first end in iobjectwithsite.setsite method , iolecommandtarget.exec method. if implement solution bho can subscribe webbrowser events in setsite method when try same thing in exec method cast webbrowser fails. how build small , simple extension? toolbar.h ccomqiptr<iwebbrowser2, &iid_iwebbrowser2> m_spwebbrowser2; toolbar.cpp stdmethodimp toolbar::setsite(iunknown *punksite) { hresult hr; ccomqiptr<iserviceprovider> sp = punksite; if(!m_spwebbrowser2 && sp) { //bho eotjiman toolbar not obtained through queryservice. sp->queryservice(iid_iwebbrowserapp, iid_iwebbrowser2, (void**)...

asp.net mvc - get new inserted ID in MVC Controller to jQuery -

i updating entity inside controller follows :- [httppost] public actionresult create(project project) { //var model = new compositeimagemodel(0); if (modelstate.isvalid) { //var model = new compositeimagemodel(project.projectid); db.projects.add(project); db.savechanges(); viewbag.projectid = project.projectid; return redirecttoaction("index"); } return view(); } and wish grab new id "viewbag.projectid" inside jquery ajax code :- onsavebegin: function () { //code save begin $('#imagelist').fadein('slow'); $("#imagelist").click(function () { $("#imagelist").load("/file/imageupload/222"); }); }, instead of hardcoded "222". how can it? thanks , time ** * ** * **** update * ** * ** * ** * ** * ** * ** * ** * ** * *** have updated jquery follows :- <script type="text/javascript"> $(document).ready(function () { var imagelist = $(...

tooltip - jQuery Select the next element using a selector -

i know can use .next() find next element of given one. however, situation forces me use selector. i'm using jquery tools build tooltips of table, each "td" having 2 elements: link , tooltip div. goal display tooltip when mouse hovers on link. according html, it's placed right after link need select "the next element". html looks like: <tr> <td><a href="#" id="td1">title</a> <div class="tooltip"> <h1>tooltip title</h1> <p>a detailed descritpion</p> </div> </td> </tr> <tr> <td><a href="#" id="td2">title</a> <div class="tooltip"> <h1>tooltip title</h1> <p>a detailed descritpion</p> </div> </td> </tr> <!-- more rows --> unfortunately, cannot use .next() here since tooltip() function accepts selector string argu...

c++ - Suspend process after a specific child process is started -

i have loader.exe starts process using createprocess(..) process starts after while process b. i suspend process , process b when b started process a. how can wait b? notified or have poll until process there? at runtime know name of process b , know b started process a. thanks use boost interprocess library . of special interest mutexes, conditions, , semaphores.

collections - Mongodb Java MapReduce getOutputCollection -

i don't know outputtypes. i'm trying this: output=collection.mapreduce(map,reduce,null, mapreducecommand.outputtype.inline,null); collection=output.getoutputcollection(); but collection null, because of inline output type. need reduced collection because need reduce further. how this? i found solution :d works output=collection.mapreduce(map,reduce,"mymap",mapreducecommand.outputtype. reduce,null); collection=output.getoutputcollection(); note cannot store in same target "mymap" again , again. have use different name when looping "mymap".concat(integer.tostring(i))

How to completly kill/remove/delete/stop an AsyncTask in Android -

i made app downloads videos our server. issue is: when cancel downloading call: myasynctask.cancel(true) i noticed, myasynctask doesn't stops on calling cancel... progressdialog still goes , jumping status status showing me each time cancel , start again asynctask clicking download button, new asynctask starts... each time click download.. cancel, again download separate asynctask starts. why myasyntask.cancle(true) not cancelling task ? don't want anymore on background. want shut down if click cancel. how ? e d t: thanks gtumca-mac, , others helped me did by: while (((count = input.read(data)) != -1) && (this.iscancelled()==false)) { total += count; publishprogress((int) (total * 100 / lenghtoffile)); output.write(data, 0, count); } thanks!!! asynctask not cancel process on myasyntask.cancel(true) for have stop manually. for example downloading video in doinbackground(..) in while/for loop. protected long doin...

java - How to make a delayed non-blocking function call -

i want call add function of hashset delay, without blocking current thread. there easy solution achieve this: utils.sleep(1000, myhashset.add(foo)); //added after 1 second //code here runs without delay ... you can use scheduledthreadpoolexecutor.schedule : scheduledthreadpoolexecutor exec = new scheduledthreadpoolexecutor(1); exec.schedule(new runnable() { public void run() { myhashset.add(foo); } }, 1, timeunit.seconds); it execute code after 1 second on separate thread. careful concurrent modifications of myhashset though. if modifying collection @ same time different thread or trying iterate on may in trouble , need use locks.