Demo Site

Saturday, November 27, 2010

multi line search and replace in eclipse (and across multiple files)

This is surprisingly more difficult that it should be. Search and replace across multiple files is covered very well here:

http://www.avajava.com/tutorials/lessons/how-do-i-do-a-find-and-replace-in-multiple-files-in-eclipse.html?page=2


but searching for things that span more than one line, wasn't covered almost anywhere, so here goes.

1. multi line search can only be accomplished by regex in eclipse (I'm using helios), so searching for something like -

 replace me
 replace me 2

would require an expressions like 'word1[\s\S]*word2' or 'word1[\s\S]*?word2' for a non-greedy expression.


to get the text back in, you'll need to also put it in one line, so a site like this can come in handy:


http://kangax.github.com/html-minifier/

Wednesday, May 12, 2010

Ibatis, Oracle and SelectKey

Another useless waste of 30 minutes, apparently if you're having problems getting Ibatis's selectkey statement to work, in order to get (and return) a generated key, it will fail with something like

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/x/ods/dao/ibatis/sqlmaps/Entity.xml.
--- The error occurred while applying a parameter map.
--- Check the insertEntity-InlineParameterMap.
--- Check the statement (update failed).
--- Cause: java.sql.SQLException: ORA-01400: cannot insert NULL into
("ODS"."ENTITY_SRC"."ENT_SRC_ID")

the answer? explicitly add the type attribute and set it to "pre". ugh-

Thursday, April 15, 2010

Google 2010 redesign

The site design is pleasing, the new logo is just too much. Compare them below


2009


2010

The colors are just a little too gaudy, the yellow "o" almost looks golden, now you see search results, its almost like seeing a stretch of golden rings. yuck.

Here's a way to bring back a more pleasing logo-
https://chrome.google.com/extensions/detail/nedjejdfkkjgebciefdfofjhmeogiaga

Monday, April 05, 2010

Spring @RequestMapping + Multiple Paths

I don't know why this isn't documented officially (that I could find anyways), but you can put multiple paths in the requestmapping annotation like so:

@RequestMapping({"/mapping1","/mapping2/*"})

Thursday, April 01, 2010

Nice review of javascript's call and apply, and how to manage scope

nice article, good refresher, so useful!
http://www.robertsosinski.com/2009/04/28/binding-scope-in-javascript/

Labels

Labels

Labels