#GIS from a .NET developer's perspective

Vote for a future Earth Day

So it's Earth Day today, and there are all sorts of blog posts out there on saving energy like saving a few watts with a new and better lightbulb, or pissing a lot of people of by driving a little slower on the highways. All these honorable initiatives are great and admirable, but I don't think they have much effect, because there are just way too few does these things (maybe we are just too stupid and/or lazy), and what we do is far from enough. What we really need is the politicians to set tough goals and invest heavy in technologies that really can make a change.

So what can you really do? Well you can vote for the politicians you think will do the most to make that happen. Currently the American Presidential election is still on-going, so judge from yourself. All 3 candidates have a page dedicated to environmental issues, so I pulled some bullets from their campain websites (but go read the full thing on the links before you decide), so you can judge from yourself. Of course there are many other important issues to look at, but given the current state of the world and that the United States wastes more energy than anyone else, I personally think it's of the highest importance. We had a great run the last century, but I'm afraid we have to start paying the bills...

Hillary Clinton -

  • Reduce electricity consumption 20 percent from projected levels by 2020.
  • A $50 billion Strategic Energy Fund, paid for in part by oil companies, to fund investments in alternative energy.
  • Doubling of federal investment in basic energy research.
  • Aggressive action to transition our economy toward renewable energy sources, with renewables generating 25 percent of electricity by 2025 and with 60 billion gallons of home-grown biofuels available for cars and trucks by 2030.
  • 10 "Smart Grid City" partnerships to prove the advanced capabilities of smart grid and other advanced demand-reduction technologies, as well as new investment in plug-in hybrid vehicle technologies.
  • An increase in fuel efficiency standards to 55 miles per gallon by 2030, and $20 billion of "Green Vehicle Bonds" to help U.S. automakers retool their plants to meet the standards.
  • A plan to catalyze a thriving green building industry by investing in green collar jobs and helping to modernize and retrofit 20 million low-income homes to make them more energy efficient.
  • A new "Connie Mae" program to make it easier for low and middle-income Americans to buy green homes and invest in green home improvements.
  • A requirement that all federal buildings designed after January 20, 2009 will be zero emissions buildings.

Barack Obama -

  • Reduce Carbon Emissions 80 Percent below 1990 levels by 2050
  • Invest $150 billion in a Clean Energy Future, double energy research, 25% renewable energy by 2025 and develop clean coal energy.
  • Support Next Generation Biofuels Two billion gallons of cellulosic ethanol by 2013, require fuel suppliers to reduce the carbon their fuel emits by ten percent by 2020, 36 billion gallons of renewable fuels to be included in the fuel supply by 2022 and will increase that to at least 60 billion gallons of advanced biofuels like cellulosic ethanol by 2030-
  • Set America on Path to Oil Independence, by reducing oil consumption by at least 35 percent, or 10 million barrels per day, by 2030.
  • Improve Energy Efficiency 50 Percent by 2030. Make all new buildings carbon neutral, or produce zero emissions, by 2030. He'll also establish a national goal of improving new building efficiency by 50 percent and existing building efficiency by 25 percent over the next decade to help us meet the 2030 goal.
  • Restore U.S. Leadership on Climate Change

Johm McCain -

No bullets to pull from his website.  Generally very vague plans (especially compared to many of his other important issues, like the right to bear arms):
 “Along with his commitment to clean air and water, and to conserving open space, he has been a leader on the issue of global warming with the courage to call the nation to action on an issue we can no longer afford to ignore. [...] By addressing this problem responsibly, John McCain believes we can meet our obligation to be proper caretakers of creation, in a manner of which we can be proud - by protecting our country, strengthening our economy, and addressing the challenges of our time, rather than leaving a much worse problem for our children”.

So what am I going to vote you may ask? Well unfortunately I'm caught in the legal void between two countries and therefore not allowed to perform my democratic responsibility, but hopefully I made one or two people change their mind for the better with this blogpost.

And sorry for the off-topic post.

My computer is too smart just have a weird way of saying things. For instance, today it tried telling me that I shouldn't be working on a Sunday.

When I booted up XP, this message kept popping up, and my Windows folder was empty:

The file or directory C:\Windows is corrupt and unreadable. Please run the Chkdsk utility. 

The funny thing is that apart from this message was constantly popping up, everything seemed to run just fine.

I took a backup, rebooted, CHKDSK started up automatically, fixed a few links, and everything seems to run fine again. PHEW! (but I'd better get that harddrive checked)

UPDATE: Two weeks later the harddisk crashed completely. Thank God for backups !

Comments working again

Thanks to Al for pointing out that my comments section was failing with JavaScript errors. Apparently the blowery http compressor that this site is using was messing up the embedded ASP.NET JavaScripts so they return empty script files. Fortunately a workaround exists for this.

So if you meant to comment about one of the screw-ups in my recent blogposts, here's your chance.

Huge wind turbines in Virtual Earth

Since today is Blog Action Day and the topic is the environment, I thought I would share this amazing birds eye view of one of the 2mW windmills in the offshore windfarm "Middelgrunden" just off the coast of Copenhagen that was published last week. I've knew these windmills were BIG, but looking from the peer it's hard to tell how big they really are. The boat next to it really gives a sense of its size. I can't even begin to imagine how big the 5mW mills they make these days are... 

There are 20 of these mills, all together producing 3% of Copenhagens total electricity consumption. Around 20% of Denmarks electricity comes from windmills.

Warning... bad joke coming up: Now you know why I moved to Sunny California - The weather really "blows" in Denmark :-)


Profanity usage

Inspired by xkcd, here's my take on it as a javascript developer:

My Profanity Usage by Browser

To be fair to the numbers above, I first of all base my JavaScript on the Microsoft AJAX client library, so usually this works pretty well with IE7. I start out with making stuff work in IE7 and then adjust it to work in FireFox, IE6, Safari etc. This is probably why I spend more time fixing quirks in FireFox than in IE7. I'm currently doing some testing against Safari 3.0beta, and some of the issues I'm having were often resolved by making some subtle (but illogical) changes in the JavaScript, but these changes were often something I've stumbled upon by sheer luck (hence the profanities). It might just as well be because this is a beta browser. Surprisingly I do find myself spending more time working around issues and bugs in FireFox than in IE, but in the end I'm usually able to come up with a script that works in all major browsers and only have very few tweaks that tests against which browser I'm using (thank God for JS base API's that does most of that work).

IE6 wins as the browser that required the most extra code needed, just because of one thing: PNG Transparency. I need objects that need to know whether its using images that are PNG or not, so I can apply the transparency workaround (but at least this is a well-known workaround). It just complicates the JS API, requiring developers to deal with more properties to ensure it works in IE6. I can't wait till the day where we can sign of that browser version.

So why do I primarily develop in IE7, and not FireFox which seems to be the case for a lot of developers? Many reasons:

  • The debug integration with Visual Studio.NET is lightyears ahead of FireBug and all the other JS debug tools in FireFox (and is the JS console really all I get in Safari 3.0 on Windows?).
  • There are some great tools to browse and modify the DOM, see requests etc. My favorites are "Web Development Helper" which even have JSON and Microsoft AJAX Partial Postback deserializers to help you easier analyze the server responses, and IE Developer Toolbar for viewing the DOM and modifying it on the fly (priceless when you are tweaking your CSS styles).
  • It's the most used browser out there, so this is in my mind also the most important one. I'm not saying the others aren't important, but this should ensure that the most used browser also gets the most preliminary testing.
  • I know all the non-ECMA-Script properties and methods that IE adds to the DOM, so I also know which properties and methods to avoid. I'm not that familiar with Mozilla's extensions and don't want to risk using methods that doesn't exist in other browsers (that just adds to the number of profanities :-).
  • This one is probably going to give me some flaming, but I do think IE7 is the best overall browser.


Whats the first thing you install?

Everytime I'm sitting down with a freshly installed PC, there is always one application I install before everything else (yeah even before antivirus software!): TotalCommander. It's my #1 application for navigating around the file system, running commands, opening/editing/zipping/unzipping/uploading/searching/multi-renaming files etc. etc. I use it so much that just using Windows Explorer to navigate to the install of TotalCommander is several agonizing seconds while thinking "God I wish I had TotalCmd to install TotalCmd" :-)

Today the first beta of the all new version 7 was released. Yepppiiiiiiii If you are new to TotalCmd, it's a great tool for quickly doing what else would require slow mouse navigation in Explorer and installing a bunch of additional applications. There's even a great set of plug-ins to make it even better! Below is a screenshot of TotalCmd configured as I like it.

Best of all: It's shareware and only $34, and you can install it on all your computers (as long as you only use one at a time, which most non-squid people do).

A little tip: In the install folder, there's a file called 'KEYBOARD.TXT'. This contains a list of keyboard shortcuts that will make your use of TotalCmd much more efficient, and discover a lot more of it's potential. I try to go through it once a month, and usually I learn some new ones everytime.

What's the first thing you install on a fresh PC?

Constant variables

I've had the pleasure of working a lot with XSLT the last couple of weeks while implementing a site in Umbraco. Developing macros in XSLT is somewhat far from what I've been used to in other higher-level languages I've worked with.

The last couple of days I've been struggling a lot with the scope of variables as well as updating some variables in a loop, without much luck. It now turns out that this is not possible because "variables are constant" in XSLT. I wonder who came up with that idea...