Richard Tallent’s occasional blog

Two Code Smells to Learn from Apple’s SSL Security Bug

I was reading an excellent ACM article on the recent Apple security bug, and it struck me that the author skipped completely over one of the *true* root causes of this bug. Here’s the buggy code: if ((err = SSLFreeBuffer(&hashCtx)) != 0) goto fail; if ((err = ReadyHash(&SSLHashSHA1, &hashCtx)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &clientRandom)) != 0) goto fail; if ((err = SSLHashSHA1.update(&hashCtx, &serverRandom)) != 0) goto fail; if ((err = SSLHashSHA1. Read more →

C# 6.0 — Wish List

I was reading this blog, and had a few thoughts of my own about what should come next in C#. 1. Monadic null checking. This was #7 on the aforementioned blog. Used correctly, this could be a good time-saver. 2. VS support for columnar-aligned code. This is really a Visual Studio thing, but I really wish the IDE wouldn’t try to stop me from using tabs to align my code. I’ve been doing this ever since I learned COBOL, and probably before that. Read more →

The Missing Computer for the Elderly

My grandparents, now in their early 80s, are visiting from Tennessee this week. They are still incredibly independent, living at home half the year and driving their RV down to Florida every winter. But they aren’t in perfect health, especially when it comes to vision, and though they have Facebook and email, they aren’t computer experts. Let’s just say their email addresses still end with “@aol.com.” My grandfather wanted to buy a new laptop, since his is “too slow. Read more →

Word for OS X and Huge PDFs

I saved a PDF file from Word for Mac 2011, and noticed that this tiny 3-page Word file (some text and a logo, a prospectus for the Beaumont Art League) was weighing in at 2.2MB! Unfortunately, I didn’t notice this until after I sent it as an attachment to board members and staff. After bumbling around online, I found this solution on Eduardo Valle’s blog. His solution didn’t work for me, but an alternate solution offered in the comments worked perfectly — saving the file as an old-school DOC file, and exporting to PDF from it instead of my DOCX master. Read more →

To NULL or not to NULL, the answer is still NULL

I randomly came across this post by Paul White while reading this question on StackOverflow. I don’t have much to add to Paul’s excellent little trick here, other than to say this exact situation came up last week for me and I was kinda wishing Microsoft would add the “IS DISTINCT FROM” operator to MSSQL. Great tip, I’m going to have to share this one at work. Read more →