Wednesday, September 29, 2010

A Solitaire Google Search Game to spend your time

Most of us get bored and need ways to spend our time. Thats when reading facebook updates of friends or browsing through other social networking media seems mundane and hackeneyed. Playing Solitaire on XP is too old school. This is the age of "The Internet".

At one such occassion when I was trifling my time, I thought of a simple game. The idea is not fully developed so use your imagination to build up on it.

The game requires you to Google. You must be thinking "googling is what I do to find anything under the sun but my missing shoes or pen, what is so new about it".

So where is the fun part?
Here is the game:
Search for a phrase. Note down the number of search results returned by Google. Your aim is to reduce the number of search results returned. That sounds simple...Right? Wrong!

Let n be the number of results returned by Google and s be your score for that query.

Play by the rules:

1. You are not allowed to search junk words. The words in your search query should be valid dictionary words.

2. If your search result returns the name of any person or place as the first result
s = 20*n

3. If n < 30 then s=1000,000. Penalty for searching something that will barely return any results.

4. You are discouraged to repeat search terms that were used in your previous queries. So if you use x terms in your query that have been used earlier, then your score can be something like
s = n*(x+1)

Add your own rules Here

In all other cases your s = n

Who knows you might end up discovering something new?

If still you are not able to pass your time, then write a blog post like this one.

Thursday, September 16, 2010

Google executes the code it owns to process data that you own

Google Chrome OS will allow you to run a browser on your PC. A browser that is Open Source but is really designed to provide a framework for web applications based on HTML and JavaScript standard for Web Applications to render their output to the browser tabs.

Of course though the browser is open source, the servers that ultimately master the content for the user run proprietary and closed source code. But that is another story.

Now the code that powers your PC is really on the server unlike the Windows Operating System which resides on our hard disks. Thus each time we wish to avail the services of our Netbook/PC we will have to authenticate with a Google Account. You don't run the code and
Google executes the code it owns to process data that you own and render it to your Open Source Browser.

Now what are the pros and cons of the cloud based solution that Chrome OS provides:
Good
1. There can be no software piracy (at least not in the form it exists today).
2. All computation code will run on Google's servers which can be optimized for a variety of workloads. This in turn could result in more energy savings.
3. Your PC will not hang if it is running something really demanding CPU time. Your other tab may well be rendering data. You will not be frustrated.
4. The cloud manages the backups of your data.
5. Lower Costs as Google will not charge you for using their systems (hopefully).
6. No data migration cost. Store Once Access Anywhere
7. Less Redundancy. All videos, movies and songs will be stored online and shared. There may well be some controls in place to prevent copyright issues. But better compression may be in the works.

Bad
1. Monopoly over your data to a single organization.
2. Advertisements will show up on your browser. You will have to pay for using the system without advertisements.
3. Out of the "box" (although there is no packaged software), you will have a fixed amount of storage. But if you find it really useful to store all your data on the cloud and access it from anywhere, you may have to pay some price for the storage. There may be different schemes on the quality of backup policies you use.
4. More demands on network bandwidth.

Neutral
1. You may prefer to use your favorite IDE for programming online and run the code on Google's servers for testing it.
2. If it becomes mainstream, you may end up writing code for the browser itself.
3. The HTML standard may be influenced depending on the popularity of the system. Application Developers may want easier programming models to send commands to the servers. Difficult to predict what the demand can be like.

But wait. The above is just my prediction. Let us wait for the actual changes in ecosystem that may ensue.

Do share your views on the topic.

Sunday, September 12, 2010

HTML and Javascript: The assembly language for the web

What is programming? In a broad sense every device exposes an interface for tweaking its behavior. How many different things one can achieve using the device is determined by the number of permutations allowed by the interface. The interface can be complex or simple to program.

Now lets jump to the more familiar area of computer programming!

To provide a software based interface to computer hardware assembly languages were created which I surmise must have greatly relieved the people who had to write binary machine code to make their programs work. Similarly fortran provided respite to assembly programmers. Followed by C++, Java, Python and numerous other languages under the sun. Of course the ease with which programs could be written with these new interfaces allowed complex tasks to be achieved.

Now let us draw a parallel in the world of web programming. I am a dabbler at best when it comes to programming for the web. But still I will be able to share some thoughts. The early web browsers provided an HTML based interface for programming them. With the increasing number of users, this HTML became sophisticated as demand for better presentation arose. Thus this HTML interface. CSS allowed the programmers to modularize their presentation style across web pages. How well a programmer could apply Software Engineering concepts like reusability, modularity and cohesion to the design of web pages along with the aesthetic considerations determined how readable and managable the websites were.

But this HTML provides only presentation tags. The web browser would have to go through a full page reload for each new request. Presto ... Enter Javascript. This allowed custom control flow to program the browser.

But why did I call HTML+javascript to assembly language of the web. Well HTML+javascript is widely used but is too basic for feature rich web applications. Each browser has different behavior with respect to the html and js on the page. So programmers should be coding separately for each browser and they are expected to maintain the code as well.

So what is the solution. Well of late I encountered JSF which provides a MVC architecture which allows you to write business code in Java while offloading the HTML and JS tasks to the framework itself. There are other frameworks like django which are popular. The underlying idea is this, HTML and JS provide a rudimentary "interface" for coding. So a new High Level model is developed

With the new Chrome OS being rolled out, it will be the aim of most web apps to treat HTML + JS as the target "assembly language" to be generated by the compiler for their framework. The browser is the incarnation of the "hardware" for which the "assembly language" is generated.

Did I just overcomplicate a simple Idea?

My take on Sociology meets Computer Science

The way I perceive it is that both Social Networking and Search Science would go through the same life cycle as other computing technologies like databases, operating systems.

When the industry felt the need to have a database or OS they developed software and then realized the shortcomings.
They invested heavily on research in universities which caused BSD and other projects delivered which found their way into commercial usage.
The use cases faced by the industry coupled with the research at universities concluded that there are certain axiomatic concepts which must be taught in engineering colleges and we had these courses finding their way to our curriculum and C/C++ which was earlier taught in engineering is now taught in school.
Finally we do have continued research in databases and os but it is focussed on addressing specific problems.

Similarly when the concepts relating to Social Networking and Web Search stabilize, it is inevitable that they will be taught in colleges and the research community will find something more exotic and yet unknown to mull over.

Did I sound philosophical?