Posts

c# - XAML:Specified element is already the logical child of another element. Disconnect it first -

Image
i building custom modal box in wpf this i want users add modal children control element xaml using custom modal element. since cannot create child window inside main window. doing indirectly using xaml , c#. here sample code implementing modal mainwindow.xaml <local:modalwindow> <border background="red" width="400" height="400"> <button width="110"></button> </border> </local:modalwindow> mainwindow.xaml.cs class modalwindow : stackpanel { public modalwindow() { stackpanel mygrid = this; this.height = 400; this.width = 400; window mywindow = new mywindow(this); } class mywindow : window { public mywindow(object x) : base() { this.windowstate = windowstate.maximized; this.allowstransparency = true; this.windowstyle = windowstyle.none; this.opacity = 0.7; this.background...

android - HAXM not working on Linux -

here go gingerbread : http://software.intel.com/en-us/blogs/2012/03/12/how-to-start-intel-hardware-assistedvirtualization-hypervisor-on-linux-to-speed-up-intel-android-x86-gingerbread-emulator/ any updates icecream sandwich or kitkat ? helpful answers highly appreciated!! haxm needed on windows , os x. on linux, need have kvm installed. see "configuring vm acceleration on linux" section on: http://developer.android.com/tools/devices/emulator.html#accel-vm just download x86 based system images in sdk manager, start avd, kvm auto-detected , used automatically if machine/system supports it.

jquery - can some one help to show the next div using the same calss -

<span class="s1">show me</span> <div class="show">hello world</div> <span class="s1">show me</span> <div class="show">hello world</div> i tried not working jquery(document).ready(function ($) { $(".s1").click(function () { $(this).next('div').slidetoggle(); }); }); if click s1 thei need show next div i prefer add target selector @ <span> can check demo here

training data - Can we use Tesseract 2.x trained files in Tesseract 3.02 -

i have set of trained files "micr" characters on tesseract 2.04 platform. there way can use same trained data files in tesseract 3.02 version? i've tried use "combine_tessdata" function on available data files, failed. , understand there major api changes going 2.x version 3.x version. i'd thankful know whether have train characters again or there exist method use current trained data files. thank valuable time. the language data between tesseract 2.x , 3.x versions not compatible. have retrain them. box files can reused after adding 6th, page number column.

c# - Autoresize textbox control vertically -

in c# form, have panel anchored sides, , inside, textbox, anchored top/left/right. when text gets loaded textbox, want auto expand vertically don't need scroll textbox (scroll panel @ most, if there more text doesn't fit panel). there way textbox? (i'm not constrained use control if there's control fits description, feel free mention it) i'll assume multi-line text box , you'll allow grow vertically. code worked well: private void textbox1_textchanged(object sender, eventargs e) { size sz = new size(textbox1.clientsize.width, int.maxvalue); textformatflags flags = textformatflags.wordbreak; int padding = 3; int borders = textbox1.height - textbox1.clientsize.height; sz = textrenderer.measuretext(textbox1.text, textbox1.font, sz, flags); int h = sz.height + borders + padding; if (textbox1.top + h > this.clientsize.height - 10) { h = this.clientsize.height - 10 - textbox1....

java - Is this method O(log N) or constant time? -

i have method inserts elements priority queue. want know performance time has. i believe can o(1) if element being inserted can place @ bottom of queue. however, runs on o(log n) time, if element inserted new minimum , percolated way root. is reasoning correct? here method insertion method: /** * insert priority queue, maintaining heap order. * duplicates allowed. * @param x item insert. */ public void insert( anytype x ) { if( currentsize == array.length - 1 ) enlargearray( array.length * 2 + 1 ); // percolate int hole = ++currentsize; for( array[ 0 ] = x; x.compareto( array[ hole / 2 ] ) < 0; hole /= 2 ) array[ hole ] = array[ hole / 2 ]; array[ hole ] = x; } i "no" in answer question "is reasoning correct?" typically o() notation taken indication of worst-case complexity of algorithm. can used average-case complexity, best-case complexity. (see here example when might use it.) have argued ...

File not found on iOS device, but found in Simulator -

when run application on simulator found path of file using following code: { nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *basepath = ([paths count] > 0) ? [paths objectatindex:0] : nil; nslog(@"%@",basepath); } simulator output: file:///users/username/library/application support/iphone simulator/7.0.3/applications/e7816ff6-7e6a-4606-917e-e74cdb574ec8/documents/images/20140306113538.png and same code when run in device found output with: device output: file:///var/mobile/applications/2d86a03f-c239-4b57-849f-019bcdca8543/documents/images/20140306114536.png and when checked, file store in documents. when load url in browser path of simulator(which simulator output) loaded in browser. path of device(which device output) showing error in browser file not found. like: firefox can't find file @ /var/mobile/applications/2d86a03f-c239-4b57-849f-019bcdca8543/documents/imag...