Tuesday, September 02, 2014

What A Programmer Can Do

If you're over the age of 30 and I ask you for the square root of 17 over 10 you'd probably pull out a dusty Casio calculator and respond to me:


If you're 30 years of age or younger, you'd probably enter this into Google and get back the same answer. (Go to love Google!)

If you're a mathematician, you'd probably (a) be appalled at this post and (b) reply that the above is most certainly *not* the square root of 17 over 10. At best it's a crude approximation. Perhaps you'd suggest that it's best to keep the expression as a well known set of symbols:

Sure, you don't have a simple series of digits, but you also don't have the wrong answer.

If you're a programmer, you've got a unique third option. Joe Marshall explains:

Instead of representing a real number as a nearby rational number with an error introduced by rounding, we'll represent a real number as computer program that generates the digits. The number of digits generated is potentially infinite, but the program that generates them is definitely finite.

Once you've got this program (which Joe was kind enough to write for us) you can do:

(define the-answer (gosper-sqrt 0 17 10 0))

And the-answer contains the answer to our quandary. When you print out the answer, you need to provide the number of digits you want to see (trying to show the infinite number of digits may take a while). Here's the-answer to 100 places:


But, we could have just as easily asked it to 1,000 places or 1,000,000 places.

I find this Third Solution pretty dang amazing; and not just because it fills the gap nicely between a rough approximation and a purely symbolic one. More importantly, it shows the power that programmers wield. Instead of being limited to a static universe (a string of digits or series of symbols that represent a computation), the programmer think in terms of an active one (using an executable program to represent numbers).

This goes far beyond math. An image doesn't just need to be a collection of colored pixels, it can be a program that generates the colored pixels. Music doesn't need to be a series of notes, but could be a program that generates these series of notes.

There are many skills that a programmer must learn (for example, debugging a program or how to split a large problem into small problems) and often these skills can be mastered in any field (say, plumbing or cooking). But this re-imaging of the world--that may actually be unique to programming. So learn to program, so you can learn to re-see the universe.

Monday, September 01, 2014

Happy 1st Birthday, Gavriella!

With the US Open behind us, we were a mere 4 hour drive from home. Or, we could Overdo It, and try to squeeze in one more bit of action into our trip. Boston was the same 4 hours away as DC, and yesterday was Gavriella's 1st Birthday. How could we miss out on that occasion?

So we left NY at 6:45am and in 4 short hours, found ourselves in Boston.

We celebrated Gavriella's birthday with an epic trip to Chuck E. Cheese. It's been years since I've been inside the mouse's establishment. To be honest, they weren't great memories: dim lighting, fraying carpet, tired animatronics and an overall dingy feeling were what came to mind.

Well, this Chuck E. Cheese successfully rebooted my expectations. The place was clean, and generally well lit. They've still got the cheesy animatronics, but the kids were absolutely spell bound by them. I was sad to see the ball pit go, but it's been replaced by a fairly novel tunnel system that runs throughout the ceiling. I can't imagine what you do when your kid freaks out and refuses to crawl down. But the kids enjoyed it well enough. All in all, the kids really had a blast, and I enjoyed playing along with them. Still not my ideal form of entertainment, but for the kids, it was a huge treat.

In the evening, Uncle Ron setup a charcoal barbeque, and the kids and I got to watch as the chef went to work. We all got a first rate education in real Man Cooking.

The Birthday girl was in good spirits today. She was scootching around the house like a pro and between a trip to the park and Chucky's place, she soaked up all the sights and sounds with a real thirst. I'm so glad we could be here to celebrate!

Shira's had more than enough time behind the wheel. So, rather than drive back to DC, we hopped on a Jet Blue flight. Yeah, one hour and 15 minutes in the air beats Labor Day traffic jams any day.

View Photos

US Open 2014 - A Taste of the Action

21 hours. Some would say that's too much time spent watching tennis. My wife would not be among those naysayers. After two full days of watching US Open Tennis, I was cooked. Shira, on the other hand, was itching to come back for more. Alas, we couldn't stay another day, so I was spared and Shira will have to get her fix the old fashion way, by watching the matches on TV.

As much as I like to kvetch about all the time spent court side, even I can tell you it's a thrill to be at one of the world's premier tennis events. We saw amazing players: Venus, Serena, Monfils, Raonic, Federer, Isner and Shira's favorite, Djokovic. We saw some impressive matches, like Raonic vs. Estrella Burgos and Isner vs. Kohlschreiber. We even caught glimpses of Courier and McEnroe, as they did commentary a few rows up from us in the press box.

There were a number of apparent differences between the US Open and the French Open, which we were at last year. The NY venue is larger than the Paris one, and the food selection was much more varied and plentiful. At the French Open, having a ticket to the main stadium didn't give you access to the second tier Suzanne-Lenglen court. Not so at the US Open, with our Arthur Ashe seats we could basically get into any match we wanted to (perhaps not the best seats, but we could be there regardless).

On the other hand, the French crowd seemed much more respectful of the tennis tradition that you don't leave or enter the stadium while the players are on the court. But, this is the US, so I guess I shouldn't be surprised that people pretty much did whatever they wanted.

It was actually the ball kids who provided the perfect metaphor for the US vs. French variation in tone. In France, the ball kids move the balls around by discretely rolling them to each other along the edge of the court. It's actually quite a sight to see; it's a sort of human powered machine that follows a strict set of rules. In the US, the ball kids just hurl them to each other, having no qualms about chucking them diagonally across the court. I suppose that's just our cowboy heritage coming out.

Shira keeps calling this our 'Recon Mission,' which has me more than a little concerned. Next year, if I get off with 21 hours of tennis, I'll count myself very lucky!

View Photos

View Photos

Friday, August 29, 2014

Come for the lunch, stay for the tennis

Mmmmm... Kosher sausage with peppers and onions, delish! Oh look, there's a tennis match going on too, that's nice.

We're now 5 hours into watching tennis at the US Open. Lord help me.

Thursday, August 28, 2014

New York Problems

Like naive non-New Yorkers we assumed that a parking spot free of meters and no-parking signs meant we could legally park there. How silly. Of course we needed to check the fine print. And when we did so, we saw this sign:

So yeah, we can't park where we want to park because at 3am TV magic is going to be made on that street corner.

Who knew?

We don't have these problems in Arlington.

Still, it's fun to be in New York, right in the middle of the action!

A Glaxy S5 Case That Works

A week or so ago I broke the Galaxy S5 case Shira had bought me. After a few days of carrying the phone around naked (man, is it sexy!), I decided it was time to get a case. Like my Father, I'm a clip-to-the-belt kind of guy (why waste pocket space when you can leverage belt space?!), so that narrowed the field. Additionally, I liked having a built in kickstand for hacking with my Perixx keyboard.

One model I wanted avoid: the i-BLASON Transformer Case. Early on I had ordered this guy, and found that it was absolute junk. The kickstand wouldn't stay in place and the whole case had a flimsy feel to it. The seller, to his credit, refunded my money and didn't even require me to send back the defective case.

After some researching I decided I'd go with the Aduro Shell Holster. Yes, it made me nervous that it looked so much like the i-BLASON, but what can you do?

See, here's the two cases:



I'm delighted to report that the Aduro works great!

The part of the case that wraps around the phone provides easy access to the USB jack and a very usable kickstand. It doesn't add an especially large amount of bulk either. The belt clip side is solid, too. And it didn't cost an arm and a leg.

Ladies and gentlemen, we have a winner!

Thanks to Android Authority for the case recommendation.

Wednesday, August 27, 2014

1984. If this doesn't freak you out, nothing will.

This afternoon I finished listening to the audio version of 1984, the classic dystopian novel by George Orwell. I'm still in absolute awe of the book. How could a book be so dark and yet so readable at the same time?

[If you haven't read 1984, then I'd suggest skipping this post. Go borrow it from your library, and come back and see what I have to say. Then let's discuss.]

Where to start?

As I started listening to 1984 I wondered how it was going to compare to the vicious world of the Hunger Games. In short order I got my answer: Orwell makes Katniss and Peeta's world look like Disney Land compared to the warped universe of Winston and Julia, the main characters of 1984. There's just so much depth and detail to 1984. It's less the story of two lovers fighting against the machine, and more a How-To-Guide for creating the ultimate dystopia.

It's absolutely stunning that 1984 was written 66 years ago, in 1948. The terminology, technology and tactics hold up nearly perfectly today. The book could have just as easily been written as a commentary about the War On Terror, the NSA or any number of other popular topics. Everything from the uniforms described to the torture techniques seem completely modern. Heck, many of the concepts seem plausibly futuristic, an even more impressive feat to pull off.

Orwell truly was a genius when it came to architecting the methods used by The Party to maintain its power. From the 24 hour surveillance, to the Thought Police, to continuously rewriting the past, to the development of language that doesn't even allow for out-of-bounds thoughts, to the Big Brother figure head, and so on. Orwell doesn't just take the time to throw these concepts together, but meticulously develops them until you get the sense that they'd actually work. There's no hand waiving here.

Of all the Orwellian concepts I learned from the book, the notion of Continous Warfare seems to hit the closest to home. Sure, we've got the NSA snooping around, but they're playing neighborhood stick-ball compared to the Thought Police of 1984. But, consider this: when I describe a far off war that will never end, and that most of us will never participate in beyond cheering on the troops, I could be describing the war against Eurasia (or was it Eastasia) or the War on Terror. Sure, a complete 'Continuous War' as described in 1984 is far more reaching than this description, but still, the fact that these match up at all is cause for concern.

Finally, what the heck should I make of the book? I mean, what was the point? The most basic reading is that at every step 'The Party' has the upper hand. Even when Winston or Julia thinks they've outsmarted the system, they have in fact, failed. In the end, there's essentially no twist to the book. The characters know that by disobeying the party they'll be punished, and in the end, they are. Without really knowing what the heck I'm talking about, my take away from this is as follows: Orwell has constructed an absolute nightmare. In the end, the Party isn't defeated, and for all intents and purposes can't be defeated. But we, as readers, get to wake up. We're the ones who get to step back and say Wow, when the conditions are right, human kind can not only become entrapped; but entrapped for eternity.

All's lost not only for Winston and Julia, but for the entire human race. But we still have a chance.

And that's where Orwell's How-to-Guide comes into play for me: by giving us such a complete recipe for controlling the population, he's also given us the antidote. Study it. Learn it. Fight it.

Right Comrade?

Tuesday, August 26, 2014

7 Truly Novel Cell Phone Photography Tips

So much cell phone photography advice on the web is, well, blah. So I was impressed when I came across this video that suggested 7 clever cell phone photography tips I'd not used before.

A number of these techniques would actually be quite tricky to pull of using a fancy DSLR. That's actually a trend I've been seeing. HDR, panorama shots, capturing motion and getting macro or fish-eye shots, are all easier on my cell phone than my DSLR. Of course, the DSLR excels in places the cell phone can't compete. But that's the point: they're both useful tools in their own right. The days of the cell phone being just a fallback camera for those times when you have no other choice, are pretty much done.

Via: PictureCorrect.com

Spiral Notebook Self Defense

I was browsing through When Violence Erupts: A Survival Guide for Emergency Responders (I can't for the life of me, find the original mention of this book) and I came across this self defense technique:

While conducting drills at the Maryland State Police Glen Burnie Barracks, Trooper First Class (TFC) Raymond J. Beard taught a technique that successfully disrupted the chain of events in an intended shooting incident 12 out of 12 times (Maryland State Police In-Service Training School for Trooper First Class, 1983. Maryland State Police In-Service Training School for Officer Survival, 1987). A state police instructor sat in the driver': seat of a stopped vehicle. When asked for a driver's license, the instructor drew a weapon and squeezed the trigger in a simulation of shooting the approaching trooper. TFC Beard told the troopers participating in the exercise that if something came out of the vehicle at them, they were to take off their Stetson' with their left hand (driver-side approach) and throw it at the eyes of the person behind the wheel of the stopped vehicle. The intent of this action was to make the armed person blink or flinch. Throwing the hat was 100% effective—in each case the person with the weapon either misfired or misaimed. When something is coming at you, your initial instinct is to blink or flinch.

Consider what happens when you are driving during a heavy rain and a passing vehicle throws water on your cart windshield. Even though you know the water is not going to hit you, you still blink or flinch when the water strikes the windshield. This is the reaction you want to provoke in your assailant. Throwing your vitals pad at the person provides the same distraction as the water hitting the windshield or the troopers throwing their hats. It interrupts the chain of events long enough to permit you to get out of the line of fire and run to safety. Carry the pad In your left hand when you make a driver-side approach. When in position behind the Back Seat column, raise the pad to your left shoulder. If the vehicle occupant takes aggressive action during your initial interview, be prepared to throw the pad directly at the aggressor nose.

Use only a soft pad of paper for this technique. A hard object such as an aluminum report book or clip-board may cause needless injuries to the occupant of the vehicle. The soft pad will not cause undue harm. If the person is reaching for a lighter instead of a weapon and you react by throwing the vitals pad, you only have to apologize and explain. Exaggerate if necessary; say you just returned from a call where the patient took aggressive action toward you, and you thought it was going to happen again. After you throw the pad, do not wait for a reaction. As soon as it is out of your hand, turn to your right (toward the unit), get out of the possible line of fire, and run to safety. (p26-27)

Pretty clever, no?

The above technique talks about pretty specific conditions: approaching a vehicle and either being a police officer or an EMT, and triggering a distraction with either a hat or a vitals pad (which is effectively a spiral notebook). But, I'm thinking this approach could be generalized in any number of ways. It's certainly one worth having in the back of your mind, when you find yourself in an encounter your not 100% comfortable with.

Review: Meet Rebecca (American Girls Collection: Rebecca 1914)

After the Boston Kids were safely delivered to their parents, it was time to get our lives back in order. On the list of things to do was to return the books and videos we had rented from the library. Among them was an audio version of Meet Rebecca, an American Girl story. When I deposited the items on the librarians desk, she asked me how I liked the audio book? Actually, I explained, I loved it and started to explain why. After a moment, I realized that I had surprised her; she was expecting to razz me about the book, and here I was, heaping praise on it.

So what's so good about a book that one would think was nothing more than marketing material for a toy?

Rebecca is a Jewish child growing up in 1914, who's dealing with the life of as an immigrant. Like Kaya, the other American Girl story I've listened to, the book manages to get a number of important things right. First off, the story covers both Kid Problems as well as Real Problems. Rebecca is struggling with the fact that her older sisters get to do more than she does, and she's searching out her independence. At the same time, we here talk about the strain Russian Jews are under, the fears that young men will be conscripted into the army, and the real possibility that one of Rebecca's cousins will be too sick to survive the Russian winter. These are heavy topics. This blend of challenges give kids something they can relate to, yet introduce them to some important real world problems.

Another area the book gets right is the way they portray a turn of the century Jewish Family. Again, they hit on the very real topics of assimilation (changing names, working on Shabbat), but also make it clear that Rebecca's Judaism is more than just lip service. The description of Shabbat preparation and Rebecca's yearning to light the Sabbath candles is spot on. And the moment where Rebecca's father, a shoes salesman, deftly gives an immigrant a free pair of shoes--explaining to his daughter that this is a Mitvah--was one that actually invoked real pride for me.

I mainly listened to this book with Tzipora, who's 3, as we drove to and from camp every day. I think she was enjoying the narration more than anything else, and certainly wasn't taking in the big concepts. But I know she took in something. After listening for a few days, Shira caught her doing some "reading time" with a book. As she ran her finger across the words, she was talking out loud about Rebecca and her sisters being at dinner (which is where a climatic scene takes place). So, it definitely impacted her. (Tzipora and Rebecca both have older siblings who are twins - so it was the perfect story for her.)

Is this great literature? No, not really. But for a kid of the right age, this should be excellent reading. And sharing the book on CD, means that you can experience and discuss some of the tougher topics together. I'm skeptical about the whole commercial side of American Girl, something I know nothing about. But, I can tell you this book is a winner.


Related Posts with Thumbnails