banjoplayinnerd: (Default)
I wasn't going to buy anything on Friday. Honest I wasn't.

In case you haven't guessed, I'm one of those contrarian types who is opposed to shopping on Black Friday. It's as much an unwillingness to go out and drop a bunch of money on stuff I don't need as it is just not want to go out and fight my way through a bunch of crowds to do it. Throw in a huge dose of "I have no money for anything this year" and you've got a pretty good handle on my situation.

But then one of the mailing lists I subscribe to came out with a super tempting deal, offering a year's free top-tier membership to Treehouse (ordinarily $600) for $99. The catch was, they had 12 deals lined up on Black Friday, and each one was only good for 2 hours, so I had basically between 12:00 and 2:00 on Friday afternoon to take them up on it.

Perhaps I should explain what Treehouse is and why this was such a tempting deal. Their stock in trade is video instruction. They break down the subject – whether it's Javascript, CSS3, Ruby programming or starting your own business – into strings of short videos, anywhere from 3 to 15 minutes long, where they present a code sample that illustrates what they're teaching. There are about 120 "badges" you can earn in these subjects, and more coming down the road all the time.

As you probably know I have been trying to learn Ruby lately with an eye toward branching out into Ruby on Rails development. I had been going through instruction books and the few free resources I could find, and was learning a few things but not enough. So when this offer came along – a year's worth of drinking from the instructional firehose – I started agonizing over it. I still had the contrarian streak, still had no business spending any money, and it was still Black Friday, but this looked like such a useful way to learn, and $100 for a year's instruction is cheap.

At about 12:15 my wife came into the bedroom and we were talking, as we often do these days, about money. I told her about this deal and how I thought it would be useful, but I really had no business taking them up on it when we had so many other places for our limited means to go.

She thought about it for a second. "Well, I can think of one reason why you might want to do it," she said.

"What's that?"

"Every dollar you've spent on education in the last 20 years has come back to us many times over."

My wife is a very wise woman.

About ten minutes later I pulled out the credit card and signed up.

This was an extremely good move.

It's been a little over 150 hours since I signed up and I've completed all of the Ruby Foundations badges, everything from explaining what variables are (for the real beginners in the crowd) to writing tests for your programs as you go. Actually, writing the tests before the programs.

It doesn't hurt that Treehouse has a somewhat whimsical sense of humor. The "Hello and thanks for signing up" video involved a very steampunkish airship and a guy with an eyepatch setting out for Treehouse Island.

So what did I do today?

OK, I'm going to admit to doing something dumb. A while back I managed to wipe my desktop clean, as in "rm -rf Desktop/". (I mean, who hasn't, right?) There was a bunch of important stuff on that desktop, including my ham radio logbook spreadsheet and a folder with all of my electronic QSL (contact verification) cards. I found a random post out on the Internet from a guy who wrote a program to download all of your QSL cards from eQSL.cc, the website that handles the service. The problem is, he wrote this program in some kind of oddball Windows scripting solution that I'd never heard of.

So, I decided to write my own. I started looking for ways I could do this and came across the web documentation for Ruby's Mechanize gem, which allows you to write scripts to load web pages, fill out forms, keep track of cookies and the like.

After about seven hours I had a working program that not only downloaded the eQSLs, changing one variable would determine whether you downloaded all of your eQSLs or just the ones you hadn't retrieved yet, and gave them sane names as opposed to the indecipherable string of digits eQSL saves them as. This is probably less time than it would have taken to go in and download all 200-something of them by clicking on them one by one, and certainly less boring.

On the basis of this and some other scripts I've written I feel confident enough now to put Ruby on my resume. There are a lot of positions and recruiters looking for Ruby, sometimes as a standalone skill but more often as a way to work with Ruby-based tools like Rails, Chef and Puppet.

And that's what I've been doing for the past week.

And yes, I think this sort of thing is great fun. Beats sitting around moping while I look for work.
banjoplayinnerd: (Default)
I've been playing with my new computer to see what it can do. Short answer: a lot. Right now I'm running two virtual machines on it, one with Windows 7 and my favorite ham radio programs, one with XUbuntu 12.10 running some server software. That, and the native Linux apps I'm running on the main machine like chromium and thunderbird. I've even launched Portal in the wine Windows emulator a couple of times, and apart from my graphics card running hot, it runs very nicely.

The virtual Xubuntu machine is where I've been putting my efforts the last couple of days. In connection with learning Ruby and Rails I've decided I wanted to get a handle on nginx (Engine X), an alternative web server to Apache or IIS. I see it crop up more and more in job announcements, so I figured it would be worth a look. After a situation where I got two different versions of nginx running, I removed them both and started from scratch. That's when I discovered that the instructions for installing one of the components had carefully documented steps 1, 2, 3, 5 and 6, leaving out step 4 entirely. Google helped me figure that one out. Then I found that the configuration for a different component had changed in the last year, making one of the tasks I was trying to accomplish (getting a PHP information page to show) completely wrong and driving me nuts for two hours because I couldn't connect to a process that wasn't running the way they said it should be. Everything got sorted out sometime after midnight last night. Good thing I had that extra hour of sleep last night.

Today I installed a package called phpmyadmin that acts as a web interface to my database running on the virtual machine. That's one of the last pieces of the puzzle I needed before I could get Rails up and running. Oh sure, I could have done it on the command line, but the web interface is faster and makes it easier to see what's going on.

Next up, I need to decide on a project to work on to learn Rails. I have a couple in mind. Maybe I'll do them both, one after the other.
banjoplayinnerd: (Default)
A couple of posts ago I mentioned my brand new development box, workstation, computer, toy or whatever you want to call it. I've been tinkering with it since that post and it is still the bee's knees. As of right now it's running a browser (chromium), an email client (Thunderbird), an instance of Windows 7 running in a virtual machine (virtualbox) that's busy running some ham radio software and the Zune music software, an IRC client (xchat), and somewhere down there in the silicon maze are daemons for apache and mysql and other things that come to think of it don't take up a lot of resources. I even kicked up the CPU clock speed to turn it from a 3300MHz processor to a 4000MHz processor, and it's not even heating up significantly.

This is sort of like when I bought my banjo almost 10 years ago now. I wasn't absolutely sure at the time that I should be spending the money on a toy when there were other things I could have been doing with it, but I've never looked back, and look at the friends it's helped me make and the fun I've had doing it. The only regret is that I didn't do it many years ago, and I could have been having all that fun this much longer.

Similarly, when I'm out of work it seems a bit foolish to spend about $400 on a new computer. But I don't look at my computer as a toy. (Well, not entirely, OK?) I look at it as a tool. Computers are how I make my living, and like I said before, the old one was driving me around the bend because it was so underpowered. I can do things on this computer I can't even do on my laptop (a dual-core 1.8 GHz machine from when Windows Vista walked the earth), much less the old single-core 1.3 GHz machine. With any luck at all this machine will last me another 5-6 years, or until software starts outpacing the hardware again. But running today's software on XUbuntu 12.10, it is great.

One of the things that a blazingly fast computer doesn't help with is doing the actual programming. Someone once said that most of a computer's time is spent waiting for you to do something, usually type in a command or click a mouse. That's true as far as I can tell. The browser comes up fast and the mail is pretty quick, but if I'm writing a program it still takes me the same amount of time to type in the code or debug it. I get the results faster, but for the stuff I'm doing now, imperceptibly so. Then again there are the times I had to wait for the old computer to play catch-up in some other process before I could get back to work, so I'm glad I don't have to worry about that at the moment.




While I'm knocking around the house looking for work I have been working on improving my skill set. Part of that is learning new languages and new technologies. I was once labeled a "one-trick pony" by an interviewer; fortunately I got that job since the one trick I knew (Perl) was the one they wanted. I'm trying to shed that these days by learning some new skills, languages and technologies, or at least getting an idea of what they're about so if someone says they want a guy who knows something about Hadoop, Nagios, Nginx or Puppet I can discuss them semi-intelligently rather than saying "Nope, no idea" or, worse, something dumb.

To that end I've been working on learning Ruby. Ruby is sort of similar to where Perl was 15 years ago, a hot scripting language that's making its presence known as an engine for creating interactive web pages. It's a typical open source success story, similar to the one behind Linux itself. In 1993 a Japanese programmer named Yukihiro Matsumoto (known to one and all as "Matz") decided that the scripting languages available to him left something to be desired, so he set out to create his own that was "more powerful than Perl and more object-oriented than Python." I don't know if it out-muscles Perl, but it is certainly object oriented. Everything in Ruby is an object, including what would normally be simple primitives like integers.

Ruby was first released in Japan at the end of 1995 and interest was pretty much confined to Japan for about four years, when the first English-language Ruby mailing list started up. It gained a modest following, but really took off in 2003 when David Heinemeier Hansson was developing an application that would eventually become Basecamp. He was working on some web scaffolding for Basecamp, and realized that with a little work he could create a general purpose web application framework, which he released under the name Ruby on Rails. (Again, this is similar to the history of Perl, where Larry Wall realized that a one-off script to do some text parsing could be expanded into a general purpose Practical Extraction and Reporting Language.) In some ways Ruby on Rails is Ruby's killer app; it does a lot of the heavy lifting involved in creating an interactive web site, and it does it all in Ruby. "Ruby on Rails" is one of the most common desired skills I've been seeing while doing my job search.

Before I dive into Rails I want to do some general purpose scripting in Ruby to get a decent grounding in the language. To that end I've been rewriting some projects I've done in other languages in Ruby. For instance, I have an application I wrote that sends a bunch of tweets at regular intervals. It's written in Java, in part because I wanted to say I had written a Java program. It took me about three days to get everything written, tested, debugged and functioning, and even so it still isn't working 100% right (in part because I don't have my class path set to work properly from a cron job . . . but I digress).

Today I got out of bed at about 8:30 and decided I wanted to convert this script to Ruby. So my morning looked something like:

8:30 - get up, get showered and get dressed

9:00 - sign on to boris (my big bad dev box) and in a separate window load up sitka (the remote server the Java code is on)

9:05 - copy the list of tweet contents from sitka to boris. Close the connection to Sitka. Format the strings for use in Ruby (mostly removing the String identifiers in Java - Ruby uses flexible typing, similar to Perl)

9:30 - install the Twitter Ruby gem (package) and take a look at the documentation

9:45 - create a sample tweet with the Twitter gem and see it appear in my timeline

9:50 - Do a little more experimenting with the gem to see how tweet objects are formatted (for use later)

10:10 - Write the code for sending the tweet lists. Test it. Fix a few bugs and try it again

10:45 - Run a full simulation, not sending tweets but testing the timing

11:00 - Done. Off to answer my mail and contact some of my recruiters.

The Java original took me three days to complete. Now granted I already had the login information and the strings I want to tweet, but putting the Ruby version together took me less than two hours, and that was with breaks to look up code examples online.

My goal is to get somewhere near the expertise I have in Perl as fast as possible, preferably within a month or two. If today's experience is any indication, I may be able to reach that goal with time to spare.

Profile

banjoplayinnerd: (Default)
banjoplayinnerd

May 2014

S M T W T F S
    123
45678 910
111213141516 17
18192021222324
25262728293031

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 6th, 2025 10:55 pm
Powered by Dreamwidth Studios