Thursday, April 24, 2014

Lessons From App Week

App Week 2014 is over, and I failed.

But that's okay!  I have a nearly-completed codebase and a handful of valuable lessons:


1) Turn features into functions.

Before you even start coding, think about the actual functions you'll need to make a feature work.  That means plenty of up-front planning.  It also means really dialing into the libraries you plan to use.

For example, did you know that MongoDB can't do "$near" on polygons?  Neither did I!


2) With Cordova/PhoneGap, that hard parts are easy, but the easy parts are hard.

You'll be surprised how much time you spend shuffling around icon files and splash screens.  There are a handful of customizations that can make your life much easier.  For example, check out this post from Holly Schinsky.


3) The iOS simulator is old and broken.

It'll get you 90% of the way there, but don't lean on it for anything other than the most basic features.  You'll have to use real hardware if you want to test anything involving a compass or accelerometer.

Thursday, April 10, 2014

App week: 7

(Faithful readers will notice that today's update is a little late.  Er... I meant "business days"?)

I'm realizing why MongoDB isn't the absolute perfect choice for every application in the universe.  And that reason is joins.

Some data just naturally lends itself to joins.  With the way it's laid out, GTFS is very well suited to doing joins.  Even the most popular MongoDB GTFS implementation uses Mongoose, so it's basically SQL.

I'm going to push on with MongoDB, although I can freely admit that it is a mistaken endeavor that should never be repeated.

Once I get my join problems solved, I look forward to submitting my app for review!

Saturday, April 05, 2014

App week: 6

Lots of polish on the frontend.  New styles, assets, copy.  I suspect I'm going to need to integrate a map somehow if it's going to get approved.

Regardless, I'm looking forward to hooking everything up tomorrow.  I think it'll be pretty slick.

Friday, April 04, 2014

App week: 5

Home stretch!

I managed to check a few things off on the front end.  Most importantly, the icons, styling, and markup are all done.  Location services seems to be working.

One worry I have is that my app is absurdly simple in functionality.  I've read that Apple will reject apps that are too simple, which doesn't bode well for my short timetable.  I might have to look at shoehorning in a settings menu, interactive maps, or some other nonsense.

My experience with Cordova thus far has been positive, although there are a ton of obvious pain points.  For example, deploying an icon for your app-- It's probably one of the first things you do during the development process-- took me about an hour and a half because of all the sizing issues.

It would be easy to un-suck Cordova with some simple hooks and scripts.  The authors got pretty close, but it's nowhere near as smooth as, say, an Express install (although it does share much of the same technology).

How about a version of Cordova that's just the Javascript API and compliation tools?  Anyone?

Thursday, April 03, 2014

App week: 4

It's come to my attention that APP WEEK 2014 is more than halfway over.

The backend is looking good-- Importing works, 2dsphere indexing works, and intersections work.  Still have a bit more work to do matching the shapes up to actual route numbers, but that shouldn't be bad.

I think the biggest challenge is going to be hooking up the realtime data and creating a notion of inbound/outbound.  This is tricky in Boston, because I suspect there are places where going "Inbound" actually takes you away from the city center.

The frontend?  Haven't started it.  Whoops!

Wednesday, April 02, 2014

App week: 3

Backend day!

Just finished up importing Boston's transit shapes into a Mongo GeoJSON collection.  That was harder than it should have been.

Tomorrow I'll be working on intersections.  Once I get that going, it's all about setting up an simple API with Express and building a simple frontend.

Tuesday, April 01, 2014

App week: 2

Goodness gracious.

I've heard XCode is bad, but I had no idea it was a glossy NetBeans ripoff from 1997.

The only reasonable thing to do is to drop any aspirations of learning Objective C and use Cordova instead.

While I was waiting for the bitter taste in my mouth to go away, I threw together the first part of the backend service.  I'm going to lean on Mongo's geospacial stuff, which is assuredly a bad idea.  But, time is of the essence.


Monday, March 31, 2014

App Week: 1

We did a bit of brainstorming last night, and aside from Flappy Tinder and GrindBus, there were some pretty good ideas.  I've settled on a simple hack using OpenMBTA data:  I want to read in GPS coordinates and compass heading, then recommend bus lines.

In other words, open the app, face the direction you want to go, and it will tell you which number to take.


Sunday, March 30, 2014

App Week

I'm going to try to write an app for iOS and get it on the App Store this week.

I don't know anything about the ecosystem.   I've never used XCode.  I'll probably fail.  But, I promise to spend at least an hour a day pursuing (and documenting) my process.

Sunday, March 23, 2014

LibrePlanet 2014

So concludes my first LibrePlanet!  Despite living in Boston for three years, I haven't actually been in town during LP weekend until now.

I won't deny that it's an echo chamber sometimes.  Nevertheless, it's a nice feeling to be surrounded by dissimilar people who've all arrived at a similar thesis.  You get the feeling that no matter what happens, everyone is on the right track.

Congratulations to all of the organizers and volunteers who helped make the weekend such a success!

Sunday, March 09, 2014

OCTPW: Heartbeat

Heartbeat is a simple way to check a process's vital signs.  Use it instead of Monit, Pingdom, Uptime Robot, or any combination thereof.

There's no setup.  Just open up a terminal and type:

    curl http://heartbeat.alexose.com/your-email@example.com/60
 
This will create a new heartbeat that will alert "your-email@example.com" in 60 seconds.  You can postpone this alert by running the same command again, or you can stop it altogether by sending a cancellation:

    curl http://heartbeat.alexose.com/your-email@example.com/cancel

The most straightforward use case is for keeping tabs on sensor data, but I can imagine using it wherever downtime requires your attention.  I use it to monitor several Raspberry Pis (which I use for all sorts of things around the house).

Check out the README for the full documentation and more usage examples.

Sunday, March 02, 2014

OCTPW: SimpleBeeps

The problem is that cell phones come preloaded with awful ringtones.  The solution is SimpleBeeps.

Sunday, February 23, 2014

OCTPW: Pomodoro!

I'm a huge fan of the Pomodoro technique as a way to manage daily tasks.  I'm a programmer, and I learned about it from another programmer, but I think any person that spends most of their time in front of computer can benefit.

Very briefly, the central tenets are:
  • Break your tasks into 25-minute chunks ("Pomodoros") at the beginning of the work period, and write them down on a piece of paper
  • Complete each task in 25 minutes, cross it off, and take a 5 minute break
  • After three tasks, take a longer (15-25 minute) break
  • Repeat until finished
This absurd simplicity is actually very effective.  It forces me to develop a strategy, execute within a time constraint, and be honest and accountable with myself when something doesn't get done on time.

As a longtime pencil-and-paper Pomodoroist, I couldn't help but wonder what a fully realized Pomodoro app might look like.  Something that keeps that same spirit of simplicity while addressing some of the annoyances of paper.

This is my first attempt at a modern Pomodoro tracker.  It's still unpolished, but works well for me.  As always, the source is freely available and I welcome any feedback or contributions.

Sunday, February 16, 2014

OCTPW: The Quantified Hedgehog

My first One Cool Thing Per Week (OCTPW) entry is more of a show-and-tell, since it's actually been in the works for several months.

Many of you have met my hedgehog, Hugh.  He lives in a custom-built box that has lots of sensors.  Among them are three thermometers, two cameras (including infrared), and a speedometer/odometer hooked up to his wheel.  All of this (and more!) are available at http://hedgehog.alexose.com.

I'm looking for more ways to consume the speedometer data.  It's both the most interesting and worst-implemented feature on the site-- Since it's limited to the last 24 hours, the only way to getting a feel for Hugh's exercise regimen is to check in every day.

From my observations, he tends to run about 4.5 miles each day, starting at 6pm (when it gets dark), again at midnight, and again at 3am.  His record distance in 24 hours is an impressive 7.67 miles!

If you're interested in a bit more technical detail, check out the "about" tab.

Sunday, February 09, 2014

OCTPW: Meteograms!

This week for the One Cool Thing Per Week (OCTPW) initiative, I'd like to share my favorite graph on the internet.  It's not interactive, force-directed, artfully designed, or data-driven.  In fact, it's a bitmap generated by a PHP script on a .gov website:

NOAA Forecast Meteogram for Boston, Now -- +48 Hours

This type of graph is called a meteogram, and is actually a de facto format for visualizing weather station data.  There are about as many types as there are weather agencies.  You don't see them on consumer facing weather services so much (In the quest for minimalism, nothing gets ignored quite like a 16 color rectangle with 12 different data series smooshed together).

This particular graph from NOAA, though, is my favorite.  I think what makes it work is how well it correlates disparate series:  Each plot takes up the same amount of height and is scaled to look like roughly the same amplitude.  Closely related data is grouped together, but not so closely to become overcrowded.  Subtle touches indicate directionality, or totals, or probability-- But only when it applies.  Most impressive is how it behaves at the extremes:  During big storms, the data is just as readable as during a relative lull.


Wednesday, January 22, 2014

Set up an active GitHub repo with a single bash command

There should never be any barrier between thinking of something and putting it on GitHub.

With that in mind, here's a very short bash function + alias I use to get a repo up as quickly as possible.

# github
function new_github_repo(){
    if [ -z "$1" ]
        then
            echo "Usage: github [name]"
        else
            USER='YOUR_GIT_USERNAME'
            curl -u "$USER" https://api.github.com/user/repos -d '{"name":"'$1'"}'
            cd ~
            mkdir $1
            cd $1
            touch README.md
            git init
            git add -A
            git commit -am "Initial commit."
            git remote add origin git@github.com:$USER/$1.git
            git push origin master
    fi
}
alias github='new_github_repo'

Saturday, January 11, 2014

Iron Blogger!

Great news-- I made it through the rigorous application process, and have been accepted to Iron Blogger Boston!

A big part of why I'm doing this is to participate in the One Cool Thing Per Week (OCTPW) initiative.  Briefly, this is something I just made up where I present one short project per week that I find "cool".  Most of these will be software projects, with a few hardware and maker things thrown in.  I encourage others to join me on this endeavor.

Outside of OCTPW, I will be posting my usual smörgåsbord of random observations, factoids, and anal-expulsive cynicsm for future archaeologists to puzzle over.

On a side note, I'm going to be using Stypi as a word processor for all of my future posts.  If you haven't used it, you should!  It's one of my favorite examples of featureset minimalism on the web.  Very unix-philosophy-y.  

(I do wish I could synchronize it with my blogging software, though.  Anyone?)

Saturday, October 19, 2013

Mint.com running total bookmarklet

Drag this link into your bookmarks bar, and click it when you're looking at your transactions on mint.com!

Annotated code below.


Monday, July 22, 2013

A simple one-liner for repeatedly querying a remote XPath from the command line!

I often want to monitor a single element on a page, but I don't feel like firing up python to make it happen.

Using a tool called xidel, this command will write the results of an xpath query to a file every 300 seconds:

yes "xidel YOUR_URL_HERE -e \"YOUR_XPATH_HERE\" 2> /dev/null; sleep 300"|sh > output.txt

Here's a working example:
yes "xidel http://www.indiegogo.com/projects/ubuntu-edge -e \"/html//p[@id='big-goal']\" 2> /dev/null; sleep 300"|sh > output.txt

Sunday, February 10, 2013

The Best Terminal Font

Misc-Fixed-6x13, a.k.a misc-fixed, a.k.a. "Fixed", is the best font for the terminal.  I can offer no scientific proof.  In my eyes, however, it is the most balanced and correctly-proportioned monospace pixel font, regardless of availability or license.

Here is a link to its current home.  Here is a link to a TrueType (.ttf) version I created this morning.