Shhhh… someone’s listening to us!

August 13, 2010

The world is abuzz with BlackBerry being threatened by governments. The Indian government, the Saudi’s… everyone seems to be behind them. While RIM has so far maintained they want to cooperate with the governments but advocate citizen’s privacy, I think they’d eventually concede to the government’s demands. After all, it’s millions of customers are at stake. They just can’t afford to lose vital markets such as India and the middle east. What’s unclear is, to what extent will RIM compromise with our privacy. The operational side is going to be interesting (and maybe it’ll buy RIM some more time).

That said, I see a pattern here. Google vs China, RIM vs India, RIM vs Saudi’s. And some are now mulling this being extended to Skype and other communication services. Now that is when it starts getting a bit illogical.

They want to watch over your (and mine) shoulders no matter how private we think our conversation is. Think about someone eavesdropping when you are discussing your personal finances with your wife? It could be even more private than just finances… you get the idea. To me, it seems illogical. The government of course says it is going to operate on specific intelligence and not watch over everyone. But hey, if that is true, why do you want RIM to handover all encryption information and master-keys? You could simply ask them for specific pieces of info when your intelligence prompts you.

This is like each country is now implementing it’s own version of patriot act. It’s is needless to say that the loopholes allow the governments to practically sniff all of our communications. Is that ethical? May be dictionaries around the world will be altered to have new definitions for ethics and privacy.

Is the government going to read this post? Hell, I don’t care. I live in India and I have the right to voice my opinions. And of-course, there is no stagenorgraphed message in here anyway. One could call this paranoia. Maybe it is. If I become overly paranoid, maybe I’ll start using stealth techniques when discussing private things over the web. Will that guarantee my privacy? No! NSA, RAW, IB have great code-breakers and they sure will sniff things out. But giving them hell of a time is quite amusing in itself. Isn’t it! C’mon guys, don’t snoop my comm… There are better things you can do to make us secure!

delegates and events. When to use what?

August 02, 2010

 Non-edited version of a community thread to which I replied (names and email addresses removed for privacy)

Question:

Hello 

  i have doubt in c# ( 2.0) regarding delegates

1) i heard that delegates can exhibit call back functionality,can anyone explain that with a piece of code

2) Delegates & events can both call a function ,so whn to use delegate n event

pls help me with a piece of code

 waiting for  ur reply

Thanks and Regards

ABC

Answer:

Events require delegates.

 

Let me try and offer you a little more insight. I am afraid though, much of it would be theoretical.

 

Delegates can be loosely translated to function pointers from the native programming days (only this time, they are type safe and verifiable). They are a general purpose callback mechanism. You could use delegates for any kind of callback functionality.

 

Events on the other hand should be used in more specific scenarios. To be precise, you should use events when there are other components that are waiting for your component to do something, when you are writing a library and you want your callers to have the ability to dynamically attach/detach delegates for a particular functionality and more importantly, when functioning of the library does not depend on what the delegate (event handler just to disambiguate) does when called. When using events, it should not matter to your library, if there is a delegate attached or not. You should be in a position to continue executing your code.

 

Here are a couple of scenarios:-

  • Sorting library:
    • Your library implements a generic sorting algorithm and can operate on any type. Except, it can't really compare two instances (obviously since it does not know the value contained by the instances). For simplicity, assume that IComparable did not exist. In such a case, you would depend on the calling code to be able to provide you with a mechanism to compare the two instances. In this case, you can safely use delegates. You don't have to raise events since raising an event means something of interest has occurred (which clearly hasn't happened here).
  • Order processing lib:
    • Your library processes orders and creates invoices. Certain other components in the system would want to do some more processing when an invoice is created (e.g. update a dashboard etc). In this case, you should go with events. Since your component does not really depend on the functionality offered by the components who are interested in knowing if an invoice has been created.

 

Updates on Taatya

December 06, 2009

Life changes dramatically after you have a kid. So is happening with me. I tend to spend more and more time with family than look at anything else.

Some of you may be aware of the tough times that we went through when Taatya was born. All of that is still fresh in our memories and we pray that no parents in the world have to go through something like that.

The good news is, that Taatya is progressing very well ever since (“touch black” my wife would say)!

Here are a couple of videos of Taatya-

This one is actually a compilation of two videos. The first one was shot about 4 months ago. He wasn’t well and had high fever. We had to rush him to the hospital at 6 AM in the morning. This video was shot at about 1 PM in the afternoon after the fever had subsided. The second one was shot at some random time!

 

And this one was shot about a month ago. He wasn't very enthusiastic about crawling (it was just 7 in the morning) but I managed to get him to crawl a few steps!

Scratching the surface of .net Reflection

September 23, 2009

Someone asked me if it was possible to find out all the types that a given .net type references. Something similar to Assembly.GetReferencedAssemblies() which returns all assemblies that this assembly uses in turn.

Surprisingly, I did not find anything pre-existing (or maybe I didn't dig deep enough!).

So, I wrote some code to do this using the reflection API.

You can download it from here.

There is no documentation in the code. Will post the details here sometime later.

PS:

1.       Note that this is just some random code that I wrote in less than an hour with almost zero testing. If this is what you are looking for, I would recommend you do some serious sanity testing before using it.

2.       The code may not satisfy all the scenarios. You may need to add more descriptor methods for additional member types.

 

 

Using a computer for the first time

July 17, 2009

Well, found this video somewhere while surfing the internet. Apparently, the lady is used to a type-writer and is using a computer for the first time.

Must watch!

101 April Fool ideas

April 01, 2009

You may remember my last year’s April fool post. Well, that was just one of my crazy April Fool ideas. I have a huge list of them actually.

On this April fool day, however, I am not going to use any of them. Instead, I am going to give them away, so that you can use these ideas to fool others.

Here is the April Fool Ideas document.

PS: You don’t have to be a blogger to use these ideas. Some of them are very trivial and you can easily implement them at home/college/office.

LiveJournal Tags: ,

NASA and Microsoft to Make Universe of Data Available to the Public

March 25, 2009

Yesterday, Microsoft and NASA announced a technology agreement under which NASA will make available its huge amount of content comprising of high resolution images and data through Microsoft’s technology. The content will eventually be available for end user’s to explore through Microsoft Research’s  World Wide Telescope.

One more step towards making the universe accessible to the common man!!!

BTW, WWT is fantastic even with it’s current databank. Feel free to explore the universe in high definition!

Obama's star begins to fade - The Times of India

March 24, 2009

When I watched a video coverage of a speech delivered by then Senator Barack Obama, I was totally flattered. I was convinced that this is the man who will change the world. His promising and soothing appearance almost made all problems fade away from the mind. It really looked like he had a vision.

But soon after he became the president of the United State, things started going from bad to worse. With the economic recession deepening further and economies across the world trying to dodge total collapse, Obama has some really tough challenges ahead.

He sure talks good. And for a moment, it seems everything is going to be alright. But over a period of time, I have started becoming sceptical. I am now beginning to doubt if with all these challenges thrown at him, Barack Obama can really bring the change he promised – to America and to the world.

I am of course not the only one thinking in this direction. But what made me blog this today is this article in the Times of India-  Obama's star begins to fade - US - World - The Times of India.

It’s a little lengthy, but worth a look.

LiveJournal Tags: ,,

RGIA, Hyderabad among top ten airports in world - MSN India News

March 23, 2009

Rajiv Gandhi International Airport in Hyderabad that began its operations last year has been ranked 5th amongst airports across the world.

The airport indeed is very nicely constructed with future in mind… India sure is shining! Umm… at least urban India.

Here is the link to the main article-

RGIA, Hyderabad among top ten airports in world!

Back to Top