Congratulations Mono team!

Having spent an undue amount of time in compiler-land over the last four months, I have nothing but respect for a team that acknowledges the shortcomings of their architecture, and so REWRITES IT.

Congratulations on the new release, mono team!

http://tirania.org/blog/archive/2009/Jan-20-1.html

Powershell Powers, Activate!

Yesterday, I had a problem to solve. I didn’t want to stay at work until 9pm, waiting for another team’s process to publish a file. (Grossly simplified, but you get the idea). I also didn’t want to log in from home at 9pm in order to wait for it to happen (I did that the night before).

So I used Powershell! Could I have used a batch file? Of course! However, I know with Powershell I can just chain commands together via a semi-colon.
I searched for “Powershell sleep”, and saw immediately that there was, in fact, a Powershell sleep command: start-sleep.

My final commandline:
start-sleep -s 7000 ; GetFileCommand ; msbuild /t:clean,build

And I could just walk away, knowing it would be waiting for me when I got into today.

(That didn’t happen, but it was unrelated to the Powershell issue.)

However, that wasn’t my only use of Powershell yesterday. The MSBuild Project system defines a build through a series of linked .XML files. I uncovered an issue where a particular task wasn’t being completed as I expected. I could, through the wonders of “Find”, locate where I EXPECTED the work to be taking place, but in a 10,000+ line XML file, scrolling upward to find the parent is not entirely pleasant.

So I used code.

I read the XML into an XML object, then found the tag I was looking for. I then got an XML Navigator object for where I was in the document, and walked back up the tree until I found something identifiable (it turned out I was screwed). All told, it took me less time to puzzle out (via get-member) how to do so under Powershell than it would have taken for me to write a real program, or to find it by hand.

Here’s the entirety of what I wrote:
$xmldoc = [xml] [string]::join(“`n”, (gc -read 10kb Native.Build.targets))
$xmldoc | get-member
$xmldoc.GetElementsByTagName(‘Internal_LinkOutputFile’)
$xmldoc.GetElementsByTagName(‘Internal_LinkOutputFile’) | get-member
$xmldoc.GetElementsByTagName(‘Internal_LinkOutputFile’).Item(0)
$xmldoc.GetElementsByTagName(‘Internal_LinkOutputFile’).Item(0) | get-member
$nav = $xmldoc.GetElementsByTagName(‘Internal_LinkOutputFile’).Item(0).CreateNavigator()
$nav
$nav | get-member
$nav.MoveToParent()
$nav
$nav.MoveToParent()
$nav

There was an awful lot of get-member calls, but I didn’t need to know ANYTHING else.

Yay Powershell!

What do you want your Server do?

Partially as a learning exercise, and partially because I’m a money grubbing greedy bastard, I’m trying to come up with a clever extension to Microsoft Windows Home Server.

Unfortunately, I already had pretty much everything I needed on the base installation; I had originally installed it purely to have a system I could hook up my parallel printer to. It already supports remote desktop to systems within your local network, as well as remote access to files on the server via secured login. Heck, it even provides dynamic DNS service, complete with chained certificates for secured access. Nice, huh?

I figure most people out there do NOT have WHS installed. Probably have no need for it. So, why don’t you let me know what would make you want a Windows Home Server? If you have one, what feature do you wish it had? If you could have your own personal secured web server, what do you really wish you could do on it?