snoofle

After surviving 35 years, dozens of languages, hundreds of projects, thousands of meetings and millions of LOC, I now teach the basics to the computer-phobic

Jul 2014

Tablemania!

by in Feature Articles on

We've all heard of dates. Not the kind with someone to whom you're attracted. No, I mean the kind that represent some relative position on the calendar. Now we've all seen what people do when faced with the extremely difficult task of working with dates. Short of programming in brainfsck, intelligent programmers use the built-in variety, be it in C#, Java, etc.

Sometimes, you need to be able to identify different parts of a date. But, given (let's use Java as an example) a java.util.Date, how on Earth can any reasonable person possibly figure out the year without too much grief? I mean, it's mathematically hard to convert all those milliseconds to years. There must be a better way to identify years!


Doing a Split...the Hard Way

by in CodeSOD on

Way back when Java first came out, if you wanted to split a string into tokens, you had to roll your own mechanism to do so. Of course, even as far back as Java 1.2, there were some built-in secrets to help you tokenize your string so you could iterate over the tokens.

David S. found this little gem written by one of his cohorts in a very recent version of Java (which we all know has absolutely no way of splitting a string into tokens).


Just Roll With It

by in Feature Articles on

DBAs are supposed to bring knowledge of the underpinnings of databases to the table. How to lay out tables and indices across disks for linear vs. striped access. How to properly set up partitioning for different types of access. Granting assorted privileges and roles. Managing backup and aging off data in a controlled manner, and so forth.

Some take pride in showing developers the "right" way. Some are maniacal in their tight-fisted my-way-or-the-highway approach. Others seem better suited to a career of asking do you want fries with that?

6sided dice

if(useTCP) return;

by in Feature Articles on

A long, long time ago, in a phone company long since gone and resurrected, if Aunt Bee wanted to call Sheriff Andy, she picked up the phone, pressed the receiver a couple of times, the operator picked up, Bee said to connect her to Andy, and the operator shoved a jack into a hole to complete the circuit. For long distance calls, two or more operators and switchboards were involved. It left something to be desired, but it worked.

Fast forward a while, and Vint Cerf and Bob Kahn got the idea to automate it all with a packet-switched network. David Reed designed UDP, which helped eliminated the operators sitting at switchboard jack panels, but didn't guaranty delivery of the packet, and if the packets did arrive, there was no particular ordering to them. This fire-and-forget mechanism was fine for the sender. Not so much for the recipient.