Tuesday, 1 December 2009

Disappearing Code (WHS Update 3)

In my previous post I talked about Mesh and mentioned the pitfalls of the current implementation, specifically the fact that if a file ‘goes bad’ in one location, it will quickly go bad in all synchronized locations, with no option (that I can see) to revert to an earlier version or undelete.

One of the folders I synchronize on Mesh contains code for a personal project I’ve been working on for a few years. Fortunately, most of the work I’ve been doing is getting my head around what I wanted to achieve, and devising the core of a design and an implementation approach to achieve this, meanwhile I’ve cut very little code.

About a year ago I created a few of the basic objects and tests in Java, and have recently been in the process of converting this Java code to C# with the intention that not only would I be able to use this project to aid in my C# education, but that also by the fact that the app would be better solved (at least initially) by a Windows desktop application (and possibly a Windows Mobile incarnation), rather than a generic Java Swing application. My ultimate goal is to make a Java Servlet web based implementation followed by a generic Java client; what better way to show off your skills to prospective employers than a solution implemented in two languages targeting multiple different clients?

Anyway, I’ve strayed a little, the key is that the Java and C# code is kept in folders replicated by Mesh. One evening late last week before setting off home from the office I decided to load the C# version to see what suggestions ReSharper would have to clean things up (ReSharper is an excellent tool – take a look if you work in any of the .NET languages, it’s good enough that it’s changed my style of programming in a few areas due to its suggestions). So I navigated my way to my replicated C# folder and… well you can probably guess: My source files were missing!!!

Bugger.

There’s only a couple of hours work there, but it’s a pain to write such things a second time. I don’t know who deleted (or hopefully moved the files) yet – me or the Mesh. Hopefully it’s me who has moved them (although the fact that some files still exist in the directory makes me wonder), but it does highlight the fragility of the system for longer term work.

So then I set to thinking about this less than ideal situation. I’ve been using Subversion for a couple of years now, and this is exactly what that system is for – source control of code. I did spend several hours trying to set up a subversion server on my (still currently dead) Ubuntu box, but failed, however after a quick search on Google I see several people are running subversion on Windows Home Server with it externally accessible from other locations. This down side of this is that it does open the machine up to the outside world, but I was intending to do this for such things as music streaming anyway, so it looks like the way I’m going to go.

I’m taking a risk here in as much as I haven’t done a test install on my trial version of WHS (which only has a few days of trial time remaining), but there’s enough going for Windows Home Server now that I know I’ll be buying a licence soon (especially since the 120 day activation key has been withdrawn from the Microsoft site – thanks guys!). You can do all this stuff for free in Ubuntu, but frankly it’s not worth the hassle to me, at least for the moment.

I also did some quick investigations into the power requirements of running the old Ubuntu box (Biostar iDeq 210) verses my old PC running the test WHS install (Shuttle SN45V3). Both machines have 2 HDD, but the Shuttle has a graphics card while the Biostar is using the internal graphics chipset (after all it was only running Linux in terminal mode). The Shuttle idles at about 102 Watts, while the BioStar was about 90 Watts. Aside from the fact they both have different processors, Hard Drives and probably memory, the extra power draw on the shuttle can probably be explained by the graphics card (and it has an AMD Athlon XP 3200+ as opposed to the BioStar 3000+). The Biostar would be of ample horsepower to run WHS, but it never properly managed to run XP without problems, it would periodically crash with a display driver warning on the BSOD, a problem I never managed to rectify either with re-installation of the OS and Drivers, or by installing an external graphics card, so I’m cautious of running WHS on this box.

Considering everything, and for the sake of an extra 10% power draw, it looks like the Shuttle box will get the WHS build. 100 Watts is more than the 35-50 Watts of the HP MediaSmart box I was looking at, and it won’t have the expandability of that box, but that machine costs over £400, so even factoring in the WHS operating system (at £66) it would still take several years to recoup the money, based on current energy prices.

The next steps are that I need to take the box apart next to see if it’s feasible to get 4 hard drives in there (3 should work as I’m going to remove the broken DVD drive, but 4 would be better if I can find the space).

The box is going to live in the garage, so I also need to drill a bigger hole in the wall to get a Cat6 cable out there (the box only has a 100 Base-T connection, but I don’t want to be running a cable twice). When I’ve done all that I’ll order the OS, a 10 meter Cat-6 cable and possibly a new bigger HDD and take it from there.

I wonder if WHS will run headless… a quick search suggests it will so I suppose that will probably be my next test (after a re-install of the trial I suppose), after all, if I can take the graphics card out the power draw may drop a little, and as they sat at Tesco “Every little helps!”. By headless I mean without a graphics card at all – not just without a monitor attached. That may sound odd, but I remember the early versions of Java would fail if certain operations were performed without any graphics card present (I think it was something to do with rendering AWT components even if they were to be served up remotely, but I’m probably wrong, this was a long time ago).

Oh, and now I see Power Pack 3 is out!

Stay tuned.

No comments:

Post a Comment