Posts

haskell - Implicit pattern matching the first 2 items of a list -

is there way in implicit way: (originalpath:extractpath:ignoredargs) <- getargs considering need first 2 args , ignore others anyway. this curiosity/exploring/learning question (just started haskell), ignoredargs not harm if it's left this. i tried (originalpath:extractpath) <- getargs but fails since extractpath of [string] type (instead of string ) use wildcard, _ (originalpath:extractpath:_) <- getargs to ignore after first 2 arguments. you need have there have 2 names bound string s, , wildcard pattern (underscore) way tell compiler , human readers of code not interested in further arguments.

installation - How do I force Inno Setup to make the 'uninsneveruninstall' flag retroactive? -

inno setup keeps "uninstall log" file unins000.dat in application's install directory. file contains list of files uninstalled when application removed. when new version of app installed on old one, inno setup appends new files "uninstall log". an version of application removes user-modified template files when uninstalled, because forgot include uninsneveruninstall flag files. in latest version of software, uninsneveruninstall flag set, , files don't removed....... unless latest version installed on broken version. then, because files in uninstall log without flag, removed upon uninstall! i can't ask users uninstall old software before upgrading, because lose files. can force inno setup regenerate uninstall log scratch? or @ least remove/overwrite entries these files? want uninsneveruninstall flag retroactive. you can't change flag retroactively. once it's been released, that's it. an option though be, during setup...

hibernateexception - Unknown Entity using Spring and hibernate -

i struggling wit error hours now.i know simple configuration somehow not work me. here relevant portion of applicationcontext.xml :- <bean id="sessionfactory" class="org.springframework.orm.hibernate3.annotation.annotationsessionfactorybean"> <property name="datasource"><ref local="datasource"/></property> <property name="configurationclass"> <value>org.hibernate.cfg.annotationconfiguration</value> </property> <property name="packagestoscan" value="com.xxx.pkit.entities"/> <property name="hibernateproperties"> <props> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.dialect"> org.hibernate.dialect.oracle9dialect </prop> <prop key="connection.pool_size">10<...

java - Should be localization part of domain in DDD -

while following ddd concept i'm struggling on decision if should make domain localization aware? came 2 two solutions how solve this. both makes domain localization aware in different places. should place localized text domain? share solution problem or pros , cons of 2 examples. thanks. example 1 class persion { string name; // other fields ommited void rename(string newname) { string oldname = this.name; this.name = newname // publish event old name , new name } string name() { return name; } } class persionrepository { void store(persion persion) { locale loc = localecontextholder.get().getlocale(); // store object dao - create/update fields context locale } // other methods ommited } example 2 class persion { map<locale, string> name; // other fields ommited void rename(string newname) { locale locale = localecontextholder.get().getlocale(); string oldname = this.name.put(locale, newna...

java - Extracting some values from a multi column text file -

lets have text file this: alaska 30-dec-11 cd station icao iata synop lat long elev m n v u c ak adak nas padk adk 70454 51 53n 176 39w 4 x t 7 ak akhiok pakh akk 56 56n 154 11w 14 x 8 ak ambler pafm afm 67 06n 157 51w 88 x 7 ak anaktuvuk pass pakp akp 68 08n 151 44w 642 x 7 i interested in saving lines start ak. in addition, need save information arrays, station name instance. for first line want store "adak nas" stationarray, "51" array, same "53", "n", "176", "39" , "w". want each line starts ak. i'm quite confused on how go this. current code pertaining follows: //process text file fileinputstream fstream = new fileinputstream("file.txt"); bufferedreader br = ...

gorm - Grails 2.2.1 groupProperty on Integration tests -

for reason groupproperty not working on integration tests. i'm getting following exception: groovy.lang.missingmethodexception: no signature of method: mypackage.carinttests.groupproperty() applicable argument types: (java.lang.string) values: [car] def names = ['honda', 'toyota', 'nissan'] 3.times { garage.build(name: names[it]) } def results = garage.withcriteria { car { eq('brand', 'honda') } projections { groupproperty('car') } } assert results == names[0..0]

php - Post JSON data to external URL -

how post json data url string external url (cross domains) , bypass access control? here jquery .ajax post request won't work sending external url because of access-control-allow-origin: var json = json.stringify(object); $.ajax({ type: 'post', url: externalurl, data: json, datatype: 'json', success: function(data){console.log(data);}, failure: function(errmsg) { console.log(errmsg); }, }); i have received suggestion post data same domain , 'pass on request' external domain, though solution doesn't make sense me. looking secure solution. appreciated. one way bypass same-origin policy use curl actual transmitting. i'll give example using php, on server side language. set script on server, example send.php first point ajax send.php var json = json.stringify(object); $.ajax({ type: 'post', url: send.php, data: json, datatype: 'json', success: function(data){console.log(...