Surf Roots, Software Thoughts

A blog by Alex Loddengaard

Archive for March, 2008

Networks Project: Radical

My friend, Robert, and I finished our big networks project about 2 weeks ago, and I just wanted to share the project. We were given Nokia N800s and told to write a P2P file sharing application in C. Awesome.

Phase 1: The Basics
We follow the specified protocol and write a program that lets N800s request lists of files and also request files from their neighbors. Neighbors are discovered by UDP broadcast packets that are sent every few seconds. All other communication – file list and file requests – are done over TCP. I’m leaving a lot of detail out such as port selection and protocol details, but the project was relatively simple and fun – lots of buffer/network code.

Phase 2: Routing
We build off of phase 1 and implement a link state routing mechanism. We also use Dijkstra’s algorithm to compute the shortest path between all nodes. We build a ping and ping reply feature to test our routing. Link state packets and ping packets are sent via UDP. This part of the project was long, hard, and awesome - tons of fun data structure/algorithm code.

Phase 3: Enhancements to Phase 1
We build a file search and request mechanism so N800s can ask their neighbors for a particular file instead of first viewing a list and then downloading. Neighbors queue requests that they can’t fulfill and send these queued requests to their neighbors. Files are downloaded automatically when a request is fulfilled. I can’t remember what network transport layer is used, but I’m pretty sure file requests and downloads were both sent over TCP. Again, a really fun phase.

Conclusions
This project was awesome. Robert and I probably spent at least 100 hours each in the labs, and we enjoyed most of it. The biggest pains were cross-compiling and running on the N800s and odd GCC behavior. If you’re a UW CSE student and plan to take networks (CSE 461), then try and take it with Arvind Krishnamurthy. Robert and I both have a few complaints about the class, but the project was tons of fun. We ended up writing around 4,000 lines of C code from scratch, including a generic hash map, list, set, and many-to-many table. Great project. I wanted to post the source code, but then I realized that I probably shouldn’t ;).

2 comments

The Importance of 404

When I first launched Best Seattle Bars a few months back, I had worked only shortly on a pseudo PHP controller to support keyword-rich, pretty URLs. The controller also handled the case when a page wasn’t found. In this case, the controller would simply output a 404 message. I thought this was good enough.

About a week after our launch, I did a few Google queries to analyze our search engine performance. I noticed that the only pages indexed by Google were those of the previous version of the site, which was a terrifyingly bad set of informational pages generated by some sort of Yahoo page builder. I was curious why our performance was so poor, so I decided to take a look at Google Tools for Webmasters and ran their diagnostics report. Everything checked except for one thing – I was missing a 404 page. I first thought that Google was wrong – I had a 404 page! It displayed “404!” Then I quickly realized that Google isn’t going to recognize a 404 page by its contents but instead by its HTTP header information. I added the following line of PHP code to my 404 page, and my problems were solved.

<?php header("HTTP/1.0 404 Not Found"); ?>

Having a 404 page is essential for search engine performance, because it allows you to flush out the old pages and perform better with the new ones. Probably a day after I made this change, our search engine performance jumped and traffic was flowing. Usually you get a 404 page for free with Apache or any other web server, but my controller put the handling of 404 into my hands. Make sure you have a 404 page.

No comments

I Don’t Regret Coming to Seattle

Here I am, on a small, turbulent, propeller-driven plane, flying to Tahoe/Mammoth to snowmobile with my Dad and close family friend. I’m returning to the state that I’ve always called home – that I’ve always talked so highly of. It was Robert, a classmate and friend of mine, who motivated me to write this post. He and I were catching a quick sandwich before a long night in the CSE labs when he casually asked me, “So do you regret coming to Seattle?” His question struck me and made me realize something – that for the four years that I’ve spent in Seattle, I’ve always complained about it – complained about the weather, complained about the people, complained about the school. I realized now that most people probably think that I regret coming here, but that’s definitely not the case.

I’ve started getting the “holy shit I’m graduation” feelings; they started with my last long night in the labs. These feelings have gotten me to reflect on my time spent in Seattle, and I’ve realized that I’ve loved my college life. I wanted to write this post for those of you that I’ve grown close to and that I’ve spent time with. I will greatly miss Seattle when I leave.

My freshman year was spent in Lander dorm, where my soon-to-be best friend and I would ponder the strange drinking habits of many of the residents. The two of us were still attached to our high school friends and family, but we had a good time on Lander 2. Academically I strived for good grades in hopes of being admitted to the CSE department at the end of the year. Socially I met a lot of good people and had a lot of fun with those people.

I was ecstatic when I received my acceptance email to the CSE department at the start of my sophomore year, and I began classes that autumn. I fell in love with my major, and, as many of my friends will tell you, was consumed by it. I would spend long nights in the labs during the week and weekend, and I loved it. I would always have a half-delusional vision while leaving the labs early in the morning of me breathing little ones and zeros of fire. Jim’s delusion was slightly different, though. He saw us sitting on a large green hill with a wand, summoning bits of code in the sky to fit into place. I loved this year and learned so much. I was also exposed to one of the most beautiful areas I’ve ever visited – the Olympic Peninsula. Some friends and I took a backpacking trip to an isolated half-moon beach, where we woke up to warm temperatures, crashing waves just feet away, and blue skies. The experience was absolutely stunning.

Junior year wasn’t much different. In fact, it was even more consuming. I begin senior-level courses this year, which made the previous year look like kindergarten. I learned all sorts of things about databases, operating systems, compilers, and distributed computing – all nerd things that I’m still intrigued by. I also grew closer to many of my newly-discovered CSE friends, and my non-CSE friends narrowed only slightly. I had a blast my junior year, especially while living in the neat town of Fremont.

Senior year, this year, was/is similar, yet also very different than junior year. Having just come off a summer internship at Redfin (also in Seattle), I had a new appreciation for Seattle. I was finally exposed to the wonderful Seattle summers that everyone speaks so jubilantly about. Again, I’ve been consumed by my studies, but I’ve managed to get out a lot more on the weekends. I’ve managed to snowboard over 30 days so far, and I’ve grown even closer to my coworkers and friends. Being the president of the Husky Snowboard Team, I’ve gotten a chance to meet a lot of fun boarders.

To those of you that I won’t be seeing as often - friends, classmates, coworkers, mentors, instructors - I will miss you dearly. I know that this goodbye is premature, but I wanted to make sure that you knew that my time spent with you was/is unforgettable, regardless of how much complaining I have done. I’m going to spend my last three months in Seattle reflecting on the wonderful experiences that I’ve lived and on the exceptional friends that I’ve made. I plan to have as much fun as possible for the last three months of my Seattle life.

5 comments

Attn: Cyclists, Please Use Passing Etiquette

So I’m somewhat competitive, and I cycle to and from work everyday. My commute is roughly six miles each way, and I tend to enjoy it most of the time, at least when it’s not poring rain and freezing cold. However, lately I’ve been frustrated with a few cyclist commuters who don’t following what I like to call, “Passing Etiquette.” For sake of example, let’s assume that Biker A is the lead biker and Biker B is the biker following Biker A. The following cases outline when Bike B can and cannot pass Biker A:

Biker B can pass Biker A if:
-Biker B and Biker A are both on the open road

Biker B cannot pass Biker A if:
-Biker A is waiting at a stop light
-Biker A is kindly letting a car turn or pull out

All bikers who do not following the Passing Etiquette are subject to open road passes, tailgating, and general loss of glory.  (haha)

It probably sounds like I hate when people pass me while I’m waiting on something. It definitely frustrates me, but it’s all good. I just thought it’d be funny to be formal/serious about it.

1 comment

A Sad Evening; Goodbye Labs

It’s 11:45pm on a Friday night, and I’m in the CSE labs.  My partner and I just finished our huge networks project (that I’ll describe in a future post).  This made me realize … this is my last evening of grinding away in the CSE labs.  I’ve had a large amount of very late nights in these labs, and I’m going to miss my time spent in them.

2 comments

Looking for a Content Management System?

I just made a post on the Redfin Developers’ Blog talking about my 6-month-long effort to choose and implement Bricolage, an open-source content management system (CMS).  This is post one of two; the second post, written by Jason, discusses implementation specifics and will be published shortly.  Take a look at my post here if you’re interested.

No comments

Guest Lecture: Launching a Website

I gave a guest lecture to Marty’s Software Engineering class about launching a website this past Friday (3/7).  Topics include revenue models, marketing strategies (SEO in particular), technical details, and a brief Cellarspot case study.  The deck is a summary of many of the things that I’ve posted on this blog, but I thought I would link to it anyway.

No comments

War Stories: The Downside to Snowboarding for 24 Hours

Nearly 12 hours ago I documented the Husky Snowboard Team’s victory at Hope on the Slopes.  Read the post for the whole story, but in summary, 15 of us snowboarded for the majority of 24 hours and took home the title for the team with the most vertical.  We boarded a combined 1.5 million vertical feet.

Now what I didn’t mention was that I was slightly sick going into the competition; I just had a sore throat along with an occasional sniffle.  I fell asleep around 5:00pm yesterday, and here I am, at 3:30am, awake, feeling sick as a dog, and blogging.  I suppose I saw this coming.  Oh well :).

I have a feeling that a good reed is going to like this one.

1 comment

Snowboard Down Everest 51 Times in 24 Hours

The Husky Snowboard Team just got back from Hope on the Slopes, a fund raising event for the American Cancer Society and a race for the most vertical in 24 hours at Stevens Pass. We brought back the trophy for having the most combined team vertical. Fifteen of us went down Skyline and Hogsback enough times to total a whopping 1.5 million vertical feet in just 24 hours (I had around 110,000). That means that the combined vertical distance we traveled in 24 hours could have brought one person down Mt. Everest (at 29,000 feet) to sea level 51 times (that’s 284 vertical miles).

img_2110.jpg

How did we accomplish this feat, you ask? A combination of energy drinks, coffee, no sleep, and teamwork. Here’s the story:

First session: 9:30am - 12:30pm
All 15 of us start on Skyline. We want to try and have some fun during the day, so some of us hit the park and others just bombed down. We were all feeling good by 12:30pm. Aleah is making everyone a sandwich. Chris is firing up his water boiler for a first-class on-hill lunch.

img_2117.jpg

Second session: 1:15pm - 5:00pm
Same story as first session. Some people hit the park, and others just bomb. By this time we had a good idea of what our competition looked like, and it wasn’t looking good. The Swiss Ski Club had some nasty skiers that we could barely keep up with. It was going to be a long night/morning.

img_2164.jpg

Third session: 5:30pm - 10:30pm
Pretty much same story. We’re all feeling good. None of us are that tired, but we’re ready for the BBQ. We head in for the BBQ, and some of us prepare for the free wax/edge sharpen going on at 11:00pm.

img_2170.jpg

Fourth session: 11:30pm - 4:00am
First, keep in mind that 2:00am was totally skipped because of daylight savings. This is where things start to get tough. Eight of the 15 decide to nap, and the other seven start CHARGING. By this time we had the first round of statistics (all results up to 7:00pm), and it looked like we had the lead by a narrow margin. Skyline closes, so we’re forced to run Hogsback over and over again. In fact, we’re forced to head down the same run every time. No matter. Our bomb squad figures out the fastest route and does lap after lap, only turning to avoid other people. I’m not even kidding. For 2.5 hours these 7 dudes and dude-ettes did nothing but point and ride the chairlift up. The run was recently groomed, so the snow was hard and fast.

img_2183.jpg

Fifth session: 4:30am - 9:30am
We get word that as of 12:00am, we were in first place with 700,000 vertical, leading the second place team by a mere 9,000 vertical. It’s go time. Kelly starts pumping up the team, and all 15 of us ride the entire session. In fact, we don’t just ride it; WE KILL IT. All 15 of us are charging as hard as we can - barely any turning. By this time there wasn’t any room for conversation. We all went at our own pace, rode our own chairs (for the most part), and got in the zone. We would buckle in on the chairlift to avoid wasting time at the top, and we would only speak to say “hi!” to other HST people that we saw along the way or to give a “Yeeehaw!” if we saw someone from the chairlift. This was serious business; we had to win.

We ended up winning by a margin of 100,000 vertical, which isn’t all that much. We each accepted our metals and our $100 gift certificates and tried not to fall asleep on the drive home. We all had an insanely good time.

img_2188.jpg

Alright, it’s time for me to go to sleep. In summary, HST dominates Hope on the Slopes. Big thanks to Kelly for organizing everything, Paul for raising a GRIP of money, and Aleah, Chris, Alex, Kelsi, Michelle, Josh, Kyle, Kyle, Sena, Corry, Fareed, and Scott for SHREDDING LIKE IT’S NOBODY’S BUSINESS.

Good night.

3 comments

Freakonomics Likes Harry Potter!

To those of you that don’t like Harry Potter, read this postLevitt says:

I can’t articulate what is so great about these books, but rarely have I enjoyed reading anything more.

This is exactly how I feel.  I absolutely love the Harry Potter series, and I have a hard time articulating it myself.  Those books just make me so happy.  When I finished the seventh book 2 days after it was released, I couldn’t stop running around the house, prancing with glee and excitement.  I remember calling my brother, who also finished the book on Sunday, every hour to talk about the recent events that we each had read.

On man, I love Harry Potter.

No comments