A regular expression to replace all ampersands (&) in a text that are not part of an entity: t = t.gsub(/&(?!#?\w+;)/, ‘&’)t = t.gsub(/&(?!#?\w+;)/, ‘&’) Language is ruby. The regexp feature used is called a negative lookahead.
More than a year ago i decided to do the Sun Certified Java Programmer. Shortly after i bought this book, the projects at work and at home were somewhat overwhelming and after all, i realized that a big part of the SCJP is about some weird, crazy and sometimes wrong design decisions of the Java […]
Right now i’m in Wiesbaden, attending the JAX 2008 conference. The mood is somewhat different compared to the DOAG i used to visit the last years. The people are more open minded, partially much younger and generally try to be much cooler. And for the sake of it, some are even more interesting and after […]
Some days i ago, i decided to revamp my ambitions to get the scjp thingy done. What exactly for, i don’t know. But working to the self tests, i found the following: class Ring { final static int x2 = 7; final static Integer x4 = 8; public static void main(String[] args) { Integer x1 […]
I use wp-cache on all my blogs all the time. No need waiting for being slashdotted or heised. But wp-cache comes with a security flaw. It requires the webserver to have write access on $WP_HOME/wp-content/cache and $WP_HOME/wp-content. The first part is perfectly reasonable, the second not. wp-cache creates it’s wp-cache-config.php in that place and edits […]