Friday, November 1, 2013

The "C21 Pentagram" Photo Filter

Click for the Flickr set.
My photos of the Space Needle just came back and the Kodak Vest Pocket has once again opened a portal back in time.  The Space Needle was built for the 1962 "Century 21" world's fair, by the "Pentagram Corporation."  When the digital crowd asks what filter I used to get the effect, I'm going to tell them it's called "C21 Pentagram."

Friday, October 18, 2013

Telemetry Before It Happens

I'd like to borrow another runner's memory.

I've been traveling a lot, and it's easy to scope out a route near each hotel using Google Maps' measurement tool and some Street View sleuthing.  But knowing when a turn is coming up, or the sidewalk becomes choppy dirt, or the hill evens out just past the firehouse .. you don't know those on the first run.

My Nike GPS watch gives me telemetry after each run.  What I need is telemetry before.  Start out the route on my second run, and I'm a little better prepared for the details.

But is the novelty of the first-time around "worth" something?

Nope.  What if the borrowed runner is used to marathons .. I'll bet she'll have a different stride and pace than me.  Or what if this is a noontime stroll I'm borrowing .. maybe he's never seen it in the evening with the city lights glimmering.  "Interesting, I've never done it this slow/late/sober/male/lean ..."

So, GPS running-accoutrement makers, how about it?  Telemetry after my run is so 5k ago.  I'll pay extra to have it up-front.

Monday, September 23, 2013

Toggle a MacBook's Wifi with a Bash One-Liner

Sometimes the easiest way is a bash one-liner.  (Think Alfred shortcuts, BetterTouchTool gestures,  Running an applescript is all fine and dandy, but it's heavy.  Here's how to toggle your MacBook wifi on or off, where the wifi interface is en0.

( networksetup -getairportpower en0 | grep On ) \
   && ( networksetup -setairportpower en0 Off ) \
   || ( networksetup -setairportpower en0 On )

This is one of those messed-up bash-isms that uses conditional logic in the "wrong" way, elegantly.

Tuesday, September 17, 2013

Setting Processing's User-Agent for loadXML

In Processing, I'm fetching Yahoo's weather forecast for my location.  The loadXML() function is perfectly happy to take a URL, so I can just point it at my location's RSS feed.

In its default mode, this sends a user-agent string of "Java/1.6.0_51" which reflects my current Java version.  But I want to set my User-Agent, to something more descriptive.  If my project misbehaves, or an operator gets curious, it would be polite to have a more descriptive string with some contact info.

You can prepend a string to the user-agent by specifying it in your setup() function.

void setup () {
  System.setProperty("http.agent", "abstractForecast;;");

Which results in the web server logging a user-agent of:

abstractForecast;; Java/1.6.0_51

Oracle has some documentation on the network properties you can set.  There are more, notably: proxy settings, IPv4/v6 preference, and DNS caching behavior.