Tuesday, June 30, 2009

HTML 5 Application Shortcuts

Google chrome has options to create web application as shortcuts. Google chrome calls it "Application Shortcuts". Why can't enhance the functionality of application shortcuts? Why can't we make it as standard somehow?

There are security issues.... It should be tackled. Assume that I am creating the shortcut for my email (live/yahoo/gmail) page. If I get a new message, It should be able to notify user. It may be somthing simple like how iPhone batch notification does or Windows outlook alerts does. There are multiple things associated with it. Browser should ever run in the background or there should be an os level hook or somthing simple. It should have a way to get updates from the source application on the internet etc. So source web application can provide this capabilites. So if the browser is able to some how get the notification from the source server, it can display alerts. It may be web service (REST/JSON/SOAP what not)

It also sounds like there is some similarity(ies) with Html5 websockets or Server Sent Events but not exactly how those are desinged/indented for. These provisions will make browser grow little bit beyond what actually it does now. It will eliminate one day the purpose of native client applications. So create an application shortcut, and tell the browser what to alert/notify. It opens up lots of possibilities.
I just posted this idea to WHATWG. Let me see the feedback....

Sunday, June 21, 2009

Erlang Tools and Modules

I was trying to use Eclipse Erlide but unfortunately I am not able turn it off compiling every time I save the file. It is quite slow and will make you irritated.
So, Since I am again coming from Java factory, thought of finding answers to the following items,
  1. Need a good IDE which will be able to give me code completion, need to jump into modules without performance issue
  2. How would normally development cycle would be. How would I make a build scripts, it looks "make" is widely used tool.
  3. How would be the different kind of environment like dev, testing, production etc organized and automated?
  4. I am also started looking at best practices/modules and ways to do Unit testing, XML parsing, Logging, Instrumentation, Socket (TCP/IP) access etc
  5. CouchDB Or Mnesia based MySql or other database access.

Erlang - Mac OSX

I have been playing with Erlang on Windows7. I thought of trying with Mac OS X. I found great simple blog which worked like a charm. I installed Erlang from source and all others and it worked.
It also gave me an opportunity to play with command line utilities and tools like Make, SVN etc. This is the piece which I was not able to answer to my friend and now I am comfortable.

Erlang - Some more musing

I am able to see lot of traction and attraction towards Erlang esp. individual contributors active with Erlang. It is good sign. Language will not be success without either community support or big marketing muscle. It is clearly the web giants and startups which anticipate astronomical spike in user growth is focusing on Erlang. It is a scale which is unimaginable and reliability which is dream of architects started using Erlang. To cater such a scale an early decision is very important. Facebook chat application with 10 billion messages and 1200 per seconds and 4+ million active channels is astronomical.

Thursday, June 18, 2009

How to Buy a Mac or Better Mac than Apple? Or Mac buying tips

I very well know that Apple is great at marketting. If you give a piece of junk they will make it Wall-E. They will go public carrying junk with clean neat casuals and contrasting background, and will start telling how beautiful it is... how wonderful it is... how awesome it is .... and people will believe it. It is like "Say once" - you wont bother; "one more time"- you hesitate; "one more" -hm.. you start believing it. But good thing is most of the item they bring into public is really good at its time.
So how about if you want to buy Macbook family of product....
Best Option from best to better,
  1. Using Student and Education - Apple never believe me I am learning every day, so I am student so it will not workout for me.
  2. EBay - with 8% cashback from Microsoft. What a hell going on?. In order to promote its online service, It end up promoting its enemy. Go to Microsoft's Bing cashback (until today, it is bing but earlier it used to be "live" but now it is dead) search for macbook and you will see somewhere link to Ebay website with dollar symbol displayed near by. Click the link and get into Ebay and there you can search for Macbook of your interest and go to the Buy it now tab, from there you can pick one and buy it using paypal. Note: it is vaild only for buy it now and with Paypal.
  3. Apple authorized deallers like MacMall or Mac Connection etc which offers almost same price or $50 less based on what model you choose. There is an additional discount for AppleInsider readers, it is 3% I guess. So go to Appleinsider (scroll down on that page) and get the code and apply it in Macmall.
  4. You can buy it anytime at Apple store or Apple online. Many a times, you get advantage like getting good discount for Apple software compare to other places.
Finally, go through Mac Buyer's guide. It is greatly kept current and it tells you when apple is going to update (refresh) its product line. Apple is very infamous for punishing last day buyers.

I am Ma(c)trixed

I bought a Macbook after a long deliberation. I have been planning to do something with iPhone. But iPhone SDK is not running on my Windows. I tried to install mac on my win notebook and gave up. It is great strategy for Apple otherwise I would never have thought of buying. I had been Pro PC guy until i started working with Mac. Hm.. how am I feeling after couple of weeks of usage.... I really liked many things, for ex build quality, usability and nuance of many other things like accessibility (I just need 2 fingers to scroll, 4 fingers to see all the open window etc). It wakes up very quickly after the lit is opened. Its ready as soon as I moved the lit to comfortable view position. Overall it feels better compare to windows. But I am not going to bother what OS is actually all I need is what kind of application I am running and how it helps me to work with those apps. I am following Google's philosophy, bothering which OS is going to soon become OLD SCHOOL of thought. Hm.. But I do use notebook for otherthings like Using Java/J2ee, Python and Erlang development. I hit a bottleneck as some of the niche application needs to be compiled for Mac. I tried,
  1. FFMpeg
  2. Image Magick
  3. OCRopus
  4. Tesseract etc. I need to spend sometime to find binaries, in fact, for windows iteself. Mac hm.. I needed to compile it from source but I never tried so far.
I am also using another laptop which is Windows 7 with GSkill Falcon Solid state drive (SSD) It is fast amazingly fast due to ssd. One more thing, Mac is helping me to explore my guts into mobile computing as I am quite interested in mobile computing. Let me try somthing soon....
I am also quite impressed with Windows 7 though it is glorified Vista but better polished n shiny Vista. What the hell Microsoft is doing. It is left and right fighting with others, one side with Apple (OS, iPod, Mobile OS), with Sony and Nintendo (PS3 and Wii), with Google (gmail, mobile os and Bing, did I say Search), with Sun (J2ee). hm... I am not able to list all and how MS is getting into.. It is seperate blog or book as its entirety...

Wednesday, June 17, 2009

Erlang - Why I need to learn new language?

I am in the process of learning Erlang. Why Erlang? There are couple of reasons. I need to find a language which should internet scale.
Brief about internet scale....
1. Single User application - We developed applications, say MS Office, which caters to single person. We won't bother multiple items here like how much memory it eats up, how much processor it takes, how much disk space it takes etc. Why because it runs on either desktop or laptop; in fact netbooks or palm top (windows mobile based phones, iPhone, blackberry etc) has concern on processor memory and space. Program should be responsive enough for the single user. This is one class application.
2. Minimal User Application - Next, small scale application. where few people access the system and they may not be bothering about whether it is up or restarting to make little bit faster (OS like windows XP needs restart to clean up memory leaks) so here people using are highly tolerant and not the applications as such. So it can run on any normal to medium profile hardware based servers.
3. Enterprise Scale Or Limited User Application: Normally enterprise application like enterprise email, Document Management Systems or leave systems etc will be use by limited set of folks and it is mostly intranet application accessed from local network. Normally it is developed in Java EE, .Net, RoR or Python or combinations of them. Normally Webservice or some other complex distributed programming paradigm will be followed.
4. Super scalable Applications: It is current class application pioneered by Google (Consumer email, youtube, maps), Amazon, Facebook (Chat), current Twitter kind of applications. It was unnoticed and tormented in Telecom environment. All the companies did a really hardwork to come up with their platform which is kind of unique and innovative. Infrastructure is built such a way it scales infinitesimal, internet scaling. It is tough to hit, important events make people hit the website. Recent fiasco Nokia's Ovi store broke down, Tweeter's frequent outage due to spikes. Why the concurrency is not free or not easy. It is like gymnastic or performing martial arts.... needs lots of coordination and control. It is tough and needs practice. Some of the paradigm we used to make it grow like imperative programing (Object oriented programing/ procedural programing) suffered a lot of maintaining state. It is like obese people suffering from excessive fat. It distract many thing including co-ordination. So difficult to parallelize. Ok.. Is there a simple way to over come this. Yes and no. I researched a lot. Closely following Twitter and Facebook gives many idea. First of all needs good hardware and servers. Next needs infrastructure which effectively utilizes the hardware. My desktop and Laptop has dual core (I am 2 years behind extreme computing with Quadcores) and multicore GPU. But how my programming platform effectively utilizes the cores is important point to scale. It is kind of parallel to Car which goes 0-120 miles in 6 secs. What is the use if my speed limit is 30 miles? Or I can say riding a bicycle in a express high way where I can go upto 85 miles per hr. This is exactly it is happening. My hardware is so powerful but my software is so dumb and it is not multi tasking. Or even single tasking with all the cores. It is like 4 people needs to do a job but they don't know how to split it and do the work. So one person starts and others are waiting until the guy finishes. So what is the problem when i have a computer with ample amount of power and I can't normally bother between 0.7 sec or 1.4 secs of completion. Still it is fast.... But what if millions of people access it. It will keel into halt but it suppose not to. So counting every penny is important as it amounts to lot of other things. Energy wastage, environmental issues etc.
So how Twitter or Facebook addressed this issue. They moved some of the heart of the code into Functional Programming Code. For Twitter, it is Scala and for Facebook, it is Erlang. Both are actor based shared nothing function language evolved from Alanso Chruch Lambda Calculus. Academic loves these languages.
So I am in the process of learning Erlang. I found great book Joe Amrstrong's Concurrent Programing with Erlang second edition. So far it is quite interesting. It is lean and mean from the start. It is damed concurrency and fault tolerance and high scalability in its DNA.
There is no loop. What a hell are you talking about? All i need to do is unlearn my OOPS oops!!!.
I create a looping control if i need. I don't need design pattern. I am not telling how it needs to do something. As my friend Santhosh GR said, I just needs to tell what I need. No state to maintain. Oh... how can I program with the one which doesn't have or doesn't recommend one which I used for developing even adding two nos.

Having set the context, I will continue on Erlang later.... It also brings me how Java going to survive? It looks like its current state it is not fit into "Internet Scale". This is same for C# and other imperative languages. Their core is thread. Is thread is bad? It looks, sounds and feels bad. Why because thread are, at least in current state, not able to scale across multiple cores. Java is faster on single core processor with high clock speed compare to multi core highly effective modern processor. It degrades shabbily beyond quad cores and Intel has 6 core already and going to launch 8 cores and AMD story also the same. But Java, Java 6 came 2 years back and 7 still in pre beta. So time and growth of hardware and software are looking north and south.