Friday, June 29, 2007

Using Prolog to Find a Friend - 2

Further to my pervious post : Using Prolog to Find a Friend

I have made a minor enhancement to compute the degrees of separation.
/* Prolog Program */
knows(a,b).
knows(b,c).
knows(c,d).
knows(d,e).

exists(X) :- knows(X,_).
exists(X) :- knows(_,X).

friend(X,Y,Deg) :- exists(X), exists(Y), foaf(X,Y,Deg).

foaf(X,Y, Deg) :- knows(X,Y), Deg is 1.
foaf(X,Y, Deg) :- knows(Y,X), Deg is 1.
foaf(X,Y, Deg) :- knows(X,Z),foaf(Z,Y, D1), Deg is D1 + 1.

/* end */

Run it using the goal:
?- friend(a,e,X).
Prolog Answer:
yes.
X / 4
Solution: friend(a,e,4)

Next I will make a List to append the friends name in it.

AJAX JSF on Mobile

Long long ago, I had written an article in Computers Today about WAP. It was in November 2000 issue. What I had written then about server side delivery will be preferred way is still true.
Ericsson has released an open source JSF renderer for mobiles! get the presentation here.
You can also download the source from their site.

The advantage of using Java EE to deliver application to mobile is that you don't have to support multiple versions for each vendor and even intra vendor's platform. And unlike Nokia's SDK, which is too fat, Ericson has a small footprint and thus does not lock the developer in.

Recently Sun and Ericsson are collaborating to marry Java technologies with telecommunications. Not that Java was not present in the telecom space, it had JAIN (Java Advanced Intelligent Network) But then there was Parlay led by Microsoft. Now Sun and Ericson have collaborated to produce Parlay interop with Java EE. It too is open source.

To avoid confusion here, I must add that I am talking two different things here. The enterprise applications connect B2C where as AIN (Advanced Intellegent Network) application are more of telecom domain applications like delivering caller tunes of your choice or call divert or voice mail service. Thus you could think it as O2C (Operator to Customer) applications. The only common thread here is the use of Java EE technology.

Thursday, June 28, 2007

Less Paper Office (Developer Release)

In my previous blog, I had proposed that a micro enterprise can save time and cost by simply using a HP scanner, that comes with a document scanning software to convert scanned documents into search-able PDF documents. Also Open Office can convert a document into a PDF file.

However, Open Office cannot create PDF files with attached exotic files like XML and zip files.

Thus I have created a simple, Free Open Source Java application, for creating PDF with attachments. These attachments can be annotated as well.

It is of pre-alpha quality or developmental release for other developers and power users, to experiment.
The distribution can be downloaded from:

http://www.ashishbanerjee.com/LePaOf_v01_dist_28june07.zip

The distribution contains source as well as Java binary. Just unzip it into a directory and execute run.bat. For Linux and Solaris, just rename the run.bat to run.sh and give executable permissions. It needs Java runtime.

LePaOf uses third party open source lib. PDF BOX.

Sunday, June 24, 2007

Netbeans Does Not Use Grizzly Yet

Its a bit sad to figure out that Netbeans.org does not use Grizzly!
Now if you are wondering what all this is all about? Let me clear the bytes for you. Netbeans is the Sun's flagship IDE. Competing directly with Eclipse. Grizzly is the NIO framework within Glassfish. It has been proven within Sun, that Apache does not scale beyond 4 cores, whereas Glassfish with Grizzly technology scales well beyond.

However I figured out that Netbeans uses the old technology circa 1999. where Apache sat in front and connected to Tomcat or any other Java Server using AJP (Apache Java Protocol)

Don't ask me how I figured out that netbeans.org uses Apache 2.0.50 (as of 24 June 2007) as HTTP server.

I would like to appeal to Netbeans admin to seriously consider using Glassfish.

Jetty 6 , which also uses NIO, run their web site on Jetty itself! That's what I call confidence!

Friday, June 22, 2007

Finacial and Banking Transaction Links

BFSI (Banking, Finance, Security and Insurance) is a vast and deep domain.
I do not wish to map it here, but focus into Financial Transactions which is the most dynamic domain and heart of todays e-commerce backbone.

Just a few URLs for my younger tribers who wish to get into Banking and Financial Transaction domain:

Financial Transaction/Communication standards:
http://www.ifxforum.org/home
http://www.twiststandards.org/
http://www.iso20022.org/
http://www.swift.com/

Also must study UMM at
http://ebxml.org/

Open source:
http://jpos.org/
http://wife.sourceforge.net/

PKIX:

http://www.ietf.org/html.charters/pkix-charter.html
http://www.oasis-open.org/committees/security/

Java Stack
https://open-esb.dev.java.net/


Feel free to ask questions to me at:
http://www.techtribe.com/triber/ashishbanerjee

How to Blog in Hindi

In case you are wondering, how I type Sanskrit in my blogs, let me share with you the knowhow. Well Hindi, Marathi and Sanskrit are written in Devanagri script.

Most bloggers of Indian origin are English speaking and are more comfortable with Querty than Indic keyboard.

Eons ago, the Department of Information Technology had funded a project with IIT Kanpur, called GIST. Now CDAC carries the torch. It resulted in LIPI and ISCI . It is now dated. Only die hard Don Quixotes of IT at government funded agencies use it. No more used in real life.

In-fact we burned a few Lakhs of rupees in consulting and Indian language conversion with CDAC, and got zilch result. But what paid off is their brand name that sells in the Banking segment.

But if you are not into politics of IT sales, then what's the technology you should go for?

The technology is Unicode. Both Windows, Linux and Solaris support it.

Best and simplest of all you can type in English and transliterate it in Hindi! That's what Google supports, see: http://googleblog.blogspot.com/2007/04/now-you-can-blog-in-hindi.html

Also checkout ITRANS, which is the original technology on which Google is based.

But what's under the hood? Good question :)

Check out my test page at : http://ash.banerjee.googlepages.com/dev2uni.html

The Java source code is available there. In-fact, by changing just a few lines of code, Inheritance in Java speak, I could make it work for Bengali and Punjabi! That's the beauty of Indian languages.

By the way Sanskrit is the most scientific language ever spoken. And A.A.Mcdonald in his Sanskrit grammar book wrote that Sanskrit is at-least 200 years ahead of English. And Panini was the world's first grammarian!

Now go and Blog in Hindi.

Wealth of Knowledge by Bhamini

Here is a Sanskrit shloka attibuted to Bhamini's Sabhatarangini:

न चोरहार्यं न च राजहार्यं न भ्रातृभाज्यं न च भारकारि।
व्यये कृते वर्धत एव नित्यम् विद्याधनं सर्वधनप्रधानं।।

It cannot be stolen by the thieves or the kings, nor can brothers divide it and it is burden less. Every time its is spent it grows. Knowledge is indeed the supreme wealth.
Sabhatarangini by Bhaamini

Wednesday, June 20, 2007

Active Magazine is Awesome

I came across the Olive Software's Active Magazine product, when trying to read the Red Herring magazine online.

As the user experience was so good and natural; Incredibly I flicked through all of the 88 pages of the Red Herring issue!

It worked in Firefox. And, it does not load any heavy duty plugins, just Java Script, though I did not care to look under its hood to figure out if it was using any Flash, the user experience was so good, that the content had grabbed my attention and my techie instinct took a back seat.

What I have noticed about me is that I start looking under the hood, only when; either the site get slow, or crashes...I guess that's when my engineering sole wakes up and takes over from the Net surfer.

The Active magazine is a great concept, though I guess it would be costing a bomb! Given that they don't disclose the prices upfront.

If you are running a community news letter, then best is to use Open Office which is free and open source it comes with a SDK. You can also generate PDF with a press of a button.

But, if you are running a professional e-zine setup, then go for Active Magazine!

Tuesday, June 19, 2007

Route Guru

I just came across routeguru.com , promoted and founded by Avinash Agrawal. Its still in Alpha (19-June-07). But works!!

Route Guru is about planning route, presently only a few Indian cities are supported. The data is licensed from Eicher, yes the same company that manufactures tractors and had published the city guides. In fact, we had approached Eicher around Y2K (during the last dot com boom), and we could not strike a deal as they were asking a bomb for their data and wouldn't consider revenue share! Good that Avinash has been able to convince them. Though, it would be interesting to figure out the terms of the deals :)

The technology is Java, though Struts has been used, which is a bit outdated. Ajax has been used as well. Though, use of Google Map API would have been a cool feature. The site was slightly slow when I clicked about us. But, I guess it may be due to the sever capability. probably a VPS with less than 200MB RAM must have been used. That's OK for testing the concept.

The idea of Route Guru, is well timed as the 2010 games is looming...also many mobiles come with LBS (Location Based Service) and GPS.

I think Route Guru should be ported to mobile, using Google Ajax mobile technology which is free and open source.

Overall an excellent idea with great potiential and right timing. Good work Avinash :) and congrats to your team.

Need for a Single Sign On

I just redeemed a gift voucher of Rs 1000/- at indiaplaza.in , I had received it for my writings at sulekha.com . This is a good concept of cross promotions between web sites.

However, there is a scope for improvement. I had to register again at indiaplaza, which inconvenienced me, also added another password and user-id to remember! Oh No! Not another id, for God's sake.

So, is there an alternative? Sure there is one. No make it two.

The concept is called Single Sign On (SSO). There are many standards for SSO. The best is SAML.
Apart from being a standard, Google also uses it. You can find the details here:
http://code.google.com/apis/apps/sso/saml_reference_implementation.html

You you are a lazy programmer like me, you would find the open source enterprise quality at OpenSSO. Get the source code from https://opensso.dev.java.net/

The other simpler alternative is openid. Open id is a democratic alternative to Microsoft's passport. Thus the user can choose where one wishes to keep their personal details.

OpenSSO extensions supports openid.

So guys lets have a SSO for techTribe.com and sulekha.com, the sites I like!

Monday, June 18, 2007

Java ME versus Java EE as a Career Option

Jatin my mentee at techTribe, asked a question :

"can u tell me about the scope that j2me has in the industry?"

This blog entry attempts to answer the above query.
First J2ME has been re-branded as Java ME. So is J2EE as Java EE, and yes you guessed it J2SE is now Java SE.

Now that you have fallen in love with Java, (I fell for it when it was in beta circa 1997, and now happily married to it, though I have a mistress called C# :), after the initial infatuation stage, you will need to evaluate the career options.

First Java ME is heavily fragmented and most of the manufacturers support is as an afterthought. All these manufacturers have an alternate C++ SDK and their own custom options.
Nokia and Moto are two 400 pound gorillas in the mobile arena. Though these two support Java ME, they have their alternative SDK. Any real life application would have to use their SDK and be tied down to their platform. Moreover Sun has launched Java FX recently, which is targeted towards RIA (Rich Internet Application). Though Java FX is a layer over Java SE and ME, it does puts spanner in the Java ME's gears. talking about gears, it reminds me of Google..why? check out Google gears but that's another story and lets not digress.

Java ME has serious competition from RIA see Google API and apps for mobiles. Also Microsoft have been slowly and steadily been chipping away at the mobile OS market.

So Java ME is in its way out to join the Applet club (Going to Caribbean into the Dead Man's Chest, with apologies to the Pirates trilogy)

Lets understand why Java ME is going under. First, Google is leading a gang of RIA developers, the advantage of delivering an XHTML application with AJAX, is that most mobiles have a good Internet connectivity. Also distribution and lifecycle management is much easier. RIA apps can also remain offline and sync when network catches up, this is done by leveraging the cache technology.

The Microsoft's mobile OS initiative is more serious, since they have more at stake than Sun in this space.

That's because after Jonathan Schwartz took over, he buried the hatchet with Microsoft. So, no more mindless Gate's bashing. Also he re-focused Sun's strategy and Sun is now making ALL its software open source! So how does Sun makes money? Good question and answering it will answer your query as well.

Sun makes its money by selling high end servers, and that is not the dual core types but more like 128 cores :) Check out Sun Blackbox as an example. Sun is also very good at making apps runs faster on their Solaris and extreme hardware platforms. For example, I have a patent (owned by Sun), to make Java faster than 'C'. So Sun really does not make money on simple hand-held devices, but by selling high end servers.

Given that Java EE has a mobile extension for RIA (Ajax, xHTML) its more of interest to Sun if applications are delivered from servers than embedded inside mobile devices.

Thus if you are wanting to go for Java, go for Java EE not ME. Sun is more focused on EE.

Now when I read the Nokia's tag line "This has what computers have become", Sun's Blackbox comes to my mind and not Nokia's N series.

I hope I have answered your query.

Sunday, June 17, 2007

Intellectual Capital

I have been concerned lately about the unsustainable business model followed by most Indian software companies; excuse my language, but I call the model Software Coolies model. [1]

There are two major issues with the coolies model, first the growth is unsustainable, see the blog [2]. Second, other low cost destinations are emerging. The hourly rates are under pressure, the Indian software talents are demanding more salaries and the rupees is appreciating.

So, we have two options, one to keep running the rat race of labor rate arbitrage, by moving to class B and C cities, opening development centers in Eastern Europe and Jakarta and so on. Train more people to increase the manpower supply and other such mundane no brainers.
But that's a losers' game, at worst when played with your customers or at best, a win-loose kind of a game, that you play with your employees.

So what the win-win strategy? The idea is to increase the Intellectual Capital [3].

However, unlike Thomas Stewart, I would like to define Intellectual Capital more narrowly.

Intellectual capital is about real money. I shall in my later posts muse more about the details of my Intellectual Capital framework. But for the purpose of this blog posting I shall define it in through a simple metrics. Since, what good is an elaborate theory, which can't be put to practice?

In a nutshell, its the leverage that knowledge provides to your employees.

The Intellectual Capital for an IT company can be measured by simply diving the turnover by the number of employees.

To repeat myself, I see a generally unsustainable trend in the explosive growth of the Indian Software Industry in general. Most of the revenue comes from T&M (Time and Material) model.

For example if one studies the balance sheet of the India's most successful and admired company, InfoSys, the 40% growth comes from 40% increase in manpower. Thus there is NO real terms of growth when seen from Revenue per Employee. Now look at the Revenue per employee of Uncle Gates' company or even Larry Ellison's company. If you multiply this figure with the number of InfoSys employees, the subtract this figure with the current InfoSys turnover, you will arrive at the potential for growth of InfoSys' Intellectual Capital !

So if we look at Apple, it has 18,200 employees and $1 million revenue per employee! that is, its Intellectual Capital is $1 Million.[4]

Compare this with InfoSys. It had 52,700 employees and $2.1 Billion in turnover, for the year 06-07 as per [2]. That is $2.1B/52.7K = 39,848 $/emp. Thus the Intellectual Capital is just $39K!

Now if InfoSys had the Intellectual Capital of Apple, then it would have had a turnover of $52.7 Billions!

If it paid back just 10% of its Intellectual Capital to its employee, then an average salary of an InfoSys employee would be $100K or nearly INR 40 lakhs per annum!!!

But how to achieve that fabulous figure?

The solution I propose is productizing the service. It comes in two flavors (or business models if you please).

The first one is the IBM model. whereby, IBM takes over the end-to-end delivery responsibility and takes a percentage of top-line revenue or a fixed cost based on a performance metrics. For example it charges Galileo GDS US$ 2 Billion for a guarantee of maintaining a sustained performance capability of 20,000 transactions per second (this was circa 1998). It takes 5 to 6% of Airtel's topline revenue for maintaining its IT infrastructure, including billing system.
This model is not confined to big ticket companies.

I knew a small company that was being paid by a Wall street banker, five years ago, US$100,000 per month, for maintaining a computational platform capable of calculating Black Shoal's Option pricing for NYSE selected derivatives to under 10 seconds. The startup had two programmers in India, and 1 person in US. Now the metrics have come down to sub-millisecond performance, and I am sure so has the price!

The second model is the Open Source model. Here a company or a group of people, develops an Open source product that is widely used and gets revenue in terms for providing alternate license, consulting (for example Redhat charges $150 /hour for JBOSS consulting, Alfresco charges in excess of $50,000 / pa for certified stack and scalability guarantee for its open source product.

You may say that's not an easy thing to achieve in practice! True, but then, is anything is easy in real life?

As Richard Branson says : "Screw it, let's do it" [5]

References:
[1] My previous post:

[2] Infosys employees strength : http://india.seekingalpha.com/article/37850

[3] Intellectual Capital, Thomas A Stewart ISBN: 0-385-48381-3

[4] Outsourcing... ET (Economic Times) Pg 22, Friday 15 June 2007.

[5] Srew It, Just do it. Lessons in Life, Sir Richard Branson. ISBN: 0-7535-1099-5

Thursday, June 14, 2007

Using Prolog to Find a Friend

I was just experimenting with the foaf (Friend of a Friend). So, if we have an RDF database Jena, and can store the aggregated foaf:knows harvested from Google. A Prolog engine can be then embedded inside the Query Engine. A knows() predicate can be build-in, that retrieves the foaf:knows values for a given person.

The following sample program can be used to determine if two persons directly or indirectly know each other.

/* predicate will be build-in that retrieves foaf:knows from the RDF repository */
knows(a,b).
knows(b,c).
knows(c,d).
knows(x,e).

/* Actual theory */
exists(X) :- knows(X,_).
exists(X) :- knows(_,X).

foaf(X,Y) :- knows(X,Y).
foaf(X,Y) :- knows(Y,X).
foaf(X,Y) :- knows(X,Z), foaf(Z,Y).

friend(X,Y) :- exists(X), exists(Y), foaf(X,Y).

The above program can be tested within any Prolog system, with the goal :
?- friend(a,d).

The above program is the bare bone proof-of-concept. It can be further improved by adding degrees of separation and common linkages of friends separation the two persons.

Thursday, June 07, 2007

India Eclipsed, Need To Get Our Shine Back

India IT is loosing its shine due to rising costs, I just read the news items in HT2 Business & world (Hindustan Times, 07June07, page 21) that TCS is planning to hire 5000 software professionals in Mexico; mainly to save cost.

Recently, as an acting CTO for a startup, I too decided to get a software module outsourced from eastern Europe. Believe me, we got good quality, fast turnaround at less than one fifth (Yes that's 1/5th) the lowest Indian quote!

Salaries in India has been sky rocketing, and rising rupees does not help as well. Not that I am against high salaries. People work hard and they have all the rights to get paid the highest possible sustainable salaries.

The problem lies with our Indian software leaders. We do not get out of our colonial coolies mindsets. Indians in 18th and 19th centuries we taken to South Africa and West Indies, by the Angrez to work on farm. Unlike their African counterpart in 15th and 16th centuries, who were enslaved against their will; the Indians willingly went along for some fast money. Recently too illiterate workers from Kerela go to Emirates as coolies.

The same model was followed by our great software leaders in 21th century, albeit in IT space. Indian intellect did shine the world. But we still had the old business model. We just remained glorified cyber coolies.

The software mughals of today, have earned the glory and the booty as labor suppliers , just like the slave traders did in 15th centuries. Only that they were whites trading black, and we are brown sahibs exploiting the fellow browns.

Analyze any balance sheet of the darlings of BSE (Bombay Stock Exchange). The 40% growth in revenues are backed by 40% increase in manpower! So, no real business model efficiencies in real term of revenue per employee.

Microsoft and other software product and productized services companies have much more revenue per employee. Their leverage is their IP (Intellectual Property).

Yes I agree! Doing product, or productizing services not easy. We are not here for a easy game either.

The software coolies mindset need to be changed, if we are to sustain the competitive edge and keep paying more and more salaries.

The leaders need to re-incarnate themselves into Intellectual property developers. Then and only then we can survive the next wave.

We have gained much experience working for the US, UK and EU. Now leverage that to create products and services. Also, we need to have our presence in the emerging markets to leverage the cheaper labor there; Or else, others will beat us at it.

hey guys! wake up! If you are a CXO then think about it and talk to your board of directors or investors.

If you are an employee, use email and blog power to convince your management to graduate to productizers. Or better still, MOVE YOUR OWN CHEESE. Chuck your cushy job, and start a company. If you don't move our own cheese, some one else will move it.

If you havn't notices till now, Our Iceberg is Melting (with apologies to John Kotter,)

Tuesday, June 05, 2007

Scan and deposit checks from Home @ Net


https://www.depositnow.com/depositnow/default


I came across the above URL through google ad. Being professionally interested in Banking systems, I looked at it. What they claim is that under Check-21 Act, http://www.federalreserve.gov/paymentsystems/truncation/ all one needs is a scanner and an Internet connection to deposit your check sitting right at home, I am talking about USA (just in case you did not notice the Check-21 Act URL :)

Back home in India, RBI has selected NCR for supplying the check truncation system. See:

http://www.ncr.com/solutions/payment_and_imaging_solutions/check_truncation/cheque_truncation_system.jsp
And
http://www.ncr.com/documents/RBI_Check%20Truncation.pdf

You can read more about RBI initiatives at : http://www.rbi.org.in/scripts/AnnualReportPublications.aspx?Id=433
It talks about check truncation, smart cards and RTGS.

Though as of now you can't scan a check at home and deposit it online, but most banks like ICICI Bank have introduced kiosks at branches that scan the checks and issue you an image receipts. Also you could use Internet banking and write an e-check and use RTGS (Real Time Gross Settlement) to transfer money between diffrent banks.

Having said that, the NCR system that they have implemented is quite old and not open in true sense of the word.
I think I will cover these issue in another post :)

Monday, June 04, 2007

Guy Kawasaki's Recording on Startup

Just found Guy Kawasaki's recording on tips for getting VC funding:
http://www.guykawasaki.com/files/mp3/raising.mp3
You MUST listen to it now.

Saturday, June 02, 2007

Appropiate Technology for Document Management for Micro Enterprise

Today Vikas, my techie friend, called me up to discuss he dad's need to manage a few thousands of documents that have accumulated over a period of 10 years or more. All these documents are important and most are legal in nature that needs to be crossed referred.

Vikas being a techie, like me, fell into the technology trap. We get carried away by the cutting edge technologies, without caring for the problem at hand. Once we get into the cutting edge, we bleed our resources dry :)

So, he saw my logic, when I told him that I had tried and failed to implement such state-of-the-art document management software for small enterprises. even these small enterprise, who may have a part time computer maintainer; is not equipped to maintain a sophisticated (read complex) document management system. Best is to use an appropriate technology.

Go for an HP scanner (Don't go for all-in-one types, just a simple scanner). Use its document scanning software, that has image to text capability. Use it to convert the scanned documents into PDF formatted files. These file are search-able using free PDF reader from Adobe.
Store them in a hiarchical directory structure, if you need to annotate use OpenOffice.org
software (its free and open source) to create a master document that links other pdf documents, and save it also as a PDF.

Archive these files in a DVD. Anytime you wish to search, just open the adobe pdf reader and search the scanned documents stored inside the DVD as pdf file.
Thus you don't need a system admin to maintain the archive. But if your need grows with the growth of your organization, then use Alfresco , also an open source Java based document management system. Its best of the breeds. I think I will take this up in another post.

(c) www.Ashish.Banerjee.name

Dynamic Configuration Management For Clustered Java EE

I have posted a tech. brief at http://www.ashishbanerjee.com/dyna-config-25may07.pdf
This technical brief, first describes the dynamic application specific configuration, then describes an use-case scenario. Thereafter, design constrains and solution architecture is described. Two
implementations are proposed.

Also a programmer's guideline is provided for using the dynamically configurable application parameters.

It is concluded that a JNDI wrapped LDAP store is the best solution, followed by Entity Beans and
finally by Java Spaces.

However, all the three implementations are transparent to the application programmer, who uses JNDI abstraction to access the parameters.