Ads

Saturday, December 27, 2008

Introducing perl, Part - II

Perl data types and variables

There are three main types of data and four types of variables supported in perl.

Scalar data and variable: scalar data may be integer literals written without a decimal point or an ‘E’ exponent (e.g; 1332, 0x33), floating point literals numbers written with a single decimal point and or an ‘E’ exponent (e.g; 12.3, 3E7), or character string literals that are enclosed in single or double quotes (e.g; “Hello World”). A variable, which holds scalar data, is called a scalar variable. Its name always begins with ‘$’, e.g;

$varint=13, $varfloat=12.3, $varstring=”youth adda”


Array of scalar and array variables: An array is an ordered collection of scalar quantities. It can contain multiple scalars or none at all. Any element of the array can be accessed by an integer index or subscript. Normally, an array containing ‘n’ elements has indices starting at 0 and going to n-1, inclusive (1, 2, 3), (‘a’, ’b’, ‘c’), ( ) are some example of array of scalars. Any variable holding an array of scalars is called an array variable and its name should start with ‘@’, e.g; @vararray=(1, 2, 3). There exists a scalar variable @#arrayname, where arrayname is the name of the array for every array that contains a subscript of the last element of the array.

Associative array of scalars and associative array: An associative array contains any number of elements that may be indexed by arbitrary character strings, e.g; (“color”, “black”, “red” 6.8). You might think that associative array elements look the same as normal array elements. But there is a difference. In associative arrays, a successive pair represents the index or key and the value respectively. An associative array is a power feature of perl. Any variable holding an associative array of scalars is called associative array variable, and its name should start with ‘%’, e.g; @varassocarray = (“color”, “black”, “red” 5.6). The key () function can be used to get the array of all keys related to an associated array.

There is a significant difference between using the single quote and the double quote to delimit strings. If a string is delimited by a pair of single quote, then all characters within the string are taken literally, and there will be no substitution. If the string is delimited by double-quotes, a number of escape sequences will be allowed, and perl will substitute the value of the variables appearing in the string.

We will take a look at the expressions of perl in third part.
Enjoy learning!!

Friday, December 26, 2008

Introducing Perl

Perl (Practical Extraction and Report Language) is a script language originally developed by Larry wall. perl is optimized for string manipulation, I/O, and system tasks. It has a very large set of built-in functions for a variety of tasks. In perl, there is no need to explicitly declare variables and you don’t also have to pre-declare the size of strings or of arrays. All variables have predictable defaults values until explicitly set. Perl is an interpreted language in the sense that your perl program’s source code can be directly executed. You don’t have to compile your program explicitly, but when you run your program, it is first compiled into byte code, and then converted into machine instructions as the program runs. Hence, perl basically lies between compiled and interpreted languages.


First Perl Program

Let us start with writing the traditional Hello World program in perl.

#!/usr/bin/perl
#
#The Traditional Hello World program
#
print ‘Hello World’; #print the string on
standard output

The first line of every perl program tells the machine what to do when this text file is executed and where the perl binary is located in the system, so that the machine can execute the text file through perl. After the first line, anything starting with # is treated as comments, and everything else is a perl statement, which must end with a semicolon. The print function is used to output information to a standard output or to a file. In our case it prints out the string ‘Hello world’ to the standard output. Type the above program in your choice of editor and save it. Now you have written first program in perl. To run this program, first change its mode. To make the file executable, use the following commands:

chmod +x filename

Where filename is the name of the file. Finally, run the program using one of the following commands;

perl filename
./filename

This is all you have to write to run your first perl program.
In next section we will look at the basic elements of the perl.

Thursday, December 25, 2008

BEFORE YOU INVEST YOUR MONEY, INVEST SOME TIME

Here are some useful points to bear in mind before you invest in the markets:

1. Make sure your broker is registered with the SEBI and the Exchanges and do not deal with unregistered intermediaries.
2. All investments carry risk of some kind. Investors should always know the risk that they are taking and invest to match their risk tolerance.
3. Do not be misled by market rumours, luring advertisements or 'hot tips of the day'.
4. Take informed decisions by studying the fundamentals of the company. Find out the Business the company is into, the future prospects, quality of management, past track records etc. Sources of knowing about a company are through annunal reports, economic magazines, databases available with vendors etc.
5. If anyone, including your financial advisor, advises you to invest in a company, be cautious. Spend some time checking out about the company before investing.
6. Do not be attracted by announcements of excellent results / news reports about a company. Do your own research before investing in any stock.
7. Do not attracted to stocks based on what an internet website, research reports, addvisories promote, unless you have done an adequate study of the company.
8. Investing in very low priced of stocks or what are known as penny stocks do not guarantee high returns.
9. Be cautions about stocks which show a sudden spurt in price or trading activity.
10. Any advice or tip taht claims that there are huge returns expected, especially for acting quickly, may be risky and may lead to losing some, most, or all of your money.

Happy Trading!!

Marry Christmas!!

Transferring Hotmail messages to Microsoft Outlook

Qus: I want to know how to transfer Hotmail messages to Microsoft Outlook, not to Outlook Express?

Asked by: Aditya Virk
Via e-mail


You can set up a Hotmail account only if you have Outlook 2002. If your version is earlier than 2002, then chances are you won't be able to create a Hotmail account. To download your Hotmail message, go to Tools > E-mail Accounts > Add a New account and click Next. When asked which protocol to use, select HTTP and click Next. Now type your Hotmail login name for User Name: and ensure that Hotmail is displayed in the top right box. Click Next and then Finish. The next time you click on Send/Receive, Outlook will download the mail from your Hotmail account.

Sunday, December 14, 2008

Cyclic redundancy check data errors

What does 'cyclic redundancy check error' mean?

There are plenty of technical resources on the Web that discuss cyclic redundancy checks (CRCs). Most times you won't need to worry about this technobabble. That is, until one it day it suddenly appears and you think - what the hell does that mean? In simple terms, a CRC is bit of mathematics used to ensure that your data is OK when being transfered. It's a checking procedure that quickly identifies when data has been damaged. If you get this message, it means that the file being read by your PC or software is corrupted. However, it does not mean all the data is lost forever. When data is transfered, it is usually in small blocks and each block is given a CRC value. If something goes wrong with the data between the time it leaves the source and arrives at its destination, the CRC sent at the source will no longer match the one that is calculated when the data arrives - this is when the cyclic redundancy check error will appear.


The most common time you will see the cyclic redundancy check error message is when trying to read data from a damaged CD or DVD. Just before it appears, your CD/DVD drive will probably grind and whirl away - your PC may also become a little slugglish.

Monday, December 8, 2008

Hide or lock your computer drives.

Just check the following step.

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Policies\Explorer
now right click in right side pane and create DWORD Value
Rename it as “NoViewOnDrive” (for locking drive)
or
Rename it as “NoDrives” (for Hiding drive)

Double click on it and put some numbers to lock your desired Drive and click ok.
DRIVE NOS.
FOR A : 1
FOR C : 4
FOR D : 8
FOR E : 16
FOR F : 32
FOR G : 64
FOR H : 128

finally restart or log-off the computer to take effect.
Keep in mind that “0″ is Default Value to Disable or remove this setting..
After locking the drive when you try to open it, you will see a msgbox like this
“This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator”

Enjoy Hacking..

Sunday, December 7, 2008

Who Used Your Pc In Your Absence,what Did He Do?

Just go start > run >eventvwr.msc

Events are stored in three log files: Application, Security, and System. These logs can be reviewed and archived.
For our purposes we want the System log. Click on “System” in the left-hand column for a list of events.
Look for a date and time when you weren’t home and your computer should have been off.

Double click on the eg: info and it will show you the detail.
You can also use this log to see how long someone was on the computer. Just look at the time the computer was turned on and off for that day.

Hope u all will like it.

Friday, December 5, 2008

How to increase your internet connection speed

If you have Windows XP, try this.
You should be logged as Administrator (not even accounts with administrator privileges).

1. Start - Run - type gpedit.msc.

2. Expand the Local Computer Policy / Administrative Templates / Network Branch.

3. Highlight the QoS Packet Scheduler in left panel.

4. In right panel double click the Limit reservable bandwidth setting.

5. On setting tab check the Enabled item.

6. Where it says Bandwidth limit % change it to read 0.

The problem is, XP seems to want to reserve 20% of the bandwidth for itself.
Even with QoS disabled, even when this item is disabled. So why not use it to your advantage.

To demonstrate the problem with this on stand alone machines start up a big download from a server with an FTP client.
Try to find a server that doesn’t max out your bandwidth. In this case you want a slow to medium speed server to demonstrate this.
Let it run for a couple of minutes to get stable.
The start up another download from the same server with another instance of your FTP client.
You will notice that the available bandwidth is now being fought over and one of the clients
download will be very slow or both will slow down when they should both be using the available bandwidth.
Using this “tweak” both clients will have a fair share of the bandwidth and will not fight over the bandwidth.

Enjoy Hacking.

Thursday, December 4, 2008

Disable Writing to USB Drives

A common security concern at organizations is allowing users to plug in a usb flash drive, because they could so easily copy corporate data.

Since Windows XP SP2, you can disable writing to USB devices altogether using a simple registry hack.

Here it is:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
“WriteProtect”=dword:00000001

Hibernate function in windows XP

The Hibernate function on Windows XP is basically the same as stand by, but with one difference. The files and programs you have open will temporarily be saved onto a specific location on the hard drive, instead of RAM.
This means that the computer can be switched off while hibernating and it will consume no power. When you turn your Windows XP on again, everything will open instantly, just like after a standby. No startup screens and waste of time.

But there is one problem with hibernate - you can only do it once. For some unexplained reason, Windows can’t hibernate severeral times in a row. The temporary hibernate file on your hard drive can’t be overwritten and you need to do a normal shutdown before you can hibernate again. I hope this problem will be fixed in future versions of Windows.

How to Hibernate


Another mystery is why the hibernate button isn’t shown on the shutdown menu by default. After all, hibernating is a lot better than standing by -no power consumption, longer than standby, computer can be turned off and makes no noise…
Anyway, to hibernate, go to the shutdown menu as usual: Start -> Turn Off Computer and hold down the shift key to relpace “stand by” with “hibernate”.

C CODE TO GENERATE AIRTEL TUNE

Headers files are dos and stdio.

#include
#include
float main(void)
{
float A,Bb,D,G,F;
A = 440; G = 780; Bb = 461; D = 586; F = 687;
sound(G); delay(500); nosound();
sound(G); delay(250); nosound();
sound(G); delay(250); nosound();
sound(G); delay(500); nosound();
sound(2*D); delay(500); nosound();
sound(2*A); delay(250); nosound();
sound(2*Bb); delay(250); nosound();
sound(2*A); delay(250); nosound();
sound(G); delay(250); nosound();
sound(F); delay(500); nosound();
sound(2*A); delay(500); nosound();
sound(G); delay(250); nosound();
sound(2*A); delay(250); nosound();
sound(G); delay(250); nosound();
sound(F); delay(250);
sound(G); delay(250);
sound(2*A); delay(250);
sound(2*Bb); delay(500);
sound(2*A); delay(500);
sound(G); delay(250);
sound(F); delay(250);
sound(D); delay(500); nosound();
sound(G); delay(500); nosound();
sound(G); delay(250); nosound();
sound(G); delay(250); nosound();
sound(G); delay(500); nosound();
sound(2*D); delay(500); nosound();
sound(2*A); delay(250); nosound();
sound(2*Bb); delay(250); nosound();
sound(2*A); delay(250); nosound();
sound(G); delay(250); nosound();
sound(F); delay(500); nosound();
sound(2*A); delay(500); nosound();
sound(G); delay(250); nosound();
sound(2*A); delay(250); nosound();
sound(G); delay(250); nosound();
sound(F); delay(250);
sound(G); delay(250);
sound(2*A); delay(250);
sound(2*Bb); delay(500);
sound(2*A); delay(500);
sound(G); delay(250);
sound(F); delay(250);
sound(D); delay(500); nosound();
sound(2*A); delay(250); nosound();
sound(G); delay(250); nosound();
sound(F); delay(250);
sound(G); delay(250);
sound(2*A); delay(250);
sound(2*Bb); delay(500);
sound(2*A); delay(500);
sound(G); delay(250);
sound(F); delay(250);
sound(D); delay(500); nosound();
sound(2*A); delay(250); nosound();
sound(G); delay(250); nosound();
sound(F); delay(250);
sound(G); delay(250);
sound(2*A); delay(250);
sound(2*Bb); delay(500);
sound(2*A); delay(500);
sound(G); delay(250);
sound(F); delay(250);
sound(D); delay(500); nosound();
return 0;
}

Have fun..

HIDDEN MUSIC

Microsoft Windows XP is playing a cool music during installation. It is a pleasant little tune that you’ve probably never heard,
unless you were present when Windows was being installed on your PC. After that it’s never played again,
unless you know where to look for it.

To hear what you’ve been missing, just follow these:

Make you way to C:\WINDOWS\system32\oobe\images and look for a file called “Title.wma” or possibly “Windows welcome music.wma”.

It is around 2.56Mb in size. Just double click the file and this will open Windows Media Player, or your defaul player
and it will proceed to serenade you with a more than 5 minutes music. It’s up to you to repeat it.

Enjoy lol!!

lovely wallpaper


Display a banner each time Windows boots

Hey Try this.

1. Go to the key HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionWinLogon
2. Create a new string value in the right pane named LegalNoticeCaption and enter the value that you want to see in the menubar.

3. Create a new string value and name it LegalNoticeText. Modify it and insert the message you want to display each time Windows boots.

Enjoy Hacking.

Tuesday, December 2, 2008

Hack your cell phone

For Nokia User


1 Imagine your cell battery is very low, you are expecting an important call and you don't have a charger.

Nokia instrument comes with a reserve battery. To activate, key is "*3370#"

Your cell will restart with this reserve and your instrument will show a 50% increase in battery.

This reserve will get charged when you charge your cell next time.

*3370# Activate Enhanced Full Rate Codec (EFR)-Your phone uses the best sound quality but talk time is reduced by approx. 5%
#3370# Deactivate Enhanced Full Rate Codec( EFR)


*#4720# Activate Half Rate Codec - Your phone uses a lower quality sound
but you should gain approx 30% more Talk Time
*#4720# Deactivate Half Rate Codec

2 *#0000# Displays your phones software version,

1st Line : software Version,
2nd Line : Software Release Date,
3rd Line : Compression Type
3 *#9999# Phones software version if *#0000# does not work.

4 *#06# For checking the International Mobile Equipment Identity (IMEI Number)

5 #pw+1234567890+1# Provider Lock Status. (Use the "*" button to obtain the "p,w" and "+" symbols)

6 #pw+1234567890+2# Network Lock Status. (Use the "*" button to obtain the "p,w" and "+" symbols)

7 #pw+1234567890+3# Country Lock Status. (use the "*" button to obtain the "p,w" and "+" symbols)

8 #pw+1234567890+4# SIM Card Lock Status.(use the "*" button to obtain the "p,w" and "+" symbols)

9 *#147# (Vodafone) this lets you know who called you last *#1471# Last call (Only Vodafone)

10 *#21# Allows you to check the number that "All Calls" are diverted To

11 *#2640# Displays security code in use


12 *#30# Lets you see the private number

13 *#43# Allows you to check the "Call Waiting" status of your phone.

14 *#61# Allows you to check the number that "On No Reply" calls are diverted to

15 *#62# Allows you to check the number that "Divert If Unreachable(no service)" calls are diverted to

16 *#67# Allows you to check the number that "On Busy Calls" are diverted to

17 *#67705646# Removes operator logo on 3310 & 3330

18 *#73# Reset phone timers and game scores

19 *#746025625# Displays the SIM Clock status, if your phone supports this power saving feature "SIM Clock Stop Allowed", it
means you will get the best standby time possible

20 *#7760# Manufactures code

21 *#7780# Restore factory settings

22 *#8110# Software version for the nokia 8110

23 *#92702689# (to remember *#WAR0ANTY#)

Displays -
1.Serial Number,
2.Date Made
3.Purchase Date,
4.Date of last repair (0000 for no repairs),
5.Transfer User Data.
To exit this mode -you need to switch your phone off then on again

24 *#94870345123456789# Deactivate the PWM-Mem

25 **21*number# Turn on "All Calls" diverting to the phone number entered

26 **61*number# Turn on "No Reply" diverting to the phone number entered

27 **67*number# Turn on "On Busy" diverting to the phone number entered

Enjoy lol;