Author Archives: Dan

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.

How to convert Access .mdb files to .csv or SQL using Mac OS X

MDBLite on the Mac App Store

A life-changing app for data enthusiasts.

Update Travis Swicegood, of the Texas Tribune, pointed out that mdbtools has a homebrew recipe (brew install mdbtools), which avoids this thorny problem. While waiting for the homebrew recipe to install, though, I found this mdb-sqlite project, which uses the Java library Jackcess, to allow command-line conversion…which is lacking in the solution I originally posted below. Still, it was the most productive $1.99 I’ve spent in a while.

MDBLite, $1.99 in the Mac App Store, allows you to convert Microsoft Access mdb files into SQL, CSV, or SQLite databases.

For the past few years, I’ve kept an old Windows XP laptop around just to open Access databases to convert them to Excel or CSV. I only found out about MDBLite after digging through some obscure discussion groups that mentioned in passing. The entire purpose of this blog post is to inform all other poor souls who use Macs but must still deal with government data. If that is the most important thing my blog provides for the Internet, I’d still be proud.

So far, it works as well as advertised. Which is pretty amazing if you’ve ever had to deal with Access conversions.

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.