Alphabet Race - a kid's game

TL;DR: I built a little truck “game” to teach my son alphabets. I started watching http://javascript30.com a couple of days ago. It’s a series of 30 videos that uses vanilla Javascript to do amazing things. I have only done the first two videos in the series. Based on what I learned in those two videos, I decided to write a small game. My son is a fan of trucks, so I cobbled together a truck race that teaches him alphabets....

December 26, 2016 · 1 min

Nostalgic Programming

For some unknown reason, I looked up GWBasic today and downloaded an emulator. GWBasic was the first programming language that I learned. I have fond memories of that language. I love the fact that I could switch to a graphics mode and start drawing circles and squares. After about 30 minutes of fumbling around, my muscle memory kicked in and I started to write a simple program to draw some shapes on the screen....

December 15, 2016 · 1 min

FuzzyFinder - in 10 lines of Python

Introduction: FuzzyFinder is a popular feature available in decent editors to open files. The idea is to start typing partial strings from the full path and the list of suggestions will be narrowed down to match the desired file. Examples: Vim (Ctrl-P) Sublime Text (Cmd-P) This is an extremely useful feature and it’s quite easy to implement. Problem Statement: We have a collection of strings (filenames). We’re trying to filter down that collection based on user input....

June 22, 2015 · 8 min

Python Profiling - Part 1

I gave a talk on profiling python code at the 2012 Utah Open Source Conference. Here are the slides and the accompanying code. There are three parts to this profiling talk: Standard Lib Tools - cProfile, Pstats Third Party Tools - line_profiler, mem_profiler Commercial Tools - New Relic This is Part 1 of that talk. It covers: cProfile module - usage Pstats module - usage RunSnakeRun - GUI viewer Why Profiling:...

May 15, 2012 · 4 min

Memoization Decorator

Recently I had the opportunity to give a short 10 min presentation on Memoization Decorator at our local UtahPython Users Group meeting.  Memoization: Everytime a function is called, save the results in a cache (map). Next time the function is called with the exact same args, return the value from the cache instead of running the function. The code for memoization decorator for python is here: http://wiki....

February 10, 2012 · 1 min