On Snow Removal and Garbage Collection

(Cross-posted on the Staten Island Libertarian Party web site.)

Like most people, I struggled to get around after the snow storm hit. On Monday Dec 27, I checked the MTA web site, which said “Good Service” for all express bus routes. Walking to the bus stop (Arden Ave & Drumgoole Rd), I saw one bus, stuck at the intersection, unable to get up the hill at Arden Ave. I then walked to the train station. The platform was nicely shoveled, and the waiting area was open, and there were signs that a train came by at some point (the rails themselves had little snow on them). No sign was posted about services (or lack thereof). After about an hour, myself and other people waiting started to give up. One person, after repeated attempts, got through to someone at the MTA, who said service wasn’t running at all, and they have no idea when it will be running. I stopped . . .

→ Read More: On Snow Removal and Garbage Collection

Create your own .pfx file for ClickOnce

Today, I needed a PFX (public key file) to sign a ClickOnce deployment. I spent a fair amount of time trying to figure this out, so I figured I’d share it!

There were plenty of suggested solutions out there, but the best one was from MSDN blogger Maxime Lamure.

In short, do the following, replacing MyCert with the certificate file name (without extension), MyName with the name you want on the certificate (your name, or a company name), and password with the public key password.

Open a Visual Studio Command Prompt. If using Windows Vista or Windows 7, be sure to run as Administrator.
Create your certificate (.cer) file by typing: makecert -sv MyCert.pvk -n “CN=MyNameMyCert.cer
Create your public key (.pfx) file by typing: pvk2pfx -pvk MyCert.pvk -spc MyCert.cer -pfx MyCert.pfx -po password

At the end, you’ll have your very own certificate file and public key!

. . .

→ Read More: Create your own .pfx file for ClickOnce

The cost of mandating rear-view cameras on cars

(Cross-posted on the Staten Island Libertarian Party web site.)

This morning, I read a news headline from the LA Times which read, “Rear-view cameras on cars could become mandatory.” An excerpt follows.

The federal government wants automakers to install back-up cameras in all new vehicles starting in late 2014.

The plan, announced Friday, received a strong endorsement from insurance industry and other analysts and is likely to get some level of support from car manufacturers.

Of course car manufacturers will support it; it brings in significant revenue. The same article states, “The rear-view camera system adds about $400 to the price of a Ford.”

As per the Bureau of Transportation Statistics, new car sales have averaged around 7.5 million per year for the past ten years. 7.5 million cars at $400 a pop is an additional $3 billion a year. Granted, technology will reduce the cost of implementation, but . . .

→ Read More: The cost of mandating rear-view cameras on cars

MVC model validation with Castle Validator

The ASP.Net MVC framework comes with built-in model validation using the Data Annotation validators. Unfortunately, the Data Annotations aren’t as robust as other validation libraries, such as the Castle Validators.

Implementing a custom model validator (for server-side validation — client-side validation requires more than is covered in this post), you need to write an implementation of the ModelValidator and ModelValidatorProvider classes that support the Castle Validators.

An example of how to do this follows. Though it hasn’t been fully tested, it worked for a handful of situations I experimented with. Use this as a starting point for your own server-side model validator implementation. . . . → Read More: MVC model validation with Castle Validator

Installing and configuring memcached and PHP on Windows

After upgrading the CSFBL forums to vBulletin 4.0, I noticed that performance was slightly worse than in the previous version. A little searching revealed that vBulletin supports memcached (an in-memory distributed caching system). Since I’ve got RAM to spare, I figured this is worth a shot.

Unfortunately, getting memcached running on the server (Windows Server 2008 R2 64-bit) took a few tricks, and getting memached running through IIS/PHP was another. To help other people through the same process (and to remind myself in the future), I’ll share the installation and configuration steps that worked for me below.

Downloading and configuring memcached

The official distributions of memcached are written for Linux systems, so the first task is finding Windows binaries. The memcached project site, fortunately, has links to Windows binaries, which are hosted by NorthScale. Both 32-bit and 64-bit versions are available.

(Note that NorthScale also offers their own . . .

→ Read More: Installing and configuring memcached and PHP on Windows