Frans Bouma's blog

Generator.CreateCoolTool();

Syndication

News




    Add to Technorati Favorites

About me

Fun stuff I created

My work

May 2006 - Posts

Mini-Microsoft quits!

Today, Mini-Microsoft, a blog by an anonymous Microsoft employee which got a lot of attention in the past, posted a blog entry that today's post is the last one...

Like I said before, for the near-term I will throw up the occasional interesting article or reposted comment. Perhaps that is all it takes given the number of excellent, good-looking people willing to spend time reading and contributing to the comments. And I'll continue to moderate comments just because occasionally something wildly offensive does show up in the pending queue. So does this mean that this is the end of Mini-Microsoft? For now, yes, but only my end of it. The rest is up to you.

It has always been unclear, at least for the people outside Microsoft, who was behind the blog. It's sad the blog stops, as its contents, together with the comments from other Microsofties, gave us outsiders some small glimpse how the life is inside Microsoft.

Posted Monday, May 29, 2006 10:24 AM by FransBouma | 9 comment(s)

Yay! A new Stored Proc vs. Dyn. Sql battle!

You'd think that by now everyone would have said everything that you can say about Stored Procedures vs. Dynamic SQL, but apparently Eric Wise and Jeremy Miller disagree with that and have started another iteration of this Never Ending StoryTM.

As it's Friday and you're probably looking forward to the weekend and wonder what to do till it's time to go home, sit back, get a soda or two and read yourself through the afternoon with the following Stored Procedure vs. Dynamic SQL masterpieces of all time :

If you still have some time left before the end of the day salutes you, google is your friend, as this fine topic has been discussed for decades by now.

(Update: added link to Rob Howard's old post, I lost the link but it was easy to find. Thanks Rob for pointing that out )

Posted Friday, May 26, 2006 10:03 AM by FransBouma | 21 comment(s)

How to skin a cat^H^H^H... blog!

So, now that we've this new CommunityServer 2.1 blog engine at our disposal here at weblogs.asp.net (Thanks guys! ), the big 'let's make my blog look better'-struggle begins again, as .Text skins don't work in CS 2.x for obvious reasons.

While some of the skins currently installed on weblogs.asp.net are nice (the paperclip ones for example), it might be, you want to have more something unique for your blog. Though, how to do that? Where to start? Well, here's a small list of tips to get you started. You'll find it very easy, if you use the right tools (but isn't that always the case? ).

Step 1: Pick a skin to start with.
This is the essential first step. Although you can go overboard and change everything from scratch, it's often easier to start by modifying an existing skin to your liking and eventually end up doing everything different.

Step 2: Download the Firefox webdeveloper extensions.
This thus applies also that you have to use Firefox for this job, however there might be an IE plugin which does the same thing, but I'm unaware of that. Download the webdeveloper extensions from this url: http://chrispederick.com/work/webdeveloper/. After you've installed the extension, you'll see a new toolbar. Don't panic, you can easily switch it off by going to View - Toolbars and uncheck the Web extensions toolbar.

Step 3: Open two Firefox windows, both with your blog visible.
You'll now use one to check which item to alter and the other one to see the result of your changes in real time. Ok, in window One we'll edit the CSS code in real time so you'll know what to copy over to your blog settings in Community Server. To edit CSS in real time, select under the 'CSS' button in the webextensions toolbar 'Edit CSS'. In the other we'll view CSS code as it is now. So in window Two, you'll select under the 'CSS' button 'View Style Information'. You'll get a crosshair cursor now. Try and click an element on the page, for example a link. A new tab will open with the CSS code which controls that element.

Step 4: Alter the CSS code
Ok, let's change something! In window One, you'll have a side bar at the left with 3 tabs. The first is 'style.css', which is the general CS 2.x stylesheet all skins will use. The second is the main CSS for the skin you've chosen. The 3rd one is the CSS which is sent by CS 2.x and which is filled with the CSS overrides you can add to your blog in the dashboard of your blog (the tab behind the control where you picked the skin for your blog). Typically this 3rd tab contains the file customcss.ashx. It's the 3rd tab you should add/change CSS in. All code you add there, you can copy over to the CS 2.x dashboard! So you can easily create a new skin by adding CSS code to the 3rd tab, see if it looks good, if it does, copy over the complete 3rd tab's contents to CS 2.x' dashboard and you have made the changes you need!

The advantage of this approach is that you can edit as long as you like, try things out, without having to worry that your readers will see the edits and changes.

To learn more about CSS in the case you're not familiar with how CSS works and what you can do, please go to this url: http://developer.mozilla.org/en/docs/Category:CSS:Getting_Started, though there are many many more resources available around the web about CSS and how to create beautiful webpages using CSS code.

Happy skinning!

Posted Thursday, May 25, 2006 1:07 PM by FransBouma | 6 comment(s)

Filed under: ,

Ok, RSS urls don't work yet.
There are some issues now with the RSS urls, which are not complete. More people have this problem at the moment, so I hope someone finds out what the cause of this is.

It appears a post only shows up in the main feed if it's tagged with a tag from a small set of tags. Understandable of course.

Posted Monday, May 22, 2006 2:02 PM by FransBouma | 1 comment(s)

Filed under:

Testpost
Test post, to see if this works. Apparently posting through w.bloggar does post the text here, but doesn't seem to propagate the post to the main feed...

Posted Monday, May 22, 2006 1:51 PM by FransBouma

Filed under:

Blog migated!

Last night, http://weblogs.asp.net has been migrated to CS 2.1, and this of course gives a lot more features to the blogs at this site, including this blog! The skin I had on the .Text powered version of this blog couldn't be migrated as CS 2.x works differently, so I picked this one from the skins available. I'll try to update this skin a bit later on, when I have more time ( at the moment it's a little hectic with LLBLGen Pro v2 in beta now so I hope to have a more custom skin soon, but when I'm not sure. )

Posted Monday, May 22, 2006 9:49 AM by FransBouma | 5 comment(s)

Filed under:

(.NET 2.) Dictionary(Of Key, Value) performance trick

(I used the VB.NET notation in the title so it won't nag about illegal characters like < and >)

In .NET 2.0 you'll have this new generic Hashtable variant called Dictionary<TKey, TValue>. It can be used as a Hashtable but now strongly typed and it doesn't use boxing anymore with value types. That's great and all, though there's one thing that's different from the hashtable: retrieving a value with a key that's not there. If the key value isn't present in the Dictionary, you'll get an exception when you do:

MyClass myValue = myDictionary[key];
and key is not present in myDictionary, while with the hashtable, you'll get back a null value. See my old blogpost about that.

What's often overlooked is a performance penalty with this pattern shift. Because of the exception, people will do something like this:

MyClass toReturn;
if(!_myDictionary.ContainsKey(key))
{
	toReturn = _myDictionary[key];
}
else
{
	toReturn = new MyClass();
}
Pretty obvious code, right? Well, ok, but it has a performance penalty which isn't that obvious: you'll query the key index twice: once in the ContainsKey call and once in the _myDictionary[key] call. If you query your dictionary a lot of times, even if the dictionary is fairly small, it will hurt performance. Better do:
MyClass toReturn = null;
if(!_myDictionary.TryGetValue(key, out toReturn))
{
	toReturn = new MyClass();
}
During profile sessions of my code I found a lot of these misusages in my .NET 2.0 versions of ported .NET 1.1 code. So, be smart, and do it right the first time with TryGetValue, it's your friend.

About the lack of blogging lately: I was very busy with finalizing the beta for LLBLGen Pro v2.0, which first beta was released 2 days ago. It's still pretty hectic, but I hope to have more time soon to blog more!

Posted Tuesday, May 02, 2006 10:52 AM by FransBouma | 6 comment(s)

Filed under:

More Posts