Monday, April 18, 2011

How to set up an Apache Ant macrodef

Note: this was originally posted December 29, 2010 on my old blog.


This blog post will go over how to set up a somewhat trivial macrodef in Apache Ant.  Ant basics are assumed.

Thursday, April 14, 2011

unix shell script: count the file handles for a bunch of processes

Note: this was originally posted April 22, 2009 on my old blog.

We are using WebLogic with the JRockit JVM and noticed tons of issues after a few weeks of uptime - spurious errors and non-responsiveness.  The cause?  Too many open file handles.  Well, actually it's not so much that there's too many open file handles, it's that the OS (Suse Linux Enterprise Server 10) has a very low limit by default.  The max file handles is over 400,000 for our production server (it's pretty high-end) but each process is limited to only 1,024.

After googling around a bit to figure out how to up the limit, I also put together this script to log the number of file handles being used by each of our WebLogic servers.

Sunday, March 20, 2011

Project Euler Problem 1

I recently attempted many of the simpler Project Euler problems, and decided it would be good to write down my thinking process.  If you don't know, Project Euler is a collection of programming problems with a heavy emphasis on mathematics.  They highly discourage sharing the answers since they want you to solve the problems by yourself, but since answers are already scattered all over the Internet it's up to you to challenge yourself and avoid spoilers.  Consider yourself warned - this post contains solutions and discussions thereof.

Problem statement:  Add all the natural numbers below one thousand that are multiples of 3 or 5.

Thursday, March 17, 2011

Setting up search shortcuts in Opera

One of the features of the Opera web browser which I really like and use often is the ability to do different search queries directly in the URL bar.  Need to look up an address on Google Maps?  Look up a word from  How about search for something using Google or Yahoo?  Opera has some very handy shortcuts for these.