Sunday, August 31, 2008

Brain-driven Email Editor

Couple of days back, I thought of sending a mail to colleague about some task.
Since the team is virtually located across the globe, sometimes it matters to send a email
before the COB, so that I'll get the reply from the person across the globe (say in US) and
start my next day activity. But, Unfortunately I forgot to send that mail.
In the sleep, I got a dream that I typed the email with better facts.
As usual, When I woke up, I forgot what was the thought that i drafted in the email.
So...., I was thinking it would be very gratefull to have some kind of Email composer driven by brain thoughts.
On the otherhand, It may cause some disaster sometimes.
Say If I had a long arguement with my boss and was not satisfied with the boss decision and
it was some kind of fight, I may end up sending some email in my un-consious mind.
As we always workaround for the issues..., we can configure the so called "Brain-driven Email Editor" to save all the mails in the draft :)
So that we can capture the dream thoughts and we can review in the morning, scrap some mails, edit some mails, and send it...
What do you think...

Few things I try to follow...

I thought of sharing few things that I call as my Philosopies...


  • Have faith on U, If you don't have faith on U, Nobody will.
  • Think whether you can complete before taking up any activity.
  • Don't believe on words, Believe on actions.
  • Treat people as you expect them to treat you.
  • Same rule can neither be applied everywhere nor for everything.
  • Avoid dependencies until it is worth.
  • If you have problem in taking decisions, ask questions yourself to narrow down.
  • Observe yourself as a 3rd person and evaluate. U can't change few habits, but you'll know U better. If possible, try to improve yourself.
  • Fitness is lifestyle.

Who is the other person?

I read the book "The Google story" recently.

If you look at few companies who started with small footprint and

succeeded to become a billion revenue company, Each of those companies

was started by only 2 people.

So....., I am just waiting for the other person.

MyQuotes

  • "Live Richly... Don't try to become Rich... Else you might miss to live richly..."
  • "Business is not about selling what you have in your store... It is about selling what customer wants to buy..."
  • "Treat people as you want them to treat you..."

Travelling across the world...

Hi,

Are you ready for the trip?

I am not asking for one or two day trekking trip or something of that sort...

I am asking for about travelling across the world for years together...

A couple have travelled for 3 years...

Covered 60,000 miles...

visited 24 countries...

visited 4 continents...

crossed 122 borders...

burnt 3200 gallons of gas...

To get to know more about the vehicle used by them, the route travelled by them, the equipments used by them, check out their website .

Windows XP - Search in the Explorer is useless

Search in the the Windows XP Explorer does not search properly all the times...

I have faced this so many times, Sometimes it doesn't strike that XP search has some bugs and I end-up searching for that item in so many folders wasting time...

Eclipse Search is much better.... It searches properly and provides the results...

Indian Finance minister and Income Tax

There was a news that the Flat resellers will be watched out by finance ministry and the reseller have to pay the tax. Finance minister thinks that people are earning easy money in lakhs of rupees by reselling the flat in a year or two. So, Government also wants to earn easy money by catching these transactions.

But in reality, the Builders, and Real Estate folks are earning lot of money and most of them are not taxed. All the transactions are not documented most of the time and direct revenue.

A small real estate person who helps to find rental houses earns more than a software engineer nowadays in Bangalore. If he helps you to find out a house of 10K monthly rental, he earns 10K from the tenant and 5K / 10K from the owner. A smart real estate person can make a lakh rupees easily in a month.

Can the finance minister get the tax for these income???

And some professions like Medical, people escape paying the tax. Doctors who have clinic, charges 100 or 150 per patient, and if 50 patients visits him on a day, he earns approx 150000 to 225000 rupees per month. A reputed doctor earns more than this. I don't know how much tax they pay.

Can the finance minister get the tax for these income???

How many politicians declare their income properly and pay the tax properly?

Can the finance minister get the tax for these income???

Okay, as a salaried person, they deduct the tax on my salary before paying the salary to me, do I get the enough benefit???

Why don't finance minister introduce some schemes like:

If you have paid X lakhs of rupees, When you take a loan from a government bank, you will get Y% discount on the interest rate?, etc...

Migration from A388 to A1200


I bought A1200 a month ago, Phone is worth for that price.

I had Motorola A388, one of the first release in that product series.

It has improved a lot in that product series. Migrated the data from A388 to A1200.

I would like to share my feedback about Motorola A1200 (MING).
Let me first appreciate the new things...

1) The interface is much better than the previous versions.

2) specific options such as "select all" option is really helpfull.

3) Full screen mode in video player is really cool.
Now coming to the points that didn't like or it would have been better...
1) I cannot create more than 6 categories in contacts.

I didn't have any restrictions in A388. I think you have made the restriction

on this because of the display in the category list.

They would have solved this by adding a scrollbar to the category list.

I could not migrate all the categories as it is from A388.

Still I have 10 categories data yet to migrate :(
2) In the Motorola Phone Tools, the Categories are not listed in the

"Mobile Phone" side of the Phone Book Screen. It would have helped if

the categories are listed in this section.
3) when porting data from A388 to A1200, The column names for the contacts differs a lot.

The portability issue is not taken care. Hence mapping column names is manual and porting them is harder. Software is not user friendly on this case.
4) When we have a loudspeaker option, the phone A1200 still demands the headset

to plugged in for the FM radio. They would have added the FM Antenna within the Phone.
5) When the flap/lid is closed, the video player keeps playing but switches to only

voice mode. There would have added an option to play the vedio even if I close the flap/lid.
6) I am not able to play video ring tones.. Is there any way out?.

WHAT ARE YOU OPTIMISTIC ABOUT? WHY?

Are you optimistic about something? If so, Why?

Even if you are not optimistic, check out about others at

http://www.edge.org/q2007/q07_index.html#gardner

May be after reading fes posts on the above site, You might feel optimistic about something...

India poised to become second biggest economy

Good to hear that Indian economy will become the second biggest....

Read more about the report by Goldman Sachs....



Goldman Sachs Report in TOI News

Conference Bus in Bangalore

Lot of innovations happening in Bangalore because of the horrible traffic.

Excerpt from TOI Newspaper:

The Karnataka State Road Transport Corporation (KSRTC), has introduced a spanking new bus facility — Conference Buses. The bus, touted as the first of its kind, is, in a nutshell, a conference room packaged in a bus. Replete with television, LCD projector, audio-visual facilities, pantry, attendants to even bring in snacks, driver and co-attendant, fixed tables and swivel chairs, refrigerator, generator, these buses are the perfect antidote to a brick and mortar conference halls in five-star hotels. Check the following link for more details...

Conference Bus in Bangalore

Eclipse Plugin Installation with Callisto Discovery Site

Eclipse is pretty good nowadays in managing the plugins. You can easily install a plugin with all dependencies with the help of Callisto Discovery Site.

Click on the menu Help > Software Updates>Find and Install

>select "Search for new features to install" option
>Click on "New Remote Site" and enter Name and URL of the updatesite

example:

Name: AndroMDA Update Site

URL: http://andromda.org/updatesite

Then, select the site that you just added and don't forget to select "Calisto Discovery Site".

I hear you asking why?... Let me answer you.

The "Callisto Discovery Site" discovers all the dependencies required for the plugin that you are installing (example: AndroMDA IDE) and presents you for the download. on the presented list, you can select all the required packages and install once for all.

I remember the day when I read the pre-requisites of the plugin and download each and every dependencies such as GEF runtime, etc by visiting somany sites and then download the plugin that I require.

"Automatically Select Mirrors" helps you to avoid one more step, the mirror selection :)

Eclipse Tip: Cleaning up Package Explorer view

One day I and my colleague, Mahesh, was trying to avoid the unwanted contents displayed in the Package Explorer view of Eclipse.

Our project contains lot of library jars, which used to occupy whole area of the package explorer. The *.jar files are displayed in the view and a lot of time is spent in scrolling up and down trying to get to the relevant source files. With this handy tip, the *.jars files are hidden in the Package Explorer view and do not get in the way.

1. Open Eclipse "Package Explorer" view
2. Click the inverted triangle in the top right corner of the view window
3. Select "filters..."
4. Choose the elements that you want displayed/hidden in the view. I found hiding the project/external library jars from the display to be useful
5. Click "Apply" button for a cleaner Package Explorer view

Note : This works only in java perspective

Saturday, August 30, 2008

Generating Huge reports in JasperReports

There are certain things to care while implementing the Jasper Reports for huge dataset to handle the memory efficiently, so that the appliacation does not go out of memory.

They are:

1) Pagination of the data and use of JRDataSource,

2) Viruatization of the report.

When there is a huge dataset, it is not a good idea to retrieve all the data at one time.The application will hog up the memory and you’re application will go out of memory even before coming to the jasper report engine to fill up the data.To avoid that, the service layer/Db layer should return the data in pages and you gather the data in chunks and return the records in the chunks using JRDataSource interface, when the records are over in the current chunk, get the next chunk untilall the chunks gets over.When I meant JRDataSource, do not go for the Collection datasources, you implement the JRDataSource interface and provide the data through next() and getFieldValue()To provide an example, I just took the “virtualizer” example from the jasperReports sampleand modified a bit to demonstrate for this article.To know how to implement the JRDataSource, Have a look at the inner class “InnerDS” in the example.

Even after returning the data in chunks, finally the report has to be a single file.Jasper engine build the JasperPrint object for this. To avoid the piling up of memory at this stage, JasperReports provided a really cool feature called Virtualizer. Virtualizer basically serializes and writes the pages into file system to avoid the out of memory condition. There are 3 types of Virtualizer out there as of now. They are JRFileVirtualizer, JRSwapFileVirtualizer, and JRGzipVirtualizer.JRFileVirtualizer is a really simple virtualizer, where you need to mention the number of pages to keep in memory and the directory in which the Jasper Engine can swap the excess pages into files. Disadvantage with this Virtualizer is file handling overhead. This Virtualizer creates so many files during the process of virtualization and finally produces the required report file from those files.If the dataset is not that large, then you can go far JRFileVirtualizer.The second Virtualizer is JRSwapFileVirtualizer, which overcomes the disadvantage of JRFileVirtualizer. JRSwapFileVirtualizer creates only one swap file,which can be extended based on the size you specify. You have to specify the directory to swap, initial file size in number of blocks and the extension size for the JRSwapFile. Then while creating the JRSwapFileVirtualizer, provide the JRSwapFile as a parameter, and the number of pages to keep in memory. This Virtualizer is the best fit for the huge dataset.The Third Virtualizer is a special virtualizer which does not write the data into files, instead it compresses the jasper print object using the Gzip algorithm and reduces the memory consumption in the heap memory.The Ultimate Guide of JasperReports says that JRGzipVirtualizer can reduce the memory consumption by 1/10th. If you are dataset is not that big for sure and if you want to avoid the file I/O, you can go for JRGzipVirtualizer.

Check the sample to know more about the coding part. To keep it simple, I have reused the “virtualizer” sample and added the JRDataSource implementation with paging.I ran the sample that I have attached here for four scenarios. To tighten the limits to get the real effects, I ran the application with 10 MB as the max heap size (-Xmx10M).

1a) No Virtualizer, which ended up in out of memory with 10MB max heap size limit.

export:
[java] Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
[java] Java Result: 1


1b) No Virtualizer with default heap size limit (64M)

export2:
[java] null
[java] Filling time : 44547
[java] PDF creation time : 22109
[java] XML creation time : 10157
[java] HTML creation time : 12281
[java] CSV creation time : 2078


2) 2) With JRFileVirtualizer
exportFV:
[java] Filling time : 161170
[java] PDF creation time : 38355
[java] XML creation time : 14483
[java] HTML creation time : 17935
[java] CSV creation time : 5812


3) With JRSwapFileVirtualizer
exportSFV:
[java] Filling time : 51879
[java] PDF creation time : 32501
[java] XML creation time : 14405
[java] HTML creation time : 16579
[java] CSV creation time : 5365


4a) With GZipVirtualizer with lots of GC
exportGZV:
[java] Filling time : 84062
[java] Exception in thread “RMI TCP Connection(22)-127.0.0.1″ java.lang.OutOfMemoryError: Java heap space
[java] Exception in thread “RMI TCP Connection(24)-127.0.0.1″ java.lang.OutOfMemoryError: Java heap space
[java] Exception in thread “main” java.lang.OutOfMemoryError: Java heap space
[java] Exception in thread “RMI TCP Connection(25)-127.0.0.1″ java.lang.OutOfMemoryError: Java heap space
[java] Exception in thread “RMI TCP Connection(27)-127.0.0.1″ java.lang.OutOfMemoryError: Java heap space
[java] Java Result: 1


4b) With GZipVirtualizer (max: 13MB)
exportGZV2:
[java] Filling time : 59297
[java] PDF creation time : 35594
[java] XML creation time : 16969
[java] HTML creation time : 19468
[java] CSV creation time : 10313



I have shared the updated virtualizer sample files at My Google Site


Note: I had posted this article in JasperSoft site sometime in January, 2007.
They have revamped their site recently, I could not find my blog entries in the new site. Just reposting this article.

Link to Spring Aop Article

Good Article on Spring AoP.

Selenium IDE - Plugin for Firefox

I have come across a very good article on Selenium IDE, the plugin for Firefox.

This article explains how to record a simple test in the selenium IDE.

Appliacations for mostly populated/crowded countries

Normally I travel in train under un-reserved compartments. I usually go an hour early to the Railway station, buy a ticket, try to get the seat in the train, and travel. On that day, I reached the railway station little late. There was a huge queue to buy the ticket. Although there are almost 10 counters in Bangalore majestic station to issue the tickets, the counters are not enough for the crowd that travels. Usually it is normal in highly populated countries like India. This might be the same in counties such as China.

It is not possible to find a solution through operation research by optimizing the counters and the process considering the crowd. It cannot be solved just by increasing the counters.

Few people are trying to solve this problem, but in the wrong direction. I saw a ticket vending kiosk in the railway station, which accepts the credit card and issues tickets between important stations. Issues still persist with this solution:
1) It is similar to adding one more counter, which divides the crowd just by another provider.
2) This is not efficient as the person in the ticket counter, almost all first timers try twice or thrice to know the flow and get a ticket.
3) That Kiosk support only credit cards issued by restricted banks.
4) It is not so reliable, sometimes it does not work.

I was thinking while I was moving in the queue . I had enough time to think, it took 25 minutes to go near to the counter. Since everyone have the mobile phones nowadays and still the mobile phone density is increasing in India, why don't we develop applications in mobile platform and tie-up with Railways, etc. No one have to stand in queue :) . People can pay the money directly from their bank through the mobile phone and get the ticket in a minute instead of 25 minutes.

It is like providing a Kiosk to each one...

Similar solutions can be developed wherever their is a huge queue that cannot be handled just by increasing the providers/counters.

Writing a Book...

I was thinking of writing a book.

Today when I was browsing about the Spring AoP, I ended up on the blog site, A Spring Framework-oriented web-log. By Craig Walls, author of the book "Spring in Action".

I found a blog on writing a book.

In that I got the reference to PragDave's Articles on writing a book.

Might be quite usefull for those who want to write books.

How to make sexy buttons with CSS

This tutorial will teach you how to create pretty looking textual buttons (with alternate pressed state) using CSS. Dynamic buttons save you heaps of time otherwise spent creating graphics and will basically make you a happier person at the end of the day.

Read more at the site , where I saw this article.

101 Ways to Rock the Keyboard

If you use your computer a lot -- and let's face it, you do -- you've got to stop using the mouse if you want to be at all productive.

You know that. You use the common keyboard shortcuts. But are you maximizing your keyboard ninja skills? Rate yourself by seeing how many of the following 101 keyboard shortcuts you actually use.
Look at the shortcuts at the dumblittleman site.

Top 5 Web Startup Mistakes to watch out!!!

This article is really worth a read, if you are an entrepreneur.

Read the article in webworkerdaily.

Wednesday, August 13, 2008

Product Companies in India

Good and Proud to read the article

From the data that are revealed at NASSCOM's second annual Product Conclave:
Of the existing 371 software product start-ups since 2001, over two-thirds have been formed in the past three years. Of this, 100 companies have started their operations in 2007 alone.

Karnataka's Economy

Karnataka's economy grown by 7% in last fiscal. So...., Planning Commission approved $6.5 billion to implement development projects in Karnataka during 2008-09.
Hope to see a better infrastructure in Bangalore by next year :)

Adding to that, Yediyurappa said his government would try to achieve a 9 percent growth in the current fiscal, with special focus on agriculture and allied activities.

Check out the complete article @ http://www.siliconindia.com/shownews/45433/

Monday, August 11, 2008

MisUse of AJAX

AJAX is normally used to fetch the data and update part of the web page without re-loading the entire page. Sometimes, AJAX is misused by some developers.
If your product/project is totally based on AJAX, when you load the page, you invoke some web handler methods through AJAX to populate the initial data on the page.
When that web page functionality is enhanced, the developers keep adding additional AJAX calls to get additional data.
As the product goes through multiple releases, single web page might end up calling 10 calls just to populate the initial data, when the page is loaded. This is actually a misuse of AJAX.

Instead of making this mistake, developer can use the facade pattern and call one AJAX call and populate the page. That facade call can return a Map, so that it can be enhanced when the functionality of the web page is enhanced in the coming releases.
In the Javascript, the developer can access the initial data from the Map based on the keys.

But in some places, you might not use this facade call.
One of that scenario is the use of Complex AJAX UI Components. The components might internally make the AJAX calls, which cannot be controlled from the container page.
So, while designing the AJAX based UI components, the component designer has to double check whether it is worth calling the AJAX call inside the component or let the container page take care of the AJAX call and pass the data to the component.
If it is not worth making the AJAX call inside the component, it is better to design the component to take the data as an input from the container.