Rick van den Bosch .net – part II

It’s been a while because I’ve been so busy lately, but the next (technical) step for my personal  website is now online. When browsing to http://rickvandenbosch.net/blog/, the content of my blog here is displayed sort of mirrored over there. I used an OpenSource RSS component to read my private rss feed from blogging about, and display it from there.

There’s still a lot of work to be done (like styling!), but I’ll get there. Eventually…. ;)

If you’re interested on the how and the what: I’ll post the source code online as soon as the entire website is ‘ready’. At this rate, it might take a while, so if you can’t wait: contact me

Technorati tags: ,,,

‘EntLib Extensions To WSSF’ released to CodePlex

Some of my (Dutch!) Avanade colleagues recently released ‘Entlib Extensions To WSSF’ to CodePlex. Quite a cool addition to the already rich Enterprise Library.



Entlib Extensions to WSSF (Web Service Software Factory) is an extension that enables WSSF to easily integrate with Enterprise Library. This extension allows you to very easily handle cross cutting concerns in WCF services like Validation, Exception Handling and Logging without much programming. The extension accomplishes this by using the policy injection application block of enterprise library.


Have a look at it over at the CodePlex page: EntLib Extensions To WSSF

Other info:
Web Service Software Factory
Enterprise Library 3.1


Blu-Ray coming to the Xbox 360?

I’m not entirely sure about the article on Digitimes. One of the reasons is because it was posted on April first. Another reason is the way it is written. But if it turns out to be true, I’m going to have to get a Blu-Ray player for my Xbox 360… ;)

A quote from the article:



Lite-On IT is developing built-in Blu-ray Disc-(BD) ROM drives for the Microsoft Xbox 360 game console, according to industry sources. Lite-On declined to comment, citing client confidentiality.
Lite-On’s shipments of the BD ROMs to Microsoft will start in the second half of 2008, the sources added. Lite-On is currently one of the suppliers of Xbox 360-use internal DVD-ROM drives.


Read the entire article over here (you be the judge…): Lite-On developing BD-ROM drives for Xbox 360, sources say

Update:
Microsoft has denied that Lite-On is developing blu-ray drives for the Xbox. And I guess that makes the Digitimes article just another rumour about blu-ray and Xbox 360. But… they are not denying they’re coming with a blu-ray drive ;)

The article starts out with:
Microsoft has insisted that Lite-on will not be making Blu-ray drives for its Xbox 360, despite widespread internet rumours to the contrary.

Read the full article at TechRadar: Microsoft: Lite-On NOT making Blu-ray drive.

Getting the ModalPopupExtender to work in SharePoint 2007

Getting the ModalPopupExtender from the Ajax Control Toolkit to work (decently) in SharePoint was not exactly a walk in the park. With a default SharePoint installation, the modal popup is partly positioned ‘outside’ of the page (you only see the bottom right part of the popup in the top left corner of the browser). Postbacks are not executed or executed poorly and the page gets garbled up. A possible solution for the positioning of the popup is to set the X and Y property of the ModalPopupExtender. Downside is you never know (for sure) if the popup is positioned inside the visible part of the browser because of things like non-maximized browser, different resolutions and so on.
Today we seem to have solved our issues with the ModalPopupExtender in SharePoint. We haven’t tested it in all scenario’s yet, but we’ll get to that. At this point everything looks the way it is supposed to. And it seems to work, too… ;).

The extra steps we took to make these two play together the way we wanted them to, besides the usual steps to make Ajax work in ASP.NET 2.0, are:

* Because of our setup with close-images that postback (because we have to clear controls and that sort of stuff) and more, we couldn’t use the TargetControlID property for the ModalPopupExtender. Well, we could, but that would result in the background not being displayed properly half the time ;). This can be solved by setting the TargetControlID to a dummy control (like a hidden one) and showing the popup from code.

** We have a usercontrol with several usercontrols in it. This one usercontrol (the parent) was added to a page. The normal (postback) controls on the usercontrols didn’t work after one of the modal popups was shown. And I can image neither would any other ‘normal’ controls on the page, but we didn’t encounter this scenario. The problem was the page would freeze with a message in the taskbar stating ‘The page is busy submitting data to the server’ directly after an Ajax postback. The controls that performed a ‘normal’ postback did nothing: the serverside code just was not executed. We solved this by putting an updatepanel around everything inside the usercontrol. That way the normal controls would postback in an ajaxy way too, apparently solving the ‘The page is busy’ message.

We’ll be testing this solution over the next few days. If any problems pop up, I’ll keep you posted.

New feature: subscription by e-mail

It is now possible to get updates from this blog through e-mail (nice feature, feedburner). Updates will be sent once a day, but only when new items are available.

Curious? Subscribe here!

By |March 12th, 2008|Blog, Link|0 Comments

I8 converter – Download (sourcecode available)

One of my colleagues pointed out the new Fine-grained password policy feature in Windows Server 2008. As you can see in this post at The Sean Blog, some values have to be entered in the I8 format, which isn’t very user friendly. Because of that, he asked me if I could whip up a tool that converts days, hours, minutes and seconds to the I8 format. I quickly put together this small tool for him. It hasn’t been tested extensively, but I think it might be of some use to some of you.
For example, I used longs to store the info. When wanting to calculate huge values, this won’t work of course. This could be improved by using the multipliers divided by for instance 10,000,000 and add the appropriate amount of zeros (7) to the string after calculation, so the numerical value stays a lot smaller. Still, I think it does what it should do at this point. You can find the sourcecode over here, or if you would like te change anything: be my guest. Let me know if you find bugs or add cool features: I would like to know.

Info taken from Technet:

When you use the ldifde command to create PSOs, you must enter the values of these attributes in I8 format, which stores time in the intervals of -100 nanoseconds. (Schema: attributeSyntax = 2.5.5.16 (I8).) Windows Server 2003 Default Domain Policy employs this exact time unit for its corresponding time-related attributes. To set these attributes to appropriate values, convert time values in minutes, hours, or days to time values in the intervals of 100 nanoseconds, and then precede the resultant values with a negative sign.

Links
Tool: http://www.rickvandenbosch.net/downloads/I8Converter.zip
Source: http://www.rickvandenbosch.net/downloads/I8Converter Sourcecode.zip

Update
Because of a hosting shift, the tool is no longer available from the above locations. When interested: drop me a line. I’ll see if I still have the app/sourcecode floating around somewhere.

(Single-Entry, ) Single-Exit, my 2 cents

As a reaction to this article at Peter Ritchie’s MVP Blog, I thought I’d give my two cents on having a single exit point for methods. Here we go…

When writing code, I always create only one exit point except for the occasional throwing of an exception. Most important for me is to always know where your code (really) stops. In case of long and complex methods there’s a chance you’re going to miss a return statement when scanning through a method. That way you could end up studying code not even applicable to the situation, while missing the real point. I do think there is no real reason to hold on to creating methods with a single exit point other than personal favoritism. This feels the same like using curly brackets with an if-statement that is followed by only one statement. I always use curly brackets, but there are lots of developers who don’t.

To answer the questions at the end of Peter’s post: Yes, I do generally follow the Single Point of Exit From Methods Principle, and I do ignore it for exceptions.

BTW: the SESE version of the first method in Peter’s post could be a little less (cyclomatic) complex:

public static int CountCommas(string text)
{
    int result = 0;

    if (!string.IsNullOrEmpty(text))
    {
        int index = text.IndexOf(‘,’, 0);
        while (index > 0)
        {
            result++;
            index = text.IndexOf(‘,’, index);
        }
    }

    return result;
}

Now available: PowerCommands for Visual Studio 2008

One of the most annoying things in Visual Studio (to me) was the fact that complete solutions (solution folders, projects, regulare folder)  would be expanded upon opening. And with big solutions, that isn’t too much fun. There are macros available online, but the ones i found were pretty slow. This is only one of the things that the PowerCommands for Visual Studio 2008 solves for you. But there is more. Much more!

A quick top five of my favorite functions:




  • Collapse projects


  • Copy & paste references


  • Open Command Prompt (at the location of the file you execute it on)


  • Remove and Sort Usings (for all classes in a C# project)


  • Close All (on a tab)

To get the PowerCommands for Visual Studio 2008, or to learn more about all the features in there, visit them over here.

By the way: this fairly new website (the Visual Studio gallery) was released quite silently by Microsoft. It contains lots of products that aid developers while working in Visual Studio, together with some Extensibility stuff. Have a look over there! Another tip: the VSX team blog. It might be a nice one to keep track of new releases of new Extensibility products. There’s a post over there about the PowerCommands, too.

Enjoy!

Windows Live SkyDrive now available

Just a quick post: Windows Live SkyDrive is now available. It left the beta stage yesterday. You can now store 5Gb of data online, choose who has access to each folder you create and more. There is a maximum filesize of 50Mb.

Interested? Have a look at http://skydrive.live.com/

By |February 22nd, 2008|Link|1 Comment

Hooray (x 2) for MSDN library Community content

There are several steps to creating a custom web service to be hosted in SharePoint. The MSDN library has a walkthrough on creating a custom web service. After having followed this walkthrough thoroughly, I though my web service was good to go. Unfortunately all I saw was an error: “Could not load type ‘ThisAndThat’ from assembly ‘SoAndSo'”. Just as I was about to search for an answer somewhere online, I remembered that the MSDN library features the Community content for little over a year now (hooray!).

At the bottom of the walkthrough were some community additions to this specific walkthrough. Some have been incorporated in the main article, others are there to be found for guys (and girls!) like you and I. One of them exactly described my problem. In that same community content item another user had added this comment:
HI – I resolved this issue with a VB.net service by prefixing the class name in the .asmx file with the assembly namespace
And that was it! The WebService works like a charm, hosted in SharePoint. (hooray!)

So there you have it: that’s the power of [wikipedia:web 2.0] for you. Users benefit from the fact that they are now able to add to the otherwise pretty static information in something like the MSDN library. ;)

By |February 1st, 2008|.Net, HowTo, Link|0 Comments