<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Social Vitamin</title>
	<atom:link href="http://www.socialvitamin.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.socialvitamin.com</link>
	<description>Give your social space a vitamin boost.</description>
	<lastBuildDate>Tue, 17 Aug 2010 20:34:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Puerto Rico Startup &#8211; SocialVitamin.com</title>
		<link>http://www.socialvitamin.com/2010/08/17/puerto-rico-startup-socialvitamin-com/</link>
		<comments>http://www.socialvitamin.com/2010/08/17/puerto-rico-startup-socialvitamin-com/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 20:34:48 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[C# .NET]]></category>
		<category><![CDATA[e-Commerce Puerto Rico]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Marketing Puerto Rico]]></category>
		<category><![CDATA[Mobile Software Puerto Rico]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Puerto Rico Startups]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby On Rails]]></category>
		<category><![CDATA[Web Development Puerto Rico]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=326</guid>
		<description><![CDATA[We are a state of the art Web and Mobile Software Development firm based in San Juan, Puerto Rico. We use the most innovative methodologies known to date to bring [...]]]></description>
			<content:encoded><![CDATA[<p><!-- begin colLeft --></p>
<div id="colLeft">
<p>We are a state of the art Web and Mobile Software Development firm based in San Juan, Puerto Rico.</p>
<div>
<p>We use the most innovative methodologies known to date to bring your   ideas into an avid reality. We take pride in our project portfolio and   have been rewarded with the satisfaction of our distinguished clients.</p>
<p>We specializes in Branding, High Scalable Websites, application   architecture, design and development and focus on Usability, User   Interaction, Web Usability, Web 2.0, Multi-Tier, Windows Mobile, iPhone,  Android,  Blackberry Mobile Applications, and Client-Server  Applications.</p>
<p><strong>Design and Brand Development</strong><br />
Corporate Identity, Logos, Websites, Ads, SEO,<br />
Print and Photography.</p>
<p><strong>Custom Software</strong><br />
C# .NET, Java, Objective-C, PHP,<br />
Python, Ruby On Rails, Application<br />
Re-Engineering and Re-factoring.</p>
<p><strong>Business Processes and Reporting</strong><br />
ETL’s, SSIS Packages, SOA, e-Commerce,<br />
Crystal Reports, Microsoft Reporting Services,<br />
Web Services and more.</p>
<p>Visit <a title="Social Vitamin" href="http://www.SocialVitamin.com">Puerto Rico Startup</a></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2010/08/17/puerto-rico-startup-socialvitamin-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;El Reencuentro&#8221; Website just launched!</title>
		<link>http://www.socialvitamin.com/2010/01/25/el-reencuentro-website-just-launched/</link>
		<comments>http://www.socialvitamin.com/2010/01/25/el-reencuentro-website-just-launched/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 01:30:43 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=250</guid>
		<description><![CDATA[On an effort to help our fellow Haitians SocialVitamin.com has helped on the creation of ElReencuentro.Net website (http://www.elreencuentro.net)]]></description>
			<content:encoded><![CDATA[<p>On an effort to help our fellow Haitians SocialVitamin.com has helped on the creation of ElReencuentro.Net website (<a href="http://www.elreencuentro.net">http://www.elreencuentro.net</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2010/01/25/el-reencuentro-website-just-launched/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is Apple working on an iTunes On Demand Music Streaming Service?</title>
		<link>http://www.socialvitamin.com/2009/08/10/is-apple-working-on-an-itunes-on-demand-music-streaming-service/</link>
		<comments>http://www.socialvitamin.com/2009/08/10/is-apple-working-on-an-itunes-on-demand-music-streaming-service/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 18:37:28 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=233</guid>
		<description><![CDATA[It all points out that maybe Apple is working on an iTunes On Demand Music Streaming Service. First they started banning a few Podcast Apps back in 2008 and now [...]]]></description>
			<content:encoded><![CDATA[<p>It all points out that maybe Apple is working on an iTunes On Demand Music Streaming Service. First they started banning a few Podcast Apps back in 2008 and now in 2009 they ban a few streaming apps from the App Store claiming they violate Apples Agreements. Boombox for OS 3.0 which is a sort of client to the famous <a href="http://www.blip.fm">Blip.FM</a> has been under review for the last month with no news if it&#8217;s even gonna hit the App Store again.</p>
<p>They are also working with the new HTTP Live Streaming protocol and submitted the specification to the Internet Engineering Task Force (IETF) a few weeks ago. It seems that there is no doubt that they are cooking something really neat for the iPhone.</p>
<p>I would love to see a good quality On Demand Streaming Service on my iPhone and not having to rely on the randomness of <a href="http://www.pandora.com">Pandora</a>, <a href="http://www.last.fm/">Last.FM</a> or <a href="http://daol.aol.com/software/mac/iphone/radio">AOL Radio</a> Apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/08/10/is-apple-working-on-an-itunes-on-demand-music-streaming-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Bing killing Yahoo! Search?</title>
		<link>http://www.socialvitamin.com/2009/07/10/is-bing-killing-yahoo-search/</link>
		<comments>http://www.socialvitamin.com/2009/07/10/is-bing-killing-yahoo-search/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:18:08 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Startups]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[stats]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=227</guid>
		<description><![CDATA[In the graph below we can see the amount of searches done in the top 5 search engines (Google, Yahoo, AOL, Ask Jeeves and Bing) Google being the true leader. [...]]]></description>
			<content:encoded><![CDATA[<p>In the graph below we can see the amount of searches done in the top 5 search engines (Google, Yahoo, AOL, Ask Jeeves and Bing) Google being the true leader. Notice the slight growth of Bing over Yahoo in the past month. Scary for Yahoo!?</p>
<div id="search_engine-US-daily-20090601-20090709" width="450" height="400" style="width:450px; height: 400px;"></div>
<p><!-- You may change the values of width and height above to resize the chart -->
<p>Source: <a href="http://gs.statcounter.com/#search_engine-US-daily-20090601-20090709">StatCounter Global Stats &#8211; Search Engine Market Share</a></p>
<p><script type="text/javascript" src="http://www.statcounter.com/js/FusionCharts.js"></script><script type="text/javascript" src="http://gs.statcounter.com/chart.php?search_engine-US-daily-20090601-20090709"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/07/10/is-bing-killing-yahoo-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yahoo! Query Language (YQL)</title>
		<link>http://www.socialvitamin.com/2009/07/10/yahoo-query-language-yql/</link>
		<comments>http://www.socialvitamin.com/2009/07/10/yahoo-query-language-yql/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:09:18 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[yahoo]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=224</guid>
		<description><![CDATA[The Yahoo! Query Language is an expressive SQL-like language that lets you query, filter, and join data across Web services. With YQL, apps run faster with fewer lines of code [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://developer.yahoo.com/yql/">Yahoo! Query Language</a> is an expressive SQL-like language that lets you query, filter, and join data across Web services. With YQL, apps run faster with fewer lines of code and a smaller network footprint.</p>
<p>Yahoo! and other websites across the Internet make much of their structured data available to developers, primarily through Web services. To access and query these services, developers traditionally endure the pain of locating the right URLs and documentation to access and query each Web service.</p>
<p>With YQL, developers can access and shape data across the Internet through one simple language, eliminating the need to learn how to call different APIs.</p>
<h3>How Do I Get Started?</h3>
<ol>
<li>Check out the YQL <a href="http://developer.yahoo.com/yql/console/" target="_blank">Console</a>.</li>
<li>Read how to access YQL from <a href="http://developer.yahoo.com/yql/guide/running-chapt.html" target="_blank">your application</a>.</li>
<li>Get your <a href="http://developer.yahoo.com/dashboard/createKey.html" target="_blank">API Keys</a> to sign your requests if you <a href="http://developer.yahoo.com/yql/guide/authorization-access.html" target="_blank">need them</a>.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/07/10/yahoo-query-language-yql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Michael D. Irizarry interviewed @ Twittericans.net</title>
		<link>http://www.socialvitamin.com/2009/05/28/michael-d-irizarry-interviewed-twittericansnet/</link>
		<comments>http://www.socialvitamin.com/2009/05/28/michael-d-irizarry-interviewed-twittericansnet/#comments</comments>
		<pubDate>Thu, 28 May 2009 14:04:23 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=220</guid>
		<description><![CDATA[Michael D. Irizarry interviewed at Twittericans.net Tweetcast 04 on Startup Weekend, his projects and also plugs in http://iphone.sal.pr]]></description>
			<content:encoded><![CDATA[<p>Michael D. Irizarry interviewed at <a href="http://www.twittericans.net/">Twittericans.net</a> Tweetcast 04 on Startup Weekend, his projects and also plugs in <a href="http://iphone.sal.pr">http://iphone.sal.pr</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/28/michael-d-irizarry-interviewed-twittericansnet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Puerto Rico Startup Weekend June 5 &#8211; 7</title>
		<link>http://www.socialvitamin.com/2009/05/19/puerto-rico-startup-weekend-june-5-7/</link>
		<comments>http://www.socialvitamin.com/2009/05/19/puerto-rico-startup-weekend-june-5-7/#comments</comments>
		<pubDate>Wed, 20 May 2009 03:20:52 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[events]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=209</guid>
		<description><![CDATA[Startup Weekend in San Juan, Puerto Rico from June 5 -7 at Hacienda Country Club &#038; Convention Center. Come join us as we bring this new and exciting business opportunity [...]]]></description>
			<content:encoded><![CDATA[<p>Startup Weekend in San Juan, Puerto Rico from June 5 -7 at <strong>Hacienda Country Club &#038; Convention Center</strong>.<br />
Come join us as we bring this new and exciting business opportunity to the Shinning Star of the Caribbean.</p>
<p><object width="400" height="226"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=4021689&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=4cf000&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=4021689&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=4cf000&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="226"></embed></object>
<p><a href="http://vimeo.com/4021689">Startup Weekend World #2 Challenge</a> from <a href="http://vimeo.com/andrewhyde">Andrew</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p><strong>What is Startup Weekend?</strong><br />
Startup Weekend is a community building startup event. Get together with local developers, marketers, designers, enthusiasts, and do what you do best. Start projects, Start companies. No talk, all action. The weekend of June 5-7 is Startup Weekend World. Celebrating the news that Startup Weekend is now ‘open’ to anyone to organize. How exciting 20+ cities from around the worl will host their own startup Weekends. No city is too big or small.</p>
<p><strong>What’s its purpose?</strong><br />
Build new startup companies, bring people together, share ideas.</p>
<p><strong>What’s the target market?</strong><br />
Technology, Web Development, Entrepreneurs, Legal, Marketing, Web 2.0, e-Business</p>
<p><strong>What are the requirements?</strong><br />
Be a technology enthusiast, be a Web Junkie, Programmer, IT person, blogger, marketers, lawyer or just have a cool business idea.</p>
<p><strong>Is it FREE?</strong><br />
Yes! It’s Free.</p>
<p><strong>REGISTER FOR THIS EVENT</strong><br />
Register here now for the June 5-7 Event: <a href="http://puertorico2.eventbrite.com/">http://puertorico2.eventbrite.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/19/puerto-rico-startup-weekend-june-5-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>C# Form Validation Class</title>
		<link>http://www.socialvitamin.com/2009/05/19/c-form-validation-class/</link>
		<comments>http://www.socialvitamin.com/2009/05/19/c-form-validation-class/#comments</comments>
		<pubDate>Tue, 19 May 2009 17:41:18 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=192</guid>
		<description><![CDATA[A nice little form validation class. It provides validation for Phone, Email, URL and Zipcode but its real easy to extend. Code public class FormValidator { public static IDictionary RegexDictionary [...]]]></description>
			<content:encoded><![CDATA[<p>A nice little form validation class. It provides validation for Phone, Email, URL and Zipcode but its real easy to extend.<br />
<span id="more-192"></span><br />
Code</p>
<pre lang="Java">
    public class FormValidator
    {

        public static IDictionary<string, Regex> RegexDictionary = new Dictionary<string, Regex>() {
        { "Phone", new Regex("^[2-9]\\d{2}-\\d{3}-\\d{4}$")},
        { "Email", new Regex(@"^(([^<>()[\]\\.,;:\s@\""]+"
          + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"
          + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
          + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"
          + @"[a-zA-Z]{2,}))$"
        )},
        { "URL", new Regex(@"(http(s)?://)?([\w-]+\.)+[\w-]+(/[\w- ;,./?%&#038;=]*)?")},
        { "ZipCode", new Regex("^[0-9]{5}$")}
        };

        public static bool IsPhoneValid(string phone)
        {
            return RegexDictionary["Phone"].IsMatch(phone);
        }

        public static bool IsEmailValid(string email)
        {
            return RegexDictionary["Email"].IsMatch(email);
        }

        public static bool IsURLValid(string url)
        {
            return RegexDictionary["URL"].IsMatch(url);
        }

        public static bool IsZipCodeValid(string url)
        {
            return RegexDictionary["ZipCode"].IsMatch(url);
        }

    }
</pre>
<p>Use</p>
<pre lang="Java">
if (String.IsNullOrEmpty(email) || !FormValidator.IsEmailValid(email))
// Do something email is required
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/19/c-form-validation-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>10 jQuery 1.3 Tips and Tricks for everyday use</title>
		<link>http://www.socialvitamin.com/2009/05/18/10-jquery-13-techniques-you-cant-live-without/</link>
		<comments>http://www.socialvitamin.com/2009/05/18/10-jquery-13-techniques-you-cant-live-without/#comments</comments>
		<pubDate>Mon, 18 May 2009 17:22:18 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=145</guid>
		<description><![CDATA[Some useful jQuery Tips and Tricks for your everyday use. Removing and Hiding Dom Elements, Browser Detection, Toggling, Handling Select Lists and more. 1. Removing, Showing or Hiding DOM elements [...]]]></description>
			<content:encoded><![CDATA[<p>Some useful jQuery Tips and Tricks for your everyday use. Removing and Hiding Dom Elements, Browser Detection, Toggling, Handling Select Lists and more.<br />
<span id="more-145"></span></p>
<h3>1. Removing, Showing or Hiding DOM elements</h3>
<pre lang="Javascript">
// Remove Element
$("#div").remove();

// Hide
$("#div").hide();
$("#div").hide("slow");
$("#div").hide("fast");
$("#div").hide(1000);
$("#div").hide(1000, callback); 

// Show
$("#div").show();
$("#div").show("slow");
$("#div").show("fast");
$("#div").show(1000);
$("#div").show(1000, callback);  

// Toggle Hide/ Show
$("#div").toggle();
$("#div").toggle("slow");
</pre>
<h3>2. Select All Check Boxes</h3>
<pre lang="Javascript">
// Check
$("#selectList").attr('checked', true); 

// Uncheck
$("#selectList").attr('checked', false);
</pre>
<h3>3. Creating Images on the Fly</h3>
<pre lang="Javascript">
$("<img/>").attr({ "src": "images/loadingAnimation.gif" }).appendTo("#div");
</pre>
<h3>4. jQuery noConflict used when using other libraries</h3>
<pre lang="Javascript">
var $j = jQuery.noConflict();
$j('#div').hide();
</pre>
<h3>5. Getting Selected Radio Button value</h3>
<pre lang="Javascript">
$("input[name='id'][checked]").val();
</pre>
<h3>6.  Getting Select List values</h3>
<pre lang="Javascript">
// Value
$('#selectList').val(); 

// Text value
$('#selectList :selected').text() 

// Multiple Selection
var selections = [];
$('#multipleList :selected').each(function(i, selected){
     selections[i] = $(selected).text();
});
</pre>
<h3>7. Check if checkbox is Checked</h3>
<pre lang="Javascript">
$('#checkBox').attr('checked'); 

$('#checkBoxID').is(':checked'); 

$("[:checkbox]:checked").each(
    function() {
    }
);
</pre>
<h3>8. Browser Detection</h3>
<pre lang="Javascript">
if( $.browser.safari ) { // Do something }

if ($.browser.msie &#038;&#038; $.browser.version > 6 ) { // Do something }

if ($.browser.msie &#038;&#038; $.browser.version <= 6 ) { // Do something }

if ($.browser.mozilla &#038;&#038; $.browser.version >= "1.8" )  { // Do something }
</pre>
<h3>9. Highlight a Row onClick</h3>
<pre lang="Javascript">
$("tr").click(function() {
    $(this).toggleClass("rowActive");
});
</pre>
<pre lang="css">
/* CSS highlights clicked row */
.rowActive {
    border: 1px solid #333333;
    background-color: #999999;
}
</pre>
<h3>10. Building the DOM Dynamically</h3>
<pre lang="Javascript">
$("
<div/>").attr({id:"header", "class":"header"}).html("Welcome to my Site!").appendTo(document.body);
$("<img/>").attr("src", "images/logo.gif").appendTo("#header");
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/18/10-jquery-13-techniques-you-cant-live-without/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Group By, Group, Take and Order By with LinQ in C#</title>
		<link>http://www.socialvitamin.com/2009/05/13/group-by-group-take-and-order-by-with-linq-in-c/</link>
		<comments>http://www.socialvitamin.com/2009/05/13/group-by-group-take-and-order-by-with-linq-in-c/#comments</comments>
		<pubDate>Wed, 13 May 2009 21:04:20 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[linq]]></category>
		<category><![CDATA[order by]]></category>
		<category><![CDATA[take]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=128</guid>
		<description><![CDATA[At some point you&#8217;ll need to group and order your results using LINQ. It&#8217;s an easy task but a little bit hard to master since you have a few options. [...]]]></description>
			<content:encoded><![CDATA[<p>At some point you&#8217;ll need to group and order your results using LINQ. It&#8217;s an easy task but a little bit hard to master since you have a few options. Lets imagine we have Voting Poll that people will vote on periods. The voting Poll has 3 tables TimePeriod, Items and the Cross Reference table TimePeriod_Items and we want to build a results grid using them. The best option for me is the following. Notice I&#8217;m also limiting the results using the Take method this way I only have 3 items per Group. Also notice that I&#8217;m not returning an Anonymous Type but rather an ItemResults Type.</p>
<p>Code</p>
<pre lang="PHP">
public List<ItemResults> FindResults()
 {

    var query = from items in db.TimePeriod_Items
    group items by items.TimePeriod into g
    orderby g.Key.finish
    select new ItemResults
    {
        TimePeriod = g.Key,
        TimePeriod_Item = g.Key.TimePeriod_Items.OrderByDescending(item => item.votes).Take(3)
    };

    return query.ToList();

 }
</pre>
<p>ItemResult Class</p>
<pre lang="PHP">
public class ItemResults
{
    public TimePeriod TimePeriod { get; set; }
    public IEnumerable<TimePeriod_Item> TimePeriod_Item { get; set; }
}
</pre>
<p>Use in ASP.NET MVC</p>
<pre lang="PHP">
public ActionResult Results()
{
    var items = appRepository.FindResults();
    return View("Results", items);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/13/group-by-group-take-and-order-by-with-linq-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
