Saturday, July 18, 2009

Difference between pointer and reference in C++

pointer and reference in c

Puppy! Can Move/Change? -  is a *Pointer in C++

reference in c

Statue! – Can’t change  - is a &reference in C++

Correct code -

int *p = &i;

int k;

p = &k;

Incorrect code -

int &b = a;

int c;

int &b = c;

While creating a reference, it has to be necessarily initialised to some variable or an object. Trying to create a standalone reference i.e. int &b; and then assigning it to some variable i.e. b=a; will not only generate an error, but would also be meaningless, since at the time of its creation itself, a reference has to refer to some variable.

Although references are internally maintained using pointers, there's a subtle difference between a pointer and a reference. The address contained in a pointer variable may be changed at any point in the program that makes it a flexible connection. However a reference once created, cant refer to any other object thus it is a rigid connection.

A pointer has to be de-referenced before you can access the value at the address contained in it. A reference is moreover a direct connection as its just another name for the same memory location.

You can have an array of pointers whereas you cannot have an array of references.

 

 

Tuesday, July 14, 2009

Carry your OS in a pen drive

You can carry your OS in the pen drive. Isn’t it amazing. Most of the time it is very heavy and inconvenient to carry laptops with you. But getting a PC wherever you travels is easy these days. So What you have to do is plug in the pen drive in the PC available. Make that PC boot from pen drive by BIOS setting. and once the PC is booted enjoy the altogether all your PC with your desk tops, your documents, your database, your web server, Your web site and what not. This is possible with Linux. preferred flavor would be Ubuntu for which it is available in two flavors

usb-linux

1. Desktop Edition

2. Server Edition.

But the Server Edition is not provided with GUI / Xwindows. But if you want it on it Don’t worry. First install the desktop edition. and then upgrade the desktop edition to server by installing the additional packages. (This is the simplest way to do it I encountered rather that downloading Xwindows and installing it)

Steps to install Ubuntu

Ubuntu 9.04 has the self explanatory steps after inserting the CD in the drive. (Like Windows)

For older version or manual installation you can follow the following steps.

Steps in detail for old version/ manual installation 

And most of the users will be moved and attracted by the following Ubuntu promise.

The Ubuntu promise 
  • Ubuntu will always be free of charge, including enterprise releases and security updates.
  • Ubuntu comes with full commercial support from Canonical and hundreds of companies around the world.
  • Ubuntu includes the very best translations and accessibility infrastructure that the free software community has to offer.
  • Ubuntu CDs contain only free software applications; we encourage you to use free and open source software, improve it and pass it on.

(If you register online on the Ubuntu site and ask for the installation CD, they will send it to you free of charge. )

Monday, July 13, 2009

Configuring Security Featuers For Wi-Fi (Wireless) Broad Band Access

Recently Intelligence agencies  have found that terrorists were using unsecured wi-fi connections for sending their emails. Most of the ISPs are  helpless in tracing the user credentials in such cases.

In order to avoid such situations and to educate Wi-Fi users, this step wise procedure  provides an overview of configuring Wi-Fi security features at both PC or LAPTOP & ADSL Modem Level.  These steps may be different for different Wi-Fi ADSL hardware/software. For easy understanding the screen shots of a typical example are only given below.

STEP – I

Open the browser and type the url http://192.168.1.1.

Type username admin and password admin in login window

image

After successfully logging into CPE . Go to Wireless in the main menu and click on the Security button from the list. The following window appears:

image

This window allows the user to configure security features of the wireless LAN interface. User can set the Network authentication and data encryption methods.

Step II

 Select the required SSID (Service Set IDentifier) and Network Authentication. Enable WEP Encryption using the pull down menu. The following screen will appear

image

Step III:

Select encryption strength as 128bit or 64bit.

Enter the network key

- 5 ASCII characters for 64 bit encryption
- 13 ASCII characters for 128 bit encryption

Four network keys can be entered.

Select one network key as the current network key.

Enable the WPA-PSK network authentication from the pull down menu if you desire to use the security as WPA-PSK method of security. Enter the pre-shared key value in the WPA Pre-Shared Key field.

image

Click on Save / Apply Button

To view the configured pre-shared key click on the link Click here to display ‘. This will open a window to show the key that you have configured. This scenario is shown in the below image.

image 

STEP IV

Wi-Fi Configuration in PC/Laptop

You need to configure same WEP key in your PC/Laptop which you have entered in CPE wi-fi security configuration.

For this go to the properties of Wi-Fi connection,

select the tab Wireless Networks.

Select the wi-fi network name ( more than one networks may be present in your area, identify your network by SSID name which is configured in modem. Normally the CPE model name ( say WA1003A) is factory default SSID setting) and click on Properties.

Look for field Data Encryption and network ID, select WEP as Data Encryption and enter the network ID which you have entered in CPE configuration as Encryption Key.

NOTE: These steps may be different for different client Wi-Fi hardware/software. The screen shots of a typical example are given below.

image image

image

Now you can enjoy the secure access to your Wi-Fi.

Followers