Posts

java - Is it possible to map a servlet to /* without overriding JSP processing -

elaborating on this: i map servlet or filter "/*" now, if access url like: /test then directed servlet (which okay) but if access url like: /index.jsp this directed servlet, dont want behavior, want index.jsp processed jsp. how can done? map controller servlet on more specific url-pattern /controller/* , create filter mapped on /* , follows in dofilter() method. string uri = ((httpservletrequest) request).getrequesturi(); if (uri.endswith(".jsp")) { chain.dofilter(request, response); // let go. container's builtin jspservlet pickup this. } else { request.getrequestdispatcher("/controller" + uri).forward(request, response); // goes controller servlet. }

java - Background image in JScrollpane with JTable -

im trying add centered background image behind jtable in jscrollpane. position of background relative viewport should centered , static. ive tried adding jscrollpane jpanel drawn image , making else translucent, result ugly , had rendering issues. check out watermarkdemo @ end of article complete example.

iphone - use if with NSinteger? -

i want use nsinteger variable *strength in code if condition it's not work.. :( if(strength == 11){ } how can use if nsinteger* nsinteger primitive value type; don't need use pointers. declaration should read nsinteger strength; and not nsinteger *strength; however if do need use pointer nsinteger (that is, nsinteger * ) reason, need dereference pointer value: if (*strength == 11) { } but see, don't think case.

Blackberry webworks : support HTML5 -

please me.. know? blackberry bold 9700 (5.0.0.469) support html5 audio stream? thanks.. i've tested simple webworks smartphone application on similar platform, diff phone: bb curve 9300 (5.0.0.846) , there no support html5 audio tag.

Which algorithms are worth to learn or recall on preparation to Java developer interview? -

i know collections.sort() method in java think quicksort worth remember , try. work target general java: web, database access, integration, not game developer, scientific application or 1 depends on advanced algorithms. algorithms should learn pass without stress java developer interview? fizz buzz i don't care, if developer knows basic algorithms heart. care, if capabale of understanding requirements , translating them in correct, testable , understandable pieces of code. ah, , care if knows how implement common design patterns. , should know when , how use collections, threads , - string#split - it's amazing how many "developers" don't know how read , process simple csv file.

regex - Python: Regular expression... not working? -

i have code: # if username isn't alpha-numerics (inc: _, -, ., ) if re.match('^[a-za-z0-9 _\-\.]+$', repname) == false: print 'decline: '+repname else: print 'accepted: '+repname and when test against string: ɢᴀꜱᴛяɪᴄ (which grabbed website) returned: accepted: ɢᴀꜱᴛÑ?ɪᴄ why getting through? why python seem change string? unsuccessful re.match not false . none . but can try way: if re.match('^[a-za-z0-9 _\-\.]+$', repname): print 'accepted: '+repname else: print 'decline: '+repname

Oracle sqlplus HTML report - alternating rows color -

i use oracle sqlplus "set markup html on" convert query output html report - it's simlpe way publish database report online. i'm missing 1 thing - alternating colors every other row, helpful while viewing wide reports. is there way embed html color every row, make dependent on mod(rownum/2) - even/odd row number ? thank ! i don't think there is, using set markup html on. have write own markup like: select '<tr style="color:' || case mod(rownum,2) when 0 'red' else 'green' end || '"><td>' || ename || '</td></tr>' data ( select ename emp order ename ); then add surrounding table tags using prompts or whatever.