It's Log, Log, Log

by in CodeSOD on

Logarithm keys

Reader Bernie submits for our approval this wonderful C# log base 2 implementation. He says: “We can distinguish two halves in that code. It looks like it was originally written for an unsigned 16-bit int, and later on extended for signed 32-bit integers.”

The Missing Source

by in Feature Articles on

Source code project 1171

The year was 2006. Nelly Furtado was getting promiscuous, the Winter Olympics were in Italy, and Domino was an application developer for Rocketware, a company that produced multimedia applications. Back then, applications were still commonly distributed on CD-ROMs: small round disks of plastic that contained grooves that could be read by a specialized laser and interpreted as data. This was handy in a period when only 30% of Americans had broadband Internet.

Wait...Press What?!

by in Error'd on

"Um, I'm not sure the programmers and the engineers were working together on this one," wrote Rob.

The Keys to Cloud Storage

by in Feature Articles on

When you want to store data in Amazon’s S3 cloud-based storage, you have to assign that data a key. In practice, this looks and behaves like a filename, but the underlying APIs treat it like a key/value store, where the value can be a large data object.

S3 is flexible and cost-effective enough that Melinda’s company decided to use it for logging HTTP requests to their application. These requests often contained large data files for upload, and those files might need to be referenced in the future, so a persistent and reliable storage was important.

Not A Fan

by in Feature Articles on

Red computer cooling fan

Larry worked in the IT department of a medium-sized financial company. Bright and early on what should have been a promising day, the phone rang. Larry cursed the caller ID for informing him that Graham was on the line. The resident old man of the office and bane of IT, he frequently disregarded sound advice and policy to satisfy his own whims.


by in CodeSOD on

How about those NoSQL databases, huh? There’s nothing more trendy than a NoSQL database, and while they lack many of the features that make a traditional RDBMS desirable (like, um… guaranteeing writes?) , they compensate by being more scalable and easier to integrate into an application.

Chuck D’s company made a big deal out of migrating their data to a more “modern”, “JSON-based” solution. Chuck wasn’t involved in that project, but after the result went live, he got roped in to diagnose a problem: the migration of data from the old to the new database created duplicate records. Many duplicates. So he took a look at the migration script, and found piles of code that looked like this:

Optimizing the Backup

by in Feature Articles on

Leslie, head of IT at BlueBox, knew there was trouble when one of her underlings called her at 3AM. “The shared server’s down,” she said. “Disk failure. Accounting can’t issue invoices, design can’t get to its prototypes, and the CEO just lost his PowerPoint for next week’s conference speech.”

BlueBox, like many companies, kept many important documents on a shared server. It also held personal directories for every employee, and many (like the CEO) used it to store personal files. That data, totaling 100 GB, was backed up to a remote server every 24 hours. “Okay, swap out the disk and restore it.”

A Case of Mistaken Identity

by in Error'd on

"Wow, even Google doesn't understand the current mess that is British politics," writes Mike R.