Programming

Mbox de-duper patched

Tuesday, July 27th, 2004

I wrote a quick patch for the mbox-dedup.pl script I found online awhile ago. Basically, the author wrote a script that takes an mbox and creates a new mbox with all duplicate messages removed. I have to deal with duplicate e-mails constantly due to some weird incompatibility between Evolution and my Argosoft Mail Server (Windows), which I’ll have to figure out some day soon.

This script is just a temporary solution. I modified it so it now creates three files: $f.bak, a backup of your old mbox; $f, your new, dupe-free mailbox; and $f.dup, which is a mailbox which ONLY contains messages detected as duplicate. You can probably get rid of f.bak and keep f.dup around in case there were any mistakes in duplicate detection (which is what I’m doing). How annoying through. Anyway, if this bothers you, download the script, but use at your own risk.

Good article on programmer productivity

Friday, July 23rd, 2004

Read it here. It encourages programmers taking breaks to think about the bigger issues and reduce code bloat.

I understand now why programmers end up so conflicted. They have to work to meet deadlines, but often problems could be solved much more elegantly if there were extra time.

If I ever did run a software development company, one of the rules would be that everyone runs Workrave, a great free tool that forces you to take breaks from your computer every once in awhile. Not only does this reduce your chance of RSI/Carpal Tunnel, but it also provides a way for you to sit back and think about a problem in the abstract, rather than code your way through it.

I know deadlines are a reality. But in a perfect world, programming projects would be done “when they’re done.”

Levels of abstraction

Saturday, June 26th, 2004

I think I must be doing the funkiest development on the planet right now. Connecting to a Debian Linux server running under VMWare Server under Windows 2000 Server as my test server, which is modeling the production server, a Redhat environment.

Locally, I’m connecting to this virtual Linux server via NFS, and plugging Eclipse right into the NFS exported directory, using uid/gid mapping to make sure permissions are okay.

Finally, running VMWare Workstation locally (for access to Dreamweaver/Photoshop) and connecting to the NFS mounted drive by connecting to the mount point on my local machine via SAMBA! That is, I have a mount point on my machine /mnt/server1 which maps to the IP of my server via NFS. And I made /mnt/server1 shareable via samba to my VMWare “Virtual Machine’s” IP address. So that means when I write a file from VMWare, it’s using the Windows SMB implementation which is interpreted by Linux’s SMB daemons, which are then sent over the Internet to my server using the NFS protocol and finally written to my server’s disk. All in milliseconds, no less.

Wow! That’s a lot of layers to peel off when something goes wrong. But so far, nothing has (this is very surprising for me).

300 lines of (careful) code later…

Wednesday, June 23rd, 2004

And I am chiseling away at this project. Coded the registration form in true MVC fashion. As I said to Olivia today, they don’t call it software engineering for nothing. I had to really plan this out properly and code the components with lots of reuse in mind. It’s paying off, slowly.

So anyway, I can see why my brother’s developers shy away from doing extensive error checking on their forms. It’s a pain in the ass. But a necessary one, I think. I really wish something like XForms were widely adopted so that us poor web developers could enforce constraints easily at the client level. I would do it with JavaScript except I really fucking hate JavaScript. It’s slow, clunky, and almost always makes your page look-n-feel unprofessional.

So, I said, fuck it, might as well take some OOP features of Java and code some reusable error handling for forms. I came up with a nice idea of using a HashMap that stores keys of the form element identifiers and passing that object to the JSP page through the RequestDispatcher/Session. Once my JSP page has it, it checks if there are errors, and if there are, it outputs the error message and also marks off asterisks next to invalid form elements.

This is probably the kind of thing Struts/FormBeans handles for you easily, but I’m doing it from scratch. All in the name of knowledge, I guess. Is the time I’m spending on this from scratch > the time it would take to learn the Struts framework/deal with the issues arising from the Struts framework? Who knows. But at least I’m learning more, so I guess that’s why it wins out.

Argh, I need sleep. I’m so pathetic. I disabled Workrave, and so I haven’t taken ANY breaks in the last 2 hours. sad

Busy days

Tuesday, June 22nd, 2004

Been working like crazy the last couple of days. Spending most of my time on the UAC project–coding all the great Java classes that will make the website run smoothly. Learning a lot more about MySQL (and Connector/J) in the meanwhile. In fact, yesterday in order to get up to speed I spent about two hours reading some relational database theory (stuff I had stupidly forgotten to review when I jumped into MySQL earlier this year, in a very practical way).

Yesterday, after finishing my Java work, I had the pleasure of setting up a Bugzilla for my brother’s web developers. I say pleasure because the Debian bugzilla package rocks and literally makes it an apt-get install bugzilla bugzilla-doc affair. From there I was able to customize it up the wazoo by editing /etc/bugzilla/localconfig and rerunning dpkg-reconfigure bugzilla. Ah, Debian. Makes things so easy.

Bugzilla is really nice when you play with it. I’ve been entering bug reports for my brother on and off as I browse his websites. 10 minutes ago I got bored so I added a bunch of Stephen Wright jokes to Bugzilla’s “quips” feature (displays a random quip on every bugzilla query). Hopefully that’ll keep my brother’s devs entertained as they try to face the growing steep of UI bugs and such.

Anyway, back to work. Just felt I was leaving this web page without love. More to come later, when I’m less under pressure.