Category Archives: thoughts

Thoughts, musings, etc.

R.I.P. Sgt. Tyler Ziegel

Left: Sgt. Tyler Ziegel with his wife, Renee, in 2006. Photo by Nina Berman

Left: Sgt. Tyler Ziegel with his wife, Renee, in 2006. Photo by Nina Berman

A couple years ago, I randomly wrote a post because I was so affected by a photo exhibit at the Whitney Museum. The photos documented the life of Marine Tyler Ziegel, who suffered horrific burns during a suicide bomb attack in Iraq; the photographer, Nina Berman, was awarded the World Press Photo’s portraiture award in 2006 and Ziegel became one of the iconic images of the hell of war.

After writing that post, I might not have thought much more about Ziegel, who by all accounts lived a quiet life. But through some strange fluke with Google, that post ended up being one of the first search results for Ziegel’s name. The steady stream of visitors to it was a constant reminder of his sacrifice. He inspired such admiration and compassion that that random post is by far the most viewed page on this blog.

Sgt. Ziegel died last week on Dec. 26, 2012, after falling on ice. He was 30.

Berman’s image is unforgettable. But Ziegel’s story after the blast is also compelling. People Magazine did a profile of Ziegel shortly after his wedding in 2006:

For Ty and Renee the two years since have been a wrenching test of love and character. In a culture obsessed with physical perfection, Ty is now vulnerable to stares and whispers. Not naturally introspective and blunt to the point of gruffness, he says he doesn’t bother with what-ifs. Rather, he relies on a store of dark humor. “I’m thinking of writing a book, You Know You’ve Been Blown Up If…,” he says, in homage to redneck comic Jeff Foxworthy. “Like, ‘You know you’ve been blown up if a year later you bleed in the shower.'” One night, out to dinner with a Marine pal, Ty had a little fun with a man who was smoking. “My friend was like, ‘Hey buddy, do you mind? Do you see what happened to this smoker?'” Ty recalls. “The guy put his cigarette out and walked away.”

There’s also this 2007 interview with Berman in Salon (before Ziegel and his wife divorced):

Yes. I asked Ty, what do little kids say? Do little kids get scared? In my book, I’d photographed a really severely burned soldier. And when I was with him I’d see kids shy away and he would smile at them.

Ty would just laugh — he’s got a great sense of humor. Kids would say, “What happened to your ears?” and he’d say, “The bad guys took ‘em.” They’d say, “What happened to your nose?” and he’d say, “The bad guys took it.” I guess he tried to make some little game out of it to deal with it.

Rest in peace, Tyler. See the rest of Berman’s photos of Tyler’s life here.

Tyler Ziegel with his then fiancee, Renee.

First-year traffic stats for the Bastards Book of Ruby (and Photography): 140,000 unique visitors

The majority of this photo’s Flickr pageviews comes from the Meet Your Web Inspector chapter, probably from readers who click the photo to see what exactly the hell is going on. Here’s the story: One day, a queen bee decided to take residence on a Chinatown mailbox. Her hive decided to follow her, causing the city to block off the corner so the bee inspectors could pluck her out. My friend from China who was visiting NYC for the first time said to me later that this was the most exciting thing she saw in New York all week. Coincidentally, the web inspector chapter is probably the most useful part (for beginners) of my programming book.

Last year, I wanted programming to be more accessible. So I published a rough draft of what I called the “Bastards Book of Ruby” and then never added to it again. It’s interesting to see how much actual traction it got. Here’s a screenshot of the Google Analytics visitors overview:

Google Analytics Pageviews for bastardsbook.com

Caveat: Unfortunately, I never figured out how to get Google Analytics to do multiple subdomains, so this report includes the July traffic boost from the Bastards Book of Photography, which, day-to-day, is not as popular as the Ruby book.

In absolute terms, fewer than half a million pageviews in a year is not impressive for a free website (this 2 min. video I took of some guys playing Super Mario Brothers in the subway is already at 250K visits). But given that it’s a book about programming and that each single page consists of a “chapter” and is – in retrospect – way too long (the Ruby book is about 75,000 words altogether), I’ll pretend that they’re more “substantial” page views. At least a few visitors saved pages for offline viewing and really, after you’ve gone through the chapters you care about, there’s not much reason to return to the book since I never really updated it.

However, according to the % New Visits metric, there’s been a steady increase in percentage of new visitors:

New visits to bastardsbook.com

Google Analytics % of new visits to bastardsbook.com

Some traffic high points:

  • 12/5/2011 – Bastards Book of Ruby is released. It made it to Hacker News’s front page: 11,566 pageviews
  • 12/22/2011 – Once in awhile, either me or someone else would submit individual chapters to various sites. The chapter I had about scraping the Putnam County Sheriff’s Office got a few upvotes on HN: 6,528 pageviews
  • 5/16/2012 – The Ruby book makes it to the top of HN, possibly in response to Jeff Atwood’s “Please Don’t Learn to Code” published the day before: 38,359 pageviews
  • 6/21/2012The Bastards Book of Photography is published. It took me about two weeks to put together and I wanted to try out Octopress as a CMS to replace the hack Rails-to-static-file system I wrote for the Ruby book. It made the front of HN as well as Reddit’s photography and howto subreddits: 45,519

In the last few months, the average number of visitors per week ranges from 3,000 to 4,000 visitors.

Promotional work and referrals

The BBoR was aimed toward journalism professionals trying to learn coding but didn’t formally pitch it outside of Twitter, listing it on my online bios and mentioning it on the NICAR mailing list. Other hacker journalists were kind enough to give it a few shout-outs.

Most of the referrals overall came from technical audiences such as Hacker News and Reddit’s technical subreddits (again, the photo book numbers are mixed in here, which I think accounts for most of the social media traffic):

  1. news.ycombinator.com 38,817
  2. reddit.com 16,297
  3. t.co 7,062
  4. petapixel.com 6,372
  5. facebook.com 4,630
  6. danwin.com 3,704
  7. google.com 2,540
  8. citizen428.net 2,476
  9. news.ycombinator.org 1,348
  10. wired.com 1,015

The most-read topics

The most popular section of the Ruby book is the five-chapter-series I wrote on web scraping, which is of particular interest to journalists dealing with cruddy government websites that will never have an API. The Parsing HTML with Nokogiri is the most popular individual chapter.

In my own cookie-wiped Google Search, the book is the top result for “ruby web scraping”.

Here are the top 20 search terms that don’t include the word “bastard”. Apparently the Bastards Book doesn’t rank high at all for any photography search terms:

  1. alter positions in a list ruby
  2. ruby io safe io video stream
  3. parse image path with ruby
  4. putnam county jail log
  5. ruby mechanize
  6. nokogiri
  7. ruby web crawler
  8. `
  9. ruby if else
  10. web scraping ruby
  11. finding curly bracket special characters in excel
  12. ruby nokogiri
  13. ruby collections
  14. ruby parse html
  15. ruby web scraping
  16. text editor using wrong version of ruby
  17. nokogiri book
  18. ruby open html
  19. how to run a saved program in ruby
  20. ruby inline if
The respective covers of the books.

The respective covers of the books.

General interest in programming

Besides fixing typos and errors, I never did fulfill the promise of making major updates (to either of the books) this year and I’ve rarely mentioned the book after its first month – except in discussions about journalism and programming, which are pretty rare in general. To my surprise though, daily traffic has been generally steady. As I mentioned earlier, the two books receive about 3 to 4 thousand visitors weekly. When the Ruby book peaked on Hacker News in May, the average jumped from 1,500 visitors to 2,500 visitors. The current average has been the status quo since the photo book was released in July.

It would seem that the photo book accounts for the majority of the difference. But anecdotally, I get thank-you emails and tweets every week about the Ruby book and almost never hear feedback on the photo book. Sure, there are plenty of in-depth photography guides in comparison to programming books. But there’s far fewer aspiring programmers than photographers.

I hope to help change that and so have been working on a major update to the BBoR (including converting it to PDF form, probably the most requested feature). Earlier than later, hopefully, and as my off-work hours permit.

Sometime after March 2011 was when I started thinking about writing a programming book. This was after I had tried teaching the first learn-to-code class at General Assembly, an 8PM Thursday class called: “Coding for Beginners: Data Mashing with APIs”. Here’s the description I wrote up for the class:

Students will learn the fundamentals of programming by creating simple yet powerful scripts to collect and organize the data found in Web services such as Twitter, Google Maps, and Foursquare. The class will walk through sample Ruby code to understand the basic theory of programming, including variables, methods, arrays and loops. At the end, students will be able to write a fully-functional custom script to access and scrape website data.

This class is intended for absolute newbies and those beginning to learn how to code. Laptops are optional. Code for the lesson will be provided so that students can follow along during class and after. Prerequisites: None.

(Before you spit out your coffee, I do reflect below about how hilariously absurd this synopsis is, in retrospect)

Jenny 8. Lee at Hacks/Hackers) introduced me to GA but I remember the GA coordinator and I both thinking, “Who the hell actually wants to learn basic programming?” I don’t know what the average price for a GA class was then. But I know when we set the price at $30 for a 2-3 hour class, I thought it was too high and we’d end up with a pretty bare turnout.

And I was wrong: it was the fastest-selling class in GA’s then-young history and sold out in a day. And thankfully, the interest doesn’t seem to be a fluke: GA today regularly holds beginners’ programming classes, ranging from price of $175 for an afternoon to $3,000 for an eight-week Rails course (including Ruby fundamentals).

My own class didn’t go terribly well because, as I’ve found out since then, it’s kind of difficult to cover in 3 hours the programming fundamentals (variables/methods/if statements/for-loops in order to create a mashup from Twitter and Foursquare APIs) that it takes real teachers a semester to cover, especially to an audience mostly unfamiliar with the command line.

So the Ruby book was an attempt to create a resource that might actually be helpful for aspiring coders. Less than half a million pageviews might not much. But it’s been gratifying to see the Ruby book continue to be used even in its messy draft form by beginners who are incredibly committed to learning new things in life. I hope the next revision of the Ruby book will be even more useful to them.

Other resources: Who knows when I’ll actually finish. In the meantime, a lot of great programming resources have come out this past year, too many to list so I’ll just point out the Ruby ones. Free resources include Zed Shaw’s Ruby version of his Learn to Code the Hard Way and Codecademy’s Ruby track. Sau Sheong Chang’s Exploring Everyday Things with R and Ruby is one of my favorite books I’ve bought this year and it follows a philosophy similar to mine: use code to do creative, real-world problem solving.

Google’s Voice Search completely shames Siri. Big Data wins again

Google vs siri

Google’s voice search (on iOS) on the left; Siri on the right

After the hype of Siri, Google’s claim that “its most advanced voice search has arrived on iOS” seems kind of a yawner.

However, my first experiences with Siri were so lackluster that I hadn’t used it since the iPhone 4S debut except to goof around (“Is there a God?“). My first question through Google’s voice search though was so amazingly fast and accurate that I see myself actually using it day-to-day.

I asked both Google and Siri, “How much damage did Hurricane Sandy do?”

Google heard it as “How much damage did Hurricane Sandy too?” and returned with official Hurricane Sandy emergency info and latest news stories literally as I stopped talking.

Siri took nearly five seconds to register my question as “How much damage did hurricane you do” and responded with hockey league standings for the Hurricanes team.

I don’t think it’s an exaggeration to say that Google voice search is to Siri as Google Maps is to Apple Maps. And while some might argue that Apple’s data-weak, inaccurate maps are still more stylish, the Google search app is executed far more beautifully than Siri. That, plus the immense voice data that Google has been collecting, plus…well, Google’s search expertise…makes it hard to see how Apple can even compete here.

Check out the announcement on Google’s blog.

Steve Wozniak’s Twitter bio

Steve Woz

Woz

I just glanced over Woz’s twitter profile because I wanted to tweet this Bloomberg article about him. What he notes in his 160-character-limited bio is notable for what it doesn’t contain.

Here it is in list form:

  1. Engineers first!
  2. Human rights.
  3. Gadgets.
  4. Jokes and pranks.
  5. Segways.
  6. Music and concerts.
  7. Gameboy Tetris*.

He recently did a Q&A over at Slashdot and someone asked him “Do you feel like you were dealt the short end of the stick where Apple is concerned?

Woz’s response:

Our union was very lucky. I think it was luckier for Jobs since I had strong internal philosophies that didn’t connect my happiness with business success or money or power. I built projects for myself and the Apple ][ was the 6th of those that Jobs saw (when he got into town) and said we could sell them. We always split the money evenly as far as I knew but money is not my thing in life. My best days were in the lab building things for myself. But I’m so nice that I give almost all my time now to young people and fans that I can help. I love my life the way it is and told that to Jobs in one of our last phone calls before his death.

A class act, through and through.

* Woz’s love of Tetris is one of my favorite side-stories about him. He was so prolific that his name was banned in the Nintendo Power listings for being listed too frequently. Here’s how he hacked around that.

Woz and Religion

As interesting as Issacson’s biography of Steve Jobs is, I liked the parts that featured Steve Wozniak the best. So I picked up Woz’s memoir – iWoz: Computer Geek to Cult Icon: How I Invented the Personal Computer, Co-Founded Apple, and Had Fun Doing It – and read it at the same I read Jobs’s biography. As expected, Woz’s perspective contains much more detail about the technical underpinnings behind Apple’s early success, partly to clear up any misconception that Jobs invented everything himself.

The detailed technical narratives by Woz are worth the price alone. But his non-technical reflections could also fill a book.

Here’s his take on religion:

So this was a hard social time for me. I remember that at one point I was taking some night classes at San Jose State and this pretty girl comes up to my table in the cafeteria and says, “Oh, hi.” She just starts talking to me, and I’m so nervous all I can think to ask her is what her major is. She says, “Scientology.”

I’d never heard of this, but she assured me it was actually a major and I believed it. She invited me to a Scientology meeting, and of course I went. I ended up in the audience watching this guy make this incredible presentation about how you can basically be in better control of yourself and that you could get really happy from that.

After the meeting, the girl I met sat with me in some little office for an hour, trying to sell me these courses to become a better person. I was going to have to pay money for them. I said to her, “I’ve already got my happiness. I’ve got my keys to happiness. I don’t need anything. I’m not looking for any of this stuff.” And I meant it. The only thing I might’ve wanted was a girlfriend, that’s for sure, but the rest of the stuff I already had.

I had a sense of humor, and I had this attitude about life that let me choose to be happy. I knew that whether to be happy was always going to be my choice, and only my choice.

Wozniak, Steve (2007-10-17). iWoz: Computer Geek to Cult Icon (pp. 83-84). Norton. Kindle Edition.

Even if Woz played a bigger role in the Apple’s post-Macintosh era, you could forgive Jobs’s biographers for not devoting much more space to him: there’s just not much mystery or drama behind what Woz does. He’s just as astounding a mensch as he is an engineer. As predictable as that is, I still find myself going back and re-skimming his memoir for enjoyment and enlightenment.

Reddit’s Q&A with a former death row prison guard

An unnamed former prison guard at Georgia Diagnostic and Classification Prison did a fascinating Q&A with Reddit users today. Among the questions he answers: the worst offender he watched over, how much animosity inmates had towards guards, and how much paranormal activity he witnessed.

What was your favorite/least favorite part about your job?

I like talking to people. Talking to prisoners and learning about their life was fascinating to me. Most of them just wanted someone to talk to listen to them anyway. Least favorite was being stuck back there with them. When those gates closed behind you it was a horrible feeling because you knew if shit went down, you wasn’t getting out.

WYSIAYG: What you see is *all* you get

Yesterday I bought a copy of The Pragmatic Programmer: From Journeyman to Master, by Andrew Hunt and David Thomas, because it was on sale for $2.99 (it’s since gone back up to its original price). It’s an eloquent read, not focused on technical details but on philosophy.

This snippet of wisdom early on in the book was something that I have tried to express to non-programmers but have failed to do so concisely:

if you do all your work using GUIs, you are missing out on the full capabilities of your environment. You won’t be able to automate common tasks, or use the full power of the tools available to you. And you won’t be able to combine your tools to create customized macro tools.

A benefit of GUIs is WYSIWYG—what you see is what you get. The disadvantage is WYSIAYG—what you see is all you get.

GUI environments are normally limited to the capabilities that their designers intended. If you need to go beyond the model the designer provided, you are usually out of luck—and more often than not, you do need to go beyond the model.

Pragmatic Programmers don’t just cut code, or develop object models, or write documentation, or automate the build process—we do all of these things.

Hunt, Andrew; Thomas, David (1999-10-20). The Pragmatic Programmer: From Journeyman to Master. Pearson Education (USA). Kindle Edition.

Small habit-forming advice, via “The Power of Habit” by Charles Duhigg

I’ve just started digging into Charles Duhigg’s “The Power of Habit,” which, besides being fascinating reading, has gotten me back into the habit of actually reading again.

Over the past year I’ve gone through some great books about the mind, including Daniel Kahneman’s “Thinking, Fast and Slow” and Robert Sapolsky’s Why Zebras Don’t Get Ulcers. “Power of Habit” isn’t as technically cerebral as those, but it contains a surprising amount of interesting, usable advice, and has caused me to rethink how I set goals in the future.

One tip from Duhigg’s book that I read this morning: taking the time to write out goals, including mundane details as necessary, is much more helpful than just having goals.

In fact, the mundane details may be the difference in success. Duhigg describes this finding from a 1992 British study involving lower-class elderly patients – averaging 68-years-old – who were recovering from recent hip or knee replacement surgery. A psychologist was examining ways to increase the patients’ willpower to keep up with the arduous rehabilitation process:

The Scottish study’s participants were the types of people most likely to fail at rehabilitation. The scientist conducting the experiment wanted to see if it was possible to help them harness their willpower. She gave each patient a booklet after their surgeries that detailed their rehab schedule, and in the back were thirteen additional pages—one for each week—with blank spaces and instructions: “My goals for this week are __________ ? Write down exactly what you are going to do. For example, if you are going to go for a walk this week, write down where and when you are going to walk.”

She asked patients to fill in each of those pages with specific plans. Then she compared the recoveries of those who wrote out goals with those of patients who had received the same booklets, but didn’t write anything.

It seems absurd to think that giving people a few pieces of blank paper might make a difference in how quickly they recover from surgery.

But when the researcher visited the patients three months later, she found a striking difference between the two groups. The patients who had written plans in their booklets had started walking almost twice as fast as the ones who had not

They were putting on their shoes, doing the laundry, and making themselves meals quicker than the patients who hadn’t scribbled out goals ahead of time. The psychologist wanted to understand why. She examined the booklets, and discovered that most of the blank pages had been filled in with specific, detailed plans about the most mundane aspects of recovery.

One patient, for example, had written, “I will walk to the bus stop tomorrow to meet my wife from work,” and then noted what time he would leave, the route he would walk, what he would wear, which coat he would bring if it was raining, and what pills he would take if the pain became too much. Another patient, in a similar study, wrote a series of very specific schedules regarding the exercises he would do each time he went to the bathroom. A third wrote a minute-by-minute itinerary for walking around the block.

As the psychologist scrutinized the booklets, she saw that many of the plans had something in common: They focused on how patients would handle a specific moment of anticipated pain. The man who exercised on the way to the bathroom, for instance, knew that each time he stood up from the couch, the ache was excruciating. So he wrote out a plan for dealing with it: Automatically take the first step, right away, so he wouldn’t be tempted to sit down again…

Put another way, the patients’ plans were built around inflection points when they knew their pain—and thus the temptation to quit—would be strongest.

The patients were telling themselves how they were going to make it over the hump.

from Charles Duhigg, The Power of Habit: Why We Do What We Do in Life and Business (p. 144). Random House, Inc.. Kindle Edition.

I have goals, and I have sub-goals for those goals. But I write them quickly in my todo list, like, “Write Bastards book of Python”…which should probably come after “Learn Python.”

I’m going to try to start sketching out details now. Being more disciplined about having small sub-goals on the way to the big ones is obvious. But I don’t write enough about anticipated failures. Not sure in terms of individualized learning how to go about this…as the “inflection points” are generally: I’m too tired to learn/write.

But to start small, maybe: Get a latte. Write a section of a chapter. When my mind wanders, add sugar to latte, take another sip.

(And then it’ll be time to start having a real exercise routine. Luckily, Duhigg’s book has a few insights on that as well)

Buying books from St. Marks Bookshop

MetaMaus and The Works, two recent purchases from St. Marks Place Books

I recently dropped about $60 at the St. Marks Bookshop for two new books, “The Works: Anatomy of a City” by Kate Ascher and “MetaMaus” by Art Spiegelman.

Neither have Kindle versions, which is where I’ve been getting virtually all my books these days. But “The Works” and “MetaMaus” are both visual works; respectively: an illustrated explanation of the city’s underworkings and a comic-panel/mixed-media reflection of the classic Maus Holocaust graphic novel. I still buy paper books when it comes to art and photography and layout.

But I could still save a lot of money by ordering through Amazon…almost 40%. There’s no shipping costs and since I almost never get to reading books immediately after buying them, the waiting period would be tolerable. But I usually feel an obligation to compensate a brick-and-mortar store for introducing me to new books…kind of a finder’s fee, I guess. As much as I love the digital age and cheaper prices, real-life places like bookstores are one of the few opportunities I have to be exposed to things I wouldn’t normally see in my targeted searches (which these days, almost consist entirely for books about programming or medicine) or through my social network.

The St. Marks bookstore has currently been in the news for trying to crowdfund its move to a smaller location. I have no idea how bookstores can be saved these days given the much cheaper prices on Amazon — relying on spendy purchasers like me won’t pay Manhattan rents. But I do know bookstores still provide a lot of value with their physical footprints.