geek

Learning in action!

  • Posted on April 29, 2010 at 5:47 pm

It’s always fun when you get to apply something you’re learning in a class to real life, right when you’re learning it.

I’m taking a Database Internals class, and we’ve spent a lot of time learning about indexes – what kinds there are, how each kind works, the pros and cons, etc.  This week we learned about implementing different query operators, different kinds of joins, etc.

Now, for those of you who don’t know, indexes help to make looking up certain information in a database faster.  I’ve never see the actual effect myself – all of the databases that I’ve worked with have been little toy databases of my own (with barely any data in them), or pre-established databases that already had the appropriate indexes.

Last night, C needed some help working with some data for his work.  He has an ENORMOUS spreadsheet that someone gave him, but he needed to make some changes to it.  It either couldn’t be done in Excel or would take a ridiculous amount of time, so he asked if I could do it with an SQL query.  I couldn’t actually think of a way to do it in a single query, but I did know a simple way to do it with a PHP script running a lot of SQL queries.  So we loaded the data up into a MySQL database I created for it* (and at first the file was actually too large to import into the database!) and I ran my script.  It took about a minute to run, maybe a little longer.  I tweaked it a bit to fix a couple of errors, and then it worked perfectly.

When finished, I decided, just for fun, to add an index to the table on one of the fields that was used a lot in the query.  Then I ran the script again, and it only took ~5 seconds!  This was really exciting for me – yes, I’m a nerd.  I really enjoyed getting to see the results of indexing in action, just like I’d learned about – and I especially love the fact that I know exactly how and why it worked!

Also, on a side note, computers are awesome.  What would take hours and hours of tedious manual labor took only a few seconds with a script and a properly-indexed database.  It still boggles my mind sometimes just how fast computers really are!

*Actually, getting the data exported from Excel and into the database was the hardest part, and took a lot longer than either of us expected – partially because the Excel file was so huge that it took several minutes every time we needed to do any operation on the data to get it ready for export.

Futurama

  • Posted on March 2, 2010 at 9:46 pm

For over three years, C and I have watched Futurama while going to sleep nearly every single night.  It started out kind of by chance – C liked to have the TV on when going to sleep, and Futurama was a show we both liked.  I’ve gotten an interesting view of the show since I take my contacts out before going to bed.  So I’m very familiar with the dialog and sounds of Futurama, but when I watch it with my contacts in I still am surprised sometimes.  “Wait, the professor is doing what in the background there???”

Well, after three years, I finally started to get tired of it.  So as of last night, we switched to the most famous Groening show – now we’re watching The Simpsons.

Websites are fun.

  • Posted on February 20, 2010 at 12:21 pm

I’m making a wedding website for my cousin, using Drupal.  One of the awesome things about making websites is that lay-people tend to be really impressed by how much you can do relatively quickly, especially if you’re making a static website.  Or if you’re using Drupal and there’s a module for everything you could possibly want to do (for a simple webpage, anyway) and all you have to do is download, activate and configure it.  It makes me feel like I’m really smart – much smarter than I actually am.

That’s what I enjoy most about CS – making things with tangible results that make life easier in some small way.  Of course, a mostly static Drupal website is a very very simple example of this, but I’m still enjoying it a lot. What I really need to do now is learn how to write some modules for open source software that I use.  I should write a Firefox add-on that I can actually use, or Notepad++, or Drupal, or whatever.  I’ll get right on that, in all of my spare time. :)  But for now, time to get back to homework!

Why I love the Internet

  • Posted on January 30, 2010 at 8:59 pm

Here’s one awesome reason I love the internet.  Last night I was planning out how to spend an Amazon gift card, and first on my list was to finish filling out the Old Man’s War series by John Scalzi.  (I own two, and want the other two.)  But Amazon doesn’t sell it directly, meaning I couldn’t use Amazon Prime to get free shipping on it.  So I tweeted about it – something to the effect of “How is it possible that Amazon doesn’t carry Scalzi’s Old Man’s War series?”  And less than 5 minutes later a response popped up from @scalzi himself, saying that it appeared to be a glitch, because the same thing is true for other books from his same publisher.  I didn’t even address my tweet directly to him, I was just throwing it out there for the world to see, so it was very unexpected and very cool to get a response directly from him!

And as it turns out, I was just one of the early discoverers of the Amazon and MacMillan price war.  I think that the moral of the story is that I should buy my books from Powells.  Also, the internet is awesome.