Archive for March, 2009

So true. It’s automagical.

2009/03/29 Comments off

Infographic of the year.

UI infographic
Thank you, webmonkey.

Categories: Coding, Design Tags: , , ,

New New Math

2009/03/29 Comments off

I had to deal with New Math briefly when going through school. Even then I found it to be pretty stupid. 2 + 2 = 4 no matter how you feel about it. But this site just might make me change my mind (not about 2 + 2). A subset of the new math equations:





This last is probably the most accurate assessment of weather forecasting around.

Categories: Science Tags: , ,


2009/03/29 Comments off

One of the Javascript test apps Google developed to put browsers through their paces, Smalltalk is a tweet mapping app for the weather. It maps, in real-time, any tweet in the U.S. having anything to do with weather conditions (although I’m pretty sure some of the fog ones were about parties with fog machines rather than actual foggy conditions). I’m having a little trouble with the GIS part – the points are mapped to a grid with no sign of a base map in site. If you know the shape of the U.S., you’re okay. And if you have a grasp on the shape of 3G coverage or wifi spots or smartphone sales, even better. We don’t get good 3G service in my neck of the woods and you can tell that by the obvious lack of tweets. I mean, I can barely get my coworkers, who aren’t that ancient, to try instant messaging (3-4 out of 30). 


One of the first things I noticed is that it, in FireFox at least, it takes up a lot of resources. Like 50% of my system resources (or 1 CPU). And it’s currently doing the same with Safari on a Mac. To be fair, I haven’t tried it in Chrome, which is the point of the app.

They should totally add another option – Stephen Fry.

Categories: GIS Tags: , , , , ,

Paging XML data from SQL

2009/03/28 Comments off

We all know the story – we’ve got a web page that’s pulling a lot of data from the database. In ASP.NET, the Gridview object will handle the pagination for you, but you still have to pull all of the data from the server. Using the ROW_NUMBER() option, we can return just the records we need to display for the page, defined by the starting row number and the number of rows to return.

This is the SQL snippet generally presented as the solution:

    SELECT fips, county, state, pop2000, area
    ROW_NUMBER() OVER (ORDER BY fips) AS num
    FROM dbo.Counties
) AS a
WHERE num > @startrow

which gives us @rows worth of counties from the @startrow position after the results are sorted.

But what if you want the results returned as XML data? My solution is to use a common table element to determine the result set first and then format the XML from the CTE.

   SELECT TOP (@rows) * FROM
       SELECT fips, county, state, pop2000, area
       ROW_NUMBER() OVER (ORDER BY fips) AS num
       FROM dbo.Counties
   ) AS a
   WHERE num > @startrow
SELECT fips AS '@FIPS', county, state, pop2000, area
FOR XML PATH('County'), ROOT('Counties') 

You get an XML stream like this:

        <County FIPS=’01001′>
                  <county>Autauga County</county>
        <County FIPS=’01003′> 

(These are not the real statistics by the way.) And usually I also return the row number as an element/attribute.

From here, we can use an XSL transform to parse the data into our final format. Now, I haven’t done any query analysis on this or compared it to a temp table situation, but it is quick to implement.

Categories: Coding Tags: , , , , ,

Update to measuring success

2009/03/27 Comments off

I found numbers (well, one number)! In the March 13 issue of Science, the letter by Ben Shneiderman includes an estimate for the number of readers to contributors for social collaboration sites: 100 to 1. So for our rubric, if you’re getting more contributors than 100:1, good job.

Unintended consequences of going green

2009/03/27 Comments off

So dishwasher detergent containing phosphates have been banned in Spokane County, Washington. Sounds great, right? Well, not really when a lot of the residents just hop the Idaho border to stockpile Cascade. The reason – the eco-friendly, low phosphate options don’t work very well with hard water. The Washington Lake Protection Association suggests installing water softeners so the eco-friendly detergents work better, but that just raises another issue – increased salinity from the waste water from the water softeners. Water softeners are already being banned in some parts of the country.

So which is worse: high phosphate loads or high salinity? Bearing in mind that the phosphate, more than nitrogen, might actually drive the algae blooms we’re trying to prevent. 

Can we come up with a third option?

Can we really legislate car colors?

2009/03/26 Comments off

California is talking about banning black or dark color cars as a way to reduce carbon emissions. The reason – it takes more to cool the car off after a few hours in the sun. 

Don’t get me wrong, I’m all for reduced carbon emissions and conservation, etc, but after many years in the desert southwest, I can tell you that it doesn’t matter what color your car is, it will be smoking hot inside if you leave it in the sun. I owned a black car at the time (and was pretty happy with the 34 mpg it got in town) and I don’t recall ever getting into anyone else’s light-colored car and saying “Wow, it’s so much cooler in here than in my car.” Nor do you ever see anyone say that a child or pet died because the car they were left in was black. No, they died because because temps inside a car can reach 140 F very quickly regardless of color.  

I’m just not buying this as a meaningful solution to global warming. Can anyone say green-washing?

Categories: Science Tags: , ,