April 2010 Archives

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.

Final term

  • Posted on April 28, 2010 at 7:23 pm

The course schedule is up for what will be my final term in grad school (Fall).  But, for the first time since starting school, there aren’t any that look especially interesting!  And there are very few that I am even eligible to take.  There are a total of ten 500-level classes, 5 of which I’ve already taken, and 1 of which I can’t take because I’m not a Ph.D. student.  That leaves me with 4 courses.  And I’m going to register for 3, so rather than picking which courses I want to take, I get to pick one course not to take.  It’s a good thing none of those 4 courses overlap, or my choices would be even more limited!

The good news is that, according to the CS department secretary, there are a couple of other classes that might be added.  At least one of them sounds very interesting and generally useful – Intro to Computer Security.  So I’m going to wait and cross my fingers that some other classes get added.  If they don’t, my final term may be a bit of a let down, unless the other classes surprise me.

Impressive energy

  • Posted on April 17, 2010 at 4:14 pm

C & I are taking care of C’s mom’s dog this weekend.  She’s very exuberant, but doesn’t regularly get a lot of exercise.  Yesterday we took her for a ~2.5 mile walk.  Today, I took her for a 9 mile run on the beach.  I was sure that by the end of that run, she would be exhausted.  I didn’t think she wouldn’t be able to run it, but I thought that she would be just trotting right next too me, to tired to try to go any faster.

The first 4.5 miles were easy – the wind was at our backs, pushing us along.  The 4.5 mile return, though, was ridiculous.  The wind was right in our faces, the rain was blowing so hard it stung my face, and it was all I could do to run 6 minutes at a time before stopping to walk and catch my breath.  I wasn’t entirely sure I was going to make it all the way back without calling C to come get us.

But Minnie was still going, pulling at the leash and wanting to chase seagulls the whole time.  I felt like she’d defeated me.  I’ve been running ~25 miles a week lately, and she gets barely any exercise.  But she beat me on a 9 mile run.

Between the two of us, we used up about 4 towels before we came back into the house.  Now I’m doing homework and feel like I could go for another run if I need to.  Minnie, however, appears to finally be tired.  Normally, when we come back from having been somewhere, she’s bouncing off the walls.  When we got back a few minutes ago from an errand, we had to actually call her to the door to come outside.  She and C are taking a nap now.

So there.  I beat you, dog.  I do hope you’re not really sore tomorrow, though.  I would be, if I were you.

Should I or shouldn’t I?

  • Posted on April 14, 2010 at 7:22 pm

After having such a great time at my first half-marathon, I’m thinking about doing the Portland Marathon in October – especially because this year, the race is on 10/10/10.  I’m not really sure if I should do it or not.

Pros

  • I made it injury-free through the half-marathon
  • I had a great time
  • The Portland Marathon will never again be held on 10/10/10 (in my lifetime), so if I’m going to do it, it should be this year!
  • I’d be able to train mostly in the summer, when I have more free time
  • I’m in better shape than ever, so I have a good base to train from right now

Cons

  • The main reason I want to run a marathon to say that I ran a marathon, which doesn’t feel like it should be the biggest reason.
  • It’s EXPENSIVE!  $135 to sign up.
  • I’d have to train over the weekends in the summer, which could inhibit vacationing/camping (or I might end up skipping runs that I shouldn’t.)
  • I’m so busy in general right now, I just don’t know if I have the time.  When I get to the end of training, the long runs could easily take me 4 hours!  This is the biggest con on the list.  I really would like to have some time to just, I don’ t know, watch TV or something.  And clean the house.  And stuff.  Marathon training would take a lot of that time away.

So I guess I’ll think about it.

I did it!

  • Posted on April 11, 2010 at 4:59 pm

I ran my first half-marathon this morning – Race for the Roses.  It went really, really well.  I’m still really excited about it.

The race started at 7:00, so I got up at 5:00 in order to be able to eat a decent-sized meal and still have it digested before the race.  C got up with me and drove us down to the convention center, and I started the race without incident.  The weather was great, and the course was very nice.  There were a couple of moderately difficult hills, but overall it was a very flat course compared to what I train on.  There were lots of water stations, and this was the first race where I actually used them.  I discovered I’m pretty much incapable of running and drinking out of a paper cup, so I stopped and walked while I drank the water.  Sara’s sister Desi was working one of the stations, and it happened to be her who handed me my water – that was neat!

C was waiting for me just before the finish, and took pictures and cheered me on, which gave me a boost for the final stretch.  My time was 2:14:44 – about 10:28 per mile, which I think is absolutely great.  It’s actually the same pace as I had for my very first 5K – but this time I held it for 13.1 miles, instead of 3.1!  And it’s faster than my pace for the 15K last month.  I still felt good after the finish line – I think I could have done another few miles if I had to (and if they weren’t very hilly).  After cooling down my legs were pretty sore – I hobbled a bit for about an hour after the race.  But now I’m feeling great again, and ready for my celebratory cheeseburger, fries and milkshake!  Yippee!

A cookbook

  • Posted on April 6, 2010 at 4:44 pm

Last summer I started leaning PHP and SQL (MySQL specifically) with my mom.  Then, for my databases class last fall, we had to create a database-driven website that does a certain number of database operations.  I took that project further, turning it into something that my family will hopefully use: a family cookbook.

My mom has always kept a Word document with our favorite family recipes, and she gave each of my siblings and my cousins printed copies.  The problem is, if she adds or edits something, we don’t see the edits, and we can’t add things to our own (since we just have paper copies).  Rather than ask her to send us each electronic copies, I decided to make a cookbook website for us.  Now if I find a brownie recipe that I really like, I can add it – and anyone else using the site can see it.  If she finds a type-o and fixes it, we all see the change.

Originally it was just intended for my family, but if any of you are interested in browsing or even adding your own recipes, feel free.  If you create an account, you can comment on recipes and make a list of favorites.  It’s a very basic site, not flashy or fancy, but it was all (with one exception) coded by hand, in order for me to really get a feel for PHP, CSS, etc., and I learned a lot while making it.  I’ve got a list about a mile long of features I would like to add (not to mention just generally making it look nice) but those changes will be rolled out slowly, if at all.

Anyway, just thought I’d share.