-
Parse the camel
A quick note about the B::Deparse Perl module: use it to tame hairy (obfuscated) Perl code, even code like this. Use it like this: perl -MO=Deparse obfuscated.pl In the area of obfusctation, but more on the funny side there is Acme::Smirch and Acme::Bleach. Have fun! PS. You can exercise your skills on the perl one-liners.…
-
Random Java blogging
-
Watch out for long running tasks with Java Timer
The problem? Write a code which will execute every N seconds. The solution? Using a Timer with scheduleAtFixedRate. Now you got two problems :-), unless you’ve carefully read the documentation which states (emphasis added): If an execution is delayed for any reason (such as garbage collection or other background activity), two or more executions will…
-
Style is important
-
Modulo implies division!
-
How to interpolate a string in Perl?
Perl (and some other languages which came after it :-)) have a feature called interpolation, whereby the names of the variables in strings are replaced by their actual values. This is both useful and dangerous (it can easily result in problems like command injection / SQL injection / HTML injection (aka XSS) – as with…
-
A great analogy for programmers
-
Negative zero – what is it?
Computers have two ways of representing numbers: One is called sign and magnitude – usually you have one bit specifying the sign (again, most of time you have 0 for positive and 1 for negative) and the rest of the bits specify the absolute value (“magnitude”) of the number. The other is ordering the numbers…