geeky · non php code

itext page number (page x of y)

I was looking for a complete example of how to dynamically generate the page numbers when you create the pdf using iText and I couldn’t find one. This is based on the example in the iText in Action book but I added my “refactoring” if you will. I hope this helps someone. If not, it… Continue reading itext page number (page x of y)

geeky · non php code

Java instaniate an abstract class… sort of…

At work I had to create some test data for a junit test. The function I’m testing expects a super abstract class to be passed in and I need to test the same function for bunch of child classes. I wish I could just pass in the parent class but since it’s abstract I cannot… Continue reading Java instaniate an abstract class… sort of…

games · geeky · php code

writing an ajax app for Sequence

Yesterday I attended Ted Neward‘s game design session at nofluff. It inspired me to begin to implement the game sequence in an ajax app. It will be a private app since I only plan to play it with some friends. But it will be hosted somewhere on my website so it can be accessed from… Continue reading writing an ajax app for Sequence

geeky

Oracle number data type

I don’t know why I’m always confused. I need to write this down so the next time I wouldn’t be. You may optionally specify the precision/length and scale of the number data type in Oracle i.e. number(9,2). I remembered it as “leading” & “trailing” (the decimal point) which is INCORRECT. As discussed here: Precision =… Continue reading Oracle number data type

geeky · pc tips

Windows 7 – middle click to close program

I upgraded my laptop to Windows 7 Ultimate yesterday (Andy bought it as a student for $10). Since I’ve been using Vista for over a year, switching to Windows 7 really wasn’t that big of deal. Switching from XP to Vista was a lot more painful. A few things annoyed me however. I have always… Continue reading Windows 7 – middle click to close program

geeky

Java: BETTER way to traverse a map

While reviewing the findbugs report (WMI_WRONG_MAP_ITERATOR) for a new project at work, I learned a better way to traverse a map in Java. In fact, since the first day I started coding in Java, I never thought twice about how to traverse a map. You always traverse the keys and use the key to get… Continue reading Java: BETTER way to traverse a map

geeky · pc tips

Eclipse CVS show history tags column stretched out

Gosh, I managed to double click on the show history tags column one time viewing a file that has gazillion tags. That stretched the tags column out of its capacity. There seems to be no way at least in UI to get that back to normal size so I can see the columns to the… Continue reading Eclipse CVS show history tags column stretched out

geeky · non php code

jQuery session timeout countdown with jQueryUI dialog

Very nice jQuery session timeout countdown example with the use of the jQuery idleTimer plugin. Here’s my example with the jQueryUI dialog as the warning. Here’s my example with the jQueryUI dialog as the warning.