Posts

.net - Accessing properties between calls using NSIS CLR.dll -

i writing installer using nsis needs parse block of json. to achieve hoping able call .net dll parse json , in nsis script call properties on class retrieve data need. however, appears nsis clr.dll has problem state of class not maintained between calls. my test .net class follows: namespace nsistestdll { public class testclass { private bool _configured; public void configure() { _configured = true; } public string name { { if (_configured) { return "john doe"; } return "unconfigured"; } } } } and part of nsis script calls is: file "nsistestdll.dll" clr::call /nounload "nsistestdll.dll" "nsistestdll.testclass" "configure" 0 clr::call /nounload "nsistestdll.dll" "nsistestdll.testclass" get_...

Efficient way to run multiple scripts using javax.script -

i developing game i'd have multiple scripts implement same structure. each script need run in own scope code doesn't overlap other scripts. example: structure.js function oninit() { // define resources load, collision vars, etc. } function onloop() { // every loop } function clickevent() { // clicked me } // other fun functions now, lets have: "badguy.js", "reallyreallybadguy.js", "otherbadguy.js" - above in terms of structure. within game whenever event takes place, i'd invoke appropriate function. the problem comes down efficiency , speed. found working solution creating engine each script instance (using getenginebyname ), doesn't seem ideal me. if there isn't better solution, i'll resort each script having own unique class / function names. i.e. badguy.js var badguy = new object(); badguy.clickevent = function() { } i don't think need create new scriptengine every "guy". ca...

asp.net - Filter IList<T> -

list<paymenttype> paymentoptions = _paymentmethods; _paymentmethods public property , i'd filter copy of , store in variable paymentoptions list<int32> noinvoice = new list<int32>(){ 16, 4 , 6 }; foreach (paymenttype pt in paymentoptions) { if(noinvoice.contains(pt.id)) { paymentoptions.remove(pt); break; } } but if run second time, variable _paymentmethods not contain removed item anymore. it seems go reference instead of value... prefer not copy list array should use linq or there other way? edit: have now: list<paymenttype> paymentoptions = shopcontroller.currentshop.paymentmethods; list<paymenttype> paymentoptionsfiltered = new list<paymenttype>(); if (havetofilter) { list<int32> noinvoice = new list<int32>() { 16, 4, 6 }; foreach (paymenttype pt in paymentoptions) { if (!noinvoice.contains(pt.id)) { paymentoptionsfiltered.add(pt); ...

exchangewebservices - Exchange Webservices Managed API - using ItemView.Offset for FindItems() hits performance of LoadPropertiesForItems method -

i'm doing little research on possible application of ews in our existing project written heavy use of mapi , found out disturbing performance of loadpropertiesforitems() method. consider such scenario: we have 10000 (ten thousands) messages in inbox folder we want approximately 30 properties of every message see if satisfy our conditions further processing messages retrieved server in packs of 100 messages so, code looks this: itemview itemsview = new itemview(100); propertyset properties = new propertyset(); properties.add(emailmessageschema.from); /* add necessary properties... */ properties.add(emailmessageschema.sensitivity); finditemsresults<item> findresults; list<emailmessage> list = new list<emailmessage>(); { findresults = folder.finditems(itemsview); _service.loadpropertiesforitems(findresults, properties); ...

Is making simple website in "java spring hibernate" is overkilling -

initially php programmer , using joomla build websites . build websites in joomla in few days. i learning java spring hibernate last 3 months , have build simple user registration logins , members area using spring mvc , hibernate annotation etc. now want ask whether onwards should use spring mvc build site because have learned or me in future. because still feel same site can build in few days in php is case in future can come on same level php can build simple site in java in few days or no matter experience have java still going take longer php always can java cms make life easier because want bye php. mean if want make 5 page portfolio website can build in java cms in 1-2 days if "simple website" mean normal page categories, articles , navigation (i.e. not web-application), yes: building grounds java + spring + hibernate overkill (i.e. low-level tools, you'd have build lot yourself). i'd stick tools built specific task, namely kind of cms s...

java ee - Deploying war issue with spring frame work -

i getting exception when trying deploy project on linux machine, using spring , hibernate framework project. following error in catalin.out using catalina_base: /usr/share/tomcat5 using catalina_home: /usr/share/tomcat5 using catalina_tmpdir: /usr/share/tomcat5/temp using jre_home: created mbeanserver id: oovd91:gmddgare.0:leeginweb1.inetu.net:1 using catalina_base: /usr/share/tomcat5 using catalina_home: /usr/share/tomcat5 using catalina_tmpdir: /usr/share/tomcat5/temp using jre_home: created mbeanserver id: onrubt:gmddgel2.0:leeginweb1.inetu.net:1 11-apr-11 8:21:38 org.apache.catalina.core.aprlifecyclelistener lifecycleevent info: apache tomcat native library allows optimal performance in production environments not found on java.library.path: /usr/lib/gcj-4.1.2 11-apr-11 8:21:38 org.apache.coyote.http11.http11baseprotocol init info: initializing coyote http/1.1 on http-8080 11-apr-11 8:21:38 org.apache.catalina.startup.catalina load info: initialization ...

jsf - Using Properties from ResourceBundle in ManagedProperty -

i have jsf validator i'm building has properties in have loaded resourcebundle. however, i'm not quite sure how work this, isn't loading properly. ideas on how can make work? i've tried using @postcontruct it, i'm getting following error in eclipse: access restriction: type postconstruct not accessible due restriction on required library /system/library/java/javavirtualmachines/1.6.0.jdk/contents/classes/classes.jar so, i'm not sure best way work this. sample of i'm talking below... the validator... @facesvalidator("usernamevalidator") public class usernamevalidator implements validator { @managedproperty(value="#{props_usernamepattern}") private string usernamepattern; @managedproperty(value="#{props_minusernamelength}") private int minusernamelength; @managedproperty(value="#{props_maxusernamelength}") private int maxusernamelength; public void validate(facescontext ...