Ubuntu Virtualbox Cannot register the hard disk fixed

Sunday, April 27, 2014 12:55 PM 0 Comments , ,

i found this problem after upgrade from Ubuntu 12.04 to 14.04. the problem is  cannot register the hard disk UUID because UUID already exists.



We need to change hard disk uuid from command line

vboxmanage internalcommands sethduuid vmimage.vdi


After change hard disk UUID, We need to add vm image to Virtualbox





Done. Happy!!!

0 comments:

Java Android Pause / Resume Thread

Monday, April 21, 2014 2:07 PM 0 Comments

This example from stackoverflow. Thank You Wroclai


class YourRunnable implements Runnable {
    private Object mPauseLock;
    private boolean mPaused;
    private boolean mFinished;

    public YourRunnable() {
        mPauseLock = new Object();
        mPaused = false;
        mFinished = false;
    }

    public void run() {
        while (!mFinished) {
            // Do stuff.

            synchronized (mPauseLock) {
                while (mPaused) {
                    try {
                        mPauseLock.wait();
                    } catch (InterruptedException e) {
                    }
                }
            }
        }
    }

    /**
     * Call this on pause.
     */
    public void onPause() {
        synchronized (mPauseLock) {
            mPaused = true;
        }
    }

    /**
     * Call this on resume.
     */
    public void onResume() {
        synchronized (mPauseLock) {
            mPaused = false;
            mPauseLock.notifyAll();
        }
    }

}

0 comments:

How to fix Ubuntu 14.014 ctrl+space do not work

Sunday, April 20, 2014 3:15 PM 1 Comments , , , ,

After i updated my ubuntu from 12.04 to 14.04. i founded problem ctrl+space key shortcut for code assist not work in Eclipse and Netbeans again. This is the solution to fix it.

1. Open Terminal run this command

ibus-setup

2. On next input method, delete ctrl+space



3. After deleted, Ctrl + Space will working fine!!!! Happy!!!

1 comments: