WHS Add-In: WHS2SmugMug - Update

Wednesday, 9 July 2008 7:11 pm

I’ve neglected this project for a while mainly due to me being so busy with other stuff.

The hiatus has actually done the project good as feature creep was threatening to de-rail the thing the last time I had a look at it.

So I’ve cleaned up the requirements for the data to be stored locally. I’ve eliminated just about everything I can pull from SmugMug leaving me with a nice, clean object model to work with.

I was also struck by the fragmenting of the project into three – scheduled, service and WHS Console Add-in.

While this seems logical, it is a bit over the top. So I’m dropping the scheduled uploader and having uploads handled by the service.

Work is progressing nicely and I hope to have a working  service app soon ( if not a console add-in).

I’m now using the SmugMugAPIWrapper from Codeplex. Its MIT Licenced so WHS2SugMug will have to be too. This library is one that I can actually use without looking at the source as its built to use the current SmugMug API, so no worries there.

As with my Windows Live Writer add-in, I’ll host the project on Codeplex as soon as there is a release-ready codebase.


Quote of the Day

Wednesday, 9 July 2008 3:40 pm

This seems to sum up programming:

He may be mad, but there’s method in his madness. There nearly always is method in madness. It’s what drives men mad, being methodical.
  - GK Chesterton


FriendFeed gets my posts, Twice

Tuesday, 1 July 2008 1:52 pm

I’ve noticed that there is a lag between my post being published and it showing up in FF (From Michel Arrington’s stream):

 

image

I’ve actually noticed that this is becoming the exception rather than the norm slowly but surely:

image

Nevertheless I wrote a plugin for Windows Live Writer that automatically posts a link to FriendFeed every time I publish a post. In fact the link in the above picture ws posted using this plugin

Since I’ve never written a WLW plugin I used the Twitter Notify plugin that is included as part of the SDK as a springboard. You might notice that there is very little code left of the original.

Since it uses the new SDK feature unavailable in WLW 2.0, you’ll need the WLW 3.0 CTP for this plugin to work.

You can get it from Codeplex here.

It will ask you for your FriendFeed username and Remote Key as well as a preamble to accompany the posted link. This is set, by default, to “Blog Post”. As you can see mine is set to “New Blog Post”. All these settings can be changed from the Plugins page of WLW options.

Suggestions are welcome as are bug fixes, etc.

The plugin is working well for me and I’ve encountered no issues, other than WLW taking slightly longer to start up ( this could be a CTP issue).

I currently thinking of:

  • Putting a link to the discussion on FF in the post( as far as I can tell this would require a re-write)
  • Linking to FF when you Update the post

Anyone else got any ideas?


WHS: Virtual Server

Sunday, 11 May 2008 8:42 pm

As I promised, I’m posting a How To for installing Virtual Server on WHS.

A word to the wise:

I’ve a 2.8Ghz Celeron D with 2GB RAM to run this on. Virtual Server can provision processor usage to an extent, but it uses RAM like there’s no tomorrow. Don’t forget that it has to play nicely with WHS (specifically DEmigrator.exe that burns CPU cycles) and other stuff like defrag passes and anti-virus.

Since WHS is built on top of Small Business Server,  the underlying OS is essentially the same. Hence no compatibility issues.

Installing Virtual Server is relatively straight forward.

First, download Virtual Server 2005 from here.

Then Download the Service Pack from here.

Open a Remote Desktop Session or use the Advanced Admin console tab to access the WHS desktop.

Now, its up to you whether you want to install the program files to C drive or D drive. Its worth noting that the Virtual Machines are stored separately in a location you specify on a per VM basis.

Once the install( including that of the service pack) is completed go to Start -> All Programs -> Microsoft Virtual server and hit the Administration Website shortcut.

You get this:

image

Note: I was accessing this remotely so had to prefix the user name with “server\”.

Otherwise, these are your WHS credentials that you use to access the console or remote in to WHS.

This is the webpage you get to (click for a larger version):

image

As you can see I have two virtual machines listed. One of which is currently  running.

I find that its easier to manage the server remotely, so copy the web site shortcut from the Start Menu to a network share. This now allows you to reach the web site from any connected PC.

If you’ve done this, close Remote Desktop and try it. The Default IIS settings that the install configures for you should be OK.

Setting up a Virtual Machine couldn’t be simpler:

First we want to set the default location of our Virtual Machines. Go to Server Properties at the bottom of the Sidebar and click on Search Paths. Change the Default virtual machine configuration folder to your desired location. I’ve been using a network share with replication turned off.

image

You can also set default paths for ISO’s that you will use. These will show up when you configure the VM’s Cd/DVD drive.

And press Ok when you’re done.

Hit Create under the Virtual machines section of the sidebar:

image

Enter all the info on the screen.

The RAM that the Virtual Machine is assigned is occupied as soon as the VM starts up. So be careful when doing this.

You have a choice of creating a new Virtual Hard Drive or attaching an existing one. make sure that the size of the hard drive is enough for your needs. Expanding it later can be a little difficult.  And choose a SCSI bus if you intend to have multiple VHDs attached to the same machine.

The VHD actual file size increases as you add data to it. It stops at the logical size of the VHD. So a 80Gb VHD can no be larger than 80Gb on disk.

You can also choose to create the VM without an attached hard disk.

Pressing “create” takes us to the Vm config page:

image

You can also reach this page by selecting your VM from the Configure menu under the Virtual Machines Section of the Sidebar.

This is where you change items such as memory, hard disks, CD/DVD ROM drives, Networking, SCSI Adaptors, COM and  LRP ports.

Each option takes you to a new page were you configure settings specific to that area.

Its worth noting here that the VM needs to be Shutdown for some operations. But you can still change the location of the media that the CD/DVD ROM drive captures while the VM is running.

You can also set the VM to start up automatically with WHS by going to the Server properties.

image

With my Windows Server 2003 VM running constantly, the WHS automatic restarts could be a problem. All I do is check the box, input the account details, set a delay ( in my case, 600 seconds) and tell Virtual server to save the VM’s state when WHS shuts down. The delay is actually a pretty nifty feature as it allows WHS to initialise itself, bringing all its processes online, before starting the VM.

One more thing I have to cover for running this on WHS is Resource Allocation:

image

You’ll find it the bottom of the sidebar.

As you can see my VM has 50% Max Processor capacity to play with. This protects the WHS processes from being starved of resources.

Once you’ve got your VM set up and you’ve installed you software all you have to do is remote in using the Remote Control facility the web site provides you with ( its good for the initial setup such as enabling Remote desktop Connections and so forth). All you do is double click on the VM icon  on the front page.

I also recommend installing VM Additions (the ISO for it comes with Virtual Server and is a default option for the CD/DVDROM drive) that will improve the way the VM behaves within the Virtual Server environment.

Additionally, this post probably scratches the surface of what’s possible with this.

And I’m sure I’ve got a few things (unintentionally) wrong along the way so its not fool proof, so YMMV ( Your Mileage May Vary).

Happy Hacking…


Link of the Day

Friday, 9 May 2008 2:17 pm

via Scott Rosenburg:

Pentagon’s Accounting Mess - Portfolio.com: Yet Another Federal Software Quagmire (cf. the IRS, the FBI, the FAA, etc.). An account of the Pentagon’s failure to upgrade its ancient mainframe-era accounting system; the tale unfolds in a building in Indianapolis the size of 28 football fields, and explains why the U.S. military cannot be audited. The Pentagon literally cannot tell you how much it has spent or what it has purchased. If you ran your family this way, they’d disown you.

Err, this is the 21st Century and this should not be too difficult to accomplish.

And they’re still using COBOL?? What can I say?

<humour> Solution? Call Microsoft </humour>


Subversion Source Control

Wednesday, 30 April 2008 5:01 pm

This post has been bouncing around my head for sometime since finding the time to write has been a little hard.

The fact is that the whole Subversion vs Git vs TFS vs [insert preferred system here] debate can get to the point where its quasi-religious (as are numerous other tech debates - windows vs mac being one of the notable ones).

Now I, bad developer that I am, have only recently started using Subversion. The need to sync source code between my desktop and my laptop outgrew the copy/paste via Windows Home Server share approach.

The fact that Subversion is free is also a big deal maker ( compared to, say Team Foundation Server).

I have been using it on another free product, namely Netbeans 6.01 for my Java development. Its nothing major, only university projects. 

The fact is that Netbeans comes with Subversion and CVN support baked into the IDE. Additionally, Netbeans uses its own Local History feature to keep track of your files wether you’re using formal source control or not. Every time you build your project it makes a commit to your Local History. This means that one has both Local history for the small changes and Subversion for the big changes.

The fact is that having it baked into the IDE makes all the difference - it allows one to interact with the code in revisions directly. Let me explain. One can make line-by-line rollbacks from your previous versions wether you are using Local history or Subversion or both. Powerfully, the rollbacks count as changes to your code and are committed right back to the database.

(I plan to do a post on the value of a good IDE soon as well)

image

In the (Subversion) case above, the local copy is out of date (on the right) and the remote changes (on the left) are shown in blue. The changes were made on my laptop, committed and I’m comparing them against the desktop copy of the files.

By clicking on the blue arrow one can insert the changes into the local copy with out inserting all the changes. The same applies for replacements (in cases where the lines have been modified rather than outright replaced).

The green area in the local copy no longer exists and by clicking on the red cross one can delete the highlighted lines.

Local History works in exactly the same way.

This is a small example and one needs to actually use it to understand the power of the concept.

Now, the fact is that the vast majority of my coding gets done in Visual Studio. And Visual Studio , the TFS edition aside, does not support source control. Period.

However, VisualSVN actually has an Add-In for Visual Studio that brings this functionality into the IDE. The problem is  that the Add-In isn’t free. Its $49 per licence. Personal licenses are restricted to one per order ( but not corporate licenses) and open source projects qualify for free licenses. And, no, I haven’t yet decided whether to get a license.

I agree with Jeff Atwood that software such as Firefox should take the most popular Add-Ins and fold them in the main code base. Which gives rise to the question that if Source Control is so important and popular (is it for non-TFS Visual Studio users????), why doesn’t Microsoft add it in?

I mean its only Subversion. Surely Microsoft must have some pretty good selling points related to why TFS is, like, totally better than Subversion ( ;) ). That takes care of the “They already have source control” pundits.

Source Control is simply good programming practice and if Microsoft is serious about attracting people to its platform (and the freely available express editions shows that they are somewhat serious), they should provide it.

Contrast Visual Studio to Netbeans and that’s enough said on the subject.

Now the easiest way to install Subversion is to head over to Jeff’s blog post about it. If you don’t subscribe to Jeff’s blog, i suggest that you do - its invaluable.

I went the VisualSVN server route which set everything up with the addition of  the ability to browse the server using a web browser (it does this by using Apache). To avoid Apache conflicting with Windows Home Server, its running on a Virtual Server virtual machine ( that image runs a few other odds and ends). Setting up Virtual Server on WHS is itself the subject of another blog post. It took me literally 2 minutes.

Before letting you go, Scott Hanselman has a great podcast on Subversion vs Git for Source Control and it comes highly recommended.


Windows Home Server: Resource Deconfliction

Thursday, 27 March 2008 3:04 pm

As more and more Windows Home Server Add-Ons are introduced, WHS becomes more and more like an appliance than a piece of software (and hardware).

More and more Add-ons mean that we ask more and more of our systems. These demands mean that finite resources have to allocated and shared with the WHS software itself.

DEMigrator.exe comes to mind ( the magic behind folder duplication). Since DeMigrator does not actually have a front end ( short of turning off folder duplication), it is impossible to pause or stop it when its running in favour of something more urgent. Granted we could change our backup window, but this is not always convenient or possible.

What WHS needs is some way of managing resources on a much more granular level than process priorities. By that I mean that WHS makes  a logical guess as to what process(es) need to run now  and what processes are less immediate.

So if I use SageTV to record show x at time y and a defrag ( or other processor intensive program) is scheduled to run at the same time, we need resource deconfliction to kick in and sort it out. We can do this in one of two ways: either throttle back the proccessor intensive process or re schedule it ( if the drive isn’t very fragmented a missed defrag pass wont make much of a difference).

Naturally, we can’t expect this souped up task scheduler to be able to handle every occurrence of every program. this means that WHS would simply notify the offending process(es) of the situation and it would be up to the program to implement a responsible and reasonable strategy to handle that.

If you’ve got a high end system running WHS, this discussion isn’t very dramatic. But between backups, defrags, virus scans, DeMigrator, SageTV  and others ad nauseam  ( even automatic Windows Update needs to be able to safely restart) jockeying for resources, something needs to manage this safely and well.

Essentially, this is bringing WHS closer to the headless system originally envisioned. It would save me a lot of Remoteing in every day.

Before we finish, let take a look at the specs for the WHS systems commercially available from HP, etc to get an idea of exactly what resources are available.

The Microsoft minimum spec is 1Ghz and 512Mb RAM and 1x 70Gb drive.

The recommended spec is 64-bit Compatible Intel Pentium 4, AMD x64 or newer with 512Mb Ram and 2x hard drives with a 300GB primary disk.

  CPU RAM Hard Drive
HP Media Smart AMD 1.8 GHZ 64-bit Sempron 3400+ processor 512Mb 2x 500Gb
Norco DS-520 Intel Celeron M 1GHz 1Gb 1x 250Gb
Piranha Home Server Intel Celeron 430 (1.8GHz, 512KB, Conroe) 1GB 2×250Gb
T2-WHS-A3 Harmony Home Server Intel Celeron 220 1.2GHz 512Mb (1Gb Optional) 1 x 500Gb (1Tb/2Tb Optional)
T7-HSA Harmony Home Server Via C7M “Esther” 1.5Ghz 512Mb (1Gb Optional) 1 x 500Gb (1Tb Optional)
My own homebuilt system (Dell  Poweredge SC440) Intel Celeron D 2.8Ghz 2GB 1×160Gb
1×400Gb
2×750Gb

I think this is a pretty representative sample of the entire range. You can get the reviews on these servers and others from We Got Served Hardware page.

NB. The extra possibilities of multi-core  64 bit machines allowing true concurrent execution are mind boggling.


Visual Studio Install Error 1935 (HRESULT: 0×80070BC9) Fix

Tuesday, 18 March 2008 4:44 pm

As  I wrote here last week, getting Visual Studio 2008 installed was a bit of a problem for me on my main Desktop PC.

And I couldn’t find a fix anywhere. So since the installation was successful on my laptop ( they are both nearly identical systems) I set about trying to find some difference between them.

I came up with the fact that I’d had Visual Studio 2008 Visual Web Designer Express installed and had uninstalled it before my Visual Studio 2008 Pro install.

So in the finest tradition of Voodoo Troubleshooting I did the following:

  1. Mounted  the Visual Studio Express Editions DVD image available from Microsoft here
  2. Installed Visual C# Express ( it looks as if any edition will do)
  3. Restarted
  4. Uninstalled only Visual Studio C# Express (the runtime prerequisites will also uninstall)
  5. Restarted
  6. Installed Visual Studio 2008 Professional

I’m not quite sure why this works. I put forward the idea that it fixes the registry or the .Net Install ( see my earlier post for details).

Happy Coding :) !


Installing Visual Studio 2008

Friday, 14 March 2008 6:44 pm

UPDATE: I found a fix. See here.

Right. Let get this straight. I’m running Vista Business with Visual Studio 2005 Standard installed (and All the extras - SQL Server etc).

The short version is that Visual Studio 2008  Professional refuses  to install itself. It installed .Net 3.5, Document Explorer 2008 and the Web Authoring Component and then quit at some point while installing Visual Studio itself.

Heres the error log:

Microsoft Visual Studio 2008 Professional Edition - ENU: [2] ERROR:Error 1935.An error occurred during the installation of assembly ‘Microsoft.VC90.DebugCRT,version=”9.0.21022.8″,publicKeyToken= “1fc8b3b9a1e18e3b”,processorArchitecture=”x86″,type=”win32″‘. Please refer to Help and Support for more information. HRESULT: 0×80070BC9.

I’ve no idea what is going on. If you Google search  the Error Code you get this error for VS2005 (or SP1), .Net 2 or SQL Server.  Searching by HRESULT points to this MSDN Forum where the discussion is about a VS2008 Compile problem.

Now here’s the thing. It installs perfectly on my laptop (also running Vista Business with Visual Studio 2005 installed with all the bells and whistles). So the download ( and no, its a perfectly legal copy) is definitely not corrupted.

HELP!!!!!


On Robotic Fish

Monday, 18 February 2008 2:28 pm

I was reading this weeks New Scientist ( the print edition, mind you) and this story  about what the US Navy’s Office of Naval Research is doing caught my eye:

AGILE robotic fish that look like the real thing are being developed to act as government spies.

The article goes onto say that the fish will have cameras and communicate with each other using sonar.

To anyone that has read Michael Crichton’s Prey, this sounds suspiciously like a multi-agent system, albeit one that uses physical agents rather than computer simulated ones.

Wikipeedia has this to say:

The exact nature of the agents is a matter of some controversy. They are sometimes claimed to be autonomous. For example a household floor cleaning robot can be autonomous in that it is dependent on a human operator only to start it up. On the other hand, in practice, all agents are under active human supervision. Furthermore, the more important the activities of the agent are to humans, the more supervision that they receive. In fact, autonomy is seldom desired. Instead interdependent systems are needed.

[...]

MAS systems are also referred to as “self-organized systems” as they tend to find the best solution for their problems “without intervention”.

[...]

The main feature which is achieved when developing MAS systems, if they work, is flexibility, since a MAS system can be added to, modified and reconstructed, without the need for detailed rewriting of the application. These systems also tend to be rapidly self-recovering and failure proof, usually due to the heavy redundancy of components and the self managed features, referred to, above.

Although we’re not likely to see these become evolving, man-eating piranhas, it is something to keep an eye on (if you’ve read the book, you’ll know where I’m coming from).

And it demonstrates a physical application of  this technology that, while the agents are not strictly independent, they are not exactly predictable either.

At least, that is the way I understand it.