Posted in Software Engineering, Technology
Wednesday, May 7, 2008

I made the trip out to San Francisco for JavaOne. The first day kicked off with a speech entitled Java + You. I came in late because, well, I had an issue finding the right conference center.. not Moscone West, not Moscone South, but Moscone NORTH, whew! I enjoyed the talk until they trotted out Neil Young, the ancient musician and liberal crackpot.

My first scheduled session was on Project Darkstar. The presenter covered Sun’s massively-multiplayer system. In describing the server he mentioned the design goal on achieving low-latency using objects that sounded a lot like stateless session enterprise java beans (EJBs). In his demo he used assets from Bioware’s Neverwinter Nights — while that was cool it looked dated. I found it strange that the demo for a MMO was empty except for the player character.

The talk for Project Aura was better. This is an open source project that provides recommendations based on classifications. They pointed out the shortcomings of the traditional recommendation engines, specifically music recommendation systems. Their approach would improve on them by automatically classifying music using artificial intelligence. They also show why the recommendations are made. This would be an improvement over, say Amazon inexplicably recommending clean underwear when I look at a book on chaos theory.

Most sessions are a cattle call. Imagine a large nerd herd of hundreds of attendees congregated outside conference rooms waiting for the room to empty and the staff to let them in. Lunch was the worst crowd. Thankfully, the lunches were boxes and line moved quickly.

After lunch I attended a session on upcoming Java changes. There are interesting things coming. Here is what I managed to scribble down:

Multi-catch

try {
// stuff
}
catch (X1, X2 e) { foo(); }
catch (X3 e) { bar(); }

Safe Re-thow

try {

// stuff
}
catch (final Throwable e) {
logger.log(e);
throw e;
}

Switch on String

switch (value)
{
case “red”:
foo();
break;
}

Modules

module org.netbeans.core;
package org.netbeans.core.utils;

Annotations (JSR 308)

Adds annotations on generics
List < @NonNull String> strings;

Adds annotations to casts
endRegex = (@NonNullPattern) endRegex;

I went to a session on Grails that was pretty similiar to the class I attended at No Fluff, Just Stuff a few months ago. Following that I went to a class on GWT where the only thing I picked up was that testing GWT classes in difficult. Then I ended the night with a session on writing plugins for Eclipse, NetBeans IDE and IDEA. The main takeaway from that session was that Eclipse uses plugins in SWT and everybody else uses Swing.

It has been a long day. I have classes tomorrow on Groovy, Struts 2, OpenSocial and Comet. So I’m off to bed to do a bit of reading before calling it a night.

Posted in Software Engineering, Technology
Thursday, May 1, 2008

Back in March I attended a software conference hosted in St. Louis called No Fluff, Just Stuff. The lectures introduced me to some cool new technology. It was small and intimate. I had an opportunity to speak to the instructors and conference organizer.

The classes I took covered these technologies: Ajax, Hibernate, Spring, Terracotta, Grails, Groovy and GWT

During one of Jeff Brown’s Grails talks I heard him say that there is built-in validation of credit card numbers, but it is limited to just checking the size. It is possible to validate the value of the number using the Luhn Algorithm. So, the following is my implementation of Luhn validation written in Groovy and suitable for use in Grails.

class LuhnValidator {

def isValidCreditCardNumber(number) {
def sum = 0
def alternate = false
number.reverse().each { value ->
if (value =~ /\d/)
{
def n = value.toInteger()
if (alternate) {
n *= 2
if (n > 9) {
n = n % 10 + 1
}
}
sum += n
alternate = !alternate
}
}
sum % 10 == 0
}
}

Posted in Software Engineering
Tuesday, June 12, 2007

Tom SmilesI was thinking today, friends. Scary, huh? I was trying to think back to the time when I was young and the sky was blue.

I realized at a young age that computer software could indeed be beautiful and have a positive impact on our world. In grade school I was put in a remedial reading class because I had difficulty reading out loud in class. It may have been because I can be incredibly shy in intense social situations. Well, having my peers listen to me read was intimidating to me back then. Anyway, I aced all of my remedial reading lessons usually finishing early. Since I had extra time, the instructor let me write some simple programs on the computer that was used to run some teaching software. That is when the programming bug bit me. I was hooked.

That enthusiasm followed me to college where I studied computer science. The sun shone brightly in my blue sky. I ravenously studied algorithms and software architecture. I read books outside of the assigned course material. I experimented with new ideas. I wondered what software was like in the real world. I was excited by the promise of working on computer software that could make a significant impact on society.

In real world there are storm clouds in the skies. While I hate to say that my enthusiasm has diminished, I prefer to say that I learned a number of lessons over the years.

There are problems that computers cannot solve. It has been shown that it is impossible for a computer to decide whether statements in arithmetic are true or false.

Computer software is written to tackle real-world problems. A vast majority of software is written to meet business problems. I do not believe that custom software will become a commodity because business problems are never the same long enough for the proposed solutions to be economical.

The ultimate product of a software project is an executable. But that product is not useful without good documentation. Documentation is often overlooked. Open source documentation is underappreciated. I will never forget the sinking feeling the first time a colleague told me he did not need documentation since his code was self-documenting.

Writing great software involves managing complexity and balancing design decisions. Programmers tend to eliminate redundancy by refactoring common code. So, if new code is necessary, it will be unique and will increase the complexity of software. A good design will mitigate how complex a system needs to get in order to meet its goal.

Writing software is limited by time and budget. For example the work on Y2K software had a deadline of New Years Day 2000. A disciplined company has a regular release schedule of software. As a manager put in once at some point you have to cut the baby and deliver a product!

For all of the dark clouds there is still a reason for software architects and engineers to get out of bed in the morning. There are problems for which elegant algorithms do not yet exist. In fact there are problems that people have only imagined for which no software exists. Futurists imagine a world, for example, with flying cars. In order for flying cars to be as easy to use as conventional automobiles we need sophisticated computer software. I do not think the futurists picture a generation of people spending time to learn to use a vehicle that is as complicated as a helicopter to operate.

I regain my enthusiasm when I think about the challenges that the world continues to face. Friends, I want to write the computer software that rises to meet them and makes life better for us all.

Posted in Software Engineering
Tuesday, May 8, 2007

Nothing can turn a programmer’s mind into tapioca pudding faster than trying to understand other people’s regular expressions (OPREs). Friends, there is nothing regular about regular expressions. The quiet secret — seldom shared outside of computer nerd circles — is that regular expressions are commonly used to validate values and provide protection from malicious user input. How did we get to the place where we trust code that few people other than the author can understand? Dunno.

Most of the time we figure out OPREs based on code comments. Or in hacker speak, we glark the meaning from the comments.

Let me illustrate how ugly regular expressions are with a few examples. Here are some gems from the Regular Expression Library.

^(([0-9])|([0-1][0-9])|([2][0-3])):(([0-9])|([0-5][0-9]))$

What does this code do? It matches time in 24 hour format. For example these values match: 1:59, 01:59 and 23:59. These values do not match: 12:63, 25:60 and 13.10. Obvious, right?

^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$

Doesn’t this look like something you’d see scrawled across a blackboard in an episode of Numb3rs? This code matches ten digit US phone numbers. These values match: 2225551212, 222 555 1212, 222-555-1212, (222) 555 1212 and (222) 555-1212.

/^([a-z0-9])(([\-.]|[_]+)?([a-z0-9]+))*(@)([a-z0-9])((([-]+)?([a-z0-9]+))?)*((.[a-z]{2,3})?(.[a-z]{2,6}))$/i

Feel like curling up in the fetal position yet? This expression matches valid email addresses.

My advice for developers is to document regular expressions with clear comments. This will help your teammates preserve their sanity.

Posted in Software Engineering
Thursday, May 3, 2007

glassesHere is the definition of geeks, nerds and dorks from the Dojo Toolkit documentation:

Geeks, Nerds, and Dorks: A geek has a very focused knowledge of a subject (that guy that memorized the language of myst), a nerd is a master at many subjects (that girl you go to when you need homework help), and a dork is just plain socially inept (Napoleon Dynamite).

*insert nerd laugh here*

Posted in Software Engineering
Monday, April 23, 2007


Green Web Hosting! This site hosted by DreamHost. src="https://secure.newdream.net/green5.png" height="75" width="75" />
Earth Day?! Does the Earth need a day? It’s my favorite place to be. Dreamhost, my web provider, posted a blog entry about now being a so-called green company. So see, I did something good for our planet. My gazpacho.net domain is green. Sure beats rationing toilet paper.

Tonight I saw Richard Stallman give a lecture at University of Missouri Saint Louis. Expect for some political digs it was pretty close to information covered in the book Free as in Freedom. The question and answer segment was entertaining with guys asking about the latest draft of the Gnu Public License (GPL) 3.0.

I usually don’t kiss and tell. I don’t like to jinx a good thing. Last week I had a “real life” date with a woman I met over the Internet. It doesn’t seem to bother her that I’m a computer nerd. Who knew such women existed? :) We had fun; I’m looking forward to seeing her again. Anybody wanna give me pointers on dating a single mom? Last night we had a “cyberdate”. We both watched “Monty Python’s Quest of the Holy Grail” at the same time at our respective homes and traded IMs about it. LOL. Friends, you can call me a dork. I enjoyed it!

I added a coworker as a MySpace friend. Then her 15 year old son sent me a friend request. I’ve decided not to friend anybody under 18 (unless maybe they’re family). When I told her about his request, she seemed a little surprised. She told me she’s gonna go through his friends list with him tonight.

I downloaded a copy of the latest version of Ubuntu Linux. I plan to migrate my Linux server from Fedora to Ubuntu. My biggest challenge is going to be setting up email and configuring the Cyrus IMAP software. I spent a lot of time configuring my existing Postfix mail server. I have aliases and made tweaks to get it to work with SpamAssassin. So upgrading may be tricky.

Posted in Software Engineering
Monday, March 26, 2007

When I upgraded the video card on my PC, the screen started to temporarily blank out every once in a while. I noticed that this occurred around the times I accessed the CD-ROM drive or added a USB device. I suspect the ultra-quiet 300W power supply I have is not enough for the power hungry video card, hard drives and USB devices.

So today I bought a shiny new 400W power supply. When I got it home, I discovered it had a 24 pin connector. When did that happen? My motherboard has a 20 pin slot for the connector. I used to be on top of the latest specs. Is it me or did upgrading PCs used to be easier?

UPDATE: Duh! I looked at the connector closely and noticed a crease around the set of last four pins. With a little bit of twisting the block of four pins snapped off. So with the four pins separated from the 20 pins I was able to connect the power supply to my motherboard. Everything is up and running with no issues.

Page 2 of 712345...Last »