Sunday, September 2, 2007

Podcasts

I am trying to make up for lost time since I haven't posted in a long, long, long time. Here my list of podcasts that I regularly listen to....

  • bsdtalk
  • Casting from the Server Room
  • FLOSS Weekly
  • Google Developer Podcast
  • In the Trenches
  • The Java Posse
  • Linux Reality
  • OnSoftware
  • Oracle TechCasts
  • Perlcast
  • Software Engineering Radio
  • SourceTrunk

iText - Java PDF library

I recently had to do some tuning on a project I had done that involves converting and merging documents into PDF format. The main performance issue turned out to be poor performing sql and a function-based index fixed it. I decided to try tuning a few other pieces of code and that brought me to try an newer version of the iText library...wow was I pleasantly surprised.

In the project I use iText to merge PDF documents into a single document and also use it to convert TIF and JPG files to PDF format. The ERP system this project was going to be a part of shipped with iText 1.02 so that is why I initially decided to use that library for the PDF manipulation. As part of my tuning effort I decided to try the latest version, 2.0.4. On average performance improved over 40%. As an added bonus some TIF files that failed to convert in the prior 1.02 version were handled flawlessly by the newer release.

In the near future I would like to compare the performance against other Java PDF libraries (such as PDFBox) to see how iText compares. The code that handles the PDF manipulation is isolated from the rest of the logic and implements an interface so it shouldn't be too difficult to try the test since the implementing class is plugable.

Couple lessons learned for me are:
  1. Write classes that do one thing and do it really well. I was lucky here, my project is relatively small and the code was well isolated making the upgrade in versions easy to test side by side.
  2. For sourceforge projects that I rely on I will sign up for the release mailing list and try out new versions. Open source projects like iText are continually evolving. I made a huge mistake of thinking that the art of PDF manipulation would not have advanced much since the release of 1.02 (which I think was sometime in 2004).
  3. iText is a great PDF library for Java. I had never used this library before this project but had heard a lot about it. What really impresses me the most about the project is the documentation and the fantastic examples on the site. I was able to use a lot of code from the examples and that left me to focus more on my program's logic rather than on the details of merging PDF files or converting images to PDF.
One last thing I want to mention was how painless the transition was from release 1.02 (circa 2004) to the latest release of 2.0.4. Just had to change 2 method calls from deprecated methods to new ones that were direct replacements. Great library, fast, stable API, well documented, definitely recommend it.

Friday, June 22, 2007

All Derived, All The Time (I wish...)

I have been working on a PeopleSoft inquiry page a bit this week. I was looking at the specifications for the page and saw I didn't need to create any physical objects in the database (tables or views) to do what I needed to do. I was planning on just using derived tables and values and just loading up a rowset with data from PeopleCode and pushing the rowset to the grid. I was using an existing derived table at row level 0 and created an additional derived table with all of the fields I needed for row level 1 (the grid). Everything derived. I added my fields at row level 0, added my grid object, added the fields I needed for the grid from the derived record and attempted to save. Error message of no data found in row level 1. What? I went back and looked, verifying that I had added the fields. Tried to save again. Same error. I went and showed one of my colleagues who also theorized that what I was trying to do should work. He got the same error. He added a field from a table that physically exists in the database and it saved. So the moral of the story is that in a PeopleSoft page, you can have all derived field at row level 0, but you must have at least one field that physically exists in the database in row level 1 for the page to work.

This posting probably is rambling and doesn't flow well, but hey, it's late on a Friday...

-E

Thursday, June 21, 2007

PeopleSoft and Firefox, Part One

I wanted to leave the door open for part two, if ever need be...

One ongoing gripe I have with Firefox is the speed of the browser in PeopleSoft. IE is hands down faster and I have yet to figure out why. Does IE cache more of the HTTPS pages where Firefox does not? Does the IE Trident rendering engine just work better with PeopleSoft than the Gecko rendering engine in Firefox? Did a very un-thorough Google search with nothing much to show for it. If anyone has an ideas or opinions, please post a comment.

Wednesday, June 20, 2007

NotePad++

We have been test-driving Notepad++ around here for the past couple of days. With the recent release of Textpad 5, we have been looking to see what else is available out there that is open source. We have been big Textpad fans for the last several years and have been looking forward to the changes that were coming with release 5, but the load time to open the app is huge. We have been conditioned for software to be lightning fast, so Textpad 5 left us wanting. I tried to revert back to Textpad 4, but had all kinds of little registry gremlins that caused me grief.

We have PSPad in the running too, but it has the same app load delay as Textpad 5 (but it has a ton of cool features).

Anyway, we will be using Notepad++ here, probably until next week until another text editor draws our attention.

Open Source Desktop Encryption Solutions

Let me throw out a couple of scenarios:

1.) You get a call from a user who needs a data extract of "XYZ" data. You run the extract, export the data to a spreadsheet and send the data back to the requester.

2.) You have 10 databases you work in, all with different passwords.

Consider these questions:
In scenario 1, what if the extract had some sensitive information in it? Where is that extract, in your local temporary folder? Is that temp folder under your profile (probably not) and who has access to it? What if it is sitting in your local temp folder and your laptop grows legs...

In scenario 2, do you remember all of you passwords or do you store you passwords in text docs locally, in a wiki, post-it note on your desk, etc. to make it easier to access the userid/ passwords?

TrueCrypt: This software allows you to create a encrypted partition in a file (yes, a file) on your harddisk that you can mount as a volume in the OS. Save anything you want to it.This is perfect for using as a temp directory. Provides a solution for scenario 1. If your laptop does take up jogging, the file is a bunch of gibberish without the passphrase.

KeePass: This software fixes the problem presented in scenario 2. The software basically keeps an encrypted database of your any userid/passwords you want to store. Add as many as you want. You only need to remember the single, encrypted passphrase to access the database.

Both of these products are available on multiple platforms. I can only vouch for the effectiveness on Windows XP.

Just to have one less thing to remember, save your KeePass database inside of your TrueCrypt partition.

Wednesday, May 23, 2007

OSAlt - Open Source Alternative Software

I came across this site this morning while looking through my LifeHacker RSS feed. OSAlt is a very cool site where you can enter what type of application (business, communications, etc), or a specific application and find any open source alternatives to it. I am frequently looking for open source alternatives to commercial applications and I am definetely going to be adding this site as one of my first places to search (along with sourceforge.net).

Sunday, May 6, 2007

Recently while working in our HR system I came across some interesting OO design.


&someobject.ShopForEmployees();
....
....
&someobject.CopyShoppingCartToRowset(&RS_Employees);


I would expect this kind of terminology from an HR person (employees being just commodities that can be thrown in a shopping cart), but what developer with any self respect would write up code like this? They, after all, are just an employee.

Besides the method naming, the code had a lot of problems and didn't work as documented. That I expected, but would have been easier to take if the naming wasn't so offensive.

Tuesday, March 20, 2007

We are still here

We have been very busy with a couple of projects. Will post more soon.

Friday, January 5, 2007

Thunderbird 1.5.09 vs Outlook 2003: Can O' Spam

I find myself constantly battling between my desire to use standardized business software (ie Microsoft products) and the desire to have software make me more productive and make my life easier. I gave Outlook another shot today (I was feeling guilty about using Thunderbird) and quickly kicked myself. We have a listserv at work that spammers seem to really enjoy flooding with spam. Unfortunately, it is a listserv which we need and frequently use. Thunderbird utilizes a Bayesian filter, so it learns what a spam email looks like based on what you have told it is spam. In contrast, Outlook allows you to whitelist/blacklist senders, so any known spammers get filtered. The downside to Outlook (and upside to Thunderbird) is that when you are getting spam and good email from a sender, you can't just filter the messages you don't want. It's all or nothing. Thunderbird doesn't care who it is from, only what the content of the message is. With all of the communication that we get through email and with the regularity that listservs and email accounts get compromised by spammers, Thunderbird's Bayesian filter wins hand down.

I should be getting a copy of Office 2007 in the near future and will give Outlook 2007 a shot to see if any improvements on the spam filtering have been made. I will blog another posting with my results.

Please don't interpret this as being a Microsoft hater. I think Outlook is an very capable email client, in certain situations, preferable to Thunderbird regardless of the spam issue. If you use Microsoft Exchange or POP3 email, Outlook is the best, hands down. If you use IMAP for your email, Thunderbird has the edge. Outlook 2003's handling of the IMAP protocol is "clunky". I use IMAP for my work email, so there is little incentive to stay using Outlook 2003, for now.

Thursday, January 4, 2007

Cross Platform Open Source (Javascript, HTML, CSS) IDE

Ran across a very nice plugin for Eclipse over the holiday break named Aptana. I already had the latest version of Eclipse installed so I just installed it as a plugin. Did a quick test using the Yahoo! User Interface (YUI) library to do a quick and dirty AJAX page that automatically updated weather info (from Yahoo Weather rss feeds).

I had been searching for a good open source tool to aid in developing xhtml/css/javascript pages and was mainly interested in command completion/suggestion. This one was the best of all I checked out. The code assist features worked great and I found the help features to be great, especially when dealing with css/javascript. I didn't try out the javascript debugger.

http://www.aptana.com

Killing an oracle session to remove a lock

I always have to search around for the right commands in order to remove table locks in Oracle. Thought I'd post and hopefully will remember I can look her for it in the future. Below seems to work at least in 8/9i.

Identifying the locks:


SELECT l.inst_id,
SUBSTR(L.ORACLE_USERNAME,1,8) ORA_USER,
SUBSTR(L.SESSION_ID,1,3) SID,
S.serial#,
SUBSTR(O.OWNER||'.'||O.OBJECT_NAME,1,40) OBJECT, P.SPID OS_PID,
DECODE(L.LOCKED_MODE, 0,'NONE',
1,'NULL',
2,'ROW SHARE',
3,'ROW EXCLUSIVE',
4,'SHARE',
5,'SHARE ROW EXCLUSIVE',
6,'EXCLUSIVE',
NULL) LOCK_MODE
FROM sys.GV_$LOCKED_OBJECT L
, DBA_OBJECTS O
, sys.GV_$SESSION S
, sys.GV_$PROCESS P
WHERE L.OBJECT_ID = O.OBJECT_ID
and l.inst_id = s.inst_id
AND L.SESSION_ID = S.SID
and s.inst_id = p.inst_id
AND S.PADDR = P.ADDR(+)
order by l.inst_id


Deep Six the session:

The SID and the SERIAL# fields can then be used to issue the kill command:


ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;


Using this combo I almost never have to resort to a "kill -9 OS_PID" on the database server itself.