My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Tuesday, May 18, 2010

Javascript - Validate Email Address

An email Address constitute of following:

--A combination of letters, numbers, periods, hyphens, plus signs, and/or underscores
--The at symbol @
--A combination of letters, numbers, hyphens, and/or periods. (Alphanumerics)
--A period
--The top level domain name (com, net, org, mobi, us, etc)


Some valid examples are:
•toughjamy@yahoo.com
•anwar.toughjamy@gmail.com
•mohdajf@adobe.com

Invalid Examples:
•@hahaha.net - no characters before the @
•cumon&dom@anwar.art - invalid character &
•buffalo@buffalo_univ.edu - underscores are not allowed in the domain name


For the purpose of email validation I employ regular expressions. The function validateEmailId would do the task for us, as follows:

function validateEmailId(element, alertMessage)
{/*Written by : Mohd Anwar Jamal Faiz 18 May 2008
Language : JavaScript

1. element is the Document element having email address , usually a textbox.
2. alertMessage would be the error message if email address is wrongly formed.

Note: Use of this function is free. But you must not remove the link to this blog.
*/
var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
if(element.value.match(emailExp)){
return true;
}else{
alert(alertMessage);
element.focus();
return false;
}
}


You can use this function in conjugation with appropriate HTML code. For example there can be a webpage having a form as follows:





* Please note that I kept HTML in a remark tag. Or else, this page would have not contained code. Instead a real text box and button would have appeared. But this technique didnt work. So again I made a picture of the text and uploaded on blogger. There are many other ways which I will discuss, at some later time.

Till then, this was the tip of the day!!!

Friday, May 14, 2010

Media nearing Money effect

I came across a video of a news channel reporting on India's losing in T20. The voice articulation is so dramatic. The reporting style is so hillarious. I regard this as Media nearing Money Effect.

Check Video at:
http://www.youtube.com/watch?v=IS5rxSJ58WU


Indian media has nowadays really gone crazy. How can you blame players so critically for losing in a either-win-or-lose game. These days there are so many 24x7 news channels, which are presenting news only for getting TRP rating. Many news channels are presenting orthodox, supersitious and astrological programmes only to create sensation. This news is just an illegitimate offspring of Media nearing Money. We have already witnessed disastrous outcome of this M and M relation. Someone, should give it a voice...

Traceability matrix and Baseline

Traceability : It is a tool to monitor the progress of Software Testing. It is used to check if some of the test cases are left out or not in Manual and automated testing.

Baseline : It is the point at which some deliverable produced during the software engineering process is put under formal change control

Baseline, in simple words is a software specification or functionality that is reviewed or accepted for development. Once the functionality is baseline, we can start developing of the functionality. A Traceability Matrix, on the other hand, lists all the functionality or features and the test cases for each feature. By using the traceability matrix we can measure, when to stop testing of the project or application.

A traceability matrix is a document, usually in the form of a table, that correlates any two baselined documents that require a many to many relationship to determine the completeness of the relationship. It is often used with high-level requirements (these often consist of marketing requirements) and detailed requirements of the software product to the matching parts of high-level design, detailed design, test plan, and test cases.

Generally Traceability Matrix contains:
1. UseCaseID(Functionality/Feature).
2. Description of the Feature.
3. Priority for the Feature.
4. TestCaseIDs for this Feature. (Once if the mapped testcases for each Feature meets Success criteria, then we can stop testing of the project)
5. In which phase is the Feature (Unit,Component,Integration,System)

A requirements traceability matrix may be used to check to see if the current project requirements are being met, and to help in the creation of a Request for Proposal, various deliverable documents, and project plan tasks.

Common usage is to take the identifier for each of the items of one document and place them in the left column. The identifiers for the other document are placed across the top row. When an item in the left column is related to an item across the top, a mark is placed in the intersecting cell. The number of relationships are added up for each row and each column. This value indicates the mapping of the two items. Zero values indicate that no relationship exists. It must be determined if one must be made. Large values imply that the relationship is too complex and should be simplified.

To ease the creation of traceability matrices, it is advisable to add the relationships to the source documents for both backward traceability and forward traceability. In other words, when an item is changed in one baselined document, it's easy to see what needs to be changed in the other.

Adobe is firing back at Apple with love

I came across a beautiful article on latest Adobe Apple controversy. I got this from Yahoo. Readers can read this--

Adobe Systems Inc. is countering Apple Inc. CEO Steve Jobs' recent jab at Adobe's Flash technology for Web video and games. The company is running ads in newspapers and popular technology blogs saying "We Love Apple" — with a bright red heart in place of love.
Jobs had described Flash as outdated, unreliable and unfit for Apple's iPhone and iPad gadgets. In a detailed, 1,685-word offensive posted online two weeks ago. Jobs spelled out the reasons why Apple continues to ban Flash from its mobile devices, including "reliability, security and performance," and the fact that Flash was designed "for PCs using mice, not for touch screens using fingers."
But he said the most important reason is that Flash puts a third party between Apple and software developers. In other words, developers can take advantage of improvements from Apple only if Adobe upgrades its own software.
Adobe's ad — at 82 words — begins, "We love creativity," "We love innovation," "We love apps."
"What we don't love," it continues, "is anybody taking away your freedom to choose what you create, how you create it, and what you experience on the Web."
The full-page ads appeared Thursday in The Wall Street Journal, The New York Times and more than a dozen other newspapers. Online, they peppered tech blogs such as ArsTechnica, Engadget and TechCrunch, as well as CNN.com and Wired.
Adobe co-founders Chuck Geschke and John Warnock, highly regarded in Silicon Valley, also posted a statement titled "Our thoughts on open markets" — 411 words — criticizing Apple.


"When markets are open, anyone with a great idea has a chance to drive innovation and find new customers," they wrote, adding that Apple's "opposite approach" could undermine a future in which mobile devices outnumber traditional computers on the Internet.
Adobe would not say how much it spent on the ad campaign. For comparison, a full-page black-and-white advertisement costs $223,000 in The Wall Street Journal, assuming no discounts were given for running it over several days.
David Wadhwani, head of Adobe's platform business, said it's something the company feels passionate about because it enables a discussion over who controls the Web. And he stressed Adobe's stance that Flash "is an open platform, with a vibrant ecosystem around it."
In a statement, Apple said that it, too, believed in openness. The company said that is why it favors the emerging HTML5 programming standard rather than Adobe's proprietary Flash product for Web video.

Solar energy in mobile towers

Solar energy in its raw form may be pollution-free, but manufacturing the devices that get the energy out of light and heat requires metal and other material, requiring mines and smelters, therein causing pollution. Maybe the most exciting thing about solar energy today is not only that the costs continue to drop and efficiencies continue to rise, but that clean solar energy is arriving at last. New technologies allow new methods of manufacturing which pollute much less, and often run on solar energy.
Solar heating and solar electric systems can now generate thermal and electric energy over their service life up to 100 times the energy input during their manufacture. This ratio; the energy it will produce in its lifetime, compared to the amount of energy input to manufacture and maintain an energy system, has doubled in the last 20 years for most solar technologies. The ratio of energy out vs. energy in for solar systems has become so favorable that the economic and ecological viability of solar power is now beyond question.
One reason solar energy still cannot compete financially vs. conventional energy is because the value of future energy output from a photovoltaic system is discounted when calculating, for example, an internal rate of return. These economic models that put a time-value on money, making long-term receipts not worth as much as near-term receipts cannot necessarily be applied to energy. Traditional models of economic analysis for an energy system lasting 50 years treat the free energy in years 11 through 50 as nearly worthless. The underlying assumption when discounting returns beyond 10 years is that BTUs are as fungible as currencies; something that is arguable but not certain. If a society as a whole desires energy independence, a solar energy system’s return on investment in year 50 is no less valuable than the return on investment in year one.

Our concern is - can this solar energy be used to meet power requirements of so many mobile towers. Currently diesel refilling is being done. How about establishing solar panels on mobile towers itself.
Still working on the idea.. Will write again.