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, Terminal.app.)  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; https://github.com/fnaard/abstractForecast;");
}

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

abstractForecast; https://github.com/fnaard/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.

Sunday, September 1, 2013

Types of PS3 Hard Drive Caddies

I sent a friend's PS3 in for service, and they ask you to pull out your hard drive if you've upgraded it.  I did, but then at some point I discarded or lost the caddy that it belongs in.  There are four generations of PS3, and each has its own style of caddy.  Here's how it goes.

Generation
Models
Caddy
Old Fatty

CECHA01
CECHB01
CECHG01
CECHE01
Wire Pull-Tab

Newer Fatty


CECHH01
CECHK01
CECHL01
CECHP01
Flat Metal Pull-Tab

Slim

CECH-2001A
CECH-2001B
CECH-2101A
CECH-2101B
CECH-2501A
CECH-2501B
CECH-3001A
CECH-3001B
Side Flange

Slimmer


CECH-4001B
CECH-4001C
Swing-Out Tab