Posted by: merly | December 23, 2008

extracting patterns in perl

In many applications we may need to extract certain numbers , characters or even a mixture of characters ans numbers from sentences….
the below code will help you

consider the below example

eg: id #23517348 – from reply

Our aim is to extract 23517348 from the above data

regex for extracting is:- /(\d+)/

=====================================
my $sub=$::FORM{desc’}; // suppose sub prints the data
id #23517348 – from reply

#print “$sub”;
$sub =~/(\d+)/;
print “$1″;

=======================
Output
=====
23517348

Posted by: merly | November 15, 2008

100 keyboard shortcuts

Here are 100 keyboard shortcuts to pace up your work and Impress others
CTRL+C (Copy)
CTRL+X (Cut)
CTRL+V (Paste)
CTRL+Z (Undo)
DELETE (Delete)
SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
CTRL while dragging an item (Copy the selected item)
CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
F2 key (Rename the selected item)
CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
CTRL+SHIFT with any of the arrow keys (Highlight a block of text)
SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
CTRL+A (Select all)
F3 key (Search for a file or a folder)
ALT+ENTER (View the properties for the selected item)
ALT+F4 (Close the active item, or quit the active program)
ALT+ENTER (Display the properties of the selected object)
ALT+SPACEBAR (Open the shortcut menu for the active window)
CTRL+F4 (Close the active document in programs that enable you to have multiple documents open simultaneously)
ALT+TAB (Switch between the open items)
ALT+ESC (Cycle through items in the order that they had been opened)
F6 key (Cycle through the screen elements in a window or on the desktop)
F4 key (Display the Address bar list in My Computer or Windows Explorer)
SHIFT+F10 (Display the shortcut menu for the selected item)
ALT+SPACEBAR (Display the System menu for the active window)
CTRL+ESC (Display the Start menu)
ALT+Underlined letter in a menu name (Display the corresponding menu)
Underlined letter in a command name on an open menu (Perform the corresponding command)
F10 key (Activate the menu bar in the active program)
RIGHT ARROW (Open the next menu to the right, or open a submenu)
LEFT ARROW (Open the next menu to the left, or close a submenu)
F5 key (Update the active window)
BACKSPACE (View the folder one level up in My Computer or Windows Explorer)
ESC (Cancel the current task)
SHIFT when you insert a CD-ROM into the CD-ROM drive (Prevent the CD-ROM from automatically playing)

Dialog Box Keyboard Shortcuts

CTRL+TAB (Move forward through the tabs)
CTRL+SHIFT+TAB (Move backward through the tabs)
TAB (Move forward through the options)
SHIFT+TAB (Move backward through the options)
ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
ENTER (Perform the command for the active option or button)
SPACEBAR (Select or clear the check box if the active option is a check box)
Arrow keys (Select a button if the active option is a group of option buttons)
F1 key (Display Help)
F4 key (Display the items in the active list)
BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

Microsoft Natural Keyboard Shortcuts

Windows Logo (Display or hide the Start menu)
Windows Logo+BREAK (Display the System Properties dialog box)
Windows Logo+D (Display the desktop)
Windows Logo+M (Minimize all of the windows)
Windows Logo+SHIFT+M (Restore the minimized windows)
Windows Logo+E (Open My Computer)
Windows Logo+F (Search for a file or a folder)
CTRL+Windows Logo+F (Search for computers)
Windows Logo+F1 (Display Windows Help)
Windows Logo+ L (Lock the keyboard)
Windows Logo+R (Open the Run dialog box)
Windows Logo+U (Open Utility Manager)

Accessibility Keyboard Shortcuts

Right SHIFT for eight seconds (Switch FilterKeys either on or off)
Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
SHIFT five times (Switch the StickyKeys either on or off)
NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
Windows Logo +U (Open Utility Manager)

Windows Explorer Keyboard Shortcuts

END (Display the bottom of the active window)
HOME (Display the top of the active window)
NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
NUM LOCK+Plus sign (+) (Display the contents of the selected folder)
NUM LOCK+Minus sign (-) (Collapse the selected folder)
LEFT ARROW (Collapse the current selection if it is expanded, or select the parent folder)
RIGHT ARROW (Display the current selection if it is collapsed, or select the first subfolder)

Shortcut Keys for Character Map

After you double-click a character on the grid of characters, you can move through the grid by using the keyboard shortcuts:
RIGHT ARROW (Move to the right or to the beginning of the next line)
LEFT ARROW (Move to the left or to the end of the previous line)
UP ARROW (Move up one row)
DOWN ARROW (Move down one row)
PAGE UP (Move up one screen at a time)
PAGE DOWN (Move down one screen at a time)
HOME (Move to the beginning of the line)
END (Move to the end of the line)
CTRL+HOME (Move to the first character)
CTRL+END (Move to the last character)
SPACEBAR (Switch between Enlarged and Normal mode when a character is selected)

Microsoft Internet Explorer Navigation

CTRL+B (Open the Organize Favorites dialog box)
CTRL+E (Open the Search bar)
CTRL+F (Start the Find utility)
CTRL+H (Open the History bar)
CTRL+I (Open the Favorites bar)
CTRL+L (Open the Open dialog box)
CTRL+N (Start another instance of the browser with the same Web address)
CTRL+O (Open the Open dialog box, the same as CTRL+L)
CTRL+P (Open the Print dialog box)
CTRL+R (Update the current Web page)
CTRL+W (Close the current window)

This may come in handy someday. Good reason to own a cell phone:

If you lock your keys in the car and the spare keys are at home, call

someone at home on their cell phone from your cell phone.

Hold your cell phone about a foot from your car door and have the person

at your home press the unlock button, holding it near the mobile phone on

their end. Your car will unlock.

Saves someone from having to drive your

keys to you. Distance is no object. You could be hundreds of miles away,

and if you can reach someone who has the other “remote” for your car, you

can unlock the doors (or the trunk).

Posted by: merly | June 21, 2008

How to disable a STOLEN mobile phone?

To check your Mobile phone’s serial number, key in the following digits on your phone:

* # 0 6 #

A 15 digit code will appear on the screen. This number is unique to your

handset. Write it down and keep it somewhere safe. when your phone get

stolen, you can phone your service provider and give them this code. They

will then be able to block your handset so even if the thief changes the

SIM card, your phone will be totally useless.

You probably won’t get your phone back, but at least you know that whoever stole it can’t use/sell it either.

Posted by: merly | May 24, 2008

Scan your books online

How is the idea?

Scanning photos online for free.

Requirements

1.An Email account

2.A digital camera/ Camera phone not less than 2Megapixel.

Take photos,transfer to computer,attach send to Scanr.

Given below is another site Qipit.

Qipit stores up to 100 scanned documents in your account for free, where you can make them public and tag them, too. When you sign up for Qipit, optionally register your cameraphone’s make and model, and the app will tell you what it can do with images from it (whiteboards, hand-written notes and/or printed documents.)

Advantage is that it even works on low resolution phones(1.3 MP).

Posted by: merly | May 15, 2008

How to Lock windows folders without any software

How to Lock windows folders without any software

We are assuming that the name of the folder to be renamed is HideMePlease and it is located in D Drive, thereby making the path to the folder as

Disc D:\

Step I


The trick is pretty simple, If you rename the folder ( in our case
HideMePlease) to HideMePlease.{21EC2020-3AEA-1069-A2DD-08002B30309D}
When this renaming of the folder is done, windows by default makes
it point to the control panel. Upon clicking on the folder after
renaming, Control Panel is displayed.
To get your folder back to the original one, rename it back to HideMePlease.

In order to make the entire process simple and clean,
i would suggest that you make two batch files (files ending with .bat
extension). One file for hiding/locking the folder; the other for
getting it back/unlocking it.
Step II

1.) The batch file for hiding the folder can be named as:
Hide.bat
2.) Open notepad/your favorite text editor and type in this
//THIS FILE SHOULD BE PLACED IN d:\
REN HideMePlease HideMePlease.{21EC2020-3AEA-1069-A2DD-08002B30309D}
Step III


1.) The batch file for unlocking the folder can be named as
Recover.bat
2.) Open notepad/your favorite text editor and type in this
//THIS FILE SHOULD BE PLACED IN D:\
REN HideMePlease.{21EC2020-3AEA-1069-A2DD-08002B30309D} HideMePlease
IT IS A VERY GOOD TRICK AND WOULD COME HANDY WHEN YOU HAVE TO HIDE YOUR PERSONAL INFO FROM OTHERS!

Posted by: merly | May 14, 2008

Security in php

Posted by: merly | May 14, 2008

Cascading style sheets(CSS)


Cascading style
sheets are a new way of formatting your page layout, text, fonts, images, and almost anything you put on the page.They allow you to position things on your page down to the exact pixel. Also, if a style is declared in the head section of a page, a change to the style changes the style on the entire page.

What is CSS?

* CSS stands for Cascading Style Sheets
* Styles define how to display HTML elements
* Styles are normally stored in Style Sheets
* Styles were added to HTML 4.0 to solve a problem
* External Style Sheets can save you a lot of work
* External Style Sheets are stored in CSS files
* Multiple style definitions will cascade into one

Suppose that you created a style for a heading tag, <H1>. In your style, you set the color of your H1 tags to red. Now if you have 10 H1 tags on the page, and decide you would rather have your headings be blue, you would no longer need to go back and change the font color for each heading. All you have to do is change the style of your H1 tags from the color red to blue. Changing the style once will adjust all of your H3 tags and they will now be all blue instead of red, with alot less work.

Syntax

The CSS takes the following syntax

selector {property: value}

eg:-body {color: blue}

This can be applied to a group also
h1,h2
{
color: #000000;
}
Adding Styles to Elements with Particular Attributes

input[type="text"] {background-color: red}

The id Selector

You can also define styles for HTML elements with the id selector. The id selector is defined as a #.

The style rule below will match the element that has an id attribute with a value of “black”:

#black{color: black}

The style rule below will match the p element that has an id with a value of “para1″:

p#para1
{
text-align: center;
color: red
}

Comments in CSS

/* This is a comment */
p
{
text-align: center;

}

Inline Styles:

Inline styles are added directly to the element to be styled with the style attribute:

<p style=”color: red;”>

Inline styles are CSS styles that are applied to one element using the style attribute.

1. We write the style properties all one line .then we separate multiple properties with a semi-colon

eg:- background:#112344; color:#223555; border: solid black 1px;

2. Now you place that line of styles inside the style attribute of the element you want styled.

<p style =” background:#112344; color:#223555; border: solid black 1px;”>
Advantages and disadvantages of Inline Styles

Advantage

1) Inline styles have the highest precedence because of the cascade.

Disadvantages

1)They can over-ride things you didn’t intend them to do as they are most specific in cascade.

2)It’s impossible to style pseudo-elements and -classes with inline styles. For example, with external and internal style sheets, you can style the visited, hover, active, and link color of an anchor tag. But with an inline style all you can style is the link itself, because that’s what the style is on.

External style sheets

External style sheets (CSS) allow you to use one style sheet on multiple Web pages – so when you change the look for your site, you change the CSS in one.

Advantages and Disadvantages of External Style Sheets

Advantages

1)Since External style sheets are written in a single page it is easy to change the style and look of websites without much trouble.You need to make changes only in a single page and to a single portion.

2)To use the styles effectively we can group them easily.

Disadvantages

* External style sheets can increase the download time, if they are extremely large.

* If you only have a small number of styles, they can increase the complexity of your site.

* Like with table rendering, you have to wait until the entire style sheet is loaded before the page can display.

* External style sheets get big very quickly as it’s hard to tell when a style is no longer in use, because it’s not deleted when the page is removed.

LINKING TO PAGE

Each page which uses CSS must link to the style sheet using the <link> tag. The <link> tag goes inside the head section:

Your style sheet should be saved with a .css extension

Suppose that style.css is the name of the page where you put your styles.

<head>
<link rel=”stylesheet” type=”text/css”
href=”style.css” />
</head>

The browser will read the style definitions from the file style.css and format the document according to it.
body { background : #FFFFFF;}
p {margin-left: 20px}

Internal style sheets

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section by using the <style> tag, like this:

<head>
<style type=”text/css”>

p {margin-left: 20px}

body {background : #FFFFFF;}
</style>
</head>

Multiple Style Sheets

A group of properties can be applied to a tag

eg:-body {
background : #FFFFFF;
border: #000000 ;
border-style: solid;
border-width: 0px;
padding: 10px ;
vertical-align: middle ;
text-align: center;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: 400 ;
color: #000000;
font-size:6;

}
Inside the tables for a all columns or rows you can specify the styles

td {
empty-cells : show;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: 400 ;
color: #000000;
text-align: center;
}

Posted by: merly | May 9, 2008

SCIENTIFIC LEMON Battery

The penny

: Any copper coin will work. (Canadian pennies from 1960 – 2001 all worked)

www.NidoKidos.Org

Creating the battery
: Insert a penny into a cut on one side of the lemon. Push a galvanized nail into the other side of the lemon.
The nail and penny must not touch.

www.NidoKidos.Org

This is a single cell of a battery. The zinc nail and the copper penny are called electrodes.

The lemon juice is called electrolyte.
All batteries have a “+” and “-” terminal. Electric current is a flow of atomic particles called electrons. Certain materials , called conductors, allow electrons to flow through them. Most metals (copper, iron) are good conductors of electricity. Electrons will flow from the “-” electrode of a battery, through a conductor, towards the “+” electrode of a battery.
Volts (voltage) is a measure of the force moving the electrons. (High voltage is dangerous!)

www.NidoKidos.Org

I have connected a volt meter to our single cell lemon battery. The meter tells us this lemon battery is creating a voltage of 0.906 volts.
Unfortunately this battery will not produce enough current (flowing electrons) to light a bulb.

www.NidoKidos.Org

To solve this problem we can combine battery cells to create higher voltages. Building more lemon batteries and connecting them with a metal wire from “+” to “-” adds the voltage from each cell.
www.NidoKidos.Org

The two lemon batteries above, combine to produce a voltage of 1.788 volts. This combination still does not create enough current to light a small bulb. Note the red wire connecting the batteries is joined from “+” (penny) to “-” (galvanized nail).

www.NidoKidos.Org

Four lemon batteries create a voltage of 3.50 volts. We should be able to light up a small device like an LED (Light Emitting Diode).
Note the connecting wires go from “+” to “-” on each battery.


www.NidoKidos.Org

LED

To turn on an LED you must determine the “+” and “-” connections. If you look closely at the red plastic base of an LED you will notice a “flat” spot (indicated by arrow above). The wire that comes out beside the flat spot must connect to the “-” side of a battery, the other wire to the “+” side.


Important information about LEDs
: LEDs are designed to work at very low voltages (~ 2V) and low currents. They will be damaged if connected to batteries rated at over 2 volts. LEDs require resistors to control current when used with batteries rated at over 2 volts. Lemon batteries produce low current. It is OK to connect an LED to a lemon battery.


www.NidoKidos.Org

In the above image, electrons flow from the “-” (nail) end of our lemon battery through the LED (making it glow) then back to the “+” (penny) end of the battery. This is an electronic circuit. The LED glows dimly with this configuration.

www.NidoKidos.Org


Improving your battery.

The quality of the copper and zinc can be a problem for a battery like this. Pennies in particular are rarely pure copper.
Try substituting a length of 14 gauge copper wire (common house wire) for the penny. Experiment with different lengths and configurations of electrodes. Other sources of zinc and copper may be found in the plumbing supply department of a hardware store.

The first battery was created in 1799 by Alessandro Volta . Today batteries provide the power for an amazing variety of devices, everything from flashlights to robots, computers, satellites and cars. Inventors and researchers continue to improve the battery, designing batteries that last longer and that are more friendly to our environment.

Understanding how batteries actually work requires a knowledge of chemistry. The most important factor in battery design is the electrical relationship between the two metals used in the battery. Some metals give electrons away while other metals accept extra electrons. Chemists have investigated metals and created an “electric potential” table comparing different metals.
Posted by: merly | May 7, 2008

ATM hackers

ATM hackersATM

Hi guys,

If you are ever forced by a thief or someone to take money out
of an ATM machine, enter your pin number reversed.

So if your number is 1254 mark 4521.

The ATM machine will give you your money, but will automatically
recognize this as a plea for help and will alert the police
unknown to the thief.

This option is in all ATM machines, but not many people know this.
Please keep this in mind

If you find this information useful…please post your comments

Older Posts »

Categories