My son and I competed as team “Blue Iris” in the ICFP 2017 programming contest.
The ICFP programming contest is an annual
3-day programming contest sponsored by the International Conference on Functional Programming.
Functional programming is an
approach to writing programs that stresses writing as much of the program as
possible in terms of functions. That’s as opposed to the more commonly used
In the contest, people form teams to compete for three days to solve a
problem, using any combination of programming languages. People compete for
the joy of problem solving in the language of their choice. It’s common for
people to use outlandish or obscure programming languages. It’s sort of like
the Wacky Races of programming
I’ve competed in this contest about six times over the past 10 years. This
year was the first year my son joined me. My son’s got about a year’s worth of
programming experience, mostly in Java. He was eager to compete in the contest
with me this year.
This year we happened to be on vacation in Taiwan during the contest. It’s hot
and humid in Taiwan, but the internet infrastructure is great, so we expected
to not have any problem competing.
The contest started at 8pm Friday night Taiwan time. I prepared by buying a 2
liter bottle of Coke Zero at the local Wellcome market, and we eagerly waited
for the contest to begin.
Each year the problem to be solved is revealed as the contest begins. The type
of problem varies by year. This year’s problem was to write a program that
claimed edges on a graph. The goal was to construct a path from a “mine” node
to a set of “customer” nodes. Scoring was based on the number of customers
After reading the problem description, we had to decide what programming
language to use. We were originally considering Python. But because the
problem had strict execution time limits, we decided that it would be better
to use a faster running language.
I decided to go with Go, for the following reasons:
- I knew Go and its libraries well.
- Go runs well both on MacOS (where we were programming) and on Linux (where the contest organizers would be judging the program.)
- Go has easy-to-use networking libraries.
- Go has easy-to-use type-safe JSON marshalling and unmarshalling code.
- There was the potential to use Go’s goroutines for extra performance.
We got to work, reading the problem specification and starting to write the
I had hoped to do pair programming, but that didn’t work out. The time scale
wasn’t right. I’d say “OK, now I’m going to write the structs we’re going to
use to read in the JSON”, and then I wouldn’t say anything else for an hour,
while I was doing that. Imagine how boring that was for my son!
I also regret that the time pressure meant that I couldn’t answer my son’s
tangential questions – “What’s a graph?”, “What’s functional programming?”,
“What’s JSON stand for?”. I should probably have given up on trying to
compete, and instead used the time to educate my son. D’Oh!
Friday night we got as far as communicating with the contest’s servers and
reading in the problem’s JSON configuration file. My son was helpful in
monitoring the contest web site and twitter for announcements. He also helped
read the spec and serve as a foil for debugging.
Saturday morning we got up early, had a quick breakfast, and got to work. We
made steady progress, although as is typical we lost a few hours to dumb
mistakes. The worst one was a stray printf that broke the offline mode of the
My son installed an IRC client (his first time using IRC) and he enjoyed
monitoring the contest IRC channel. He helped other contestants overcome
issues that we had already encountered.
By lunchtime we had our first working program, that simply picked the first
unclaimed edge on the map. It did surprisingly well against some opponents on
We ate delicious pizzas from the local Maryjane Pizza restaurant, and then went back to work.
By 6 PM we had our final lightning round, which tried to create paths from
mines to consumers. It worked, but not very well. Still, good enough for the
We spent a few hours decompressing and researching graph algorithms to use in
the main contest, and then went to bed.
On Sunday morning (day 2 of the contest) we decided not to continue with the
main contest. Our reason for quitting was a combination of burnout and
disinterest, combined with the sense that some teams were doing much better at
solving the problem.
What went right
- We blocked off a whole weekend to compete in the contest.
- We had the contest VM installed and running before the contest began.
- The Go programming language worked well.
- The JSON, networking, and IO libraries were great.
- Very few platform-specific issues between MacOS and Linux
- Go made it easy to call an OS API on Linux to fix the lamduct EAGAIN issue that caused much heartburn to teams using languages like Java.
- Super fast compile time.
- Makefile-less build. The entire build script was: go build
- My son was an eager, supportive teammate.
- Our Internet and computer hardware worked flawlessly.
What went wrong
- Go is not quite the right language for graph traversal contests.
- Too difficult to develop abstractions for graphs.
- Temptation to use slices and maps for everything, which works, and is fast, but is too low level. Going up a level of abstraction introduces a lot of boilerplate.
- Go’s manual error checking adds a lot of overhead to writing code on “contest time”.
- The Sublime Go IDE experience has regressed since I’ve used Go seriously. The GoSublime plugin seems to have rotted away in the past few years.
- Using Go disenfranchised my son, who currently only knows Python and Java.
- Our small team couldn’t afford to invest time in writing tools (visualizers and contest servers) that would have helped us.
- My wife, who is a puzzle solving expert, was away during the contest. I’m sure she would have been a huge help in algorithm development.
Also, as my son diplomatically put it, “the problem was not the most
interesting”. I think we would have had more fun with a more competitive or
physics oriented problem. To be fair, this year’s problem as roughly in the
middle of all the problems that have been presented. It’s certainly more
interesting than 2010’s or 2013’s abstract math problems.
Despite giving up on the main contest, we had fun during the lightning
contest. We look forward to reading the results of the competition and reading
the other teams’ postmortems. And we look forward to competing again in 2018!
I recently put together a cheap-and-cheerful machine-learning-capable PC.
- Pentium G4560 CPU
- NVIDIA 1060 6GB GPU
- 16 GB RAM
- 512 GB SSD
The main difference from a budget gaming rig is that I chose a relatively
overpowered GPU. This is because for machine learning I think the main
bottleneck will be GPU RAM size. This particular GPU model has a lot of RAM
(6GB) for a relatively low price.
The other extravagance is the 512 GB SSD. It would have been cheaper to use a
smaller SSD coupled with a traditional hard drive. I went with a single SSD
because I don’t want to deal with the hard drive.
So far my son’s done far more gaming than I’ve done machine learning. He likes
the system a lot. It’s >10x the graphics performance of his previous machine,
a 2012 Mac Mini running Windows 10 in Bootcamp.
A few months ago, inspired by The Scooter Computer, I bought
a fanless Intel Broadwell 5257u
computer. I set it up as a Core OS
Docker host, but quickly discovered that I didn’t actually have much use for
Docker or Core OS. Recently I tried to repurpose it as a low-end Windows 10
game box. That unfortunately ran into heat-related stability issues. Windows
10 worked fine as long as I didn’t try playing 3D games. Playing 3D games like
Counterstrike GO would crash after 10 to 15 minutes, with a very hot heat
sink. Fiddling with BIOS settings and drivers didn’t make a difference.
I guess the lesson to learn from this is, when buying a fanless computer, not
to get the highest powered available CPU. Safer to get the lowest power CPU
that meets your performance needs. Or just get a fan. :-P
As the summer of 2016 draws to an end, it’s time to plan my family’s IT setup
for the 2016-2017 school year.
My current setup
Phones for kids
The big change this year was that my youngest kids got their own phones. The
process went well. I’m glad I spent the extra money to buy refurbished iPhone
5s’s instead of cheaper phones. The iPhone 5s’s have been reliable and easy to
administer. The 16 GB of storage has occasionally been a problem.
I restrict my youngest kids’ phones so that they can’t install apps. It’s
tedious to have to unlock and then relock the phones to install apps for them,
but I like being able to have a say on which apps they have on their phones.
I bought Otterbox cases, which worked well at protecting the phones. So far
all the phones have survived. One phone did get dropped in the water briefly,
but it worked OK after it dried out.
The T-Mobile Simple Choice plan has worked well for us. It has a 1 GB/month
data cap per line. When you exceed the cap you still get data, but at a low
A nice bonus: T-Mobile gave everyone unlimited high-speed data for 3 months
last year. I believe the kids used an average of 2.4 GB per month while that
was available. But they seem mostly happy with the 1GB / month limit.
Laptops work great
The Macbooks have been great. They’re used for web access and light content
Declining desktop usage
Our computer usage has shifted to laptops. Our desktop Mac mini computer goes
weeks between uses, and I notice that I seem to be the only one logging into
it these days.
Modest tablet usage
Our two tablets get relatively little usage. The mini is used for puzzle
games, the Pro is used for comic book reading, video watching, and
This is partially a “personal vs. shared” issue. People prefer their personal
phone and/or laptop to shared tablet.
It’s also a “tool at hand” issue. I find myself using a laptop or phone rather
than a tablet just because the laptop or phone is always closer to hand.
Minimal Apple TV usage
Our Apple TV gets almost no usage. Its controller sucks for games, and family
members prefer to watch video on their personal laptop or phone.
Our family TV is used mostly by my wife who still likes watching broadcast TV
in the evenings.
What didn’t go according to plan
Apple’s hardware releases modified last year’s plan:
- I dropped the Android TV in favor of the latest Apple TV. The Apple TV works great, but it turns out that we don’t use it much.
- I exchanged my iPad Air 2 for an iPad Pro. Love the keyboard and stylus.
Beats headphones are low quality
I spent a lot of time this year dealing with broken headphones. My daughter’s
Beats wired headphones failed twice while under warranty. Apple was nice
enough to replace them (with refurbished headphones) each time, but it
required two trips to the Apple Store for each incident.
Getting rid of old electronics
For what it’s worth, Amazon has a good trade-in service that buys old
electronics for a fair price. Not as good a price as you’d get on Swappa or
craigslist, but zero hassle. I used it to get rid of a bunch of old consumer
electronics gear that I’d accumulated over the years.
Best hardware purchases
- Phone holders for the cars.
- Multi-port USB chargers for car.
- Multi-port USB chargers for bedside.
- Short (4 inch) USB cables for bedside charging.
- Long (10 foot) USB cables for car and couch.
- External battery packs for recharging phones.
Plans for 2016-2017
- Keep current phones & laptops.
- I will upgrade to the latest iPhone just because I need it for my work.
- A Sony Playstation 4 NEO.
- My son is desperate to play the latest video games.
- Support school-issued Windows laptops.
Keeping current hardware
I’m happy with my current hardware. The equipment is reliable and easy to
administer. There doesn’t seem to be anything significantly better on the
market or on the horizon.
My kids report that the iPhone 5s is the current “standard” phone model among
their classmates. (6th grade and 8th grade). So at the moment there isn’t any
social pressure to upgrade. My son would like a larger screen and a bigger
battery. I got him an external battery pack, we’ll see if that helps.
Apple is rumored to be introducing new Mac hardware this year, but based on
rumors it doesn’t seem to be significantly better for our budget and use cases
than our current hardware.
Consoles vs PC gaming
My son’s grown out of Minecraft, and now wants to play teen games.
In the past few years Macs have stopped being able to run modern games. mostly
due to Apple not supporting recent 3D graphics APIs.
High-end gaming PCs work well for games, but they’re expensive to buy and
A console seems like the best choice for us. Based on performance and
exclusives I’m leaning towards the Sony Playstation 4. A new version of the
PS4 is rumored to be coming out in October. I’ll probably get that.
Return of Windows devices
The big change to my home network this year will be dealing with school-issued
Windows laptops. I want to keep the Windows devices off my home network, but I
also want to give them access to the Internet and to a local printer. I think
the simplest way to do this is to buy a new Wi-Fi printer, and put the laptops
and printer on a guest network.
I could get a fancy router and set up multiple virtual networks, but buying a
second printer seems simpler. Perhaps if the second printer supports cloud
printing I can use it from all my devices, and then retire my current printer.
I think the whole idea of a local network is becoming obsolete. In many cases
it’s simpler to assume that every device is always on the public internet, and
just configure the device to survive in that environment. The only devices in
my house that really need to be behind a firewall are the printer and the NAS.
If anything, I might simplify my home network by retiring the desktop computer
and the NAS.
In the past I used the NAS for storing backups and downloaded videos. But
these days I use cloud services for both backups and videos. I rarely use the
I rarely use my scooter computer. It was educational to set it up, but I don’t
really use it.
I sent my kids to the DigiPen ProjectFun
summer camp this year.
It’s expensive ($1400 for 10 days). It is very well run. My kids loved the
experience, and they learned a lot about the topics (animation and game
programming) they took.
The classes were structured as 7 days of instruction, 2-and-one-half days of
final project, and then a demonstration on the afternoon of the last day.
FWIW I am well versed in both animation and game programming. I’ve tried to
teach my kids these subject. They learned more from these courses than when I
tried to teach them at home.
The instructors emailed me a detailed “what we did in class today” letter
every day. I found it helpful to read the letter and use it to prompt
discussion with my kids.
A nice side benefit is that my kids were exposed to relatable role models in
the game industry, through the many DigiPen students who are helping run the
camp. “Dad, everybody has nose rings.”
Only drawback: my kids now think less of my old games: “Dad, no offense, but
your [1980’s vintage 8-bit era] game is kind of lame.”
I think this camp would be best for 5th-thru-10th graders. For a self-
motivated older child it might be better to spend the money on
That which is resisted, persists.
I’m going paperless in my home office. Over my 30+ years of adulthood I have
accumulated 20+ filing cabinet drawers of paper records. Plus there’s a ton of
unsorted bills and junk mail piled up.
My strategy is to tackle the filing cabinets first, then work on the unsorted
bills and junk mail. My reasoning is that doing the filing cabinets first will
help me set up my taxonomy on Google Docs, making it easier to file the new
My strategy for scanning my filing cabinets is:
- Go through each file cabinet drawer and storage box, one at a time.
- Sort docs into 3 categories: scan & keep, scan & shred, shred.
- Scan documents to PDF files with a Fuji ScanSnap ix500.
- Store the scanned documents in folders (with the same name as the original folders) on Google Docs.
- Put the “keep” documents back into the same folder and cabinet drawer that they came from.
- Make a backup copy of the scanned documents to a USB stick.
My strategy for deciding what physical items to keep is:
- Keep official government documents like tax returns forever.
- Keep items related to tax returns for 15 years.
I’ve scanned one half drawer so far. It takes a while to scan old documents.
Lots of staples to remove.
At this rate it’s going to take about six months to scan everything. Yow!
Here’s my take on tech trends in 2015 and predictions for 2016.
Personal trends in 2015.
- I started using Twitter, following a mix of optimistic tech bloggers, economists and comic-book artists. Always something interesting to read. I don’t tweet much. (Nothing to say :-P)
- Podcasts. I’m following a bunch of tech, gamer, and comedy podcasts. I especially like
The Voicemail, Accidental Tech Podcast, Melton, and Guys we F*cked (NSFW) .
- I switched to a large-sized iPhone 6s+. The big screen is great.
- I stopped maintaining my “Terminal Emulator for Android” program, because I lost interest in the idea of an on-device terminal emulator for Android. (And I lost interest in maintaining the project in the face of frequent Android UX and build system churn.)
I’ve been doing less open-source software work than in previous years. My OSS
work has been driven by emotion and “hack value”. This year I haven’t come up
with any ideas that were exciting enough to work on. Partly this is because
we’re in the midst of a change from PCs to mobile, and it’s not clear to me
what needs to be done in the new mobile-first world. And partly it’s because
things are working pretty well. I feel that I have my basic computing needs
taken care of by existing apps.
More than once this year, I came up with an idea for a project, only to find a
perfectly serviceable implementation already available for free or only a few
dollars. Each time I installed the existing app rather than writing my own
I found myself playing fewer video games. I bought lots of mobile games, but
mostly for my family rather than for myself. My wife briefly held the world
record high score for the puzzle game Spl-t.
I’m still waiting for The Witness and
The Last Guardian to ship. I may
buy a PS4 to play TLG. Or I may just watch the inevitable “Let’s Play”
walkthroughs. It seems like the kind of game that would be almost as much fun
to watch someone else play as to play myself.
I bought an Apple TV 4th Gen and an Apple iPad Pro. I’m using both primarily
for media consumption, although once I obtain an Apple Pencil I hope to use
the iPad Pro for some sketching.
I had hoped to write games for the Apple TV, but the bundled controller is too
limited to support interesting games. And the development model is clunky,
requiring either two Apple TV units, or a long cable. I think it makes more
sense to concentrate on iPhone/iPad apps than Apple TV apps.
I’m studying Swift, trying to decide if it’s good or not. It’s a positive sign
that Apple open sourced it. I like the “Playground” feature.
I wish I could use Go more, but I don’t currently have
a project for which Go is suitable.
Similarly, I’m impressed by recent developments in Clojurescript. I wish I had
a project idea for which Clojurescript was suitable.
- Machine Learning
Just an update on my family IT use.
The T-Mobile family plan has worked great for us. T-Mobile’s plans are nice
for us because:
- The third, fourth, and fifth lines are only $10 / month.
- When the paid-for data is exhausted, the plans automatically switch over to unlimited free low-speed data for the rest of the month.
- Streaming music doesn’t count against the data caps.
- Free phone calls, texts, and low-speed data in Canada and Taiwan. (It was great using Google Maps to get around Vancouver. I was using many short cuts that I didn’t know about when I was navigating using paper maps.)
- For the last 3 months of 2015 T-Mobile had a special where they gave everyone unlimited high-speed data for free.
I ended up getting used iPhone 5s’s for all my kids. I had the kids pick their own otterbox commuter cases.
My son was initially frustrated at having to give up his rooted and customized
Android phone for the smaller, less customizable iPhone. He’s grown used to
it, and likes it now. Everyone loves the fingerprint unlocking feature of the
I have the phones set up with restrictions, so that the kids can’t install
their own apps. I also confiscate-and-recharge their phones and laptops each
night. This is fairly foolproof, and gives the kids 8 hours a day to sleep
without electronic distractions.
I bought an Anker 6-port USB charger for my bedside table. I use it to
recharge everyone’s phones while keeping an eye on them. I have the phones on
“Do Not Disturb” mode, so they don’t bother me over night.
The “Find my Friends” app has proved helpful for keeping track of where
everyone is, especially for things like picking kids up at school and at bus
We now have 5 laptops: four 13” Macbook Airs and one 13” Macbook Pro. They
work great and last a long time. They are mostly used for web surfing, YouTube
We have had problems with headphones – the kids are rough on headphone
cables. They’ve already gone through one set of headphones each. Currently
we’re using Beats headphones due to them being relatively cheap on sale and/or
included in Apple Educational bundles. They look stylish and work OK. Apple
has a fairly good warranty repair process for their Beats headphones.
A few products that made my summer family travels happier:
Photive 6 port Desktop USB Charger.
Anker 4-port USB car cigaret lighter charger.
Car vent phone holder (don’t remember the brand.)
Short stereo audio cable. It’s ghetto compared to bluetooth, but more
As summer draws to a close, I am planning my family’s computer use for the
2015-2016 school year.
My plans for this year are:
- Each family member gets their own mobile phone and laptop.
- We also have a shared desktop and a few shared tablets.
- Shared network scanner/laser printer.
- We print color documents and pictures at the library or at the drugstore.
- Android TV for shared movie watching.
- Chromecast for audio sharing.
- Comcast Business Internet
- Apple Time Capsule for backup / WiFi / NAT
Note the lack of a dedicated game console. The kids play games on mobile,
tablets, and laptops (for Minecraft specifically!).
My two youngest kids are getting their first phones this year. I’m worried
about their phones getting lost, broken, or stolen. So for the first six
months my kids will use hand-me-down phones. After they’ve learned to take
care of phones, I’m going to give them better phones. (Still used, though!)
To achieve my plan I need to buy one laptop and three mobile phones. For the
laptop I’m leaning towards a 13” Retina Macbook Pro. For the phones I’m
leaning towards used iPhone 5Ss.
Why a Macbook and not a Chromebook? Build quality and applications. I have a
low-end ARM Chromebook, and I noticed that nobody in the family uses it by
choice, due to its low speed and poor quality screen. I could get a
Chromebook Pixel, but for my family, at that price level a Macbook is a better
Why iOS and not Android? It comes down to ease-of-administration. I want to
lock down my kids’ phones, and unfortunately experience with my oldest child
using Android is that it’s all-too-easy for him to defeat the aftermarket
Android parental control apps.
For phone service I’m probably going to go with the BYOD T-Mobile Family Plan,
- It is cheap.
- Unmetered music streaming.
- When you hit your data cap it switches to low speed data for the rest of the month, rather than charging more.
- It has free 2G international roaming.
Thoughts on laptops and other legacy hardware
If I were on a tighter budget, or starting from scratch, I’d consider dropping
the laptops, the Comcast Internet, and the home WiFi, and going pure mobile. I
would get bluetooth keyboards to make typing school assignments easier.