3 things: Swift functions

22 October 2017

This week’s post is all about Swift functions.


3 things: Swift, CRISPR, WEIRD

15 October 2017

I’m trying something new. I’m going to record three things I learned or found interesting in the past week. I don’t think these will be long or in-depth posts. Just a quick note to myself about where my mindset was for the past week. I’ll see if I can make a habit of it or not.


Make An UIWebView Transparent

11 July 2017

I’ve been playing around with iOS. One challenge I came across was how to make a Web View transparent. I found two ways to do this: using the Interface Builder in Xcode or using Swift.


3 Things I learned from the Introduction to Mathematical Thinking class

10 June 2017

I took the Introduction to Mathematical Thinking class to improve my logical thinking. I found the class difficult, but I enjoyed it. The class covered many topics including truth tables, number theory and real analysis. The following are three things I learned that I can apply to programming or every day life.

1 - Understanding versus solving a problem

When faced with a problem it is natural to want to dive in and solve it. However, it is important stop and examine the problem. Is there a pattern? Does everyone have the same context for the problem? Is there ambiguity about the requirements?

Mathematical thinking focuses on understanding a problem rather than rushing to solve it. This is because finding the answer solves that one problem. But, understanding means the solution can be applied to many problems.

One example from the class was to find the double meaning in the following statement:


I'm taking a math class

16 January 2017

I’m starting 2017 by taking Coursera’s Introduction to Mathematical Thinking class. In my previous post I noted I should focus on programming projects. I realize I am distracting myself from that goal. However, I am taking this class for the following reasons:


2016 Reflections

31 December 2016

What I did in 2016:


  • I coded!
  • My python knowledge has improved.
  • I contributed a small amount to open source.
  • My command line skills have improved.


  • I did not have a focus. I split my time among coffee script (hubot), wordpress and python.
  • The time spent on hacker rank distracted me from doing another project.
  • Nothing gets done in December. It is all illness and family functions.

What I can do to improve in 2017:

  • Focus on projects. Come up with a plan on what I want to work on and stick to it.
  • Pick a language to focus on.

Happy New Year!


On deleting code

29 November 2016

This blog post is my journey on creating, debugging and deleting a unit test.

A frequent choice every programmer faces is whether a piece of code belongs in a program. I was working on a hobby project recently where I faced this choice. I had written a number of unit tests and after some reflection deleted one of the test to improve my code quality. At first read this sounds counter-intuitive. Don’t unit tests improve code quality? Generally, yes they do. But good unit tests need to be repeatable, maintainable and quick to run.

In my case I had created a Trie and some unit tests to validate it. In my test code I created a small Trie which contained 11 entries. However, I wanted to test against a larger set. So, I decided to use the dictionary file in /usr/share/dict/words.

I created the following unit test:


How to view a web page on a mobile device from a server running locally on my computer

24 October 2016

When developing a website, I like to run it locally on my computer. This allows me to quickly see the changes I have made. But running the web server locally means I cannot view it on my mobile. How do I solve this? By setting the web server to listen on instead. Now I can see my work from my mobile! But what is Let’s explore.


Application Monitoring On A Raspberry Pi

29 September 2016

One of the things I use my Raspberry Pi for is to run a twitter bot. I want this bot to run without much manual intervention. So, I want to be notified if it encounters any errors or is not running. To do this I use Papertrail and Dead Man’s Snitch. I use the free tier plan for both services.


6 ways to compare two files on Linux

20 August 2016

Comparing two files is a common task. On my MacBook I use the FileMerge (opendiff) app, which is part of the XCode tool-set. However, there are times when I am at the Linux command line and need to compare two files. In this blog post I will show how to compare files at the command line and with the emacs and vim editors.