December 2003 - Posts

From this side of the fence.

Reading through the blog entries, i stumbled upon this entry by Sriram clearing out some of the misconceptions that people generally have. Started writing a comment for it but then realised that it was huge enough for a post. Here are my views.

A good thought well put by Sriram ! I am from Bangalore and most of my friends are here with me in different IT companies. Well does that mean that Bangalore is the thriving software city or the next silicon valley ! definitely not ! Companies have started looking at other avenues and cities which will provide the right atmosphere to start a new division. To name a few Hyderabad, Delhi, Pune, Bombay, Chennai, Chandigarh and Bhuvaneshwar are opening up to support such ventures.

I read a statement recently by Narayana murthy. Ok let me paraphrase what he said : "The employee is a liability to the company. Get attached to your work rather than to the company". Well i've seen that it is true in rather many a case when the company wants to squeeze all the work possible out of you and doesnt care much about the compensation in terms of culture and pay for the work. I think this whole notion has cropped up due to many companies outsourcing to India because of cheap labour and talent available here and in order to bring in more work eventually end up overtaxing the developers with all sorts of work. Eventhough it provides good oppurtunities and exposure, what lacks in developers in these companies is the attachment with the company that i see in most bloggers from MS. That includes me too :( but can't help it though.

Recently, Rory posted about “Jobs moving back from India” . Well i can understand how enthralling the news would have been to most people, eventhough it was later dismissed as another hoax. My point is that, the software industry, or be it any developing industry strictly behaves in sync with the survival of the fittest and the laws of change. Now it doesn't mean that Americans have lost their fitness, definitely not or neither does it mean that Indians have suddenly become uber-fit ! It is just that America has gotten bit by its own economic boom now and that the cost of living, the contract allowance, the industrial compensation standards, and many other benefits are expected beyond what the companies can afford anymore apart from being able to show a decent profit level !

hmm i perfectly agree with what Darell had commented in Sriram's post.

“Businesses are outsourcing so that they can get the same quality for less money. This is a standard business imperative in a capitalist society. Right now this benefits you, but eventually it will move on to some other "up-and-coming" nation, and India will be experiencing the same angst as US workers are now.”  

What he has said here is the undeniable truth and fact of the software industry. Or rather you could call it the law of the universe : “Follow the Path with least Resistance !”. Every country will face the same only that at different points in time ! How to solve this and implement the solution is where we have to be looking at rather than fighting or even cribbing about the current scenario.

I dont blame people who are crazy about going overseas say US or somewhere else on a software job just for the pay. All these guys have the notion of a cakewalk future, after working in US for about 5-6 years coming back to India and then settling here. Unfortunately, the culture i must say is radically different in these two places and people as we know dont like change and it becomes difficult to accept the truth that you can't come back to India and spend the rest of your life here. I've seen this happen quite a few times now and so i am totally against the idea about indians travelling to work overseas and then returning back to India.

And about the colleges and universities. Ok for people in US. let me ask you this : 'Is MIT and Stanford the only good universities over there ?'. Well the questions seems obviously absurd to even me but unfortunately people outside India do not realise the same about Indian Universities. To tell you frankly, there are not many bad colleges here and you could easily say with conviction that around 35 % of them produce quite a number of bright students every year. There is no need to be prejudiced about the whole scenario thinking that (cream from India == IIT). Nope change the vision please !

Well anyway these are my thoughts. My 2 cents to clear up the trash of prejudiced ideas and wrong notions that have existed so far about work in India. All comments are welcome !

Windows on Linux.

Check out this article on Linux world News : "Windows on Linux" - Unlikeliest Linux Development of 2004?. Pretty interesting read ! Also check out this Slashdot post that triggered it.

There is a spoof website which talks about a MS Linux which is a Linux OS modified to provide the functionality and flexibilty of the Microsoft products ... whoa ! Dont forget to see the last updated date : Thursday, April 13, 2000 along with the MS copyright symbol ( pretty misleading ! ). It also states that the MS Linux will ship in November 2003.

hmm now what are they trying to spoof here ??! anyone got a clue on this ? well it doesn't matter really as long as you can have a good laugh at some anti-MS guy's creativity to explicitly attack about MS's monopoly.

Simple math !

This snippet from vbCity .net.devcity.weekly, Dec 26 2003 newsletter struck a chord in a weird way in me again about the beauty of math which i have forgotten to think about for quite some time now :(

How Can You Inflate something to make it smaller?

When you give it a negative value.

I love this one! Although Inflate is designed to make something bigger (Oh, Duh!), you can employ it just as easily to reduce the size of some things.

Take this code for Rectangle creations, for instance.

'  Set up the graphics object, pen and original rectangle
Dim g As Graphics = Me.CreateGraphics
Dim p As New Pen(Color.Navy, 4)
Dim rect As New Rectangle(5, 50, 250, 180)

'  Draw it
g.DrawRectangle(p, rect)

'  Create a User controlled pause
MessageBox.Show("Inflate Me Smaller!")

'  Inflate with a negative value
rect.Inflate(-72, -42)

'  Draw rectangle with changed values
g.DrawRectangle(p, rect)

'  Optional: Remove original rectangle after a pause
Dim tThread As Threading.Thread
tThread.Sleep(1500)
rect = New Rectangle(5, 50, 250, 180)
p = New Pen(SystemColors.Control, 4)
g.DrawRectangle(p, rect)

'  Dispose of graphics object
g.Dispose()

Link Interface 20.

Some more links here.

  1. Generics in .NET - Part I - Writing generalized but still strongly typed code via Tom's corner. Also this article about Using ASP.NET HTTP Handlers to create a photo album is pretty good and talks about making good use of Handlers to create a good user effect !
  2. This post which is a try to define what a service is effectively and precisely is really interesting ! Check it out !
  3. Quote : Service in my definition is that software entity that is designed in isolation however provides near frictionless interoperability.
  4. Dino gives some tips and best practices for Data Access. Also if you haven't noticed, see his latest post on the upcoming articles on MSDN mag !
  5. Another good news : Microsoft Patterns Are Now Available in the MSDN Library

That's it for now ! Happy holidays and a very happy new year to all :)

ASP.NET - Download file issues.

hmm sorry about the trend that's been happening on my blog lately .. Got caught with lots of work and have loads of things to blog about now .. Keep reading. Ok back to business . Here's something which i faced recently ! Another ASP.NET problem which you will definitely get stuck into pretty soon if you have requirements to download files created on the fly.

Here's what my code looked like to enable a file download on clicking on a button.

   string ExportData = "" , Filename = "", ContentType = "";

   ExportData = GenerateCSV(p_omyDataSet);

   ContentType = "application/octet-stream";

   Filename = "CSV View.CSV";

   Response.Clear();

   Response.ContentType = ContentType ;

   Response.AddHeader("Content-Disposition", "attachment; filename=\"" + Filename + "\"") ;

   Response.Flush();

   Response.Write( ExportData );
   
   Response.End();
   
Here i generate a CSV file dynamically and then render the same by changing the Content-type for the Response. Well sounds pretty easy doesn't it ! hmm yeah logically this should have worked beautifully without any problem ! But the hang up is that, since the content-type of the response has changed, the browser will think that this page will not be compatible anymore for the current content-type and so will throw an error on any subsequent operations you do on the page.

I had some javascripts on the page which should have worked in the background once the page renders but i was getting an 'Access Denied'
error ! Didnt get the feel of it for a long time until i figured out what was going on in the background ...

I dont know how i got stuck into a situation so very simple and made it complicated but then isn't this all the code that is necessary to get the job done ?? Where am i going wrong ? I searched some newsgroups, googled around for a more elegant solution but then couldn't find any with the time constraints i had.

Implemented a workaround instead to get the job done for now ! Using a hidden IFRAME and then sending a request to download the
content in the IFRAME because of which only the content-type for the IFRAME changes and the page itself works normally. Also it gives the impression of a background operation (async) and the user can work normally on his activities in the foreground until the Download File message box is thrown up with Open and Save options ...

Any better way of doing this ?? If someone has a very elegant solution feel free to post about it here ..

Nobel Prize !

Well you have definitely heard about Nobel Prize but do you know about Ig Nobel Prize ??

Check out this link about a Beer paper that won the Ig Nobel physics prize last year !

For more on the Ig Nobel prizes, check out this link. You definitely don't want to miss out the kind of funny things people do research for a life time ! After reading this, all thy intentions for research will go down the drain if you are just a budding researcher ...

XAMLON !

For those of you, who have not yet had a glimpse of the new technologies been shown at the PDC, a consolation has arrived ... Well i don't know how exciting this could be to the crowd but i am feeling jumpy already ...

There is a beta version of a software which can parse XAML files and then show the UI to the user in WinForms. Actually no magic here, just use a XmlTextReader, parse through each of the nodes, use Reflection and then create controls and add to the parent ! Voila .. You get XAMLON ! It is a framework which precisely does this although i havent checked it out how it works ...

What is Xamlon?

Xamlon (pronounced "Zamelon," which rhymes with "avalon"), is a XAML runtime library for the .NET Framework 1.1. Xamlon is not a 100% XAML compatible library, it was not designed to be, but rather uses the same syntax as XAML to provide the same power and capabilities as XAML but for building "Windows.Forms"-based applications instead.

Kewl huh ... Now i have something to muck around with in my free time to understand ( well to some extent ! ) the schema and how XAML elements are arranged !

Ok ... Where is the serial number now ??

Link Interface 19.

Out of touch, out of contact and waiting to burst out with ideas and things to say .. So stay tuned for more posts here .. ugh .. cant beleive i haven't made a decent post in a long time ! Here are some links for now ...

FeedAggregation Engine.

Me and Kris have been working on a FeedAggregation Engine which will get feeds as specified in a BlogList XML file and will aggregate them asychronously to provide it in the format as requested by the consumer. Right now, the engine works pretty well with RSS alone and am working still with the classes given by Kris to provide support for ATOM and other kinds of feeds.

In the meanwhile, Brian had read my post about how miserably, the effort to produce a GotDotNet Aggregated feed had failed and requested me for a latest version of the code :) i sent him over the new build of the engine which is much more stable and flexible now. Will blog more about this in detail later.

For now, here's the feed hosted by Brian providing the GotDotNet Aggregate RSS feed.

Happy blogging.

Printing confidential docs.

A non .NET helper fact ! Sorry about that but this will save you lots of trouble on corporate policies and stuff ... Got this forwarded in our internal mailing list about printing confidential documents which can be made secure and private to you in the print job.

If you want to print a job that is personal or confidential, and you do not want anyone else to see it, the printer can hold your job in memory until you arrive at the printer.
 
Steps to follow:
1) Printer properties -> Setup -> Click on "Print and Hold" button
2) Select "Confidential Print"(give user name and pin)
 
Go to Printer:
1) Press Menu until you see your user name, and then press Select.
2) Enter your four-digit pin using the numbered buttons on the operator panel.
3) Press Go to send the job to printer.