Java MVC

I have to read a bit more on the subject but this article was interesting since it shows how to do in Java what Apple Cacao does with the MVC model. I find this twist to be easier to understand.

http://java.sun.com/developer/technicalArticles/javase/mvc/

Java Anti-Pattern

http://odi.ch/prog/design/newbies.php

This explains a few things that should be done differently if you want your application to perform well. Very interesting!

Java keytool quick notes

I have been playing with SSL connections between a Java application and a server lately and understanding the keytool command has helped troubleshooting. So here are my quick notes:

To list the content of a keystore you simply use this command:

keytool -v -list -keystore keystoreFileName

It is useful to remember that the default keystore is in the $JAVA_HOME/ jre/lib/security/cacerts file and that the default password for it is “changeit”.

I also used the printcert command to list the content of some certificate:

keytool -printcert -v -file entrust.cer

Article about Functional Programming

I had heard about functional programming and I was curious about understanding a bit more than just a few “features” of it. This article explains some basic concepts and I was surprised to learn that the functional programming concept can be applied in common programming language.

http://www.geeksaresexy.net/2009/02/06/an-introduction-to-functional-programming/

Date and Time calculation simplified with Python

When looking at java garbage collection logs you only get logs with a time stamp in seconds from the start of the JVM. After a few days of running the JVM it is difficult to remember when it started and when is the event your are looking at from. I was looking for a quick way to calculate the time. Python has some nice facilities built-in to help with that task. Here is what I do from the command line to figure out the last time it was started:

[bash]$ python
>>> from datetime import datetime
>>> from datetime import timedelta
>>> datetime(2009,2,9,10,48) – timedelta(seconds=159565)
datetime.datetime(2009, 2, 7, 14, 28, 35)

The datetime object is initialized with the date I want. In this case it was February 9, 2009 at 10:48. The timedelta object is initialized with a number of seconds but it could be days or min.

Very quick and convenient.

Quick Python Learning

A friend recommended this link and I have to admit that I am learning quite a few things about Python on this single page.

http://www.poromenos.org/tutorials/python/

There are quite a few things that I will need to test to fully understand.

Installing a new Apache with PHP

I was tasked with installing a new Apache and PHP on an existing and working RHEL4 servers. The new install had to be separate from the current one so to not disrupt the current work.

Apache 2.2

Apache was somewhat easy to install but here are my steps anyway.

I downloaded the source code from apache.org and untarred in my home directory.

As myself I then configured it with these parameters:

./configure –prefix=/opt/apache22 –exec-prefix=/opt/apache22 –datadir=/opt/apache22 –enable-mods-shared=all

Built it as myself with:

make

and as root installed it with:

make install

I had to modify the /opt/apache22/conf/httpd.conf for a few things. After the ServerRoot line I added these 2 lines:

PidFile “/opt/apache22/httpd.pid”
LockFile “/opt/apache22/access.lock”

These allow many version of Apache to run on the same server without stepping on each other files. There is more to it but these were the 2 lines that took me a while to figure out because I was not reading the comment in the configuration file properly.

I also modified these lines to match what I wanted to do:

Listen 8000
User apache
Group apache
DocumentRoot “/var/www/html_php5″
<Directory “/var/www/html_php5″>
ScriptAlias /cgi-bin/ “/var/www/cgi-bin/”
<Directory “/var/www/cgi-bin”>

Listening on an other port is the option I took to make sure I could run 2 Apache without stepping on each other toes. The user and group are the ones in RHEL4/5 so I simply re-used. The document root is a directory I created to be different than the default one (/var/www/html) used in RHEL4/5.

So it was quite simple for the Apache portion

PHP 5.2

Selling a domain name

For the second time in recent history I have received an offer to buy my domain name for $1000. Who thinks that such a ridiculous amount can buy a domain with 4 letters? Do I look like a stupid teenager that will be impressed by a few dollars?

New Code Kata page

I have started a simple page to track my progress in becoming a better programmer. So my Code Kata page will be a simple way to track my progress. Hopefully this is enough motivation to keep moving forward.

http://www.cinq.com/code-kata/

Intelligent Phones

I have a Palm Treo 680 and it is time to consider a replacement. I love the Palm software but Palm is going nowhere so I can’t avoid a change forever.

I have looked at some options but I am quite puzzled about which one is the best choice.

iPhone is the rage but I have heard too many stories about the battery not lasting that I don’t really want such a phone. The virtual keyboard is also quite a turn off for me. I have an iPod Touch and I can’t type quickly on a screen. So that option is out of the race.

Windows Mobile options are numerous but I feel a bit the same about it as I do about sticking to the Palm. They seem to be doing nothing and going nowhere. All you hear about Microsoft is that they keep delaying the next version.

Blackberries are attractive to some extent. I have one because of work and I want to get my own so that they can push me the emails and I will not have to carry 2 units on me. Keyboard is good on most units and the battery life is actually very impressive on the one I have.

My concerns with all these different phone is that important tasks to get me organized always seem to be an after taught. A good tasks manager is important for me and on the BlackBerry it is a bit basic for me. Can’t seem to find a good application to organize notes on it either. Very basic applications. I can do advanced organization on my Palm and it helps me a lot. I am not looking for an entertaining device to play music and videos and connect me to the Internet all the time. I am looking for very useful “disconnected” applications.

I will have to dig more to find all the functionality that I want in that gadget.