Zac Stewart

Have an interesting problem? Let's talk

My First Month Living in Taiwan

It's been a month since I moved to Taiwan. The first two weeks were spent in quarantine, of course. For 15 days I sat on my balcony and enjoyed the warm, sunny weather. During the 3 weeks since I got out, Taipei has had almost non-stop rain.

Read more

Trip Report: Atlanta to the Georgia Guidestones

In August I went on a bike excursion from Atlanta to the Georgia Guidestones and back. I've known about them for a while, and have been curious to go see them, but never enough to drive the three or so hours it would be round trip. I never pass through that neck of the woods either, so I've never had a reason to stop while passing through. Last week, management at work announced a surprise day off kind of last minute. I had nothing planned, so I decided to build a route and put this unexpected three-day weekend to use.

Read more

Coming Back to an Old Ruby Project After a Few Years

I have this Ruby project that I haven’t worked on in while. Over the last four or five years I’ve barely committed any work, just enough to keep it humming along. It has actual users (not that many though) and has hundreds of pages indexed by search engines. It’s just an open source community thing, not super important. I’ve been so lazy with it that a feature branch that I never merged into master has been running in production for years. Since it’s Saturday and I don’t have anything to do (thanks global pandemic), I decided to rectify that and finally clean this project up.

Read more

Making a Phone Part 6: SHARP Memory Display

I’m frustrated by my struggles to get an e-paper display that can do partial screen updates, so I’ve decided to give another technology a shot. I ordered a SHARP Memory Display from Adafruit. I also threw in a small mic and a speaker because I was going to need those anyway, sooner or later.

Read more

Making a Phone Part 5: Partial Update Setbacks, Navigation Flows

I finally ordered a e-paper display capable of partial refresh. A 1.54" display made by Good Display and packaged with a PCB by a supplier called Waveshare. They also publish some drivers and demo code. I needed a higher-RAM microcontroller to handle partial updates, so I upgraded my Teensy LC to a Teensy 3.2.

Read more

Making a Phone Part 4: Text Messages

Sending texts is the next goalpost. The backend of this was pretty easy thanks to the Adafruit FONA library. The hard part was building a frontend for 9-key text entry. After a couple of after-work code sessions I got something complete enough to allow for lower-case text entry including spaces and punctuation.

Read more

Making a Phone Part 3: Going 32-bit

Naturally, the next function is answering incoming calls. One way to do that (aka the wrong way) is to poll the cellular module to ask it what its call status is. The microcontroller communicates with the FONA via a serial interface, so doing that every tick of the loop function (16 MHz) is very chatty.

Read more

Making a Phone Part 2: Getting Started

I started out with an Arduino Uno-compatible microcontroller board manufactured by OSEPP, a 16-button 4x4 button matrix, a 2G cellular module by Adafruit called a FONA, and a 1.54" monochrome e-paper display from Adafruit. I also grabbed a starter kit from them that contained a soldering iron, a multimeter, a couple breadboards, some wire cutters, a handful of components, solder, and wire.

Read more

I’m Making a Phone

Why make a phone? I started down this path after recognizing that I’m struggling with how addictive tech is. Devices are engineered to be as instantly gratifying as possible. I’m not incapable of putting it down, and luckily I’m not hooked on social media, but the devices themselves have a tendency to draw me in and fill up any empty space that I might otherwise use to hear my own thoughts for a minute. This constant presence works to isolate me from other humans. At least, I often feel lonely and disconnected, and then supplement my loneliness with more device usage.

Read more

Simulating the iSight Camera in the iOS Simulator

A well-known limitation of the iOS Simulator is that you are unable to test code that uses the camera. Unlike some other hardware features (Location Services, Touch ID, orientation, gestures), Apple has yet to add a way to either link the Simulator’s camera output to a camera on the host device, or even allow you to choose a static image to “mock” the input of the camera. That’s the goal of this tutorial. I’ll walk you through creating an interface around the camera and then mocking it to use on the Simulator. The result will be that you can include some static images to represent the front and rear cameras when running your app in the Simulator.

Read more

Using JSON Web Tokens to Authenticate JavaScript Front-Ends on Rails

While working on a project recently, I encountered a problem I haven’t had to tangle with in a while: authenticating front-end applications against a Rails API. The last time I was even dabbling in this realm, jQuery was everything, CORS was still in its infancy, and JSONP was still a thing (that’s not a thing anymore, right?). The only way I ever managed to scrape by in this hostile environment was to let Rails’ asset pipeline serve up the front-end app and rely on same-origin requests and regular ol’ cookies to handle authentication. I didn’t like it, but I survived. Eventually, I got away from front-end concerns almost completely.

Read more

Document Classification with scikit-learn

Document classification is a fundamental machine learning task. It is used for all kinds of applications, like filtering spam, routing support request to the right support rep, language detection, genre classification, sentiment analysis, and many more. To demonstrate text classification with scikit-learn, we’re going to build a simple spam filter. While the filters in production for services like Gmail are vastly more sophisticated, the model we’ll have by the end of this tutorial is effective, and surprisingly accurate.

Read more

Using scikit-learn Pipelines and FeatureUnions

Since I posted a postmortem of my entry to Kaggle’s See Click Fix competition, I’ve meant to keep sharing things that I learn as I improve my machine learning skills. One that I’ve been meaning to share is scikit-learn’s pipeline module. The following is a moderately detailed explanation and a few examples of how I use pipelining when I work on competitions.

Read more

Building A Language Identifier

I recently gave a talk on language identification at Big Nerd Ranch. The gist of it was extracting text from Wikipedia and training a naive Bayes classifier to predict the language of text. You can check out the resulting classifier running on Heroku

Read more

Kaggle See Click Fix competition postmortem

This challenge was to predict the number of votes, comments, and views that issues created on See Click Fix would get. The provided datasets included the latitude and longitude, summary and description (both text fields), a source (mobile client, API, city-initiated, etc…), a created timestamp, and a category tag. Of course, the training dataset included the three items to be predicted.

Read more

Learning C++: A brainfuck Interpreter

As I try to steer my career away from generic application building and into scientific computing, I find myself wanting to learn C++. This is an odd admission for a Rubyist, as I usually see movement in the opposite direction, with tired C programmers washing up on the sweet shores of Ruby, sighing, with relief, that it just feels so right.

Read more

Establish Your Encrypted Channels Now

The purpose of this post isn’t to bemoan the expanding surveillance state, warn of impending civil liberty revocation, or even to make you feel paranoid. I only want to talk sensibly about a few tools that we should all be comfortable using and know when we should use them.

Read more

Some Things I Read in 2012

I read a total of 14 books last year. I had set my goal for 15, but finished the year two-thirds of the way into three different books. I tend to read plurally.

Read more

Verifing Minecraft User Accounts

When I need to give my brain a rest, I like to play Minecraft on an interesting server known as Civcraft. The unique thing about this server is that it is an experiment in anarchy of sorts. There are no rules except not to exploit software glitches that could give you an unfair advantage. Robbery, murder, griefing and trolling of all sorts are completely legal within the rules of the server. As a result, there have evolved complex and organic societies complete with competing cities, marketplaces and even ad hoc police forces and bounty hunters.

Read more

Defining Abilities for Collections of Records Using CanCan

I’ve been using CanCan for managing role-based authorization in Rstrnt, my restaurant management solution. CanCan is a very simple and easy-to-use authorization library that works out-of-the-box with Devise (and any other authentication system that provides a current_user method). However I had a use case that doesn’t seem to be documented on the project’s wiki.

Read more

Meow: A Growl Work-Alike for jQuery

jQuery Meow mimics Growl notications. It supports all jQuery events and you can bind it to various sources for message input making it ideal for form validation, Rails flash notices, or a replacement for the alert() box.

See a demo

Deploying Your Jekyll Blog On Dreamhost Via Capistrano

I've gotten Jekyll working on my shared Dreamhosting account, and not just pushing the compiled pages to my webroot: compiling my Sass stylesheets and then compiling the static HTML pages with Jekyll and even using Pygments to generate syntax-aware HTML--all server-side.

Read more