Sunday, January 25, 2009

ObSrv: Watching the World

I've just completed a project called "ObSrv" which will convert Google Image Searches into MediaRSS compliant RSS feeds.

If you don't know what an RSS feed is, perhaps you should read this, or this. I love RSS because it's an easy way to let other people know what you're doing, and to find out news that is of specific interest to you. This blog (like almost all others) has an RSS feed. Most news sites and picture sharing sites have RSS too. This makes it easy for you to show their content on your website, or to view their content in an RSS reader.

If you don't know what MediaRSS is, you might want to read the specification. Basically, it's for a special type of RSS feed that contains media, such as pictures, video, and music. These feeds are cool because pictures, videos and music are much more entertaining than plain text. You can do more with them. For example, there's a slideshow on the right hand side of this blog that updates every few seconds with pictures of hi-tech gizmos. It's based on a Media RSS feed.

My favourite Media RSS application is John's Background Switcher. It updates the wallpaper on your computer desktop with pictures from a Media RSS feed.

My only problem with Media RSS is that the biggest source of images on the web (Google Images) doesn't serve up their image searches as an RSS feed. Which means that while you can search for images at google, you can't automatically feed them into a media RSS application.

That's where ObSrv comes in. It converts a Google Image search into a Media RSS feed.

Here's how:
  1. Go to http://obsrv.com/

  2. Type a few search words in the box. (Hint. If you want, do an advanced search in Google Images, and copy the Google Images URL into the box instead).

  3. Press ENTER or click on the "GO" button.

  4. ObSrv will give you the link to your feed.

  5. Click on the link to open the feed in a new window, or copy the URL for the feed from the textbox.

Here's some links to some applications that you can use with RSS Image Feeds:

John's Background Switcher (Windows desktop background switcher)

Vuvox (Slideshows)

Feed Reader

RSS Popper

What's Next?

I'll be adding functionality to ObSrv as time permits. My next task is to get it to convert any webpage containing images into an RSS Image Feed.

Monday, September 08, 2008

Outlook not showing embedded images

Sometimes when I received an email in Outlook with an embedded image, the image would not display, but I'd just see a white rectangle with a small red "X" in it instead.

This was nothing to do with the outlook security settings.

To fix the problem, I deleted the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Security\OutlookSecureTempFolder

After I deleted it, I restarted outlook, and my images now appear fine.

Monday, September 01, 2008

Schizophreinc Blogs!

I have a schizophrenic blog. Some days I upload copies of postcards that I receive. Other days it's info about migration to Australia in the 60's. And then it might be some photos of family and friends.

So it's a bit of a mixed bag.

Which is fine by me. My attention gets pulled all over the place, and I get interested in lots of different things. A bit like Homer Simpson walking through a shopping mall :)

But it could make life hard for my readers, so I recently added a little Javascript widget that makes the blog change its appearance depending on what interests you. Coupled with judicious use of blogger labels, it works wonders.

It's the same blog, but it changes shape depending on how you get to it.



Have a look at these two different links to see what I mean.

First if you're interested in Postcards go to the blog via the URL: http://neilius.blogspot.com/search/label/Postcards?pcd=1.

Second if you're interested in Ten Pound Poms go to the blog via the URL: http://neilius.blogspot.com/search/label/Ten%20Pound%20Poms?tpp=1.

(Hint for the uninitiated "Ten Pound Poms" were migrants who came to Australia from Britain between 1950 and 1971).

There are two cool bits to this.

The first is that you get a totally different set of links at the top of the blog depending on how you view it. I do this by adding some query string parameters to the URL. (The "?pcd=1" or "?tpp=1" parts of the URL).

Secondly, using labels in the URL lets me control what articles appear when you visit. (That's what the "/search/label/..." bit of the URL is all about).

You might think using query strings on your URL is a messy way to get to your blog. But it's really easy to set up a domain and (using something like ZoneEdit's "webforward") point that domain to a more complex URL.

For example, http://TenPoundPoms.com and http://Postcards.NeilEnnis.com both point to the same blog, but I've used ZoneEdit to add different parameters to the URL query string.

A small Javascript widget at the top of the blog looks at the query string, and decides what sort of links to display. Basically it's saying "If you've come here to look at postcards, I'll show you some postcard links. But if you're interested in Ten Pound Poms, then I'll show you some different links instead.

Here's the code. The Orange section is a javascript function to pull the query parameter out of a url. The Green section controls what gets displayed when people are interested in "Ten Pound Poms". The Blue section is what gets displayed when people are interested in "Postcards".


<script>
function gup( name ){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1];}
</script>

<script>
var tpp_param = gup( 'tpp' );
var pcd_param = gup( 'pcd' );
if(window.location.href == 'http://neilius.blogspot.com/search/label/Ten%20Pound%20Poms')
      tpp_param = '1';
if(window.location.href == 'http://neilius.blogspot.com/search/label/Postcards')
      pcd_param = '1';
if(tpp_param == '1')
{
      document.write('<div id="tpp-info" class="sidebar section">');
      document.write('<h2 class="title">Ten Pound Poms</h2>');
      document.write('<a href="http://neilius.blogspot.com/search/label/Ten%20Pound%20Poms?tpp=1">Home</a> Ten Pound Poms | ');
      document.write('<a href="http://neilius.blogspot.com/2008/07/about-tenpoundpomscom.html?tpp=1">About</a> Ten Pound Poms | ');
      document.write('<a href="http://neilius.blogspot.com/2008/08/links-for-ten-pound-poms.html?tpp=1">Links</a> for Ten Pound Poms<br/>');
      document.write('<a href="http://neilius.blogspot.com/2008/08/migrant-ships.html?tpp=1">Migrant Ships</a> - How we got here<br/>');
      document.write('<a href="http://neilius.blogspot.com">Musings</a> - Back to the main blog');
      document.write('</div>');
}

else if(pcd_param == '1')
{
      document.write('<div id="pcd-info" class="sidebar section">');
      document.write('<h2 class="title">My Postcards</h2>');
      document.write('<a href="http://neilius.blogspot.com/search/label/Postcards?pcd=1">Home</a> - My Postcard Blog | ');
      document.write('<a href="http://neilius.blogspot.com/2008/05/about-my-postcards.html?pcd=1">About</a> My Postcards | ');
      document.write('My Postcrossing <a href="http://www.postcrossing.com/user/Neilius" target="_blank">Profile</a><br/>');
      document.write('<a href="http://postcrossing.com" target="_blank">Postcrossing</a> - A great way to send and receive postcards<br/>');
      document.write('<a href="http://flickr.com/photos/magictyger/sets/72157604961465429/" target="_blank">Postcard Collection</a> at Flickr<br/>');
      document.write('<a href="http://neilius.blogspot.com">Musings</a> - Back to the main blog');
      document.write('</div>');
}

</script>

Wednesday, July 02, 2008

More algebra

A couple of years ago, in this post I published the formula for calculating loan repayments based on rate, PV, FV and interest rates etc.

I mistakenly said that you couldn't arrange the formula to give an expression which would calculate the TERM given the other values.

I was wrong.

Here's the formula:
NPER = LOG((PMT*(1+RATE*TYPE) - RATE * FV) / (PMT*(1+RATE*TYPE) + @RATE*PV)) / LOG(1+RATE)

FV is the "Future Value" of an investment assuming an initial investment (PV), constant repayments (PMT) and a constant interest rate (RATE) over a fixed term of months (NPER). When "TYPE" is zero, loan repayments are made in advance. When "TYPE" is 1, loan repayments are made in arrears.

It yields a non-integer result. The result should be rounded up to the next highest integer, with the value of the final repayment reduced.

If I get time I'll post a formula for the final repayment later.

Saturday, December 22, 2007

Where did my money go?

The Money Tracker
www.MoneyTracker.com.au is a great site that lets you track the location of your bank notes after you spend them.

Basically you go to the money tracker web site, and enter the serial number of any bank notes (cash) you have. Then you just spend them like you normally do. Eventually, someone else will get the note, enter it into money tracker which then notifies you of the new location of your bank note.

This fascinating idea was inspired by the US website http://wheresgeorge.com/ which lets you track U.S. bank notes.

Now all we need is some sort of machine that can help us get our money back after we spend it :)

Sunday, December 16, 2007

Sir Arthur C. Clarke 90th Birthday Reflections



Scince fiction writer and visionary Arthur C Clarke turned 90 on Sunday.

Best known for his blockbuster "2001: A Space Odyssey", he also wrote numerous other books and short stories.

I've devoured most of his works since I was 11 years old, amd marvelled at Clarke's optimistic vision of the future, and what we could achieve as a species. He made the future exciting. I couldn't wait for it to happen, and still can't :)

I hope you stay around till you're at least 100, Sir Arthur. We need more optimistic vision like yours.

Sunday, October 07, 2007

What's cool, what's not?

Technology is cool.

There is so much new cool stuff you can do these days.

Here's just a few:

ShipWatcher - a new website I created that lets you look at the webcams of cruiseships, view their progress on a map, and take photos of ships you like. Every hour ShipWatcher picks webcams that it thinks are "interesting" and take a couple of photos, automatically uploading them to....

Flickr - a fantastic service, from Yahoo that lets you share photos with other people, place them on a map, group them into sets and collections, pool them into groups with other people, and even track the type of camera that took the photo - to help you choose your next camera. I even used Flickr to share some great looking Photo Mosaics that I generated with...

Andrea Mosaic - a clever little utility which lets you generate mosaic pictures like this one I did, from pools of photos that you might have. In fact, if you have large pools of photos, you might be interested in...

Photosynth - amazing new technology from Microsoft that pools photos, organizes them in relation to each other, and lets you view a 3-d model of the real world, by aggregating thousands of photos. This really has to be seen to be beleived. I have a copy of it on my main machine which runs....

VMWare -fantastic software that lets you build "virtual" computers. You can configure a number of different types of computers with different amounts of memory, diskspace, networking abilities, each of which can run a different operating system like Windows XP, Linux, Vista, DOS, and run them all at the same time. You can even get your virtual machine to take a snapshot of itself. Do some risky stuff, and then if you don't like the result, rollback your machine to the state it was in when the snapshot was taken. Great for demos, when you want the demo to revert back to its previous incarnation when you're finished. If you have a laptop, copy your virtual machine from your desktop to your laptop, and it's ready to go. Everything on the laptop is the same as when you last used it on your desktop. So easy to backup too. Just copy the virtual disk (one file). I use VMWare to do all my software development, including a cool web development tool called...

Iron Speed Designer - easy to use software that lets you quickly generate websites based on any existing SQL, Oracle or Access database. I've never developed websites before, and Ironspeed made it easy to look like a pro. Great stuff.

It seems things just keep getting better. Life gets easier for us. We can do more, in less time.

BUT. Some things aren't cool. They make life harder. They suck. Even some things that are cool can suck. For example....

Iron Speed Designer - although a great tool, decided that they didn't like people using their software inside a virtual machine. Aparently some people were using the flexibility of virtual machine software such as VMWare to defeat the copy protection mechanism. So the folks at Ironspeed decided they'd put a limitation in version 5 of their software that makes it refuse to run on a virtual machine.

You may think "so what?". But think about what this means. If you've got your entire development environment inside a virtual machine. And one of your development tools stops working in that machine. What do you do? Uninstall it and move it to a real machine I suppose.

But I use MS Visual Studio in conjunction with Ironspeed. So I suppose that would have to come out too.

Then, to make it consistent, I suppose all my Visual Studio projects would have to come outside the virtual machine.

And then - what happens if I want to go out of town for a week and take my laptop. How do I easily move all this stuff from desktop to laptop?

The Virtual machine becomes useless. All because Ironspeed doesn't like you using their products in a virtual machine.

So one software supplier digs their heals in over technological innovation. Where will this end?

I predict one of two things will happen:

1. Ironspeed will see the error of their ways, repent, and their next version will run inside a virtual machine. Probably with some sort of licensing service that runs on a physical machine to police the licensing policy.

2. As more developers start using virtual machines, another software vendor will release an alternatuve web development utility, that does what Ironspeed does - except the new software will run inside a VM.

People who work in the technology industry can't run away from technological innovation. Or they will end up being people who USED to work in the technology industry. Technology is all about innovation. Anyone who wants to stay in the technology industry needs to embrace innovation, not shun it.

So, here's my message to Alan Fisher and the great guys at Ironspeed: You guys have a fantastic product. I love it. It's brilliant and makes my life easier. It's worth every cent that I paid for it. But if you want me to chose between Ironspeed and my Virtual Environment, then I'll chose the latter. I want my technological life to be easier, not harder.

Please change your mind.

UPDATE December 2007. The folks at Ironspeed have responded to user requests, and removed the restriction on ISD running in a virtual environment. Fantastic decision, guys. A great product just got even better. Thanks for listening to us!

Friday, September 14, 2007

SSL / HTTPS stops working on localhost under IIS 5.1

I have an ASP.NET web application that uses SSL.

The other day it stopped working on my development machine (Win XP Pro SP2). Whenever I tried to navigate to the SSL page my browser said it couldn't find the page.

I spent hours trying to google an answer to this problem.

The thing that finally fixed it was.... (drum roll)... a reboot.

Now here's the proof that I've taken leave of my senses. My colleague had the same problem a few days ago. I helped him resolve it, and even suggested the reboot solution. It worked for him. But today when this problem happened to me, I forgot all about that episode, and wasted time until I came up with the same solution. Again.

I must be getting old.

Incidentally, if you need an SSL certificate for testing purposes, try Microsofts SelfSSL utility. It creates the certificate and installs it for you.

It's available at https://www.microsoft.com/downloads/details.aspx?familyid=56FC92EE-A71A-4C73-B628-ADE629C89499&displaylang=en or search for "Internet Information Services (IIS) 6.0 Resource Kit Tools".

IMPORTANT UPDATE: Microsoft's SelfSSL utility will cause MSDE to stop working. It tries to install certificates in the SQL Server which makes it impossible to connect to.

Thursday, May 31, 2007

BuzzNet to Blogger woes

There was a cool feature at BuzzNet.com. It let you email a photo to a secret email address and would then create a blog entry at BuzzNet from the email. Really handy when you were on the road, had some nice photos, and wanted to upload them quickly without stuffing around with URL's and HTML image references and crap like that.

What was also nice was the BlogThis! facility that let you convert the new BuzzNet entry into a Blog Entry here at Blogger.

After I upgraded to Blogger's new gmail accounts, I was unable to use the BlogThis! facility at BuzzNet.

I've been stuffing around with this for ages, and every time I tried to get BuzzNet to talk to Blogger I got errors, and it wouldn't retrieve a list of Blogs.

Eventually I gave up in disgust and tried Flickr.Com.

It works! Perfectly! Easily!

I created a new Flickr account, told it that I had a Blogger account, and it directed me to a page at Google which let me authorize Flickr to update my blog.

Now I can email a photo to a Flickr address, and it automatically creates a new Blog entry for me.

Next time I go on a cruise, I'm all set to upload my new photos every day without spending hours trying to figure out all the HTML references.

I am a very happy camper. If anyone else has this problem with Buzznet - forget them - just upgrade to Flickr and make your life easier.

Wednesday, April 11, 2007

Laptop Runs like a Dog

My laptop has been running slowly for months. I thought I had problems with the CPU temperature, the CPU itself, spywarre, viruses, global warming, little green men - you name it.

The penny finally dropped. (D'OH!)

My power management settings were set to "Default Power Scheme". So Windows was throttling the CPU to reduce power usage and extend the life of my battery. That's useless to me because my computer is rarely un-plugged.

I changed it to "Minimal Power Management" and WHOOOOSH!!!!! It's running as fast as it used to.

Nice to have decent laptop power again. I've been putting up with crawling speeds for months. If only I'd found this solution earlier!

Thursday, January 25, 2007

Outlook 2003 Runs like a Dog

I've been growing increasingly frustrated with the amount of CPU time consumed by MS-Outlook 2003 on my laptop.

When Autoarchive runs every morning at 9am, the system grinds to a halt. There's no way in Outlook you can change the TIME at which this process runs. So my solution to the problem is to disable Autoarchive, wait till midnight, enable it, and tell it to run every day. That way I won't be around while it's archiving. How stupid that I have to stay up till midnight because MS products don't work properly. Does anyone know any better solutions to this?

The other contributing factor is my archive folders. I have them visible in the folder window that appears on the left hand side of outlook - so I can see "Mailbox - Me", "Personal Folders", "Archives" etc down the left hand side. I thought this might be slowing things down a bit, so I right-clicked on the Archove and Personal Folders, selected "Close", and the folder disappeared from view. After I did this, Outlook seemed to consume less CPU time, so I think I've solved this problem.

One final thing that might be adding to the overall slowness is the fact that my main outlook mail folder connects through a VPN to my exchange server (i.e. its not local to me). I think the combination of VPN and Exchange might be using up a lot of CPU.

Surely there must be something better?

Friday, January 12, 2007

It Works!!!!

Ben Tatasciore and his team at Fone Zone Strathpine are legends.

I complained to Ben yesterday about my poor experience with Telstra and he solved my problem. Basically the upgrade to a 3G sim card broke my messagebank service, and Ben helped me navigate the labyrinth of Telstra to find an intelligent lifeform that was able to "Re-provision" my phone and get my messagebank working again.

Thanks for the excellent service, Ben.

Special thanks also to Anthony at Telstra who flipped the right switches and made the right incantations to get it all working for me.

As an addendum to my report about MyPhoneExplorer that I mentioned yesterday, another nifty feature is that when it's connected to my computer, and I receive an incoming SMS, it pops the SMS up on my compuer screen. Plus when someone calls on the mobile while its connected to the computer, a popup flashes on the screen to tell me someone is calling, and it tells me who the caller is.

I am a very happy customer now!

Thursday, January 11, 2007

It's a Sony :)


I love my new Sony K800i mobile phone.

I can email, take photos, videos, browse the net, watch Fox-Tel, listen to the radio and use it as an MP3 player. Mine came with a 500mb memory stick, and a nifty little adapter so you can plug the stick into your laptop.

I have two gripes:

GRIPE 1. The softwae that comes with it is useless. This bloatware is almost 50mb to download. It fails to install, with heaps of DLL errors. Gives errors when you uninstall it, blurts out wierd pop-up messages in chinese when I reboot my machine, and renders the phone unusable when connected to the laptop via USB.

SOLUTION 1. A FANTASTIC program called MyPhoneExplorer - it's free, only 2mb in size, installs with no problems, does everything the Sony software pretends to do and more, and is easy to use. It even has a great utility where you can use your computer keyboard to navigate around the phone rather than pressing the small keys on the phone. If you download it and like it, don't forget to send a donation to the author. He accepts paypal.

GRIPE 2. Telstra. It took 18 hours to get my new 3G Sim Card activated. While they were doing that, by messagebank service died. I tried phoning them 4 times, each time on the phone for 30 to 40 minutes. On 3 of those occastions they cut me off after 30 minutes.

SOLUTION 2. Any suggestions? I won't touch Optus with a barge-pole because they're majority owned by the Singapore government who has the nasty habit of executing people by hanging. I don't know anything about Voda, 3 or AAPT. Telstra is sort of like an alcoholic uncle. You don't like him very much, he does nasty things, but you're worried if you swap him for someone else's uncle you might end up with someone even worse.

Tuesday, December 05, 2006

This is "cool" (well not as hot as it used to be).

The screen on my LG LW70 laptop is slowly degrading. Every week I get a new vertical line on it as the pixels die.

I've got an extended warranty on it, so I could return it to get a new screen, but I run my life and my business on my laptop, so I'd rather buy a new one than let it out of my sight for more than a few hours.

I noticed that it was pumping out a lot of heat from the heatsink on the left hand side of the unit, and thought that was normal for laptops. But when the next vertical line started flickering on my screen I got desperate and googled "lg lw70 laptop temperature" and discovered a new utility.

Speedfan (http://www.almico.com/speedfan.php) is a clever utility that monitors the temperature of a PC at several different points (HDD, CPU, Video) and lets you configure responses to certain events if the heat gets too high.

To my horror, when I ran it on my laptop, I discovered that it was running at 66 Celsius, which is pretty hot.

I racked my brain trying to figure out a way to reduce the temperature and came up with two ideas:
  • I put the laptop on a U-shaped metal tray. The U-Shape meant that air could get underneath it, and the metal tray conducted the excessive heat away from the laptop.
  • I made the windows power schemes the same whether the laptop is running on batteries or not. So the HDD spins down after 5 minutes, and the Laptop tries to conserve as much power (i.e. produce as little heat) as possible.

The results were drastic. The laptop temperature dropped from 66C down to 44C in about 2 hours.

It won't undo the heat damage that's already been done to my screen, but at least the screen won't sustain any more damage.

Now all I have to do is figure out how to live without my laptop for a week so I can get it repaired :)

I'd recommend speedfan for any machine that has a decent bios and allows monitoring of temperatures.

Friday, September 01, 2006

Sharepoint doesn't send out alert emails

There are a lot of useful articles in the Microsoft Knowledgebase to help you resolve the problem where sharepoint won't send out email alerts. Some of them are really complex.

BUT!!!! Before you spend hours (like I did) trying all the complex solutions to make it work, try the simplest solution first:

Make sure your mail server allows relays from itself. In exchange, go into the SMTP server properties (Start / Programs / Microsoft Exchange / System Manager / Servers / My Server / Protocols / Smtp / Default Server / Access / Relay / "Only the list below" - Granted to 127.0.0.1.

Wednesday, June 21, 2006

Memes and viruses of the mind

A while ago I posted my thoughts about "The Virus of Ideas".

Since then I've been lucky enough to discover the work of Richard Dawkins. His 1991 article "Viruses of the Mind" explains the concept of an idea being analogous to a virus that infects the mind.

He says:
Like computer viruses, successful mind viruses will tend to be hard for their victims to detect. If you are the victim of one, the chances are that you won't know it, and may even vigorously deny it. Accepting that a virus might be difficult to detect in your own mind, what tell-tale signs might you look out for? I shall answer by imaging how a medical textbook might describe the typical symptoms of a sufferer (arbitrarily assumed to be male).
It's worth reading his description of those symptoms. Check out his article if you get a chance - especially if you think you might have been infected :)

Tuesday, August 16, 2005

Easy backup

I downloaded Image for Windows (IFW) from http://www.terabyteunlimited.com/imagew.html

It lets me backup my entire hard drive to DVD or CD. Plus it makes the DVD or CD bootable. That means if my hard drive ever crashes, I just boot from the DVD, and it will automatically restore everything.

Amazing. Easy to use. Only $US 27.

My only gripes:

1. It doesn't write to DVD-RW so you can't re-use DVD's.
2. Someone stupid like me could accidentally boot from a DVD and wipeout everything on the hard drive.

Both those gripes are solvable - just use cheap DVD-R disks, and (easier still) don't be stupid.

I'll email their tech dept and let you know if they have a solution for the DVD-RW's.

Addendum (17-Aug-05)

IFW can handle DVD+RW disks without any problems. DVD-RW's need to be fully blanked or brand-new before they will work. So I think I'll buy some +RW's and see how I go! The article is here: http://terabyteunlimited.com/kb/article.php?id=215

Thursday, August 11, 2005

Crash recovery - a litany of errors

Here's how NOT to recover from a faulty hard drive.

I turned on my laptop and got an error while booting about a faulty NTLDR.SYS file - or some name like that. The error said to insert the Windows CD and select option "R" to recover.

My Acer laptop didn't come with a Windows CD, it came with a "Recovery CD". So I inserted that CD, booted from it, and the damned thing started formatting my hard drive. Yes there was some vague warnings in broken English about backing up data, but I was expecting to see a Windows message, and got something totally different.

"Ah!!!!" I screamed as I saw what was happening, and turned my machine off in the middle of the format.

Now the disk drive was partially formatted, and had no directory info on it.

So I plugged in my trusty USB drive backup, and went about getting the machine ready to Ghost the backup drive back to the original drive.

Getting a laptop to boot from a CD and run Ghost is an effort in itself and took me about 2 hours to figure out. If you want to try it yourself, get Ghost to burn a bootable floppy that does the same thing, and use something like UBCD to convert the floppy to a CD.

So I ghosted the backup drive back to the laptop, booted the laptop and.... NOTHING. The USB drive was faulty, and the backup drive was unreadable.

"Ah!!!!" I screamed again in a Homer Simpsonesque panic.

I ran Spinrite on the USB drive in a vain attempt to fix it. But the back up drive was faulty (remember, Neil?) and so it just made things worse - and I lost the partition table on the backup drive.

So I threw the USB drive caddy out the window, and connected te Backup drive to a spare IDE port on my desktop computer. Still no joy.

So I tried a thing called "Diskpatch" which is supposed to fix partition tables. It said a few encouraging words, and did absolutely nothing.

Finally, I tried a thing caled "iRecover". It was able to see stuff on the drive. Most of it was scrambled, but I used it to pump as much corrupted data from the drive as I could.

It has been running for about 7 days, and has almost finished pumping everything from the 60GB backup drive. about 75% of the stuff is rubbish. I was able to recover one or two snippets that were some use to me.

Bottom line - I lost about 6 months worth of work - but was able to scrounge a lot of it back from other sources.

I NEVER EVER want to go through this again. It's bad for my health, my marriage and my business. Here's what I will do in future:

1. Backup more regularly to multiple locations.
2. Use something like NTI to create a bootable backup DVD of my drive.
3. Get a new Laptop - the Acer Travelmate is rubbish.
4. Never try to run windows repair on a faulty drive until I've pumped it for all the information I can.
5. Never trust a USB drive. Especially one that runs hot.
6. Backup more regularly to multiple locations.
7. Buy high quality equipment

The other thing with Laptops - don't move them around until you've put the machine in standby mode. If you do, the diskdrive is still spinning, and there's a good chance you'll stuff the drive up.

You will have one of your disks crash on you sometime in the next few years. It's happened to me 4 times in the last 12 months on 2 different machines. Make sure you can recover from it. Do something about it today.

iRecover is available from http://www.diydatarecovery.nl

It works, but it is damned slow.

Saturday, March 12, 2005

Loan repayment calculations and high school algebra

FV = (PMT*(1+RATE*TYPE)*(1-(1+RATE)^NPER)/RATE) - PV*(1+RATE)^NPER

This is the formula for the "Future Value" (FV) of an investment assuming an initial investment (PV), constant repayments (PMT) and a constant interest rate (RATE) over a fixed term of months (NPER). When "TYPE" is zero, loan repayments are made in advance. When "TYPE" is 1, loan repayments are made in arrears.

You can algebraically rearrange the formula to give an expression that calculates PMT.

You can also rearrange the formula to give an expression that calculates PV.

Both of these just require simple high-school algebra.

But you CAN'T rearrange the formula to give an expresion that calculates RATE or NPER.

To work out these figures, you have to use an iterative method where you "plug in" a guess of what you think the rate or period should be, evaulate the result, and adjust your guess accordingly.

If you use some smart iterative methods, you should only have to loop about 5 times. The simplest way is given two guess / result pairs (x1, y1) and (x2, y2), and wanting to find the "x" which will result in "y", your next best guess is to try x = y*(x1-x2)/(y1-y2).

In subsequent iterations, discard the (x,y) pair furthest from the desired result, and repeat the process with the new results.

RAID-1 Upgrade (RTFM!!!)

My server had 2 x 60gb Seagate IDE drives in a software RAID-1 array.

For those of you who don't know, this means that although I had two 60gb drives in the server, it only looked like I had one, because I'd set it up so that Windows kept a "mirror" of the drive. That meant that if one drive failed, my machine would still work ok because the "mirrored" copy would still be available.

One of the drives recently started showing errors, so I decided to replace it.

Although 60gb drives are still available, I decided to replace the array with two 160GB drives to give me a bit more space.

The big question was, how to replace the drives without taking my server offline for too long?

One alternative would be to break the mirror (remove the faulty drive from the machine) and replace it with the new 160GB drive, then add that 160GB drive to the mirror. Althoug I wasn't 100% certain, I thought that if I did this, the 160GB drive would only use 60GB of the available space, and I'd be wasting most of it. Despite this, the advantage would be that the machine would only be offline just for the time it took to replace the drive and turn it back on again.

Instead of this approach, I decided to add one of the 160gb drives to the machine as a 3rd disk drive. I would then use Norton Ghost to copy the contents of the mirrored volume onto the new drive. The disadvantage of this approach is that Norton Ghost requires the machine to be offline while it runs in DOS mode to copy the entire contents of the drive, ensuring that nothing gets changed inadvertently while copying from one drive to another.

For some reason I cannot fathom, 10 minutes after starting the Ghost, the screen on the server went blank, and the server died. Initially I thought it was just some sort of lowlevel screen saver in the video card (optimistic, aren't I?) so I left the machine for a couple of hours, hoping that ghost would finish.

Eventually, after trying the same process several times, I came to the conclusion that ghosting a mirrored volume just wasn't going to work. I thought perhaps it was because my power supply couldn't cope with 3 drives, tape drive and DVD drive and so disconnected the DVD and tape. This still didn't fix the problem, so all I can suggest is that Ghost doesn't like copying mirrors.

In the end, I read the instructions on the label of the new disk drive, downloaded a utlility from http://www.seagate.com/support called "DiscWizard for Windows" and ran it.

It's great!!! It found my new drive, formatted and partitioned it for me, then asked me if I wanted to replace an existing bootable drive. I said yes, it copied all the files, then gave me a printout telling me what jumpers to change on each of the drives, and whereabouts on the IDE cable to put the new drive. All with friendly illustrations.

AND it did all the copying while the server was still online.

AND (best of all) it worked!

The added bonus is that DiscWizard is free. It comes with all Seagate drives.

So the moral of the story is that I was trying to be too smart. In this situation, if I had just RTFM (read the fine manual) I would have saved myself about 12 hours of frustrating heartache.

Today I've got two 160gb drives in a mirrored array, and feel very relieved that it's all working again. I'll know next time how to swap my disks over with the minimum amount of messing around.