October 2007 - Posts

Arrays in PowerShell
23 October 07 08:39 AM | john | 0 Comments   
While I'm waiting for some files to copy around I thought I'd record my recent PowerShell learnin'. Somtimes a command, like Get-ChildItem can return either an array of results or just a single one. You can use the @ symbol to cast the result into an Read More...
Filed under: ,
Line Count with PowerShell
22 October 07 08:35 PM | john | 0 Comments   
Starting to get the hang of PowerShell. Today I wanted to quickly count the number of lines in some source code. There's a simple implementation and then there's a better one . In the end I settled on: $count=0;gci . -i *.cs,*.cpp,*.h -r | %{$count += Read More...
Filed under: ,
More PowerShell Fun
17 October 07 11:33 AM | john | 0 Comments   
Still struggling to gain traction with PowerShell. I've stopped myself running the CMD prompt by default, and I've installed it on all my test VPC machines. Firstly, I recommend you download the Windows PowerShell Graphical Help File . It's an old school Read More...
Filed under: ,
Changing the Desktop Wallpaper Programmatically on Windows
12 October 07 01:39 PM | john | 0 Comments   
My friend Scott asked me the other day how he might go about changing the desktop wallpaper programmatically. It's one of those things that is still buried in the native Windows Win32 API. The call you need is SystemParametersInfo and the action you need Read More...
Filed under: , , ,
The Singleton Pattern in .NET and C#
11 October 07 09:18 AM | john | 0 Comments   
I just got bitten by a static initialization problem - again. There are two things you've got to be careful of in .NET when using statics (i) threading issues and (ii) initialization ordering issues. I'm not going to go into a great long discussion about Read More...
Changing the Windows Log On Keyboard Layout to Dvorak
03 October 07 06:15 PM | john | 0 Comments   
If you found this entry, you are either a Dvorak keyboard typist searching for help or you are a strange individual who reads my blog but never leaves a comment. If you are the former then the link you are looking for is to this Microsoft Help & Support Read More...
Filed under: , ,