Posts

java - Spring from scratch - Bug on context:property-placeholder -

i'm doing test on very, simple application using spring . my app have have one bean , i'm injecting simple string class , printing value. so far working . what need: i want string configuration file, create file inside /src/main/resource what did: 1) on application-context.xml add: <context:property-placeholder location="classpath:myconfigfile.properties" /> 2) on application-context.xml change simple string use ${name_test}: <bean id="hello" class="com.dummy.sayhello"> <property name="name" value="${name_test}" /> </bean> 3) double check myconfigfile.properties , contains "name_test=jacktheripper" 4) output not 'translating' value config file, have output when run app: hello ${name_test} and i'm stuck here, clue, tips??? just fyi i use this tutorial tests, maybe help. i add log4j maven dependencies , log4j config file , works fin...

c# - Creating new object then reallocating -

a question builds upon to "new" or not "new" foo object1 = new foo(); // operations later ... object1 = new foo(); is i'm attempting advisable? , if foo implements idispoable, need call dispose before calling new operator second time? yes, you're doing in example fine. the object1 variable reference object of type foo . after first new assignment refers 1 particular instance of foo ; after second new assignment refers different instance (and original instance becomes eligible garbage collection, assuming there's nothing else referencing it). and yes, if foo implements idisposable should dispose it, preferably using using block, although personal preference use separate using variables each block: using (foo first = new foo()) { // } using (foo second = new foo()) { // else }

c# - Design Guidelines for Heavy string operations -

in current project, working on word processing & highlighting solution. typically every call class processing approximately 4000-5000 words long strings. the structure looks this public string parsetext(string inn) { //heavy parsing } public string highlighttext(string inn) { var cleaned = cleanuptext(inn); var parsed = parsetext(cleaned ); //highlight algorithm var formatted= parsetext(parsed); return formatted; } public string cleanuptext(string inn) { //heavy parsing } public string formattext(string inn) { //heavy parsing } so feel passing around same string around different methods decreases performance. though string reference type, creates new string , allocates new memory each passed variable due immutability nature of it. different other user generated...

php - IPhone App ajax request Problem -

hello using cross domain ajax plugin send request server using iphone. but when complie code xcode behaving strange. some time send request server. time doesn't send reuest. some time got response request , time not able reponse pls. help if there other way send data server using javascript pls. tell me thanks if native app, use nsurlconnection. read on here: url loading system programming guide if it's web app, javascript best way transmit data bi-direcionally asynchronously. if doesn't matter you, can use pure php , refresh page each time, although may not optimal user experience.

android - How to sync my app with photos -

i build custom gallery photos only. taking photos sdcard class: public class photos { public static final string photo_bucket_name = environment.getexternalstoragestate().tostring() + "/dcim/camera"; public static final int photo_bucket_id = getbucketid(photo_bucket_name); public static int getbucketid(string path) { return path.tolowercase().hashcode(); } public static list<string> getphotos(context context) { final string[] projection = {mediastore.images.media.data}; final string selection = mediastore.images.media.bucket_id; cursor c = context.getcontentresolver().query(images.media.external_content_uri, projection, selection, null, null); list<string> result = new arraylist<string>(c.getcount()); if (c.movetofirst()) { int datacolumn = c.getcolumnindexorthrow(mediastore.images.media.data); { string data = c.getstring(datacolumn); result.add(data); } while (c.movetonext()...

flex3 - Issue in chrome when using cursormanager(Its Displaying both custom cursor and normal mouse pointer) -

i using cursor manager set hand cursor overlay. its works fine in mozilla firefox , ie8, in chrome shows hand cursor , normal mouse pointer, here code import mx.managers.cursormanager; import mx.managers.cursormanagerpriority; [embed(source="/assets/images/cursor_hand.gif")] public var handcursor:class; renderer.addeventlistener(mouseevent.mouse_over, function(event:mouseevent):void{ cursormanager.setcursor(handcursor,cursormanagerpriority.high, 3, 2); }); renderer.addeventlistener(mouseevent.mouse_out, function(event:mouseevent):void{ cursormanager.removeallcursors(); }); am missed here? using flex builder 3 , flash player 9. access this link in chrome , check whether seeing custom cursor alone. if no, try update flash player version.i have version have version 10,0,45,2 , seeing custom cursor in chrome.

php - Get parameters and folders depth in a path -

how can take url path , break the params, in case param1=1 , param2=2 the end script, levele the middle folders in script levela, levelb, levelc, leveld . http://test.com/ levela/ levelb/ levelc/ leveld/ levele ? param1=1 & param2=2 another example this, folder depth different, , number of parameters different: http://test.com/ levela/ levelb/ levelc/ leveld ? param1=1 & param2=2 & param3=3 use parse_url() split url, , parse_str() split query string components. the levela/levelb/levelc part best split using explode() .