Recent posts
A word of caution when using HashSet
The HashSet is a “class [which] provides high-performance set operations. A set is a collection that contains no duplicate elements, and whose elements are in no particular order.” Common set operations such as additions, deletions, or containment checks can be done in O(1) time. It’s not difficult to come up with use cases where this may come in handy. read full post
The horrible implications of cheating at the Google Hurdles doodle
So Google has a hurdles doodle up where you play as an athlete competing in the 100m hurdles. You run by alternating between the left- and right arrow keys, and jump with space. Alternate left and right faster and you run faster. Obviously being a programmer this means I will run like the fastest bastard that ever lived: read full post
Protocol-relative URLs
Here’s a neat trick I’ve learned today: protocol-relative URLs. How do they work? Well, consider my current homepage, which has a link on it to this blog. My homepage can be viewed both over HTTP and HTTPS. Previously, the link to my blog looked like this: read full post
Writing a decimal number as a fraction
The decimal number 2.5 can also be written as the fraction 5 / 2. 19.2 becomes 96 / 5. 0.24 becomes 6 / 25. Etcetera. So how can you do this programmatically? Well, it turns out a naive solution can be obtained pretty quickly. read full post
Project Euler: Problem 15
The next Euler problem is here: read full post
Project Euler: Problem 14
Here’s problem 14 of Project Euler: read full post
Project Euler: Problem 13
It’s been over a month since I did any Euler problems, so I’ll be posting some of those the coming week. Here’s problem 13: read full post