CommandLine Tools 1.0.2

Once you get started on something, it's hard to stop 🙂

I made another update to my CommandLine Tools, adding a Hash Generator that supports MD5, SHA-1, SHA-256, SHA-384 and SHA-512. Also, my Subversion Revision/AssemblyInfo tool (CommandLine .net SVN Revision Replace) now supports Visual Basic.net and Visual J# as well.

You can download Version 1.0.2 here. Source Code is released under GPLv2 on that page as well.

CommandLine Tools 1.0.1

Yesterday, I introduced my tool to send e-Mail from a Command Line. There was a little cosmetic Bug in it (The "Execution Finished Date" did not show the proper month), so I released a small Bugfix release.

I also added a new tool: CommandLine .net SVN Revision Replace. This tool solves a little problem: Changing the AssemblyVersion to have the Repository Version as Build Version. So if your repository is Revision 20, it will patch your AssemblyInfo.cs files to have an AssemblyVersion and AssemblyFileVersion of x.x.x.20. It will leave the first three octets unchanged.

Also, GPLv2 Source code is available for the tools now.

You can find the updated tools here.

CAML Or-Queries

Just another "RTFM"-Problem that I encountered the hard way:

<Or>-Queries in CAML look like this: ((((A or B) or C) or D) or E).
I accidentially assumed that they were (((A or B) or C or D) or E), but that just leads to Sharepoint 2007 giving the overly helpful "Cannot complete this action" Error message.

Example of a correct Query to have 5 OR-Directives:

<Where>
  <Or>
    <Or>
      <Or>
        <Or>
          <Eq><FieldRef Name='Author'/><Value Type='Text'>A</Value></Eq>
          <Eq><FieldRef Name='Author'/><Value Type='Text'>B</Value></Eq>
        </Or>
        <Eq><FieldRef Name='Author'/><Value Type='Text'>C</Value></Eq>
      </Or>
      <Eq><FieldRef Name='Author'/><Value Type='Text'>D</Value></Eq>
    </Or>
    <Eq><FieldRef Name='Author'/><Value Type='Text'>E</Value></Eq>
  </Or>
</Where>

Send e-Mail from the Command Line

So you have written your neat little backup script that backs up everything but the kitchen sink, does three different types of verification and replication and writes everything into a neat little log file that you can check to see if everything ran fine.

But no real™ script that runs as scheduled task would be complete without e-Mail notification, right?

There are quite a few tools available that allow to send e-Mail from the command line, and here is yet one more: cmdsendmail!

This tool works off an XML file and has pretty much every feature that could be useful: SMTP AUTH? Check. Ability to set CC and BCC as well? Check. HTML support? Check. Attachments? Of Course!

Since it works off an XML file, you can have your script create this file dynamically, which makes it extremely flexible.

So how much does it cost? 99€? 49€? 19€? Nope, it's free software, and the source code is available as well!

SPContext.Current does not exist in Workflows

Maybe this is obvious, but I just learned it the hard way: SPContext.Current does not exist in Workflows.

So when you have an external Assembly that provides some functions, make sure to pass a SPWeb into those functions, as SPContext.Current is null and you don't have a SPWeb or SPSite.

On a similar Note, SPWeb.CurrentUser is the system account usually, so if you need the User that started the workflow, pass workflowProperties.Originator into the functions as well.

Weighted Companion Cube Plushie Sewing Pattern

So I got myself the Orange Box from Steam yesterday, which means that I bought one of the most original and fun Games of the last years: Portal.

Portal has two noteworthy characters: GLaDOS, the main antagonist and the Weighted Companion Cube, the sidekick of the player in one of the maps.Companion Cube

Both have gained some fame now, but the Cube has one advantage: You can actually build your own, thanks to the sewing pattern! And guess what? I've just decided to make my own. I know enough about sewing to fix buttons on my shirt, but after all, this is the internet: Place of unlimited information and failure, so it should not be too hard to gain enough knowledge. For starters, my first quest will be to actually get the materials, especially since I never needed to buy "raw" plush before? As I don't want to kill some cuddly toys to harvest their plush (this is not BioShock, after all!), I think I'll have a lot of fun shopping soon.

HDMI and Component video capture

Ever since I got my Nintendo Wii and especially since my Xbox 360, I wanted to be able to record the output onto a PC, to make some video reviews or walkthroughs. In the old days of Xbox and Playstation 2, the S-Video connector was "State of the Art". Ok, there is RGB over Scart, but the quality was not that different compared to S-Video, and you can easily capture S-Video with about every 20 € TV Card on the market.

Nowadays, this became more complicated. Sure, the Xbox 360 still supports S-Video output, but why on earth would anyone do that if you have a 32" LCD TV with HDMI in that allows 720p? Playing Gears of War in SDTV is simply not the same as on 720p. On the Wii, it can be argued whether Component and S-Video are that different, but I still think that Component is much better.

So my task was now to find a way to record HDMI/Component Signals. My first approach was to kill two flies with one stone: Find an A/V Receiver that not only upscales everything to HDMI, but that is able to downscale HDTV Signals from HDMI down to standard PAL-Resolution Composite/S-Video Signals. That way, I could play on the TV in full resolution and have a "good enough" signal to capture as well. That approach seemed logical, as I want to buy a receiver anyway. Well, guess what? There is no A/V Receiver that is able to do that, at least not in the <1000 € price range. Nice idea Michael, except that it's not gonna work.

The second approach proved more successful: Find a Capture Card for the PC that has HDMI and Component Inputs.Blackmagic Intensity Pro Before research, I was sure that those exist, but only in the "Pro" price range of well over 1000 €. To my suprise, there is a card that does that a lot cheaper: The Intensity Pro from BlackMagic. Priced at 349$, it's surely more expensive than the 20 € TV Cards i've used in the past, but the price is still managable. I'll have to dig out some more reviews, but what I've seen so far seems promising.

Valid XHTML and YouTube embedding

If you look at the sidebar of this web page, you might see that "Valid XHTML" link. It's a link that WordPress adds per default and that you have probably seen on a gazillion of other blogs as well.

Have you clicked on it? No one does, because why should you care if my Page is valid XHTML if it displays correctly for you? Anyway, I clicked it a few minutes ago, and was greeted with a nice "This page is not valid XHTML!". Whoops. I tried clicking that link on a few other blogs, and many of them are not valid XHTML anymore, due to some funky stuff in the postings.

I think it's quite embarrassing, having that "Look ma! Valid XHTML!" statement on your web site, and then not fulfilling it. Here, there are two solutions: Simply removing the link that no one cares about anyway, or actually fixing the broken XHTML.

I went with the second option, and I found that the little YouTube video i've embedded a few weeks ago is breaking my XHTML, because the default YouTube embed code is not XHTML compliant. I found that this is one of the more common sources of those false valid XHTML statements. Luckily, there are people who found a proper way to make XHTML compliant YouTube embedding, which you can find here. I went back and fixed the article, so now the valid XHTML link leads to a nice "This Page Is Valid XHTML 1.0 Transitional!" message. Woohoo!

Re-Using a SPQuery = bad Idea

I've just spend an hour trying to find the source of one of those dreaded "One or more field types are not installed properly. Go to the list settings page to delete these fields." error messages, and it turns out that SPQuery can not easily be reused on multiple Lists.

My code was like this:

SPQuery query = new SPQuery();
query.Query = "<some CAML>";
SPListItemCollection ListOneResults = ListOne.GetItems(query);
// do more stuff
query.Query = "<some other CAML>";
SPListItemCollection ListTwoResults = ListTwo.GetItems(query);

The CAML is fine, but apparently SPQuery has a private List property that links the Query to the first list, causing the second call to be executed against the wrong list. Using "query = new SPQuery()" to overwrite the object completely works.

I'd also like to thank U2U for their CAML Query Builder, which helps in writing the CAML queries.

Freestyle Skating Weekend 2008

I've spent the last days in Mönchrngladbach, during the 4WheelFreestyle organized Freestyle Skating Weekend.

Friday, 15.02.2008

On Friday, we spent the Evening with moving all the technical equipment in place. Organizing such an Event is a lot more complicated that it may seem at first, and the list of equipment needed grows and grows and grows... Anyway, putting everything in the cars and the trailer and driving to Mönchengladbach Neuwerk was the easy part. But then, it had to be moved downstairs, which was easy for the small things, but interesting for the big speaker cabinets. But well, this is the first of 3 days and we were still fresh and relaxed, so building the Team Area was straight forward.

Also, the first guests arrived and after doing some free training, we spent a nice evening at the Mokka in Viersen till 1:30 or so.

Saturday, 16.02.2008

After a very short night of maybe 5 or so hours of sleep, we started into a much too cold day at 7:00. As we had a little shop on the Event, we had to take the pile of stuff from Thomas' apartment into the car and to the event. The official start of the Event was at 10:00, and the time until 16:00 was spent with Workshops and free training and preparing the top-notch equipment that was used to make some 3000 photos and countless hours of video. At 16:00, the Battles started. With Sebastian Lafargue, Thomas Vilcans and Rudy Op't Veldt as Judges it was guaranteed to have proper and well-founded judgements, even though it was a pity not seeing Rudy and Thomas compete in the Freestyle Battles.

The day ended at 22:00, and I think I never felt my feet with such an intensity than on that evening. But regardless of exhaustion, it was a very nice day.

Sunday, 17.02.2008

Sunday started with the Final rounds of Speed Slalom. Thanks to the Freestyle Slalomskater Munich Team, we had a light barrier and a nice display of the times. For the Men, Seba won the Speed Slalom, and Chloe Seyres was successful for the women.

After Speed Slalom, we went on to the finals of Freestyle Slalom. Chris Fessel won the Event for the Men, and Chloe Seyres was successful for the Women. The Riders seemed to like the Winner Certificates - they have style, certainly. Also, the Podium is a nice example of why multi-function sport halls are useful 🙂

One of the attractions of the Event was the DJ Equipment, thanks to Thomas. The people liked the live DJ set on Saturday evening. As Thomas was one of the Judges, Michel took over the music during the battles.

And as my personal Highlight, I could add some Souvenirs to my 4WheelFreestyle Shirt 🙂

Overall, it was a great event. It was quite exhausting but it was surely worth it. If you want some more photos, check out my album of the 4WheelFreestyle Forum Thread.

The full list of results is available here.