Monday, May 24, 2021

Street Art for All, without Asking

Art in public spaces is great. It's also tricky. Getting permission means dealing with layers of bureaucracy. Asking for forgiveness risks criminal prosecution and possibly marring your neighbors space.

I came across a brilliant solution to this problem on my run over the weekend. I give you the Secret Community Mural.

The 'mural' is tucked away under a bridge, visibile only to walkers and bikers. It consists of drawings, messages and most importantly, a bag of chalk for passer-bys to add their own.

This citizen powered project can risk asking for forgiveness because the artwork isn't permenant and it's only going to improve the surroundings. So clever, so brilliant.

Here's where the mural is located to stop by and contribute:

I've been trying to think of a way of supporting this project. I suppose I could drop off more chalk. Though I'm considering placing an Ed Emberly Drawing Book at the location as a source of inspiration. Have any better suggestions for ways to contribute?

Sunday, May 16, 2021

Friday, May 14, 2021

Tzitzit Inspiration, Modern and Historic



Yesterday I repaired two tzitzit on my talit. In English, that means that I removed and tied two tassles on my prayer shawl. (Thanks YouTube!) Tzitzit are (to me) a curious Jewish commandment because it's both explicit and cryptic in the Torah. Consider what Numbers 15:38 - 40 have to say:

Speak to the Israelite people and instruct them to make for themselves fringes on the corners of their garments throughout the ages; let them attach a cord of blue to the fringe at each corner.

That shall be your fringe; look at it and recall all the commandments of the LORD and observe them, so that you do not follow your heart and eyes in your lustful urge.

Thus you shall be reminded to observe all My commandments and to be holy to your God.

So make fringes (or what the rest of the world would call tassels): check. Look at the fringes and recall all the commandments? Uh, OK, if you say so.

And yet, as I admired and then later davened with my finished work, I couldn't help but see a new side of tzitzit. I'd taken a simple woolen section of cloth, tied on simple woolen strings with simple knots and ended up with something holy. Truly, the whole was more than the sum of its parts. That makes me wonder: what else can I elevate from the mundane to the holy?

Whenever I look at my tzitzit, I'll see this lesson in sharp relief.

As I read up about the history of tzitzit, I have a pretty solid apprecation for the fact that my ancestors almost certainly took away a different lesson from this mitzvah.

The clue is in the mention of 'blue' in the verse above. You'll notice that the cordage I used to tie on the tassles was all white. That blue is known as tekhelet, and for nearly 2000 years its source was lost to us. To me, its inclusion significantly reshapes the mitvah of tzitzit.

This timeline of our knowledge of tekhlet is absolutely fascinating. Through some very thorough research, we now believe that the blue mentioned in the torah is a specific dye from Murex trunculus, a type of sea snail.

We know that this blue dye was terrifically valuable. Apparently, various Roman Emperors banned anyone but royalty from wearing blue and purple.

In that context, it must been quite the statement to say that all Isarelites should add this luxurious material to the corners of their garments. From the ditch digger, to the wealthy merchant, they'd all be wearing the same sign of royalty.

It brings to mind the no-doubt apocryphal story of the company that flies all their employees first class. Sure, it costs more, but the idea is that every employee is important, so they deserve first class treatment.

Perhaps that's one of the geniuses of the Torah: as the millenia tick by the details may chage change, but the opportunity for learning and inspiration never ceases.

Monday, May 10, 2021

ShulCloud on the command line: Now with form support

Our shul is in the process of switching to In-Person and Zoom based services from being strictly Zoom based (whoo!). To power this process, we're making use of ShulCloud's forms. Naturally, I wasn't excited about logging into ShulCloud's interface to work with these forms, so I decided to add on to the command line tool I'd previously built.

The shulcloudassist tool, which you can find on github, has the following new options:

$ shulcloudassist -a forms
...generate a command line friendly list of all forms...

$ shulcloudassist -a export-form -i 94848
...dump the submissions for form 94848 as CSV...

ShulCloud offers a form submission export URL that I was able to tap into without issue. Using this URL and theauthentication functionality I'd previously built, it was trivial to pull the form submissions given a form ID.

Getting the list of forms, however, proved to be trickier. There wasn't a CSV export option that I could find that gave me this info. It looked like my best bet was to scrape the HTML <table> that contained the list of forms.

To accomplish this, I used a new tool: pup. Pup is inspired by jq, a tool that makes working with JSON a far simpler process. In fact, pup will output JSON, no doubt for further processing by jq.

It took a little experimentation, but ultimately, I got pup to do what I wanted. For example, to pull out the 3rd form's name, I run the following pup command:

curl -s -G ... $BASE/admin/forms.php > $DOC_SNAPSHOT

name=$(cat $DOC_SNAPSHOT | \
  pup "table.listing tr:nth-child(3) td:nth-child(1) text{}")

echo $name

By making creative use of nth-child(...) I can navigate the HTML document and get back just the data I need.

While the process is messy, it does seem reliable. And any tool that brings data to the command line is a win in my book.

Friday, May 07, 2021

3 Plant Mysteries, 1 Simple Tricks for Solving Them

Last weekend we hiked the BROT. Peeking out at the base of a tree I saw this little guy:

What the heck is it?

Or consider this beauty right here. It's obviously what would be called a wildflower, but what plant is it specifically?

And check out the funky leaves of this plant. The dark green and pronounced vein pattern reminded me of spotted wintergreen. Was this spotted wintergreen or a relative?

I wouldn't consider a hike a success if I didn't walk away with a heap of question like these. And thanks to Plant Snap and Google Images it's usually possible to get them answered.

Using a new tool, however, I was able to untangle these mysteries in a single click. Here's what I learned:

Pic 1 is Conopholis americana, known as American Cancer Root, Squawroot or Bear cone. I was right to be confused as it "is a fully parasitic plant that occurs only where it can grow attached to the roots of some species of oak." It has no chlorophyll, hence the lack of any green. Technically, the plant is edible, though reports suggest it tastes awful.  The name 'squawroot' is derived from the medical benefit related to treating menopause and other lady ailments.

Pic 2 is the aptly named Virginia Spring Beauty. Apparently, they are tasty:

In his book "Stalking The Wild Asparagus" Gibbons wrote about eating them daily if not twice a day for several weeks. He said: "We tried them fried, mashed, in salads, and cooked with peas, like new potatoes. All these ways were completely successful, but, as regular fare, we preferred them just boiled 'in the jackets.' My friend grew so fond of this food that he was afraid he would experience withdrawal symptoms when the supply was exhausted." While Gibbon's friend thought they tasted like potatoes Gibbons thought they were sweeter, closer to chestnuts in flavor.

Pic 3 is most definitely not Spotted Wintergreen, and when comparing the two photos they don't look anything alike. What I found is Hieracium Venosum, known as Hawkweed or Rattlesnake Weed. Apparently, it gets it name as it thrives where rattle snakes occur. (Though no, there are no rattle snakes on the BORT). While it may have some medical benefits, they appear to be relatively obscure.

So how did I figure all this out so quickly? Why Google, of course. Specifically using Google Lens. Below are what happens when I click the "lens" button in Google Photos for these examples:

I suppose I shouldn't be surprised that Google can find web pages that contain photos that are a close match to these examples. But still, to see it in action it's hard not to be blown away.

So next time you're out and about and see some strange looking plant, give Google Lens a try. I think you'll be amazed with what you can learn.

Wednesday, May 05, 2021

Tuesday, May 04, 2021

A Long Walk to Image-Based-Map Story Telling

I did a bit of Yak Shaving this morning. See, I wanted to write a post about a recently discovered app feature that does an amazing job of identifying wildflowers. But, to give that post context I thought it would be helpful to put the wildflowers pics on a map. But to get photos on a map, I figured I needed to extract the lat/long from each of the images' metadata. And to extract the image metadata, I needed re-learn how to pull exif data using ImageMagick.

So while I had intended to write about wildflower identification, I found myself writing the shell script below that extracts the latitude and longitude from an image.

But my Yack Shaving didn't stop there.

My Maps Awesomeness

With the latitude and longitude derived, I then went over to Google's My Maps to figure out how I could render the photos on a map.

I opened up My Maps, clicked Import and was shocked to see that there's a Google Photos option:

I selected a bunch of wildflower pics from our recent hike and to my delight, Google precisely placed them on the map. All the work I did to extract geo location data from images was unnecessary (but I'm confident it may be handy in the future).

Wrestling with Garmin Connect

To complete the wildflower map I needed to export our route from connect.garmin.com and import it into a new layer on My Maps. Garmin, to their credit, includes GPX and KML export options and My Maps reads both these formats. This was going to be a breeze!

The export from Garmin went smoothly, but the import into My Maps failed. The export file was over 5 Megs, the size limit for My Maps. Ugh.

Looking at the export file, I noticed at least two optimizations I could make to shrink the file:

<trkpt lat="38.72506211511790752410888671875" lon="-77.3301221989095211029052734375">
  <ele>78.40000152587890625</ele>
  <time>2021-05-02T11:00:34.000Z</time>
  <extensions>
    <ns3:TrackPointExtension>
      <ns3:hr>105</ns3:hr>
    </ns3:TrackPointExtension>
  </extensions>
</trkpt>
<trkpt lat="38.725062198936939239501953125" lon="-77.33012236654758453369140625">
  <ele>78.40000152587890625</ele>
  <time>2021-05-02T11:00:35.000Z</time>
  <extensions>
    <ns3:TrackPointExtension>
      <ns3:hr>105</ns3:hr>
    </ns3:TrackPointExtension>
  </extensions>
</trkpt>
...

Those lat/lon values are crazy. There's no reason to have that many decimal points of precision. Also, the tags prefixed with n3: appear to be heartrate metadata which My Maps won't use. Running the following unix commands brought the 9.2 meg GPX file down to 4.9 meg, perfect for My Maps:

$ sed -E 's/([0-9]{6})[0-9]+/\1/g' bort.gpx |  grep -v ns3 > bort.smaller.gpx

A BROT Wildflower Map

And check it out, here's my wildflower map of the Bull Run Occoquan Trail (BROT). Pretty sweet, right?

Image Based Maps for Storytelling

The more I think about this My Maps capability, the more I'm both impressed by it and amazed I hadn't considered searching for it in the past. Viewing pictures on a map adds an impressive amount of context. It turns what may be an un-inspiring one-off picture into a fascinating collection.

Consider the difference between a photo of a meal you took while on vacation, and a map showing every meal you ate as you traveled the country. While none of the pictures themselves may be particularly special, as a whole, they would be a fun and unique way to visualize your entire trip.

I'm glad to add map based image collections to my blogging toolbox.

Bonus: Image Metadata Extraction

Here's the script I wrote to extract latitude and longitude metadata from images. It was inspired by this discussion.

#!/bin/bash

##
## help out with manipulating images
##

usage() {
  cmd=$(basename $0)
  echo "Usage: $cmd -a lat -f <img>"
  echo "Usage: $cmd -a lng -f <img>"
  echo "Usage: $cmd -a latlng -f <img>"
  echo "Usage: $cmd -a exif -f <img>"
  exit
}


while getopts ":a:f:h" o; do
  case "${o}" in
    a)
      action=$OPTARG
      ;;
    f)
      file=$OPTARG
      ;;
    * | h)
      usage
      ;;
  esac
done

case "$action" in
  lat | lng)
    if [ -z "$file" ] ; then
      usage
    fi
    
    case $action in
      lat)
        prop=GPSLatitude
        ;;
      lng)
        prop=GPSLongitude
        ;;
    esac


    raw=$(identify -format "%[exif:$prop]" $file)
    if [ -z "$raw" ] ; then
      echo "exif:$prop not found in image"
      exit
    fi

    ref=$(identify -format "%[exif:${prop}Ref]" $file)
    if [ -z "$ref" ] ; then
      echo "exif:${prop}Ref not found in image"
      exit
    fi

    deg_n=$(echo $raw | cut -d, -f1 | cut -d/ -f1)
    deg_d=$(echo $raw | cut -d, -f1 | cut -d/ -f2)
    min_n=$(echo $raw | cut -d, -f2 | cut -d/ -f1)
    min_d=$(echo $raw | cut -d, -f2 | cut -d/ -f2)
    sec_n=$(echo $raw | cut -d, -f3 | cut -d/ -f1)
    sec_d=$(echo $raw | cut -d, -f3 | cut -d/ -f2)

    loc=$(convert xc: -format "%[fx:($deg_n/$deg_d) + ($min_n/$min_d)/60 + ($sec_n/$sec_d)/3600]" info:)


    if [ "$ref" = "S" -o "$ref" = "W" ] ; then
      echo -n "-"
    fi
    
    echo $loc
  ;;

  latlng)
    if [ -z "$file" ] ; then
      usage
    fi
    
    echo -n $(imgassist -a lat -f $file)
    echo -n ","
    echo -n $(imgassist -a lng -f $file)
    echo
    ;;

  exif)
    if [ -z "$file" ]; then
      usage
    fi
    
    identify -verbose $file
    ;;
  *)
    usage
esac

Oh, and I really do plan on posting about wildflower identification. That is if I can avoid the Yak.

Monday, May 03, 2021

Hiking (nearly all) The Bull Run Occoquan Trail

Yesterday we hiked the Bull Run Occoquan Trail (aka BROT). I classify this as a One Day Trail, because every time I'd seen it mentioned I remarked that one day I was going to hike it. And yesterday was that day.

What distinguishes BROT from other local area trails is its combination of length and back-country feel. At a little over 17 miles, it's one the area's longest woodland trails. Yesterday, the weather cooperated, and we had an outstanding day of hiking.

We opted to traverse the trail from Fountain Head Regional Park to Bull Run. This was a wise decision because the Fountain Head Section has a heap of elevation gain and loss which was nice to accomplish while we were fresh. The trail was well marked, and at only two points did we find that the blue trail markings and the All Trails route disagreed. And even those cases were easy to reconcile.

Some of the AllTrails reviews painted a pretty bleak picture of the trail: claiming that the trail was overgrown, required bushwhacking or in at least two instances, suggested that you were required to make a waist-deep stream crossing. None of this is true. Except for one recently downed tree, the trail was smooth sailing the whole way. All the stream crosses had bridges or stepping stones.

We did run into one logistical glitch. When we arrived at Bull Run to drop off our car it was 6:15am and the park wasn't scheduled to open until 7am. Our fix was to park at an access point off of Route 28 about a mile into the hike. I was bummed to be losing a mile of the trail, but preferred that to scrubbing the whole adventure. Fountain Head Regional Park opened at 6am (despite Google claiming it too opened at 7am), so we had no problem parking there. We were on the trail by 7am as we hoped.

While the trail didn't offer much in terms of views, and we didn't have time to explore the history of the area as much as I'd liked, it more than made up for these losses. Much of the trail takes you along water which was both picturesque and quite inviting. There were also numerous types of wildflowers in bloom, including Virginia blue bells, Virginia spring beauty, Meadow buttercup, Golden ragwort and more. There was a variety of Azaleas blooming that looked downright spectacular. Heck, even the Skunk Cabbage looked impressive.













I also came across some unique finds, including a Pink Lady's Slipper which is a variety of orchid(!) and the odd looking and equally oddly named American Cancer Root. It was a definitely a wonderful day to be in the woods.


I also spent quite a bit of time pondering this plant right here:


She may not look like much. However, unlike most of her plant neighbors, she's destined for greatness. That's a baby Tulip Poplar. Once mature, it'll be among the tallest trees in the forest. Tulip Trees are so large that I didn't notice their distinctive leaves and flowers until one pooped on me.

Think about all countless things that have to go right for this tiny seedling to turn into a mighty tree. It seems impossible. And yet, as we hiked through the forest, we were surrounded by mature Tulip Trees. That's amazing.

Overall, the BORT is a splendid trail and one I hope to come back and explore in the future.