Monday, December 31, 2012

Moving the blog to my domain

I am moving my blog under my domain. Please visit me there. Thanks.

Monday, August 20, 2012

First Impressions of a budding functional programmer

I have just started learning functional programming. Having spent almost all my time as developer on the JVM (and mostly java), it would have been easier or may be natural to pick up Clojure. I did start on it but somehow could not keep with it. Also I had a burning desire to venture outside the JVM. So I picked up Haskell.
For a brief time now I have been trying to learn Haskell. And boy isn't the language amazing. It's pure functional nature makes you appreciate how the functional paradigm is refreshing different from the imperative world I have been on. Wanted to write down a few impressions, I have had on learning functional programming through the language:

  • The simplicity of the Head and the Tail and how many ways it helps to solve problems
  • The amazing power of recursion and how it can used to solve problems which you never thought could be solved.
  • Higher order functions which allow passing them around and currying which makes problem solving so elegant
  • Type which really govern behavior - Honestly this is something which I am still not sure whether I have wrapped my head around.
  • The thrust in the language to write simple and clean looking code all the time.
These are just a few impressions.
I missed one obvious one obviously. Functional programming reinvigorates your love for math (or for others it might be the first time). I am currently looking at picking up math courses and buying math books.
The journey has just begun and I have a long way to go. If I do something original during this time, you will surely hear from me. Bye for now.

Wednesday, July 18, 2012

Test Driven Development - Recording I

Sometime back, I was working on the development of a service (as part of my work). It was actually a rewrite involving conversion of a legacy EJB based service into simple POJO based service exposed to the external world through Spring remoting. As I had been practicing TDD (and leaning towards behavior driven tests) for sometime, I decided to use the same technique for this work as well. I decided it would be good to record some of my thoughts or opinions about what I was doing and that is why this write up. Though the rewrite use case is the not the typical use case for TDD (which is developing on green field), where it is considered to come out in all its glory, I still felt there are some good points which came out this exercise. Here are a few of my observations of doing TDD with behavior based testing:
  • Let us take a scenario where the Object under test is interacting with third party code. When we do behavior based testing in this scenario, we need to get to know more details of the implementation of the third party code. I did not like it much and started feeling the behavior based testing is making me do this thing, which felt wrong. But later on, I realized that behavior based testing is actually bringing out the fact that the third party code is actually not designed properly and hence the reason for my strife. So this gives me a chance to fix that piece of code. Now, this is nice if I have control on the 3rd party source code. If I have no control on the 3rd party source code then I probably have to move away from behavior based testing to avoid brittle tests.
  • In the pursuit of truly isolating the method under test, I try to mock out all other significant method calls whether external calls or internal methods calls (thanks to mockito's spy). In order to do that I have to increase the visibility of these methods from private to default (package level). I actually don't like doing this. The only saving grace is that the visibility is increased to package level only which still means that it is only visible within its part/sub system of the application.
  • As I write these behavior based tests, I find them very very close to the implementation. So I know that if I have to change the implementation I have to change the tests as well. I am not sure whether this is a completely bad thing. Giving that test is supposed to drive the development, this might be something which is expected (want to think more about this).
  • I realized that as I keep developing through TDD and behavior based tests, I tend to make methods much more granular and cohesive. The methods tend to be small and focused on a single task. This made it easy to test them by mocking other things out. This is a very pleasant outcome of TDD for me.
  • One thing I observed during the process of development is that it is important to have a good set of integration tests. This allows me to catch wrong assumptions I have made during writing of unit tests. Unit tests because of their nature are very focused and hence suffer from shortsightedness. Integration tests help me to overcome this problem.
  • When I am trying new stuff during implementation (say a new technique of persistence etc.) I find it worthwhile to write a integration test immediately after writing a unit test (and the implementation as they go together). This allows me to check out whether the technique is working fine. This idea is just taking the concept of iterative development to a micro level.
As I continue with development, I feel the need to go back and read some of the state vs behavior driven tests related articles. The starting point probably can be 'Mocks Aren't Stubs' article be Martin Fowler. But this time I have decided to read more of them (or may be a book) to get a better idea. Some day I will share what I learn from that.

Saturday, June 30, 2012

Why do Android developers do not make money?

Okay now. Don't expect me to bring some new reasoning here. This is probably known to a lot of us (if not all). Even I have heard about it before many times. But only a few days back, I sort of got it (Eureka! Eureka!).


A friend of mine had bought an iPad 2 just few weeks back. He intended to buy an Android tablet (Asus Transformer) but somehow things worked out differently (that is another story and does not have a place here) and an iPad 2 landed on his lap. He has been using it for sometime now. A point to keep in mind is that he owns a Android Motorola Defy for quite some time and uses it a lot and likes it a lot (already rooted and flashed).


We were talking about apps on iPad (since I have been using one for sometime, I am considered a locally available subject matter expert - I suppose in the country of blind, the one eyed man is the king) for reading PDFs. Good Reader came up as a possible choice and we talked about the fact that its costs a few dollars and is not free. Then it happened...


My friend said: "I need a good app for reading PDFs and since I have already put in the credit card information into the iPad 2, I might as well buy a good app".


I heard that but it did not register first. And then it hit me! My friend has owned an Android phone for a very long time and has never bought an app in the Google Play store. He has never entered his credit card information in his Android phone till date. And he probably will never do it.


When an iPad 2 is registered with an Apple id for using the app store, one is mandated to enter credit card information. Google Android phones on the other hand allow the user to skip that part. That means that as a user, my friend never entered his credit card data in the Android phone but he entered it first thing in the iPad 2. I am sure he must have felt forced and wronged when he had to put the CC information in the iPad 2 and would have liked not to do it. But over a period of time, this just became a matter of fact for him. 


Eventually what matters is that Apple has his credit card information within just a couple of days of him having a Apple product and that has opened the door for his spending in the App Store within weeks. Where as Google still does not have his credit card information and he has not spent a dime in the Google Play store for close to a year.


Like I said, what I am saying is nothing new. I have heard it many times. But when you experience things first hand, it has a way of making things very clear in one's head. That is what happened with me and I had tell it everybody.


What should Google do? Should it force the consumer to enter her/his credit card information upfront? Will that push the consumers to spend on the Play store? Will that make Android a better platform for developers to develop apps? What do you think?.


  

Sunday, June 17, 2012

What is SPDY?

Lately there is a lot of talk about the SPDY protocol (pronounced as Speedy). The recent launch of Firefox 13 with SPDY available by default is very welcomed. Though created by Google, a lot of large entities (amazon, twitter, mozilla etc.) are interested in this protocol. Google has submitted this as a draft to IETF as the next gen replacement Http. Even microsoft is interested and they have also submitted a parallel proposal, which is very much inspired by SPDY.

Now that I have built up the interest on SPDY as the next gen http (hopefully), you might ask: "What is wrong with HTTP? Why should I care?"

Problem with HTTP

HTTP has served us well for a long time and in many ways it was never conceived to be used. Today the content which flows through the internet is very rich with images, dynamic scripts, videos. Some of HTTP's early decisions are not good enough any more in terms of performance. For example
  • One request per connection at a time - Everything a server has to send to the client comes in a serial manner - send one and then the other and then the next. Too slow. Browsers circumvent this by creating parallel connections to the server (creating new connections is not cheap at all).
  • Request always initiated by client only - HTTP works by the principle that client initiates the request and the server responds to it. Even if the server knows that the client would need these resources, it can't really do much about it (neither pushing content nor providing hints).
  • HTTP Headers keep sending redundant information and that too in uncompressed form.
All these mean that HTTP makes the web experience much slow (at least at the rate at which we want it today). That said, HTTP is very prevalent and it handles various kinds of content very nicely.

In comes the SPDY

SPDY as the name suggest is a protocol aimed at changing the performance aspect of HTTP. It preserves the application usage aspect of HTTP and tries to solve the performance issues. It sits on top TCP and provides a session layer. It tries to:
  • work with many concurrent HTTP requests in a single TCP session/connection in the form of streams. A new frame format helps doing this
  • reduce bandwidth usage by using compressed headers and removing unnecessary headers
  • create server initiated streams (push or hint)
SPDY also tries to ensure that content does not have to change to achieve this. This is important because with the amount of web content available in the world, this would just be unreasonable. The idea is to change the user agent (browser) and the content provider (server) to provide support for SPDY.
Another thing to note is that SPDY stays at the application protocol (HTTP is one) layer and does not move into the transport (TCP) layer. This is not because there is no optimization possible at that level. It is more to do with the fact that such changes would need the entire internet infrastructure to change and that will make the protocol a non-starter in terms of its acceptance. 
SPDY also prefers to work with SSL. This does cost on performance, but the idea is to promote a more secure way of interaction between client and server. 

SPDY Implementation 

Google has worked on implementing this protocol and testing it extensively. Their browser (guess which one) supports it and their server infrastructure supports it as well. That itself is a good testing bed for SPDY. A lot of details about their testing is provided in the SPDY white-paper if you interested to check out.
Of course other companies are getting involved as well as I mentioned before.

Development Support

The SPDY project page refers to a lot of frameworks and server software that support SPDY. Some interesting ones are

There are lot more servers and libraries supporting it - please refer the project page mentioned above.

Conclusion

SPDY is already there in the wild now. It makes the web interaction faster for consumers/producers like us. It has picked the interest of other big entities who are trying to improve it further. Google itself is very much involved and is doing a lot of testing. It also wants to involve the open community on it. May be its time we get to know more about it and contribute to it in whatever way we can. 

Sunday, April 29, 2012

Micromax Funbook seems to have some fun in it

Sometime back I came across a news item on the launch of Micromax Funbook. Seemed interesting and hence wanted to read it. Finally got to it today. Also watched iGyaan initial video review on youtube.

Few very good things going for it:
- Android ICS
- Price of 6.5k
- Capacitative
- Google Play available

The looks are also decent. A bunch of useful pre-loaded apps thrown in. Only thing which did seem a problem during the video is the browser speed/snappiness. That is a cause of worry. At the same time I think its worth checking out.

I am going to do that for sure. Given the price, I am very convinced to give it a shot. What about you?

Saturday, April 7, 2012

Zite on Android

It was only yesterday I was talking about Zite to my friend (I have mentioned the app before to them).

I have been using Zite for sometime now. It has been my go to magazine app on my iPad 2 for reading tech and development articles. I have backed its own feed with my google reader and twitter feeds. Almost on a daily basis I keep looking at the top news section and catch a lot of stuff I like to read. It is just become part of my daily routine.

Yesterday, during conversation with my friend I mentioned all this. She was very intrigued and interested and wanted to use it. I told her that there is only a iPad version of the app (and she has a Samsung Galaxy S2 like me and no tablet)  and hence it is not for her.

I was completely wrong. Today morning (actually just a few minutes ago) my iPad was out of juice and I wanted to catch up on some tech/dev news (like usual). I thought Zite might have online presence (I doubted it as soon as I thought it somehow). So I dutifully logged on to their zite, oh sorry site.

And lo behold, what was waiting for me. An Android version. And next thing I did was installing it. I took it for a very very short test drive (using the same account I have on my iPad 2) and at first look I liked it. The content was all there (I still have to check out the user interface properly). According to Zite this was customized for the Android phone and not the tablet. God knows why (may be it is because android phones are much popular than android tablet) but it suits my need well.

As soon as I finish publishing this out, I will message my friend about it (to correct the wrong I did yesterday). 

Sunday, March 11, 2012

Gadget's and their batteries

The new iPad boosts some great features - retina display, higher graphic performance, 4g connectivity etc.  Now all this is nice but what is nicer is the battery life claimed on it. All this and yet a battery life of 9 hrs is great. Of course there is a secret - bigger denser battery. Knowing Apple, they have probably patented it already.

Today's gadgets (smart phones, tablets etc.) are very smart and power hungry. My android phone and iPad are no different. Since I carry my phone around, I always keep a charger handy with me. I am even considering buying a travel battery pack (something like this but maybe of more capacity. May be someday.

Couple of days back I came across some news on silicon nanowire based battery which can hold 10 times that and tweeted about it. Now this was amazing news. 10 times more battery life will be dream come true. But then I noticed that the news item was from Jan 2008 or earlier. What happened after that? I did more digging...
Amprius is the name of the start-up which is working on this and I found an article in GigaOM for a later date (late 2010). It talks about work still happening on the technology to commercialize it. The start-up is backed by many venture capital firms and Dr. Eric Schmidt (I wonder who is that now). Also found this nice graphical piece of writing which explains the technology in simple terms. The amount of increase it can give (whether 10 times or less) is still under question but even if we get 3 times more that will be good.

If this start up makes commercialization of this technology viable then every gadget maker worth their salt (read Apple and Google) will be behind them. Now will some Dr.Schmidt have any say in the matter.

For me, I hope this technology does not get stuck with one of these big players. This technology can make a great impact to on our lives. So what do you think! 

Wednesday, March 7, 2012

Google rebrands its digital content offering as Google Play (No more android market)

Google is creating a single destination for all its digital content: Google play.

I am still trying to figure out what the 'play' here is. I understand that it is good to bring all their offerings to a single place (part of their consolidation strategy I suppose) as that allows me (the consumer) to not have to go to multiple places to get stuff.

What I don't get the name 'play'. I tried reading the faq to find if there is anything mentioned there which will make things clear but could not. Is Google trying to take a shot at the philosophy that 'life is a game, play it'. Or is it that you play games, movies, music and hence the name (but I don't play books. I also get a lot of work done through the apps). I don't get it.

I understand they wanted to move away from being called "Android Market" because it is more than just about Android. Some people have suggested that they should have used something like "Google Market". That does make sense to me but the only thing is that it looks like a beaten/used name with no 'new' factor (others would say it is a well established brand now).

Why so much hue and cry about the name? Its just a name. But if we think about it, it is the name people use the connect to what is offered. Common sense and even user experience science suggest that having a clear good name is always better than having some vague catchy stylish name. Consumers/customers get simplicity and clarity.

So why is Google doing this? Am I missing the 'play' here?

Wednesday, February 22, 2012

Ubuntu for Android

With the news of Mountain Lion out in the open, a lot of integration between iOS and the new OS is being talked about. The desktop OS is trying to be closer to the mobile one thus making the transition seemless. People are also talking about how this might impact the mobile industry and work against Android. When I thought about it, I felt that the argument made sense.

Today I saw the news on Ubuntu for Android. I read further about it in herehere and here. This is a truly novel idea. One device which gives you two different experiences and without any compromise (if it really works like it says). I truly will be able to use a device in two different fully functional and integrated modes (ok, that is repeating the previous line but I just am amazed at the idea). And best part is that it is favorite desktop OS too. Just reading about the amount of synchronization and synergy there will be (sharing the same kernel surely helps) and what can I do with both is really amazing.

One thing that is not clear is the kind of ubuntu based application that will be available on this ubuntu version. More news might trickle down the line.

Now, if you don't want to read all of these links which I have provided above and just want to taste of this thing then jump straight to the below video:


Monday, February 20, 2012

Open Source Textbooks - Now that is new!

Recently I read an article in techcrunch which talked about open source text books. This was the first time I came across such an idea. Very interesting really!

It talks about how costly text books are and how open source can help a lot. It also talks about how there are some ventures/firms which are working in this area (with the recent addition of apple with there new iBooks etc.). It also mentions about the usage of tablet like devices where text book content can be received and consumed (that takes away the cost of printing/publishing). At the end it mentions that it would probably take 10 years for open source text books become main stream (that is to grab around 25% of the market share). All this is in the context of U.S.

Will this ever happen in India!

That is the thought that struck me immediately. For that first I wanted to consider whether we need such a thing. When I look at my daughter Harinya's book needs (she is studying in Upper Kindergarten), the cost is sufficiently high for her age. Even my college books were quite costly at that time. So does this mean there is some kind of need for open source text books. May be.

I thought about it a bit more. I remembered that during my school education we used text books from NCERT which were of good quality and extremely cheap. I went to their site and found that they allow you to download books from class I to XII from the site. Of course these are copyright protected and hence cannot be reprinted or redistributed (that's restrictive, but its better than nothing). Now if students can get hold of these directly then it would be great for them to use. But this means that the students need someway to access this content and store it so that they can read from it. How can they do that without some kind of device and internet connection.

Recently there was news on the Aakash tablet. If Aakash really becomes possible (is that too much to hope for), it is an ideal platform for students to get such content and use it. Wow! that sounds like a complete end to end solution. Is it too good to be true?

I don't know whether the Aakash tablets are available for kids in school. From what I understand the tablet is available only to college students at least as of now. And NCERT books are available only for school students. Now this means that two ends of the above solution never meet. So these efforts become pretty much useless (unless something changes).

Even if these meet, I still see two problems. The schools in India can follow different syllabuses and different boards. So depending on the board, the content available through NCERT might or might not be relevant. Also individual schools which follow the same syllabus as NCERT may still use different text books than what is available through NCERT. Can this be changed? I don't know. The other part is that for higher studies there is nothing like NCERT which is providing free/cheap content (may be that's going to change - I am not sure, I would like to know). Till that happens, the content required for studies will still be very expensive (expensive is a relative term and here I mean expensive for India.)

Does this mean Open Source text books are going to be useful for India? I am positive it is going to be. But the question is when will it happen in India. I would like to believe it is soon but I don't think it will happen. I hope I am wrong! What do you think?

Wednesday, February 15, 2012

Firefox Roadmap for 2012

Lately Firefox has been in news for the wrong reason. They have been losing out to competitors especially Chrome.

I personally use both the browsers and like both of them. I really like the Firefox add-on system because it is quite rich (Chrome has caught up quite a bit on this too). One thing which I don't like is its bloated nature (the other day I saw Firefox was taking close 2 GB of my RAM!).

I got a chance to look at the Firefox Roadmap for 2012 which got updated very recently. There are some good things planned and I was able to categorize them into themes:

  • Catch up to Chrome:  One of the primary themes which I could make out (because they obviously won't say it that way) is Firefox trying to add a lot of Chrome features. For example: silent updates, web apps marketplace (like Chrome Web Store), add-on sync seem the most important ones. There are a few others as well.
  • Performance - There are a lot of items on this one and I am very glad about it. Firefox is looking at changes for better memory management, improving start up speed, faster session restores. They plan to introduce a next generation JavaScript engine 'IonMonkey' which is expected to have improved performance. They are other similar ones mentioned in the roadmap including a few obvious ones.
  • Social engagement - Firefox is planning to provide ways to share stuff. It is also going to have an id system (log on to Firefox with a password which hooks you to other things). One of the best things they are planning to introduce is an ability to monitor site tracking and control it (one of my friends would be thrilled with this feature). I would like to learn more about this and if I do, I will share it.
  • Firefox for Window 8 Metro: There is plan to release beta version of Firefox for Windows 8 metro. At this point in time we don't know how this will pan out and the kind of features that will come out. For the matter we don't even know how much Metro will catch on. Something to wait and watch.
  • Other catch up/good stuff: Reader mode similar to Safari. Language translation  etc.

Now these are significant features for sure. The one that can make Firefox standout and be counted as serious contenders is the social/privacy feature. If that is good then a lot of privacy conscious people (and that is a lot of people!) will take to Firefox. And to make them not regret that decision, Firefox performance improvements will help.

On the whole it looks like Firefox does not want to give up and die! I hope and want them to make it.

Thursday, February 9, 2012

Belated Happy Birthday Google Maps

I just learned from this article that Google maps turned seven yesterday. It covers some salient dates and numbers in the Google Maps journey.

I think Google maps is really amazing. Using maps for actually finding my way around was made possible (even thinking about it) for me by Google maps. Before, I would not have dreamed about it. While there are other services like Bing Maps, lot of people I see around keep using only Google maps. It has become a de-facto standard. I have used it to find my way around in my own city many times.

Belated Happy birthday Google Maps. I wish you the best!

Wednesday, February 8, 2012

Appbooster by AppsFire

Mobile application development is currently a hot thing to do. I can see a lot of people developing apps for the smart phone platforms like iPhone and Android (even school kids). I too want to and hope to do it some point in time (at least that is the excuse I gave when I bought these devices).

When I hunt for apps, I read of lot of review comments from other users. This is especially useful in the Android platform (it is useful in IOS too but it is less so) and I make decisions on whether to try it out based on these comments.

While these comments are very useful for peer users, I wonder what it does to developers. I have seen many developers mentioning in the description to send them emails if there are any issues instead of giving review comments. There is two fold advantage for developers in this. First of all they can avoid negative reviews coming in the market/app store which will affect their app download/usage. Secondly they can have meaningful conversation to get a better understanding of the problem. They might even be able to get new feature ideas from their customers. All in all better customer engagement which is something a developer should love to have.

Today I came across a news item which talked about Appbooster. A short description talks about how the sdk can allow developers to easily build an in-app feedback and notification mechanism. Direct engagement is what this is driving. While the feedback part seems to essentially talk about what is described above, the notification stuff is cool. You can send notifications to users based on geography, version etc. You could tell them about new features added or new features coming in etc. All of this is inside the app. This also could mean that developers need not push notifications to the common notification bar (it really annoys me sometimes) if they don't want to. Not sure whether they will not want to.

The platform also makes possible cross promotion of apps. This can have an advertisement angle - developers collaborating to provide ads for each others apps. They might even push ads for app related merchandise in due course of time. Now that won't please Google or Apple.

The sdk page says that it is available for iOS and Android. Appbooster is currently in beta. So interested developers please jump in and let others know how good (or bad) it is.

p.s.: While reading about Appbooster which is part of Appsfire, I realized Appsfire itself is app discovery engine (like chomp I guess). Will try it out and let you know. 

Sunday, February 5, 2012

The fate of the Aakash Tablet

When I read this article on Aakash, I felt really bad. I was happy that there was innovation happening at our own education institutions. Also felt good that there was effort to make things better and the inventors were trying to push the manufacturers to get out better quality stuff.

But the stalemate is not going to help us in anyway. I am not sure whether the Indian government will do a good job in breaking the stalemate in the proper way and in the proper time.

I look up at the sky and hope and pray that Aakash makes it.

Thursday, February 2, 2012

Google vs Microsoft - Business as usual

Microsoft is trying their best to benefit from the hue and cry people are making over Google privacy policy changes. Google is answering it back with their own blog post (find a short summary here).

I personally am not so much concerned about the privacy policy changes which Google is making (to be frank I am not so buzzed about privacy policy changes in general - if you want to keep something really private then don't put it on the internet). But 'privacy changes' are nowadays treated almost like some personal attack or act of robbery!

From what I have heard most of such companies including Microsoft have such common privacy policies. So seems like a clear case Microsoft trying to make hay when the sun shines :).

Now it was only yesterday, I talked about Microsoft becoming benign and whether I had lost my mind to think like that. Today, it is proved that I have really lost it!    

Wednesday, February 1, 2012

Microsoft Offers Accelerator-Backed Startups $60,000* In Azure Cloud Usage

It helps to be sitting on a big pile of cash. Microsoft has shown this to us a number of times. They are offering free cloud time to leading startups chosen through their startup promotion partners.  The game of course is to increase adoption of Azure and push it forward. That said it is still a good gesture from Microsoft (at least some start ups might use the opportunity). Also given that Azure supports open technologies (yes java too), it is surely not a bad proposition for these startups.

For sometime now, I have had feeling that Microsoft is turning more benign than before. Am I right or should I go for a sanity test?

App Engine 1.6.2 Released

The latest app engine release is out. During its initial days I really liked the idea of App Engine ( I guess a lot of it has to do with the fact it was free and from Google). I even went for a short training course on it. Then slowly interested faded. Lot more players came in after that with different and better (more complete) offerings. App Engine restricted environment did not help matters. App engine lost its shine for me.

That might not be so for many others. So you might be thrilled about it. If so do let me know.

Facebook filing for $5 billion IPO tomorrow, says NYT | The Verge

Facebook is reported to make a public offer of $5 billion (very close to all time high, according to the report).

I am not a big user of Facebook. I rarely log into it directly. I use Facebook through other tools for sharing stuff some of my friends. I think these friends of mine are the reason behind Facebook's success (ok, multiple millions of people like my friends). The feelings this raises in my head are mixed (more like 'I wish I was part of it - the greenery looks fantastic').

Facebook has grown at such a rapid pace. Technologically (which is primarily my interest) they have done a lot of good/great things. They are probably the poster child for a start up. Every start up would love to think that they are destined to same place. But I really doubt that. To do another Facebook is next to impossible at least within my life time. What do you think?