Friday, May 31, 2013

Beautiful and mesmerizing Maldives

DSC_0057DSC_0312DSC_0318DSC_0321DSC_0367DSC_0646

Maldives, a set on Flickr.

Pics from my last trip to Maldives. It's a nice, very hospitable and beautiful country.

Tuesday, April 02, 2013

Solution: Virtual Drives not working in Windows 8

If you are having problem loading Virtual Drives on Windows 8 (most probably after you upgraded from Windows 7 to Windows 8), the following should solve the problem.

  • Open devmgmt.msc and see if you have yellow warning icon in front of your virtual drives. Try to reinstall the driver for them and see if it fixes it.
  • If it doesn't then uninstall the drivers. Goto HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318} and delete the following values
    • UpperFilter
    • LowerFilter
After deleting these two registry values, you should be able to see your virtual drives in the explorer. These keys created problem for all my native virtual drive and also with the CloneDrive. I had tried uninstall/reinstall of clone drive many a times but in the end it's the registry that always helps.

Reference: http://technet.microsoft.com/en-us/library/cc772156(v=ws.10).aspx 

Saturday, March 02, 2013

Rising Petrol price in India under UPA Govt


Lol...
Courtsey: TheekHai Dr. Manamohan Singh and Sonia Gandhi
Source: https://www.facebook.com/swami.ramdev

Friday, February 22, 2013

Proof that excessive sunburn makes your skin darker.


Proof that excessive sunburn can permanently color you black.

Look at the dog sleeping in the shade, it's still white while the one sleeping in the sun became dark.

Sunday, January 27, 2013

0x80070422 while deploying application to Windows Phone device

I’m developing an application for my Windows Phone 7 and today I got an error when I was finally ready to deploy my application on my Phone. I hit deploy and whoa I get an error that “WP7 - Zune software is not launched. Retry after making sure that Zune software is launched.” Sure Zune was opened and connected to my phone alright. It did sync and stuff but still no luck.

Luckily I found about WPConnect.exe found in your “C:\Program Files\Microsoft SDKs\Windows Phone\v7.1\Tools\WPConnect\x86”

Running this again gave ne the same error but at least with an error code 0x80070422

Now we have a little bit more information so I was able to identify the solution.

Due to my very slow system I’m working on I had disabled all the unused System Services and one of them was “zune windows mobile connectivity service”. This Service is used by Visual Studio to connect to your Windows Phone 7.1/7.5 and restarting it fixed it.

So in short if you get an error stating error code 0x80070422 or “WP7 - Zune software is not launched. Retry after making sure that Zune software is launched.”  one of the first thing you should try is to enable and start “zune windows mobile connectivity service”

 

Will be posting my app to Windows Phone Marketplace very soon.

Sunday, January 20, 2013

Choosing a CMS for your website

One of the first and most difficult question while you are planning to build your own hosted website is “which CMS to use for my blog/website”. Googling for the best CMS doesn’t help either as all people have their own expertise and comfort level with their recommendation. I too have my bias towards the CMS I chose but since I had no particular experience with any of the CMS I have tried and I’m building it from ground up, it’s applicable to all newbies (I’m primarily a .Net developer so I haven’t worked with other php based CMS and mainly looking for a .Net CMS, people preferring php should use some other reliable resource).

I have tried Wordpress, Joomla, Drupal, DotNetNuke, Kentico, Blog.Net and blogger of course (had tried several others but don’t remember their names). I’ve given them a try multiple times but for one reason or another always comes back to the following two.

  1. Wordpress, and
  2. Orchard

Wordpress is one of the best CMS out there, mainly a blogging platform but can easily (and I mean really easy) be extended for website purpose. There are so many themes and modules out there that it simply doesn’t make sense to choose any other if you don’t want to customize via code (which is not a problem if you are a php developer). I prefer .Net so I chose Orchard over wordpress but on every other aspect it’s simply perfect, fast and extensible. You can customize it the way you want and most of it is available from admin interface.

Orchard is ASP.Net/MVC based CMS from Microsoft. It is being actively developed by a very talented team and I’ve seen a lots of improvement over the time in Orchard. Installation is simple. Developing a theme is also easy and you can easily build modules for Orchard (I ‘m still learning it but it’s really good).

If you are looking for a easily setup and extensible CMS for your website, choose one of these two without blinking. They are worth their cost which is free Smile. I love freebies.

For simple blogging purpose blogger.com is also a very good choice. You don’t need to host buy a hosting space for your blog and it allows you to use custom domains (which is a disadvantage for wordpress free hosted blogs).

One CMS I would dis-recommend is DotNetNuke. It’s cumbersome, slow and not very user friendly (my personal opinion ofcourse). It’s highly commercialized and developed in VB.Net and you’ll find a lots of paid modules for DNN as well but since I like freebie I dint find it good. Also it was too slow for my taste when I last tested it (I’ve been using it on shared hosting so that could be a reason for slowness but I can’t afford costly servers not now) so it’s a no-no for me.

Recommendation: No brainer Wordpress (non-developers or php developers)/ Orchard (.net developers)

 

If you are using Orchard I’d highly recommend TheThemeMachineResponsive theme. It’s a simple responsive theme from the Orchard developers. I’m using it on my beta portal http://backup.sandeeprawat.com which will soon replace my primary domain http://www.sandeeprawat.com

[Update] Forgot to mention another CMS which is very good, light-weight and .Net based. N2 CMS is also very nice to work with. Had worked with it and is very easy and powerful.

If you are bored, sharing a nice song from a very talented singer Rabbi

Challa by Rabbi

Tuesday, May 29, 2012

Lambda closure and compiler generated code in C#

I came across an interesting problem today.

In our WPF application we are heavily using unity and prism framework and we build pieces of application using unity IModule interfaces. We also make use of EventAggregator.

Now we had a perfectly fine piece of code that was working without any problem so far until today. Here is the code snippet

Note: this is only a sample code to illustrate the problem.

class MyModule:IModule
{
void Initialize(IEventAggregator aggregator)
{
Parameter param = new Parameter();
aggregator.GetEvent<MyEvent>.Subscribe(
() => {SomeStaticMethod(param);});
}

public static void SomeStaticMethod(Parameter param1)
{
//Do Something
}
}


So far so good. Now one of my collegeue made a small change to the code.



class MyModule:IModule
{
ISomeType someTypeObj;
void Initialize(IEventAggregator aggregator, ISomeType someTypeObject)
{
someTypeObj = someTypeObject
Parameter param = new Parameter();
aggregator.GetEvent<MyEvent>.Subscribe(
() => {SomeStaticMethod(param, someTypeObj);});
}

public static void SomeStaticMethod(Parameter param1, ISomeType someTypeObject)
{
//Do Something
}
}


 



I guess you can see the small difference. We just added a new parameter to the method call in our lambda and whoa our application stops working…



Looking at the change doesn’t give a clue. Why the heck it stopped working with a small change.



Here reflector came to our rescue. After fiddling with our debugger and looking at the reflected code we figured out the issue and it was a very interesting find.



Previously we were only calling a single static method in our lambda and passing a local variable, hence compiler optimized the generated code and produced a static method for our lambda. In the second case though we passed an instance variable and hence generated method had to be an instance method.



Now you must be wondering what difference does it make. But it does when you are using it inside IModule and lambda is used by EventAggregator. By definition IModules are short lived and unless there is a reference to the Module object, it will be garbage collected. Secondly, EventAggregator by default keeps a weak reference to the event handler in the aggregated list. So now since my Module is dead so is my event handler. This event handler was doing stuff, which was life line of my application and hence it went dead too.



Learnings:




  • Compiler does and will optimize anything it wants to and it wont ask you.


  • Test your code thoroughly event when you think it’s a small change.


  • Debug, Debug, Debug…….



Sunday, February 26, 2012

Load Historical EOD chart of NSE stocks from Yahoo finance into Ninja Tr...

You can use Ninja Trader to view historical charts of NSE stocks free of cost. It allows use of free Yahoo finance EOD data. Here is a video showing how to use TCS chart from Yahoo finance. It also supports Goog finance but there is no way Yet to load it into Ninja trade (at least I couldn't get it to work).

Saturday, January 14, 2012

Argument between Passengers and Airport Staff over mismanagement - IGI A...



For some reasons this video seems to be getting lots of hits in the youtube, so just sharing it on my blog as well. Well just to update my blog..

Thursday, January 05, 2012

New year’s resolution

Courtesy: Lets laugh a bit

Sunday, December 18, 2011

Shocking but true brutal egyption police.



What is this? Aren't policemen ashamed of what are they doing? (Egyption Police). This kind of brutality can't be tolerated in a civilized world.

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

Error

"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>
<asp:Content ContentPlaceHolderID="Content" runat="server">
</asp:Content>
 


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 %>" />
</asp:ContentPlaceHolder>
</head>

 


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

 

Google Analytics

Popular Posts

Powered by Blogger.