Download Android App


Alternate Blog View: Timeslide Sidebar Magazine

Friday, December 30, 2011

Time series and OpenTSDB


OpenTSDB is a distributed, scalable Time Series Database (TSDB) written on top of HBase. OpenTSDB was written to address a common need: store, index and serve metrics collected from computer systems (network gear, operating systems, applications) at a large scale, and make this data easily accessible and graphable.

This article will help you gather metrics and send it to OpenTSDB server. The detailed instructions on setting up OpenTSDB can be found here.

First, register the metric.

./tsdb mkmetric order.count.1m

A simple MySQL collector.

cat > orders.sh <<\EOF
#!/bin/bash
set -e
while true; do
  echo "Querying orders...."
  mysql -u user -ppassword -Ddatabase --batch -N --execute "select count(orderdate) from ORDERS where orderdate > date_sub(now(), INTERVAL 1 MINUTE)" \
  | awk -F"\t" -v now=`date +%s` -v host=`hostname` '{ print "put order.count.1m " now " " $1 " host=" host }' \
  | nc -w 5 tsdb.host.name tsdb.host.port
  || exit  # To handle SIGPIPE properly.
  sleep 60
done
EOF

chmod +x orders.sh
nohup ./orders.sh &

This shell script will poll the MySQL database every 1 minute, get the order count for the last 1 minute and publish it to the TSDB server. Open the TSDB screen, select "order.count.1m " as metric and you should see a graph like the following:


Most of data collection work can be accomplished by writing simple shell or python scripts. Here is a code snippet that can help you publish metrics using Java.


public static void main(String[] args) throws Exception {

   Socket echoSocket = null;
   PrintWriter out = null;

   String host = null;
   int port = 0;

   while (true) {
       try {
           if (echoSocket == null) {  // Only open the connection if necessary.
                echoSocket = new Socket(host, port);
                out = new PrintWriter(echoSocket.getOutputStream(), true);
           }

           int orderCount = getOrderCount(60);//Orders in last 60 sec
           out.println("put order.count.1m " + (new Date().getTime() / 1000) + " 100");
           out.flush();
       } catch (UnknownHostException e) {
           System.err.println("Don't know about host: " + host);
           return;
       } catch (IOException e) {
           System.err.println("Couldn't get I/O for the connection to: " + host);
           out.close();
           echoSocket.close();
           out = null;
           echoSocket = null;
       }

       System.out.println("Sleeping for 60 s");
       Thread.sleep(60000);
   }
}

public int getOrderCount(int interval){
   .........
   return orderCount;
}

More collectors are available on github.

There are many good things about TSDB like:
  • Simple to setup and get started.
  • Easy to build dashboards. Plot and compare multiple metrics on the same graph.
  • Simple HTTP API to query the time series database using "/q" option. It can produce results in HTML, JSON, PNG or plain text. This way, you can use the data for numerical analysis or use a different plotting library than the default Gnuplot used by OpenTSDB.
It will be great to see some enhancements like:
  • More aggregation functions like percentiles etc.
  • Better support for counters, sampling and debugging.
  • User guide.
  • Export to more formats like CSV, Excel etc.

StatsD is another great tool for metrics aggregation and plotting. More about it in my future blog post.

Tuesday, December 20, 2011

Globalization!

Shared by my friend:

My wife wanted knitting needles as aluminum needles, being relatively heavy, were proving to be painful for her. After some research, she decided on buying bamboo needles which are light weight. She could not find it online in India and so she ordered it on a UK based E-Commerce website and shipped it to her friend in London.

She was super excited after her friend arrived and handed her the needles. She quickly opened the parcel and looked at the plastic wrapper to realize the needles were "Made in India"!


Well, the needles flew all the way from India to UK and back!

Sunday, December 18, 2011

The Principles!

Robustness Principle: "be conservative in what you do, be liberal in what you accept from others".

This principle encourages excellence in design and maximizes interoperability. It's practical meaning is:
  • when designing software, be careful to be compliant with the protocols specified in the RFCs and STDs (Internet-related standards documents).
  • do not introduce features or proprietary extensions to protocols that will be incompatible with other products or systems that are compliant.
  • design your software to be tolerant of products that may not be completely compliant with Internet, Unix and Linux standards.
  • where the standards are vague, accept as wide a range of reasonable operation as possible.
The principle is still honored today and is frequently mentioned in modern day Internet standards documents (RFC 2015 is just one example). Compatibility is a tradition in the world of the Internet, Unix and now Linux.

Douglas Engelbart's law of maturity: "The rate at which a person can mature is directly proportional to the embarrassment he can tolerate."

Excerpts from the book "The Engelbart Hypothesis: Dialogs with Douglas Engelbart"

"And then I’d realize, “Boy, that’s just the way I often sound.”When I was in the service I had time to think through a lot of things. I generated a sort of algorithm: the rate at which a person can mature is directly proportional to how much embarrassment he can tolerate. And I realized that embarrassment didn’t seem to bother me very much, because of my upbringing and the perspective I had about the world. Something Benjamin Franklin wrote was so beautiful, “You wouldn’t worry half so much about what other people thought about you if you realized how seldom they did,” and I’d say, “Oh, that’s right.”I seem to have a lot of intuitive capability. I just don’t mind at all not being able to explain to people how I reached something. It doesn’t bother me."

Principle of locality, also known as the principle of locality, is the phenomenon of the same value or related storage locations being frequently accessed. There are two basic types of reference locality. Temporal locality refers to the reuse of specific data and/or resources within relatively small time durations. Spatial locality refers to the use of data elements within relatively close storage locations.

Wednesday, December 14, 2011

New age and electronic music

New Age music is music of various styles intended to create artistic inspiration, relaxation, and optimism. It is used by listeners for yoga, massage, meditation and reading as a method of stress management or to create a peaceful atmosphere in their home or other environments, and is often associated with environmentalism and New Age spirituality.

'Beautiful' by Ryan Farish is pretty special. Listening to this album is like taking a tour through new age and electronic music. There’s some of Enigma’s arpeggio bells; a few chanting voices from Adiemus; some pleasant “whoosh” sounds from Jean Michelle Jarre; and them all topped off with some tastefully applied pan flute and simple Jim Brickman piano melodies. And yet, I think this is pretty special stuff. The compositions are nice and elegant; the melodies are simple but enriched by some intricate electronic noodling. It's really kind of intoxicating.

Enjoy 2 beautiful videos from this album.



Friday, December 9, 2011

The wifey confusion!

Friend 1: How is wify doing ?
Friend 2: do not know.. its data card...
its uses different network... something like UMTS or HDPS
Friend 1: hahahaha, wify means wife dear, not wi fi!
Friend 2: Oh!


You may also like: Thirst!, Software Humor

Thursday, December 8, 2011

Interesting times in Indian E-Retailing

These are interesting times for E-Commerce in India.

Companies are getting funded by the dozens, spending money on TVCs and burning investor money, distributing gift coupons as if it were cheaper that water, and what not. In short, e-commerce is catching up!

So, an e-commerce company X, famous for selling books online, recently started offering replacement guarantee for electronic products.

Company Y, another e-commerce player in electronics space, responded with:

In these fascinating times, Taggle.com shut shop, stating competition to be too cut-throat for building a profitable business.

One e-commerce website selling electronics and gadgets since inception, entered into another category - "Toys"!

A milestone day for India’s ecommerce industry was observed recently. While most of the sites are selling mobile, tablets, perfumes etc. Ebay went a step further and sold ‘milk giving black young buffalo 20 liter per day’.

Apart from free shipping offer (national courier), the deal also comes with 7-days exchange offer!


Deal websites are not just about deal anymore. They have entered mainstream e-retailing.

Very recently, Bollywood felt left out. Yes, Bollywood. After all, who would want to miss the e-commerce money making race.

Karishma Kapoor recently invested in an e-commerce startup that operates a retail website for kids.  Ajay Devgan launched an e-ticketing and film entertainment site Ticketplease.com in January this year. Other investors in this venture include Sanjay Dutt, Bollywood producer Nitin Manmohan, Vatsal Seth, Ramakant Tibrewal, Vijay Jain and Amit Sharma of Roha JP Group. Seth has also set up Celebwears.com with actor Sohail Khan. Surely, Indian celebrities are now reaching beyond endorsements and turning into full-fledged angel investors focused on start-ups.

Finally, not all is well. dearflipkart.blogspot.com will tell you why? Interesting name for a blog, isn't it? Read the article titled Dear Flip****, Your Customer Service Has Started Sucking. Shoppers are unhappy to the extent that they have dedicated a blog and websites to voice their frustration. 

And it is just the beginning!

Thirst!

I wake up in the middle of the night, thirsty. I drink water. It doesn't quench my thirst. I drink more, and more, and more. But the thirst refuses to be quenched, like a wildfire refusing to be doused by the gallons of water dropped over it by a helicopter.

It finally dawns on me: I'm thirsty for real, but I'm drinking water in my dreams. I sigh, relieved. I decide to wake up, take pick up the bottle, and quench my thirst for real this time.

-- From Rajbir Bhattacharjee blog

You may also like: BBA entrance interview
You may also like: The wifey confusion!

Sunday, December 4, 2011

NoSQL - Right tool for the right job!

First of all, the name: NoSQL is not "Never SQL" or "No To SQL". It is generally expanded to "Not only SQL".

There are a crazy number of softwares out there that are part of the 'NoSQL' movement. Some of the popular ones are listed below:

Tokyo Cabinet/Tyrant, Redis, Voldemort, Oracle BDB
CouchDB, MongoDb
Neo4J, InfoGrid, Infinite Graph
Cassandra, HBase, Riak
Oracle Coherence, db4o, ObjectStore, GemStone, Polar

NoSQL softwares can be categorized broadly into 4 categories:
  1. Key-value stores
    • Based on Amazon's dynamo paper
    • Collection of key-value pairs
    • Example: Voldemort,  Tokyo Cabinet
  2. BigTable clones
    • Based on Google's BigTable paper.
    • Big table, column families
    • Example: HBase, Hypertable,  Cassandra
  3. Document database
    • Inspired by Lotus Notes
    • Collection of key-value pairs
    • Example: MongoDB, CouchDB
  4. Graph Databases
    • Inspired by Euler and graph theory
    • Nodes, relations and key-value on both.
    • Neo4j, Sones, Allegrograph
NoSQL is primarily about scalability. Generally, when we talk about scalability, we think about the data size - from gigabytes to pentabytes and maybe more. There is another dimension to scalability - complexity of data. The two axes to scalability: Size and complexity.

Scaling size: Dealing with more and more information that is roughly similar in nature.
Scaling complexity: How do you deal with data that is more messy and more semi-structure. The categories above are mapped in the graph below.


As you can see, the focus of these softwares are very different.
Key-value stores: Simplistic data model that can massively scale.
Graph database: Capable of handling complex connected data; difficult to achieve horizontal scalability.

Typical applications:

Key-value store: Storing the customer shopping cart of a customer in an E-Commerce application. Since all lookups are based on key (customer id), and in most cases, ad-hoc query is not needed. This makes key-value an ideal storage for shopping cart data.

BigTable clones: You have a news site where any piece of content: articles, comments, author profiles, can be voted on and an optional comment supplied on the vote. You create one store per user and one store per piece of content, using a UUID as the key (generating one for each piece of content and user). The user's store holds every vote they have ever made while the content "bucket" contains a copy of every vote that has been made on the piece of content. Overnight you run a batch job to identify content that users have voted on, you generate a list of content for each user that has high votes but which they have not voted on. You then push this list of recommended articles into the user's "bucket".

Document database: Documents are semi-structured data. Modeling product attributes using RDBMS has always been a challenge. All products will have a common set of attributes e.g. title, sku, price and a category specific set of attributes. Document databases effortlessly solve this problem. MongoDB is one step away from MySQL providing ad-hoc queries, transactions, indexes and more.

Graph database: Great for cases where data is connected e.g. social applications like twitter, facebook and blogs.

Sunday, November 20, 2011

The daily deal nerve discovered!

Daily deals brought to you by companies such as Snapdeal, Crazeal etc., has brought “coupon-clipping” to an entirely new generation and it’s made it cool. It’s social. It’s a community of people working together if for nothing else but the simple joy of finding a spectacular deal. It joins the masses for the greater good. Bargain hunters unite!

Daily deal sites count on the fact that the limited time frame will pressure people into making a quick decision. You see that timer ticking (a clever visual pressure tactic) and there’s a limited number of the specific deal left, N number of people already bought it and maybe you want to be part of group that’s getting in on a great bargain. After all there’s nothing worse than feeling left out and possibly it’s something you’ll actually use…maybe. But it’s not long after that impulse shopping’s close relative, buyer’s remorse sets in.

Recently, an elderly relative visited me and showed his new Android phone. During our conversation, he mentioned he had been getting spam SMSes about deals, sometimes in the middle of the night. I offered to help him. I said I can install a SMS blocker on his phone and he can have his peace of mind. "No", he promptly replied, "sometimes the deals are interesting and I can't miss those!".

I was taken aback but I know how that feels. It is like “Shaadi ka laddoo – jo khaye pachtaye, jo na khaye pachtaye” or "Every coin has two sides".

So what is the way out? To have the cake and eat it too? Well, there are many preachy 'dos and donts' articles out there that help you decide on what deals to buy. And there is another way - don't succumb and subscribe to every daily deal website but have some friends in your group who do that and have their number in your phone's favourite list! After all - "har ek friend zaroori hota hai!".



Stunning Video of Earth from 240 Miles Up




Here's a beauiful space video: 18 time-lapse sequences of photos taken from the International Space Station, gorgeously processed and edited by Michael König.

It is like sitting in heaven and orchestrating the magic called Earth - the mesmerizing aurora borealis or the Northern and Southern Lights, the lightnings in the clouds, the cobwebs of settlement light stretching across continents, the blue oceans. A list of the locations being passed over are mentioned below.

Shooting locations in order of appearance:

1. Aurora Borealis Pass over the United States at Night
2. Aurora Borealis and eastern United States at Night
3. Aurora Australis from Madagascar to southwest of Australia
4. Aurora Australis south of Australia
5. Northwest coast of United States to Central South America at Night
6. Aurora Australis from the Southern to the Northern Pacific Ocean
7. Halfway around the World
8. Night Pass over Central Africa and the Middle East
9. Evening Pass over the Sahara Desert and the Middle East
10. Pass over Canada and Central United States at Night
11. Pass over Southern California to Hudson Bay
12. Islands in the Philippine Sea at Night
13. Pass over Eastern Asia to Philippine Sea and Guam
14. Views of the Mideast at Night
15. Night Pass over Mediterranean Sea
16. Aurora Borealis and the United States at Night
17. Aurora Australis over Indian Ocean
18. Eastern Europe to Southeastern Asia at Night           

Wednesday, November 9, 2011

Understanding the European Union Financial Crisis

If a picture is worth 1,000 words, a video is worth 10,000 words.



But why is Germany letting Greece default by cancelling 50% of latters debt?

Before Euro became a common currency across Europe, German exports stood at around $487 billion in 1995. In 1999, the first year of the Euro being used as a currency the exports were at Euro 469 billion. Next year they increased to Euro 548 billion. And now they stand at Euro 1 trillion.

Using Euro as a common currency took away the cost of dealing with multiple currencies and thus helped Germany expand its exports to its European neighbors big time. Also with a common currency at play, exchange rate fluctuations which play an important part in the export game, no longer mattered and what really mattered was the cost of production.

Since the beginning of the Euro in 1999, Germany has become some 30 per cent more productive than Greece. Very roughly, that means it costs 30 per cent more to produce the same amount of goods in Greece than in Germany. That is why Greece imports $64 billion and exports only $21 billion.

So the way it works is that German banks lend to other countries in Europe at low interest rates and they, in turn, buy German goods and services which are extremely competitively priced as well as of good quality. This, of course, helps Germany.

And that is why Germany is interested in rescuing these countries or at least showing that it is trying to do something about it. Because if these countries in Europe collapse, then German exports will collapse as well.

One solution bandied around is that these countries which are in severe debt to Germany should be asked to stop using the Euro as its currency. But if they stop using the Euro as a currency, then the huge export advantage which Germany has had because of the Euro will also end.

Moral of the story? Germany is jammed in from both sides!

How the whole thing happened explained in a picture:


Understanding the European crisis
 

Who will lose money?

More data and numbers?

http://www.guardian.co.uk/news/datablog/2011/nov/07/euro-debt-crisis-data

Sunday, November 6, 2011

Personalization and E-Commerce

Strong customer relationships are important to the success of an e-commerce business. That's why the e-commerce personalization features are so important.

I went to a neighborhood grocery store, of which I am a regular customer, and asked for a bottle of juice. He gave me a bottle of orange juice with lots of pulp, exactly the one I like.
You are standing in a digital electronics store, wondering which video game to buy for your son - Sony PS3 or XBox 360 or Wii? You are inclined to purchase Sony PS3 but minutes later, a store executive walks up to you and points to XBox 360 console and motivates you to give it a try. Nothing more is said and you walk out of the store with XBox 360 in your hand, passing by the smiling store executive.

These are just two forms of personalization out of many. Personalization is easy to achieve in the physical world. In the virtual world, it is a tad hard. There are no store executives to help, yet you must understand the preferences, needs and intentions of the shopper and help him transact. Sounds easy? I will say may be yes but mostly no.

Let's get to product recommendations, a very interesting form of personalization. The phrases that e-retailers use goes something like this:
  • Similar products
  • Recommended products
  • People who viewed this product also viewed these products
  • People who bought this product also bought these products and more
While searching for a dual SIM mobile phone, the following products are recommended for your consideration. If you have guessed by now, recommending relevant products is very important.
What is relevancy? To a shopper, it could mean related products around same price point, similar features and possibly a fast moving item.

Viewed product
Recommended products


This mobile phone costs Rs 2999 and the recommended mobiles are around the same price point. Since the shopper is looking for dual SIM phone, 2 dual SIM phones are recommended. All these 4 products are liked by the users as inferred from reviews and ratings.

Let us take another example where an attempted product recommendations goes bad.

Viewed product
Recommended products
 

Anomalies are easy to spot - Samsung laptop is similar to Sony PS2 and gaming laptop worth Rs 76,099 does not come close to Sony PS2 costing Rs 5690. And most interestingly, people who bought Sony PS2 also bought a geyser. That is very insightful!

Mostly, product recommendations are generated using rules or computer algorithms. If algorithm driven recommendations are not meaningful, consider manually linking related products or use paid service. It is a safer way to tread. Today's shoppers are smart and they can smell bad recommendations from miles away.

Product recommendations are very useful tools for personalization. If done correctly, it can significantly improve customer experience, conversion rate and repeat purchase.

There are many more decision to make before serving good recommendations. I will cover these in my future blog posts.

More blog posts on E-Commerce:
Social Validation and E-Commerce
Social Commerce: Part 3
Gamification

Monday, October 31, 2011

SOA learnings from Amazon and Facebook

I came across this interesting and very frank article written by Steve Yegge. You can read is here.

Having worked at Amazon for close to 4 years, I could not but agree with Steve's take on Amazon, Platform, SOA and 'Eat Your Own Dog food' concept. Thinking and designing in terms of services comes naturally to SDEs at Amazon.

It is interesting to understand what platform means. Platform is a term for technology that enables the creation of products and processes that support present or future development.

If we talk about software platform, it is a software program that makes services available to other software programs through Application Programming Interfaces (APIs).  e.g. the Java platform is a generic platform that runs programs written in the Java language.

Two notable characteristics about software platforms that I want to quote from the book "Invisible Engines":

Software platforms are at the heart of “ecosystems” that consist of mutually dependent communities of businesses and consumers that have a symbiotic relationship with the platform. 

"Software platform businesses have at least two sides. Software platforms consist of services that are often made available to developers through APIs. They are also made available to computer users, but those computer users typically avail themselves of API-based services by buying applications that in turn use APIs. It is only a slight exaggeration to say that all software platform makers all the time invest in getting both developers and users to use their platforms."

Look at the platform offerings from Amazon via Amazon Web Services(AWS) and Facebook. They provides developers with:

• Software services available through APIs
• Software development kits that facilitate writing applications
• A “developer zone” that provides, for example, access to tools, sample code, and technical support
• Member forums for online discussions with other developers

The AWS offerings now allows creating and hosting enterprise applications completely on the cloud.

Thinking in terms of platform and API allows great deal of innovation. In recent times with the advent of free web services, numerous mashups were created, which in turn created value for end users. Availability of Android OS and the 'apps' it can run has created a win-win situation for developers, hardware manufacturers and end-users.

A good indicator for creating a platform is when a big pieces of inter-dependent business functionalities needs to be realized and the future requirements are unknown or vague at best.

While deciding about creating a platform, it is important to have a clear vision. Some basic questions that needs to be answered are:
  • What problem in the platform solving?
  • Is the platform reusable? Can many clients benefit from it?
  • Who will use it and how?
And then more specific questions like what APIs should be provided and many more. Infact, creating and externalizing a software platform is similar to writing a business plan and then launching a startup! It is learning all the way.

Often while interacting with other software engineers/architects, I find it very difficult to explain the need to go with SOA or think in terms of platform . Software engineers are inherently opposed to the idea. Mainly because they have not seen and experienced the architecture before or 'fear' the additional complexity that comes with it. The most common excuse for not using web services I hear is that SOAP is heavy weight, that web services add complexity and even phrases like "too many moving parts" and "we don't need SOA now"!

Indeed, these are valid statements but the benefits of SOA far exceed these short comings. Companies like Amazon has clearly demonstrated it. Not only does SOA solve business problems, it lowers costs and create values for end customers. With low margins in E-Retailing, Amazon had to adopt it.

The biggest hurdle software developers have to cross is the ability to 'think' in terms of platform and to realize it.

More interesting articles on SOA:
Software design at it's best
SOA @ Amazon


Tuesday, October 25, 2011

Social validation and E-Commerce

I was browsing through the Books section of an Indian E-Commerce website, looking for a best seller or a book from a known author. Needless to say, there were many options and I was confused. So rather than looking at the story line and finding about the author, I started looking at what others wrote about the book, how many ratings it had and the average book ratings. Sounds familiar?

"When we are uncertain about what to do we will look to other people to guide us. And we do this automatically and unconsciously." says Professor Robert Chialdini.

It is a very common psychological phenomemon and it is called 'Social Validation'. More precisely, the social validation stems from the Bystander effect or Genovese syndrome, a social psychological phenomenon that refers to cases where individuals do not offer any means of help in an emergency situation to the victim when other people are present.

Why do we ignore? Put simply, it’s a matter of trying to fit in with the crowd. If everybody else is just watching and not doing anything, therefore, I should act like them to fit in with the social norm.

Only 5 to 10 percent of the population engages in behavior contrary to the social norm. Because we want to fit into these groups and maintain our membership with them, we conform our actions to the norm.

The bystander effect is a great way to show the power of social validation. We tend to do what we think is best to fit in with the crowd, regardless of the situation.
Another common place reasoning that suppors Social Validation: If everyone else is doing it, let’s just go with it too…besides, how can so many other smart, capable people be wrong?

So how does this apply to E-Commerce and online shopping? Look at the images below:








Do these images look familiar? Visual cues, textual cues and even stasticial numbers are used by online retailers to help shoppers take decision. Often times the social validation principle and the theory of scarcity (the illusion of diamond scarcity) go hand in hand. I will leave the details of which to a future blog.

In sum, social validation is a powerful phenomenon. In E Commerce, the cues works, provided each feature is implemented the right way.


You may be interested in other E-Commerce article:
Gamification
Personalization and E-Retailing

Friday, October 21, 2011

Ra.One, Shah Rukh Khan and Homeshop18

In yet another first of its kind marketing association, Ra.One the most awaited film of the year and Homeshop18, India’s largest virtual retail platform, came together for a unique partnership. Through this association Ra.One merchandise spearheaded by Shah Rukh Khan will get access to HomeShop18’s widest distribution network which will enable him to take the movie merchandise to the masses. As official shopping partner of Ra.One, HomeShop18 will sell the original movie merchandise through both its 24 hours home shopping channel and India’s fastest growing ecommerce portal, www.homeshop18.com.
Shah Rukh Khan takes movie marketing to an all new level in India, with a deep rooted movie merchandise strategy, enabling audiences from across the country to have a piece of the super hero. HomeShop18 offers unmatched value propositions on its products; free home delivery and cash on delivery, which makes it a smarter and convenient shopping platform.  

Bollywood’s biggest superhero, Shah Rukh Khan on the association with HomeShop18 said, “I would like everyone to watch the movie and bring home G.One. It gives me immense pleasure to collaborate with HomeShop18 as the association would help us reach out to the masses with our super-movie. Through this association, we are trying a new form of movie marketing in India, much like the practice in Hollywood. We want our audiences to not only get entertained by Ra.One but also get a chance to own a piece of the movie as they shop in the comfort of their homes”

Shah Rukh Khan further added “HomeShop18’s innovating retail setup is a significant boost to the movie industry and we look forward to partnering with them for our future projects”


Saturday, October 15, 2011

Software design at it's best!

Once upon a time, in one of the software projects, team A was collaborating with team B to develop a workflow system. The main workflow would invoke other smaller workflow - an orchestration system was the need of the day. A meeting was held and the agenda was to integrate the two workflows.

Day 1:
Team B: We have a web service and the only API 'pushMessage' should be called from your code.
Team A: Why remoting? We need a jar.
Team B: That is a very good question. The workflow is a system and not a library. We want to avoid code inter dependency. Code deployment and maintainability is easier. Service is reusable, and in this case, it encapsulates a complete workflow.
Team A: Generating web service client is pain ...(sorry but I don't remember the following words as I was rotfl; in my mind of course). We need a jar.
Team B: Generating web service client is trivial. It  takes about 15 mins. We can do it for you.
Team A: Ok, let us discuss this again tomorrow.

Day 2:
Team A: We have a great idea. Let us merge the code of these 2 separate projects. We will combine all the APIs and create 1 WSDL. It will run very fast.
Team B: (After recovering from the shock) These are 2 distinct functional components. The APIs have no relation to each other. There is a clear boundary between the 2 sub systems.
Team A: It is complex.
Team B: What is complex?
Team A: Making a service call from our code is complex.
Team B: Making a service call is complex? How?
Team A: Yes, we have to make this service call inside a transaction and it is complex.
Team B: What!! When did you decide to make a service call inside a database transaction?
Team A: Today. And we have a problem. It is complex.
Team B: What is complex?
Team A:  Making a service call from our code is complex.
Team B: Write 0 lines of code and you get code that has zero complexity .
Team A: Does writing 0 lines of code makes the code fast?
Team B: Yes, the code runs at infinite speed!
Team A: And can I apply encapsulation to the design?
Team B: All team members faint.

You make also like this humorous post on NoSQL vs RDBMS.

Saturday, October 8, 2011

He's asking if God exists

Atheist: You seem to believe that God exists. Then you should be able to show me God.

Theist: Sorry, I do not 'posses' God as if God were an object; so I can not 'show' God to you.

Atheist: Do you know what God is?

Theist: For me, this world is God in manifest form. When we see the world, we don't see God and when we don't see the world, we will see God. It is like water - when it is liquid, it is not ice and when it is ice, it is not liquid!

Atheist: But what exactly are you pursuing?

Theist: My belief, what sages have been saying for eons, is that the phenomenal world is not real; it is an illusion. One must not get entrapped by it; one must make the effort to get away from it's allure. So, I am not not 'pursuing' anything that I can show you. Rather, I am trying to get away from what is unreal in order to experience the real.

It is like seeing the reflection of the sun in water and believing it to be the sun. Only when you turn your eyes away from the water and towards the sky will you realize that the sun is up there. Or like believing that the image in the mirror is you and then turning away from the mirror to discover who you truly are.

 Atheist: But isn't that naive? What if you are chasing a mirage in your search for an imagined God?

Theist: A dear chases a mirage because it 'sees' water when it is thirsty. I am not 'seeing' anything in the distance. I am simply disillusioned by what I am experiencing with my body, mind and ego in the physical world. It is so evanescent and transitory, yet so engaging. My mission is to get away from it in the faith that it will lead me to something better, something real and absolutely true. It is when you are immersed in worldly ways, that you are chasing a mirage!

Atheist: I can't take your word for it. Give me some proof of God's existence.

Theist: When you ask for proof, you mean the 'triputi' of seer (you), the seen (God) and the process of seeing. But God does not fit into this kind of 'triputi'. The only way to get proof of God is by merging with God, by becoming God. It is like a salt doll wanting to experience the ocean. The moment it goes for a feel of the ocean, it is no more it's erstwhile limited existence. It becomes the ocean itself.

Atheist: Perhaps, but surely, there must be some other way of convincing me of God's existence.

Theist: I am afraid not. Faith is the only instrument that can give you a measure of God. Nothing else can work. Just like a micrometer and not a foot rule is the right instrument to measure the thickness of a sheet of paper.

Atheist: Okay. Suppose I grant all of what you are saying. But, just consider what happens in case you do not experience God. Would you not then repent for having missed out on what the world has to offer?

Theist: Absolutely not because this world does not charm me anymore. I have nothing to seek in the world of objects. So, there can be no question of 'missing out' on anything. I am distancing myself from it of my own accord.

Taken from "Speaking Tree" section of TOI.

Sunday, September 18, 2011

From a programmer with love: Collection of programming and software quotes

Being a programmer is not easy. It is a continous strife for perfection.
Programming is like an optimization problem - with the end goals of elegance and simplicity, reliability, user-friendly, reusability, workability, performant etc. You can't have the best of all.

Some easy ways to save your neck when QAs, Managers and client shouts "bugs"!

“My software never has bugs. It just develops random features.”
Any sufficiently advanced bug is indistinguishable from a feature. - Rich Kulawiec
It's not a bug - it's an undocumented feature. - Author Unknown
It's easy to cry "bug" when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully.  - Doug Vargas

Some classic programming and software quotable quotes:

Walking on water and developing software from a specification are easy if both are frozen.

Any good software engineer will tell you that a compiler and an interpreter are interchangeable. - Tim Berners-Lee

As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications. - Dave Parnas

However, writing software without defects is not sufficient. In my experience, it is at least as difficult to write software that is safe - that is, software that behaves reasonably under adverse conditions. - Wietse Venema

I'm not saying we purposely introduced bugs or anything, but this is kind of a natural result of any complexities of software... that you can't fully test it. - Will Wright

Indeed, the woes of Software Engineering are not due to lack of tools, or proper management, but largely due to lack of sufficient technical competence. - Niklaus Wirth

Most of the effort in the software business goes into the maintenance of code that already exists. - Wietse Venema

People who are really serious about software should make their own hardware. - Alan Kay

Software is like entropy. It is difficult to grasp, weighs nothing, and obeys the second law of thermodynamics; i.e. it always increases. - Norman Ralph Augustine

Why shouldn't we give our teachers a license to obtain software, all software, any software, for nothing? Does anyone demand a licensing fee, each time a child is taught the alphabet? - William Gibson

Writing software that's safe even in the presence of bugs makes the challenge even more interesting. - Wietse Venema

Every good work of software starts by scratching a developer's personal itch.

Any fool can write code that a computer can understand. Good programmers write code that humans can understand. --Martin Fowler

Good code is its own best documentation. As you’re about to add a comment, ask yourself, ‘How can I improve the code so that this comment isn’t needed?’ Improve the code and then document it to make it even clearer. -Steve McConnell

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. -C.A.R. Hoare

Premature optimization is the root of all evil in programming. -C.A.R. Hoare

Inside every large program, there is a small program trying to get out. -C.A.R. Hoare

The key to performance is elegance, not battalions of special cases. -Jon Bentley and Doug McIlroy

Simplicity is prerequisite for reliability -Edsger W.Dijkstra

Correctness is clearly the prime quality. If a system does not do what it is supposed to do, then everything else about it matters little. -Bertrand Meyer

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian W. Kernighan

Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.

... programming requires more concentration than other activities. It's the reason programmers get upset about 'quick interruptions' - such interruptions are tantamount to asking a juggler to keep three balls in the air and hold your groceries at the same time."  -Steve McConnell

“Software is a great combination between artistry and engineering. When you finally get done and get to appreciate what you have done it is like a part of yourself that you've put together. I think a lot of the people here feel that way.” - Bill Gates

Saturday, September 10, 2011

Why Har ek friend jaroori hota hai - The new Airtel Advertisement

It is impossible to believe that any Indian would have missed watching this ad:


Catchy it is, pleasant to the ears, but soon due to its excessivity,  like the flood gates have been opened, it starts hurting your ears. I fear watching television these days, for I do not know when this megaton bomb would be dropped. My hand automatically reaches for the mute button on the remote to spare my brain of this incessant pain.

It looks like Airtel has made it the national anthem of India and it won't spare any Indian till each one of us has learned the lyrics by heart.

Chai Ke Liye Jaise Toast Hota Hai
Vaise Har Ek Friend Zaroori Hota Hai
Yeh sun sun ke bheja roast hota hai
Har Ek Friend Zaroori Hota Hai

With the success of Facebook, I think the song will be next picked up by them to promote the social networking website. "Facebook...Kyonki har ek friend zaroori hota hai!"

No wonder Airtel is soon going to increase the mobile phone tariff by 20% soon. I guess it is time for them to pay the broadcasters.

Till this ad goes off air, I have decided to watch my TV in mute :)

You may also like this article on my blog: The new Sony Vaio Ad.