Tuesday, December 14, 2010

How to use GIt



I have been working on project which uses GitHub as source control tool. so i thought of sharing my experience on working with this tool.

When i am asked to use this tool for the project i was thrown away by the number of commands that are necessary to work with GitHub, so i started learning it by my self from the scratch and here is step by step guide for you to learn it with real example.

First create account at github.com

after creating account , it will take you to this page
then you create a repository.Thereafter it will take you to this page.


if you are working on windows operating system then you need to download Git and install it on windows environment.

download the suitable GitHub version and install it on your operating system. since i am working on windows operating system i have downloaded .exe setup file. After installation is done ask your self why do i want to download and install it. it is because, all the source control activities are done through this interface here after. this GitBash is very much similar to linux shell.

Now comes the most important steps.



whatever the project first you have follow the following steps to configure your machine to your git account.

How what do you want to do, this is the problem i had at first. i have git account and git bask running on my machine, now i want to work with github.com account i have created using git bash.

One way, i have project on my computer and i want to put that in to github

This is how you do it,







So here we go ....


First tell git who you are: git has many users , so when you are connecting to make source control of your source on git, let it know about you to point to your project source :P



Hey, git, here is my name and email.

git config  user.name "Your Name" git config  user.email kapila@ntp.org

You can understand this from the following example also. Say you are working on a project which has 100 developers. 
So you are the program manager and , what you first do is create git account in github.com, this has nothing to do with 
your local machine. 


or else , first create new project in remote repo and then make a pull. 

here goes how you do it
following window shows how you create new repository. 

it will point you to the following window.
it says, what to do next. so you have project that is sync with github and all your source code reside in github nowww!






Sunday, November 21, 2010

Web 2.0 Summit, Eric Schmidt

I was interested in the latest discussion that Google CEO, Eric Schmidt had at web2.0 summit. I thought of sharing those ideas and elaborate what he said bit more precisely.

Q: There has been a lot of talk about a new operating system aligned with a potential hardware device, coming from Google. We’d love to see it if that was possible.

ES: OK. How about instead a demonstration of some software.? So, I happen to have here an unannounced product that I carry around with me. That is an Android device, and we have taped over its origin.

You see, this is a placemark [showing a placemark panel, obviously with a tag in it]. The neat thing you could do with this new technology called NFC (which stands for Near Field Communication), and we think that Android should support that. It’s been around for a while, by the way.What you do is, these are chips that are embedded in things, eventually in clothes to prevent people from stealing. These chips are senders, and we are incorporating support for the reader-writer, so the way it works is you turn this thing on and you basically just tap like that, and it tells you, in the particular case, where you are.

What’s neat about the NFC chip is that the whole notion of location takes an entirely new meaning, because now I can just tap, I don’t have to take a picture, I don’t have to scan a barcode.

Q: So this is basically gonna be in presumably many of the new Android phones.

ES: It’s actually gonna be in the new operating system called Gingerbread that comes out in the next few weeks. So we think that the overall mobile market, which is already extraordinarily excited about these payment systems, will benefit from having those, because it is a secure element, and the secure element really is very hard to steal if you will.

Q: So, the secure element allow you basically to do payment.

ES: One way to think about this is that is that it will replace your credit card. The term of the industry is called tap and pay. The theory of the case is that you will be able to take these mobile devices from everybody, to walk into stores, do commerce, you’ll be able to figure out where you are, again, with your permission, all that kind of stuff.

Q: Effectively, bump for everything.

ES: Yes, bump for everything, and eventually, replace credit cards.

Q: It also turns the phone into a much more powerful form of identification.

ES: It’s an example of what I have talked about for a while, which is “mobile first”. I don’t think that people understood how much more powerful these mobile devices are going to be than the desktops. You think of the desktop machine as having all this power and tremendous network, beautiful screen, but because these things are so highly personal, and because they are location aware, …

Q: They also have network

ES: Yes, with LTE networks coming to the United States, first in the world, for a change, roughly in January-February around the country, it is a really really god day for mobile.

Q: With the theme of points of control, it strikes us that one of the points of control is having tons and tons of credit card numbers; Amazon has tons, Paypal has tons, Apple has a lot. Combined with this kind of technology, it strikes me that it could possibly change the game. Do you agree with that, and where does Google stand with that.

ES: Well, we see ourselves as a technology provider in this, we’re not trying to compete in those spaces, but ultimately this technology is personal, it’s secure, and it’s an aggregating technology. So it makes sense that you put everything in it and carry it around. It has to be secure, because it’s obviously going to be used as money repository.

Q: But still, if you are doing payment, somebody is doing the payment processing.

ES: There are industrial partners for all the initiatives in the industry, with very sophisticated payment processors, and regulations, and all

Q: You expect to be a partner there rather than …

ES: Absolutely.

Q: But you do have Google checkout.

ES: Remember, Google checkout is just a piece of this. Payment processors do something different. They actually deal with the merchants, moving the money around, you know with fraud and so forth. The reason why this NFC dhip is so interesting is because the credit card industry thinks that the loss rate is going to be much better, because they are fundamentally more secure. And ultimately, the money that brings us all to this wonderful venue comes out of commerce in one way or another; advertising in Google’s case. My guessis that there will be 500 new startups in the mobile payment space as these platforms emerge, with all these new and interesting things that we can do.

Q: What I’ve been fascinating by is the idea that this is gonna change is shorten the loop between the search and acquisition of a product. Right now, we see this in buying an app: you search for the app and then you buy it on the phone. But this really makes it possible in the real world. You can search for something, and …

ES: But, forget search. Well, I shouldn’t exactl say that, but that’s a joke. Imagine I am walking down the street, and instead of typing my search, my phone is giving me information all the time, and it happens to know that I need new pants or something. You can imagine all sorts of linkages between autonomous search, and location-based search, where you are, where your favorite stores are, what your preferences are, again if you opt in to these situations. Its likely to drive a very very large mobile commerce business and mobile e-commerce business. And the scale of commerce is 14 trillion dollars, which is the global GDP, so some large amount of money is to be gotten in these new platforms over time.

Q: And you can really how this could be a fabulous tie with groupon, because it tells you that there is a crowdsourced offer.

ES: Again, if you look at groupon as a very good example of a very very successful local merchant, they today use e-mail as their primary acquisition mechanism, but they have competitors which are using other techniques. What we know is that people like a deal.

Q: One last question on Android. What are you dissatisfied about with regard to the platform, and what do you think need to be fixed, if anything.

ES: You score Android against the historically leader in the space, which is the iPhone, and I do this as a proud former board member of the Apple world. There is a set of things that the iPhone really did a brilliant job of bringing out in a closed system. Brilliant design, the app store, the platform and so on. So most people judge Android by how we are doing relative to that. And it’s clear that from a reach, choice, and so forth, we are in great shape. The next real focus is at the applications layer. So I think that if I want to be critical, I would have liked to put more emphasis on the application side earlier. It’s hard, because remember, the application decisions are made based on developers, who do it based on volume. So you have to establish volume first, which is something that I think we have done with Android. And for all of these players at the third-party level, and again I know that we have a lot of developers here in the audience, it’s fundamentally about the math of the platform. So we understand platforms very well, we think that Android will be, if not the leading platform, a leading platform.

Q: That brings up a question that I have been thinking about. As there are more and more applications, it becomes a search problem to figure out which one to choose, and that’s one of your sweet spots. But you don’t have some of the same mechanisms for identifying the best apps. How are you thinking about search as a competitive advantage as the application space grows, where the Android Market is the Google of the app space?

ES: We don’t think of it as a competitive edge, we just try to do it better, and the competitive environment will win. As a comment, I think people are obsessed with the competitive landscape, where what they should really be focusing on is how much bigger the market is getting. And because it’s, including the leadership that you guys did with Web 2.0 so many years ago, this is a very large universe, that is getting much larger very quickly, bringing more and more people into it. So the competition is healthy, what’s really happening is you’re growing the market. So with respect to the applications and application search, there’s all sorts of interesting ways of doing that; Admob, for instance, is doing on the order of a billion ad impressions a day now, and that kind of information, in theory, is useful as part of a search problem, because ads have a real value, and we really believe that. There are many many ways in which the information people are using, usage patterns, can be used to provide better choices. But you’re correct that these markets tend to overcorrect; They have millions of apps, whatever, but then ultimately, the leaders emerge.

Q: One of the things that Steve and Apple did right is the about divorce from the carriers, the ability to pretty much say: I don’t want your stuff on my phone. Do you think that Android is ever going to be truly free of that …

ES: I certainly hope so, in the sense that the Android model is different from the Apple model, very distinctly on pretty much every point. It’s open system vs. Closed system, and closed systems have their advantages, and open systems have their advantages. Google made a bet on open systems. We are willong to let the vendors, the carriers, and so forth, set their pricing, set their distribution terms, and so forth. I think that ’s the right model.

--------------------------------------------------------------------------------------

11.54

Q: Recently there was a big story and a fellow lost job over the story. (understand i was presumed for disclosing it) you are giving raise to everybody at Google.And That is being confirmed. can you talk bit about the environment that we are in right now, for talent. and how you came to this decision.

ES: Well, Origin over the raise were later in the sprint, that was six months ago, when we are looking at our forward revenue, we realized that we still sort of carrying the memories of recession. what we have to do and so forth. So we made series of decision at the time. One of which is to significantly invest in core parts of our business. core advertising core search. As a result of that investment, Google instant came out , which is huge success. advertising products, success in our display business, deal with now, come along to a view which we are called hockey strike.we are looking for hockey strikes -------- and we are just pure resources. Another decision we made to do with the time is to focus on for even more acquisition's. we did review of our acquisition strategy to how well the head works for us, android for example came in as an acquisition. maps came in as a acquisition, i am giving you examples after example , something abut the how crushable about the acquisition is that it produces these Gem which we can --------------- and grow them very quickly. third one we have to do is to shearing the success of the company

Thursday, November 18, 2010

Designing Logic Layer of a web application

Logic Layer of a web application comprise of set of actions permitted to the user from the user interface of it.

AddNewCV Page

Experience

Following are the situations i need to think about when designing logical layer for saving experience data and retrieving experience data

When user clicks on add new experience table, master entries should be loaded. For adding new experience

  1. Retrieving Master Data
  • Institute Master entries should be loaded to institute drop down box,
  • Role Master entries should be loaded without considering the department to the role drop down box.
  • Reference tag table need to be searched for the characters that user entering and matching tags should be displayed to the user as drop down list in the text box.
  1. Adding New Master Data
  • New Institute should be allowed to add to the institute table for a given SAASCompany. (because, we can not expect candidates to have there experiences in the companies that we are given. So HR should be able to add new company if it does not exist)
  • New Role should be allowed to add for a given SaaSCompany and for a given department. (because, we can not expect candidates to have performed only the roles mentioned by the department. we should be able to add new role if candidate has performed different role that SaaSCompany has not yet identified.
  • New Reference Tag should be allowed to add to the database.

Academic Qualification

Following are the scenarios to be considered in logical layer when saving academic qualification data and retrieving academic qualification data.

  • Retrieving Master entries
  1. Degree data should be loaded
  2. Institute data should be loaded
  3. Year Data should be loaded
  • Adding New Master Entry
  1. New Degree should be allowed to add to the table
  2. New Institute should be allowed to add to the table
  3. New year should be allowed to add to the table
  • Saving Academic Qualifications
  1. If there are more than one academic qualification instance given, then for each instance check whether relevant master entries are there.
Adding New Address

Following are the scenarios to be considered in logical layer when saving address data and retrieving address data.

  • Retrieving master entries
  1. Retrieve address type master entries
  2. Retrieve Country city postal code combinations for a given search text
  • Adding New master entry
  1. User select country and he can add new postal code and new city, or he can add new postal code for existing city. Here postal code and city belongs to a SaaSCompany. If user has selected existing city , i won't get the id of it, bcoz of the implementation difficulty associated with text box. so i have to search the database with the city text to find out whether it is an existing city.
  • Saving Address Instance Data

Wednesday, November 17, 2010

Using JQuery with MVC

Here i am explaining my experience in using JQuery with MVC. MVC stands for Model , View and Controller. Web applications written according to MVC framework has there presentation layer or User interface embedded in views flooder, so what user sees in his or her :P browser is these views. if you choose JQuery to design your views, you might wonder , how a view can call controller when using J Query. it is done as follows.

First I like to introduce this JQuery method of calling controllers vs usual MVC controllers method of calling controllers. what ever the method you are using, all you want is , you need to post some data to the relevant action in the controller. and as per the action user must be shown with relevant output.

If you are using ASP.net,



Sunday, October 24, 2010

JQuery Tabs

First time when i was asked to design user interface for web application using J Query, i had no idea how to use J Query for tabs. So my first step was search in Google for Hello world in J Query. i should say to you this fist, understanding basics of any programming language is can be done greatly by writing hello world application. But believe me, JQuery is different, you may not get better understanding of its behavior by just writing hello world program of it. So here i am explaining you how i got in to the concepts of JQuery and Implemented advanced JQuery tabs.

Following are the sites where i started learning J Query.

This is a great tutorial, you might find it difficlut to follow this tutorial if you are new to user interface programming. I will be explaining this tutorial in get the work done for your project!.


Following 15 video tutorials are also best to get the concepts in to your mind



Following 3 videos also helped me to a greater extent.


Now, Lets start learning JQuery.

First of all , For this tutorial, JQuery is all about event handling in the user interface, this means that, when you click on something in the user interface, JQuery will catch that event and perform relevant tasks. What are these relevant tasks, relevant tasks means that adding new item to user interface, remove existing item from the user interface. these are the tasks i am referring to.

Also , i would like to address a one of the beauty of JQuery. it is that, if you are using MVC architecture for your web application then, you may find it very useful to click events to retrieve pages from a server.

IF you are a bigginer, i understand the problem you are facing when trying to implement JQuery tabs. most of the tutorials explain how to implement JQuery part, but they dont specifically say how to integrate JQuery, your web site code and .css and other .js libraries to get a working product. I am here to solve that problem!


This is the JQuery code of my application that i will be explaining to you.

If you are familiar with Event Driven Programming, Then it will help you to understand J Query Better. Event Driven Programming is, Program is driven by an event that you perform on the screen with the use of Mouse and keyboard and other input devices. Using Mouse , you can perform click event. J Query can capture those events that you perform on your browser and, than perform tasks on the use interface according to the events.

Following is a simple example of above description.


Let's start with following tutorial.
you can download source code of this tutorial too from the above url.

Let's try to understand this source code.











Thursday, October 14, 2010

Designing Data Base Layer Using Entity Framework

Following is the requirements of the web application to design it in the database. This system is a HR System. This System is designed considering SAAS Model. Which means that There is only one application in the world which provide HR System service for all the companies.

Store Candidate Information
Candidates send there CV's to respective organization. Then each organization transform this candidate data in to information. Then we provide 2 main services based on those information. One is

At the beginning we started with the one table , it was designed by looking at GUI of extracting

We can describe how to handle following synario. this means that when there is many to many relation, how do we go about addressing following situation.

One person can have many email addresses, and One email address can have many people.
So, when there are two persons for one email address , we can set the status of one email address to be inActive or Active while , for other person , this will be active email address. so , that is one thing we might have add new attribute to the middle table of many to many relation.

What is the next synario.

Lets say , There is a CV table and there is a person table. A person can have many cv's and a cv can have only one person, but that is not what is told by

Most important point is , CV table has an attribute for Recommended Person. This means that for tables are linked by two relations, so , one recommended person can have many cv's and cv can have may persons. My question is , why we have included that one cv can have may persons.


Monday, October 11, 2010

How to implement the database level of a web application`

If you are wondering on how to design database level of a web application, then first thing you want to do is to identify the different classes of the application[i will be explaining to which i am referring to as classes if you are not quite sure about this term]. Identifying different classes in your system is done as follows. Here is a real world synario to identify different classes. Lets consider that we want to implement free online educational system which provide university level ordered education to any one who seek knowledge. So, this big picture is the primary key in designing the database. So , you should be having clear idea on what you are going to do. So first question your self by asking very basic questions ,

Who are the users of this system.

What exactly i am going to offer to the target users of this system.

What are the existing applications similar what we are doing.

How does this product differ from those existing sites.

And do research on web application that might provide different service to the user than what you are doing to understand how if they have become successful and why if they have become unsuccessful. Then, compare your goal with how others have achieved there goal in a web application.

Target users of a free online educational system is university students of IT field at very first stage. i would like to compare this with stackoverflow.com, since it is been the most successful forum for developers to find exact answers for the technical problems they are facing in the industry. so stack-overflow has been successful by gathering talented software engineers around the world. And key point that handle the success of stack-overflow is that it is active, if you type question at stackoverflow.com, you get answers with in seconds. That is one reason developers are emotionally attached to it.

Sunday, October 10, 2010

How To Build Web Application Using PHP, JSP, ASP.Net, and Ruby On Rails


In this part of the tutorial you are going to learn building web application using ASP.Net, PHP, JSP, Ruby on Rails Web Development frameworks. Even if you are a programmer having experience in using any one of above frameworks in web development , most probably you are going to learn something out of this tutorial.

First i would like to start with assuming that you are a newbie having no knowledge of any one of above technologies and have burning desire to learn the technology in depth. So, i would like to give you basics first to make a very firm basics. yes very firm basics. this is mainly because i believe this iceberg. One thing i forgot, you will be learning lot through Images and Videos during this part of the tutorial.

I thought of throwing very simple question at first. What is the difference between Dynamic Web Application, Static WebApplication , Web Service. Since you are using a web browser to read this blog post , you know that you can communicate with web server using web browser. Let's see how exactly is this happening. A Web client program (such as a web browser) can access data from many different servers, such as Gopher, FTP, NNTP (Usenet) or HTTP. The HTTP server was designed specifically for the Web, and employs a protocol (system of messages) that supports sending documents from the server to a browser(HTTP Get), and that also support sending complex data from the client back to the server(HTTP Post). As the design of the World Wide Web was not inherently dynamic, early hypertext consisted of hand-coded HTML(Hyper Text Markup Language) that was published on web servers [1][2]. Any modifications to published pages needed to be performed by the pages' author.

So How do we make make dynamic web applications :O ???

To provide a dynamic web page that reflected user inputs, the Common Gateway Interface (CGI) standard was introduced for interfacing external applications with web servers

it is something like this.


[1] http://www.utoronto.ca/web/CGI/cgi1.html
[2] http://en.wikipedia.org/wiki/Web_application_framework
Comparison of Web Application Frameworks

Sunday, October 3, 2010

Google Code Jam : Different Sum

This algorithmic question is from Google Code Jam 2009. problem we need to solve in this question is that, Given a number in given base, can we find number of summands for given number provided that numbers in the a same column in summation should not be similar to one another.
So Basic answer comes in to mind is , first find all possible summations that can represent different sums of the given number. we will start with the smallest number lets say 1, and add the rest to get the required number. As an example if we take number 11 then 1 + 10 = 11, and we try to find different ways in which 1 can be written. but there is only one way. there for we are going to find different ways in which 10 can be written. we can not take 1 again bcoz it is already there in the solution. So Here comes my problem, how do we find out all the different ways of writing this number.

Wednesday, September 15, 2010

What is this blog is about

People say Electronic Engineering field is saturated, do you believe in that. In Sri Lankan context many would say that is true because people look at from the perspective of job opportunities in the field . it means that you define Electronic Engineering to be made up of Diodes, Resistors , Capacitors and all those fancy devices that you may find in any electronic device.

Don't you think that it is reasonable to believe that it will keep evolving with nano technologies or ability to control the behavior of animals by providing required signals to the parts of the brain. This second would lead us to create machines that uses human brain. at this point you may probably have noticed , this blog is about introducing something that can not proven in real life.

So what you would be given in this blog. i am not going to discuss any rocket science mentioned above, without those rocket science we can make tremendous contribution to the world, YES, that is TRUE, do you want examples ?, look at the Google search engine, it provides world with tremendous service that help world to evolve to its limits by manipulating 1's and 0's pulses travelling in a electric wire. So my dear readers, here we are going to introduce to the world with new creations with existing technologies, never say any engineering field is Saturated!. Let's prove that to ourself.

Why did i start this initial blog post introducing Electronic Engineering thought i am going to discuss about future of Computing, it is because, Future of Software is based up on hardware devices on top of it runs. This blog post is also being written on a piece of software which runs on hardware devices made up of Diodes, Resistors etc. So i would define this existing technologies to be very old , it is not the future. if we want to see a future that is there in the films we see, then we have to go beyond Von Neumann architecture.But having said that, as i said earlier, so far we have gained maximum out of these existing technologies to make the world a better place. so why don't we look at this bright side, let's try to see that bright side of it!