Welcome to Pete Brown's 10rem.net

First time here? If you are a developer or are interested in Microsoft tools and technology, please consider subscribing to the latest posts.

You may also be interested in my blog archives, the articles section, or some of my lab projects such as the C64 emulator written in Silverlight.

(hide this)

Silverlight 1.1 Carbon Offset Calculator is out!

Pete Brown - 07 July 2007

I've written about some Silverlight work lately, but couldn't really talk about it until now.

Well, I can finally talk about it officially :)

The Silverlight 1.1 alpha Carbon Calculator that I and Steve Suing from Applied Information Sciences built was released into production last night, just in time for Live Earth. We're still doing a little bit of shake-out (and video editing and uploading), but it's out there, usable and fully functional, all on an alpha platform.

 

The Carbon Offset Calculator is a tool that calculates your impact on the environment, specifically your carbon dioxide output. This is affected by things such as the type and amount of energy in your home, your car and all the way down to the diet you eat. The science behind it is pretty solid, supported by government data. 

There are a number of calculators out there, some in HTML/AJAX, some in Flash, some in plain old HTML with JavaScript. This is the first of its kind in Silverlight, though. It's also one of the first real production Silverlight 1.1 applications out there.

If you click on "Explore Madagascar" you can see how we also integrated Virtual Earth into the solution.

The colors could still use a little updating, as we scrambled at the last minute to restyle this for a white page. Originally it was all set up for a black page. The map page still uses the color scheme set up for the black page, as it really looks best that way.

I will blog later about a lot of the specific details of the implementation. In the mean time, here is some high-level information:

Some Details

  • Two developers, two months doing everything on the project except for coming up with the specific language to show up on the screens 
  • Almost all test descriptions and calculator data is served up from various MOSS (SharePoint) lists
  • All filmstrip images come from MOSS
  • All videos are served up from MOSS
  • The geodata for the map points is also served up from MOSS
  • Silverlight is sitting over a layer holding the Virtual Earth map. We show and hide that layer as necessary. The shapes are placed on the map by converting lat/long data into real Silverlight coordinates.
  • The calculator itself is hosted in a regular old html page and surfaced via a page viewer web part (iframe) in a SharePoint page. This eliminated having to tackle building a web part on such a short project.
  • We couldn't pop up web pages using Silverlight, as popup blockers aren't yet aware of it like they are Flash. For that reason, the donation process takes over the iframe. This is far from ideal, but the best approach for now, as the donation pages change regularly.

Code Metrics

VS Analyzer doesn't yet understand agclr-hosted assemblies, so I did a quick count of files by hand  (good old DIR /S), ignoring the test projects

  • The UI layer project has 87 XAML files, 93 .cs files and 5 .js files, not counting the sample silverlight controls I modified
  • The business layer project has 28 .cs files
  • The web service layer project has 38 .cs files and 2 .asmx files

Tools Used

  • Visual Studio Orcas Beta 1 for all development, and some xaml tweaking
  • Expression Blend 2 Beta for main UI design and some of the animations
  • Expression Design RTM for all vector graphics (everything in the UI except the backgrounds)
  • Expression Media Encoder Beta for the videos
  • Corel Paint Shop Pro Photo for raster graphics (I'll graduate to PhotoShop CS some day!)

All in all, while the project had a lot of long days, this was very enjoyable, and we both learned a ton. LINQ and the other .NET 3.5 additions were a great bonus to our learning on this project, and turned out to be extremely useful for navigating the objects we created from the SharePoint data. 

Lamont Harrington at Microsoft (the person who owned this project on the Microsoft side) has a blog post that talks about some of the other bits he oversaw as part of this whole launch.

See it at BiodiversityHotspots.org . While you're at it, make a donation to a great cause!

   
posted by Pete Brown on Saturday, July 7, 2007
filed under:    

6 comments for “Silverlight 1.1 Carbon Offset Calculator is out!”

  1. Lorin Thwaitssays:
    Looks like the flight calculation for carbon is way off. Selecting 10 flights a year shows way, WAY more carbon usage than using 12 megawatt-hours of electricity a year. This calculator seems to be for a chartered 737, as if I am the only one on the plane! Divide by about 100 to get the real carbon offsets. Ultimately jet travel gets between 30 and 50 mpg per passenger, depending on how full the plane is. Check this out:

    http://www.carboncounter.org/offset-your-emissions/calculations-explained.aspx#_ednref24
  2. Pete Brownsays:
    Hi Lorin

    Thanks for the information on the calculation for air travel. Unfortunately, the calculators that are out there do not agree on this. For example, the old calculator at Conservation International (upon which we based this code, as it was really just a port) comes up with 7.9 tons for 10 short and 10 long flights. The one at the nature conservancy comes up with 25 tons for the same input. The one at begreennow comes up with 6.41 metric tons for 20 flights (to my surprise, they don't differentiate short from long, but it averages out to 1660 miles per flight). The reason the calculators do not all agree is because of the way they count long and short flights. As conservation international has stood by their data and their calculations, I stand by the implementation :)

    Thanks for writing.

    Pete
  3. Pete Brownsays:
    Hi Andrew

    Thanks for the kind words. I agree on the delay being bad. Unfortunately, time ran out before we could do some of the optimizations we'd like to have done. The photos are all loaded from a SharePoint list, a list that is expected to get pretty big over time. The thumbnails are from the same list. However, we are able to do a background download of the thumbnails; even that doesn't always cut it, especially on a slower connection.

    Doing the same for the main images would have been possible, but we felt that was a poor use of the user's bandwidth (plus they might wonder what the heck was going on in the background!)

    Pete

Comment on this Post

Remember me

25 trackbacks for “Silverlight 1.1 Carbon Offset Calculator is out!”

  1. Lamont Harrington's Blogsays:
    As mentioned in my last post , in addition to the website redesign and replatform to MOSS , I also oversaw
  2. Lamont Harrington's Blogsays:
    As mentioned in my last post , in addition to the website redesign and replatform to MOSS , I also oversaw
  3. Lamont Harrington's Blogsays:
    As mentioned in my last post , in addition to the website redesign and replatform to MOSS , I also oversaw
  4. Public Sector Developer Weblogsays:
    As mentioned in my last post , in addition to the website redesign and replatform to MOSS , I also oversaw
  5. Noticias externassays:
    <p>As mentioned in my last post , in addition to the website redesign and replatform to MOSS , I also oversaw</p>
  6. POKE 53280,0: Pete Brown's Blogsays:
    Now that I have completed the Silverlight project , I had a few moments to tie up some loose ends on
  7. Christopher Steensays:
    The Distributed Observer Pattern | The REST Dialogues [Via: (author unknown) ] PainlessSVN - Subversion...
  8. WynApsesays:
    Silverlight Cream for July 11, 2007
  9. Felix's Notes on Evangelismsays:
    在MSN赞助的今年 LiveEarth 活动中, Conservation International 发布了基于MOSS 2007新网站,作为阻止温室气体排放的努力,他们发表了一个二氧化碳排放量计算器,当然,这是基于Silverlight的应用:
  10. Noticias externassays:
    在MSN赞助的今年 LiveEarth 活动中, Conservation International 发布了基于MOSS 2007新网站,作为阻止温室气体排放的努力,他们发表了一个二氧化碳排放量计算器
  11. 外部部落格says:
    在MSN赞助的今年 LiveEarth 活动中, Conservation International 发布了基于MOSS 2007新网站,作为阻止温室气体排放的努力,他们发表了一个二氧化碳排放量计算器
  12. 外部部落格says:
    在MSN赞助的今年 LiveEarth 活动中, Conservation International 发布了基于MOSS 2007新网站,作为阻止温室气体排放的努力,他们发表了一个二氧化碳排放量计算器
  13. POKE 53280,0: Pete Brown's Blogsays:
    I previously posted about the Carbon Calculator we wrote using the Silverlight 1.1 alpha bits and MOSS
  14. POKE 53280,0: Pete Brown's Blogsays:
    The Silverlight Carbon Calculator is back up and functioning. It took some doing to get it back up (not
  15. POKE 53280,0: Pete Brown's Blogsays:
    Frank LaVigne and I were both interviewed as part of a Silverlight article for Redmond Developer News.
  16. POKE 53280,0: Pete Brown's Blogsays:
    The main pattern I followed in the Silverlight 1.1 Carbon Calculator UI development was the pattern of
  17. POKE 53280,0: Pete Brown's Blogsays:
    My colleague at AIS, Steve Suing, just started up his own blog today. Among other things, Steve was half
  18. POKE 53280,0: Pete Brown's Blogsays:
    When I first became an MVP in January 2008 there was some questions as to what bucket Silverlight would
  19. POKE 53280,0: Pete Brown's Blogsays:
    PETA and AIS just completed a great Silverlight 2 application for the Animal Testing Breaks Hearts campaign.
  20. POKE 53280,0: Pete Brown's Blogsays:
    Prior to joining Microsoft, I worked at a consulting company for a bit over 13 years. Prior to that,
  21. Community Blogssays:
    Prior to joining Microsoft, I worked at a consulting company for a bit over 13 years. Prior to that,