Posts

jquery - ASP.Net MVC - updating areas of page based on drop down lists -

i have product page has 3 x drop down lists allow visitor select product attributes - example pair of trousers colour / waist size / leg length. currently have drop downs hooked cascading use of jquery , json - each selection populates next drop down list down hierarchy calling jsonresult action via jquery within page. when selections made, , visitor has decided upon product variant, need update page contents - elements such price / image / stock availability / long description , table of specifications can product variant specific. these page elements need change distributed throughout markup rather being in 1 block complicate matters little. currently page (view) has these elements within main view - best way achieve changing page reflect visitors choice? this webforms app made use of several updatepanels achieve same thing, relative mvc newbie i'm not sure of approach tackle kind of problem? thanks. basically have 3 major options: display prerendered vi...

c# - ASP.NET Build Error : The type exists in both dlls -

while building project, got below error message. the type 'tracker_ascx' exists in both 'appdata\local\temp\190\temporary asp.net files\root\web_tracker.ascx.7a9a6bd4.fnv2mhdj.dll' , 'appdata\local\temp\190\temporary asp.net files\root\web_tracker.ascx.7a9a6bd4.pxdl7dxj.dll'. the application runs in .net framework 4.0 this happend because may have reference of old dlls if u added new version. clean solution , rebuild it.

collections - Polymorphism in Java -

why uses polymorphism in java while using collections. what difference between these initializations. private list<order> orderlist = new arraylist<order>(); private arraylist<order> orderlist = new arraylist<order>(); in second form, orderlist can treated arraylist<order> or inheriting arraylist<order> . in first form, orderlist treated list<order> , recommended when use functionality defined list<t> interface. way code more flexible , can refactored (e.g. realize need linkedlist<t> instead, change initialization , of code not need changed). also, helpful code refactoring use interfaces instead of actual types, if possible (e.g. use parameters of type list<t> instead of arraylist<t> ), because allows caller change list type without changing in called function.

C++ what is the difference between static and dynamic declaration internally -

i have 2 codes: normal: int* p[5]; (int i=0;i<5;i++){ int s = rand()%25; p[i]=&s; } dynamic: int* p[5]; (int i=0;i<5;i++){ int* s = new int; *s = rand()%25; //edit: typo, didn't want make random pointer p[i]=s; } now if print array p, p[i] first , then: *p[i] after it, get: static dynamic 0x22ff04 7 0x22ff30 7 0x22ff04 7 0x22ff24 14 0x22ff04 7 0x22ffa6 2 0x22ff04 7 0x22ff89 8 0x22ff04 7 0x22ff13 21 now why elements in p pointing @ same location normal declaration while in dynamic declaration there multiple objects created? why this? in first case, entries point s , left dangling moment s goes out of scope. dereferencing p[i] leads undefined behaviour. in second case, each entry points separate heap-allocated object. here, there's no undefined behaviour (but there's memory leak).

pass data from java to python and back jython -

i using jython run python script java. able send data python script command line arguments when invoke script using pythoninterpreter . now want call java method within jython script, passing list method argument. how do that? i posting code both passing of data java -> python , python -> java. hope helps !! in this, string array "s" passed python script , python, "city" list passed python java through function call getdata(). javaprog.java: import org.python.core.pyinstance; import org.python.util.pythoninterpreter; public class javaprog { static pythoninterpreter interpreter; @suppresswarnings("resource") public static void main( string gargs[] ) { string[] s = {"new york", "chicago"}; pythoninterpreter.initialize(system.getproperties(),system.getproperties(), s); interpreter = new pythoninterpreter(); interpreter.execfile("pyscript.py"); pyinstance hello =...

javascript - Nodejs mongodb fetching document size without actually fetching cursor -

my question is, how can cursor size (in kbs) without fetching ? i've examined lot of question such here don't want fetch query result learn how kb it. i want like: var mongoclient = require('mongodb').mongoclient, test = require('assert'); mongoclient.connect('mongodb://localhost:27017/test', function(err, db) { var collection = db.collection('simple_query'); // insert bunch of documents testing collection.insertmany([{a:1}, {a:2}, {a:3}], {w:1}, function(err, result) { test.equal(null, err); collection.find(/**some query*/).size(function(err, size) { test.equal(null, err); test.equal(32111351, size); // in bytes or kilobytes whatever db.close(); }); }); }); something this? var avgsize = db.collectionname.stats().avgobjsize; // ... collection.count(/* query */, function(err, count) { var approximatesize = count*avgsize; // work simple database models } i know not perfect,...

c# - .NET: class definition explanation -

i understand basic inheritance , understand basics of generics. but not understand class definition: public class exportcontroller : abstractfeedcontroller<iexportfeed> the exportcontroller inherits abstractfeedcontroller ... but, <iexportfeed> do/mean? generics? yes, generic definition. in short, abstractfeedcontroller defines generic implementation can applied various types including iexportfeed in case. look @ definition of class abstractfeedcontroller , see class abstractfeedcontroller<t>{ ... in class see type t used multiple times. whenever see t , can swap in mind type think can apply. in class definition, might see where t : ... . condition on type t , limiting kind of types class can use. read this msdn article in-depth explanation.