Perl state variables

Perl 5.10 added a new class of variables ‘state’ that are similar to ‘my’ in scope but are only initialized once. Even inside of a subroutine a state variable will only be initialized on the first call to the subroutine and will maintain it’s last value between calls. A simple example is the easiest [...]

JDK 7 - Try with Resources

JDK 7 has several enhancements to the try-catch construct. Try with resources allows for ensuring that resources are closed and freed up without the need to explicitly call the close function. Any class implementing java.lang.AutoCloseable can be automatically closed without the need for a finally section in the try block.

The syntax is a [...]

JDK 7 - use Strings in switch statements

JDK 7 adds the ability to use String objects as the case in switch blocks. It’s not exactly an earth shattering addition but I find it quite useful in avoiding long if-then chains. Plus the release docs claim that using a switch is more efficient.

At the bottom of this post is a small [...]

JDK 7 release candidate now available

Build 147 for JDK 7 is now available with the goal of a generally available release later this month. Some good resources are: Oracle’s Java 7 wiki Java 7 project page Get the release from the download page Oracle’s Java SE 7 documentation

As I test out the release I’ll do some posts on [...]

Perl 5.12 using each with arrays

As of version 5.12 perl now supports using each with arrays and hashes both. For our pm project we should get in habit of using it. No need to rewrite any old code.

In practice it’s very much the same as use with hashes. each still returns 2 results with the first one being [...]

Quote of the day 26-March-2011. The power of the washing machine.

Hans Rosling always gives great presentations and this one is really excellent as he discusses energy uses across economic class lines. Using his personal expierence of how the washing machine affected his life, he touches both sides of the issue. The ending sentences are some we should all remember.

“Thank you industrialization. Thank [...]

Jack Daniels and the deficit

Needs nothing added.   Video by10000Pennies

Standard disclaimer – At the time of posting I believe all information contained to be accurate but there is absolutely no warranty or guarantee.

Quote of the day 3-3-11

Russ Roberts has a great short piece Don’t follow the money on the buy local movement at Café Hayek. His ending sentence is the best one line summary of the buy local scene I’ve found.

We have tried buy local before. It is called the Middle Ages.

Murray N. Rothbard’s Austrian Perspective on the History of Economic Thought

Rothbard’s massive book on the progression of economic thought is not an easy read and the sheer size of the work is no doubt intimidating to many. Nonetheless, it is a trove of knowledge and insight I recommend to all. Mises.org now has both volumes combined into one EPUB and the 2 volume set [...]

Installing Perl under your home directory

The question of how to do a local install of PERL comes up now and then. The truth is it’s quite simple if you have a normal set of build tools installed. GCC, make, etc. I will walk through the steps here on doing the build and install.

Decide where you wish to [...]