Posts

c++ - Hang on CreateService when windows is starting -

i register program windows service. when reboot windows, service start_pending forever. after traced, found hung on createservice function. hservice=createservice( hscmanager, pszdrivername, pszdrivername, service_all_access, service_kernel_driver, service_demand_start, service_error_normal, pszdriverpath, null, null, null, null, null); i can resolve problem creating service before rebooting, want know hang happened. have idea? if remember well, services must created once. don't have call createservice function again ever ! , wouldn't recommend create while in windows boot process. as can see in following msdn example, have star...

javascript - Is it possible to save all field information when the user closes his browser? -

e.g. writing article accidently closes browser. possible save wrote? something this: onexit -> information user filled -> ajax request saves information in database. or is possible preemptively saving every x second? my company running ajax query save every 5 seconds, should localstorage saving on client, use onunload save , recover later. i made html5 notepad stores localstorage every onchange event , every 500ms , onbeforeunload save 1 field, easy modify, here's (essential) code: <textarea placeholder="type here, see here..." id="notepad"></textarea> <script> var n = document.getelementbyid("notepad"); /* save */ var s = function(){localstorage.setitem("notepad", n.value);} /* retrieve (only on page load) */ if(window.localstorage){ n.value = localstorage.getitem("notepad");} /* autosave onchange , every 500ms , when close window */ n.onchange = s(...

Recommendation for database for a search engine -

i writing search engine looking database store crawled datas used urldatabase , data store. it should disk based not memory based java preferable because application in java can embedded it. salable preferred linux , windows. take @ hadoop , hbase http://hadoop.apache.org/ http://hbase.apache.org/

wpf - Clipping from left rather than right when there isn't enough room for a child element? -

i have grid 3 columns of width *, auto, *. when collapse grid width using expander, want central column remain fixed size. want right hand column begin clipping right hand edge. default behaviour, , works fine. however, first column clip left-hand side. say, i'd left-hand edge of column become hidden first. left-hand column, clipping right-hand edge. hope i've explained enough! thanks you need set horizontalalignment="right" , ="left" appropriately. here's example, may not match requirements exactly, clips left , right require: <grid> <grid.columndefinitions> <columndefinition width="*"/> <columndefinition width="auto"/> <columndefinition width="*"/> <columndefinition width="auto"/> <columndefinition width="auto"/> </grid.columndefinitions> <textblock grid.column="0...

c++ - Properly print utf8 characters in windows console -

this way try it: #include <stdio.h> #include <windows.h> using namespace std; int main() { setconsoleoutputcp(cp_utf8); //german chars won't appear char const* text = "aäbcdefghijklmnoöpqrsßtuüvwxyz"; int len = multibytetowidechar(cp_utf8, 0, text, -1, 0, 0); wchar_t *unicode_text = new wchar_t[len]; multibytetowidechar(cp_utf8, 0, text, -1, unicode_text, len); wprintf(l"%s", unicode_text); } and effect ascii chars displayed. no errors shown. source file encoded in utf8. so, i'm doing wrong here ? to wouterh: int main() { setconsoleoutputcp(cp_utf8); const wchar_t *unicode_text = l"aäbcdefghijklmnoöpqrsßtuüvwxyz"; wprintf(l"%s", unicode_text); } this doesn't work. effect same. font of course lucida console. third take: #include <stdio.h> #define _win32_winnt 0x05010300 #include <windows.h> #define _o_u16text 0x20000 #include <fcntl.h> using namespace std; int...

image viewer - ImageViewer in WPF -

hi implement imageviewer (like 1 in facebook example) in wpf application i have listbox whith pictures, works well. add pop "image full size" when user double click on 1 of them. (something in fb, fade out of background etc). i'm thinking of use window...do have better idea of should use ? you use popup control . it comes some built in (but limited) animations, fade , see popupanimation. i'd try , if doesn't fit needs, second bflosabre91 oppionion , use separate opacity animated window. but bear in mind additional window have negative side effects e.g sync window positions correctly, handle task switches (ie. correctly hide window in taskbar/tasklist)

android softkeyboard - To Hide soft keyboard or virtual keyboard on loading the fragment -

there 2 edit text boxes in fragment.whenever fragment loaded activity soft-keyboard appears on screen covering half of tablet screen.i want hide soft keyboard whenever fragment loaded activity.the soft-keyboard should appear on clicking or tapping edit text boxes. padma's comment prevent soft keyboard ever coming in application, doesn't sound want since have edittext's need input somewhere. you close soft keyboard whichever edittext on view when it's loading: inputmethodmanager imm = (inputmethodmanager)getsystemservice(context.input_method_service); imm.hidesoftinputfromwindow(findviewbyid(r.id.your_edit_text).getwindowtoken(), 0);