Monday, February 24, 2014

Story : One night a King had a dream

Once in a ancient times one King saw a dream that : He became very sick, all his hair is gone, he became very thin and very old.

the next day morning he called one astrologer ( ज्योतिषी ) and told about the dream he saw ..
the astrologer heard everything and told to the king "You are going to live very long, you are going to see your son dying, you are going to see your great grand son dying also.

the King announced to hung the astrologer till death and it happened so.

Then the King called another astrologer and told about the dream he saw ..
the astrologer heard everything and told to king that "You had a very good dream, you are going to live very long, you will see your fourth generation also alive, your son, grandson, great grand son are going to rule your Kingdom" and the second astrologer got rewarded with Gold prizes and priest has been praised very much.

So what is the Moral My friends ?? 

Friday, December 6, 2013

Sort DateTime List c#

    
    var sortedDates = dates.OrderByDescending(x => x);

or else Don't want to use, or don't know Linq then you can go for following..

    static List SortAscending(List list)
    {
    list.Sort((a, b) => a.CompareTo(b));
    return list;
    }

    static List SortDescending(List list)
    {
    list.Sort((a, b) => b.CompareTo(a));
    return list;
    }

Wednesday, December 4, 2013

Directory does not exist. Parameter name: directoryVirtualPath

I had the same problem and found out that I had some bundles that pointed to non-exisiting files using {version} and * wildcards such as
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
    "~/Scripts/jquery-{version}.js"));
I removed all of those and the error went away.

Code to Randomize data in a list

Random rand = new Random();
latestdata = latestdata.OrderBy(c => rand.Next()).ToList();

Structure data for Movie & review

<div itemtype="http://schema.org/Movie">
    <ul>
    <li>Title : <a itemprop="name" style="color: black;" title=""></a></li>
    <li>Star Cast :<a itemprop="actor" itemscope="" itemtype="http://schema.org/Person" title=""><span itemprop="name">Sundeep Kishan</span></a>
<a itemprop="actor" itemscope="" itemtype="http://schema.org/Person" title=""><span itemprop="name">Rakul Preet Singh</span></a>
    </li>
    <li>Director : <a itemprop="director" itemscope="" itemtype="http://schema.org/Person" title=""><span itemprop="name"></span></a></li>
    <li>Producer : <a itemprop="producer" itemscope="" itemtype="http://schema.org/Person" title=""><span itemprop="name"></span></a></li>
    <li>Music : </li>
    <li>Released on : Nov 29, 2013.</li>
    </ul>

    <a itemprop="author" itemscope="" itemtype="http://schema.org/Person"><span itemprop="name"></span></a>
    <a itemprop="creator" itemscope="" itemtype="http://schema.org/Person"><span itemprop="name"></span></a>
    <a itemprop="publisher"></a>
    <span itemprop="description"></span>
    <span itemprop="keywords"></span>

    <div itemprop="review" itemscope itemtype="http://schema.org/Review">
        <span itemprop="name"></span>
        <span itemprop="author"></span>
        <meta itemprop="datePublished" content="" />
        <span itemprop="description"</span>
        <span itemprop="keywords"></span>
    </div>
</div>