For fun I'm going to try this. Google has a new service that lets you create your own search engine. As an example. .NET web developers will find http://www.searchdotnet.com/ useful as it only returns authoritative Microsoft sources. MSDN, microsoft.com, MS blogs, etc. I've added that to my custom Google homepage.
So what should I create a search engine for? How about poker - a search engine that will search only the top poker blogs nd ignore the ads and such?
Check http://www.google.com/coop/cse?cx=007309252445351814162%3Aym0xcd0ajbk in a little bit to see how that goes. :)
The next adventure in my journey from Visual Studio 2003 to the wonderful Visual Studio 2005 is to convert our large source control repository from SourceSafe (VSS) to the new Team Foundation source control. This should be fun. Visual Studio 2005 comes with a tool called VSSConverter which analyzes your existing VSS database, and then when things look good it migrates it for you. Very handy. VSSConverter will migrate the files, including check-in history, to a new project in Foundation Server. In my practice, the migration happened almost flawlessly. The one big hiccup for me is that there are some developers who have left the company, and since Foundation Server is built off of Active Directory, I had to map those users to Guest. So you lose some user names in the conversion from people who have left. Is there any way around that? Any tips or hints would be appreciated.
We ended up converting an entire ASP.NET 1.1 web site to 2.0 in under a week. It turned out to be easier than I imagined - I estimated 2 people for 2 weeks, and it looks like it will be 1 person for 2 weeks.
I don't want to understate how many problems there were. In the project as a whole, there were THOUSANDS of warning and error messages after the conversion wizard that done its work. But because of the duplicate nature of these problems, it was usually a search and replace job to fix them. One search and replace could fix 50 warnings at once. And even the ones that had to be fixed manually, I could usually just F3 from occurrance to occurance and paste in the corrected code.
The site is now up and working. There is still a lot of testing to do obviously, but I am extremely happy that it has turned out so well.
OK, perhaps saying "too easy" in my last post was asking for trouble. Because trouble is what I have.
I have a weird situation and I need some help figuring out what the solution is... Any clues, please email me or leave a comment.
We have a "base page" that inherits from System.UI.Web.Page. My base page is called "BasePage.aspx".
All other web pages of our application inherit from that. So "default.aspx" inherits from BasePage.aspx.
So my problem is that the codebehind page for BasePage, called BasePage.aspx.cs, has been saved in the App_Code folder. Now I don't know this folder or what it's for, thats my first problem.
Now all the pages that inherit BasePage.aspx now fail because the class doesn't exist.
If I move BasePage.aspx.cs out and put it at the root folder, then another page breaks about the BasePage class (one of our User Web Controls).
Ugh. I am sure once I figure the underlying problem out, fixing all pages won't be a problem. This isn't a problem relating to the number of pages, it's a problem every web site would have during a migration with base pages, web controls, etc.
So here is the status of my .NET 2.0 application conversion. I converted the 71568 lines of C# code and 38452 lines of VB code in the business object and services tier with little error. No errors really, just a few things that Visual Studio 2005 warns about that Visual Studio 2003 did not.
When I got to the web portion, I started finding lots of interesting errors. It's going to take a full day or so to go through them all.
All in all, it's not as scary a proposition as I thought. It's the kind of conversion that can be completed in a couple of days. I thought it might have required weeks before.
We have a rather large project that currently runs in ASP.NET 1.1, and we want to convert it to 2.0. Now it's not huge compared to some projects, but it's pretty big.
71568 lines of component C# code
38452 lines of component VB code
100401 lines of ASPX C# code
It should be fun seeing how the .NET conversion wizard handles this... I'll document my progress here as I go through it for the sake of posterity and the benefit of anyone else contemplating a rather large conversion.
Microsoft recently released a toolkit called Atlas at http://atlas.asp.net/
Atlas is an AJAX framework for ASP.NET 2.0. If you don't know what AJAX is, it is best described as a web programming technique where the page appears to update itself (or actually does update itself) without a full refresh of the page by the server. This can be automatic or at the request of the user viewing the page.
For instance, the up-arrow images on the left side of this page are AJAX-type controls that allow the user to alter their view of this page. This happens without a trip back to the web server.
An example of automatic updating would be a page with stock quotes embedded inside a news article (like http://www.marketwatch.com/news/story/5x12BB8tQmtNw49x3nlsrfJ?siteid=mktw&dist=TNMostRead ), and every few seconds the stock quotes update themselves with the latest values, but the rest of the page stays the same. In this case, the web browser is actually going back to the server to get a new quote, and updating a small part of the web page with the new value. The reason this is useful is that full page refreshes are slow, and annoy the user by making the page flicker or become unreadable.
For a live example of Atlas, check out the official samples page at http://atlas.asp.net/atlastoolkit/
Look at the Accordion control. As you click the headers, all other headers collapse and only the one selected is open. Or try the slider control - a control not normally available in HTML web pages. These controls are cross-browser compatible with IE and Firefox.
I saw a demo of this last week and it was very cool. http://www.msdnevents.com/
It only took me 6 months of procrastination to go from getting my MCAD.NET to getting my MCSD.NET.
Today I passed the SQL Server Design exam (70-229) as my elective.
Microsoft was having a promotion - if you fail an exam, you get to take it again for free. And a friend handed me a 50% off coupon. So no more excuses - I just went.
No studying, no Transcenders this time. If I failed, I would take the followup more seriously. No need, since I passed.
Anyways, one more goal reached.
I'm busily studying for the next MCPD upgrade exam: 70-552. I took 70-551 last week.
Now you don't have to take both (one is for Web and one is for Windows Forms developer)... but since they are free I figured “why not?”
And since the questions on both exams overlap, taking 70-551 actually gives me an advantage for the exam tomorrow. I have seen 1/3 of the questions before.
So if I didn't pass 70551 (or barely passed it), I should have a better score on this one.
Just got back from taking the 70-551 exam (71-551 in beta).
3 sections, 30 questions each (for a total of 90 questions). Each section correlates to the Official Exam Objectives published by Microsoft. At the end of 90 questions (at around 87 actually), I was exhausted and could not wait to be done. Luckily, I felt I did pretty well on the last section so did not have to spend much time reviewing it and could just end it. The whole test took roughly 2 1/4 hours (although I had 3 to complete it if I wanted).
Each section allowed 60 minutes to complete. No going back once you've completed a question although the usual Previous/Next is allowed within a section, and a review at the end of each section.
I found the test hard in some places and easier in others. The first section (on .NET Framework) I may have barely gotten 60%. The next section, on web development, was also tough but I did slightly better, say 70%. And the final section, on design and development in general, I did better still at 80%-90%.
So who knows if I passed. I don't. The results come in 8 weeks apparently.
Anyways, on to the Windows test next Sunday. Don't forget to visit my 70-551 Wiki. I am starting one for the Windows exam 70-552 as well.
One fun way to learn - for me at least, your mileage may vary - is to watch a training video and do the exercise alongside the instructor. The instructor creates a new project, I create a new project. The instructor adds a TreeView control to the web page and creates a new dynamically bound data source, well... you get the idea.
Some great ASP.NET 2.0 videos are here. Useful for studying for the certification, hint hint.
I never mentioned on this blog what I did in December. I achieved my MCAD for .NET certification.
Today I got my Welcome Kit. A lapel pin, a wallet-sized card, a certificate suitable for framing...
Oh, and the right to post this logo to my blog:

W00t w00t!
Long-time readers will recall that I often post here how much I love .NET. You can go back in the posting archives of this site and see how it thrills me when things that I want to do are made simpler with .NET (compared with other programming environments I am used to).
Today was not a good day in that regard.
Where do I begin? Well, first of all, I was writing a simple Windows Forms program to call a stored procedure and write the dataset returned out to a text file. Should be simple to do.
Well, I tried to be a bit fancy right off the bat. I don't know why I did it, but I lost a couple of hours of productivity and I still don't understand what the big deal is.
Here's what I tried to do: I wanted execution time to be displayed on screen as the program ran. You know, every second the text will update to say “1 second”, “2 seconds”, “3 seconds”, etc. Easy right? I just add a timer component to the form and have the Tick event update the text in a label.
Well, I tried to run the program in debug mode, by stepping through it line by line. When I happened upon my SqlConnection.Open() statement, the debugger froze. “There is no source code for the current location.” Hmm. I was using Step Over, not Step Into, so it should not be trying to go into the SqlConnection object code. Is my SQL connection setup OK? Check my connection string. Database is running. Add a generic exception handler to the catch statement. Tried commenting a bunch of stuff out. Moved things around. Nothing worked. The program always froze on the SqlConnection.Open() statement.
I called a friend over, and showed the problem to him. We both spent 20 minutes trying different ways of doing the same thing, to no avail.
Finally, I checked Google. It led me right away to this MSDN Knowledge base article. Ah, you cannot access the SqlConnection from inside a timer event in Debug mode. But the article suggested a work around. Instead of using a Timer component, I could use the System.Timers.Timer class.
So I reworked my code to use that class instead. The method and property names are slightly different, so it wasn't just one-line change. Ran it again.
This time it worked. But... the program continued to act strangely in Debug mode. When I tried to read the dataset using a SystemDataReader.Read() call, it froze again.
So finally, I pulled out all the timer events. Not the best solution, but it worked fine after that.
Anyways, .NET's flakiness with Timer events cost me a couple of hours today. While most of the time it is fun to be a programmer in this tool, today it was not fun.
I spent a few hours today studying for my next MCSD .NET exam: 70-315. One event that caused me to have so much free time is that we are getting our condo painted, and so I can't wander too far from home or for too long. So here I sit with my laptop studying like a college student. It's fun actually.
So, first let me give credit where credit is due: Amit Kalani has written some excellent study guides for the Windows and Web exams. I love doing examples - since I spend the majority of my study time working with .NET and not just reading about it. And the Kalani books have plenty of examples.
I have purchased the Transcender for the next exam already, although I have not had time to use it yet. I think I will try and get through the Kalani book before testing my knowledge with Transcender.
Of course, it's entirely possible to take the exam after studying only the Kalani book, without the help of Transcender. But I think having the exam simulation software allows me to honestly assess my skill level, gain confidence, and reinforce my learning over and over.
I can't wait to take the next exam. I think I'll book it soon.
I hate to sound like a shill for any one company or product, but today I purchased a Transcender exam simulation and bought a Microsoft MCP exam voucher, for $100 off the retail price. I love saving money.
If you use this link, I will earn $5 as well. Good deal all around!
Microsoft Transcender Cert Pack - Pro
I took the “Developing and Implementing Windows-based Applications with Visual C#.NET and Visual Studio .NET” exam this morning and passed with a 920!
Whew. That's one load off my shoulders.
I should try to take the Web-based Applications exam soon too, before all that knowledge escapes from my head...
I am scheduled to take one of the MCSD .NET exams this morning - “Developing Windows Forms Applications with C#”. (It's getting late -- I should get some sleep.)
Wish me luck!
VB 2005 Express setup gave me a little cause for concern today:

Wow, the setup routine needed 36,468 files in order to begin the installation. I'm now a little bit afraid of running this thing on my home PC...
Just a quick note... I've had a wonderful few days programming extensively in .NET, mixing evenly between Visual C# and Visual Basic. My productivity has been incredible - completing several important project tasks. There is nothing like positive project progress to make a developer feel happy.
For instance, I was talking to one of the other developers on my team today about a particular task on our to-do list, and 10 minutes later I was able to hand over working code for that developer to use. (I've been working with the middle-tier components lately, and this developer was working on the ASP.NET front-end that uses those components.)
I love days like this. And having an easy to use development environment, like .NET, is a big part of it. The people on my team and the company I work for are another big part of it.
This is huge news out of Microsoft today. Wow.
Microsoft Announces new Express Products!!
In the TechEd Europe keynote today we officially announced the new Express products that are available to download right now:
- Visual Basic 2005 Express Edition (download)
- Visual C# 2005 Express Edition (download)
- Visual C++ 2005 Express Edition (download)
- Visual J# 2005 Express Edition (download)
- Visual Web Developer 2005 Express Edition (download)
- SQL Server 2005 Express Edition (download) – Note, SQL Express is included as an optional component in the installers of the other Express products.
Recently, I wrote a rock paper scissors (RPS) web service and submitted it to a competition in Switzerland. (That sounds more impressive than it actually is...)
First, the good news, in my group I tied for first place with a record of 6 games won and 4 games lost. However, when you take the individual rounds into account, I came fourth in my group -- dead middle out of 7 contestants in Group 1.
http://www.00001001.ch/codeduel/fr/ranks.aspx?grId=0
I was given the user id “noname”.
There were a total of 112 contestants, although some of those appear to be Bots entered into the competition by the organizers to fill out the groups. The top prize was a Tablet PC.
Some people debate the benefits of earning developer certifications. While they are obviously important in the Systems Engineer field, where MCSEs and Cicso certifications are often job prerequisites, the common wisdom for Developers seems to be that “what you have done” counts way more than simply “passing a certification exam”.
The anecdotal evidence gathered from my personal experience is overwhelmingly in favour of certification, as far as I'm concerned. I have been Microsoft certified for 6 years, and have:
- landed at least one job where having an MCSD certification was a prerequisite to even apply;
- gotten into the book industry on the back of my certification; and
- found situations where interviewers/employers mention it favorably - “Ah, I see you're certified. That's good!”.
I am not out to convince people that everyone needs to become certified, or that certification is the Holy Grail that will allow you to find work faster and easier than anyone else. I just want to say that I, personally, find that Microsoft certification is one element that has helped drive my career forward.
(See Eric Sink's excellent article on Career Calculus, to understand the correlation between constant learning and career development.)
As some of you know, I have been maintaining a MCSD/MCAD Certification Wiki elsewhere on this site. As I gather info and links, I update the pages of the Wiki. Since I am currently studying for the 70-316 exam (officially called Developing and Implementing Windows-based Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET), that is the section of the Wiki with the most information.
Some people study for an exam, and then wait until they are 100% ready to book it. I can't work like that. I prefer to book the exam the moment I decide to go for it, and schedule it for a date 3 or 4 weeks in the future. Then I study like crazy and take the exam. Booking the exam first gives me a definitive deadline to work towards, ensuring I devote the time necessary to pass.
Of course, if I honestly felt I was not ready a few days before the scheduled exam date, I could always call Prometric and reschedule the test... there's no charge for that. I've had to do that once or twice when my work schedule did not permit me to take time off to study for or take the test.
God, I love this stuff.
So I sit down, and in less than an hour build a simple model-based testing program for my Rock Paper Scissors web service.
Basically, I start by defining all the valid states for my service.
private enum states { Offline, ShakeHands, TakeTurn, ReceiveTurnFeedback, ReceiveGameFeedback };
Then I create an array indicating all the valid state from-to combinations.
private states [] testorders = {states.Offline, states.ShakeHands, states.ShakeHands, states.TakeTurn, states.ShakeHands, states.ReceiveGameFeedback, states.TakeTurn, states.ReceiveTurnFeedback, states.ReceiveTurnFeedback, states.TakeTurn, states.ReceiveTurnFeedback, states.ReceiveGameFeedback, states.ReceiveGameFeedback, states.Offline};
So, taking the first line of the array above, if the rps service is currently offline, the only valid action would be to shake hands. If you have just shaken hands, you have two choices: you can either take a turn, or receive game feedback (close the game down).
The actual code is rather simple. If my RPS service were a professional application, I would improve this a bit. Basically, I keep track of the current state, loop through the array looking for all the possible actions, and then randomly take one.
// What can my next states be? ptr = 0; for (int j = 0; j < testorders.Length - 1; j += 2) { if (testorders[j] == CurrentState) { // Add this to the list NextState[ptr++] = testorders[j+1]; } }
// Pick one CurrentState = NextState[rndm.Next(0, ptr - 1)];
If I do this enough times, I will have tested every allowable combination of actions and states. And somehow there was a new allowable action, for instance, SayNiceGame(), I could add that to my states array easily enough.
Possible improvements to my application would include testing for exceptions, and handling them gracefully; keeping statistics about the number of tests run; calculating the percentages of each choice made (rock, paper and scissors)... You can start with a basic test model, and make it more complex as you have time.
Testing Web Service, v1.0 - C# Source Code
Testing Web Service, v1.0 - .NET Binary
Josh Ledgard points (through Nihit Kaul) to an excellent article on testing methodologies - well worth a read. Automated testing seems to be the new "hot" technology of 2004.
For Testers: Nihit Kaul Talks Up Model Based Testing
It was my belief as a test lead and is still my belief. To test a product with any amount of interesting complexity you need to find good ways to reduce a reliance on manual processes. If you test manually you need automation. If you are writing a test plan you need to have a machine figure out the details. If you start writing automation you need to reduce the cost of writing automation. One way to reduce costs and start abstracting the testing problems is through model based testing. Nihit has a good introduction article to the practice you should read.
Internally we have gone so far as to write automation that abstracts Visual Studio, write a model that represents a feature, and have that model make calls to the automation. This reduces the cost of writing scripted automation. Only a few teams have started doing this and I think it has a long way to go, but I would be surprised if the use of such practices don't take off quickly.
Today I watched 5 short training videos at Visual Basic At The Movies, and for my troubles Microsoft is sending me a free copy of Visual Basic .NET 2003. For those of you wanting to get started in VB but don't have a copy of the Visual Studio IDE, this is a great offer.
Now, I could have chosen to get a free “Developer Welcome Pack” instead, since I already have VB installed at home. But while poking around the Internet looking for more information on what exactly a welcome pack is, I discovered a second Microsoft promotion offering to send the Welcome Pack free for existing developers. So why settle for one or another when I can get both?
Microsoft announced a cool new product called Visual Studio 2005 Team System. It puts project management, architecture, and unit testing tools right into the Visual Studio IDE.
I can't wait to get my hands on it.
OK, I promised yesterday to release the .NET client application I wrote that interfaces with my Rock-Paper-Scissors (RPS) web service, so here it is:
RPS Client v1.0 - Source Code and Binary
It's a very simple app. I wrote it in 45 minutes or so, so don't judge me to harshly on it. Here's a screen shot.
As you can see, after 50 hands, my web service kicked my human ass, 20-12. I haven't yet added any of the advanced RPS code in there either.
I must say, after spending all of 45 minutes writing a complete Rock-Paper-Scissors game client to the web service I wrote last night...
I LOVE .NET
Consuming a web service in .NET is crazy simple.
Step 1. Add a Web Reference to the web service URL.

Step 2. Instantiate an object using that reference.
rpsservice = new RPSClient.com.mydemos.www.ScottRPS();
Step 3. Use the object, just as you would any other object in .NET.
rpsservice.ShakeHands(iGameId);
Wow. I love it when products just work. No fuss, no muss.
|