Wednesday, October 25, 2006

Hex Dump of File For Windows (XD)

I often need to decode contents of various file formats as my line of work. It is often good to be able to read both the HEX and ASCII content of the file. I used to work on Digital Equipment line of products and they had a very nice DUMP format like this,

0: 4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF 00 00 | MZ.......... ..
10: B8 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 | ╕.......@.......
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 E0 00 00 00 | ............α...
40: 0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 | ..║..┤.═!╕.L═!Th
50: 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F | is program canno

But, on Windows I had to some hunting around to find a program that did this. I actually wrote one a long time ago and posted on the web, but the ISP crashed one day, and lost the file forever.

So here it is, there is a freeware called XD from who else, John Walker (of the AutoCAD fame) who now lives in Switzerland and runs The Fourmilab. http://www.fourmilab.ch/xd/

I suggest that you just take xd.exe and then drop that into Windows/System32 directory. This way you can call this handy utiliy anywhere (since there is a default path to that directory).

While you are at it, you should try Home Planet. It is really fantastic and free Home Planetarium software that runs on you Windows. Complete with Cookoo clock (since he lives in Switzerland). There are many other stuff there.

Windows XP - How to Set IP Address From Script

You may run into a sitaution where you move your laptop computer around different networks where static address must be configured. This can be accomplished very easily on Windows XP using the "netsh" command. What you do is to write a command similar to the following in a .BAT file then just double click that .BAT file. (Note that due to the browser formatting, following may look like two or three lines but it is supposed to be type in as a single line command.)

netsh interface ip set address name="Local Area Connection" static 192.168.0.68 255.255.255.0 192.168.0.1 1


What they mean:
  • netsh is the command already built into your XP
  • interface ip set address is the command to set a fixed IP.
  • name="Local Area Connection" is the name of the interface. This is the name of the interface that you can see on your Networks window from the Control Panel.
  • static means it is a static IP
  • 192.168.0.68 is an example IP address that I want to assign
  • 255.255.255.0 is the netmask as an example
  • 192.168.0.1 is the gateway as an example
  • 1 is the routing metric, you can almost always leave this as 1
For more information you can type in netsh, hit return then type a ? then hit return.

Tuesday, October 17, 2006

Visual Studio 2005 C++ Lacking Namespace Issue

After several years of not having had coded in C++, I had to get back and work on some new C++ code on Microsoft Visual Stuido 2005.

When compiling very simple code including a template
#include
... some code...
list theList;

I have started to get a compliler error "error C2143: syntax error : missing ';' before '<'"
Then I started to remember;

You do need to include;

using namespace std;

I am hereby reminding myself to do this.

Tuesday, October 03, 2006

Mac OS X with Windows NTFS USB2/Firewire Drive READ ONLY

To much to my dismay, I have just discovered that if you connect a Windows NTFS formatted external hard-drive via USB-2 or FireWire, you can only READ the file but it does not allow Writing it and here is the technical article.

http://docs.info.apple.com/article.html?artnum=75320

On a related scheme of things, the Mac OS X "Connect To Server" in the Finder allows you to connect to an FTP server to get the file, butLink again, it does not allow you to write to the FTP server (this is not a feature in the Windows IE nor Expolrer either), but it is something you should be aware of. If you need to write file via FTP on your Mac OS X system, you'd be best off with Fetch software. I like it because it support the Automator.

Update on this issue: 17 October 2006

I have tried a bit more at it. I thought that we could convert the format from NTSF to FAT32 non-destructively. Apparently this is not easy to do without buying some commercial tool.

There is something called NTSF for Mac on Source Forge http://sourceforge.net/projects/ntfsosx/ But I have not given it a shot yet. The Forum there says there are some known bugs...