Thursday, July 19, 2012

Installing custom ROM in ZTE Blade

How to install  ClockworkMod Recovery v5.0.2.0?
Goto Google Play and Download & Install "Rom Manager"
Open ROM Manager and select "". It will say that you need ClockworkMod Recovery for ROM Manager to run. Select OK. It will ask for the type of phone. Select ZTE BLADE. Select OK. It will install latest ClockworkMod Recovery.

Meaning of terms in ClockworkMod Recovery v5.0.2.0
wipe data/factory reset 
-- Wiping data...
Formatting /data...
Formatting /cache...
Formatting /sd-ext...
No app2sd partition found. Skipping format of /sd-ext.
Formatting /sdcard/.android_secure...
Data wipe complete.

wipe cache partition
-- Wiping cache...

Formatting /cache...
Cache wipe complete.

- advanced
Wipe Dalvik Cache
Dalvik Cache wiped.

- advanced
Wipe Battery Status
Battery Status wiped.

- mounts and storage
format /boot
Formatting /boot...
Done.

- mounts and storage
format /cache

Formatting /cache...
Done.

- mounts and storage
format /data

Formatting /data...
Done.

- mounts and storage
format /sdcard (Formats the whole SD card)

Formatting /sdcard...
Done.

- mounts and storage
format /system

Formatting /system...
Done.

- mounts and storage
format /sd-ext

Formatting /sd-ext...
No app2sd partition found. Skipping format of /sd-ext.
Done.

Boot to ClockworkMod Recovery. Press Vol- button and then press the Power button.
Connect the phone to your computer via USB.
Select -mounts and storage -> - format/sdcard. This will format the whole SD Card.
Select -mounts and storage -> - mount USB storage. This will mount the SD Card as a removable disk in Windows.
Copy & Paste the ROM zip file in the root of the mounted SD Card.
Close the SD Card folder.
Select -Unmount. This will unmount the SD Card as a removable disk from Windows.
Select - install zip from sdcard.
Select - choose zip from sdcard
Select  the zip file
Select -Yes - Install

-- Installing: /sdcard/
Finding update package...
Opening update package...
Installing update...

Install from sdcard complete.

Select -reboot system now

Tuesday, July 10, 2012

DD-WRT Wireless → Basic Settings differences

There are various options in DD-WRT under Wireless → Basic Settings.
http://www.dd-wrt.com/wiki/index.php/WebInterfaceWirelessBasicSettings
They are as follows:
  1. AP (Access Point)
  2. Client
  3. Client Bridge
  4. Repeater
  5. Repeater Bridge
  6. Ad Hoc
Options explained here:
http://www.dd-wrt.com/wiki/index.php/Linking_Routers

A simulation could be found here
http://www.informatione.gmxhome.de/DDWRT/Standard/V24BetaVPN/Wireless_Basic.html
http://www.dd-wrt.com/demo/

The difference between them can be explained better using images.
AP (Access Point)



Client / Client Bridge



Repeater / Repeater Bridge




Monday, July 2, 2012

C++ Notes

Bitwise shift operators
The bitwise left shift (<<) (A << B) operator shifts A by B bits to the left. Just add B number of zeros to the left of A in binary format.

E.g.
6 = 000110.
6 << 1 = 001100 = 12
6 << 2 = 011000 =  24

The bitwise right shift (>>) (A >> B) operator shifts A by B bits to the right. Just add B number of zeros to the right of A in binary format. If there is no room to shift to the right, truncate the bits on the right.

E.g.
6 = 000110.
6 >> 1 = 000011 = 3
6 >> 2 = 000001 = 1 (last 1 is truncated)
6 >> 3 = 000000 = 0 (both 1's are truncated)
6 >> 4 = 000000 = 0 (both 1's are truncated)

Pointer initialized to 0
In C++ a pointer initialized to 0 is equivalent to NULL.
So
int * ptr = 0;
and
int * ptr = NULL;
are identical.
But initializing to any number other than zero is illegal.

Uninitialized pointers contain garbage values. Only Static pointers are initialized to NULL automatically by the compiler.

Function declaration place
Functions should always be declared/defined before it's call (from top to bottom). If it's not defined, at least it should be declared before it's call.
You can declare it inside main() as well, but it should be before the call to it, is made.
If it's defined before main, declaring it after the definition or inside main is redundant.