Wednesday, March 25, 2009

Introduction To Web 2.0

What is Web 2.0

Web 2.0 is the network as platform, spanning all connected devices; Web 2.0 applications are those that make the most of the intrinsic advantages of that platform: delivering software as a continually-updated service that gets better the more people use it, consuming and remixing data from multiple sources, including individual users, while providing their own data and services in a form that allows remixing by others, creating network effects through an "architecture of participation," and going beyond the page metaphor of Web 1.0 to deliver rich user experiences.

Origin of Web 2.0

The bursting of the dot-com bubble in the fall of 2001 marked a turning point for the web. Many people concluded that the web was over hyped
The concept of "Web 2.0" began with a conference brainstorming session between O'Reilly and MediaLive International. Dale Dougherty, web pioneer and O'Reilly VP, noted that far from having "crashed", the web was more important than ever, with exciting new applications and sites popping up with surprising regularity.
What's more, the companies that had survived the collapse seemed to have some things in common. Could it be that the dot-com collapse marked some kind of turning point for the web, such that a call to action such as "Web 2.0" might make sense? We agreed that it did, and so the Web 2.0 Conference was born.
In the year and a half since, the term "Web 2.0" has clearly taken hold, with more than 9.5 million citations in Google. But there's still a huge amount of disagreement about just what Web 2.0 means, with some people decrying it as a meaningless marketing buzzword, and others accepting it as the new

Why Web 2.0 is needed

Business aspect
Behind the hype and confusion, there are truly revolutionary changes afoot. There are over a billion internet users worldwide sent over 1.4 Trillion SMS messages in 2005, generating over $50B in revenue. And, new services with just the right value proposition for the time, like Skype and MySpace, can attract over 50M users in their first 18 months of operation

In the early ‘90s Due to Bridges, routers, LANs, etc. of the networking era comes. They were about connecting computers to other computers

In the late ‘90s, “Web 1.0” took the next logical step of connecting people to businesses and data on other computers around the world. Search engines, online commerce, etc. were all both contributors to and outcomes of this new way of connecting

We’re really entering an era where the primary emphasis is on connecting people to other people. Whether it’s social networks, community generated content, VoIP, or new mobile technology, the truly revolutionary and business-worthy ideas that are being born now are the ones that bring together technology and people and let creative combinations and business models flourish

Basic Elements of Web 2.0
  1. AJAX (Asynchronous Javascript And XML )
    One ingredient of Web 2.0s meaning is certainly Ajax, which I can still only just bear to use without scare quotes. Basically, what "Ajax" means is "Javascript now works." And that in turn means that web-based applications can now be made to work much more like desktop ones
  2. Democracy
    The second big element of Web 2.0 is democracy. We now have several examples to prove that amateurs can surpass professionals, when they have the right kind of system to channel their efforts. Wikipedia may be the most famous. Experts have given Wikipedia middling reviews, but they miss the critical point: it's good enough. And it's free, which means people actually read it. On the web, articles you have to pay for might as well not exist. Even if you were willing to pay to read them yourself, you can't link to them. They're not part of the conversation
  3. Don't Maltreat Users
    I think everyone would agree that democracy and Ajax are elements of "Web 2.0." I also see a third: not to maltreat users. During the Bubble a lot of popular sites were quite high-handed with users. And not just in obvious ways, like making them register, or subjecting them to annoying ads. The very design of the average site in the late 90s was an abuse. Many of the most popular sites were loaded with obtrusive branding that made them slow to load and sent the user the message: this is our site, not yours. (There's a physical analog in the Intel and Microsoft stickers that come on some laptops.)
- Google was a pioneer in all three components of Web 2.0: their core business sounds crushingly hip when described in Web 2.0 terms, "Don't maltreat users" is a subset of "Don't be evil," and of course Google set off the whole Ajax boom with Google Maps.
- The fact that Google is a "Web 2.0" company shows that, while meaningful, the term is also rather bogus. It's like the word "allopathic." It just means doing

Six Trends That Characterize Web 2.0
  • Writing Semantic Markup: Transition to XML
    One of the biggest steps in realizing Web 2.0 is the transition to semantic markup, or markup that accurately describes the content it’s applied to. The most popular markup languages, HTML and XHTML, are used primarily for display purposes, with tags to which designers can apply styles via CSS.
    RSS is an XML format for syndicating content. It is an easy way for sites to tell people when there is content available. So, instead of browsing to your favorite site over and over again to see if something is new, you can simply subscribe to its RSS feed by typing the RSS URI into a feed . The aggregator will periodically poll the site, notify you if something is new, and deliver that content. It’s a real timesaver
  • Providing Web Services: Moving Away From Place
    During the early years of the Web, before content had semantic meaning, sites were developed as a collection of “pages.” Sites in the 1990s were usually either brochure-ware (static HTML pages with insipid content) or they were interactive in a flashy, animated, JavaScript kind of way. In that era, a common method of promoting sites was to market them as “places”—the Web as a virtual world complete with online shopping malls and portals.
    In the late 90s and especially the first few years of the 21st century, the advent of XML technologies and Web services began to change how sites were designed.
    This is truly powerful. Anyone can build an interface to content on any domain if the developers there provide a Web services API
    Amazon.com and eBay, both of which provide an immense amount of commercial data in the form of Web services, accessible to any developer who wants it. An interesting interface built using eBay’s Web services is Andale.
  • Remixing Content: About When and What, not Who or Why
    Web design in Web 2.0 is about building event-driven experiences, rather than sites. And it’s no coincidence that RSS is one of the key building blocks. RSS feeds enable people to subscribe to your content and read it in an aggregator any time, sans extraneous design
    Associated Press CEO Tom Curley made an important and far-reaching keynote speech to the Online News Association Conference on Nov. 12, 2004. In it he said, “… content will be more important than its container in this next phase [of the Web]… Killer apps, such as search, RSS and video-capture software such as TiVo—to name just a few—have begun to unlock content from any vessel we try to put it in.”
  • Emergent Navigation and Relevance: Users are in Control
    As a result of the remixing aspects of Web 2.0, most content will be first encountered away from the domain in which it lies. Thus, much of the navigation that is used to reach a specific item might be far removed from the navigation specifically designed for it. This “distributed” navigation might come in the form of a feed reader, a link on a blog, a search engine, or some other content aggregator.
    aggregators can use past user behavior to predict what users will find most relevant in the future. This is very apparent in Daypop, Del.icio.us, and Blogdex feeds. What people have found relevant in the past is likely to be useful in the future
  • Adding Metadata Over Time: Communities Building Social Information
    One feature of Web 1.0 that seemed to change everything about publishing was the ability to make changes to the primary publication at any time. There are no “editions” or “printings” on the Web like there are in the print world. There is simply the site and its current state. We are used to this paradigm now, and an optimist can hope that Web content will only get better with time: metadata will be added, descriptions will get deeper, topics more clear, and references more comprehensive.
    Web 2.0 is a step beyond this, to where users are adding their own metadata. On Flickr and Del.icio.us, any user can attach tags to digital media items (files, bookmarks, images).
    For example, that we tag a bookmark “Web2.0” in Del.icio.us. We can then access del.icio.us/tag/Web2.0 to see what items others have tagged similarly, and discover valuable content that we may not have known existed
  • Shift to Programming: Separation of Structure and Style
    In Web 1.0, there were two stages to visual Web design. In the early years, designers used tricks like animated GIFs and table hacks in clever, interesting and horrible ways. In the last few years, CSS came into fashion to help separate style from structure, with styling information defined in an external CSS file. Even so, the focus was still on visual design—it was the primary way to distinguish content and garner attention.
    XML is the currency of choice in Web 2.0, so words and semantics are more important than presentation and layout. Content moves around and is accessible by programmatic means.
    In the words of Amazon.com CEO Jeff Bezos, “Web 2.0… is about making the Internet useful for computers.”
Web 2.0 Made Easier
  • A clean interface with focus on usability
  • Social functions like tagging, groups, commenting, evaluations and friends
  • RSS feeds for everything
  • An open API
    - Web 2.0 isn’t about technology. It’s about understanding fundamental changes and innovations in interaction models, work models and business models that, in many cases, are only possible on the Web.
  • Web 2.0 is about making things simpler.
  • It is a step away from a thick client world to a thin client world.
  • It is a step away from being techy & geeky to being more universally accessible.
  • Its about using the web to do things that you used to use your computer to do.
  • ( Gmail, flikr, blogger)
  • Its key enabler is widespread availability of broadband.
  • The proximate driver of web2.0 is companies trying (still) to figure out how to make money from the web
  • The strategic driver is to deliver services via the web to make it more attractive to non-technical people. This means providing services that are

    Gmail, Delicious, digg, blogger, flikr, are all steps in these directions.
Examples of Web 2.0

Google provides many characteristic Web 2.0 services: Blogger, Adsense, Maps, Search, Base, Gmail, GTalk, Reader, Statistics. Each of these services either exploit the read/write Web or the Web as Platform.

eBay provides many buyer and seller services that aim for greater participation. Their API is one of the most successful, and the network effects they enjoy from their large user base are unrivaled. New Exemplars of Web 2.0

Flickr is a fast-growing photosharing service that provides an collaborative user interface as well as a powerful API to it's content. (Recently acquired by Yahoo!)

Del.icio.us is a popular social bookmarking service. Joshua Schacter, the founder, characterizes his service as a way to remember things. (Recently acquired by Yahoo!)

This blog is output of some reference material from internet. Content from some reference site may appear as it is in this blog. Author of this blog may not take responsibility of correctness for such content .

Friday, March 6, 2009

Introduction to Unix Shell Scripting

I would like to discuss Shell Scripting in Unix in this topic today. What I would be discussing with you is introduction to Shell Scripting, its features, command line parameters, arithmetic operations, control structures and functions usage in Shell Scripting.

Lets start with the definitions. Shell is a program provided by Unix, typically to provide interface to the Unix system. Thus, in other words, Shell is some tool for interacting user with system. Generally its either text based and command line oriented. Command Interpreter which is series of commands and takes commands from user and executes them. There are different types of Shell e..g Bourne Shell (/bin/sh), C Shell (/bin/csh), TC Shell (/bin/tcsh), Korn Shell (/bin/ksh), Bash (Bourne Again shell) (/bin/ksh) etc.

Why do we need Shell Programs ? Nice question you have... Lets concentrate now on this basic question which is generally asked. We generally may need to run tasks that are customized for different system or Some times we need to write some jobs that run on a system and we need to control those jobs we may need Shell Scripting in such and situations like those.

1.Script starts with line #!/bin/sh
2.'#' is used for commenting in script. Comments used in script always makes your code readable
3.It gives identification of author of script and date & time of update.
4.Easy to read and understand
5.Major complex sections of codes can be explained
6.Last but not least Versioning is tracked through this

These are few of features that we can generally think of it.

Lets see now what are the parameters and its usage through command line.

$0 tells you the name of script. $1, $2, $3 … tells you the 1st , 2nd , 3rd and so on parameter passed through the command line. And $# gives you no. of arguments passed to the script. If your script needs to read the input given by user through command prompt, use “read” statement .
e.g. echo “Please enter your name : ”
read name
where name would be the variable holding the user inputted value.

How arithmetic operations are carried out in Scripting is still a question. Let me explain you through the example.
e.g. i=2
j=3
k=`expr $j - $i`
echo “Result of $j - $i is : $k ”
Note here, expr is used to execute the operation and it would assign the result to the variable on left side.

Just like other programming languages, Shell Scripting also provide couple of control structures for your help. Significance of control structures is well knows world wide.. :)
If – then, For loop, While loop, Case statement are couple of control structures provided by Shell Scripting.

Lets see Syntaxes one by one for all Control Structures :
1.If- then
Syntax:
if condition then
condition is satisfied and is true
execute this block
else
if condition is not satisfied then execute this block upto fi.
fi

Here, note that condition is zero means its true and satisfied. And you can go in nested
if -else – fi .

2.For Loop
Syntax:
for { variable name } in { list }
do
execute and repeat all the statements in this block once for each item till
the list is finished
done

3.While Loop
Syntax:
while [ condition ]
do
command1
command2
command3
..
....
done
Here, Loop is executed as long as given condition is true. You need to make sure, at some point condition should get false within the loop or else it would go on executing indefinitely causing script hang.

4.Case Statement
The case statement is good alternative to Multilevel if-then-else-fi statement. It enable you to match several values against one variable. Its easier to read and write.
Syntax:
case $varName in
pattern1) command1
command2
…..
commandn;;
pattern2) command1
command2
…..
commandn;;
.
.
.
.
patternN) command1
command2
…..
commandn;;
*) command;;
esac

The $varName is compared with patterns till a match is found. And similar to case statements in
other programming languages such as PHP, shell executes all the statements up to the two semicolons as a delimiter.. *) is the default case and executed when no pattern is matched.

Hope at this point of line, you have been very much comfortable with Shell Scripting and its basics. Finally lets see how user defined functions work in Shell Scripting.

In Shell Scripting Function can be defined as a series of commands. They performs specific work to do or simply say task. Below mentioned syntax can help you understand the function in detail.
Syntax:
function_name ( )
{
command1
command2
.
.
.
.
commandN
return
}
Here, function_name is the name of function that you define, and it executes series of commands either up to return statement or end curly brace of function (whichever encounters first ) which terminates the function and passes control back to the calling point
e.g.

Type fnGetName() at $ prompt as follows
fnGetName()
{
echo “in function”
}
Call to the above function can be given with simply name of fucntion.
e.g. fnGetName

fuew !! Tired so far reading ?? ha ha .. we are not done yet but for now.. yes..!! This is enough for you to get basic idea of what is Shell Scripting. We still have tons of other areas in Shell Scripting to cover which is vast in size and will need separate site to explain and discuss it. Lets discuss it further later at some point, in mean while you can always get in touch with me for your queries through this blog and will be happy to resolve them.

Till then aloha !!

Thursday, March 5, 2009

Importance of Project Planning in Software Industry

It has been a very controversial discussion on importance of Project Planning in Project Development in Software Industry among my friends. Many of my friends has view that its mere time wasting in documentation rather than actual development. What all I say to them is just a saying.. "The sooner you start, the later you finish !!".. Let me explain what does it mean... If you start project without prior planning and estimation, you will face tons of obstacles and surprising risks and crisis. After huge discussion and debate finally I decided to write an article and would like to take an opportunity to share few of my thoughts about Importance of Project Planning which I realized in my project.

Project Planning process gives a significant help in your project. Even though we know lots of concepts that generally we follow while project development, but if project is not going through proper phases given by CMMi standards, many of activities that we are supposed to follow gets overlooked and later when project finds ample of surprising crisis, we find that following those processes would have really helped for betterment of project.

Project Planning is one of such process. For instance, setting milestones on project, which we as a manager generally overlook in project development. Many of us knows this concept and its usefulness in project, but as mentioned earlier when project starts directly without process following, milestones does not get setup in advance and then it becomes very tedious to trace back the tasks and its completion time versus estimated time. Project Planning process gives this power to you to plan well in advance and in turn easiness to mange the project.

External and Internal dependencies are another factors which we never think about in advance. If we are following Project Planning process and preparing its documents in advance, it will give you chance to think in deep about this area well in advance which generally person do not do when not following this process...

Risk management. This is another key aspect in project development. When project is started directly without prior preparation documents in hand, person literally think on surface level about it. Believe me, and I hope you agree with it, that each and every project has Risk associated to it and Project Planning is the document which gives you change to think about it that are going to occur in future and not on surface level. If project is following the general traditional way of development then manager never foresee those Risks in advance and hence is not well planned for any kind of un-certain disaster with project. And then obviously person heads towards applying patches and it goes on and on and on... This can be easily avoided by planning well in advance, where Project Planning Process helps you a lot...

Third party tool, Roles and Responsibilities and many more such sections from Project Planning, which gives you enough power and makes you think beyond the limit. Hence I suggest you to give proper attention towards Project Planning and filling Project Plan document for all of your projects. I realized its importance at my project hand helped me to complete my project on time.

I hope by the time you are at this point reading, you've already agreed with me and understood how project planning in project development plays vital role. Let me know your views and thoughts on this topic. I would like to discuss further and will be interested in knowing any pros that I've missed to mention or drawback of project planning if you think so.

Wednesday, March 4, 2009

How to show Google map on your website

Lots of time I have seen that programmer generally wants to show Google maps on their website. I personally think, while going through developing those requirement, maps generally requires longitude and latitude which is hard for a typical developer to provide since requirement generally provides you just address of place of which map to be shown. In that case it becomes challenge for the developer to calculate required
longitude and latitude of a specific address and then accordingly pass them to get the map. Second challenge, developer may face in placing marker on map If developer is new in this area and he has to spend tons of time in R&D for getting these markers placed along with SmartWindow for label on marker. Believe, me this is my personal experience when I as a fresher started working on this requirement have spent lots of time in so simple feature. (Don't call me dumb..please.. ;) )

So hereby, I would give you a small function which will give a facility for a developer to just include couple of functions and map will be ready for him on page with marker and SmartWindow with label details without hassle of calculating long. & lat. details of address.

Very first step obviously you have to do is to get AppId for your application. If you are doing web based development, you need to provide domain URL for authentication. This is extra care taken by Google and appId generated for one domain through Google can not be used for another domain. Well sorry but, it's like that only and I personally love this extra check by Google. Click Here for signing up for a Google Maps API Key. Once you receive your API Key you are ready to go for that !

Next step is to include/load map file from Google using appId generated for specific to your domain.
e.g.
<script type="text/javascript" src="http://www.google.com/jsapi?key=abcdefgh"></script>
where you need to replace your API Key with "abcdefgh" given in example.

and that's it.. Now rest all you have to do is copy below mentioned piece of Javascript code and paste in your file, preferably within <head> </head>tag, below <title></title> tag though it really doesn't matter but just for the sake of coding standards.

= JS Functions to display MAP Starts here =

<!-- Functions for Map -->
<script type="text/javascript">
/* Define the address you want to show map of */
var address = "1600 Amphitheatre Parkway Mountain View, CA 94043";

/* Define the label details of address you want to show as marker on map */
var infoWindowDetails= '<span ><B>Google Inc.</B> <br /> 1600 Amphitheatre Parkway <br /> Mountain View, CA 94043 USA<br />Phone: +1 650-253-0000<br />Fax: +1 650-253-0001 </span>';

/* Load Google Map. second parametere is for view type*/
google.load("maps", "2");

var map = null;
var geocoder = null;

// Call this function when the page has been loaded
function initialize() {
if (GBrowserIsCompatible()) {

map = new GMap2(document.getElementById("map_canvas")); // Creat instance of map.
map.addControl(new GLargeMapControl()); // Add Map Control on map
var mapControl = new GMapTypeControl();
map.addControl(mapControl); // Add Map Type Control on map
geocoder = new GClientGeocoder();
showAddress(); // Call to the fucntion which will mark the address on map.
}
}

function showAddress() {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point); // Create instance of marken on map
map.addOverlay(marker); // Add overlay of marker on map
marker.openInfoWindowHtml(infoWindowDetails); // Show label baloon on marken with address details.
}
}
);
}
}

google.setOnLoadCallback(initialize); // Call to callback function on page load.
</script>

= JS Functions to display MAP Ends here =

Congratulations !! you are done with it.. You can easily see your map with specified address... No need to calculate latitude, longitude neither is there hassle of point locations finding for Marker and SmartWindow.

BTW, Dont forget to provide some content layer on your page to hold the map... or else there is no specific place you are giving for google to show its map on your website..

e.g.
<body>
<div id="map_canvas" style="width:600px;height:300px"></div>
</body>

Here's wishing you a very happy programming !!

Monday, March 2, 2009

Looping through form elements using JavaScript

Here is another basic need of developer. Many times developer needs script to loop through all the elements that are available in form tag using client side script.

Following is the piece of Javascript that can be used on your page under script tag which will help to loop through all the form elements on page. You need to copy and paste the piece of code under <> < /script > tag for Javascript language.

Note, here you need to replace frmName with your actual name of form element on page.


for(i=0; i < document.frmName.elements.length; i++)
{
alert("Field Name : " + document.frmName.elements[i].name + "
<> Field Value : " + document.frmName.elements[i].value + ".
<> ");
}


You can find example of how can above piece can be used to loop through all the form fields. Example explains you how all the checkboxes available in form as well as explains how those checkboxes available on page can be unchecked (e.g. all the records listed on page needs to be activated/de-activated, or adding / removing items from your shopping basket).

Initially, you need actions to give call to the Function...
< type="button" name="btnSelect" value="Select Records" onclick="javascript: selectAll();">
< type="button" name="btnDeSelect" value="De-Select Records" onclick="javascript: deSelectAll();">

Second step is to have the piece of code that loops through all the elements,

< language="JavaScript">

function selectAll()
{
/* Function to loop through the form elements and check all the elements that are of type Checkbox */

for(i=0; i < document.frmName.elements.length; i++)
{
if(document.frmName.elements[i].type=="checkbox")
{
document.frmName.elements[i].checked=true;
}
}
}

function deSelectAll()
{
/* Function to loop through the form elements and un-check all the elements that are of type Checkbox */

for(i=0; i < document.frmName.elements.length; i++)
{
if(document.frmName.elements[i].type=="checkbox")
{
document.frmName.elements[i].checked=false;
}
}
}

< /script >