January 2005 Entries

Post-Cache Dynamic Content Generation

 

Nikhil was recently talking about this support for the upcoming release within ASP.NET 2.0. If you wanted to do this previously it required some use of JavaScript or iframes. This is definitely going to be a nice bit of functionality I will want to take advantage of.

Megan Passed

 

We just found out yesterday that Megan passed her LPN boards test. Congratulations babe! I have to admit, it makes me wonder why they make them wait. The test is done on the computer and you have two options, wait four weeks from your test date to receive confirmation in the mail or pay 8 bucks and find out two days after the test. Once you've already paid 300 dollars to take a test, what's 8 bucks? My question, why do you have to wait two days, shouldn't the results be known as soon as the test is complete?

Debugging Web Applications with Fiddler

 

I just came across a new article on MSDN detailing the release of a tool called Fiddler. Fiddler sits as a proxy between WinINET and your requests to web servers; allowing it to capture all HTTP traffic. Fiddler is then able to track results and provide performance metrics based on the HTTP traffic being processed. Something I think makes this product even more valuable is the support for debugging. Fiddler supports a type of breakpoint, which allows you pause HTTP traffic, and edit values. If you don’t have an IDE readily available this is the next best thing since sliced bread for debugging in the web environment. Fiddler is also extensible allowing you to write your own rules or inspectors; this is definitely a tool I’m adding to my list.

C# vs. C++

 

Ok, so this is obviously not a new topic and you are probably accustomed to seeing a comparison between C# and it's more common competitor, VB.NET. Eric Gunnerson gave a really nice, detailed list of reasons as to why C# is better than C++ followed by only 4 pluses to the usage of C++. The choice of C# seems rather clear when compared to a language that isn't managed, however when comparing multiple managed languages it becomes much more vague.

Valid RSS from .Text

 

I use RSS Bandit as my RSS aggregator, it comes with a host of nice options, one of which allow you to validate a specific RSS feed to confirm it is well formed. This morning I decided to check to see that my feed, which is being generated from .Text is properly formed. It wasn't. When I went to Feed Validator, it came back with an error stating the <managingEditor> element needed to include an email address. I quickly pulled up the .Text source code to see what was going on. I was able to find in the BaseRssWriter.cs file, Scott was formatting the <managingEditor> section with only the name of the editor. After changing the BuildChannel call to pass the email address instead of the name, my feed is now valid.

What type of developer are you?

 

Brad Abrams wrote a post back in late 2003 discussing three types of developers. These three types of developers (i.e., Systematic, Pragmatic and Opportunistic) can map closely to the languages of C++, C# and VB, respectively. These three types were defined by Steven Clarke who works on API usability at Microsoft. I think a major flaw with this mapping is that developers can become pigeonholed specifically by the programming language they use. I don't feel that I fit into one specific category here; it's more of a melting pot for me. So I wonder, where do you fit in the grand scheme of things?

CAPTCHA Added To Site

 

Well, I woke up this morning and got to work, a short time later I've got an effective CAPTCHA control added to decrease the influx of spam posts I've been receiving. Let me know what you think.

Search Added To Site

 

I added searching to my site tonight, hopefully over the weekend I also plan on adding a CAPTCHA control to lower the amount of spam comments I receive. The search is performed via MSN Search, which can provide an RSS feed as output for your search results.

Finding Unmanaged Exceptions

 

Mike Stall has a really nice write up that walks you through using Windbg to find out about unmanaged exceptions. Nice stuff Mike.

Dinner in Omaha

 

Well, last night Javier and I drove out to Omaha for dinner with Jeff Brand from Microsoft and a bunch of other Omaha developers; Joe Olsen and Phil Wolfe to name a few. It appears that Javier already beat me to the post so I won't ramble on any further but I just wanted to say thanks again, what a great night.

Revisiting Eclipse – Another IDE

 

Tonight I got out my copy of The Pragmatic Programmer; I haven’t read this book for almost two years now so I thought it would be a good chance to review it. If you haven’t read this book yet and you get paid to develop software I would highly recommend it. After reviewing a few chapters it put me in the mood to revisit an old IDE I once used. I haven’t worked with Eclipse since I was in college, since I was in a bit of a reminiscent mood I decided to download the latest bits and give it a whirl.

There are some really neat new options, I wonder if the Visual Studio .NET team is watching (I’m sure they are). Of these, one thing that caught my attention was the “Update imports on paste” functionality. Basically, if you were to paste in some new code, the IDE will determine which import statements are required by the new code and automatically add them to your existing list of import statements. We all try to avoid copy and pasting code (right?), but this functionality is really nice if you need to do so. I wonder how it handles type resolution across multiple namespaces if the type isn’t fully qualified with a namespace via the code. None the less a helpful feature I believe. Another nice feature is its ability to highlight method exit points simply by placing the cursor on the method return type. This can be extremely helpful in visualizing the code path with long methods.

Something I found a little strange (correct me if I missed the reasoning here) is spell-checking support has been added to the Java editor. The only language that I can think of that would pass a spell checker is COBOL, why on earth would you want to spell check your Java code? Okay, the devil’s advocate would say: “to do so to confirm all their documentation is free of misspelled words”; which makes sense however the fact that it would pick up on every code entry would simply be too painful. You would need to limit the spell checker to commented out lines only for this to be acceptable. Again, feel free to correct me if I misspoke. Overall I’m rather impressed; especially considering it’s a free IDE. I can’t wait till the beta 2 bits drop for Visual Studio .NET, I understand there is a rather large delta between it and the beta 1 release, that will be even more fun to play with.

A Software Developer’s Mantra

 

Marco Dorantes recently posted what I would consider a software developer's mantra, check it out here.

My New Clock

 

Here is a shot of my new clock; there are many different skins available – very cool system tray clock if you ask me. It is available here for download if you are interested.

 

Comega is an extension to C# in two areas; a control flow extension for asynchronous wide-area concurrency and a data type extension for XML and table manipulation (the latter seems much easier to say, don't you think?). This is a research project that has been going on at Microsoft Research; however Dare Obasanjo recently made a post mentioning an article he has recently written that should show up around the end of the month. It appears that Comega could really provide an enhanced support of Object <--> XML mapping, this would be very welcome in my book. I'm really looking forward to the article.

Becoming an independent consultant

 

This is a very interesting read on becoming an independent consultant. Matt has some pretty interesting posts on his blog.

A Little Snow...

 

Heath was talking about the possibility of getting a little snow up in the Washington area a couple days ago. In particular, he was worried about the drivers when faced with the driving conditions snow produces. This is absolutely a legitimate concern. We recently had an ice storm come through followed by several days of snow. I took a picture of the snow at the end of my driveway so people in Washington can have a little perspective of the snow accumulation that occurs in the Midwest.

Use Ruby to Unit Test C#

 

As I mentioned earlier I would be posting an entry showing how to test your .NET code with Ruby. John Lam recently posted an example using Python.NET to test a C# class so I though I would use his C# example to show how you would do this with Ruby. First off, you will need the Ruby/.NET Bridge which is available here. Here is the C# class that we will be testing:

 

using System;
namespace Calc
{
public class Calc
{
public int Add(int x, int y)
{
return x + y;
}
public int Divide(int x, int y)
{
return x / y;
}
}
}

Next, compile that with the following command line:

 

csc /target:library Calc.cs

This will generate a Calc.dll file which you can load in your Ruby code as follows:

require 'dotnet'
require 'test/unit'
loadLibrary 'Calc'

class CalcTest < Test::Unit::TestCase
def test_divide
calc = Calc.new()
assert_equal(2, calc.Divide(8, 4))
end
def test_add
calc = Calc.new()
assert_equal(5, calc.Add(2, 3))
end
end

Run your code by calling "Ruby calctest.rb". Your output should be as follows:

 

>ruby testcalc.rb
Loaded suite testcalc
Started
..
Finished in 0.101 seconds.

2 tests, 2 assertions, 0 failures, 0 errors
>Exit code: 0

The test suite automatically runs all instance methods that start with 'test'. That's it, we can easily add or change new test cases in Ruby to test our Calc class that was written in C#.

Microsoft Visual C# MVP Award

 

I’ve been awarded the Visual C# MVP (Most Valuable Professional) award from Microsoft for 2005! I just received the email tonight with all the details regarding the program. This is a great honor, I was really delighted when I found out I had been selected. I am really looking forward to the MVP Global Summit; it will be a great chance to visit Seattle, friends and some family that live there.

I know I had mentioned that my first post of the New Year would reflect using the .NET Framework from Ruby, but I am currently working on an issue with overriding the WndProc within Ruby, I hope to go over this soon in an upcoming post. Wow, what a great way to start out the year!