Friday, July 5, 2013

C++ fundamentals

In classical inheritance where objects are defined by classes, classes can inherit attributes and behavior from pre-existing classes called base classes, superclasses, or parent classes. The resulting classes are known as derived classes, subclasses, or child classes.

class SuperClass
{
public:

SuperClass(int foo)
{
// do something with foo
}
};

class SubClass : public SuperClass
{
public:

SubClass(int foo, int bar):SuperClass(foo) // Call the superclass constructor in the subclass' initialization list.
{
// do something with bar
}
};

Virtual Inheritance

Abstract Classes

Friend Classes

Explicit Constructors
http://weblogs.asp.net/kennykerr/archive/2004/08/31/Explicit-Constructors.aspx

Virtual Methods

Pure Virtual Methods

Singleton

Static Methods

Templates

Initialization List

Namespace

Function Overriding

Function Pointer

Pass by Value, Pass by Reference, Pass by Pointer

Sunday, May 5, 2013

Enable toolbar and menu bar in Firefox popups


Firefox doesn't show toolbar and menu bar in popups by default. So you won't be able to do things like print preview, etc or play around with the url. Pop ups appears by default as in the image below.



To enable it open about config by typing about:config in address bar. "This might void your warranty!" warning page may appear. Click the button "I'll be careful, I promise!", to continue to the about:config page.

In the Search box at the top, type dom.disable_window_open
You will see various options. These value of these options could be toggled between true and false by double clicking the particular option.

The main options are:
  • dom.disable_window_open_feature.menubar
  • dom.disable_window_open_feature.toolbar

Below you would see what happens when you set dom.disable_window_open_feature.menubar to true



In this case the menu bar appears, but the address bar url is read only, as you see it's greyed out. So you cannot edit the url and play around with it (for whatever reasons you want to play around).

Below you would see what happens when you set dom.disable_window_open_feature.toolbar to true



In this case the tabs appear and the address bar url is not greyed out. So you can edit it and play around.
But in this case the menu bar is not present. So you cannot do things like print preview, etc.

Below you would see what happens when you set dom.disable_window_open_feature.menubar and dom.disable_window_open_feature.toolbar both to true



In this case the tabs appear, the address bar url is not greyed out and also the menu bar appears. So all the requirements for this blog post is accomplished.

Disable Session Restore when you open Firefox after a crash.


Due to unexpected issues such as problems with a website, software errors, or an accidental loss of power, Firefox may unexpectedly close. In these situations, Firefox can restore the pages that you were visiting when it is restarted. Firefox will automatically restore your previous session, the first time you launch it after a crash.

If Firefox crashes a second time, the Restore Session (i.e. "Well, this is embarrassing") page will appear when you next launch Firefox.


  • To restore your previous session, select the windows or tabs you want to restore and click Restore.
  • If Firefox continues to experience errors when windows and tabs are re-opened, you can launch Firefox without restoring these items. Click Start New Session.
When you've set Firefox to show your windows and tabs from last time

You can set Firefox to always show your windows and tabs from your previous session each time you start Firefox. To change your Firefox startup settings, see Configuring session restore, below.

Session Restore may keep you logged in to sites that you were logged into before you closed Firefox. If someone else used your computer after you, they could access your account on these sites. If this is a concern then you should not configure Firefox to open all windows and tabs from your previous session.

You may also wish to disable the Session Restore crash recovery feature which is enabled by default. This will prevent restoring a previous session when Firefox is opened after an unexpected close or software crash:
  • In the Location bar, type about:config and press Enter.
  • The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise!, to continue to the about:config page.
  • In the Search box at the top, type browser.sessionstore.resume_from_crash.
  • In the resulting grid, double-click on browser.sessionstore.resume_from_crash to set it to false.

Tuesday, February 19, 2013

Root Micromax A80


There is no custom ROM for A80 yet. If you just want to root it without backing up anything, here is an easier way to do.
Essentially you use the SP Flash tool to overwrite just the stock recovery image with CWM recovery. Then go to recovery and install uniroot2.signed.zip.
So you will now have the stock Micromax A80 ROM, but rooted and with CWM recovery.

For this you will need
1. USB Drivers. Link -> Drivers.zip
2. SP Flash tool. Link -> SP_Flash_Tool_v2.1121.01.zip
3. Micromax A80 scatter file. Link -> MT6573_Android_scatter.txt
4. CWM recovery image. Link -> recovery.img
5. unitroot2.signed.zip file. Link -> unitroot2.signed.zip

It seems installing USB drivers is the most trickiest part. So try the following in the order it is mentioned below:
1. Unzip Drivers.zip. It will unzip to a folder named "Drivers".
2. Whenever you plug in the USB cable and you are presented with missing drivers dialog, select "Browse my computer for driver software" and then click Browse button and select the Drivers folder obtained from Step#1. It contains all the possible drivers.
If you are not presented with any missing drivers dialog at all, check Device Manager for phone or android related drivers with a question mark or asterisk icon. Right click on it and select "Update Driver" and then carry out as mentioned in Step#2.
3. If the above method fails, plug your phone to PC via USB cable first and then install PdaNet+ for Android. Link -> PdaNet+ for Android
PdaNet+ for Android installs the necessary drivers for the phone automatically.

Rooting Procedure:
1. Create a new folder and put the Scatter file (MT6573_Android_scatter.txt) and recovery image (recovery.img) file in it.



2. Connect your phone to PC and put unitroot2.signed.zip in the root of sdcard.
3. Switch off the phone and connect the microUSB cable to it, but not to the PC yet.
4. Open SP Flash tool



5. Click on "Scatter-loading" button, and browse to the folder where you kept the scatter file and select the Scatter file. Press ok for the pop up.



It would automatically load the recovery image file (since it was in the same folder) and that would be the only one that is checked.



Click "Download". A countdown would start with 14 seconds remaining.
Plug the microusb cable to PC within 14 seconds. As soon as the phone is detected, the countdown will stop and a yellow progress bar will start.



After it has finished, a pop up would appear saying that recovery has been downloaded to phone.



Press OK and then one more pop up with a green circle saying "Download OK" would appear. This means everything is OK.



Close that pop up and close SP Flash tool.

Press the Volume Up button and power button simultaneously. Keep them pressed till you get into CWM recovery.

You will see "CWM_based Recovery v5.0.2.8" with blue letters. Use Volume Up or Down button to scroll down or up. Use Power button to select an option.

1. Select "install zip from sdcard"
2. Select "choose zip from sdcard"
3. Select "unitroot2.signed.zip"
4. Select "Yes - Install unitroot2.signed.zip"

You will see the following
CWM_based Recovery v5.0.2.8

-- Installing: /sdcard/unitroot2.signed.zip
Finding update package...
Opening update package...
Installing update...
...Starting Rooting...
...Copying System Files...
...Installing root...
...Installing busybox...
...Installing Superuser...
...Rooting Complete!...

Install from from sdcard complete.

5. Select "+++++Go Back+++++"
6. Select "reboot system now"

After it reboots, you will have a rooted Micromax A80.

Wednesday, January 23, 2013

Vodafone USSD Codes

Vodafone Care USSD - *111#
Choose ur language
1.Hindi (on supported handsets only)
2.English

Option 2
Press Answer, type number, press call button
1.My Delights
2.My Balance
3.Last 3 Charges
4.Last 3 Recharges
5.Data Plan
6.Bonus Card
0.More

Option 0
Select from following options:
7.Best Offer
8.Low Balance Services
Press # for main menu

Option 7
1. 25 STD Min @ Rs8
2. Full Talktime 130
3. 1 GB Data @ Rs24
4. Bonus Card 46
5. 80 SMS @ Rs6
To know details select from above op

Option 8
Prepaid Low Balance Services
1.Balance Transfer
2.Balance Request
3.Call Me Back
4.Chhota Credit
5.My Delights
Press Answer button type no , press call button

Vodafone Offers USSD - *121#
Special offers for you are:
1. 25 STD Min @ Rs8
2. Full Talktime 130
3. 1 GB Data @ Rs24
4. Bonus Card 46
5. 80 SMS @ Rs6
0. More
Select from above options

Option 0
1.My Delights
Select from above options

Option 1
1. Bid to get Petrol worth Rs10000
2. Get Free Deals
3. Jhakas Deals
4. Majhi Maharashtrian Deals
5. Info
Press # for main menu

Vodafone Offers 2 USSD - *444#
1.Daily Bonus Cards
2.Night Bonus Cards
3.SMS Bonus Cards
4.My Delights
5.GPRS Packs
6.Happy Hour
For details,Type Option & Press Call Button

Vodafone Balance USSD - *141#

Vodafone Alerts USSD - *123#
Welcome to Vodafone Alerts!
1.Google Lite
2.Top Services
3.Money Saver Packs
4.More Categories
Reply with 1 OR 2 OR 3 OR 4 (tollfree)

Option 4
Categories
1.Sports Pack
2.Bollywood Pack
3.Daily Packs
4.Infotainment
5.Devotional
6.News Pack
7.Finance
Reply by 1 to 7 and press call

Option 1
Welcome to Google Lite
1.Weather
2.Definitions
3.Translate
4.Movies
5.Railways
6.Stock
7.Currency

Option 2
Top Services:
1.Jokes
2.Quran Pack
3.4 in 1 Sports
4.Love Daily
5.Astrology
For more info, reply with 1 OR 2 OR 3 OR 4 (tollfree)

Option 3
Money Saver Packs:
1.Devotional Pack
2.All News
3.Super Combo
4.Love Combo
For more info, reply with 1 OR 2 OR 3 OR 4 (tollfree)

Vodafone Caller Tunes - *567#