Monday, April 8, 2013

How to get the classic start menu in Windows 8?

Here are the steps to get a classic start menu with out any 3rd party apps:

1. Right click on taskbar
2. Select Toolbars > New toolbar
3. Enter "%ProgramData%\Microsoft\Windows\Start Menu\Programs" as the value for Folder:
4. Click on the 'Select Folder' button

You are done.

How to partition hard disk using Live CD (Ubuntu)

I end-up destroying the Windows primary partition after installing Ubuntu and later the Windows was complaining 'No hard disk found due to the incorrect partitions'.

To repartition your hard disk using Ubuntu:
1. Boot from the Ubuntu as a Live OS
2. Press Ctrl + Alt + T to start the terminal
3. Issue the command 'sudo gparted'

Now the gparted GUI will be opened. Delete the partitions and recreate a Primary partition and an Extended partition. The extended partition can be sub divided again into logical partitions.

Thursday, April 4, 2013

How to loop through a std::map and deleting entries using iterator in C++

Once you call map.erase(iterator) the iterator will be invalidated. What you need to do is something like:

for(iterator=map.begin(); iterator != map.end(); )
{
    del_iterator = iterator;
    iterator++;
    map.erase(del_iterator);
}