Saturday, March 17, 2007

Recovering CHK files

I have an old One-Touch external hard drive from Maxtor. It went crazy and generated 10,000 FILE????.CHK files about a year ago. My wife and I were worried about that the entire hard drive has gone unstable so we simply gave up using it. Recently I found some spare time trying to search for some tools to recover those CHK files.

RecognizeImageFiles.py


One of the most important file types to recover is our photos. The first step I tried was to find some python script that can recognize image files by file content but not by file extensions. There is indeed such a nice little script imghdr.py in python repository. I modified it a little to have it specifically useful in CHK image file recovery (RecognizeImageFiles).
Screenshot of RecognizeImageFiles.py execution

It was quite successful and about 500 image files were recovered. But then, what about other types of files? I went online to search for third-party tools.

UnCHK and FileCHK


Surprisingly there isn't too many tools online. The most popular tools seem to be UnCHK (by Eric Phelps) and FileCHK (by Martin Kratz). They seem to be neat and useful. However, UnCHK (version UnCHK3) froze at the very beginning:



and FileCHK gave an error that reads:

Runtime error "9":
Subscript out of range

It's possible that they couldn't recognize my One-Touch in drive F. Whatever, they don't work in my case.

MediaHeal


I then found a MediaHeal from officerecovery. The description reads:

Recovers files from corrupted hard disks. Supported are all common file systems, including NTFS, FAT12, VFAT12, FAT16, and FAT32.

I downloaded the MediaHeal for Hard Drives and gave it a try. Unfortunately, this program only aims at the entire hard drives but doesn't allow users to check folder(s):

MediaHeal doesn't allow you to choose a folder (image shrunk to fit screen)

Much worse, it froze at the very beginning on this screen:

The excution of MediaHeal demo version froze at the very beginning
(image shrunk to fit screen)


RecoverMyFiles


Finally, I found RecoverMyFiles from GetData. According to their website, this program allows users to recover deleted files even after the hard disk is reformatted (I didn't even know that it's possible):

Recover deleted files even if emptied from the Recycle Bin
Recover formatted hard drives, even if you have reinstalled Windows!
Recover your files after a hard disk crash
Get back files after a partitioning error
Recover documents, photos, video music and email.
Recover from hard drive, camera card, USB, Zip, floppy disk or other media

and it's able to recover 200 types of files. I downloaded the trial version and was amazed how efficient it was:

The screenshot of RecoverMyFile excution.

It ran smoothly and took less than 4 minutes to complete checking my 250GB One-Touch. You can check the content of each file to decide what file is valuable. Since this is a trial vresion so it doesn't allow real rescuing. But it already impressed me.

Other links


FILExt.com
http://filext.com/detaillist.php?extdetail=chk&Search=Search

Look for info about a file ext
http://shell.windows.com/fileassoc/0409/xml/redir.asp?Ext=jpg

A list of common file extensions
http://safari.oreilly.com/0596002491/winxpnut-APP-F

OfficeRecovery.com (data recovery software for corrupted files)
http://www.officerecovery.com/mediaheal/index.htm

Thursday, March 15, 2007

HTML Tablizer

Introducing a html tablizer -- an online utilite to make simple html table.

The program has an Input Section and Output Section:


Enter your table data in the Input Section and either hit [Submit] button or simply move the cursor away from the input box. Then the resulting table will be shown immediately in the Demonstration in the Output Section. Also, the corresponding HTML code will be displayed in HTML code for copy and paste.

After the HTML code and the demo result are shown, you can modify the HTML code and see the result immediately:



If the resulting table is too wide:



You can hit the button [demo on top] to bring the table up:



Enjoy tablizer here.

Friday, April 14, 2006

Blogger Favelet (1)

Set folding

People who wrote frequently on blogger would soon find that they have a long list of articles jamming on the same page. Some of the templates provided by blogger do have a list of article titles on the sidebar for readers to click. But in some templates those article list is either not shown or is hidden far below and not so eye-catching.

Recently I came up with a favelet to deal with this. The entire code reads:

javascript:function gcls(c) {void(arr=[]); void(es= document.body.getElementsByTagName("*")); for(var i=0; (e=es[i]); i++) {if (e.className==c) arr.push(e)} return arr}; function each (a,f) { void(o=[]); for (var i=0; (x=a[i]); i++) {o.push(f(i,x))} return o} function h(c) {void(each(gcls(c), function(i,x) {void(x.style.display='none')}))}; h("post-body"); function nd(t) { void(ss=t.parentNode.childNodes); for (var i=0; i<ss.length; i++) {void(u=ss[i]); if (u==t) {return ss[i+2] }}}; void( each(gcls("post-title"), function (i,x) {x.style.cursor= 'pointer'; x.onclick= function() {void(y= nd(x).style); y.display= y.display== "none"? "block":"none"} }))
It does look ugly, doesn't it ?

What it will do is:
  1. Find all the post contents and hide them;
  2. Find all the post title, and assign an onclick eventhandler to each of them, such that when clicked, their corresponding content is either shown or hidden.
How to use it ?
  1. Go to the bookmark manager of your browser and create a new bookmark;
  2. To the "url" entry, copy and paste the above code. Note that entire code should all be in one line.
  3. Give whatever name you want. For example, "Set Folding";
  4. Click [OK] to accept the settings;
  5. When you are reading a blogger, click this bookmark.
It should turn Fig.A into Fig.B:




Fig.AFig.B

Clicking on the title will show/hide the content of each article.

Friday, March 31, 2006

Document loading order

The other day I was learning about how a document is loaded by a browser. I use the <script> tag to insert definitions of different variables at different stages of a document(#2). Then I wrote a function showVars() to check the availabilities of those variables (#1). This showVars() is called at different locations (thus different stages during loading steps) of a document(#4). The output will tell us how a document is loaded.

Other than those defined variables, showVars() also checks the availabilities of document.body and a <div> that is placed in the end of the <body> (#3).



The result shows some interesting features:



-- Retrieving a tag from inside <body> section by document.getElementById() works even before the document starts loading (#1);

-- document.body is available for javascript right after the loading enters <body> tag (#2)-- doesn't have to wait until the entire loading process is completed;

-- A javascript variable V defined with a <script> tag that is inserted into <body> section is availabe only to those javascript code AFTER V is defined;

-- A javascript in body.onload (<body onload="??">) is executed after all elements are loaded, so it can access all of the variables defined anywhere in the document (#7).
javascript, dom


Related

Dean Edwards: The window.onload Problem - Solved!
http://dean.edwards.name/weblog/2005/09/busted/
http://dean.edwards.name/weblog/2005/09/busted2/