Sunday, September 23, 2012

More about watch repairing

Watch repairing fever hasn't gone down yet. For very long, there was no information available on what is inside Quartz watch.

I started looking into them about 20 years ago and was surprised to know that they have very few parts compared to conventional manual wound watches.

With information gateway around in the form of internet, it has become easy to find information which you need. People are using the medium to share lot of good knowledge they have acquired over years.

I came across this link where they have scanned and uploaded manuals for Citizen/Miyota watch moments. Hope you find this information useful, should you get hooked on to hobby of watch making.

Till next, take care.

Thursday, September 20, 2012

Inside conventional wrist watch

Hi Friends,

Watches are very close to my heart. The hobby, which I picked due to my dear friend Anand Oak about 21 year ago, while working at WRIC.

I am talking about mechanical watches which our dad and grandfather use to wear on their wrist before Quartz watches arrived in the market. Mechanical time keeping machines are engineering marvels in my opinion. The design, the assembly, all has to be in perfect sync to keep almost perfect time. As you know, few of these time keeping machines, specially Swiss made, can cost you anywhere between few thousand to few lacks of US DOLLARS.

Well, I am a hobbies watch maker and like to see to mechanics in it tick. I have spend countless weekends in opening a watch and fixing it all again. My interest is specially in the mechanical watches. They can be divided into two categories. Manual wound and Automatic watches. The mechanical automatic watches do not have any battery to power them, but they use brilliant mechanical design to automate the task of winding the watch for us.

For long, I struggled to find good information on how to disassemble and assemble the watch. I had to rely on my memory or use some other technique to remember the order in which I disassemble a watch. Wondered if there was any authentic document by manufacturer for its technicians to the task, and finally found a place on internet, where someone as passionate as me, scanned and uploaded the document for one of the Seiko made automatic watch, on which I was working. It can be found here

The next step is to make sure, that the efforts of fella are not wasted. I have to use the document to go the next of understanding of this small mechanical wonder, we call "Watch".

Till then, take care.

Monday, August 20, 2012

POE (Power Over Ethernet)

VoIP (Voice over IP) has always fascinated me. I worked on EPABX software in 1993-94 time frame. It was all embedded world then. Smart members of our team developed the EPABX software in C programming language. It was all fun.
After so long, we have free commercial grade VoIP server softwares available, which can be installed on Linux server and used. Cheapest way to use them is by installing soft phones on PC. Other alternative is to use expensive VoIP phone instruments. These instrument come in two forms. One which takes power from Adapter and other ones expect power to be fed to them over regular Ethernet wire, which is generally used for Data communication.

I was very curious to know how power is given to these VoIP phone devices. The Ethernet cable has 4 pair of wire inside it. They are color coded too. The colors used are Green, Orange, Blue and Brown. The diagram below gives you the pin numbering of the RJ45 connector which is used to connect Ethernet cable to your PC, Laptop etc.


We can see from the diagram above, that out of 8 pins of RJ45 connector only 4 are used for Transmitting and receiving data where as remaining 4 pins ( 2 pairs) are reserved, i.e not used.

Basically these 4 pins or two pairs are used to transmit power. There are many schemes used by various vendors but most common of all, is to use pin 4 and 5 for +ve end of power source and pin 7 and 8 for the -ve end of power source.

Again, there is no specific standard on how much power is to be transferred. These pins are used to transmit from 12v to 48v depending on the need.

So these were some basics of POE ( Power over Ethernet)

Till next, take care.
 

Tuesday, August 14, 2012

Custom classloaders in Java

Friends,
I was obsessed with custom class loaders in Java because I faced a real issue while working on the project. The JAX-WS implementation would work on one App Server where the same code would fail on the other. I knew it could be because of Classloaders and how different vendors of App server implement features documented in Specs.
Well, after little reading I realized how a premitive Class loader can be written. Idea was to load a class using custom class loader and test if the same is really loaded using my class loader or by system class loader. If the the class we are trying to load is in classpath, then it gets loaded by system class loader by default and I did not really understand how not to keep my class on the class path and then load it using custom class loader.
I decided to load a class from a random directory which is NOT in the class path. Now I would load the class bytes from the class file for my class but would fail for java.lang.Object. As we all know, every class in Java is child of java.lang.Object :-) Now my class loader would fail because it could not find the class file for java.lang.Object at the specified location. After careful analysis I realized where the mistake was. I was trying to load all the classes (including system classes) using my custom class loader. Then I changed the approach to:
  • Check if the class is already loaded by custom class loader in the cache.
  • If not already loaded, use System class loader to load it for you.
  • If System class loader can not load it, then use our custom logic to load the byte codes from the generated .class file
  • Define and return the loaded class
This is "System class loader first" approach, where is I check if system class loader can load the class for me and use my custom class loader only if it fails to load.
Java also has Class loader hierarchy, which needs to be looked at. The behavious depends upon which method/s we override while extending java.lang.ClassLoader. I still have to look into it.
I managed to get my custom class loader working and also tested with a sample program. I will post it here once the cleanup is done.
Till then, take care.
- Manoj

Nice MBR and FAT recovery tool

Hi,

I have been experimenting a bit about Boot loaders in general for a while now. Found a piece of code, which when loaded onto first sector of first track etc, recognizes the hard drive as a bootable drive and prints message etc.

In the frenzy of testing this code, I used my 8GB pen drive, which had lot of valuable data on it and updated so called MBR ( Master Boot Record ). Needless to say that the experiment failed.

I had a pen drive with data on it, but just MBR overwritten with junk bytes on it. The Windows would recognize the drive, but said, it needs to be formatted. Linux sensed the pen drive connected, but would not mount the media as it did not find correct information in the MBR.

I was determined to NOT to format the pen drive and loose all the data on it. Tried lot many tricks, but they didn't work.

Finally, came across this wonderful free tool at http://www.cgsecurity.org/wiki/Advanced_FAT_Repair, which did the trick.

The tool is simple and easy to use and did precisely what needed it to do. It restored my MBR with default and I managed to see ALL my data intact on the pen drive.

Now, it has made me think more about bit and byte of format process. Will pen down my Boot Loader experiment once I see some ray of hope.

Till then, take care.