<?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, 26 Jan 2010 01:31:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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>0</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 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 [...]]]></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. Notice the slight growth of Bing over Yahoo in the past month. Scary for Yahoo!?


Source: StatCounter Global Stats &#8211; Search Engine Market Share

]]></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 and a smaller network footprint.
Yahoo! and other websites across the Internet make much of their structured data available to developers, primarily through Web services. To [...]]]></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>0</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 to the Shinning Star of the Caribbean.

Startup Weekend World #2 Challenge from Andrew on Vimeo.
What is Startup Weekend?
Startup Weekend is a community building startup event. Get [...]]]></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>0</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
    &#123;
&#160;
        public static IDictionary&#60;string, Regex&#62; RegexDictionary = new Dictionary&#60;string, Regex&#62;&#40;&#41; &#123;
        [...]]]></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>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> FormValidator
    <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> IDictionary<span style="color: #339933;">&lt;</span>string, Regex<span style="color: #339933;">&gt;</span> RegexDictionary <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Dictionary<span style="color: #339933;">&lt;</span>string, Regex<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;Phone&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> Regex<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;^[2-9]<span style="color: #000099; font-weight: bold;">\\</span>d{2}-<span style="color: #000099; font-weight: bold;">\\</span>d{3}-<span style="color: #000099; font-weight: bold;">\\</span>d{4}$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>,
        <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;Email&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> Regex<span style="color: #009900;">&#40;</span>@<span style="color: #0000ff;">&quot;^(([^&lt;&gt;()[<span style="color: #000099; font-weight: bold;">\]</span><span style="color: #000099; font-weight: bold;">\\</span>.,;:<span style="color: #000099; font-weight: bold;">\s</span>@<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; 
          + @&quot;</span><span style="color: #009900;">&#40;</span>\.<span style="color: #009900;">&#91;</span><span style="color: #339933;">^&lt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>\<span style="color: #009900;">&#93;</span>\\.,<span style="color: #339933;">;:</span>\s@\<span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span>\<span style="color: #0000ff;">&quot;&quot;</span>.<span style="color: #339933;">+</span>\<span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>@<span style="color: #0000ff;">&quot; 
          + @&quot;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>\<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">3</span><span style="color: #009900;">&#125;</span>\.<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">3</span><span style="color: #009900;">&#125;</span>\.<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">3</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot; 
          + @&quot;</span>\.<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">1</span>,<span style="color: #cc66cc;">3</span><span style="color: #009900;">&#125;</span>\<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">|</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>a<span style="color: #339933;">-</span>zA<span style="color: #339933;">-</span>Z\<span style="color: #339933;">-</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>\.<span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot; 
          + @&quot;</span><span style="color: #009900;">&#91;</span>a<span style="color: #339933;">-</span>zA<span style="color: #339933;">-</span>Z<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span><span style="color: #cc66cc;">2</span>,<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>$<span style="color: #0000ff;">&quot;
        )},
        { &quot;</span><span style="color: #003399;">URL</span><span style="color: #0000ff;">&quot;, new Regex(@&quot;</span><span style="color: #009900;">&#40;</span>http<span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">?:</span><span style="color: #666666; font-style: italic;">//)?([\w-]+\.)+[\w-]+(/[\w- ;,./?%&amp;=]*)?&quot;)},</span>
        <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;ZipCode&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> Regex<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;^[0-9]{5}$&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> bool IsPhoneValid<span style="color: #009900;">&#40;</span>string phone<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> RegexDictionary<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Phone&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">IsMatch</span><span style="color: #009900;">&#40;</span>phone<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> bool IsEmailValid<span style="color: #009900;">&#40;</span>string email<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> RegexDictionary<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;Email&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">IsMatch</span><span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> bool IsURLValid<span style="color: #009900;">&#40;</span>string url<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> RegexDictionary<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;URL&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">IsMatch</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> bool IsZipCodeValid<span style="color: #009900;">&#40;</span>string url<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> RegexDictionary<span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;ZipCode&quot;</span><span style="color: #009900;">&#93;</span>.<span style="color: #006633;">IsMatch</span><span style="color: #009900;">&#40;</span>url<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Use</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span>.<span style="color: #006633;">IsNullOrEmpty</span><span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>FormValidator.<span style="color: #006633;">IsEmailValid</span><span style="color: #009900;">&#40;</span>email<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #666666; font-style: italic;">// Do something email is required</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/05/19/c-form-validation-class/feed/</wfw:commentRss>
		<slash:comments>0</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

// Remove Element
$&#40;&#34;#div&#34;&#41;.remove&#40;&#41;;
&#160;
// Hide
$&#40;&#34;#div&#34;&#41;.hide&#40;&#41;;
$&#40;&#34;#div&#34;&#41;.hide&#40;&#34;slow&#34;&#41;; 
$&#40;&#34;#div&#34;&#41;.hide&#40;&#34;fast&#34;&#41;;
$&#40;&#34;#div&#34;&#41;.hide&#40;1000&#41;;  
$&#40;&#34;#div&#34;&#41;.hide&#40;1000, callback&#41;; 
&#160;
// Show
$&#40;&#34;#div&#34;&#41;.show&#40;&#41;;
$&#40;&#34;#div&#34;&#41;.show&#40;&#34;slow&#34;&#41;; 
$&#40;&#34;#div&#34;&#41;.show&#40;&#34;fast&#34;&#41;;
$&#40;&#34;#div&#34;&#41;.show&#40;1000&#41;;  
$&#40;&#34;#div&#34;&#41;.show&#40;1000, callback&#41;;  
&#160;
// Toggle Hide/ Show
$&#40;&#34;#div&#34;&#41;.toggle&#40;&#41;;
$&#40;&#34;#div&#34;&#41;.toggle&#40;&#34;slow&#34;&#41;;

2. Select All Check Boxes

// Check
$&#40;&#34;#selectList&#34;&#41;.attr&#40;'checked', true&#41;; 
&#160;
// Uncheck
$&#40;&#34;#selectList&#34;&#41;.attr&#40;'checked', [...]]]></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>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Remove Element</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Hide</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fast&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">// Show</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;fast&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1000</span><span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
<span style="color: #006600; font-style: italic;">// Toggle Hide/ Show</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;slow&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>2. Select All Check Boxes</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Check</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#selectList&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">// Uncheck</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#selectList&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>3. Creating Images on the Fly</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;img/&gt;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span> <span style="color: #3366CC;">&quot;src&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;images/loadingAnimation.gif&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#div&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>4. jQuery noConflict used when using other libraries</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> $j <span style="color: #339933;">=</span> jQuery.<span style="color: #660066;">noConflict</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$j<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#div'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hide</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>5. Getting Selected Radio Button value</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;input[name='id'][checked]&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>6.  Getting Select List values</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Value</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#selectList'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">val</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">// Text value</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#selectList :selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
&nbsp;
<span style="color: #006600; font-style: italic;">// Multiple Selection</span>
<span style="color: #003366; font-weight: bold;">var</span> selections <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#multipleList :selected'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">,</span> selected<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
     selections<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>selected<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>7. Check if checkbox is Checked</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#checkBox'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#checkBoxID'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':checked'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;[:checkbox]:checked&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span>
    <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #009900;">&#125;</span> 
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<h3>8. Browser Detection</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">safari</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Do something }</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span> <span style="color: #339933;">&amp;&amp;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">6</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Do something }</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">msie</span> <span style="color: #339933;">&amp;&amp;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span> <span style="color: #339933;">&lt;=</span> <span style="color: #CC0000;">6</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Do something }</span>
&nbsp;
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$.<span style="color: #660066;">browser</span>.<span style="color: #660066;">mozilla</span> <span style="color: #339933;">&amp;&amp;</span> $.<span style="color: #660066;">browser</span>.<span style="color: #660066;">version</span> <span style="color: #339933;">&gt;=</span> <span style="color: #3366CC;">&quot;1.8&quot;</span> <span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// Do something }</span></pre></div></div>

<h3>9. Highlight a Row onClick</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;tr&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">toggleClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;rowActive&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* CSS highlights clicked row */</span>
<span style="color: #6666ff;">.rowActive</span> <span style="color: #00AA00;">&#123;</span>  
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span> 
    <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#999999</span><span style="color: #00AA00;">;</span> 
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>10. Building the DOM Dynamically</h3>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div/&gt;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>id<span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;header&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;class&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;header&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Welcome to my Site!&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;img/&gt;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;src&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;images/logo.gif&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#header&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></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. 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 [...]]]></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>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>ItemResults<span style="color: #339933;">&gt;</span> FindResults<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">var</span> query <span style="color: #339933;">=</span> from items in db<span style="color: #339933;">.</span>TimePeriod_Items
    group items by items<span style="color: #339933;">.</span>TimePeriod into g
    orderby g<span style="color: #339933;">.</span><span style="color: #990000;">Key</span><span style="color: #339933;">.</span>finish
    select <span style="color: #000000; font-weight: bold;">new</span> ItemResults
    <span style="color: #009900;">&#123;</span>
        TimePeriod <span style="color: #339933;">=</span> g<span style="color: #339933;">.</span><span style="color: #990000;">Key</span><span style="color: #339933;">,</span>
        TimePeriod_Item <span style="color: #339933;">=</span> g<span style="color: #339933;">.</span><span style="color: #990000;">Key</span><span style="color: #339933;">.</span>TimePeriod_Items<span style="color: #339933;">.</span>OrderByDescending<span style="color: #009900;">&#40;</span>item <span style="color: #339933;">=&gt;</span> item<span style="color: #339933;">.</span>votes<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>Take<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> query<span style="color: #339933;">.</span>ToList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #009900;">&#125;</span></pre></div></div>

<p>ItemResult Class</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ItemResults
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> TimePeriod TimePeriod <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">public</span> IEnumerable<span style="color: #339933;">&lt;</span>TimePeriod_Item<span style="color: #339933;">&gt;</span> TimePeriod_Item <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Use in ASP.NET MVC</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> ActionResult Results<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">var</span> items <span style="color: #339933;">=</span> appRepository<span style="color: #339933;">.</span>FindResults<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> View<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Results&quot;</span><span style="color: #339933;">,</span> items<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></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>
		<item>
		<title>Paging with LINQ in ASP.NET MVC</title>
		<link>http://www.socialvitamin.com/2009/04/25/paging-with-linq-in-aspnet-mvc/</link>
		<comments>http://www.socialvitamin.com/2009/04/25/paging-with-linq-in-aspnet-mvc/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 13:19:19 +0000</pubDate>
		<dc:creator>Michael D. Irizarry</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.socialvitamin.com/?p=115</guid>
		<description><![CDATA[Here&#8217;s a really neat and simple way to add pagination to your LINQ results in ASP.NET MVC. The simple class can be also implemented in non ASP.NET MVC projects.
Note: You can change the source parameter to be List or just add a method overload.
PaginatedList Class

using System;
using System.Linq;
using System.Collections.Generic;
&#160;
namespace MyApp.Helpers
&#123;
    public class PaginatedList&#60;T&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a really neat and simple way to add pagination to your LINQ results in ASP.NET MVC. The simple class can be also implemented in non ASP.NET MVC projects.<br />
Note: You can change the source parameter to be List or just add a method overload.</p>
<p>PaginatedList Class</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">using <span style="color: #990000;">System</span><span style="color: #339933;">;</span>
using <span style="color: #990000;">System</span><span style="color: #339933;">.</span>Linq<span style="color: #339933;">;</span>
using <span style="color: #990000;">System</span><span style="color: #339933;">.</span>Collections<span style="color: #339933;">.</span>Generic<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">namespace</span> MyApp<span style="color: #339933;">.</span>Helpers
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> PaginatedList<span style="color: #339933;">&lt;</span>T<span style="color: #339933;">&gt;</span> <span style="color: #339933;">:</span> List<span style="color: #339933;">&lt;</span>T<span style="color: #339933;">&gt;</span>
    <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> int PageIndex <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">private</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">public</span> int PageSize <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">private</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">public</span> int TotalCount <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">private</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">public</span> int TotalPages <span style="color: #009900;">&#123;</span> get<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">private</span> set<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> PaginatedList<span style="color: #009900;">&#40;</span>IQueryable<span style="color: #339933;">&lt;</span>T<span style="color: #339933;">&gt;</span> source<span style="color: #339933;">,</span> int pageIndex<span style="color: #339933;">,</span> int pageSize<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            PageIndex <span style="color: #339933;">=</span> pageIndex<span style="color: #339933;">;</span>
            PageSize <span style="color: #339933;">=</span> pageSize<span style="color: #339933;">;</span>
            TotalCount <span style="color: #339933;">=</span> source<span style="color: #339933;">.</span><span style="color: #990000;">Count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            TotalPages <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> Math<span style="color: #339933;">.</span>Ceiling<span style="color: #009900;">&#40;</span>TotalCount <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span>double<span style="color: #009900;">&#41;</span>PageSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            this<span style="color: #339933;">.</span>AddRange<span style="color: #009900;">&#40;</span>source<span style="color: #339933;">.</span>Skip<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>PageIndex<span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> PageSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>Take<span style="color: #009900;">&#40;</span>PageSize<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> bool HasPreviousPage
        <span style="color: #009900;">&#123;</span>
            get <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span>PageIndex <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">public</span> bool HasNextPage <span style="color: #009900;">&#123;</span>
            get <span style="color: #009900;">&#123;</span><span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span>PageIndex<span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">&lt;</span> TotalPages<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Controller</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000000; font-weight: bold;">public</span> ActionResult Index<span style="color: #009900;">&#40;</span>int? page<span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
            int pageSize <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">var</span> content <span style="color: #339933;">=</span> MyAppRepository<span style="color: #339933;">.</span>FindContentByDate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span>ToList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">var</span> pagedContent <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PaginatedList<span style="color: #339933;">&lt;</span>Content<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span>content<span style="color: #339933;">,</span> page ?? <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> pageSize<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #b1b100;">return</span> View<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Index&quot;</span><span style="color: #339933;">,</span> pagedContent<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div>

<p>View</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">        &lt;div id=&quot;nav_paging&quot;&gt;
        &lt;% if (Model.HasPreviousPage) { %&gt;
        &lt;div class=&quot;nav_prev&quot;&gt;
            &lt;%= Html.RouteLink(&quot;Previous&quot;, &quot;Index&quot;, new { page = (Model.PageIndex - 1) })%&gt;
        &lt;/div&gt;
        &lt;% } %&gt;
&nbsp;
        &lt;% if (Model.HasNextPage) { %&gt;
        &lt;div class=&quot;nav_next&quot;&gt;
            &lt;%= Html.RouteLink(&quot;Next&quot;, &quot;Index&quot;, new { page = (Model.PageIndex + 1) })%&gt;
        &lt;/div&gt;
        &lt;% } %&gt;
        &lt;/div&gt;</pre></div></div>

<p>Routes in Global.asax</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">routes.MapRoute(
                &quot;Index&quot;,
                &quot;Index/Page/{page}&quot;,
                new { controller = &quot;Home&quot;, action = &quot;Index&quot;, page = 0 }
            );</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.socialvitamin.com/2009/04/25/paging-with-linq-in-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
