skip to Main Content

WBR HTML Tag

The little known WBR tag is great for formatting HTML tables. Add it to specific places in your table cell values to give the browser the option to add a line break there. This is very useful when displaying tables with long strings that would otherwise cause horizontal scrolling.

Here’s a sample table, displaying some info. Since the values in the tables do not have spaces or tabs, the browser is forced to display the values on one line:

KeyValue
ChinhDo.TestApp.TestClass.ExampleKey1this.is.an.example.of.a.very.long.string

Here’s the same table, with <wbr/> tags inserted where periods are:

KeyValue
ChinhDo.TestApp.TestClass.ExampleKey1this.is.an.example.of.a.very.long.string

Getting the Starting Day of the Week for Any Date

From my code snippets, here’s a function that will return the starting day of the week for any date:

/// <summary>
/// Gets the start of the week that contains the specified date.
/// </summary>
/// <param name="date">The date.</param>
/// <param name="weekStartsOn">The day that each week starts on.</param>
/// <returns>The start date of the week.</returns>
public static DateTime GetStartOfWeek(DateTime date, DayOfWeek weekStartsOn)
{
    int days = date.DayOfWeek - weekStartsOn;
    DateTime startOfWeek = days>=0 ? date.AddDays(-days) : date.AddDays(-7 - days);
    return startOfWeek;
}

Transactional File Manager Is Now On CodePlex

It’s my first open source project! I’ve gone open source with my Transactional File Manager. Check out the CodePlex link here.

Use any file system as a transactional file system! Transactional File Manager is a .NET API that supports including file system operations such as file copy, move, delete in a transaction. It’s an implementation of System.Transaction.IEnlistmentNotification (works with System.Transactions.TransactionScope).

image

More on Transactional File Manager in my original blog post on it. If you are interested in contributing to the project, let me know.

MSMQ Installation on Windows Server 2008 Fail with 0x80070643

If you get one of these errors starting MSMQ Server or installing MSMQ on Windows (Server 2008), this article describes a potential solution:

  • You cannot start MSMQ Service with the following entry in the Application Event Log: The Message Queuing service cannot start. The internal private queue ‘admin_queue$’ cannot be initialized. If the problem persists, reinstall Message Queuing. Error 0xc00e0001.
  • You cannot install MSMQ with the following error: Attempt to install Message Queuing Server failed with error code 0x80070643. Fatal error during installation. The following features were not installed: Message Queuing Services/Message Queuing Server.

    MSMQ Installation Result

 

For me, the solution was to delete the Registry key KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ, then try the installation again.

See also:

Don’t hire ghost hunters who are afraid of ghosts

Your house is haunted. You can’t stand living with the ghosts anymore and decide to call in the professional, a ghost hunter. The ghost hunter comes, nicely equipped with all kinds of shiny ghost hunting equipment, and proceeds to immediately pass out and fall to to the floor with a loud thud at first sight of the ghosts.

Well, in a nutshell, that is the story of the new Event Viewer in Windows Vista and Windows Server 2008. The new Event Viewer looks very nice and all. Trouble is, it now won’t work when there is a syntax error in machine.config or other .NET Framework problems. Apparently, in Windows Vista and Windows 2008, someone at Microsoft decided to rewrite the Event Viewer utility (a perfectly usable and solid utility in previous versions of Windows) in .NET.

MMC could not create the snap-in. The snap-in might not have been installed correctly. Name: Event Viewer.

So, the lesson I learned from this is: don’t hire ghost hunters who are afraid of ghosts. Or, don’t write a utility designed to view monitoring and troubleshooting messages that can fail due to unnecessary dependencies. A critical system troubleshooting utility such as Event Viewer should be the last thing that fails.

What to do when you cannot run Event Viewer in Windows Vista/Windows Server 2008/or Windows 7?

If you get the following error:

MMC could not create the snap-in. The snap-in might now have been installed correctly. Name: Event Viewer. CLSID: FX:{b05566ad-fe9c-4363-be05-7a4cbb7cb510}

Try the following:

  • Fix any syntax errors in machine.config. Restore to a previously known working copy.
  • Rename EventVwr.exe.config in %WINDIR%\System32.
Back To Top