4/17/2008
Sometimes you need to build some user input validation on your website. Often I see people using String.Length() and StartsWith/EndWith constructions to check the entered values. Ofcourse this will work, but often this could also be done with Regular Expression. When I ask them, why they do it without this powerful tool they tell me: ‘It works this way and RegEx is way too difficult’.
They have a point when reading a RegExpression for the first time. Often it’s the best way to learn something, by just doing it and playing with it. Last week a saw a tool that is called the regex coach. This enables you to check your RegEx dynamically, without compiling code. So excellent to learn how to write your expression.
You can download this tool from the Regex Coach website.
Tip 1: there is a website called RegExLib with frequently used regular expressions. You don’t want to invent the wheel over and over again. (Like a RegEx for e-mail address validation)
Tip 2: It also contains a cheatsheet.
Good luck with building your creative regular expressions!
4/16/2008
Sometimes you discover something that is already existing for some time but you haven’t been aware of. I was studying for MCTS certification and I discovered the Nullable type. With this you can assign boolean of datetime objects the NULL value. It’s use full when you want to declare types but leave them unassigned (and check later).
This is the code sample:
1: //Normal notation
2: Nullable<bool> b = null;
3:
4: //Shorthand notation
5: bool? b2 = null;
6:
7: //Since it's nullable, you have 2 new value members:
8: // HasValue and Value
9: if (b.HasValue) Console.WriteLine("b is {0}", b.Value);
10: else Console.WriteLine("b is not set");
11:
12: //Throws exception:
13: //Console.WriteLine("b is {0}", b.Value);
14:
15: //Outputs 'b is '
16: Console.WriteLine("b is {0}", b );
17:
18: b = true;
19: //Outputs 'b is True'
20: Console.WriteLine("b is {0}", b );
This is available since .NET framework version 2.0
1/25/2007
Wouldn’t it be nice to have something like this:

You can use this technique for any command line or batch file you want to attach to the Explorer context menu.
-
Add a key (any name and content appears to work) to HKEY_CLASSES_ROOT\Folder\shell.
-
Below that add a key “command” and set the text to be whatever command you want executed. I copied the command line from the .NET 3.0 SDK “CMD Shell” (see registry export listing below), but you could use any command line entry. The nice thing about the .NET 3.0 cmd shell is that it sets the environment so you can access svcutil.exe and other 3.0 specific utilities.
Registry export listing:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\Command Prompt]
@=”.NET 3.0 Command Prompt”
[HKEY_CLASSES_ROOT\Folder\shell\Command Prompt\command]
@=”C:\\WINDOWS\\system32\\cmd.exe /E:ON /V:ON /T:0E /K \”C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0\\Bin\\SetEnv.Cmd\”"
BTW: If you’re running Vista then you’re in luck, it’s built-in!
1/18/2007
My Web Pages Starter Kit (MWPSK) is an open source ASP.NET 2.0 project. It is hosted on the CodePlex portal. Normally starter kit’s are not ready to use products, but this one is! It’s a simple file based CMS, which is really easy to extend. Out of the box MWPSK contains the following modules:
- Building blocks:
- HTML
- Events
- Links
- Guestbook
- Contact form
- Downloads
- RSS
- Image gallery
- Multilingual
- ASP.NET 2.0 based, so features like Masterpages, Themes, Navigation, Membership are there.
- File-based, no database necessary. Easy to backup (just copy .xml files in data dir)
- Open source
- Secured admin section to maintain your site (multi-user)
MWPSK homepage: http://www.codeplex.com/MyWebPagesStarterKit
Download MWPSK
1/15/2007
For a project I am investigating the possibilities of the new Microsoft Office 2007 for Sharepoint Server (MOSS2007 in short). Basically Moss uses Windows Sharepoint Services 3.0 (WSS) for collaboration as a basis.
Here’s a link dump:
Always a useful tool for webdeveloping is the IE developer toolbar
1/4/2007
The Patterns & practices Guidance Explorer is a nice application helps you using best practices. The Guidance Explorer provides a database of recommendations and best practices for ASP.NET, ADO.NET, and the .NET Framework that you can easily filter and search. Particularly useful are some of the checklists you can easily follow for performance and security best practices prior to deployment.
You can create custom views of the library of just those recommendations you care about. What is cool is that you can now also easily publish these custom views to your friends or other members of your team.
1/3/2007
On the DevDays 2006 I saw a session where Scott Guthrie was talking about Atlas (former codename for ASP.NET Ajax). I was intrigued by his way of enthiousiasm about new technologies. Since then I visit his blog once in a while, better: RSS keeps an eye on him :-).
He has a nice section about ASP.NET 2.0 Tips & Tricks that I would like to recommend.
Also a nice site to remember is the ASP.NET Videos page.
1/2/2007
Are you a guru in Regular Expressions? I am not really either. Most of the times I can handle it with a simple expression (or 2) to solve my issues. Today I came across a great site with a repository of RegExp’s. You can browse patterns, test your own newly made ones and use cheatsheet building them. Very nice and maybe a life saver.
8/18/2006
Simian is a Similarity Analyser that detects duplications in source code (java, C#, C, C++ ASP, XML etc); once detected you can easily locate the duplication and refactor it. Simian runs natively in any .NET 1.1 or higher supported environment and on any Java 1.4 or higher virtual machine, meaning Simian can be run on just about any hardware and any operating system you can hope for.
For integrating it in VS2005, read this post from Howard: http://blogs.conchango.com/howardvanrooijen/archiv…
When you want also clickable links in the output, you can try the tool MonkeyWrangler..
Have a nice weekend!
8/16/2006
There are a lot TOP 10 lists for developers available. This is a list that breaks down the questions in different skill levels. Very nice.
What Great .NET Developers Ought To Know (More .NET Interview Questions)
Update: there are some answers in other blogs, since I didn’t know all the answers right-away:
Part 1, Part 2 and Part 3