Posts

asp.net mvc 4 - ViewModel List object return Null on HTTPPost -

i posting form server, values null. model: public class rdetailsviewmodel { public rdetailsmaster rdetailsmaster { get; set; } public etransaction etransaction { get; set; } } public class rdetailsmaster { [required] public list<qe_dropdown_mst> master_eq { get; set; } [required] public list<qe_dropdown_mst> master_basis { get; set; } [required] public list<qe_dropdown_mst> master_te { get; set; } [required] public list<qe_dropdown_mst> master_alop { get; set; } [required] public list<qe_dropdown_mst> master_risk { get; set; } [required] public list<qe_dropdown_mst> master_excess { get; set; } [required] public list<qe_dropdown_mst> master_ctype { get; set; } } controller: [httppost] public actionresult rdetails(rdetailsviewmodel objr) { return view(); } my view : @model qms_erater.viewmodels.rdetailsviewmodel @{ viewbag.ti...

javascript - Fulling updating setState in reactjs -

in reactjs docs setstate : setstate() not mutate this.state creates pending state transition. accessing this.state after calling method can potentially return existing value. the second (optional) parameter callback function executed once setstate completed , component re-rendered. what if wanted update state, create callback nothing? the callback optional can this.setstate({ key: value }); .

java - properly using constructors to change int value? -

i have 2 classes. 1. main , 2. gun. gun: public class gun { private int ammoamount = 15; public int getammoamount() { //i believe allows me see value of ammoamount , use in main class. return ammoamount; // returns value of ammoamount getammoamount? } public gun(int ammousage) { //this constructor right? ammoamount = ammoamount - ammousage; //method makes ammoamount decrease ammousage. } public void newammoamount() { system.out.println("you have " + ammoamount + " bullet(s) left."); // output of how bullet left. } } main: import java.util.random; public class main { public static void main(string[] args) { random rand = new random(); gun fire1 = new gun(0); // need create objective? fire1.newammoamount(); // need code below? int clip = fire1.getammoamount(); // need set clip while loop? { //starts loop int x = 5; //max # random can go to. int...

c++ - Error with strtok Function -

in code unhandled expression error when use parse function. in popstack function right way delete last element of vector. error is: unhandled exception @ 0x0f463b50 (msvcr100d.dll) in boost_test.exe: 0xc0000005: access violation writing location 0x00345d49. class stack { public: stack() {globalindex=0; }; std::vector<char*> v; int globalindex; void addstack(char* txt); void parse(); void popstack(); void printstack(); }; void stack::parse() { char* tok; tok = strtok(v[globalindex-1], ";"); while(tok!=null) { cout<<"\nthe time value = "<<tok<<endl; tok = strtok(null, " "); } } void stack::addstack(char* txt) { v.push_back(txt); globalindex++; } void stack::popstack() { v.pop_back(); globalindex--; } void stack::printstack() { std::cout<<v[globalindex-1]<<endl; } int _tmain(int argc, _tchar* argv[]) { int i; ...

javascript - Regular Expression: Convert a numeric string from camelCase to regular -

i need convert alphanumeric string, written in camelcase regular string. input can of following strings: var strs = { input: [ "thisstringisgood", "somethinglikethis", "a123capshere345andherebutnot678here90end", "123capshere345andherebutnot678here90e", "abcacryonym", "xmlhttprequest", "thisdevicehasa3printingservice" ], expectedresult: [ "this string good", "something this", "a123 caps here345 , here not678 here90 end", "123 caps here345 , here not678 here90 e", "abc acryoynm", "xml http request", "this device has a3 printing service" ] }; after converting string expected format i'm doing this: function capsplit(str) { return str.replace(/(^[a-z]+)|[0-9]+|[a-z][a-z]+|[a-z]+(?=[a-z][a-z]|[0-9])/g, function (ma...

GIT utility to generate graph like this? -

Image
i working on assignment, need generate graph of git repository arrows is there utility generate graph this? know gitg, gitk; need utility through can generate graph in same format 1 shown in picture? an answer inside se here . links alias , creating dot file based on git repository pretty add: [alias] graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f" to .git/config. after this, can run , create diagram e.g. git graphviz head~100..head~60 | dotty /dev/stdin (also token link wiki resource). if redirect output dot-file, can manually compile graph on wishes dot or maybe neato. can adjust alias little better formatting (color, shape...) of e.g. nodes.

glib - Building Qemu(ARM emulation) for Windows64 on Linux64 -

i trying run emulation of arm vexpress in qemu. end platform windows64. , build system running linux64. using qemu version 2.3.0 , x86_64-w64-mingw32 toolchain. i faced quite lot of issues during build, solved on own. 1 of them tool chain on installation doesn't contain glib library , had import 1 got searching round internet. after adding pkg-config files , copying set of glib lib folder got whole thing start compiling. how ever facing new issue. checking librt while toolchain doesnt have librt. got version of librt , added toolchain lib folder , compilation throwing below error. @ steps appreciated. make all-recursive making in pixman make[3]: nothing done 'all'. making in demos make[3]: nothing done 'all'. making in test make[3]: nothing done 'all'. chk version_gen.h link qemu-ga.exe /home/user/downloads/mingw/glib/lib/libglib-2.0.a(libglib_2_0_la-gutils.o):(.text+0x505): undefined reference `__imp_cotaskmemfree' /home/user/down...