Posts

c# - Determine if window has close button (Or, why isn't GetTitleBarInfo working?) -

i'm trying determine if given window has close button using gettitlebarinfo function, recommended in this answer . when call function return value rgstate[5] - should indicate close button state - 0 , don't understand why. have idea i'm doing wrong here? alternatively, if 1 can suggest method information, helpful well. thanks! [dllimport("user32.dll", exactspelling = true, setlasterror = true)] internal static extern intptr getforegroundwindow(); [dllimport("user32.dll", setlasterror = true, charset = charset.auto)] [return: marshalas(unmanagedtype.bool)] internal static extern bool gettitlebarinfo(intptr hwnd, ref titlebarinfo pti); [structlayout(layoutkind.sequential)] internal struct titlebarinfo { public int cbsize; public rect rctitlebar; [marshalas(unmanagedtype.byvalarray, sizeconst = 6)] public int[] rgstate; } intptr handle = getforegroundwindow(); titlebarinfo titlebarinfo = new titlebarinfo(); titlebarinfo.cbsize = m...

c# - Home Index not loading when the application starts -

i working on asp.net mvc3 application. in views created folder named home , view named index. then created controller homecontroller. in controller added: public actionresult index() { return view(); } but when run application error: the resource cannot found. description: http 404. resource looking (or 1 of dependencies) have been removed, had name changed, or temporarily unavailable. please review following url , make sure spelled correctly. requested url: / if add address bar : /home/index view loads normally. how can make application automatically go home/index when loads? thanks help you need add route global.asax file points path. routes.maproute("default", "{controller}/{action}/{id}", new { controller = "home", action = "index", id = urlparameter.optional } );

lambda - Java 8 Pattern Matching? -

will java 8 support pattern matching scala , other functional programs do? i'm putting presentation of java 8's lambda features. can't find on particular functional-programming concept. i remember got me interested in functional programming quicksort implementation, compared imperative programming's implementation. i suppose not talking pattern matching in sense of applying regular expression on string, applied in haskell . instance using wildcards: head (x:_) = x tail (_:xs) = xs java 8 not support natively, lambda expression there are, however, ways so, computing factorial: public static int fact(int n) { return ((integer) new patternmatching( incaseof(0, _ -> 1), otherwise( _ -> n * fact(n - 1)) ).matchfor(n)); } how implement find more information in blog post: towards pattern matching in java .

connect forms through php and primary key -

i'm trying connect forms using 1 of inputs form of primary key. for example, ---first form primary key taken form1.php ---second form, page1 based on input form1 form2.php?page1=primary key ---third form, page1 based on input form2 form3.php?page2=primary key ---fourth form, page2 page1 form4.php?page3=primary key ---fourth form, page3 page2 and on, until last page. question how connect them? how retrieve primary , pass on form involved? far can pass primary key form2, when reaches form3, disappears. by way, after each form accomplished, proceeds process page. ---below code sample form <form id="form1" name="form1" method="post" action="eval_2.php"> <table width="100%" border="0" cellpadding="2" cellspacing="0"> <tr> <td width="70%"> <strong>1. quality of work </strong><b...

switch statement - javascript case not delivering proper value -

i setup case statement convert full state name short value html dropdown. (yes seems redundant, have multiple data sets coming in , must) here case statement var state_switch; //document.write(temp[1]); var state_case = temp[1]; //document.write("state ="); //document.write(state_case); switch (state_case) { case "alabama": state_switch="al"; break; case "alaska": state_switch="ak"; break; case "arizona": state_switch="az"; break; case "arkansas": state_switch="ak"; break; case "california": state_switch="ca"; break; case "colorado": state_switch="co"; break; case "connecticut": state_switch="ct"; break; case "delaware": state_switch="de"; break; case "district of columbia": state_switch="dc"; break; case "florida": state_switch="fl...

java - Get focus on a JTextField from another panel when a CardLayout changes -

hi need on swing application doing. have dialog 2 panels, first panel has cardlayout , second has flowlayout. first layout has buttons change card layout , buttonclick entered specific textfield on second panel. every time card layout changes, textfield on second panel loses focus. how focus of specific textfield of second panel? when clicking on button go anohter panel write code inside "actionperformed" of button actionperformed(actionlistenet al) { //code.. textfield.requestfocus();//what textfield u wnat } refer link setting focus text field

Azure Website missing msshrtmi when built on and deployed from TFS -

i'm trying deploy azure websites (preview) tfs (preview). build works , website deployed when code tries access azure roleenvironment website throws following exception: could not load file or assembly 'msshrtmi, version=1.7.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified. i've tried solutions proposed in following thread no luck. think has tfs. i have tested this: reinstalled azure sdk , tools removed platformtarget projectfiles wrote post-build event delete msshrtmi.dll targeted assemblies x64 (-> failed unit tests on tfs, seems x86, if allowing x64 in .testsettings) could not load file or assembly 'msshrtmi' or 1 of dependencies (azure table storage access) i've ran out of ideas on how troubleshoot issue? have suggestions? i've encountered similar issue in earlier versions of sdk when doing builds. solution wasn't entirely intuitive. if go thr...