Category Archives: Programming

NDesk.Options

Parsing command-line arguments can be deceptively tricky. Often it starts as something very simple to do manually, but as more arguments and formats and flexibility are desired, the effort required to do it well can explode. So there are several … Continue reading

Posted in Programming | Leave a comment

Write MSMQ Messages from PowerShell

This PowerShell script sends a message to an MSMQ. I did it this particular way because NServiceBus can consume messages sent like this. [Reflection.Assembly]::LoadWithPartialName(“System.Messaging”); $queueName = ‘.\Private$\your.queue.name’; $queue = new-object System.Messaging.MessageQueue $queueName; $utf8 = new-object System.Text.UTF8Encoding; $tran = new-object System.Messaging.MessageQueueTransaction; … Continue reading

Posted in CodeMinder, MSMQ, PowerShell, Programming | 1 Comment

Read MSMQ Messages from PowerShell

This script dumps the contents of an MSMQ to the console. This one dumps the Journal contents of a private queue; of course you’ll have to adjust that line for your queue. [Reflection.Assembly]::LoadWithPartialName(“System.Messaging”) $queueName = ‘.\Private$\your.queue.name\Journal$’; $queue = new-object System.Messaging.MessageQueue … Continue reading

Posted in CodeMinder, MSMQ, PowerShell, Programming | Leave a comment

JavaScript: this and that.

This is a brief description of a technique recommend by Douglas Crockford, probably in Act III of his JavaScript video series. Code that looks right, but is wrong: There are a few workarounds; the one Douglas Crockford recommends is to … Continue reading

Posted in JavaScript, Programming | Leave a comment

Don’t use BR for vertical spacing

Use CSS instead. When <br> is used for vertical spacing it drives me crazy. Among my coworkers it is widely known that I don’t approve of <br> abuse. One recently wrote in a source control commit comment, “Removed some nasty … Continue reading

Posted in HTML, Programming | Leave a comment

More Semantics

Focusing on semantics instead of the technical has application beyond CSS. Amazingly, a few hours after posting my last bit on Semantic HTML, a coworker noted the following in a code review: Small lie: .indent16px{ margin-left: 15px; } I don’t … Continue reading

Posted in HTML, Programming | Leave a comment

Semantic HTML

There’s a lot of literature about “semantic HTML” on the web (here’s one person who writes about it a lot). The best short advice I know of to get jump-started on this topic is from a page on W3C.  I’ve … Continue reading

Posted in HTML, Programming | Leave a comment

Paradigm Shift: from Request/Response to Publish/Subscribe

Since attending Udi’s ADSD class about a year and a half ago, the publish/subscribe pattern in general has been fascinating for me to consider at many levels.  In some ways it’s a fundamental shift in the way we program. When … Continue reading

Posted in CQRS, DDD, Programming | Leave a comment

How to Teach Data Types

I received this email from Terry Palmer, an instructor of CIS at Mayville State University.  As a software development professional, the preparation of new graduates in this field for real world work provided by mainstream universities has often been very … Continue reading

Posted in Programming, Programming for Kids | Leave a comment

CodeRush FTW: Reorder Attributes

Check out this code block within an ASP.NET forms application: It’s quite wide, and the repetitive attributes that I mostly don’t care about are left-most.  It’d be nice to move the “runat” and “EmbedInDiv” attributes to the end of these … Continue reading

Posted in CodeRush, Programming | Leave a comment