Tuesday, December 28, 2010

Goto – Good or evil?

Found a good article on the use of goto statements in the languages while, I was following up with posts on stack overflow. Here is a stack overflow post named Goto still considered harmful. It has some interesting discussion but I also found two articles by two great computer scientists discussing it in detail.

  1. Dijkstra's Letters to the editor: go to statement considered harmful
  2. Structured Programming with go to Statements
They have some interesting facts and information as to where goto is good and where is it harmful? A good reading nevertheless.
Beware Winking smile
Visit XKCD for more comic.
Linus (Linux Fame) also had something to share on goto here

Friday, December 24, 2010

Torrent Finder Domain Seizure

Copied from: [http://torrent-finder.info/torrent-finder-domain-seizure.php]

On Thursday, the 25th of November 2010, the Torrent Finder domain ( www.torrent-finder.com ), registered with Godaddy, was seized by the U.S. Immigration and Customs Enforcement (ICE) without any prior takedown notice or specific allegations of infringing activity. The Domain IP was suddenly changed without the registrar's knowledge and the system displayed a "Pending Registry Action" message on the domain's status. No contact was given until Wednesday, the 1st of December, when Godaddy replied to my inquiries, giving a contact for an ICE agent.

On Thursday, the 2nd of December, David Snead who is representing Torrent Finder contacted the ICE agent in charge who told him that "the orders are under seal, but that the seal will be lifted today or tomorrow". However, we have not heard from them until writing this post. Another email from Godaddy clarified that the action was taken by VeriSign: "please understand that these actions were taken by Verisign at the Registry level; and not by Go Daddy". The story was first reported on TorrentFreak and NYTimes.com.

Torrent Finder is a meta search engine that searches other search engines through iframes redirecting users to other domains and websites that Torrent Finder does not manage or control; most of the sites are suggested by Torrent Finder users through URL suggestion form. There have been many explanations about the mechanism of Torrent Finder Search on the media and how it works just like Google or Bing despite that Google does link to .torrent files directly. "So, when is the U.S. Government going to seize the Google domain?" Inquisitr.com asks. And Torrent Freak writes "When a site has no tracker, carries no torrents, lists no copyright works unless someone searches for them and responds just like Google, accusing it of infringement becomes somewhat of a minefield - unless you're ICE Homeland Security Investigations that is" and many others ask the same question, for instance Techdirt and Technobuffalo.com.

For more visit: http://torrent-finder.info/torrent-finder-domain-seizure.php


Support electronic freedom, fight censorship. Like the torrent-finder facebook page and spread the news.

Saturday, December 04, 2010

Funny–Indian Youth Education Series

Random TV Presents Mahilao se Baatcheet : Ek Margdarshak (how to talk to the ladies – A Guide)

How to talk to the fairer sex. A guide for the Indian Youths


Credit goes to the original uploader.

Monday, September 27, 2010

SharePoint–Preventing CSRF using dynamic canary

As you are aware SharePoint uses a FormDigest to prevent common CSRF attacks.

A Good article on SharePoint XSS and AllowUnsafeUpdates can be found here.

In a relatively obscure scenario you may want to call a SharePoint page asynchronously using AJAX. If so you will want to prevent CSRF attack on the target page and call SPUtility.ValidateFormDigest. But how to provide form digest to this page?

Simple! Just add a __RequestDigest variable to the Post request and call the TargetPage. Don’t forget to include a formdigest control on the TargetPage though or inherit from SharePoint master page.

var canaryValue = document.getElementById('__REQUESTDIGEST').value;
request.Send("__REQUESTDIGEST" +canaryValue+someFormData)
This code is assuming you are making the AJAX call from a SharePoint page which already includes a RequestDigest field and you can use this value to post to the Target Page.

Another method to get the request digest is to call GetUpdatedFormDigestInformation method on Sites.asmx webservice.

As an alternative of sending RequestDigest field in the Post Data, you can set the X-RequestDigest header on the web request to the Request Digest value and validate the FormDigest on Target (Couldn’t get it work for the ASPX pages. Works for WebService I believe).

request.SetRequestHeader("X-RequestDigest", canaryValue); 

Monday, September 20, 2010

Behind the Code - Anders Hejlsberg

Behind the Code with Anders Hejlsberg

Recommended C# Books

  • The C# Programming Language - Anders Hejlsberg
  • C# in Depth - Jon Skeet

Saturday, August 28, 2010

Comic - Engineering Process

Disclaimer: The intent of this comic strip is pure fun. No harm is intended to anyone.

Artist: Alone Dreamer




Copyright: Do not hotlink to the above images and Do not replicate the graphics without the prior permission of the author.

Comic - Triage Bug Bar

Artist: Alone Dreamer

Triage bar goes high as a product reaches closer to the General Availability.

Friday, August 27, 2010

Comic - A Feature Team Meeting in Company

Disclaimer – No offense is meant to anyone living or dead Smile

A typical feature team meeting in a Software Company (Name withdrawn upon request).

Duet Taskflow Feature Team Meeting

Click the image above for the full version of the image

Credit: Alone Dreamer

Saturday, August 21, 2010

Some VS Bugs


"the page has one or more <asp:content> that do not correspond with <asp:ContentPlaceHolder> controls in masterpage"

Apparently I’m using a wrong contentPlaceHolderId which doesn’t exist in my master page but that’s not true. Here is my Page

<asp:Content ContentPlaceHolderID="Head" runat="server">
<asp:Content ContentPlaceHolderID="Content" runat="server">

And my Master page looks like this

<head id="h" runat="server">    
<title id="t" runat="server" title='<%$ CurrentPage: Title %>' />
<asp:ContentPlaceHolder ID="Head" runat="server">
<link rel="canonical" href="<%= CurrentPage != null ? CurrentPage.Url : Request.RawUrl %>" />


It all looks good to me so where is the problem? Error message is not very friendly in this case and error and solution both seems pretty weird.
Solution: The title tag should not be used as a single closed tag e.g. <title /> instead it should be written as <title></title> and the problem will go away. Look out for other tags as well such as <script />. It doesn’t work very well in the single close tag. Use explicit close tag wherever possible. Browsers are forgiving in nature but not the VS

Thursday, August 19, 2010

Solution: Facebook Social Plugins not working in IE

What to do when you’ve worked hard to integrate Facebook plugins with your website and they look cool on Firefox/Chrome but all of a sudden you feel disappointed when it doesn’t work at all in IE, or may be works sometime but not always (as in my case).

Being an avid IE fan and user, I can’t just sit back and relax when it’s not working on IE. So here is a small modification you need to make to your page when you feel you’ve done everything correct but your fb:like or fb:login-button are still not working.
Add the xmlns:fb namespace to your page and you are done. I just forgot to add this to my page and was living in frustration for one whole day until I came across this post. Then I realized it was a silly mistake and I should’ve added this before when my Visual Studio was complaining about the unrecognized fb tag Smile

<html xmlns:fb="http://www.facebook.com/2008/fbml">

I hope it helps some people implementing Facebook connect on their pages.

Sunday, August 15, 2010

Bowling at its worst :)

This is us playing bowling at Extreme Sports Bar Hyderabad.

Let’s see how we play :)

This is Suneet playing his second best lol..

Now you know how was his first best :) People moved their children away after his ball hit the pins Why?? ‘coz it hit the pins in the another lane… Lol

I was not behind though.. this is how I like to play

Sunday, July 18, 2010

Dynamically adding Facebook XFBML plug-in to your page using jQuery

I was trying to add some of the facebook social plug-ins to my home page at www.sandeeprawat.com which display a kind of splash screen at first (not a splash actually but a simple visible <div> and hidden content on the page) and then on clicking on the page, it renders the hidden content of the same page and adds some XFBML plug-ins and a twitter gadget. I didn’t want to download everything on the page load since it will never be shown to a user if she never click on the splash screen and it would  mean unnecessary load time. So I what i tried to was to add the content dynamically on the onClick handler. Now here is the problem.

facebook SDK parses the DOM only on the doc load, so when I dynamically add <fb:like /> button after that, it is inserted successfully but doesn’t do anything and no iframe is generated which is obvious. I’ve scratched my head for long, tried various options suggested over internet but none of them worked for me, so I went back and added them statically to the page and make those controls hidden which wasn’t a good solution but at least it worked.

Now here is what I was doing wrong, I was using FB.XFBML.host.ParseDomTree and I also used FB.XFBML.Parse() as suggested by Facebook but I still couldn’t get that to work. Now the error was very simple, my syntax was wrong I should have used parse in small case instead of Pascal casing which caused me a fair amount of time to discover but at least it was a good learning. Mind you I’m new to the jScript world :)

Here is the code snippet I’m using to insert the tags dynamically.

$(document).ready(function () {

$("#divStarter").click(function () {
$(".container").css("visibility", "visible");
var poetry = $("#autoFetch").html();
$("#fbReco").html("<fb:recommendations />");
$("#fbFriendPile").html("<fb:friendpile />");
$("#fbLike").html("<fb:like />");

Thursday, April 15, 2010

Dandeli – Goa trip

Note: Cross posted from Smoke 'n Ashes.


Some pics from our trip to Dandeli and Goa. Trip was kool but nothing that we expected. We had more fun the last time we went to Hampi.

It’s a nice place to visit. You can do Jungle Safari, rafting, kayaking and all short of other cool stuff. Place is a bit expensive though.

It’s me. Who else did you expect? :)
Visit my Picasa or Facebook Album for more pics…
Note: Cross posted from Smoke 'n Ashes.


Trip to Hampi

Note: Cross posted from Smoke 'n Ashes.


Hampi is famous for its temples. Some cool images from Hampi. Trip was fun, we spent two days in Hampi

Note: Cross posted from Smoke 'n Ashes.



Google Analytics

Popular Posts

Powered by Blogger.