Archive for software

Forced builds only in CCNET?

I’ve been trying to setup CruiseControl.Net to only build a project when the ‘Force’ button is clicked.

After scouring the internet for the proper setup to do this, I don’t see any trigger that allows me to do this. I’ve setup a ScheduleTrigger that only allows builds at 9:00:00 each day, so right now there’s at least one build a day, but it’s just wasteful. I only want a build when someone specifically needs one, not at random times.

Does anyone know if this setup can exist in CCNET?

New Google Feature?

A couple weeks ago I noticed the gmail widget on my Google home page was adding check boxes to the side of each email that was displayed:

The check boxes were inconsistent – I could refresh the page and they would be gone, and then back again. I haven’t seen them since that one day a couple weeks ago. I’m hoping they’re adding some features to the gmail widget, like the ability to multi-select messages and delete them, or mark them as read.

No good deed goes unpunished

I love my MS Natural Multimedia Keyboard, I’ve used them for years, I even bought my own that I use at work.

I’ve had my keyboard at home for probably 4 years now and it was starting to get really nasty; there was lots of dirt and grime on/in the keyboard. I had half-assed tried to clean it in the past by just rubbing the grime off, but I decided recently to do it right. I unplugged the keyboard and used an alcohol swap to wipe the whole thing down and got it really clean, it was great.

I left it to dry for a couple days and used a backup keyboard in the meantime. After a few days I plugged it back in, on a day that I was working from home.

I am a big fan of Yahoo Music Jukebox, and I have it on when I’m working, especially if I’m at home. As I was working and listening to music, the volume would get muted off and on at random intervals.

After awhile this got really annoying and I started to pay attention to what was going on. Eventually I figured out that my left shift key was functioning exactly as the Mute key on my multimedia keyboard. It would capitalize my letters, and toggle the volume mute. Here are the different search terms I tried in google to find someone who had run into this before:

  • windows left shift key mute
  • windows shift mute
  • vista left shift key mute
  • vista shift mute
  • left shift mute
  • shift mute
  • vista left shift
  • windows left shift
  • left shift key mute
  • left shift key mutes speakers
  • shift key mute
  • shift key mutes speakers
  • shift mute
  • shift mutes speakers
  • shift mute volume
  • shift  = mute

It seems that NOBODY has had this happen to them before. I gave up and plugged in the backup keyboard, but I was annoyed. I had simply wanted to clean my goddamn keyboard, is that so wrong??

I tried fixing this issue again yesterday. I tried several key remappers but nothing was working, and not only that, but when you remap keys you need to reboot your machine for it to take effect so I was rebooting my machine a bunch too.

I finally found a solution that fixed my problem. I used SharpKeys to disable my multimedia Mute key, as well as remap the left shift key to the right shift key. I suspect that simply disabling the Mute key would have worked, but I didn’t want to tempt fate again, so I’ve left it as is, I never use the Mute key anyways, so I don’t care.

I also tried using KeyTweak which has the same ability to disable/enable keys and remap keys, but I never tried disabling Mute with KeyTweak, but I would guess that it works the same as SharpKeys.

Anyways, there you have it, if your left shift key suddenly starts muting your speakers, here’s your solution.

Deciding on Castle or Spring.Net

I’ve been comparing Spring.Net and Castle tonight to try and form an opinion about which one is better suited to use at work. I’ve used Castle MonoRail and ActiveRecord in the past and I’ve recently figured out dependency injection by using Castle Windsor, so I know what Castle offers.

After scouring the Spring.Net site I don’t see much difference in terms of functionality from either project as far my interests lie.

  • They both have an IoC container
  • They both have web frameworks (granted the frameworks are different, but they’re both better than WebForms)
  • They both have some sort of ORM capabilities

Spring.Net seems to use xml configuration a lot more than Castle and it also seems to have a ton more “stuff” in it, just based on sheer size of the documentation page. I’m not sure if this means that Spring.Net is a heavyweight framework or not. I definitely like Castle better when it comes to configuration (or lack thereof) and the availability of a programmatic API that can be used instead of xml, but that doesn’t mean that either framework has any functional difference, just a different way of getting there.

Can anyone tell me if theres something that I can do in either framework that can’t be functionally reproduced in the other? I’m mostly concerned with the Ioc, ORM, and web frameworks that each of these offer.

SlickRun and Remote Desktop

I’ve been using SlickRun for over a year now. It took some getting used to but now I can’t live without it.

I frequently have to use Remote Desktop at work to access our servers, especially in our dev environment, so I created a SlickRun keyword, ‘remote’ that opened up Remote Desktop.

This was great until I realized that I only really accessed a handful of servers, so I figured I could make life even easier by adding a keyword for each server into SlickRun and then pass the server name into Remote Desktop so it would just connect automatically. I’ve been using this method for about two weeks now, and its awesome.

Heres an example:

Using FxCop 1.36 with CruiseControl.Net

I’ve been trying to use the lastest FxCop release with CruiseControl.Net but I couldn’t get the output to work on the CCNET page with the FxCopReport.xsl file that comes with FxCop 1.36 Beta 2. The xsl file seems to get nearly all of the build report and writes it to the screen, which makes it unusable.

I tried the xsl file that comes with CCNET and it got a little better. The first assembly would show up in the list, but all the rules kept getting indented way too far, and none of the other assemblies showed up.

The CCNET xsl seemed to be closer to being correct so I decided to use that as a starting point and began mucking with the xsl to see if I could get the transform to work correctly.

The fix turned out to be as easy as commenting out the section titled “Rule Details”. That was hiding my other assemblies as well as messing up the indentation.

You can download the xsl file that I’m using if you’re having the same issue: FxCopReport.xsl.zip

UPDATE: Turns out the change I made was dumb and removed all the good details about the rules, I did a little more work and got that back in there correctly.

Improving SqlMetal with SqlPlastic

The Refresh Problem with LINQ to Sql

When the Orcas beta 2 came out this summer I decided to download it and take a look at the new changes in the IDE as well as check out LINQ.

After reading K. Scott Allen’s post about building a testable data access layer using LINQ to Sql, I wanted to finish his implementation. I was using a small database that I made at home to test out the data access layer, by using the visual LINQ designer in Orcas.

As I was playing with the designer I wanted to add a new column that I had added in the database. So I right-clicked on the table in the designer, looking for the “Refresh” command. I didn’t see it. I looked at the database level, not there either. I looked everywhere in the IDE, but there is no “Refresh” command because it doesn’t exist.

So the way you refresh a table in the designer is to delete it, and any column customizations you’ve done, and re-create it. This sucks. I frequently like to name my database columns all lowercase, with a “_” in between word (”customer_id” for instance), but I want my .net code to have standard .net names (”customer_id” -> “CustomerId”). So the visual designer is out.

SqlMetal

Next, I looked at SqlMetal. SqlMetal is a command line tool from Microsoft that you point at a database and it generates LINQ to Sql code based on the database schema, much like the visual designer does. There is an option in SqlMetal to instead generate a metadata xml file which can then be fed into SqlMetal to generate code based on the xml file. This got me thinking that if I could modify this metadata before it gets fed back into SqlMetal, I could rename my columns programmatically, which implies automation and consistency.

SqlPlastic

So I started working on my own tool, SqlPlastic, that wraps SqlMetal. SqlPlastic is a command line tool that takes arguments similar to SqlMetal. SqlPlastic runs SqlMetal on the specified server and database to generate the intermediate xml file. Then, SqlPlastic runs your custom actions, called “MetaDataTasks” that can modify the content of the xml file. After the custom actions are run, SqlPlastic runs the modified xml file into SqlMetal to generate c# or vb code.

You specify your custom actions in C# or vb class files, classes that implement SqlPlastic.MetaData.IMetaDataTask. At runtime, SqlPlastic finds all your custom classes and compiles them, then queries the assembly for all the classes that implement SqlPlastic.MetaData.IMetaDataTask, instantiates them, and executes them. This way your code is interpreted each time so you can make changes to your code and simply re-run SqlPlastic to see the changes.

The scenario that I had in mind when coding this was a continuous integration environment, where the persistence code gets generated during every build. The fact that SqlPlastic and SqlMetal are both command line tools makes them integrate easily into automated builds, and you gain confidence that your persistence code is current if you are constantly regenerating it.

As of right now, there are 8 built in tasks that SqlPlastic exposes for you to use:

Renaming Tasks

  • RenameTableTask
    • Changes the .net name of a Table.
  • RenameTypeTask
    • Changes the .net name of a Type. Database tables can have several types.
  • RenameColumnTask
    • Changes the .net name of a Column.
  • RenameAssociationTask
    • Changes the .net name of an Association .

Aggregate Tasks

  • AggregateTableTask
    • Iterates over all tables and applies custom tasks to each one.
  • AggregateTypeTask
    • Iterates over all types and applies custom tasks to each one.
  • AggregateColumnTask
    • Iterates over all columns and applies custom tasks to each one.
  • AggregateAssociationTask
    • Iterates over all associations and applies custom tasks to each one.

The way you use these rules is to create a new class that inherits from any of these rules and then simply set the necessary properties (for the Renaming tasks) or override ExecuteCore (for the Aggregate tasks). When SqlPlastic is run, it will find your custom tasks and compile and run them against the generated metadata.

Trying it out

SqlPlastic is hosted at Google: http://code.google.com/p/sqlplastic/

You can get the code at: http://sqlplastic.googlecode.com/svn/trunk

I haven’t put together a release yet, so you’ll have to download the code and open it in VS 2008 to compile it. Theres a unit test project that I maintain as well in there.

The code is all written in VB, but you can use vb or c# to write your custom tasks, you just need to specify which language you want to use by using the /language: command line switch.

I’d love to hear what people think of this, so please don’t hesitate to leave feedback, thanks!

MVC codename

By now most people have heard about the MVC framework that Microsoft is working on.

The one piece of information that I find crucial that hasn’t been answered though: what is the code name for this project?

We all know the final project will be called something lame like “Microsoft Front Controller Framework Extensions for ASP.NET”, so how will we know what we should really call the framework when its finally released?

Beer #3: Honey Steam

I finally got around to finishing my next home brew last week. I brewed the Honey Steam from Midwest Supplies. I also finished making my kegerator setup as well, which means I didn’t have to bottle this batch. Kegging the beer was a lot easier and faster than bottling, and I also didn’t have to wait one to two weeks to drink the beer like I would have with bottles.

  • Beer: Honey Steam from Midwest Supplies
  • 6/13: Beer gets brewed, (I forgot to take a reading when I brewed it, so I don’t know the initial gravity)
  • 6/21: Transferred from plastic fermenter to glass carboy, there was a lot of gunk floating on the beer
  • 6/28:  hydrometer reading: 1.009
  • 7/6: hydrometer reading: 1.009
  • 7/6: transferred to keg, but I couldn’t get the CO2 working correctly
  • 7/9: talked to Justin and got the keg pressurized to ~33 psi
  • 7/12: beer was done being carbonated on 7/11, didn’t drink it until today

I think this is the best my beer has tasted on the first try. The other two beers were good, but they got better as they aged a bit, but this one was delicious right away. Honey Steam is similar to Anchor Steam, but the recipe called for 3 lbs. of honey which gave it a sweet taste.

I’ll post some pics of the final kegerator setup later.

New Job

Once again its been about three weeks since I last posted. I haven’t really felt like doing much geek stuff this summer so far which kind of reduces the blog fodder.

I did start a new job this week, at MinuteClinic headquarters in downtown Minneapolis. I’m part of their internal software development team, and on my first day I was already waist deep in a project. Leaving Magenic was a tough decision, but this seemed like a fun opportunity to try out, so here I am.

I also have another beer brewing, Honey Steam, that should be ready in about a week, so that’ll give me something else to talk about as well.

Enjoy your weekend