A Tale About Problems of Scale
I earned some new bragging rights this week and had fun doing it. I love computer science!
A tale about iteration, unexpectedly large data sets, and time...
About a month ago, a large file of data unexpectedly needed to be processed, using some pre-existing code written several years ago. This code happened to be written in Java, but this story could apply to most any commonly used programming language. It was a batch process, so speed wasn't of the utmost essence, but at the same time it shouldn't run on and on and one because other files also needed to be processed. The data set was 500K records, whereas the larger data sets normally are in the 20-30K range, so this was more than 10x the norm.
Everything seemed to be going fine. The file was read into a database and some processing had been done on it and the time had come to write out a result file. Along with results, the original programmer had wanted some statistics, so there was a quick iteration through all of the records to gather the statistics and then the results would be written into the file. It seemed straightforward and I didn't expect anything to go wrong. When things go wrong on files, my experience has been that they usually go wrong earlier on.
The Christmas That Santa Got His Geek On
This year I received a lot of geek books for Christmas (2009), and I'm so delighted and intrigued by them that I thought I'd share them here and maybe somebody else will discover a wonderful book to read.
These are the six books I received:
- The Code Book, The Science of Secrecy from Ancient Egypt to Quantum Cryptography, by Simon Singh
- Train Man, the novel, by Hitori Nakano
- Zero, The Biography of a Dangerous Idea, by Charles Seife
- The Geek Atlas, 128 Places Where Science & Technology Come Alive, by John Graham-Cunningham
- The Annotated Turing, A Guided Tour through Alan Turing's Historic Paper on Computability and the Turing Machine, by Charles Petzold
- e: the Story of a Number, by Eli Manor
I haven't had time to read any of the books yet, but have thumbed through all of them enough to give a brief overview and my first impression of the quality of the book. It should be noted that these books were all on my Amazon.com wish list (thanks to Amazon for suggesting them for me) and I've read the reviews and any excerpts that were available.
The book that I've given the most attention to so far is The Code Book, and that's because I have three puzzles to solve. After my brother-in-law saw that I'd received a cryptography book, he asked if I like that sort of stuff and then promptly produced printouts for three puzzles he needs to solve to be able to locate geocaches. (I've solved two so far and one is partially solved)
Scala Cheat Sheet Created
I started teaching myself Scala this week because I want to speed up coding of new projects without sacrificing quality, readability, reliability and performance. Scala seems like a good choice for this. I've also been interested in learning more about functional programming, and exploring the concurrency benefits that functional programming can bring to the table.
I've read halfway through a book on Erlang , another functional programming language, and am finding many similarities to Scala. (That book, BTW, "Programming Erlang: Software for a Concurrent World", by Joe Armstrong , is an excellent book and I highly recommend it.)
So far, I'm liking Scala a lot. It's comfortable because of it's close ties to Java and the fact that it runs in the JVM. It's also compatible with much of the Java code I've written in my life, so that's a huge plus!
My only complaint at this point is with the documentation I've found. There's a lot of great online documentation, but the quick start articles I've read thus far seem to skip all over the place and leave a lot out, so I find myself flipping from one to the other trying to make sense of what I'm reading. It would be a lot easier if I had a concise reference to glance at.
I decided that what's needed is a cheat sheet (pdf), but then couldn't find one, and because necessity is the mother of invention, I've written my own. [Update, most recent cheat sheet version now available on Github]
Now beware, this cheat sheet was created by a newborn 3-day old Scala programmer, so there may be a lot of corrections needed, and I'm certain it needs more information added to it, but I think this is good enough to start with for a quick start guide.
[Update: I've made several improvements and added a version number that I'll increment every time I update it. (Note: instead the Scala cheat sheet has been added to github)]

Scala Cheat Sheet by Julie Bovee Hill is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
References for the quick start cheat sheet:
The Busy Developers' Guide to Scala series:
- “Don't Get Thrown for a Loop”, IBM developerWorks
- “Class action”, IBM developerWorks
- “Functional programming for the object oriented”, IBM developerWorks
Scala Reference Manuals:
- “An Overview of the Scala Programming Language” (2. Edition, 20 pages), scala-lang.org
- A Brief Scala Tutorial, scala-lang.org
- “A Tour of Scala”, scala-lang.org
"Scala for Java programmers", A. Sundararajan's Weblog, blogs.sun.com
Be a Wizard of SSL
SSL Tricks and Tips
Many of the developers I've worked with treat SSL as if it's the carrier of a new and virulent plague or the product of evil magic. They duck and run for cover whenever the boss shows up looking for someone to battle a new error. Having not ducked fast enough, I've found myself face-to-face with SSL on many occasions, and have survived to overcome the intimidation factor and tell you that solving most SSL problems is a snap and anyone can learn to do it. By becoming the SSL go-to person in your IT department, you'll win fame and recognition as the great defender against evil magic. I reveal below these mysterious secrets of common SSL problems and some simple tricks and tips for solving them.
Expired Certificate
Probably the most common problem is that the certificate can expire. When the certificate expires, the site breaks. You can view the certificate in your browser to see the expiration date when you try to load a page that is using an expired certificate. This is usually accomplished by right clicking on something, and differs by browser, so I'll leave you to learn how to view the certificate in your preferred browser.
Solution: Purchase a new certificate and follow the instructions to install it.
If you already did purchase and install a new certificate and you're still having problems, then it's likely a configuration issue, so check the "Certificate Configuration" section below.
Do You Verify Your Downloads?
Do you verify the integrity of your downloads?
I saw a notice announcing a new release of Apache Tomcat Native this morning, and when looking at the page, saw the usual notice, as follows:
"Use the links below to download Tomcat Native from one of our mirrors. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory."
That made me wonder how many people who download actually do verify the integrity of their downloads? I know I do, but I've worked with developers who don't. It would be interesting to do a poll on that. I'd also be interested in knowing of any cases where the integrity verification failed. I've never had one fail.

