Advice to CS Undergrads

Since I’m starting my PhD this year, I have been reflecting on how I would be different if I went back in time and started my degree all over again. I am also continuing tutoring, in my 4th year, and I have been occasionally approached by students and asked for general advice with their studies. […]

Regularly Divisble

Update: read the comments at Hacker News to see some succinct approaches to this, as discussed by gjm11, qntm and patio11. Thanks to Robin for providing this demonstration that can find a regex for testing divisibility of any number, in any base (he also made the code available, nice). Earlier this year, at the advice […]

Things Smarter People Said #1

I am currently reading Code Complete 2 as per Jeff Atwood’s Recommended Reading for Developers list, where I came across this interesting quote by Glenford Myers: We try to solve the problem by rushing through the design process so that enough time is left at the end of the project to uncover the errors that […]

How to Win Friends and Generate People

I’m doing a project for a subject at RMIT which needs to manage thousands of patient records for a hospital. We haven’t been given any sample data though, so I wanted to write a generator (so we can test it with small or large data sets whenever needed). I started with the name generator (in […]

Nanosecond Timing

My Uni (RMIT) uses a mixture of Solaris, Mac OS X, Linux, and Windows computer labs. Our programs are nearly always tested on Solaris, though. Sometimes we are required to provide nanosecond timings in our experiments using the (real-time) POSIX function gethrtime(). Depending on which lab I work in, or if I’m working from home, […]