Tuesday, April 12, 2011

A Minute Manager – The Second Secret

Alright Pals, ready to know the second Secret of “A Minute Manager”? Well, here it is.

Second Secret is “A Minute Praising”. Yes, you heard it. It’s a minute praising.

Being a Minute Manager, one should make it very clear to its subordinate on very first day that he(manager) know that it will be a lot easier for him(subordinate) to do well if he gets crystal clear feedback from the manager on how he was doing. A manager should make sure to convey the subordinate that he wants him to succeed, be a great help to organization and enjoy his work as well and therefore he would try to let him(subordinate) know in all certain terms when he is doing well and when performing poorly. This might not be the most comfortable situation at first for both manager as well as subordinate cause people are not used to with this concept, as most managers do not manage this way. But in that case, manager should assure its subordinate that such feedback would be of great help to subordinate himself.

Let me explain you guys in details…
Once Goal settings are done for a staff, you being a Minute Manager should be in a close contact with him. You can do this in two ways, firstly, observe all the activities of sub-ordinate very closely and secondly, make your sub-ordinate keep detailed records of his progress and have him send it to you regularly. Initially, your sub-ordinates might think that you are spying on him and that you don’t trust in him. But believe me, eventually he will get over with this wrong interpretation. 
Motto behind all this should be only one and that is Try to Catch him doing something RIGHT.

Help People Reach Their Full Potential…
Catch Them Doing Something Right.

Most of the managers spend their efforts in trying to catch people doing something wrong. You being a minute manager should try to catch them doing something Right. And this is the moment where Praising comes in Action.

Yeah! Correct… When you see your sub-ordinate doing something right, go to him and make a brief contact. That may include putting your hand on his shoulder or touching him in a very friendly manner. I know you are laughing at this, but believe me it makes a great difference. It just makes your sub-ordinate feel that you really care about him and that you want him to prosper. He feels that you both are on the same side. So anyways, after that just look straight into his eyes and tell him precisely what he did right. And then share with him how good you feel about what he did. It certainly will make your sub-ordinate feel good.
But make sure you are consistent in doing this. I mean, things may not be going well for you elsewhere and no matter how much annoyed you are about other things, but do respond to your sub-ordinates situation and praise him for his good performance and when he deserves it. The things going around you should not affect your response. Your sub-ordinate would surely appreciate it.

Now you would say, I am a manager and I already have a lot on plate daily. I am very busy person and that wont this praising and all take a lot time of mine? Well – Not really.. Remember, you don’t have to praise someone for very long to let them know that you noticed and do care. It should not take more than a minute. And that’s why its called “A Minute Praising”.
Just a last point to note, you should try catching your sub-ordinates doing something right only when he starts to work with you or when he being to new project or responsibility. After your sub-ordinate get to know the rope you can reduce being around him. This is because, by that time you and he have other ways of knowing when his job performance is “praiseworthy” cause then onwards you both can review the data in information system e.g. Sales Figures, project schedules etc. Also, by then, your sub-ordinates begin trying to catch himself doing right and praising himself. Plus, he is wondering when you praise him again and this feeling keeps him going when you are not around.

Well folks! You must be thinking that though one can’t argue about effectiveness of catching people doing something right, especially after they know what they are to do and what good performance looks like - But do one minute praising really work?. You must be wondering, does all this a minute management stuff really gets results – the bottom-line results?

To get answers of these and such all of your questions and to know little more about our Third Secret for being a Minute Manager, lets meet in my next post. Same Place, with same passion and at.. umm… lets say, somewhere in near future !!.. ha ha… ciao.. Stay Tuned and have a Happy Managing…



Courtesy :
the One Minute Manager
by Ken Blanchard and Spencer Johnson
All Content and/or ideas Copyrights are reserved and maintained by Authors/Publishers.

Wednesday, February 16, 2011

A Minute Manager

Friends, Its been quite a while, I have had written something nice. The other day, I was having a sip of coffee whilst enjoying view in my garden, I saw bunch of people working in my patio with their in charge yelling at them for doing some work in-correctly. And it suddenly struck with the topic in my mind to discuss with you pals. So here we are today discussing How a Good Manager should be.. I guess my this post would interests many New as well as prospective Managers...

Lets see the definition of a manager. The act of getting people together to accomplish desired goals and objectives using available resources efficiently and effectively is called the Management and the person who uses/posses these management skills to achieve those goal by leading people is called Manager. A boss or A supervisor is a literal dictionary meaning of Manager.

In our daily life, we come across various types of managers. Government Administrators, Military Officers, Construction Superintendents, Corporate Executives, University Professors and Shop Stewards. Managers of shops, banks, restaurants and hotels with men and women… young and old, almost all types.

We see many ‘tough’ managers, whose organization seems growing but people they have are lost. If we ask them what type of manager they are, they would proudly quote ‘autocratic – who keep on top of the situation’, bottom lined, hard-nosed, strict, realistic, profit minded etc. Despite of their proud, these words speak their interest in results.

Versus, we also see many ‘nice’ managers, whose people seems wining but their organization fails. If we ask these managers, what type of manager they are, they with proud in their voices, would quote democratic, supportive, participative, considerate, humanistic etc. These words clearly shouts loudly about their interest in people.

If we look closely, many managers fall in either of above category. Managers who interests in results are labeled as “autocratic” whereas those who are interested in people are labeled as "democratic". But each of these types of managers is partially effective kinda like half manager.

I feel a manager should be an “Effective Manager”, who with his presence, should not only profit Organizations but also the people he works with while managing himself and the people working with him.

Now that I have quoted what a Manager should be like, lets discuss what one can do to be a great Effective Manager.

An Effective Manager should be more in touch with his people through meetings. Meetings should not be far distant that people forget what was discussed in past meeting and should not be frequent enough to consume all of our people’s time in meeting only. I guess May be a weekly meeting of an hour or two should be enough. Target of those meetings for manager should be more like listening to the problems and accomplishments his people had in past week and the things that are yet to accomplish. Together they should come up with strategies and plans for the coming week. The decisions and plans should be binding to both Manager as well as staff. Of course, if not binding there won’t be any point of arranging meetings, don’t you agree? J

A Manager should neither be participating in his staff’s decision nor should he be only result oriented. Startled ?!? Well Yes, One can not achieve results if its not through people! They both go hand in hand.

People Who Feel Good about Themselves, Produce Great Result!

Wont you agree with above statement? You get things done more when you feel good about yourself! So, a Manager should be always remembering, “helping people feel about themselves is a key to getting more done”. While doing so he must not forget that “a productive is more than just a quantity of work done. It’s quality also”. Thus, “Productivity is both Quality and Quantity”.

We can call such Manager who achieves the productivity mentioned above through people as “A Minute Manager”. Why “A Minute Manager”? Because, it takes a very less time to get very big results from the People.

Well, now you guys seem a bit surprised to hear this. So to explain you a bit better, let me take you a bit down in the concept.

I can see there are Three secrets for being “A Minute Manager”. Lets go through them one by one.

First Secret is “A Minute Goal Setting”.
A minute goal setting is a foundation of “
A Minute Management”. Most of the times you guys have seen that there is conflict between the manager and staff for understanding the responsibilities staff is held accountable for. In fact, I guess, many of you have been in trouble for not doing some job, which you at first place never thought is yours. “A Minute Manager” should always make it clear to his staff what their responsibilities are and what they are being held accountable for.

Once a manager and staff have agreed on what needs to be done, then each goal should be written on a single page. Goal with its performance standard should be expressed in no more than 250 words. Its like, anyone should be able to read that in a minute. Both, a manager and staff should keep a copy of this so everything is clear and progress can be checked periodically.

Goals should be set with 80-20 Goal setting rule, i.e. 80% of really important results should come out of 20% of goals set.

Isn’t it sound like “No Surprises” – everyone knows what is expected from them from starting.

It doesn’t stop it yet. Once these minute goals are set, a minute manager should always ensure what a good performance is. Thus, performance standards are made clear.

You must not also forget to take a minute every once in a while out of your day to look at your performance and see whether or not your behavior matches your goal.

Well I guess, by now you have understood the importance of Goal Settings in your work. After all how can you be an effective manager, if you and your staff doesn’t know what they are being asked to do? And what is an efficient way to do it.

I think this is enough to you guys for a day... I would take a break here… The rest of two secrets being “A Minute Manager”, I will cover and share with you very soon in my another posts. So stay tuned and till then, Aloha !! Wish you new managers a Very Happy Managing.


Courtesy :
the One Minute Manager
by Ken Blanchard and Spencer Johnson
All Content and/or ideas Copyrights are reserved and maintained by Authors/Publishers.

Wednesday, February 17, 2010

Shell Scripting Continued...

Hi Folks

Along with my previous commitment about posting further more on Shell Scripting and on request from few about same, here I am again with few more details on it.

In this blog, I would try to answer basic Why, How and Where about Shell Scripting.

I received ample of comments with basic yet very valid question that

Why Should I need to write Shell Scripts ?

Here are some usage I have tried to quote :

1. Operating Systems likes Linux and other Unix-like needs automated tasks. Shell scripts are extremely useful for achieving this.
2. Shell scripts are also employed extensively in the default installations of Unix-like operating systems.
3. In daily life, programmers might need to execute series of commands most often. Executing those several commands manually at a command line interface, Shell scripts allow it to be executed automatically. And that too without having to wait for a user to trigger each stage of the sequence.

For example, in a directory with three C source code files, rather than manually running the four commands required to build the final program from them, one could instead create a C shell script, and keeping in the directory with them, which would compile them automatically.

These types of programs are also called as Batch jobs.

4. A shell script can be used to provide a sequencing and decision-making linkage around existing programs, and for moderately-sized scripts the absence of a compilation step is an advantage.
5. Shell scripts can also be useful at a need where scripts requires executed :
  1. Interactively
  2. Once, at a future date and time
  3. Repeatedly on a fixed schedule
  4. Using an HTML form

Next, I would like to shed light on How to create shell Script ?

What all I would like to mention here to answer this question is that all that is necessary to create this script is to open a plain text editor (but not a word processor), such as vim, emacs, gedit, dtpad et cetera are all valid, any text editor will do. And type the series of commands to execute them. Thats it !! Its that simple !! For adding commands to be executed, you can refer my previous post on same topic. It would help you understand the syntaxes, variables, arithmatics to be used etc. in script.

Consider a very basic example of printing Date of the System :

Filename : myDate.sh

#!/bin/bash
set `date`
echo $1 $2 $3 $6

Alternatively, the above code could be copied from this page and pasted to a blank page opened by the text editor page using the standard keyboard or mouse copy and paste functions.

After saving this plain text file, with a file name such as date (or anything else desired), the script is complete and almost ready to run. Scripts are typically run by typing a dot, a forward slash and the file name (with no spaces in between) and then pressing the ENTER key. You would come to know further ways to execute the script from command prompt down below.

Thus, for example, if the above script were saved with the name morning, an attempt could be made to execute it by issuing the following command:

./myDate

Script will print the output as : sat Aug 5 2006

However, the script probably will not run, in which case an error message will appear on the screen such as bash: ./myDate: Permission denied.

This is because the permissions for the file first have to be set to executable. (By default, the permissions for new files are set to read and write only.) The problem can easily be solved by using the chmod command with its 755 option (which will allow the file creator to read, write and execute the file) while in the same directory as that in which the file is located as follows:

chmod 755 morning

Now the script is totally ready to run..


Finally Where would I execute the Script ? is the question remained..

Command Prompt !! This is what all I can answer to this. Ha ha. Yes, serious I am. Consider you have named your script as foo. (Well, I dont know why foo. :) Its just like that !! LOL ). So once you are done writing your script, you would simply go to the command prompt and type any of following command to execute your script..
  • $ bash foo
  • $ sh foo
  • $ ./foo


Finally, I would like to share one Shell Scripting example with Menu Program ::

fnMainMenu()
{
clear
echo "======= Menu ==========="
echo "Menu :"
echo " (1) Addition"
echo " (2) Quit this Menu"
echo "Enter your option : "
read response
case $response in
1) echo "Enter First Number : "
read num1
echo "Enter Second Number : "
read num2
sum=`expr $num1 + $num2`
echo "Addition : $sum "
;;
2) exit
;;
*) echo "I dont know what you are trying?"
sleep 2
;;
esac
}
#===== Start =====
#!/bin/sh
fnMainMenu


Try this program !!

Hope I have been successful in explaining the more basics about the Shell Script and was able to answer most of your doubts on this, so feel free to share your views on this.

Monday, February 15, 2010

SQL Injection

Hello Folks, Long time no see !! I know I was also missing writing since couple of months. To fulfill my hunger of writing and your hunger of reading, here I am ready with another topic to shed some light on...

Our Todays topic is SQL Injection..

Another common vulnerability which is result of slipshod input validations is SQL Injection. Generally cross-site scripting vulnerabilities are actually directed to your site's visitors whereas SQL Injection is something which directly attacks on your site itself – to be specific its Database.

Target of SQL Injection activity is to insert arbitrary data, mostly DB Queries, which are eventually executed by the Database using your script only. The subtle query may attempt any no. of actions starting from retrieving the records till removing significantly all records from database including altering or modifying the same.

[In this blog, I have used PHP Scripting Lang. extensively, but note, it is possible with any Scripting language and PHP is used as I love it.. ;P ]

To demonstrate it in more detail, look at the below example :

Consider a simple query where I want to retrieve the user name and password of user named 'Sandip'.

$strSelectQuery ="Select username, password from tbl_Users where user_name='".$userName."'"

For this Query, in my script I am taking user name as in a variable:

$userName = "sandip"

So that it would make my call as :
mysql_query("Select username, password from tbl_Users where user_name='".$userName."'");

Simple ain't it ? But here's the glitch..

What would happen if instead of simple 'sandip' input some enters:

$userName = "sandip’; DELETE FROM users;"

By appending an entirely new query to $userName, the call to the database turns into disaster: the injected DELETE query removes all records from users.

Still Confused how ? Ok here, if notice the single quote and semi-colon given in user input, those two entities will complete the first query successfully causing next query for Delete User stacked in queue and getting it executed will remove all of those users off the table.

Hoohh !!! Scary huh ??

But don't worry, PHP is here to rescue, Magic Quotes is something provided by PHP. This is PHP's automatic input escaping mechanism. magic_quotes_gpc, provides some basic protection. If "magic quotes" enabled, it adds a backslash in front of single-quotes, double-quotes and other characters that could be used to break out of a value identifier. If not enabled, you can still use addslashes feature given by PHP in combination to protect at moderate level.

E.g.
if (!get_magic_quotes_gpc()) {
$userName= addslashes($userName);
}

$strSelectQuery ="Select username, password from tbl_Users where user_name='".$userName."'"

Wondering how escaping would help ! Ok, carefully note, in first illustration, it was single quote which caused our first query completed making second one stacked and executed. How if we do not let our first query itself completed ?? Yeah, you got it !! escaping single quotes from input string would add slashes in it and would in turn hold the query to be completed forcefully by user input.

There are many of the database extensions available for PHP include dedicated, customized

escape mechanisms. E.g. the MySQL extension for PHP provides the function mysql_real_escape_string() to escape input characters that are special to MySQL and if you are not much interested in using addslashes you can surely tweak the code as :

if (get_magic_quotes_gpc()) {
$userName = stripslashes($userName);
}

$userName = mysql_real_escape_string($userName);

$strSelectQuery ="Select username, password from tbl_Users where user_name='".$userName."'"

Note, here before giving a call to the function, checking magic code state is important in else case input would be escaped twice.

Ouch !! Unfortunately, escaping the single quote does not always guarantee you security of your code from SQL Injection. There are certain queries that still allows SQL Injection despite of you escaping the input. Consider following example, you would know what I mean :

$user_id = "0; DELETE FROM tbl_Users";

$user_id = mysql_real_escape_string($user_id); // 0; DELETE FROM

If you note here, we are expecting a numeric value as an input to our query, and as you know it’s not necessary to enclose the value inside single quotes. Thus, even if we escape the input, there is nothing to escape and hence still causing the second injected query of delete execute successfully causing our Database severe damage.

But don't worry, we still have solution to this problem as well. How about Casting feature of PHP. As we know, we gotto have numeric value as an input. Why don't we cast it ?? Feeling good to know this...

So, if an integer is required, cast the incoming datum to an int; if a complex number is required, cast to a float. As simple as that Lets see one illustration for this as well :

$user_id = "0; DELETE FROM tbl_Users";
$user _id = (int) $user_id; // 123
$strSelectQuery ="Select username, password from tbl_Users where user_name='".$userName."'"

A cast forces PHP to perform a type conversion. If the input is not entirely numeric, only the leading numeric portion is used. If the input doesn’t start with a numeric value or if the input is only alphabetic and punctuation characters, the result of the cast is 0. On the other hand, if the cast is successful, the input is a valid numeric value and no further escaping is needed.

Numeric casting is not only very effective, it’s also efficient, since a cast is a very fast, function-free operation that also obviates the need to call an escape routine.

Aahh !! Relax, Now we are much safe here !!!

Hope you all have read the article and found helpful to take care of those things in your development !! Feel Free to share your feedback...

Wednesday, July 8, 2009

Situational Leadership

Friends,

Today I would like to share few of thoughts about how to be a good manager. Many times it has been a question from most of managers saying they are having hard time to get work done from people as hard as they used to do themselves.

Lets begin with a one of famous quote :
Don't work hard.. work smarter...

As a Manager, One need to learn to delegate the tasks...Manager should work for their staff and should not happen other way round.. One need to provide a resources and working condition to its staff in order to accomplish the goals you've agreed to.. At last, You need to roll up your sleeves and help your subordinates to win rather than wait to "catch them doing something wrong".

Note, If your subordinates win you win. And for that you need to work closely with those who need help, thus treat different people differently, just like saying "different strokes for different folks".

One minute Manager should assign tasks and should work closely with the person. Involve in his job if he lacks in experience or is new on job.

Listen to the person and work participative with the person who is doing well. Never tell him what to do, but together arrive at the direction you want.

One minute manager should be Situational Manager which means he should be able to change his style depending on conditions and peoples.

To Be a Situational Leader Learn 3 Things :

      1. Flexibility : Use Variety of leadership style flexibly.

      2. Diagnosis : Diagnose the need of people you supervise

      3. Contracting : Come to some agreement with them, to contract with them for leadership style they need from you.

Four Basic Leadership styles are :

      1. Directing : Leader provides specific instructions and closely supervise tasks accomplishments.

      2. Coaching : Along with directing style, it also explains decisions, solicits suggestions and support progress.

      3. Supporting : Leader facilitates and support sub-ordinates efforts and share responsibility for decisions making with team.

      4. Delegating : Leader turns over responsibility for decision making and problem solving to sub-ordinates.

These 4 styles consist of different combination of 2 Basic Leadership Behaviors :

      1. Directive Behavior : STRUCTURE, CONTROL & SUPERVISE

      2. Supportive Behavior :PRAISE, LISTEN & FACILITATE

Directive Behavior is one way communication where you tell people when, where, why n how about the task. And monitor the task closely. You tell person what is goal and what a good job look like. You layout step by step plan to accomplish task and prob. is solved. You make decision and your sub-ordinate carries out your ideas

whereas

Supportive Behavior is where you support subordinates efforts, listen to their suggestions and facilitate their interaction with others. You encourage and praise to built their motivation and confidence.

There Is Nothing So Un-Equal As The Equal Treatments of Un-Equals.

Directing style leadership is better for enthusiastic beginners whereas coaching is the right style for disillusioned learners. Experienced people like a more participative management.

Delegating is Appropriate for people who are peak performers. If you are feeling very much loaded with work, if it goes beyond your head - Delegate it.

When I Slow Down, I Go Faster : So think before acting.....






Before using any leadership style, you need to diagnose the person's past performance. And competence and commitment are two important ingredients to determine person's
performance / achievement.

So Problem in either competence OR commitment OR Both determine that person is not doing well.

There is a slight difference between Competence and Ability. Many of you think, and do directly relate competence with ability of person.

Competence is a function of knowledge and skills which can be gained from education, training and/or experience.

Ability is 'natural' potential to acquire certain skill so easily whereas, Competence is something which can be developed with appropriate direction and support. It is not something you are born with. It's Learned.

Commitment is a combination of confidence and motivation.

We can define Confidence and Motivation as :

Confidence – Measure of self assuredness.

Motivation – Interest and enthusiasm to do task well.

People can have different combination of competence and commitment. And so it make up 'Development Level' for the person.

There are total 4 Development Levels. These are :

Thus, Everyone has Peak Performance Potential - You just need to find it.

Leader needs to do what people they supervise can't do for themselves at the present moment.

  1. D1 has commitment but lacks competence, leader needs to provide Direction ( S1 ).

  2. D2 lacks both competence & commitment, leader needs to provide both direction & Support ( S2 ).

  3. D3 has competence but variable commitment, leader has to provide support ( S3 ).

  4. D4 has both competence & commitment, leader does not need to provide either direction or support ( S4 ).


As the development level moves, manager should change and move leadership style.

Five Steps to develop persons Competence & Commitment :

(In other words steps to change person's development level)

  1. Tell them what to do

  2. Show them what to do

  3. Let them try (But don't turn over too much responsibility, risk has to be reasonable)

  4. Observe the performance ( You can Expect more, If you inspect more )

    But it means catch people doing right, Not wrong.

  5. Praise the progress.


Remember to save Reprimands for D4, D3 and occasionally D2. If you use reprimand for D1 they might loose interest and stop trying. It's not a tool for training. Nor is it to teach skills. It's mostly a way to deal with Motivation and Attitude Problem.

Do not forget to have all facts and see theres no extenuating circumstances before Reprimand.

Decline in Performance, may caused by drop in confidence - You need to provide support and encouragement rather than Reprimand.

“Contracting” is a third skill of being Situational Leader :

As per most famous saying, “Situational Leadership is Not something you Do to People, But something you do With People”.

Most of managers may think as a manager, they had to figure out all by themselves but contracting eliminates all that worry. In Contracting, you come to mutual agreement with people you supervise.

By this time, when I have mentioned so much about Situational Managerial skills and Leadership of One minute manager, you must have comfortable enough to handle the situations and tackle the problems smartly. If you're nodding your head vertically... Voila.. you are almost Situational Leader.. Congratulations !! This was just first step and we have long run to go … Will keep posting further about it...


Courtesy :

Book : Leadership and the One Minute Manager

by Kenneth H. Blanchard, Patricia Zigarmi
All Content Copyrights are reserved and maintained by Authors/Publishers

Friday, May 15, 2009

Connecting MS SQL Server through PHP

Being a PHP developer, we've been used to connect to MySql Database through PHP. Using a MySql Database generally recommended strongly by overall community but what if I have some restrictions and have to use MS Sql Server.

Recently I came across a situation where one of my friend called me to clarify his few queries. He was working on moving asp application onto PHP (Kudos to PHP ! This has become a trend now -lol ) and he came across a condition where database previously used was MS SQL and his client didn't want to change the database though ( God knows why ?? ). It gave me a nice chance to have our own little class script which would handle the connectivity to the server and handle the errors as well as other DB related necessary functions.

Below is the class definition which I think you might find useful for your future use...


<?php

// SQL SERVER DATABASE LOGIN DETAILS
$DB_USER_MSSQL = username;
$DB_PASS_MSSQL = password;
$DB_HOST_MSSQL = host;
$DB_DATABASE_MSSQL = database;


class ConnectDB_MSSQL {
var $conn;
var $errFunc;

function defineerror($msg) {
echo "</table></table></table><p>\n";
echo "<h1>Database Error: $msg</h1>\n";
exit;
}
function ConnectDB_MSSQL($db_name,$server,$user,$pass,$error_function="defineerror") {
$this->errFunc = $error_function;
$this->conn = mssql_connect($server, $user, $pass);
if (! $this->conn ) {
$this->error("Unable to connect to MSSQL database");
return;
}
$result = @mssql_select_db($db_name, $this->conn);
if(!$result) {
$this->error("Unable to select MSSQL $database database");
}
}


function error($msg="") {
$this->{$this->errFunc}($msg);
}

function close() {
return @mssql_close($this->conn);
}

function query($sql) {
$result = @mssql_query($sql, $this->conn);
if(!$result) {
$this->error("Query ($sql) failed: ");
}
return new DatabaseQuery_MSSQL($result);
}


function addSlashes($string) {
return addslashes($string);
}

function stripSlashes($string) {
return stripslashes($string);
}

function parseDate($string) {
list($date, $time) = split(" ", $string);
list($year, $month, $day) = split("-", $date);
list($hour, $minute, $second) = split(":", $time);

$result = mktime($hour, $minute, $second, $month, $day, $year);

return $result;
}
}

class DatabaseQuery_MSSQL {
var $id;

function DatabaseQuery_MSSQL($id) {
$this->id = $id;
}

function fetchArray() {
return @mssql_fetch_array($this->id);
}

function numRows() {
return @mssql_num_rows($this->id);
}

function seek($row) {
return @mssql_data_seek($this->id, $row);
}

function fetchField($offset) {
return @mssql_fetch_field($this->id, $offset);
}

function f($offset) {
$a = @mssql_fetch_array($this->id);
return $a[$offset];
}

function fetchRow() {
return @mssql_fetch_row($this->id);
}

function numFields() {
return @mysql_num_fields($this->id);
}

function result($row, $index) {
return @mssql_result($this->id, $row, $index);
}

function freeResult() {
return @mssql_free_result($this->id);
}
}

?>


Object for the above class defined can be created as :

<?php

$db_MSSQL = new ConnectDB_MSSQL($DB_DATABASE_MSSQL,$DB_HOST_MSSQL,$DB_USER_MSSQL,$DB_PASS_MSSQL);

?>

and that's all !! Just create a library file of above class and include it in your script, and you are done !! Isn't it simple !!

BTW, sorry for formatting in above script.. I tried a lot to bring it to proper format, but thanks to blogspot... :)

Feel free to put your views or comments !! till then Aloha !!

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 .