Thursday, September 24, 2009

REGEX

Regular Expressions You Should Know


Visit Source

href="http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/%20

Matching a username

/^[a-z0-9_-]{3,16}$/

String that matches: my-us3r_n4m3

String that doesn't match: th1s1s-wayt00_l0ngt0beausername (too long)


Matching a Password

/^[a-z0-9_-]{6,18}$/

String that matches: myp4ssw0rd

String that doesn't match: mypa$$w0rd (contains a dollar sign)


Matching a Hex Value

/^#?([a-f0-9]{6}|[a-f0-9]{3})$/

String that matches:

#a3c113

String that doesn't match:

#4d82h4 (contains the letter h)


Matching a Slug

/^[a-z0-9-]+$/

String that matches:

my-title-here

String that doesn't match:

my_title_here (contains underscores)


Matching an Email

/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/

String that matches:

john@doe.com

String that doesn't match:

john@doe.something (TLD is too long)


Matching a URL

/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/

String that matches:

http://net.tutsplus.com/about

String that doesn't match:

http://google.com/some/file!.html (contains an exclamation point)


Matching an IP Address

/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/

String that matches:

73.60.124.136 (no, that is not my IP address :P)

String that doesn't match:

256.60.124.136 (the first group must be "25" and a number between zero and five)


Matching an HTML Tag

/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/

String that matches:

Nettuts+

String that doesn't match:

" /> (attributes can't contain greater than signs)

Friday, June 19, 2009

Is "telnet" works on VISTA??

Telnet is not a default available feature on Vista.
To enable telnet

>goto control panel
>programs
>Turn windows features on or off
>May need confermation the UAC
>wait...
>click the checkboxex beside the telnet client or server
>OK

Thursday, April 16, 2009

Nokia sees profits plunge by 90%

Source : BBC_NEWS

Nokia, the world's largest mobile phone maker, has reported a 90% fall in profits for the first quarter of 2009.

The company said net profits sank to 122m euros ($160m; £108m) in the quarter, down from 1.2bn euros in the same period a year ago.

The main reason for the slump was a dramatic fall in sales, which were down by almost a third.

Nokia is implementing a cost-cutting drive during the economic downturn and announced 1,700 job cuts last month.

Sales were down by 27% to 9.28bn euros in the quarter from 12.7bn euros a year ago, Nokia said.

This included the proceeds from the sale of 93 million phones.

"The macro [economic] environment is causing many people to trade down and purchase lower priced handsets," Nokia boss Olli-Pekka Kallasvuo said.

'Getting started'

Financial analysts said the results were not as bad as some had feared and Nokia's share price rose almost 9%.

"Although their performance was bad, it wasn't as bad as expected," said Neil Mawston at Strategy Analytics.

"Everyone talked Nokia down, so there was general relief that things weren't that bad after all," he added.

Nokia's share of the global handset market was 37%, down from 39% in the same quarter a year ago, but stable from the fourth quarter.

The company has come under increased pressure from smart-phones such as the Blackberry and Apple's iPhone.

In fact, Nokia has been criticised for being slow in developing more advanced phones.

"Clearly we are just getting started," said Mr Kallavuso, before saying that Nokia aimed to gain a 20% market share in touch-screen handsets. He did not, however, give a timeframe to achieve this goal.

Looking forward, the company said the outlook for the mobile phone market was improving.

"It is too early to say that end-consumer demand has hit the bottom," said Mr Kallavuso.

"But we believe the market is no longer falling in an uncontrolled manner."

He did, however, predict that the global mobile phone market would contract by 10% in 2009.

Google reports stronger profits

Google, the internet search engine, has announced the strong results for the first three months of this year.


Net profit for the quarter was $1.42bn (£0.95bn), up 9% compared with the $1.31bn posted a year earlier.

Revenues came in at $5.51bn, 6% higher than for the same period last year but a decrease of 3% on the last quarter.

The results were better than many analysts had expected bearing in mind the recession in the US and the general downturn in advertising spending.

For more details visit BBC_NEWS