Archive

Archive for February, 2009

IE7 iframe and cookie hell!

February 19th, 2009

Recently I was working on a project which loads a third party domain webpage in an iframe. Everything looked fine except it started acting weird in Internet Explorer 7.

Later I realised that it was because of the default privacy settings (or rather annoyance) in IE7 which blocks third party cookies in iframes.

There are two ways to solve this.

  1. Change the IE7 settings to accept all cookies. This can be done by navigating to

Internet Options >> Privacy >> Advanced >> Check “Override Automatic Cookie Handling” and “Always allow session cookies”.

This solution is not possible if you are the webdeveloper. You cannot ask all users to change their privacy settings. So how can you over come this programatically? Look at the second solution.

 

     2. If you are the we developer then you can add p3p headers to the pages loaded in iframe. By doing this we are telling the browser that it is OK to create and maintain cookie values of the pages loaded in iframe. Adding the headers is not a tedious task. Use the following code.

PHP :

header('P3P: CP=\"IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA\"');

ASP :

Response.AddHeader "p3p", "CP=" & chr(34) & "CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR" & chr(34)

ASP.net :

HttpContext.Current.Response.AddHeader ("p3p","CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");

:>

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban ASP.net, php

Stackoverflow Favorites wordpress widget

February 18th, 2009

Do you love stackoverflow? Are you a frequent user or stackoverflow? Then why not share your Favorite programming questions from stackover?

Here is a wordpress sidebar widget that will make your job easy. Simply download and add the sidebar widget to your theme and your Favorite questions will automatically be displayed.

Usage :

  1. Download the plugin from here
  2. Open stackoverflow_favs.php and edit the userid on line 11 (You can get your userid from your stackoverflow profile url. Example : http://stackoverflow.com/users/12178/shoban
  3. Upload the changed file to your plugins directory and activate it.
  4. Add My Favorites from SOF widget to your sidebar from your widgets menu.

Do you have any suggestions? let me know :)

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Uncategorized, php

If the button says ‘dont click’.. dont

February 13th, 2009

yesterday I saw a few tweets in my friends timeline which asked twitters users not to click. The tweet also had a link. Even though I saw the same tweets from few of my friends I dint click it (May be first time I did something right :) ) .

Ajaxian wrote a post about about the tweets today and it seems that it was a clickjacking spam.

The page behind the tinyurl has a button that tells people not to click it – which of course they do. When they click the button they send the tweet telling other gullible people not to click the button – which of course those people do.

You can read more here.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban links

Are Indian Software Developers “Code Donkeys”?

February 13th, 2009

recently I read an interesting post in thoughtclusters which talks about indian software developers.

The recent 40th StackOverflow podcast with Michael Lopp had some pretty harsh words for Indian software programmers and the outsourcing industry in general. The transcript is incomplete, so you have to hear the podcast, but what I heard went something along these lines.

The cost of an Indian developer is one-third the value of the cost of a developer in the United States. People assume it is because of the lower cost of living in India. But that is not why. It is because the value is one-third. If they produced the same quality of code, they would be charging the same amount.

You can read the rest of the post here. One of the line which caught my attention was a comment about outsourcing.

Developers from India, sorry to say, are what I call “Code Donkeys”. They do crud, boring, repetitive nothing innovative business applications and in many occasions they need blue prints and directions on how to start. I have never seen any shrinkwrap software made in India.

Krishna@thoughtclusters have given some valid points to prove that this is wrong.

At first this seemed to be a little harsh comment and it was disturbing as I am a software developer from India and I work for an outsourced company. But after giving some thought about his comment for few minutes I realised what he said was right. I completely agree with the comment that Indian software developers are “code Donkeys“. I am glad that he is referring to only outsourced software developers as code donkeys. Now let me explain why I feel he is right.

Projects are very less in outsourced companies. Most of the work include maintenance of existing projects (not developed by the so called code donkeys) and this means there is very little room for applying new ideas or innovations. So developers don’t have any other choice other than follow the existing coding standard for maintenance and support. This reminds me of the Monkey and the Hat seller story :) so I prefer calling outsourced software developers as code monkeys. I have seen applications which use variables names like orange, blue, green etc. and these applications were not developed by the code donkeys in India but unfortunately these applications are supported by them.

Now here is another reason. Most of the outsourced companies have their own coding standards so new projects automatically follow the standards (Which is full of nothing but rubbish writeen years back). Most of the standards dont allow the developers to think outside the box or apply innvoative ideas. Again the reason for a bad application goes back to the outsourced company.

Now you know whay outsourcedsoftware developers are called code donkeys. Above are some of my personal thoughts. What do you think?

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Misc, links

Moonlight 1.0 Release

February 12th, 2009

Finally Moonlight is available for download. Moonlight enables Linux users to view Silverlight content and Silverlight applications.

Congrats to the team behind this ;) . You can read more about the the release in ScottGu’s blog.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Silverlight, Uncategorized

Passwords – Protecting your website series part 1

February 8th, 2009

Here is the first post for “Protecting your website” series.

Passwords! As you all know a password is a secret word or string of characters that is used for authentication, to prove identity or gain access to a resource. The password must be kept secret from those not allowed access [via].

Passwords are used in connection strings, directory security, admin areas etc… Most of the time we dont give much importance while choosing a password. Most of the websites require user names and passwords and the list is increasing day by day. On an average I use 25 passwords daily. We also tend to use the same password as we don’t have to remember them all. Here are some tips to choose a better password.

  1. Don’t use dictionary words : This is not a new tip. Every security related site will ask you not to choose a password which can be found in a dictionary. Choosing a easier password will enable any hacker to find your password with less effort. This includes foreign words, words spelt backwords etc
  2. Password is not a word : Strong passwords are not usually words. Most often people forget that special characters can be used in a password. Try to use a password which has ! “ £ $ % ^ & * ( ) _ + [ ] { } ; ‘ # : @ ~ \).
  3. Replace characters with numbers : This is a simple but effective way of generating a strong password. Try to use a password which has numbers in place of some characters. You can replace 1 with i, 4 with a, 3 with e, 0 with 0, 5 with s and so on. Example : c0deg33k5 can be used in place of codegeeks.
  4. Choose a long password : Most of the sites tell you that your passwords should be atleast 8 characters in length. This doesn’t mean that your actual password should consist only 8 characters. Try to create a password using a long sentence. Example : ikwydls can be used in place of I know what you did last summer. Replacing the above word with the tip 3 makes it more secure.
  5. Use password generators : Use a good password generator to choose a secure password.
  6. Check strength of your password : Use a software or a website to check the strength of the password you have chosen. Here is one such Password Checker from Microsoft.

Okay! You have started using a secure password but your job does not end there. Make sure you take care of your password by following these steps.

  1. Never share your password with others : No matter what, never share your password with others. If you want to share it for something very urgent make sure you change your password the next time you log in.
  2. Never write down you password : I have seen a PC with a sticky on it (user : admin password : adm1n). Now the password looks secure but what is the use in keeping the password public. Never write it down on your diaries, behind your keyboard etc
  3. Change it regularly : Believe it or not passwords are like your undergarments change it regularly. If you are a web developer try to force password expiration in your applications.
  4. Dont use Same password : Its like using the same key for all the locks. Never use the same password for all the logins.

Do you follow any other way for choosing a secure password? Share it with us.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Misc, links

How many engineers does it take to create a cross browser button?

February 7th, 2009

You all must have noticed the new buttons in Gmail. Although it does not look like normal buttons there is an interesting story behind it. Interested in knowing more? Check this post in Ajaxian.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Tips

The Geek Social Aptitude Test

February 4th, 2009

Face it: We’re all geeks here, and that means we all have a measure of social awkwardness. But how much are we talking here? Teaspoons or gallons? Find out with the GSAT.

Taking the test is simple. There are 50 statements. Mark down one point for yourself for every one that applies to you. At the end, score yourself. We can’t solve your problems, but at least we can help you figure out just how bad your problems are. And that’s something, right?

Take the test here. My score is 24. What’s yours?

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Misc, links

Show line numbers in Visual Studio

February 4th, 2009

Here is a how you can ebable Visual studio to show line numbers in the editor.

  • Got to Tools -> Options -> Text Editor -> All Languages -> General
  • Check Line numbers

The above settings will show line numbers for all the Files. If you just want to see (or not see) the line numbers of a specific file, you can override this global setting by going to the Text Editor – <specific language>General page.

Via Sara Ford’s blog

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Tips, vb.net

History of Programming languages poster

February 3rd, 2009

Looking for a good poster to fill you wall? Here is one of the best. I am sure every code geek will like it.

You can download the poster version here.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Misc