2.9.09

jQuery issues on partial postback

While using jQuery we are used to writing all the logic inside

$(document).ready(function() {

//jQuery functions and logic

)};

Inside this we use notation like $(.classname) etc to get the element variables instead of using the traditional clientid's to refer as in Javascript.

The problem with this is that the id's wont be bounded on partial post back while using ajax etc. This is because DOM elements changes are lost on postback

So insead of loading on document.ready use add_load as below

Sys.Application.add_load(function() {

//jQuery functions and logic

)};

This should resolve all the issues associated with jQuery not working on partial postback

21.6.09

palm prē Vs iPhone

iPhone was the benchmark for phones ever since it was released and every phone released after that with a touch screen were pitted against it unfairly.

I personally liked the iPhone and give credit to apple for taking the mobile industry into a new direction which was much needed. Mobile phones were beginning to just add more and more 'features' and iPhone fulfilled the need for a true mobile computing device.

For me iPhone was more of a true mobile computing device and was mis-marketed to fool the consumer as a phone so that they would carry this as they already were used to carry a device named cell phone in their pockets. Then they introduced the appstore and unlocked the potential of a smartphone. Basically they put the smartphones into the hands of the common man.

Ok, enough praises on apple. I never liked apple for its high prices and insane fanboys who would buy anything that apple makes and be their free marketing scout. But as a gadget freak I support anyone who innovates and brings things to the common man at a reasonable cost.

The ailing PALM after much talk finally fired their silver bullets palm prē and Web OS.

I never owned any of these two, but got a chance to get hands on since my friends own both of them. I always liked iPhone and was waiting for my t-mobile contract to end. But with the entry of Palm everything changed.

Boy!! What a device it is. I can sum it up in a single sentence

"prē is all what iPhone is and looks better than iPhone and has dimensions practical to carry in the pocket"

While there are some people who already own the iPhone and who haven’t ever touched a prē but claim that the prē sucks. It will be a difficult task for prē to fight against this publicity. The crowd buys iPhone because it's Apple, and it is difficult to convince the clueless crowd that there exists another phone better than iPhone.
Plam needs to work on releasing the SDK soon and improve their app numbers, brand the prē better and niche. Hopefully next year when prē is released on a better network a.k.a Verizon, people used to ATT would realize how big of a difference can a network do for their data enabled phones.

Competition is always good and the consumer benefits from it. I really hope prē succeeds against all the negative campaign and there would be true competition in the market.

Disclaimer - I own none and I use a HTC. I always support innovation and believe that a good product needs the rightful attention irrespective of the company which makes it.



10.5.09

Charts in ASP.NET

Recently I was working on a project to show metrics in graphical format in a web application. After exploring the possibilities of using all flashy technologies like silverlight etc we finally went for using the Microsoft Chart Controls.

We hear about technologies and solutions all the time and read them in books and articles, but we only realize the ease and power when we work on them. I am sure everyone working in .net would come across a situation where the user wants his data in graphical format. I must say, this is THE solution for anyone trying to provide charts to your users in ASP.NET.

Apart from being flexible, the best part I liked was the complete detailed examples which they provide in a single solution which makes it so much easier even for those using it for the first time.

It requires little or no learning for existing .net developers as they are just extension controls. The development is a breeze with the complete knockoff examples they provide.


2.5.09

Lessons from Susan Boyle

There are already too many people praising her which she rightly deserves, so I won’t be doing that again. Instead, I think we need to learn two important lessons from this whole episode



1. It is a perfect example of "Do not ever go by looks alone"
You never know the real potential of a person unless you see his/her work. We live in a world where looks are so important and this once again proves that we are wrong.

2. Keep the expectations low and surprise people to exponentiate the appreciation.
She knew that she was gonna blow away the audience and she kept a low profile. It’s not that she would not have become so famous otherwise, but it brought that element of surprise and tremendous fan following.


11.4.09

jQuery

"Javascript needs to go and something new needs to replace it" this is what I said to anyone who talked about javascript. Though I knew the advantages of JavaScript I was always bugged by the simple mistakes we could make and get those ugly errors. We also had to write extensive code to implement some complex logic.

We started implementing jQuery today and I must say, I was totally blown off. Its such a simple solution and yet powerful that it knocks off all the issues/mistakes which a developer writing javascript would make.

Below is the link which I am using to learn jQuery. Start with the beginner examples and it should be easy from there.

Learning jQuery

I will try to post more on jQuery as and when I find something good to share.


6.4.09

Javascript to correct case for Name fields

Though this might be a simple script, I felt it always good to share a re-usable code

Text Entered - o'reAlly jack daniels mc donald
Changes to - O'Really Jack Daniels Mc Donald


function CorrectNamingCase(control) {
var pattern = /(\w)?(\w*)?(\W\w)?(\S*)/; // a letter, and then rest of word, special character word, none or more letters

var a = control.value.split(/\s+/g); // split the sentence into an array of words

for (i = 0; i < a.length; i++) {
var parts = a[i].match(pattern); // just a temp variable to store the fragments in.

var firstLetter = parts[1].toUpperCase();
var firstWord = parts[2].toLowerCase();
var specialWord = parts[3].toUpperCase();
var restOfWord = parts[4].toLowerCase();

a[i] = firstLetter + firstWord + specialWord + restOfWord; // re-assign it back to the array and move on
}
control.value = a.join(' '); // join it back together
}


15.3.09

Automotive Family Tree

For anyone who wants to know the worldwide automotive companies and their relations the below link is a very useful one.

The original 2008 version was published by Jalopnik and that is extended at the below website. This latest 2009 version includes most of the Asian manufactures too.

Automotive Family Tree