Sunday, August 24, 2008

Kingfisher Flying with Linux

KingFisher Airlines, Indias most colorful and luxurious domestic airlines provides Entertainment system which are based on Linux.
It so happened that I was travelling from Hyderabad to Bangalore in KingFisher flight. 5 min before the take off , all the entertainment units got restarted. I was totally amazed when I saw a Linux boot sequence getting displayed on the screens. It was an embedded Linux ( a scale down and customized Linux especially for the Embedded Systems). After the booting was over the X window console came and then suddenly the moving map. The entire thing was very exciting. I wanted to share this information at that time itself. I sent SMSes to my friend who is a Linux Junnkie. I wanted to send this information to everybody who can get excited like me. For the first time I realized the use of microblogs like twitter. Had I got a twitter account on mobile I could have immediately posted the information on my twitter widget on the Blog. So the flight seem to be providing me lot of insights....
For all the Linux junkies KingFisher is a nice example of proving the use of it in the commercial systems.





Add to Technorati Favorites

Saturday, August 2, 2008

Easiest way to crack an Interview

Cracking an interview is what most of the people look forward. People generally prepare a lot for an interview in terms of their technical stuff, personal questions etc. All this is fine but I think even the interviewer is aware of all these preparations the candidate usually do, so he might not be very impressed if you answer him in the artificially imposed sophisticated looks and manners. The interviewer has 1 min to judge you and you have to take the lead in that 1 min. I have recently given 4-5 interviews (just for fun) and in all those interviews I found that no body is actually interested in looking at you "artificial manners". They will be more than happy if you remain what you actually are. So here is the trick and this is applicable for both freshers and the experienced people.
Just to put it in simple sentences
1. Prepare slides or some visual depiction of the work you have done so far.
2. Ask the interviewer permission to show your stuff.
3. In all probability he will say yes
4. Using your slides/ graphs give an overview of the work
5. Be very casual while describing. The words should be just oozing out of the mouth.
6. You should look proud and confident of what you have done. Think as if you are selling your work to a customer
7. You should tell what impact you work has put in the current company (if you are switching the job) or if you are fresher than how your work has been judged by the college
8. All this has a great effect on the interviewer.
  • He thinks that you are confident about what you have done--so you are not telling a lie.
  • He thinks that you are sound in the area that you are looking for.
  • He understands that you can express yourself---a very important quality
  • He understands that you can sell your case ---If you cannot market a thing then what is the use to produce it?
  • He thinks that you are professional-- slides, graphs, if permitted a prototype
9. If you have impressed the interviewer by your presentation, then it really don't leave any space for rejection, since Interviewer gets answers to all the potential questions.

In Short
"BE COOL AND TALK RATHER THAN LISTEN AND GET TENSE"

My take on REST and SOAP

  1. Soap supports more RPC style of architecture where the use of SOAP is to invoke a remote function carrying in the message the function name and the various parameters. The RPC is basically a function that is sitting on a remote machine.
  2. The function has a specified number of parameters that needs to be provided to make use of the function. The use of SOAP is to make requests to such functions and to get the response back.
  3. SOAP uses XML to transfer the data and so it is heavy in size.
  4. The SOAP message is cryptic in the sense that it contains a header that wil specify the route, the info about the message and sometimes the security aspect for the message
  5. The SOAP message is difficult to create without the tools. So these days the langusgaes provide the library functions which will create the SOAP message
  6. The SOAP is generally sent using HTTP but other protocols are also valid like Java Message service
  7. SOAP is very function (verb ) centric. The way you get the things done is by calling a function so to get the stock prices you will call a function (web method: A webservice will have number of methods) getstock(GE)

Now the function will calculate the price and send it back to you

You must know the names of the function and the way it is going to use the parameters. For that you need to get the WSDL file which is very cryptic.

  1. SOAP syntax is not user friendly and human readable
  2. When SOAP makes the http request its difficult to find out which http method it is actually going to use.

REST

In case of rest the functions are fixed it will be get, put, post and delete. You will mention the name of the stock directly while making the request (each object will have a different URI) so www.stockprice/category/stock/GE

In this case the description of how to make the call is very simple and its intuitive.

No extra tool is required, The call is very simple.

REST is only for http since it uses the protocols methods GET, PUT(Update), POST (create), DELETE. This is good since the user don’t have to find out which method will be used for a specific purpose. Its basically service_name/noun so Stock is a service and GE is the noun

Tuesday, May 13, 2008

Password validator in flex 3


create a validator PwdValidator.as

package valueObjects

{
import mx.validators.ValidationResult;
import mx.validators.Validator;

public class PwdValidator extends Validator {

// Define Array for the return value of doValidation().
private var results:Array;
// this will help in getting the status
public static var VALID:Boolean = true;


// Constructor.
public function PwdValidator() {
// Call base class constructor.
super();


}

// Define the doValidation() method.
override protected function doValidation(value:Object):Array {
//var pwd: Password = value as Password;
var p1: String = value.first;
var p2: String = value.second;

results = [];
results = super.doValidation(value);


if(p1 == p2)
{
VALID=true;
return results;
}
else
{
results.push(new ValidationResult(true, null, "Mismatch",
"Password Dosen't match Retype!"));
VALID=false;
return results;
}
}
}

}


Now the flex code should be passing the value of the password and confirm password textbox. This is done as

<mx:Model id ="pass">
<name>
<passwords>

<first>{txtPassword.text}</first>
<second>{txtConfirmPassword.text}</second>

</passwords>
</name>
</mx:Model>

// this is the way to pass the multiple controls input to the validator.
<val:PwdValidator id="custPass" source="{pass}" property="passwords" listener="{txtPassword}"/>

<mx:Form labelWidth="110">

<mx:FormItem required="true" label="Password">
<mx:TextInput id="txtPassword" displayAsPassword="true" />
</mx:FormItem>
<mx:FormItem required="true" label="Confirm Password">
<mx:TextInput id="txtConfirmPassword" displayAsPassword="true" change="custPass.validate()"/>
</mx:FormItem>

</mx:Form>


Wednesday, May 7, 2008

Five best bollywood lines

1. Border : If every soldier leaves the battlefield to serve his family, who is going to fight the enemy
2. RHTM.. never say i dont eat nonveg, say I have not eaten it since long time
3. DDLJ: Whats there in Zurich , real europe is countryside.
You can not spend the entire life with your friends, you got to have a beloved
4. Zameen: In our country its illegal to kill stray dogs
5. OSO: Every story has a happy ending, if you think the end is not happy it means the story is incomplete

Saturday, May 3, 2008

New Book on Web 2.0



A must read book. The author has explained the Web 2.0 philosophy in a very intuitive way. He talks about how to monetize the websites at the same time attract the users by giving them
some free services. He calls this as Freemium.
The book discusses the success stories of Flickr, Facebook,Linkedin, google. The basis of all the success story is the rich user base.All of them have followed the long trail concept by reaching out to the masses rather than concentrating to a niche segment " Every buck counts".
Since the book talks about the sites which we commonly use it is easy to realize the concepts since we are the part of the revolution happening around the particular site.

I would highly recommend this book to anybody who wants to find out what is this web 2.0 business all about.

Saturday, April 19, 2008

How to create XMLListCollection from XML in flex 3

There are times when the data that you obtain is in the form of XML or a string that contains XML tags. For displaying the data in datagrid, list, trees we desire to convert the data in the XMLListCollection. We need to perform the following steps to get the XMLListCollection.

1. Lets assume that we want to convert the following string to the XMLListCollection

var xmlStr:String="<root>
<person>
<name>Rohit</name>
<surname>Agarwal</surname>
<phone>5551234</phone>
<age>24</age>
</person>
<person>
<name>Richa</name>
<surname>Mittal</surname>
<phone>5552341</phone>
<age>23</age>
</person>
<person>
<name>Puneet</name>
<surname>Jain</surname>
<phone>5553412</phone>
<age>23</age>
</person>
</root>";

2. Convert the string to XML

private var pat:XML ;

pat=new XML(xmlstr);

3. Convert the XML to XMLList. We want to have individual persons as seperate XML objects

private var patList:XMLList;
patList = pat.person;

4. Convert the XMLList to XMLListCollection

[Bindable]
private var patListCol:XMLListCollection;
patListCol = new XMLListCollection(patList);

In this way the XMLListCollection is created from the XML