So a few days ago I came across this video on Digg discussing a programming question sometimes used in interviews, code the game FizzBuzz.  I've never had to do this since I've applied for a programming job, but I liked the idea of trying to figure out how many ways I could code FizzBuzz in Swift.  To make this a bit more fun I gave myself an hour to try and come up with the most convoluted and the simplest solutions I could.

The Rules

  1. Print the numbers 1 through 100, one number to a line
  2. If the number is divisible by 3, print "Fizz" instead
  3. If the number is divisible by 5, print "Buzz" instead
  4. If the number is divisible by both 3 and 5, print "FizzBuzz" instead

The Loop

So the first part of this game is a simple loop and there were really only two options available a for and a while loop.  They would look something like this.

var counter : Int = 1
let counterLimit : Int = 100

//While Loop Option
while counter <= counterLimit {
    //Do Something
    counter += 1

//For Loop Option
for i in 1...counterLimit {
    //Do Something

Running The Tests

The rest of the program just requires that we test the number to see if it is divisible by 3, 5 or both.  The sequence of our tests matters because doing things backwards would require more tests to cover the same scenarios.

//Requires fewer tests
for i in 1...100 {
    if i % 3 == 0 && i % 5 == 0 { print ("Fizz Buzz") }
    else if i % 3 == 0 { print ("Fizz") }
    else if i % 5 == 0 { print ("Buzz") }
    else { print ("\(i)") }

//Requires more tests
for i in 1...100 {
    if i % 3 == 0 && i % 5 != 0 { print ("Fizz") }
    else if i % 5 == 0 && i % 3 != 0 { print ("Buzz") }
    else if i % 3 == 0 && i % 5 == 0 { print ("Fizz Buzz") }
    else { print ("\(i)") }


The simplest solution I could think of was the same as what was presented in the video, although you could get "fancy" using an array to capture the results instead of just printing them out.  But that may not be as efficient from a resources perspective.

for i : Int in 1...100 {

    var output : String = ""

    if i % 3 == 0 { output += "Fizz" }
    if i % 5 == 0 { output += "Buzz" }
    if output == "" { output = String(i) }

    print ("\(output)")



My complicated answer just does a lot of work that can be simplified through the use of the modular (%) operator.  There are clearly better ways of doing this.

//Function to determine remainder equals 0 (true)
func remainder (number : Int, divideBy : Int) -> Bool {
    let result = number % divideBy
    if result == 0 {
        return true
    } else {
        return false

for i in 1...100 {

    if remainder(number: i, divideBy: 3) && remainder(number: i, divideBy: 5) {
        print ("Fizz Buzz")
    } else if remainder(number: i, divideBy: 3) {
        print ("Fizz")
    } else if remainder(number: i, divideBy: 5) {
        print ("Buzz")
    } else {
        print ("\(i)")
AuthorLee B Wilson

If we're going to have a conversation on productivity a definition is probably as good a place as any to start this conversation. While its a bit cliche, let's see what Mirriam-Webster define productivity as

the quality or state of being productive and they define productive as having the quality or power of producing especially in abundance

These certainly aren't the only definitions out there, but they were the first listed. What I found interesting was that they implied that abundance was necessary in order to be productive and made no reference to quality or time. This definition may be more applicable to manufacturing, but if I think about fields like IT abundance isn't always desired, especially when you're building a solution for a single client. This definition is therefore too generic for me so let's try to construct an updated definition which we can apply to our conversations going forward.

In my mind productivity is composed of three separate components

  1. Quality
  2. Time
  3. Repeatability

Quality is pretty straightforward and refers to the characteristics of the output. For example, how many bugs exist in a piece of software or how many units of your new electronics device are returned because of physical defects. The catch with quality is that it's subjective, not everyone will encounter your software bugs, or receive a broken electronics device and you can suffer from a vocal minority's opinion.

Time I'll define as how long it takes to do something, however we're not referring to just clock time. When we discuss time it will often be necessary to understand how many steps are required to complete a project or manufacture a product. It is also important to remember that less time or fewer steps doesn't always lead to better productivity, sometimes those seemingly unnecessary steps are there for a reason.

Repeatability is just that, can we consistently and accurately perform the same steps over and over. This is where we'll get into the topic of automation. In electronics manufacturing it makes sense to use automation because the steps to build a cell phone are always the same. However, if you're a woodworker hand crafting a table, automation may not be as useful. It's important to recognize when tasks can be automated to improve productivity versus where manual repetition and practice makes us more efficient in performing a task and therefore more productive.

Given these factors I would start to define productivity as

The ability or power to repeatably perform a task or create something while balancing the time (steps) to completion and overall quality

I'm sure this definition will change as I learn more, but I feel comfortable that it's a good starting point, and see where it takes us from there.

AuthorLee B Wilson

As is the current fashion in Hollywood, every franchise gets a reboot. So if Hollywood gets to reinvent itself with fancy new graphics and a marginally different storyline then why not do the same with my personal blog?

This website has had several reboots before, none of them successful, but in the past I really didn't care. The reason being that wasn't meant to be an important place. This site was really a place for experimentation and learning. A place for me to learn about Content Management Systems (CMS), HTML, CSS and other web technologies without bothering to manage my own server. Could I have done it cheaper, yes, but because sponsors so many of the podcasts and online content I enjoy it seemed right to support them as well, so here I am.

The site however can no longer serve no purpose, which is why this reboot is taking place.

What will this site ultimately be? I have no clue. What I do know right now is that there are topics I'd like to explore and it seemed appropriate to document my journey somewhere so why not here.

The first topic I'll be delving into is productivity, which I'm sure sounds fascinating but is something I spend a lot of time thinking about (more on that in a later post). As for what else I'll be covering that's still to be determined.

Could this be another failed reboot? Yes, it's possible. But I'm hoping that won't be the case. This time I'm going in better aware of the flaws that led to failure in the past and interested in learning what else I can do to be more productive.

I won't promise regular posts just yet, but I can promise there will be a second post. Stay tuned.

AuthorLee B Wilson

Last year for Black Friday, had a fantastic deal on an Acer c720 Chromebook so I decided to grab one.  I'd been wanting to test ChromeOS and live "la vida google" for a while.  After 2-3 months I decided that ChromeOS wasn't for me.  I'm an old school computer user, I need a command line, and I need actual applications and not web apps.  This isn't to say that ChromeOS is a bad operating system, it wasn't, and if you live purely online I think it will get the job done.  

That said, I had this c720 which I now needed to find a purpose for.  I had heard that the c720 could be converted into a nice Linux laptop, and so for my maker project in February I decided that I would convert the c720 into an Ubuntu laptop so I could write code, and goof around online.

Here are the steps I followed to make this work.  I'll include the source URLs when I can.

Step 0 : Remove the screw.


In order to get the c720 to boot consistently into Ubuntu you need to be able to flash the NVRAM of the c720.  There is physical write protection on the motherboard in the form of a screw, URL below has an excellent picture of the motherboard and where that screw is located.  It isn't hard to remove.  Once removed just replace the bottom cover but don't screw in the bottom panel, you'll need to replace the screw later.

Step 1: Enable Developer Mode and Flash the NVRAM


ChromeOS uses a special BIOS and so in order to have a reliable Ubuntu machine you first need to flash the BIOS to get SeaBios running.  

  1. Press and hold ESC + F3 then press the POWER button.  This puts the Chromebook in Recovery Mode
  2. Press CTRL+D to enable Developer Mode and CONFIRM.  The Chromebook will work for a bit and reboot.  Leave it alone for a few minutes while it completes.
  3. At this point you've restored the machine and it has losts its configurations.  When you get to the configuration screen press CTRL + ALT + F2 to bring up the prompt.
  4. Login with the userid chronos.  There is no password.
  5. At the prompt access the superuser shell
    1. sudo bash
  6. Enable SeaBIOS
    1. crossystem dev_boot_usb=1 dev_boot_legacy=1
  7. Reboot the machine

At the white splash screen you can press CTRL + L to boot into SeaBIOS.  Otherwise the machine will boot into ChromeOS if you wait a few seconds.  To make SeaBIOS boot by default we need to run a few more commands.  Return to the ChromeOS superuser shell and run the following.

sudo su

flashrom --wp-disable

flashrom --wp-status

This last command should return the following values (there could be more)


Set SeaBios as the default by running 0x489

flashrom --wp-enable

Turn off the c720 and return the screw you removed from Step 0.

With that done you can now install Ubuntu.  Insert your 14.04 install media and install Ubuntu normally.  Make sure to attach an external USB mouse to the c720, by default the trackpad on the c720 will not work with Ubuntu 14.04

Step 2 : Ubuntu

Once installed and online give Ubuntu a few minutes and it will prompt you to perform some updates.  Let Ubuntu update, once done we can fix the trackpad and boot time issues.


First we'll fix the trackpad.  Luckily someone online has written a script to get all the work done for us.  To get started open a Terminal window and enter the following:

bash kz917j

Type in your administrator password when/if prompted and reboot when done.  Make sure not to touch the machine while processing.

To fix the boot time and other issues with the suspend, follow the instructions on this site.  I'm not including them here because it involves editing a couple of files and I like how the author of this site presented the information.


With that done you should have a functional Ubuntu laptop for not a lot of money.  You may need to map some of the volume and brightness keys, but that can be easily done through the System Settings panels in Ubuntu.  In addition, I be careful with any update that involves changes to the kernel and that might break some of these fixes.

AuthorLee B Wilson