Comparing integers using Integer.compare vs subtraction

04 August 2015

TL;DR: Use Integer.compare to avoid overflow that can occur when subtracting two integers.

Read More...

Formatting Pygments linenos with Jekyll and Bootstrap

03 June 2015

This blog is generated by Jekyll and uses Pygments to highlight code syntax. This post describes the process I used to setup Pygments and style code snippets. [Update: For formatting code blocks with Jekyll version 3 please see formatting code with jekyll 3 and bootstrap] [Update 2: Github has updated to Jekyll 3, so this site now uses Jekyll 3 and the rouge highlighter.]

Read More...

Swift Programming Language Questions - The Basics

23 May 2015

I’ve been playing around with Swift and going through Apple’s Language Guide for Swift. I created some quiz questions for myself based on the first chapter. These questions do not contain all the topics covered in the chapter. For example, booleans are excluded as I am comfortable using them.

Read More...