Posts

jquery selected options from one to another -

in following multiple select box when clicked on change button want populate selected items in id="p_prod " display in id="s_prod" , remove them in p_prod , on click of revert want them removed s_prod , repopulate them in p_prod in same order earlier ..how this <select size="10" multiple="multiple" id="p_prod"> <option value="1">prod1</option> <option value="2">prod2</option> <option value="3">prod3</option> <option value="4">prod4</option> </select> <select mulitple="multiple" id="s_prod"> </select> <input type="button" id="change" value="change" onclick="val();"/> <input type="button" id="revert" value="revert" onclick="val();"/> function val() { $('#p_prod...

c# - Get checksum of files contained in a MSI package -

is possible programmaticaly (c#) obtain hashsum of files contained in msi package using microsoft.deployment.windowsinstaller or microsoft.deployment.windowsinstaller.package dlls? i getting files using method: how can resolve msi paths in c#? and not extract files onto fs, hashsum of files using c# code. is possible? windows installer contains msifilehash table . gets populated @ build time 128-bit hashes of files in file table. installpackage files property brings dictionary of of installpathmap objects. keys of collection have file key file table , can used query msifilehash hash. if need calculate hash of installed file comparison against stored hash, installer class found in microsoft.deployment.windowsinstaller has getfilehash method class underlying msigetfilehash function .

c# - Restore value in NumericUpDown -

i have numericupdown. when user changes value, show messagebox confirm. if user selected yes, well. if user selected no, want restore original value. i have run 2 problems: q1. how original value. store in private member variable, updated when user selects yes. know if there better way. q2. changing value original value again triggers event handler. have put if condition handle that. here current code: if (mnumericupdownvalue != mreactantnumericupdown.value) { bool change = !mismodified; if (mismodified && reportchangewarning()) { change = true; } if (change) { mreactantgroup = (int)mreactantnumericupdown.value; clearuservalues(); updatecontrols(); } else { mreactantnumericupdown.value = mnumericupdownvalue; } } if binding value prevent changing number @ until user confirms. write property this: private int _testnumber; public int testnumber { { retur...

grails - Spring Security Reauthentication with Persistent Logins -

i using grails spring security core persistent logins. thus, login information of user stored in database. problem following case: a user logged in , username change x y. means have reauthenticate user with: springsecurityservice.reauthenticate y remembermeservices.loginsuccess(request, response, springsecurityservice.authentication) in database username persistent token remains x. how can set new entry persistent token new username y? you should find existing database entry user. can done username. can set new database entry persistent token remembermeservices.loginsuccess. finally, have reauthenticate user.

java - How can read text file from position -

i'm trying develop application can read files. don't know how can change position of reader pointer, please? for(int i=0; i<tab.length; i++){ char cbuf[] = new char[tab[i]]; try { inputstream ips=new fileinputstream(fichier); inputstreamreader ipsr=new inputstreamreader(ips); bufferedreader br=new bufferedreader(ipsr); //i need change position of pointer here br.read(cbuf, 0, tab[i]); tabs[i] = new string(cbuf); system.out.println(tabs[i]); br.close(); } catch (exception e){ system.out.println(e.tostring()); } } the read command lets take in next character. use loop take in characters // reads , prints bufferedreader int alength = 10; int array[] = new int [alength]; int value = 0; int index = 0; while((value = br.read()) != -1 && index < alength) { array[index++] = value; }

c++ - Qt, Dynamic allocation of memory -

i have little question: made little program every time user click on qpushbuton new object created pointer, here code: ajoute *az = new ajoute; qvboxlayout *layoutprincipal = new qvboxlayout; the problem every object have been created have same name if want delete object there have error ? p.s : sorry bad english, i'm french the problem every object have been created have same name if want delete object there have error? it seems creating group of dynamically allocated objects , don't know how store pointers. simplest way use qvector<ajoute*> , store dynamically allocated objects: qvector<ajoute*> v; now whenever create ajoute do: v.push_back( new ajoute ); that add pointer @ end of vector (container). can access them in order doing: v[0]; // first v[1]; // second v[2]; // third and can delete them as: delete v[0]; // example just remember delete pointer inside vector well: v.remove(0);

ios - Labels not appearing after clicking cell -

i'm still new programming. i'm doing final project ios dev class , build basic app. i've been trying figure out how complete few days , it's 1 problem after other. pressed time since due tomorrow. app supposed show list of chevy cars , picture next each car name. takes place in table view controller. problem lies when click cell. labels information of car blank. example, have label says "horsepower," , next it, supposed display actual horsepower of car. instead of displaying actual horsepower, displays blank label. there missing? there way can show guys code used? have '1" reputation. any appreciated. this tableviewcontroller: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cartablecell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath]; cell.textlabel.t...