Archive for August, 2008

DevLink 2008

August 26, 2008

I had the opportunity to attend the 3rd annual DevLink conference this past week.  Thanks to John Kellar for squeezing me in!  All-in-all, it was a good experience.

The conference started out pretty weak for me.  The keynote speaker sounded like he was reading straight out of a white paper from several years ago about outsourcing.  Not very engaging or relevant.  I figured “Hey, the sessions can’t all be this irrelevant.”

The first breakout session I walked into was focused on testing, as I walked in I heard the speaker say he was a stastician, not a tester, and “was just filling a seat.”  That was my cue to look for something else.  So I headed over the requirements gathering session, thinking I’d hear a about a new methodology or tip.  After about 10 minutes of requirements gathering 101, I bounced.  It’s likely the first day was slated for 101 type classes, but I was looking for something more.

Most of the other tracks were focused on Microsoft development products, specifically newer ones, and probably more much more relevant.  Since, we’re not a MS development shop (primarly CF, Flex and Java), I wasn’t really interested in learning about Silverlight or WCF.

I was about to head back to the office when I remembered John Kellar talking about the “Open Groups” they started up this year.  The concept is great… pull a bunch of intelligent developers into a room and ask them what they want to talk about – what issues they’re currently facing, what technologies they are looking into, and the list goes on.

In the initial session, everyone tossed out ideas for topics, wrote them on huge sticky notes and created a schedule of open groups for the conference.  The Open Groups I attended were great – engaging discussion about current, relevant topics we’re all working through.

The Open Groups at this conference saved it for me.  I’d like to see more events geared like this.  Hats off to the organizers who put this together!

Working without worry.

August 26, 2008

Well, sitting here working today, I have been challenged with many things running through my mind just like everyone does. Sometimes, it not always business… shhh don’t tell my boss, not like I would be fired, but you really can’t control human nature. We all think about non-work things while we are working. Sometimes these things vary from what’s for dinner, to what character to play on WOW tonight or what game to play with the kiddos. For some people it gets worse, how much am I going to pay the credit card company, how am I going to pay the electric bill or worse, THE RENT!

While I was thinking about the dinner part, I was happy to remember, I BUDGET! Since I came to work here three years ago I started budgeting every single month. I never did that before. Before, I was worrying about some of those other things, never about the rent but sometimes about the credit card. Now that I do a budget, I have the peace of mind that I never worry about money. Not just because of the incredible salary we get working here, but because I plan this every month, like clockwork. It was super hard the first five months, then after a year, it was easier, but I was still tweaking it every other month. Trying to figure out if my spreadsheet, a yellow pad, or the budgeting software on MyTotalMoneyMakeover.com works better for me.

Well now that I have that figured out, getting married really was easy on the ole’ budget. I even budgeted my wedding too! We took a rough cut at what we needed and perfected it as we grew. Budgeting the wedding is one way to make sure your soon-to-be spouse is on board with you financially. When she can’t have that extra thing, or you can’t have the cool new underwater camera because it won’t fit in the budget, well… you do what is most important. When it was time to bring the money together, that was easy too! Just reflecting today on how nice it is to not have to worry about money ever any time – that is a victory in and of itself.

DO YOU BUDGET?

Java Topology Suite — Sweet!

August 26, 2008

We have been building a sophisticated mapping application in Adobe Flex that enables our internal advisors for Endorsed Local Providers (ELPs) to visualize the regions that our partners cover throughout the country. We’re using MapQuest’s Enterprise API, which has a pretty robust ActionScript 3 library along with a nice Java library.

We wanted to be able to display many zip code polygons on the map, and enable our advisors to click on a zip code and see the ELPs who cover that zip code, among other things. However, early in development, we found that the performance of the application suffered greatly when displaying a large number of zip code polygons.

With focused intensity, we took several steps to improve the performance of the map. These steps include:

  • Reduce the complexity of the zip code polygons.
  • Combine zip codes with multiple polygons into a single polygon.
  • Cache the resulting polygon definitions in our local database, as gzipped XML.

After several failed attempts to accomplish these tasks, we found the Java Topology Suite (JTS), an open source collection of geospacial data manipulation tools created by Vivid Solutions of Victoria, Canada. While capable of many other things, we used JTS to unify multiple polygons into a single polygon, and to reduce their complexity.

Here’s our process to unify and simplify polygons from MapQuest’s API through JTS:

  1. Extract the polygons from a MapQuest FeatureCollection to Well-Known Text (WKT) format.
  2. Create a JTS Geometry object for each polygon.
  3. Use JTS to create a GeometryCollection, then union the polygons with the Geometry.buffer() function.
  4. Simply the resulting polygon with JTS’s TopologyPreservingSimplifier.simplify() function.

Here is the most important portion of the code that does all of the above:

/**
 * Unifies and simplifies a MapQuest FeatureCollection using JTS.
 */
public synchronized FeatureCollection unifyFeatureCollection(
    FeatureCollection origFc, double simplifyTolerance) throws Exception
{
    // Extract polygons from FeatureCollection and convert to Well-Known Text
    ArrayList polygonsAsWTK = featureCollectionToWTK(origFc);

    // Create JTS Geometries
    WKTReader rdr = new WKTReader();
    Geometry[] geom = new Geometry[polygonsAsWTK.size()];
    for (int i = 0; i  0) {
        unifiedPolygon = TopologyPreservingSimplifier.simplify(
                                    unifiedPolygon, simplifyTolerance);
    }
    // Convert result back to FeatureCollection and return
    return jtsGeometryToFeatureCollection(origFc, unifiedPolygon);
}

/**
 * Called by unifyFeatureCollection(), returns
 * the union of the input Geometry array as a single
 * JTS Geometry.
 */
private Geometry unifyPolygonArray(Geometry[] geom)
{
    GeometryFactory fact = geom[0].getFactory();
    Geometry geomColl = fact.createGeometryCollection(geom);
    Geometry union = geomColl.buffer(0.0);
    return union;
}

/**
 * Changes a JTS Geometry into a MapQuest FeatureCollection
 */
private FeatureCollection jtsGeometryToFeatureCollection(
    FeatureCollection origFc, Geometry unifiedPolygon)
{
    FeatureCollection newFc  = new FeatureCollection();
    List polygons  = PolygonExtracter.getPolygons(unifiedPolygon);
    for (Geometry currPolygon : polygons)
    {
        // Parse: POLYGON ((-123.862898 46, -123.863671 46.000707, ....)
        String polygonAsWKT = currPolygon.toText();
        String [] wktPoints = polygonAsWKT.substring(
                                (polygonAsWKT.indexOf("((")+2),
                                 polygonAsWKT.indexOf(")")).split(", ");
        ArrayList newLatLngList = wktPointsToLatLngList(wktPoints);
        PolygonFeature newPf = makePolygonFeatureFromPoints(origFc, newLatLngList);
        newFc.add(newPf);
    }
    return newFc;
}

The result: it works really well. There is still room for performance improvement, but the gains we observed were extremely significant

If you’re working with mapping applications, we’d love to hear from you.  Leave us a comment and tell us about it.

Subversion Branch Management

August 26, 2008

If you’re just starting out with SVN, chances are you use the “just-throw-everything-on-trunk” method which will eventually lead to some, “Who broke staging again!?!?!” moments. I was introduced to the world of SVN branching via a large code rewrite effecting… pretty much our entire codebase.

Through that experience, I realized the benefits (and the hardships) of maintaining your own branch of Trunk. One of the things I love about our culture here is that we “kill the sacred cow” meaning we don’t do things just “because we’ve always done it that way.” With that in mind, we decided to have each developer setup their own project branch instead of just committing to Trunk. The benefits have been huge. We now have a Trunk the entire team can rely on. When rolling out new code, that confidence goes a long way and avoids quite a few rabbit holes trying to determine if your code changes are the problem or if someone else is half-way through a project and their code is the culprit.

After learning things the hard way, I’ve come to really appreciate Chapter 4 of the book Version Control with Subversion. If you’re not using branches and you have more than a couple people on your team, you should be using branches. If you are using branches, this chapter is a must read. It will take about an hour or so to get through, but it will save you a lot of trouble down the road.

Unless you’re using SVN version 1.5, I recommend using a wiki page or excel file to keep track of your revision numbers. This can be really helpful as you start rolling code out to your development servers, merging with release and updating your live servers. Knowing what you’ve merged and what’s been updated on which server really saves time, especially during ongoing development while rolling out bug fixes to existing versions. Below are a couple examples using Confluence and Excel:

Take it from someone who has been there, done that, got the t-shirt… branch management can be great if you do it correctly and keep track of your revision numbers during the process.

This isn’t a perfect process, but it’s the best one we’ve come up with.  If you’ve found a better way, leave a comment and start the conversation.

Little Changes and HUGE Effects

August 19, 2008

iTunes operates similar to a Digg type website. In this case, people vote by subscribing to a podcast inside iTunes. The more people click on your podcast, the higher the ranking goes. The top spot on the podcast ranking can be valuable real estate to hold, but how does one become (and stay) king of the mountain?

Of course, it really helps if you have a popular website that can drive people to your podcast. Then you can use a link like the one below (every podcast has their own unique url) to send people to the iTunes Store.

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=77001367
iTunes Podcast Subscription

The iTunes Podcast Subscription Page (Red Circle Added)

The above link brings up iTunes and preloads it to a screen like this one. Where iTunes ratings are concerned, it’s all about clicking that last button.

It’s also entirely time-based. You can have 3 Million podcasters sign up over the course of a year. Assume that all of them are avid listeners who hear the show every day. That would be 10,000 people/day. However, say a TV show ends and posts a snippet on iTunes, and they get 150,000 people to download the snippet over 3 days. Even though the theoretical TV show only has 5% of your theoretical audience, they would have 40,000 more subscribers per day and presumably take the #1 slot for 3-4 days.

It’s an interesting animal. A while back, we added images to our podcast feed, and almost immediately we jumped to #1 in the business category, and for the first time we broke the top 100 overall. Late last year, we started to combine 2 feeds, and jumped from an average ranking around 80 to an average ranking around 40 – and we have more changes coming. (I’ll detail what we’ve done in a future post.)

When you start working with groups of people in the millions, small changes can make a HUGE difference. We’ve seen it here many times in various forms, but to me it’s like a jet leaving the runway – it still amazes me every time.

Foam Ball Friday

August 14, 2008

Imagine this… The end of the workday is almost here. It’s Friday. You’ve had a lot of fun this week working on cutting-edge technologies… But at the same time you’ve been bouncing around between several different projects all week. First off, you had the urgent media event that you need to be ready for, you have half a dozen meetings about an up-and-coming revolutionary project that’s going to turn the way you’ve done things on it’s ear, and of course there’s always the few minor things you do to help your customers or help maintain existing code.

stress balls

Are They Stress Balls... Or Future Projectiles?

 
Needless to say, you’ve had a great week, but you’re also ready for a weekend off. Then it starts. It begins as a trickle. Slowly it becomes more frequent, and the next thing you know you’re surrounded by flying foam stress balls.
 

Foam Ball Friday has been a web-team tradition for 3 years now. It started off as a promotion. We were giving out foam footballs at events with the slogan “Tackle Debt with MyTotalMoneyMakeover.com.” Then the promotion ended and we were left with the challenge of finding a use for the extra stress balls. It quickly became apparent that you could fling these at other team members without fear of hurting more than someone’s pride. It quickly became a tradition that the programming team has kept alive. It’s an awesome, lighthearted way to cap off a week of tough, dedicated work!

So, if you’re wandering through the office late on Friday afternoon, you’d be well advised to duck first, then grab a handful of stress balls and start throwing!

If you’re looking for a great place to buy a bunch of these things… we’ve used this company before.

Podcasting with Excellence

August 6, 2008

Being a webmonkey, I have a different take on podcasting. The Dave Ramsey Show has gone from 200 to 350 radio stations in the last 3 years due to our incredible affiliate relations/syndication team. We have Matt Aaron (spoke at NAB in ’07), one of the Industry’s best engineers running a cutting edge studio. All we do is work on the feed and the mp3s.

Amazingly, that still leaves plenty to do to get your podcast onto people’s MP3 players. The iTunes store in particular is an interesting animal. It’s perhaps the largest directory of free podcasts. Apple publishes a basic spec, but after 3 years of working at it, we’re still learning how to improve.

A few weeks ago, the iTunes store featured a personal finance section on their podcasting page. During the peak of this period, our podcast rose to #2 overall (that I saw). For a brief period of time we passed This American Life, (a podcast that’s spent a lot of time in the #1 overall slot) but were then unseated by something relating to the season finale of American Idol. Mileage may vary, but for us that exposure roughly translated into an extra 3,000 subscribers per day.

Our team culture here is to look at everything we do here in terms of lives changed. Every book, every CD, every class membership, and every advertisement sold isn’t just a number on a profit and loss statement. To us, victory is the single mom across the street and the struggling family across the country who flipped the page on their calendar knowing that for the first time in a long time they had more money than month.

To us, an extra 3,000 changed lives is worth going after.