June 2005 - Posts
We've been running on .Text for quite a while, but continue to find bugs in it. Especially the fact that randomly, people cannot edit the items they have just placed on their blog is an annoying one.
We are hoping to solve a lot of problems by upgrading to Community Server from Telligent Systems. The reason why we haven't upgraded in the past, is because of the new location of the pages. Version 1.1 has become more flexible on the location of the community site and I've found a very small but excellent component for url rewriting. I've done some of the coding myself at first, but with this component I don't have to reinvent the wheel as it has all functionality I want.
Via Mischa Kroon I've found the link to this url rewriting component. It reads settings from your web.config to see what page(s) it has to redirect and whereto. This is very flexible as it also works with regular expressions. For all Community Server junkies or people that are afraid to upgrade (like I was), here's what I did.
Remember, these instructions are for CS 1.1 but should work anywhere.
I'll first explain the current and new situations. In the current situation, the url is like bloggingabout.net/username/ whereas the new situation will be bloggingabout.net/blogs/username/. There are a lot of possible directories and files behind those urls, so it should definitly be solved by a regular expression. Here's how I did it.
First, download the component, unzip it and in the directory /demo/bin/ you can find two .dll files. Copy those to the /bin/ directory on your website.
Now you have to edit your web.config and you are done! First, find the <httpmodules> tag. If you haven't added anything, make it look like this.
2: <add name="RedirectModule" type="Madgeek.Web.RedirectModule, Madgeek.RedirectModule" />
3: <add name="CommunityServer" type="CommunityServer.CSHttpModule, CommunityServer.Components" />
4: <add name="Profile" type="Microsoft.ScalableHosting.Profile.ProfileModule, MemberRole (...) 7562"/>
5: <add name="RoleManager" type="Microsoft.ScalableHosting.Security.RoleManagerModule, M (...) 7562" />
At line 2 you can see the line I added. I've truncated some of the content (in line 4 and 5) so it won't be that long.
Now you add another line to your configSections.
2: <sectionGroup name="memberrolesprototype">
3: <section name="membership" type="Microsoft.ScalableH (...) 7562"/>
4: <section name="roleManager" type="Microsoft.ScalablH (...) 7562"/>
5: <section name="profile" type="Microsoft.ScalableHost (...) 7562"/>
6: <section name="anonymousIdentification" type="Micros (...) 7562"/>
8: <section name="redirections" type="Madgeek.Configuration.XmlSerializerSectionHandler, Madgeek.RedirectModule" />
This time you can see the added section at line 8.
Now all you have to do is add your redirection part. Mine looks like this:
1: <redirections type="Madgeek.Web.ConfigRedirections, Madgeek.RedirectModule">
2: <add permanent="true" ignoreCase="true" targetUrl="^/MainFeed.aspx" destinationUrl="/blogs/MainFeed.aspx" />
3: <add permanent="true" ignoreCase="true" targetUrl="^/(dennis|rj|patrick)/(.*).aspx\??(.*)" destinationUrl="~/blogs/$1/$2.aspx" />
In line two the main rss feed is redirected to the new location. This only concerns one file and is, as it looks, very easy. But now the current blogs to their new location. The third line tells that it should look for directories starting with either dennis, rj, or patrick and forward those to the destination url. I will have to include all bloggers currently in our community in the final version though. The regex will place the found user-directory at the $1 location and the complete directory structure after that and the file behind it at the $2 location. It should forward every .aspx file.
You can also see the parameter permanent which is set to true. This will make the component send an error 303. This tells the search engines like Google that it's a permanent move of the file. The search engine will then update its index, which was very important for us.
I'll do some additional tests soon and hope to be able to upgrade BloggingAbout.NET without any problems.
If you like the MSDN Nuggets that Carlo Poli has mentioned in the past, you might also want to check out the GrokTalks. The GrokTalks were recorder at the US TechEd a few weeks ago and can be streamed and downloaden. Where the Nuggets were about 15 to 30 minutes, these GrokTalks are 10 minutes long at most. They are all presented by Microsoft Regional Directors from all over the world and some are pretty cool to watch.
You can find a quick list of all of them here in the archive, where the topic covers the presentation and presenter.
If the list is gone because you're in the year 2007 or something, check out the june 2005 archive.
Definitly watch Kimberly Tripp's groktalk! Scott Hanselman's tools is also quite a good one.
If you want to know about modeling and Agile modeling specifically, take a visit at Scott Ambler his site. He has put some effort in explaining Agile modeling and of much interest are the list of 35 modeling artifacts. He described the artifacts and provides examples for every one of them. Quite some information, that can also be quite handy when you just need to look up some stuff.
It now is just an issue of what tools to use when you want to draw these. Unfortunatly only very few can be drawn in Visual Studio Team System. But for the smaller projects, I still prefer Visio with Pavel Ruby's Visio UML Stencils.
Here's a complete list of the modeling artifacts described:
Today, BackBase will release the free community version of their BackBase AJAX backend. If you've ever wanted to write AJAX enabled websites, this is your change. There are multiple demos online that are very good and offer loads of functionality, all client side!
If you're still unfamiliar with what AJAX is, read this and this article.
It's not online as I write this, but you can signup on the main page to be notified when it's released. I just spoke to someone from BackBase and he said they'll be uploading it any time now soon. They also have a .NET enabled version of their library, I don't know if it's included in this free community release though.
Go here to see their website.
A few days ago I've watched a webcast by Brian Button on refactoring. For the most part, he introduces refactoring to the viewer and gives some good examples of why you should refactor and how it's done. He uses Resharper and the examples really make you want to use the tool. Too bad I'm still using VS.NET 2001 at my current project.
Anyway, the reason why I decided to blog about it is because of some code I just ran into.
public string AddData(DataRow dr, DateTime date)
string msg = "";
SqlParameter paramColl = new SqlParameter;
paramColl = new SqlParameter("@date",SqlDbType.DateTime);
paramColl.Value = date;
paramColl = new SqlParameter("@z_1d",SqlDbType.Decimal);
paramColl.Value = dr["1d"];
paramColl = new SqlParameter("@z_1w",SqlDbType.Decimal);
paramColl.Value = dr["1w"];
I simplified the name of the method to add to the effect. But as you can see, there's room for refactoring. You might want to start with the naming if your variables. As a developer you immediatly can see the parameter date is of type datetime. So you don't really need to specifiy this concerns a date, as that's crystal clear! I'd rather know the function this parameter has. Why do I have to supply a date to this method? And what data should the DataRow dr contain? Something you have much less worrying about when using objects. Heck, this would have not been written if an O/R Mapper had been used! ;-)
Go view the webcast if you're haven't got that much experience with refactoring. You'll learn a lot. Find the replay of the webcast here.
Microsoft just introduced a video on Channel9 about the new file format for Office 12, which is to be released in the future. Word, Excel and PowerPoint will be able to use the new format. You can view the presentation here, but in short, this is what the file format offers:
- New extensions
The old .DOC, .XLS and .PPT will become .DOCX, .XLSX and .PPTX. Whereas the change from Office 97 to the new file format in Office 2000 didn't change the extension, users weren't able to tell in which format a document was. This explains the change in extension.
The new format will of course be XML, but not like it is in Office 2003. In 2003, everything was in one document, whereas in the new format, every separate part of the document will be stored in a different xml file, that contains references to other documents. For example, a PowerPoint document will contain a base XML file that has references to all the slides, that are stored in additional XML files.
They are able to use multiple files because Microsoft stores it in a ZIP container. You can rename the document it's extension from .DOCX to .ZIP and open it up with your favorite zip archiver. The reason for zip is that it's a widely known format and everyone's already using it. Both users and developers and other tools.
The zip containers contain multiple directories, where the different files are stored. If you include for example a .JPG file, it's stored outside the XML file, inside the zip container. You can open up the zip, find your image and can easily replace it by another picture, without opening the entire Word document.
- Old Office upgrades
Both Office 2000, Office XP and Office 2003 users will be able to upgrade their version via a free download to be able to use the new XML File Format.
When you're developing and create, for example, Word documents, you can validate your documents against schemas to see if Word can open your document.
Everything is open and easy to use. For developers, the new format should be much more easy to understand and use then the old format. Microsoft had either never thought that developers wanted to create Office documents by hand, or didn't want them to. The current binary format is a simple memory dump of the document onto disk, and therefor very hard to open and change inside your own code. The new file format is as open as can be and everyone can use it in their application.
- Desktop search
As many parts of the document are split up into different files inside the container, there are a lot of possibilities for users and search engines to specify exactly what their looking for.
Microsoft is very excited about the new File Format and will be listening to comments from you in the future. I'm not easily excited about Word documents, but it will be nice to use the new format to create documents from inside my applications. Right now we almost always choose to create Acrobat Reader documents because of the troubles you can run into when using Word documents.
After post 200 was about RotS, post 201 is about voting NO! today. I cannot believe why still so many people want to vote for the proposed constitution.
Some reasons, according to our government, who's always trying to be the best kid in class, where the class is the EU:
- If we vote no, there will come a war.
- If we vote no, the economy will fall down for exactly one year.
- if we vote no, the Netherlands will look really bad in Brussel
- Because of the EU, Germany and France haven't been at war for 60 years. The EU accomplished that.
- If we vote yes, we will not become a small part of a superstate, dominated by France, Germany and Britain.
Where Chirac could tell his country and people they would benefit from the new constitution, our government hasn't given us any clear clues as to what we will benefit from it. From the beginning, they have had arguments that should make us fear a no vote. A quote from CNN : Although the politicians want us to vote "Yes", we don't know why, they don't explain much," says one Dutch person."
Back to the reasons to vote. Of course these are all very not true. The first two have been confirmed by other politicians, a war will not be started just because of us voting no, and the economy won't fall because of a no. But how about the second? Will we look bad in Brussel? Another quote from CNN : "The Netherlands is one of the bloc's founding members and is a nation accustomed to saying yes -- on such matters as Amsterdam's infamous sex parlors and legalizing drugs."
I cannot remember ever saying yes to those topics. But besides that, everyone expects us to say yes, because they're used to that. Will voting no make the Netherlands look bad? I think not! It makes people look at us and the EU differently. Another quote from CNN : "The result raises profound questions for all of us about the future direction of Europe. About the challenges in the rest of the world and the ability of Europe to respond, "says British Foreign Minister, Jack Straw." I'm not really sure that this is positive, but at least they're thinking again!
Then reason number 4. It's ridiculous! Whoever thinks that is the or a reason to vote yes, should first explain me how it is possible that England and the Dutch haven't been at war since 1784. That's for over 200 years! We didn't need the EU for that, did Germany and France need the EU for not going at war with each other? And would they also dare to say that if the EU was setup before 1929, the second world war wouldn't have happened as well? The arrogance!
The last reason then. There are so many examples that this is not true. For example, Rick van der Ploeg. Former "staatssecretaris" of culture. What value have statements by him? Be sure to know he teaches economics in three EU countries, Italy, Britain and the Netherlands. As an extra, he went for the role of "Europees commissaris" for the Netherlands, but didn't get the role. :-) Anyway, when interviewed by a large newspaper in The Netherlands, he was asked what he thinks of the fact that the constitution determines that countries can't provide Eurocommisionaries anymore. He responded : "That is a logical effect of the close corporation. In The Hague is the Dutch government, and nobody is questioning whether there's someone from every province in our country in there. That's how you should look at it." And that's the thing I'm afraid for! That we just become a part of a large superstate. Because...
When, in the past, Chirac and Schröder didn't like the guidelines by Dutch eurocommisionary Bolkestein about free invisible trades, they had a private chat. Afterwards, Chirac openly declared : "The principle of his guideline (...) was not acceptable. Both France and Germany have made that clear in Brussel, and so the guideline doesn't exist anymore." And that's how it's currently going, my friends. This cannot improve, but will only get worse in the future.
Two other reasons I have to vote a no:
- The Netherlands pays relatively the most money to the EU. Our government promised us to do something about it with the new constitution, but failed to do so. Only some vague guidelines were submitted. And when we take a look at the rules about every EU country it's budget deficit, we all know what happened to those in the past. And those rules were/are clear!
- It has become clear that we should've never agreed on the Euro or at least how our own currency was rated.
I think I've made my point clear: NO!