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

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