Friday, March 22, 2019

The River Was Angry That Day My Friends

Typically, running along Holmes Run is a placid affair. You get the woods for ambiance, the paved trail for convenience and the stream crossings to make the whole experience feel like an authentic adventure. But not yesterday. Yesterday the river was angry. The day's worth of rain turned the calm stream into a torrent.

I had planned to run along Holmes Run, but found the following view at the first stream crossing:

I took one look at those whitecaps, snapped a few pics, and ran back the other way.

Thursday, March 21, 2019

Review: Ready Player One

I listened to the audiobook version of Ready Player One by Ernest Cline and really enjoyed it. The only hints of the plot I had were from a movie preview, so I assumed the book would be a shallow excuse to revel in 1980's pop-culture. And while the book definitely elevates the 80's, it touches on deeper themes as well. Add to this the puppy-love story, and I found the book both thought provoking and entertaining.

I liked how Cline weaves solutions into the storyline, much like Christian Cantrell does in Containment. Don't give me a Ted Talk on how virtual schools can help level the playing field and reduce the scourge of bullying, show me by having your main character attend and thrive at one. The samegoes for the book's anti-obesity strategy.

Mostly I enjoyed pondering the philosophical questions posed in the book. It's a common theme in Sci-Fi: the Earth has become unsustainable, so we flee to another planet. In Ready Player One humanity has fled online. Is this the equivalent of finding a new planet? Or has humanity locked itself in a cage? If your virtual reality is nearly your entire self, then does it become your reality? The book poses these questions and leaves room for debate. Notably, our main character is both at home in the digital universe, and yet has flashes of pure desolation when he ponders his choices.

I was a kid during the 80's, so I got a number of the references (my older brother would no doubt get more), including some of the game references. I can proudly say I've logged hours of Gorf and used to play on our Commodore 64. With that said, much of the 80's pop-culture references whizzed over my head. And not being a gamer, I didn't really ponder the book through that lens. More than once I thought how crazy the plot device of having the future obsessively study the 80's is. But I stuck with the book, so I guess it works.

I found the pacing of the book slow at times. I kept waiting for it to skip ahead in the contest, but no, it plodded along in no hurry. And I found the story occasionally tested just how much belief I could suspend, as there were moments when the technology and social structure envisioned were just more than I could buy.

Ultimately, the questions Ready Player One raises aren't really some far off future concern. For all of recorded history, there have been those trapped in circumstances that are far bleaker than the book imagines. Using little more than books and letters, one could imagine constructing an alternate reality to thrive in. The Internet has vastly simplified the process, and now I can be so much cooler online than in real life. Should we be embracing these virtual lives even more, or use this as a wake up call to unplug? And what does it mean that I'm publishing these words on my blog, rather than preaching them to friends over dinner?

So many questions.

Wednesday, March 20, 2019

pick-one: a (very) lightweight image collaboration tool

Last week I wanted a small group of folks to weigh in on a particular design decision. Surely I thought, there's a tool out there I can use to run a quick poll of the various mockups. Alas, searching didn't turn up a usable solution. I found sophisticated tools for collaborating on designs, as well as simple tools for creating image based polls. The design tools were overkill, and the image polls were crude and ad filled. What I wanted was something like, but for images, not scheduling. With no great options, I decided to build my own. I give you: pick-one.

Here's an example of using pick-one in action. Suppose I wanted to find out which bridge pic of mine a group of people prefer. I upload the source photos to a directory accessible to pick-one and then send out a link with that directory name in the URL. In this case the URL is Clicking on the link shows an overview of the photos:

Clicking on any of the images will zoom in:

Each image is automatically overlaid with a consistent letter. Folks I've emailed can reply with a quick 'C' if that's their choice.

You can find the source code for pick-one here. I'm not in love with the fact that it requires you upload images. A smart enhancement would be to pull the images from a Google Album, Google Drive Folder or Amazon S3 Bucket. Once this is done, the system should be far more usable.

I'm still convinced that there's a lightweight tool out there that will let me poll my audience. But until I trip over it (or better yet, you tell me about it in the comments), I'll keep enhancing pick-one.

Tuesday, March 19, 2019

Learn the Lessons, Avoid the Pain | The Catalog of Failed Attempts

Yesterday, Shira came home and found me in a glum mood. The problem I explained, was that Jupiter's YoYo attempt of the PCT had ended in failure. Mind you, I don't really know Jupiter, his failure happened over a year ago and from comments I see that he's fine and heading out on the trail soon. Still, if an uplifting story or song can raise your mood, then surely it's reasonable that a failed attempt should bring you down. That's just quality film making.

Jupiter, however, is self aware enough to know that this failure doesn't define him. As he explains:

I'm obviously not happy about the outcome of this hike but I am happy that it can share a story not often shown. I like to think about it as if it's skateboarding. Those guys fall and fall and fall. But ya know the strongest get back up and try again. Our 'trick' is just on a longer timescale but the lesson is the same.

It's in this spirit that I was glad I watched Jupiter's story and was glad to add him to my Catalog of Failed Attempts (CFA). The CFA exists for an obvious reason: if experience is the best teacher then learning from other's failures is an invaluable (and pain free!) opportunity.

You might think it's a bit harsh to keep a list of people's failed attempts, but I think it showcases an important trend. Everyone on the list has and will continue to have amazing accomplishments. Take Jupiter. Sure, his PCT adventure didn't go as planned. But neither did his first thru hike attempt of the AT. After that trail, he successfully completed the 4,800 mile Eastern Continental Trail. I'd love it as much as the next person if we could have our failures early (or better yet, not at all!) and be done with them. But as long as you're leaving your comfort zone failure is very much an option.

At its core, the catalog is all about embracing and learning from failure, not dreading it.

Any attempts you can suggest adding to my list?

Thursday, March 14, 2019

Building a Better Barometer

Picture it: We're a 1000 miles from nowhere, it's 3pm, and we're staring at a trail map. Should we push forward and tackle the mountain pass ahead of us, or should we play it safe and take it on the next day? If only we had a way of knowing if the current weather was going to hold. Then it hits me: I can consult my phone's barometer to help predict the weather.

I bust out my phone, Bluetooth keyboard, and start up Termux. I then run tail -24 ~/storage/shared/Tasker/pressure.txt | baro to see the last 24 hour's barometric pressure readings. We huddle around my phone, trying to make sense of this raw data.

There are a number of things wrong with the above scenario. Top among them, the awkwardness of using my baro shell script. Fortunately, it's not hard to make this script far more practical.

First off, I discovered spark, a command line sparkline generator. Sparklines are an Edward Tufte invention that's used to help visualize data. Here's how Tufte defines sparklines:

A sparkline is a small intense, simple, word-sized graphic with typographic resolution. Sparklines mean that graphics are no longer cartoonish special occasions with captions and boxes, but rather sparkline graphics can be everywhere a word or number can be: embedded in a sentence, table, headline, map, spreadsheet, graphic. Data graphics should have the resolution of typography.

Thanks to this shell script you can add Bash terminal to the list of places sparklines can appear. The spark command reads data from stdin and generates a corresponding mini bar graph. Here's an example of me filling a data file with 100 random numbers and then graphing the results.

The other missing piece of the puzzle is an ability to run my baro command with ease. The Termux:Widget app has me covered there. Termux:Widget allows you to add a widget to your home screen that scans the ~/.shortcuts directory. Every file found in that directory shows up as a command in the widget. Pressing on the script name launches the corresponding command. Here's my ~/.shortcuts/show_pressure script:


cd ~/storage/shared/Tasker
tail -$hours pressure.txt | $bin/baro
tail -$hours pressure.txt | $bin/baro -d | $bin/spark
tail -$hours pressure.txt | $bin/baro -s

Combining spark and Termux:Widget means that I can now view my local barometric pressure by clicking over to my widget screen and pressing show_pressure:

Do we push on, or setup camp? Who knows. But at least consulting the barometer is now effortless.

Wednesday, March 13, 2019

Review: Phantom Warriors

I've mentioned before how riveting a read Phantom Warriors by Gary Linderer was, and I recently finished book 2 in the series. Bottom line: I continue to be in awe of the stories Linderer tells.

Phantom Warriors chronicles the life of various Long Range Reconnaissance Patrols (LRRP) during the Vietnam War. While LRRPs were occasionally used for offensive means, the majority of their missions focused on collecting field intelligence. As modern a war as Vietnam was, the most reliable way to assess the state of affairs on the ground was to send in highly trained pros. A mission typically lasted for days, and even the smallest misstep could reveal the team's position and put them in an overwhelmingly bad position. You can read about some of tactics they used to stay safe here,

The grit, courage, fearlessness that were so prominent in book 1 continue in book 2. In this latest book, however, I got a more complete picture of the challenges LRRPs face. We meet soldiers and commanding officers who are more liability than asset. We find our teams of heroes not just under fire from the enemy, but from poor decision making and distrust by their own leaders. It's one thing to call for an extraction and be told that no helicopters are available. It's altogether a different story to be denied assistance because senior command doesn't truly believe you need it, or doesn't believe the contact with enemy even occurred.

This is an ugly side of war, but it's no less a reality than the other challenges LRRPs had to deal with.

Book 2 follows the same recipe set out in book 1. Each chapter begins with a fairly technical state of the war at the time of the mission, followed by a short introduction to each individual going out on the patrol. You're then treated to a blow by blow account of the mission, which may last hours or days; may be without incident or contain a bloody firefight; and may end with everyone safe or significant loss of life. You have the privilege to watch each story unfold, all while rooting for the team to make it back in one piece.

It's worth noting that the overview given at the start of each chapter was almost my undoing. I picked up Phantom Warriors a couple times only to put it down because I found the content so bland. But once I read on I realized just how short-sighted I'd been. The text naming each soldier in the patrol, while less exciting than the mission description, is just as important. It goes a long way towards reminding me that this isn't some fictional account. These were real people in a very real war.

These are legendary heroes, with a story that hasn't been widely told. Pick it up today, you'll be glad you did.

Tuesday, March 12, 2019

Digits, Aspirin and an NFC Powered Cheatsheet

This past weekend we got recertified in CPR and first aid, and so the time was right for me to take stock and up my first aid game. Here are three changes I've made as a result.

I've gotten into the habit of handwriting key phone numbers in the back of my pocket notebook. That way if I lose my phone I've got a fighting chance of contacting loved ones. To this list I added Poison Control (800-222-1222) and the National Suicide Prevention Lifeline (800-273-8255). Hopefully I'll never need either of these, but should one of them be necessary, I want the quickest access possible.

I've been vaguely aware of the recommendation that if someone is having heart attack symptoms they should take an Aspirin. This advice appears to be legit, and have added 4 tablets of 325mg Aspirin to my kit.

A day of CPR and first aid training is helpful, but those skills are awfully perishable. To help retain them we're given a quick reference guide. I pondered the best way to store this guide and came up with the following.

First, I copied the salient details of guide into a plain old .html file. After storing this file locally on my phone I setup a trivial Tasker action that opens this file in a browser. I then setup two quick ways to access this Tasker action: the first is a widget on my home screen, and the second is a via an NFC tag that's placed in the first aid kit itself. I'm not sure how practical this second method is, but it's pretty sweet to hover my phone over my first-aid kit and have a cheatsheet pop-up in response.

Will this NFC tag approach work in a high-stress emergency scenario? Probably not. But it does make launching the file easy and if I do that every couple months for a quick review, that alone will be helpful.

Finally, here's a couple snapshots of my EDC first aid kit. A good bit of it is little more than meds and tape, which can truly work wonders. The gloves, CPR face shield and tourniquet are a nod to the fact that very bad things can happen when we least expect it. The ear plugs are because I kept showing up at concerts unprepared and kids today play their music too dang loud.

Friday, March 08, 2019

Weather Prediction Like It's 1850

I've been wearing one of Shira's old watches and I've become fascinated by the weather function. Without any connection to the web and minimal sensors, it boldy offers predictions. See, it's going to be partly sunny today! (OK, that's not the boldest of predictions I suppose.)

How does it do that?

The watch in question is an old tech4o model that fits in the Altitude-Barometer-Compass class of watches, so called ABC watches. Back in the day, these were high tech and provided next level features when compared to a typical sport watch.

My hunch was that the sensor powering the predictions is the barometer. This fascinating article on the topic Fair or Foul? How to Use a Barometer to Forecast the Weather confirmed my suspicion. What a game changer this must have been in the mid 1800's when suddenly forces that seemed godlike were reduced to quantifiable phenomena. Even now, when it seems like weather forecasting should be in the domain of scientists and super-computers, I find it remarkable that you can offer predictions, however crude, using one commonly available sensor. That's too cool.

Most of the time I'm only a few keystrokes away from knowing a precise forecast. That is, however, until I'm off in the woods and there's no cell or WiFi signal. In that case, having something like Shira's watch could be pretty handy. But what if I didn't want to depend on her watch? The Physics Toolbox App on my phone tells me that my Galaxy S9+ has a pressure sensor built in. Could I use my phone as glorified barometer?

Looking on the Android Play Store I found a number of apps that promise to turn my phone into a weather station. But many of them seem quite sketchy, and even the ones that look reputable leave me with questions of efficiency and battery life impact. Fortunately, there's a lighter-weight option than installing one of these apps: Tasker. When configured, Tasker will populate the variable %PRESSURE with the current value of the phone's pressure sensor. Capturing this variable in a simple text file is easy:

(Download this Tasker Profile)

You'll want to make sure that you've setup Tasker to monitor the pressure sensor. Also, in order for the %PRESSURE variable to be populated it needs be referenced by a profile. Or at least that's what I had to do to get the variable to be set.

I got a little overzealous and had Tasker capture the %PRESSURE every 5 minutes. I think hourly is probably sufficient. Regardless, after couple of days I had a data file filled with entries that looked like so:


That's standard unix time and pressure in millibars. All that was left to do was to turn that text file into of something human friendly. I kicked off Termux, fired up emacs, and wrote the following script:

#!/usr/bin/env bash

## A script for working with barometric pressure data
## Assumes standard in is a stream of unix timestamps and barometric pressures
## See also:


while getopts "d" OPTION ; do
  case $OPTION in
    d) MODE=data ;;
    *) echo "Usage: `basename $0` [-d]" ; exit 1 ;;

while read line ; do
  s=$(echo $line | cut -d: -f 1)
  v=$(echo $line | cut -d: -f 2)
  hg=$(echo "($v * 0.0295)" | bc)
  p=$(echo "($v * 0.0295 * 100)" | bc | sed 's/[.].*//')
  t=$(date "+%Y-%m-%d %H:%M" -d @$s)
  if [ $MODE = "data" ] ; then
    echo $p
    if [ -z "$last" ] ; then
      if [ "$last" -eq $p ] ; then
      elif [ "$last" -lt $p ] ; then
    echo "$t $c ($hg)"

The script maps the stream of raw times and pressures into a readable timestamp, rising/falling/steady indicator and pressure in inHg. Consider the example below that tells me that after dipping overnight, the pressure has started rising this morning. That bodes well for today!

While my Tasker + Termux solution lacks the the cute icons Shira's watch provides, it makes up for this with something more valuable: simplicity. Tasker is giving me raw access to the sensor, and good old fashion unix scripting let's me process it. In other words, I've turned my $800 cell phone into a $20 barometer. Most importantly, whether I have Internet access or not, I can play armchair sea-captain and offer up weather predictions. Welcome to the 1850's baby!

Wednesday, March 06, 2019

Making More Minyans | A Software Solution to Increasing Attendance

For years I've wondered what code I could write to help improve attendance at my shul's Thursday morning minyan. For those not familiar with a minyan, the idea is that we have a weekly prayer service that runs regardless of how many people attend. If 10 Jewish adults are present then we can say a number of additional prayers. You can apply the logic of this post to any gathering that strives to have a quorum.

There are a number of competing requirements that minyan related software should meet:

  1. It should encourage people to attend without turning into a nag.
  2. It should be respectful of people's time and only call for a minyan when one is necessary.
  3. It should be a lightweight, frictionless system. Users shouldn't need to register an account or have to log in to interact with it.
  4. It should work equally well over mobile and desktop devices.
  5. It should be something I can build and maintain with a minimum of effort.
  6. It should both push information out to the community, as well as serve as a repository interested individuals can interact with.

Over the years, I've had glimpses of solutions to the above ("What if I made an SMS based ...") but I've never had a concrete plan.

And then a couple of weeks ago, while on a run, I had a flash of inspiration. I then sat down and coded an implementation in 45 minutes. This blog post will probably take longer to compose and edit! Here's what I did.

First, I created a new Google Sheet. I setup one place on the sheet to request a minyan and another place on the sheet to say you're attending. I made the sheet editable by all (so no login required) and protected all the cells except for the area I expected input. To simplify access, I created a custom redirect on the shul's website so that a URL like: would take users to the spreadsheet.

Here's a screenshot of the sheet in action:

With just this sheet and URL created I solved a number of the above challenges. The system didn't require any registration or login and had a friendly URL. That's pretty frictionless, no? The system serves as a repository of information. On Wednesday night, folks can peek in and see how close we are to a minyan for the following day. Google Sheets works well on both Mobile and Desktop devices, so I was covered there too. And so far, the system had been effortless to build.

There were a couple of key pieces missing. First, the system doesn't push information out. Second, there's no obvious way to reset the sheet for the next week. On my run I imagined I'd have to write custom code to address these challenges. However, Google was one step ahead of me and provides easy fixes. The magic: Installable Triggers. Specifically, Time-drive Installable Triggers. Using these you can invoke a function on your Google Sheet at a recurring time. Essentially, it's cron for Google Apps. I setup two triggers: one happens two days before minyan and calls the notify function, and one happens an hour after minyan and calls reset. Here's the definition of the notify trigger:

All that was left to do was to write the notify and reset functions. reset I figured would be straightforward as it's little more than code to delete the contents of cells. But notify I intended to send e-mail. Would Google Sheets allow such an action? Again, things broke my way and the answer was a resounding Yes! Here's my implementation of notify and reset:

function reset() {
  var doc = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = doc.getSheetByName("Minyan Tracker");
  var ranges = [ sheet.getRange("C5:C17"),
                sheet.getRange("E5:E17") ];
  ranges.forEach(function(r) {

function notify() {
  var doc = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = doc.getSheetByName("Minyan Tracker");
  var needs = sheet.getRange("E5:E17");
  var requests = needs.getValues().map(function(row) {
    return row[0];
  }).filter(function(cell) { return cell != ''; });
  if(requests.length > 0) {         
    var body = "A Minyan was requested for Thursday morning. Can you attend?\n\n" +
             "If so, please visit: or reply 'Yes' to this e-mail to let the community know.\n\n" +
             "Tired of getting these e-mails? Mail Ben Simon ( and ask " +
             "to be removed the TMMR mailing list.";
    MailApp.sendEmail("", "[TMMR] Minyan Requested", body);

I setup the minyan-notification e-mail list to include folks interested in attending minyans. I configured the e-mail list so the replies go back to the sender; Me. This means that recipients can signify their attendance by either clicking on the link within the e-mail, or hitting reply to the e-mail. What could be simpler than that?

notify only sends e-mail if someone has signed up requesting a minyan. The request list on the sheet, like the list of attendees, is cleared out weekly so it stays fresh. The result is a system that pushes out requests but is careful to do so only if a congregant has an explicit need.

It truly is amazing what you can accomplish using a Google Sheet, an e-mail list, a bit of code and some creativity.

Tuesday, March 05, 2019

Massive and Invisible | The Oscar Straus Memorial

Outside the Reagan Building, on the DC Mall, is a large fountain flanked by imposing statues.

You could be forgiven for (a) assuming they have something to do with Ronald Reagan, or (b) neglecting to notice them at all.

In fact, this a monument to Oscar Straus, the first Jew to be appointed as a cabinet secretary. He served under Theodore Roosevelt as Secretary of Commerce and Labor. He also served under Taft, McKinley, and Cleveland. His autobiography describes Roosevelt's offer to join his cabinet:

After luncheon, the President asked me to wait for him in the Red Room, as he wanted to have a talk with me. When the other guests had departed, he came back to me and with his face beaming with geniality he said: "I don't whether you know it or not, but I want you to become a member of my Cabinet. I have a very high estimate of your character, your judgement, and your ability, so I want you for personal reasons. There is still a further reason: I want to show Russia and some other countries what we think of Jews in this country."

How wholesome is that scene? It's like out of an episode of West Wing.

As for the monument itself, the statues on the left are titled Justice, while those on the right are titled Reason. Justice is a nod to the Religious Freedom that allowed a Jew to have such a prominent government position:

Just two blocks from the White House in Washington, D.C., in front of the Ronald Reagan Building and International Trade Center, is a memorial to Oscar Straus, one of the premier U.S. statesmen of the early twentieth century. Two statues represent what Straus cherished most about this country—our high esteem for enterprise, on the one hand, and our commitment to freedom of religion on the other. At the base of the monument to religious freedom—a woman, representing "Justice," with her arm resting on the Ten Commandments—the inscription reads: "Our Liberty of Worship is not a Concession nor a Privilege but an Inherent Right."

Reason honors Straus' Commerce and Labor efforts:

To the right of the fountain, Reason is represented by a partially draped male figure and a child holding a purse, key, and hammer, symbolizing capital and labor. The figures represent the opportunity and religious freedom Oscar Straus found in the United States and commemorate what he gave back in service to his adopted country.

At the time, immigration fell under Commerce and Labor and Straus didn't forget his immigrant roots:

Straus, an immigrant and the first Jewish person to serve in a presidential cabinet, believed in an open-door policy for immigration. Whereas previous Secretaries of Commerce and Labor had viewed Ellis Island as an administrative headache, Straus took greater interest in immigration than his predecessors and gave full support to the views of the new commissioner.

Everything I read about Straus gives off an aura of goodwill and striving to make the world a better place. Still, I can imagine his Mom having this back and forth: You must be so proud! Feh. What kind of boy gives up a law practice to be a secretary?

The Straus monument, while hidden in plain sight, is a treasured part of Jewish DC. If you have the opportunity, swing by and take a fresh look at this work of art that honors a remarkable Member of the Tribe.

Friday, March 01, 2019

Very Tiny and Very Annoying | The War on Biofilm

Below is a pic of the Jefferson Memorial I caught on a run a few weeks ago.

Note the odd swath of white on the dome. My guess is that's due to the biofilm cleanup effort the National Park Services is undertaking. You wouldn't imagine "a colony of microscopic organisms" could do so much harm to the look of a monument. However, up until October of 2017 the biofilm covering the monument was easily winning the war, and us puny humans were powerless to fight back.

But before you surrender to our biofilm overlords, you'll be glad to know that through the power of "lasers" we can safely destroy the biofilm without harming the memorial or its ecosystem. Well, unless you consider the biofilm as part of the ecosystem. I think a spotless Jefferson Memorial will be a welcome sight on the Mall.


Related Posts with Thumbnails