Monthly Archive for March, 2008

Some eggdrop tcl scripts

Since I began using the IRC about 3-4 years ago, I’ve come around to write a couple of scripts for my bot. They’re still not really stable nor user friendly, but they do what they’re supposed to. If I’ve got time and motivation, I might continue the development at some point.

One is a simple “battle/vote” script, that takes a set of candidates as argument and “calculates” the winner. The outcome is displayed in percent. You can battle anything: Batman vs Penguin, bananas vs mangos, youtube vs work vs coffee break. But if you throw in Chuck Norris in the fight, he’ll always win.

The other is a reminder script that someone actually might find useful. It can be set to remind anyone of anything at any time (not in the past, though). The time syntax is really liberal, you can tell it to remind you on a specific date and time or in a relative time in the future (like “5 hours”). You can also ask the script to show all active reminders and cancel reminders.

You can find them on the Projects page.

Tomcat 5.5 getSession(true) returns null

This week I’ve been fiddling around with my thesis application, trying to get it up and running again after a hibernation period of almost a year. A lot of things had changed since I last used it, both on the department server and in our database, so I was in for some serious glueing, duct taping and debugging. Most of the problems were quite straight forward to fix, such as the database being out of date, some protocols having changed and so on. But there was one thing I just couldn’t understand.

When my web application tried to create an HttpSession object by calling getSession(true) on the HttpServletRequest instance, it returned null! According to the servlet 2.4 specification, the method must return a new session if it doesn’t exist, so this was just insane behaviour. By reflex, I started Googling for some answers, and it actually took me a while to find the solution.

Continue reading ‘Tomcat 5.5 getSession(true) returns null’