Thursday, November 25, 2010

Believe It or Not

Yet another attempt on Kavidhai. I was hearing many complaints from my friends off late on how hectic their routine life turn out to be especially in India! Though many of the following might not hold good for this generation couple there are few exceptions who makes others life quite hectic..

A sneek peak on life of middle class working women

மங்கையராய் பிறப்பதற்கே நல்ல மாதவம் செய்திட வேண்டுமடா
மாதவம் அல்லாமல் மகாஷக்தியும் தந்தருள வேண்டும் அந்த பராசக்தி
கிடிக்கி பிடிக்கவும் வேண்டும் நன்றாய் code அடிக்கவும் வேண்டும்
Office tension இருந்தாலும் சிரித்து பேச வேண்டும்
ஆணுக்கு நிகராய் உழைத்தாலும் அவனுக்கு நிகராய் பேசாது இருக்க வேண்டும்
இரவெல்லாம் கண்விழித்து உழைத்தாலும் காலையில் விரைவில் துயிலெழ வேண்டும்
தனக்கென்று அந்தஸ்து பெரிதாக கிடைக்கவிட்டாலும் எல்லோரையும் அரவணைத்து செல்ல வேண்டும்
வெளி உலகத்துக்கு boldai இருக்கனும் வீட்டில் பணிவாய் காரியம் செய்யனும்
Mode select பண்ண கூடிய ரோபோவாக இருந்தால் எவ்வளவு நன்றாய் இருக்கும் !?
வேலை செய்யும் பணியாளாக
திறமையை காட்டும் கணினியாக
உழைக்கும் திறனுள்ள கருவியாக
நல்ல ஆசானாக , அம்மாவாக
அனால் feeling இல்லாத ஒன்றாக (for consequences watch Endhiran movie)
வல்லமை தாராயோ பராசக்தி !

Thursday, April 01, 2010

Software Sonnet-2

I have never realized so far that i can attempt writing the so called poems. Birthday was a good starter to kindle my thoughts :) Here is another attempt made on the topic 'SOFTWARE'

Software, the most uttered buzz word
May sound like the mantra of this busy world
Salary is the prime factor people have heard
Hard to realize the sacrifices of busy bird(s)

When sub-prime peeps in the door
When Recession hits the floor
When Loan alarm breaks your snore
When you are supposed to slog more
When there is no one to help you for sure
Then is when you realize SOFTWARE is not a fantasy floor
Simplicity comes as a remedy to cure
And the least expensive investment is your knowledge store !!

Tuesday, March 23, 2010

Birthday Special

Sri has promised me to write a post on this. Before time permits him to do so, here are the verses

Kavidhai:

Though miles apart, you stay closer to my heart
Whenever i think of you, I hear the word 'Never Depart'
On this Birthday, my sweet heart
I wish you a wonderful start
We know Life is an Art
And I am sure you have mastered it a Lot.

Badhil Kavidhai:

Metres and Miles will never get us Apart
Forever you think of me, you never will hear the word Depart
Since the Day we met at the Mart
We had a wonderful head Start
For the Life we know as Art,
And What better day to remember it, you smart!

Saturday, January 30, 2010

Download to Excel

Albeit plethora of approaches traditionally followed, the one that impress me is the following.

Assuming datasource is readily available in hand, all we need to do is to export a part of the contents of the result set.

A handy and pliant approach to Download the page contents to Excel using ASP.Net is directly setting the dataset as a source for the response data. There is a small glitch in this as we have to disturb the code every time whenever the data source of the dataset is changed. Instead we can loosely couple this architecture by using XSL in place, provided the XSL file should be in a location which can be directly modified even in PROD similar to config files.

.Net snippet to achieve this:

Response.ClearContent();

Response.ClearHeaders();

Response.ContentType = "application/vnd.ms-excel";

Response.AddHeader("Content-Disposition", "Attachment; FileName =TestDownload);

Response.Charset = "";

XmlDataDocument xdd = new XmlDataDocument(oDS);

xdd.InnerText.Replace("\"", "'");

XslCompiledTransform xt = new XslCompiledTransform();

xt.Load(HttpContext.Current.Server.MapPath(C:\\Excel.xsl");

xt.Transform(xdd, null, Response.OutputStream);

xdd = null;

xt = null;

Response.Flush();

Response.Close();

this.Dispose();

XSL file can be used to control the display of the Excel including the column that are required, format , style etc.,

Wednesday, January 20, 2010

AutoComplete Search

Auto Complete Search is a good to have functionality to ease the search for a given context . Before deciding on the approach, lets first examine the data source from where the auto complete list needs to be populated.

case i) Data is available in the web page already and needs to be listed upon search.

In this case instead of caching the dataset or making the page heavy by storing the dataset values to maintain across postbacks, the suggestion list to be displayed can be built as a JSON structure.

JSON is a format in which the values are stored and is very easily accessible in the form of objects in the client side.

case ii) Data is not pre-fetched and needs to be rendered on the fly. In this case a definite server side call is required either synchronously/asynchronously. Here we can make use of the ASP.Net autocomplete feature. It requires a reference to the Ajax Extender control toolkit.
Here we necessarily need to call a web method with the default parameters mentioned in the syntax including the casing. So what about customization here?
Well, we can address it using the bridge method with the default parameters and then calling the custom method with the required set of custom parameters from there.





Wednesday, June 24, 2009

Language Settings Issue

When you press shift key for a long time then the key press will be reflected in the output in a different language.

This language setting will be displayed in the bottom pane in the language bar.
EN : English
CH : Chinese
JP : Japan

To view the output in the expected language, click on the appropriate language. (EN for English).

Wednesday, June 17, 2009

WebService and XML parsing error

While consuming webservice, we need to be very cautious and ensure that the data what we pass is absolutely in the right format. i.e the webservice must be able to parse.
Say for example, you have some query and it returns perfect while testing in the backend. But when you consume the same data in the front end application through the webservice you will get a parse error something like this.

Error in XML Node(5,20)


The reason is either the object returned from Webservice is not serializable, or the data returned from the backend has values which couldn't be parsed by the webservice.
Eg: Consider connecting to DB2 for data. If the fields are not properly intialized at the backend, it will fill in the remaining space by low values which are not parsed by webservice and hence the error.So trace it at the backend before jump starting on debugging the front end application.