Sunday, December 2, 2012

Clone your existing HDD/SSD to a new HDD/SSD mac

If you are installing a new hard disk or a new SSD in your mac but dont want to go through the hassle of installing the OS or applications again, this is for you.

The software which makes this possible is 'Carbon Copy Cloner' (you can try it for free for 30 days). You can download and install it from: http://www.bombich.com/index.html

These are the steps:
1. Put the new disk in an USB enclosure and connect it to the mac (or alternatively you can use a data transfer cable...as long as you can see the new disk connected, you should be good).

2. Format the new disk drive by doing the following:
- Go to Disk utility (Applications -> Utilities)
- Go to the erase tab
- Format the new disk to 'Mac OS Extendend (Journaled)'

3. Open carbon copy cloner.
- In the source disk: Select your source disk as the one you want to clone (in most cases it will be called Macintosh HDD). Beneath the source disk you can select and deselect what you want to clone. I would recommend just cloning everything if it can fit on the new disk.
- For the target disk, select your new disk (which you have formatted in step 2)

4. Click on clone button. The amount of time will depend on the amount of data to be cloned.

5. Open up your mac and replace the old disk with your new disk.
[If you are changing from HDD to SSD, enjoy the new blistering speeds :) ]


Steps are mentioned in detail here:
http://mac101.net/content/how-to/simple-hard-drive-cloningbackup-with-carbon-copy-cloner/

Running applets on mac after apple update

Due to an apple update, it is possible that the applets wont run on your mac.

To fix it, you can download and install Java 7 (jre should be good enough) from Oracle website: http://www.oracle.com/technetwork/java/javase/downloads/index.html

As of this writing chrome says that its 32-bit and that java 7 only runs on 64-bit. But you can open it in safari and it should work fine. I haven't tested on firefox.

Tuesday, May 15, 2012

Sorted Linked List To Balanced BST

Marker Interfaces

Marker interfaces are interfaces which do not define any functions. But by using the language capabilities (for e.g. reflection in java) you can have a certain capabilities if a class implements a marker interface.

for e.g. Suppose you have a marker interface 'MarkerInterface'

public interface MarkerInterface
{
    // Nothing here
}

Now you can check if any class implements the MarkerInterface and provide a functionality by doing something like this:

if(object instanceof MarkerInterface)
{
   // do something specific
}

These are a few interesting links that can tell more about Marker Interfaces:
http://en.wikipedia.org/wiki/Marker_Interface_pattern
http://geekexplains.blogspot.com/2009/10/marker-interface-in-java-what-why-uses.html
http://www.coderanch.com/t/409760/java/java/Marker-Interface
http://www.jguru.com/faq/view.jsp?EID=224126

And of course you can google to find out more..