Thursday, March 17, 2016

Defying Gravity and Other Sights from Last Night's Game

Shira scored tickets to last night's Bulls vs. Wizards game. I'm not a follower of pro-sports, but I'm always glad to hit up a live event. And I've got to say, I was really impressed with last night's game. No doubt the ridiculously close seats helped. I mean, I know on paper these guys are big, but up close, they're absolutely huge. And yet, they can move with incredible grace and precision. There were definitely sequences where it seemed that the players managed to hang in mid air for an unnaturally long time. All in all, very impressive.

A few photos of the action are below. I missed the tip-off, but in my defense I had this going on in front of me, which served as, uh a, distraction.

Fun times, and it was great to see the home team victory!

Wednesday, March 16, 2016

The Lazy Upcycler: Quick and Easy Mesh Bags

Don't get me wrong, I love me an impressive upcycle, where someone takes trash and turns it into a magnificent object. But that's just not me. Me, I'm strictly opportunistic (read: lazy). I see an interesting container, I'll toss it in the dishwasher. Maybe I'll find a use for it, maybe it'll end up in the recycle bin. No biggie.

My latest reuse hack: with a minute or two of TLC, turn the plastic mesh bags that clementines come in, into little drawstring bags. The process is embarrassingly simple:

That is: cleanly cut one end of the bag, ziptie the other end, cleanly cut it, thread a shoe lace through the first opening. And you're done.

The result looks like, well, a mesh bag:

I wish these bags weren't made from plastic mesh, as I bet old school string would be quite strong. But still, the bags are surprisingly useful. They are lightweight, pack down to nothing, allow the contents to "breathe" and best of all, if one gets damaged or generally nasty, it can be recycled like it was going to be in the first place. Zero guilt.

Tuesday, March 15, 2016

The technology that powered geeks from Newton to Aldrin

Pop Quiz: What do Issac Newton, Buzz Aldrin and My Dad all have in common? They all solved math problems, at one time or another, using the same device: the mighty slide rule. After watching this video I realized I've never done a post on the slide rule, and as an aficionado of all things simultaneously basic and techy, I needed to correct that.

The technology really does go back hundreds of years, with Issac Newton clearly describing a device which anyone doing math in the 1960's or before would appreciate:

Mr. Newton, with the help of logarithms graduated upon scales by placing them parallel at equal distances or with the help of concentric circles graduated in the same way, finds the roots of equations. Three rules suffice for cubics, four for biquadratics. In the arrangement of these rulers, all the respective coefficients lie in the same straight line. From a point of which line, as far removed from the first rule as the graduated scales are from one another, in turn, a straight line is drawn over them, so as to agree with the conditions conforming with the nature of the equations; in one of

And here's an actual shot of Buzz Aldrin in space with a slide ruler floating in the background:

One can imagine that nearly every major undertaking involving complex math utilized the slide rule in one way or another. Consider this description of the building of the Golden Gate Bridge:

Charles Ellis and Leon Moisseiff calculated forces for the Golden Gate Bridge with only a circular slide rule and a manual adding machine. They worked for months -- by hand -- sometimes solving equations with more than thirty unknowns.

Those guys weren't messing around.

My favorite slide rule store does happen to come from the space program, specifically from the Apollo 13 mission:

Perhaps the most impressive use of the slide rule was during the Apollo 13 crisis. Engineers had to recalculate data to guide the crew safely back to Earth—and they had to do it quickly. Richard Ogle describes how it went down:

""NASA had at its disposal whole banks of sophisticated computers, of course, but these were not programmed to do the basic calculations [Commander Jim Lovell] needed. So the engineers reverted to that most mundane pre-pocket calculator workhorse, the slide rule. Had the engineers at Mission Control been forced to do the necessary calculations on paper, Apollo 13 might well have missed the trajectory needed to bring it back to earth altogether. Instead the slide rule, designed specifically to exploit human beings’ highly developed visual acuity, allowed them to perform a set of complicated calculations in seconds.""

OK, we all get that the slide rule is an amazing device. But how do you truly grok it? You could pick one up on eBay for under $10 or so and work towards mastering it. Or, you could install the App on your phone for free, and start playing with it right now. But, as they say, if you truly want to understand something, teach it. And I know of no more recalcitrant a student than the computer. So I decided to program a slide rule.

Here's my solution:

(struct scale (symbol location abs-fn scale-fn) #:prefab)

(define C (scale 'C 'slide
   (lambda (s)
     (log s))
   (lambda (a)
     (exp a))))

(define D (scale 'D 'body
   (lambda (s)
     (log s))
   (lambda (a)
     (exp a))))

(define CI (scale 'CI 'slide
    (lambda (s)
      (log (/ s (/ 1 s))))
    (lambda (a)
      (/ 1 (exp a)))))

(define DI (scale 'CI 'body
    (lambda (s)
      (log (/ s (/ 1 s))))
    (lambda (a)
      (/ 1 (exp a)))))


(define A (scale 'A 'body
   (lambda (s)
     (log (expt s (/ 1 2))))
   (lambda (a)
     (expt (exp a) 2))))

(define B (scale 'B 'slide
   (lambda (s)
     (log (expt s (/ 1 2))))
   (lambda (a)
     (expt (exp a) 2))))

(define R (scale 'R 'slide
   (lambda (s)
     (log (expt s 2)))
   (lambda (a)
     (sqrt (exp a)))))

(define K (scale 'K 'body
   (lambda (s)
     (log (expt s (/ 1 3))))
   (lambda (a)
     (expt (exp a) 3))))



(define (make-slide-rule)  
  (let ((offset 0))
    (lambda (action . args)
      (define (align s1 v1 s2 v2)
 (cond ((and (eq? (scale-location s1) 'body)
      (eq? (scale-location s2) 'slide))
        (set! offset
       (- ((scale-abs-fn s1) v1)
   ((scale-abs-fn s2) v2)))
        offset)
       ((and (eq? (scale-location s1) 'slide)
      (eq? (scale-location s2) 'body))
        (align s2 v2 s1 v1))
       (else
        (error (format "Must align body to slide, not ~a to ~a"
         (scale-location s1) (scale-location s2))))))
      (define (read s1 v1 s2)
 (cond ((and (eq? (scale-location s1) 'body)
      (eq? (scale-location s2) 'slide))
        ((scale-scale-fn s2) (- ((scale-abs-fn s1) v1) offset)))
       ((and (eq? (scale-location s1) 'slide)
      (eq? (scale-location s2) 'body))
        ((scale-scale-fn s2) (+ ((scale-abs-fn s1) v1) offset)))
       (else
        (error (format "Must read from slide to body, or body to slide. Not ~a to ~a"
         (scale-location s1) (scale-location s2))))))
      (case action
 ((align)
  (apply align args))
 ((offset) offset)
 ((read)
  (apply read args))
 (else
  (error (format "Unknown slide rule command: ~a" action)))))))

I found this page especially useful in developing my implementation.

What I learned from this little coding exercise was that there's really only two operations that you can perform with a slide rule: slide it and read it. So I implemented those two operations: align and read. For example, to perform basic multiplication, you align the C and D scales, and then read the value off the D scale relative to the C scale. Or, in code:

(define sr (make-slide-rule))
(sr 'align C 1 D 5)
(sr 'read C 3 D) ;; => 15

And here's an example of computing X3 using the K scale:

(define sr (make-slide-rule))
(sr 'align C 1 D 1)
(sr 'read C 3 K) ;; => 9

I definitely appreciate that by implementing more advanced scales, you could knock out some pretty hairy math with relative ease.

Don't get me wrong, I love me a calculator (even with its flaws) and gladly perform even the most basic mathematics on it. But from a design and hacking perspective, you really can't beat the mighty slide rule. It's definitely worth taking the time to understand how it works and why it was such an effective tool for so long.

Thursday, March 10, 2016

Fore! Golfing with The Parents, A Surprisingly Successful Adventure

My parents are golfers. Me, not so much. Actually, make that not at all. Years and years ago my parents tried to help interest me in the sport but it didn't take. I think I played a grand total of one par 3 course. Yet when I realized that we were merely minutes from the East Potomac Golf Course, and that the course was not only open to the public, but quite affordable, I suggested to my parents that I play a round with them. I figured I'd hit a few balls, and if nothing else, get a nice walk in while I watched them show off their skills.

And this week the stars aligned: my parents were in town, the weather was perfect and I could book a 1:06pm tee time. And so I did.

We arrived at the Golf Course 45 minutes early in the hope that I could hit a few balls on the driving range. Our plan came together nicely. My Mom gave me about 10 minutes worth golf lessons, the three of us hit a bucket of balls and off we went.

We played the White Course, which consists of 9 holes. And I've got to say, when we started that first hole and I couldn't even see the flag at the other end, I was a bit intimidated. Actually, make that very intimidated. My brain tried to process what I was seeing: 141 yards away was a tiny little cup that I was expected to get a tiny little ball into.

Still, I followed my Mom's advice (keep that back swing short!; keep that left arm straight!; relax!) and what do you know, I actually managed to do OK. In fact, I left the course feeling quite proud of myself. I'd spent most, though not all, of the time on the actual fairway, didn't hurl a club, didn't throw a temper tantrum and managed to eek out a few beginner's luck shots. I did get in that nice walk as well as the joy of sharing a game with parents that they love.

Good times!


Wednesday, March 09, 2016

Up Close and Personal: Building and Using A $3.00 Digital Microscope

This DIY digital microscope project looked like a no-brainer to experiment with. So, I did. What makes the project work is the lens from a cheapy keychain laser pointer. I picked one up at CVS (the Laser Chase II) for under $3.00:

I took a needle nose pliars to it and ripped it shreds. When I was done, I had the tiny lens extracted. As suggested here, I mounted the lens by fitting it into a bobby pin and taping the bobby pin to the phone. Here was my setup, minus a tripod:

Yes, I'm using a bit Play-Doh to keep the flashlight upright in that plastic cup. And yes, I used the packaging of the laser pointer to make a slide and base for my samples. Hey, use what you've got, right?

And the results? Well, I certainly got up-close photos. I'm not sure I really captured anything that remarkable, but I'll have to keep an eye out for some more interesting specimens. The photos below are of a snippet of leaf and my saliva. As quick experiments go, I've got to say, this is a fun one. For $3.00 and 20 minutes of your time, it's hard to beat.

What the video that inspired this all:

Tuesday, March 08, 2016

Gotcha of the Day: Google's Mobile Friendly Tool Ignores Responsive Design CSS

As a make-a-website-mobile-friendly project was winding down, I decided to pop over to Google's Mobile Friendly Test Tool to confirm what Firefox's Responsive Design Mode and my actual cell phone showed me: the site was ready for mobile use.

And of course, Google's Tool gave my work a big 'ol F-. It explained to me that the site was most certainly not mobile friendly and showed a screenshot as the evidence.

In Google's defense, the screenshot did show a pathetic mobile experience, as it showed the desktop site crammed into a tiny window; not at all what I intended.

And so began the anger and denial. The anger came from the Tool's lack of specific detail. How hard would it be to show me exactly what files Google was accessing and exactly what CSS was being applied? All I could find were links to general mobile design guidelines, not helpful.

The denial was just the classic developer response. Surely the tool was grabbing an outdated version of the page. I changed the HTML on the front page and hit refresh. D'oh, it showed the most recent change.

Surely the tool was refusing to pick up mobile.css. I hit refresh on the tool again and, D'oh, I watched in the access logs as it downloaded mobile.css.

Surely the tool was ignoring my @media screen directive within mobile.css. I added the rule:

 body {
   borer: 4px dashed purple;
 }

and hit refresh. D'oh, the tool gladly reran the test, showed me the ugly purple border *and* failed my work.

My phone and Firefox were showing the right version, but Google wasn't. What about another site? I bounced over to MobileTest.me and tried the site there. It showed up just like I wanted it to.

So odd, it was definitely Google's fault.

And then I looked at my specific CSS. The original site was coded years ago, back when the best practices of CSS were still in flux. The result was that I had to do some pretty creative things in mobile.css to undo the craziness in style.css. One unusual line of code was this guy:

  body {
   ...
   min-width: unset;
   ...
  }

I changed that to:

  body {
   ...
   min-width: 100%;
   ...
  }

And Bam!, Google's Mobile Tool showed me a nearly perfectly rendered mobile site. There was some funkiness in the header of the site, where the logo was getting overlapped with the site's tag line. But still, it was a huge improvement. I looked for more suspsicious CSS and made this change:

  #title {
    ...
    position: unset;
    ...
  }

to

  #title {
    ...
    position: static;
    ...
  }

And, problem solved!

So apparently Google's CSS handling is just a bit more restrictive than my mobile phone and Firefox's. Definitely something to keep in mind when trying to please Google's Mobile Friendly Tool and more importantly, the Googlebot, which no doubt uses the same logic.

Monday, March 07, 2016

The Problem With, and Solution To, Calculators

I was chatting with my Dad last night and the topic of calculators came up. My Dad, a Biology Professor for many years, had strong feelings about these magical little devices and how they impacted his students. The problem, he explained, is that the calculator always gives you an answer. And because the answer is on a calculator (or in an Excel Spreadsheet, or part of a Matlab Prompt session, or echo'd next to an R prompt) it has the bias of appearing as truth. The result: his students would blindly hand in answers that with even a little thought showed them to be ridiculous.

So what's the solution, I pressed back?

Simple, he explained: before you starting using the calculator figure out a guess as to what you believe the solution should be.

If the solution and your guess match, awesome!

If the solution and your guess don't match, that's just as important: why not? Was an assumption of yours off? Or, did you merely type in an extra zero when keying in your inputs?

Solid advice Dad, and one I'll be using from now on.

Thursday, March 03, 2016

A Little Love for Snapchat

I'm a big proponent of allowing everyone, including kids, to have an online presence. Blogging, Facebook, Twitter; give me a few minutes and I'll be glad to step on my soapbox and preach as to their value. But Snapchat? Well, not so much.

Snapchat as I first experienced over a year ago is an app custom built to frustrate parents. For those who need a refresher, Snapchat is the app that allows you to send a message (typically a photo) and it gets automatically "deleted" after the receiver has viewed it for a few seconds. Deleted is in quotes because this is the web and computers and such, and nothing should ever be considered deleted.

In other words, it's practically inviting you to undress, take photos of yourself, send them to your friends.

OK, perhaps not. But that's what the doomsday fear is. And I can't blame parents who worry about what kind of mischief their kids are going to get into with an app that appears to provide a behavioral free pass.

From my perspective, Snapchat's lack of history means that you lose all the archival benefit of web publishing. Those photos you snapped of your buddies at the football game all disappear with Snapchat. But wouldn't it be cool to see those photos 30 years from now? Trust me kids, it would be.

But enough Snapchat hate, thanks to this article: Why Your Kids Love Snapchat, and Why You Should Let Them I'm willing to re-think the service.

The premise of the article is that many of the negative unintended consequences of typical social networks are avoided with Snapchat. Consider the evils of the Like button:

Most visual platforms put feedback from peers at the center of the experience. Life on Instagram, for example, is as much about the rush of scoring likes as sharing something creative with peers. Many users view likes as a barometer of popularity and even self-worth, with some even deleting posts that haven’t drawn enough attention. For tweens and young teenagers, the yearning is so powerful that many post content designed only to collect likes (the popular “rate for a like” post, for instance, offers to rate friends on a scale in exchange for a like). They may follow “Instagram stars” with hundreds of thousands of followers, observing what appear to be perfect lives that are, in reality, perfectly curated.

I suppose it boils down to this: what if you just want a way to chat with your friends? You're not interested in recording every moment for posterity, or leaving a digital footprint to impress colleges, or leading a revolution. You just what to say Hey. Well, it's hard to argue with the crude effectiveness of Snapchat.

Read the article and snap on!

Wednesday, March 02, 2016

Sure, you're innocent, but do you know why?

I don't know much about law, but I know this: You're innocent until proven guilty. At least I've watched enough TV dramas to think I know this. So here's the question: where was this statement originally codified? Surely it's in the Constitution or some other founding document; right?

I got curious enough to look, and it turns out, it's not:

The Anglo-American reverence for the maxim does pose an interesting conundrum: it cannot be found in Magna Carta, the English Bill of Rights of 1689, the Declaration of Independence, or in the Constitution of the United States; and not, I might add, in the works of the great English jurists, Bracton, Coke, and Blackstone.

The principle isn't officially codified until 1895, when the Supreme Court made it official. The short version of the story is this:

We can know exactly when the maxim formally entered American law: through a Supreme Court decision of 1894, Coffin vs. U.S. A lower court had refused to instruct the jury that "The law presumes that persons charged with crime are innocent until they are proven by competent evidence to be guilty". The appeal to the Supreme Court was based in part on the lower court's refusal.

By the way, they won the appeal. The Coffin decision contains a historical attempt to map out the history of innocent until proven guilty and goes as far back as Deuteronomy. The recounting would make a Talmudic scholar proud.

It's remarkable to think that an absolute bedrock principle of American law was only codified nearly 120 years after the country's founding.

Next thing you're going to tell me that that Under G-d wasn't added to the Pledge until the 1950's.

Proof Arlingtonians Just Don't Get Trump

This map elegantly explains why nobody around here gets Trump:

And within those splotches of purple, Arlington is extra purple:

Seriously, the guy won our state but came in a distant 3rd place locally.

Who's up for a field trip to Buchanan County where Trump earned nearly 70% of the vote?!

Of course, Buchanan's 70% of the vote only netted Trump 1,586 votes, whereas his poor turnout in Arlington earned him 3,698 votes. Tricky, eh?

Still, around here you're probably going to have better luck getting support for a gun store than you are getting support for Trump. We just don't get it.

Tuesday, March 01, 2016

Why Arlington Needs a Gun Store

Arlingtonians are freaking out. There's talk of a gun store opening up in the community and people have gone downright apoplectic. Over 2000 of my neighbors have called on the building and gun store owner to cease and desist. I think they're wrong to do so, and more importantly, my guess is that they think they're wrong, too.

Allow me to explain.

Imagine for a second that you get a call from your Aunt Louise down in Real Virginia. She's absolutely furious. She explains: "they want to open up a Planned Parenthood next to a children's school. How can they be so brazen as to put this factory of death next to our children?! The people who run this Planned Parenthood don't share the same values as the community, the building owner should refuse to provide them with a lease!"

You take a deep breath and try to calm good old Aunt Louise down. First off, you explain she doesn't really know what goes on at Planned Parenthood, she only knows to repeat the same talking points as her uninformed friends. In fact, you wouldn't be surprised if given time, the community would embrace the Planned Parenthood. Besides, it's effectively a business: if people don't go to Planned Parenthood, it will close up on its own. Supply and demand is the ultimate equalizer.

You'd agree with her that the optics of having a Planned Parenthood next to a school was unfortunate, but abortions don't just jump off the shelf, do they? People who want to find Planned Parenthood's services will find them. Those that want to walk on by, will do just that.

When that line of reasoning gets you nowhere, you'd try a different tact: operating a Planned Parenthood is completely legal. In fact, the person that's being disruptive is Aunt Louise and her friends; they're the ones that are putting a stumbling block in front of a perfectly valid business.

Aunt Louise, you'd gently say, you're being prejudice; as in you've pre-judged this business and the people that work there. Perhaps the doctors and staff at the Planned Parenthood are jerks, or worse. However, it's far more likely they're just like you and your friends, they're your neighbors after all. And besides, you might a learn a thing or two about hot button issues by talking to people who share a different view, rather than listening to the same voices. By being closed minded, you're hurting your community and passing on a chance to grow as a person.

When none of that worked, you'd pull out the ultimate card: America. Aunt Louise, you'd explain, we live in this remarkable country where individuals live side by side with those who dress, look, believe, speak, pray, eat, love, work and do just about everything else differently. As Americans we firmly hold our own beliefs, yet just as importantly, leave space for others to hold theirs. Every day we live the motto: E pluribus unum, Out of many, one. Every once in awhile our community gets tested: do we truly believe in allowing the many to thrive? It's tempting to go the easy route and reject what we're not comfortable with. But that's not America. American needs the many. If this establishment isn't breaking the law, then you need to let them be. Hold fast to your beliefs, and at the same time, fight to allow others to do the same. It's the American thing to do.

Do you think Aunt Louise is convinced? Probably not. But replace Planned Parenthood with Gun Store and you see, it's not such a crazy argument to suggest that a business, even one you're not comfortable with, should be aloud to set up shop in Arlington.

Do it for America.

Monday, February 29, 2016

Indian Head Rail Trail - 26 miles of prime bike riding terrain

Yesterday was the perfect weather for a bike ride, and the Indian Head Rail Trail was the perfect location to make it happen. Because the trail follows an old rail road bed, it's nearly devoid of hills, and it manages to run along some wonderful natural areas. It's also very well maintained, has plenty of benches and nature viewing sites and generally it was as smooth as could be.

It was a bit of a drive to get there, but getting in a change of scenery on a well maintained trail on a beautiful day was completely worth it.

Roller Skating: Good Times, Good Therapy

Our friends Lauren and Nick asked if we'd like to join them and their kids at Roller Skating Night at Thomas Jefferson Community Center. Apparently, this is an Arlington thing to do which we've never heard of, much less considered attending. We were in!

This wasn't my first time skating around a gymnasium to the popular tunes of the day. That honor goes to the after school skating parties we'd had in elementary school (Shira claims it was at Brookside Elementary School; I've got no way to confirm this). While the details are now hazy, I remember clearly that these skating parties were optimized for the coordinated and the popular; of which I was neither. I can clearly recall skating to Van Halen's Jump, with the more capable skaters taking flight at the lyric's command to jump. And then there was the couple's skate. Perhaps I worked up the courage to ask a girl to let me hold her hand as we did loops in the gym, probably not. Like I said, it was for the coordinated and popular.

Well, this last Saturday night I got to show my 8 year old self just how far I'd come. OK, when the DJ played the Cupid Shuffle, I had no dance moves to offer up. I gingerly skated around the gym with exactly the same lack of grace I had as an 8 year old. But in terms of holding the hand of a pretty girl, well, that part I'd absolutely nailed. One out of two, ain't bad.

If you're looking for some family fun, you should definitely check out the Roller Skating nights. If nothing else, it's cheaper than therapy.

Friday, February 26, 2016

The Friendly Skies

We just took off from a very cloudy Chicago, O'Hare airport and burst through the clouds to blue sky and a carpet of perfect puffy clouds. Onward to DC!




Thursday, February 25, 2016

Us

From a run earlier this morning along Coyote Creek Trail.

And a snapshot of the sun coming up at the same time.

Now that's the way to start the day!