Frank 的个人资料Frank de Groot日志列表 工具 帮助
12月29日

My smart girlfriend

With the advent of Vista and the urge to install Ubuntu I decided to buy another hard disk. I couldn't resist buying another 150 Gb Raptor, of course totally overkill but that's not the point I wanted to make...
 
As I was trying figure out how to get the hard disk into the bay, my girlfriend walked in, stared at it blankly for a few seconds and then said "Can't you take out the whole bay?". When I looked more closely, it turned you she was entirely right!
 
Looks like she saved me some serious time trying to get the motherboard out of the way. Go girl!
12月26日

Finding your tools

I finally found a tool to download big files from my employer's intranet through the VPN. The VPN connection gets killed after some time, so it must be restartable. Today I found Robocopy included in the Windows Server 2003 Resource Kit Tools.
 
Then I used 7-Zip to scoop out robocopy.exe from the self-extracting .exe and the contained .msi. So no need to install anything.
 
Thank you Microsoft and thank you 7-Zip!
12月24日

NBear

Browsing CodePlex I found NBear, an ORM framework for .NET 2.0. Interesting? Well, I'll be damned if I know: apparently it's a chinese product; all the documentation and web sites are in chinese! Needless to say that diminishes my interest in the product somewhat...
12月22日

Human Methodologies 2

In another not-so-recent ARCast Lewis Curtis and Brian Derda explain their new methodology Perspective Based Architecture. Now, I'm not an architect and I don't have any experience with this methodology but I found it an appealing methodology because:
  • The basic idea is indeed very basic (what can be more basic than asking questions?),
  • The architects they intend to force people out of their comfort zone (especially useful to technical specialists),
  • and the questions also encourage people to collaborate (instead of just throwing documents over the wall).
  • They also emphasized that a strict timebox encourages people to prioritize the questions,
  • and be honest when they just don't know the answer yet.

Again a methodology with a strong social component. In my opinion methods like these have a promising future.

12月21日

Human Methodologies 1

Just recently I read the following paragraph in the book "Agile Project Management with Scrum" by Ken Schwaber.
 
I used to teach people the theory, practices, and rules of Scrum. Now I teach them what Scrum feels like as it is implemented. I teach them how to recognize when things are going right and when they are going wrong. I provide exercises and discussions that let them experience the epiphanies so that they know what Scrum should feel like. Just as you don’t really know what it’s like to be someone else until you’ve walked however many miles in his or her shoes, you might not fully understand Scrum until you implement it yourself. But as you read this book, you will begin to understand what Scrum feels like and how you might feel using Scrum in your organization.
 
How a project management methodology feels? That's what I like about the recent progress in software development, things like XP and Scrum I find more straightforward, pragmatic and most of all, more human than previous methodologies.
 
This is why I'm enjoying software development more than ever, power to the people!

Open XML in Office 2007 produces smaller files!

In a not-so-recent ARCast I heard that the new Open XML format for Office documents actually produces smaller files. After downloading the update for Office 2003 to create Open XML files I was surprised to see that this is actually true! A few tries produced files 5x smaller!
 
Amazing, an open format, much more accessible (for developers that is) format and smaller files too!
12月20日

Find & replace special characters in Word

I just pasted syntac coloured C# code from a Word document into the editor for this blog. The result was an empty line between each line of code, caused by a Paragraph tag. This in turn was caused by the Paragraph Mark which should be replaced by a Manual End of Line Mark (Shift-Enter).

 

To replace the Paragraph Mark with a Manual End of Line Mark in Word I tried to use find-and-replace ^v to ^| but Word couldn't find the Paragraph Marks, even though the ^v is inserted by a menu option on the same dialog (More / Special / Paragraph Character).

 

After googling I found this page explaining I should use ^13 instead of ^v. Odd, but it works!

Easier .NET Service installation 2

Also, removing a .NET Windows Service that is running under an account other than Local System/Local Service lingers in the list of services until a restart. Adding the snippet below in the project installer will reset the account to local system just before the actual uninstall. This neatly removes the service from the list.

/// <summary>
///
Overriden to set the user account to local service.
/// If set to custom user on uninstall the service entry lingers until a reboot,
/// when set to local service the entry is removed immediately.
/// </summary>
///
<param name="savedState">Only passed to base class.</param>
protected override void OnBeforeUninstall(IDictionary savedState)
{
      
this.serviceProcessInstaller.Account = ServiceAccount.LocalService;
      
base.OnBeforeUninstall(savedState);
}

Easier .NET Service installation 1

Below are two code snippets useful when creating a Windows Service in .NET.
 
Windows Services created as a .NET assembly are installed using InstallUtil. The code below allows installation and removal using the executable .NET assembly with the command-line options /i and /u respectively.
 

/// <summary>
///
The main entry point for the process.
/// Allows install and uninstall with command line option.
/// </summary>
///
<remarks>
///
Relies on <see cref="ProjectInstaller.OnBeforeUninstall"/> to set the user to local service
/// just before uninstall to prevent the service entry to linger until a reboot.
/// </remarks>
///
<param name="args">Command line arguments.</param>
private static void Main(string[] args)
{
      
if (args.Length > 0)
       {
             
string systemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);
             
string command = Path.Combine(systemPath, @"..\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe");
             
// Remove the 'file:///' prefix.
              string service = "\"" + Assembly.GetExecutingAssembly().CodeBase.Substring(8) + "\"";
             
switch (args[0].ToLower().Substring(1, 1))
              {
                    
case "i":
                           Run(command, service);
                           Run("net", "start Berichtensimulator");
                          
break;
                    
case "u":
                           Run("net", "stop Berichtensimulator");
                           Run(command, "/u " + service);
                          
break;
                    
default:
                           Console.WriteLine("Please specify '/i' to install service and '/u' to uninstall service.");
                          
break;
              }
       }
      
else
       {
              System.ServiceProcess.ServiceBase[] ServicesToRun;
              ServicesToRun =
new ServiceBase[] { new BerichtenSimulatorSvc() };
              ServiceBase.Run(ServicesToRun);
       }
}

private static void Run(string command, string args)
{
       ProcessStartInfo processStart =
new ProcessStartInfo(command, args);
       processStart.UseShellExecute =
false;
       processStart.RedirectStandardOutput =
true;
       Process process = Process.Start(processStart);
       process.WaitForExit();
       Console.WriteLine(process.StandardOutput.ReadToEnd());
}