Saturday, March 26, 2011

Some CEO knows how to make headlines (but not by doing his job)

According to this CEO, .NET sucks!
What a news! Microsoft has become the new IBM, and open source is the new kid on the block!
I can see this cycle repeating several times now, from IBM to Digital, then to Apple, then to Microsoft, then to Open Source. This is just a natural evolution of the software industry, and it behaves more and more like fashion industry. Open Source is the new Black!
Despite headline grabbing capabilities, there may be some truth to his speech. The fact that few startups use Microsoft do pose a valid question, but the answer sure is not that .NET sucks. .NET is very much up-to-date and still runs at the front of innovation, introducing new things, especially LINQ (Rx and Parrallel LINQ are two of my favorites).
The main reason that .NET is not used widely by startups is: Microsoft costs. Given a choice, many would love to skip the license cost of several thousands and run for a free product, say Linux and MySQL. Language is not the problem here, cost is. However, many argue that the hidden cost of Open Source is not understood fully when these decisions are made. Also, it is kind of funny that you are willing to shell out at least $100k for someone (supposedly) good, but frown upon $5k of industrial strength software.
The main problem is talent. Any good talent, no matter what language is he/she working on, costs. And there are always bad Open Source programmers, as long as they got paid. A good measuring stick of a talent is that if the person does any (for free) sidejobs besides the main one.
During my whole profressional life, I have seen preciously few talents. But what languages do they use are definitely not one of the deciding factors!
Oh, and on top of that, a .NET programmer is better than a Ruby on Rails guy, according to him.

Thursday, March 24, 2011

Oldie but goodie: WSE for .NET framework 2.0

If you are still stuck in the .NET 2.0 world and want to use WS-Security, here is the rescue:
WSE 2.0

Something new again (Two-way SSL Certificate for Web Services)

1. The Intermediate Certificate should be in the Intermediate Store for IIS, otherwise it will not be able to verify the chain of certificates.
2. The certificate store should be for Local Computer, not Current User. And
3. If it doesn't work, delete all certs, restart IIS and do it all over again!

Wednesday, March 23, 2011

Something new (for me) everyday: Easy upsert in SQL Server Integration Services

See here. It also mentions the "Instead of" triggers that are (apparently) there since SQL Server 2000. I can see some magical use of these.

Thursday, February 24, 2011

script tag

This is something that outraged me when I ventured into the la-la land of javascript... :)
If you want to have a <script> tag in html, it can not be something like <script .../>, as any self-respecting tag can do (and a valid scenario when you have a "src" attribute). But rather, you need to have <script ...></script>. This is nuts!
And the reason is that it is not conforming to the xhtml standard as it requires (#PCDATA), thus can not be self-closed...
No matter who comes up with this has to be a nutjob.

atdmt.com and all its troubles

I got a mysterious problem on my Windows 2008 Server R2 machine that drove me crazy. And it doesn't show up on other machines that I have. Here is the problem: When I log into Hotmail, for every email that I click, I will get a popup dialog asking for credentials. And it won't go away unless: Either I click cancel, or if I enter some gabbage and click OK, it will popup again for a total of three times. And the whole thing starts all over again once I click another email. Add insult to the injury, this problem is with every browser that I try.
This behavior is very close to, actully the same as, the behavior for a NTLM enabled website. This makes it bizarre as no sane website would do this on the internet. I did a tone of googling on "hotmail atdmt" and various combinations. And the only result I got refers to the atdmt tracking cookie, which is not really related.
So I finally got fed up and decided that not able to view hotmail is a big deal for my development machine. :). And fired up fiddler on two machines to compare what is going on. And here is what I found:
1. The h.atdmt.com reference was redirected by h.live.com.
2. The h.atdmt.com returned 401 Unauthorized and ask for either "Negotiate" or "NTLM". Another funny part is that it is an IIS/7.5 with Sharepoint 14. (wink)
3. On the "good" machine, this same request will be actively rejected by the host. (wink again.)
4. And finally, the IP address of h.atdmt.com is "127.0.0.1", for both machines!
Everybody knows that "127.0.0.1" is the local host. And that's weird. I tried ping it and get the same result. There is no proxy on my machine so it must be happening from DNS server. But why?
Before I start to venture about the answer to the question, this phenomenome is explained well by the facts that:
a. I have a SharePoint 2010 installed on my local machine and it requires NTLM.
b. There is no webserver on the "good" machine.
So when a request is made to h.atdmt.com(127.0.0.1), the XP machine ("good" machine) rejected it immediately while the 2k8 server replies with 401 and indicates for NTLM (or Negotiate). And the clients faithfully ask for credentials every time!
What I guess the reason this is happening is: For some reason, the central IT people wants to block tracking done by atdmt.com. And what they choose to do is returning 127.0.0.1 when asked for atdmt.com, thus blocking it at DNS level. And unfortunately, hotmail has a love affair with atdmt and try to track every email click that way. And, because I am a developer and have a NTLM enabled website, I got hosed.
Once I got the problem identified, the solution is simple. I added h.atdmt.com to hosts file and gave it an address not in the network. And it works good after that. Thank God, there is peace in the world again...

Thursday, January 20, 2011

Frustration with idiotic .NET Generics

Do you know ObservableCollection(of Object) != ObservableCollection(of ClassA)? Of course you do. But what do you do when you have a generic collection class that you want to generalize (pardon the tone twister)? You need to do a little converter function. However, if .NET can say ObservableCollection(of ClassA) isa ObservableCollection(of Object), life will be a lot easier.
Another thing it will fix is the need to create a non-generic class as the parent type of the generic class in a class hierarchy (to ease the pain of multiple "isa" call in trying to assert the subclass' type). So you can say:
If typeof o Is GenericClass(of Object) Then
instead of
If typeof o Is GenericClassUselessParent Then
to simplify the class hierarchy.