Category Archive: “Uncategorized”
Backups
It’s widely recommended to make regular backups of your files, but until recently that’s been advice I’ve neglected. Now, though, I do have a regular system in place. Here’s the setup:
My Mac mini has a 500 GB internal drive. It is connected to an external 2 TB drive with two partitions. One partition is an exact bootable backup of the internal drive, updated each night with SuperDuper. The remainder of the external drive is allotted to Time Machine, which allows recovery of previous versions of individual files. These measures only guard against drive failure (inevitable) and user error (likely). A more robust backup strategy would include off-site copies of these volumes, to guard against local meteorite strikes or other such mishaps. Toward that end, I do store many current projects on Dropbox, and most of my programming-related projects are mirrored on Github as well.
Once set up, this scheme is easy to maintain because Dropbox, SuperDuper, and Time Machine all perform their jobs automatically. I acknowledge that the local backups would not be quite so easily automated (and therefore reliable) if my computer was a laptop, in which case I’d still have to remember to plug in the drive on a regular basis.
I share this not to imply that you should use the exact same backup system, but simply to encourage you to consider whether you have any digital files that may be worth the investment of a little verifiable protection.
Posted on Friday, March 8th, 2013. Tags: mac.
An arcencode example
Arcencode is my Tcl implementation of the compression algorithm used by both MapQuest and the Google Maps API to encode a list of coordinates as a printable string. It can be used, for example, to obtain a relatively compact representation of a route that can be passed as a single parameter value to a web map.
Here is a GPX file exported from a map created with MapMyRun. It contains a track representing a route through a nearby park, pictured above. The track consists of 790 points, listed here in plain text form. If the contents of that plain text coordinate list are assigned to a variable named coordinates
, the encoded form can be obtained with:
set encoded [arcencode $coordinates]
With line breaks added, the contents of encoded
are:
q}g`GrlfnMPDND\DJ?L?T?P?N?N?N?P?VAPANANAPANAPANATGNELGXENANANCNANA^BNDPDNBNDNDND NDPDNDNBNDNDPDNDNDNDVHNFPFNFNFNFPFNFNFNFPFNFNFNFPFNDNFNFPFNFNFNFVFNBPBNBNBNBVFND PDNDPDNFPDNDPDNDPDNDPDNDPDNDPDNFPDNDPDNFPFNDPFNFPFNDPFNFPFNDZLHFJDNFPHNFNHPFNH\F LAJ?V?F?PFNFNDNFNHZNLHNHLHLHLHNJLHLHT?N?PAN?PAPAVDPFNDNDPDNFNDPDNDNF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OGOGYEM?M?Q@[GM GOGMGMGMGUIMGOGWMKEMCQIQEOGOGQEOGOGOGQE[KQEOEOEQEOEOEQEOEOEQEOEOEQEOEOEQEOGOEQEO EWEOCQCOEOCOC_@KOGOGOGOEOGOGQGOGOGOGOGOGOGOEOGOGOGOGOGOGOGWGOEQEOEQEOEQEOEQEOEQE OEQEOEQEOE[AK@M@Q@Q@OBQ@QFOFOFWBO@Q@O@Q@O@Q@Q@U?O?Q?Q?O?Q?Q?O?]CKEMCME
Succinct, considering it encodes detailed geometry. A coordinate list of 790 corresponding points can be recovered from this block of text with the complementary arcdecode
procedure:
set decoded [arcdecode $encoded]
The decoded
coordinate list can be examined here.
An important proviso: this encoding scheme is lossy. Specifically, coordinate values are rounded to five decimal places. Compare the input coordinates to the decoded output for an example. Any precision can optionally be specified, but greater precision compromises the amount of compression. (Note that the Google Maps API is only compatible with five-digit precision).
How does this algorithm work? Google offers a technical step-by-step explanation. Essentially, compression is achieved by storing only the difference between each coordinate value and the previous value in the sequence; this requires fewer digits than storing each value in full, especially since precision is limited to a fixed number of digits. The values are packed into a printable Base64 representation in a way that eliminates the need for delimiters between coordinate values: values are bit-shifted left before output, and the ones place is used to mark whether the subsequent character represents a new coordinate or a continuation of the same value.
I updated my WheresThatSat site to use JavaScript and (on the Twitter bot side) Ruby implementations of this algorithm. It’s an appropriate application – previously, satellite ground tracks were encoded as a repetitive sequence of separate point parameters. In addition to yielding somewhat shorter URLs, this compression method ensures the correct point sequence is preserved even if the URL parameters are re-ordered.
Posted on Sunday, March 3rd, 2013. Tags: code, geography, tcl.
Just go for a run
It’s been a month since I announced the resumption of regular running. So far the job has just been to build a steady platform for subsequent training. For me, this is about establishing a routine practice more than meeting any particular performance goals. The greatest challenge is avoiding unplanned lapses; based on past experience, breaking routine for as few as two days sets a negative precedent that can unravel my previous efforts. My guiding principle to counteract this risk is that it doesn’t matter how far or how fast I run, as long as I do go for a run.
It works. The February graph above is from MapMyRun (modified to mark peak distances). I haven’t stuck to a six-days-on/one-day-off schedule perfectly, but neither have I let any exceptions grow into longer interruptions. Once I actually get out and start moving, any reluctance burns off like a morning fog, often to be replaced by delight in the experience of stomping around in the rain or working up a sub-zero sweat. Reasons not to run are legion, but none of them matter once you do.
Posted on Tuesday, February 26th, 2013. Tags: running.
Wednesday Sketches
Posted on Wednesday, February 13th, 2013. Tags: art, drawing, timelapse.
More Time Lapse Sketches
Just a couple more portraits. I’m experimenting with different camera setups. This time, the camera is on a stand on the desk directly between me and the sketchbook.
I learn more about my drawing by re-watching these videos than by looking at the drawings themselves. Like, art’s a *verb*, man, not a noun.
— Jim (@anoved) February 7, 2013
Posted on Wednesday, February 6th, 2013. Tags: art, drawing, timelapse.
2013 Race Calendar
Forks XV (15 km.) – Sunday, March 24
Remington Murder Mile (1 mi. w/500 ft. climb) – Sunday, April 28
Binghamton Bridge Run (half marathon) – Sunday, May 5
Vestal XX (20 km.) – Saturday, June 15
Whiteface Mountain Footrace (8 mi. w/3500 ft. climb) – Saturday, September 14
Wineglass Marathon – Sunday, October 6
Philadelphia Marathon – Sunday, November 24?
Schedule is subject to change. Training resumes tomorrow, February 1!
Posted on Thursday, January 31st, 2013. Tags: running.
Time lapse portrait sketches
Variations on a theme, obviously.
Posted on Thursday, January 31st, 2013. Tags: art, drawing, timelapse.
Tcl Doctools for BBEdit
Doctools is a Tcl-based markup language suitable for writing software documentation. BBEdit is a Macintosh text editor. I made a Doctools language module (for syntax highlighting) and preview filter and posted them on Github as Tcl Doctools for BBEdit.
Posted on Thursday, December 13th, 2012. Tags: bbedit, mac, tcl.
GIS Stack Exchange
GIS Stack Exchange is a question and answer site dedicated to helping people figure out GIS (geographic information systems) problems. It’s part of a larger Stack Exchange network of Q&A sites about various topics.
I received some helpful replies in response to a query I posted earlier this year, and have found useful information there as a result of other searches, too. So, in an effort to “learn by teaching”, I’ve decided to try contributing answers on a regular basis (at least weekly). I’m not qualified to address most of the topics that come up, but there is a large backlog of unresolved questions to peruse, and I’ve already found a few of interest. Even if I can’t provide authoritative answers, I hope that providing pointers to relevant references might help people figure things out.
Here are the comments I’ve offered so far:
- Cartograms: making base maps and facilitating size comparison (previously, here)
- Shapefiles: clarifying whether polygon features may intersect themselves (no)
- Projections: finding an implementation of space oblique mercator (PROJ.4 supports a Landsat-specific subset; sparked some more ideas for gtg)
One of my answers even got an upvote! So, yay. My geography degree was good for something.
Posted on Tuesday, December 11th, 2012. Tags: geography.