Jay McGavren's Journal


I'm writing Head First Ruby!

One reason this blog hasn't seen an update in forever is that I've been writing a book! O'Reilly will be releasing Head First Ruby in mid-November.

Head First Ruby Cover

You can get access to the Early Release right now on O'Reilly's shop.

Or, you can pre-order from Amazon.

Enjoy, and please send feedback!


The danger of habits...

In the late 20th century, I received a thorough mocking for only putting one space after my periods. “Everyone puts two spaces after a sentence, don’t you know that?” I switched, and have been using two spaces for over a decade.

I have a very heavily-ingrained habit to undo:

Why You Should Never, Ever Use Two Spaces After a Period

I’m working on a book right now, and the publisher is going to expect single spaces after each and every sentence. Even if I take corrective action now, some are still going to slip in, and it’s going to be very time-consuming and error-prone to track them down.

Do your kids a favor, and ensure they’re being taught the single-space style.


Malware and your brain...

Consumer-level brain-computer interfaces (they exist!) are rather limited at this point, and therefore so is this hack. Still, this is troubling.

Object recognition brainwaves can reveal sensitive info about you

I, for one, am really eager to control my computer with my mind. But I had never thought about the possibility of malware that could read my thoughts…


Here’s the kind of code sample I have to throw away every day because it won’t fit in the available space…

scene = ['bullseye teacup prisoner',
         'ballerina waldo tablecloth',
         'zebra fencepost awning']

result = scene.find do |area|

puts result # => ballerina waldo tablecloth



Got our Chromecast a couple days ago, and it’s an awesome way to view Netflix and YouTube on your TV. Just pull out your phone, pick your program, and then it’s sent to the television. From there you can fast-forward, rewind, pause, and control the volume from your phone. You can queue up your program while someone else finishes theirs. If your TV has HDMI v1.4 (mine doesn’t), the Chromecast will even turn it on and switch to the correct input for you.

One caveat - my phone sometimes loses its LAN connection to the Chromecast, and I have to flip through various menus to get it to resume control. Time will tell how big a problem this is. But since the device was $35, I won’t be mad if it doesn’t work out perfectly.