Recent Articles

Dec 2005

The Brillant Paula Bean, J2ME Edition

by in Feature Articles on

Being the end of the year and all, I thought it'd be appropriate to name the "Post of the Year." But, since that would involve trudging through a year's worth of posts, I decided instead to revisit the classic Brillant Paula Bean ...

Heidi S and Michael Hanson's employer was building an enterprise shipping/warehousing system but didn't have enough in-house resources to do it. One of the contractors they brought in to help fill the gaps was Paula, an "experienced Java programmer with strong knowledge of the shipping industry." For the first few months, things seemed to be going pretty well. At the weekly status meetings, Paula would report that good progress had been made and that things were looking good for the deadline.


If ++ Increments ... (++)

by in Feature Articles on

Another slow day, another revisited post. Even if you've seen the original, I highly recommend checking out the comments posted. There you will find a number of solutions (five pages worth) to the problem that Steve Local's ... less gifted ... colleague was having in C# ...


One2Pt20462262185th TwoPtZero

by in Feature Articles on

With half of the readers of this site away from work for the holidays, it's a great opportunity to replay one of my favorites, One2Pt20462262185th ...

I believe that we may have had a first yesterday. The coder behind yesterday's post offered a perfectly reasonable explanation: one-time use with a tight deadline. Fair enough. Now I really want to see Isaac's coworker offer some sort of explanation for this ... seriously ...


Pragmatically Registering

by in Feature Articles on

Even if you're pretty certain that your way isn't the best way, sometimes it's just easier to go with what you know instead of struggling with something new. I'm pretty sure that's what the author of today's code (found in the Sidebar) was thinking. He knew that to register a OCX library, you click the Start Button, then press R (for Run), then type in -- well, you get the idea.


Holiday Smorgasbord

by in Feature Articles on

It's been a while since I've done a smorgasbord post, so here goes ...


DM discovered the source of some rather ... unprofessional ... error messages in the log files ...


The Quadrasort

by in Feature Articles on

Stephan Müeller was overjoyed to hear that his coworker, The Specialist, had finally left the company. His coworker earned that title because he had the strange power to turn anything he touched into an unmaintainable, barely-compilable heap of codefiles: methods would swell to thousands of lines of code, case statements would branch to over ten levels, and so on. While browsing through his inventions, Stephan discovered the Quadrasort: it would sort a list of filenames formatted like "YYYYMMDDHH.ext". Sure, using the built-in Collections.Sort() method would do the trick; the format is, after all, designed for lexicographical ordering. But you have to admit, The Specialist's Quadrasort is that much more ... special ....

 


Uniquely Addressing

by in Feature Articles on

Mark Dryden works for a small software company with clients spread across the state. One of their clients had some in-house development skill but wanted to outsource a fairly large project: redoing their sales database. The client had a number of features to be added and wanted to improve its interface, which had a cyan-colored background featuring a magenta-colored map with sunshine yellow controls placed in seemingly random places. However, the in-house developer vehemently disagreed, claiming that this could be handled with a few simple tweaks instead of a costly, out-sourced rewrite.

The client held a meeting so that the in-house developer and Mark could meet and make their case for their solution. Having seen the code and database structure, and realizing that the GUI was actually the application's strong point, Mark knew it would be a fairly easily sell ...


Porting Java

by in Feature Articles on

Love it or hate it, one of the great things about Java is its portability. It abstracts out many of the platform-specific things so that you, the programmer, need not worry about things like file systems and how to create directories and the like. That said, Nick Smith was a bit surprised to learn that he was tasked with porting a Java application that ran on a UNIX host onto a Windows server. Not a big deal, he thought, that's what Java was built for ...


Printf to String

by in Feature Articles on

A lot of programmers have lost all hope after seeing this website. After all, most of the code I post here was found out in the wild, on real, live, production systems that some of you actually maintain. But today I'd like to offer a glimmer of hope: there are actually people who are out there who are fighting the good fight, doing their best to makes sure that code like today's never makes it to production.

You should all be thanking Kirk L. for being one of those guys. He discovered this in a code review of a colleague. The code also explained why there were hundreds of temp files in the working directory came and a huge leakage of file pointers. If you're not well-versed in C++, suffice it to say that while most people would simply use sprintf, our coder felt it better to format strings by writing temporary files to disk and reading them back ...


The Flat-File Society Does XML

by in Feature Articles on

A little while back, Phil introduced us to a group of developers from The Flat File Society who were forced to do relational database. Phil is still at the client site and was tapped to lend a hand with a communication project the programmers were struggling with. They were able to get their data in XML format, but the vendor still rejected it, despite the fact that they said they could transform one XML to another without problems ...


Listing a List

by in Feature Articles on

It seems that whenever I tell a Lotus Notes programmer about this site, their reaction is consistently, "you must have a lot of Lotus Notes code posted !" Of course, this is not to say that Lotus Notes is a bad language (I've never used it), but it is odd that I keep hearing this. No less, Drew Refshauge does a bit of Lotus Notes and was called in to a client to fix a strange bug: some lists stopped working after it had twenty items. Right away, Drew knew what was wrong: while most would simply put the name of a list field in a drop-down box to get its values ("=exp_newlocation"), the original coder figured that breaking the list apart and assembling it again was the way to go ...


Some Basic Error Handling

by in Feature Articles on

Ken's team recently inherited a VB6-based application. They were a bit a disappointed -- but not surprised -- to see that the application reinforced those certain stereotypes of VB applications. After a little while of going through and documenting the code, they were delighted to finally see some a comment and even error handling .... errr .... wait .... at least it was one of the nicer named functions ...


Logged to Death

by in Feature Articles on

"APPL IS COMPLTLY FRIED," Damien's emergency pager read, "CANT EVEN LOGON TO SRVR!!!" Damien dragged himself out of bed and VPN'ed on in. The middle-of-the-night page did not lie: any attempt at accessing the application resulted in an incomprehensible "Internal Framework Error," and the server prevented any logon attempts with something to the effect of "cannot load security profile." Fortunately, the logs were available ... all sixty-eight gigabytes of them. Damien was able to kill the logs, which were consuming every bit of free space on the drive and every bit of available memory, queued to write to disk.

A bit of investigation the next day revealed the culprit: the LogFillerPlugin class. Written by a "de-hired" coworker, its purpose was surprisingly not sabotage, but to ensure that the log properly wrote out 16k ... every single second ...


Hacking the jProject

by in Feature Articles on

Steve received a frantic call from client management, begging him to help fix their largest client's order entry system. In production for less than a year, the system was running as fast as a crippled tortoise and, short of upgrading to Blue Gene, they had maxed out hardware options. But none of this surprised Steve; this was, after all, a jProject.

jProjects, as they are known throughout the company, are projects destined to fail or turn into an unmaintainable mess. jProjects are, consequently, lead-up by the company's star developer, Jay. In addition to being wildly innovative, Jay manages to discover architectural flaws in programming, database, and other third-party tools when developing his own architecture.


Pop-up Potpourri: ?????(p???? Edition

by in Pop-up Potpourri on

You should know what these are all about by now ... here's the last one in case you missed it: Episode IV.


David Mills saved this MS Outlook error a few years back and was happy to see that it has found its place here. Me? I prefer to call those "Unexpected Error Exceptions". But I guess this works too ...


Fine, I'll Handle Exceptions

by in Feature Articles on

Highly-paid consultants seem to get a lot of flak on this site, especially those who's number negation algorithms come with the prerequisite of installing an extra CPU fan. But certainly not all highly-paid (or, in Kent's case, highly-billed) consultants are bad; heck, Kent's job is to actually go in and make things better! Fancy that.

At a client's site a while back, one of Kent's responsibilities was to start code reviews for the developers. During one of the first reviews, he noticed a certain develop had no exception handling code. "Yah yah yah, I know," the developer explained, "I was just being lazy." A few days later, the developer returned to code review with his exception handling changes, each taking the form of this ...


Library.Math.Functions.3rdGrade.FindTheRemainder()

by in Feature Articles on

James Newton's story needs no introduction ... so ... enjoy!

My second job as a programmer was working for a defense contractor. One of the things I did there was maintaining a library of code that was being used by a few tens of projects. One day I got a bug report in saying that if a time class (some particular time system) was constructed with a large number it would hang the program in a busy loop. The number passed in was simply the number of seconds from an epoch.


All Talk and No Code

by in Feature Articles on

You know that you're really in for a treat when, after joining a large, on-going project, your technical overview consists of an email from the lead architect that reads "I have commented just about everything; you should be able to figure it out without a problem." Our anonymous poor soul who submitted this didn't quite realize how fun it would be ...


Functionally Illogical

by in Feature Articles on

Subroutines are one of those programming constructs that predate computers themselves; the Wikipedia dates their usage back to Ptolemy's time. They live by many different names -- functions, procedures, named-squiggly-brace-blocks, etc -- and exist for two primary reasons: to allow for code reusability (not the copy-n-paste type) and to break down and simplify long and complex code. Bas ter Brugge came across a series of functions that not only fail to accomplish those goals, but actually manage to be longer to type out than the code they contain ...


Painting Qualifications

by in Feature Articles on

If you've ever posted a job opening in the newspaper or website, you're probably very familiar with the scan-and-trash technique of dealing with resumes. Half of the resumes I've filtered through shared this fate, many a result of the candidates’ difficulties in spelling the technologies they were proficient in (e.g.: Micro Soft Visuals: Basics, C, C+, C#, C++, Java, Internet). Rafael de la Torre was scan-and-trash filtering through a pile of resumes and stopped for a double-take on this Emule/Kazza-qualified candidate ...

Computer Science

  • Programming : Average knowledge about programming in Visual Basic, C, PHP, HTML, SQL, Mysql, MS Dos.
  • Databases: Average programming knowledge in Oracle 8.0,Visual Basic, Mysql.
  • Networking: Average knowledge in network administration and setup.
  • O.S.: Average knowledge in Windows and Linux: Redhat 7.0,Mandrake 8.0.
  • Web Design: Average programming knowledge, http://some-ugly-as-hell-web-site-made-with-an-online-page-builder/
  • Servers: Basic knowledge about web server administration (Apache), proxy server administration.
  • Computer assembly and repair: Advanced knowledge as a technician, effective use of the Internet.
  • Office suites: Word, Access, Excel, Power Point,Outlook.
  • Others: Paint Shop Pro 7, PhotoShop, Emule, Kazza, Paint, WordPad, Acrobat Reader, Winzip, WinRar.

My List Is Emptier Than Your List

by in Feature Articles on

Joe H. was reading through the documentation of his company's custom-built Java framework and came across today's bizarre example. It would seem that the framework builders (who have since moved on) preferred to use the EmptyList in a number of places in lieu of an Empty List.