<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8980734269859237005</atom:id><lastBuildDate>Sat, 31 Jul 2010 09:41:51 +0000</lastBuildDate><title>DevCurry</title><description /><link>http://www.devcurry.com/</link><managingEditor>noreply@blogger.com (Suprotim Agarwal)</managingEditor><generator>Blogger</generator><openSearch:totalResults>580</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/devcurry" /><feedburner:info uri="devcurry" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>devcurry</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-610666518106965109</guid><pubDate>Fri, 30 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-30T03:55:00.087-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>Filter data in a WPF ListBox</title><description>&lt;div align="justify"&gt;In this post, I will demonstrate how to filter data from the list box in WPF. To do this, I am using LINQ to Collections.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align="justify"&gt;Assuming you have a WPF project, add a class file ‘Employee’&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee
&lt;/span&gt;{
&lt;span style="color: blue;"&gt;  public int &lt;/span&gt;EmpNo { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
&lt;span style="color: blue;"&gt;  public string &lt;/span&gt;EmpName { &lt;span style="color: blue;"&gt;get&lt;/span&gt;; &lt;span style="color: blue;"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;&lt;div class="code"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="code"&gt;In the MainWindow.Xaml, add the following code:&lt;/div&gt;&lt;div class="code"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBox &lt;/span&gt;&lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="298" &lt;/span&gt;&lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Left" &lt;/span&gt;&lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;="80,55,0,0"
&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="lstEmpData" &lt;/span&gt;&lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Top" &lt;/span&gt;&lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="252"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Binding &lt;/span&gt;&lt;span style="color: red;"&gt;EmpName&lt;/span&gt;&lt;span style="color: blue;"&gt;}"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TextBlock&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBox&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="23" &lt;/span&gt;&lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Left" &lt;/span&gt;&lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;="60,18,0,0"
&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="textBlock1" &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="Search Name"
&lt;/span&gt;&lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Top" &lt;/span&gt;&lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="134" /&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;TextBox &lt;/span&gt;&lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="27" &lt;/span&gt;&lt;span style="color: red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Left" &lt;/span&gt;&lt;span style="color: red;"&gt;Margin&lt;/span&gt;&lt;span style="color: blue;"&gt;="208,13,0,0"
&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtNameToSearch" &lt;/span&gt;&lt;span style="color: red;"&gt;TextChanged&lt;/span&gt;&lt;span style="color: blue;"&gt;="txtNameToSearch_TextChanged"
&lt;/span&gt;&lt;span style="color: red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue;"&gt;="Top" &lt;/span&gt;&lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="202" /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align="justify"&gt;The xaml code shown above defines a ListBox which has ItemTemplate set to TextBlock. This TextBlock is bound with EmpName. The TextBox(txtNameToSearch) is used to define filter values.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align="justify"&gt;In the Window_Loaded event, add the following code&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre class="code"&gt;&lt;span style="color: #2b91af;"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;&amp;gt; lstEmployee =
&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;&amp;gt;();

&lt;span style="color: blue;"&gt;private void &lt;/span&gt;Window_Loaded(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)
{
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1001, EmpName = &lt;span style="color: #a31515;"&gt;"Mahesh" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1002, EmpName = &lt;span style="color: #a31515;"&gt;"Amit" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1003, EmpName = &lt;span style="color: #a31515;"&gt;"Vaibhav" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1004, EmpName = &lt;span style="color: #a31515;"&gt;"Ashwin" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1005, EmpName = &lt;span style="color: #a31515;"&gt;"Prashant" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1006, EmpName = &lt;span style="color: #a31515;"&gt;"Vinit" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1007, EmpName = &lt;span style="color: #a31515;"&gt;"Abhijit" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1008, EmpName = &lt;span style="color: #a31515;"&gt;"Pankaj" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1009, EmpName = &lt;span style="color: #a31515;"&gt;"Kaustubh" &lt;/span&gt;});
lstEmployee.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Employee&lt;/span&gt;() { EmpNo = 1010, EmpName = &lt;span style="color: #a31515;"&gt;"Mohan" &lt;/span&gt;});

lstEmpData.ItemsSource = lstEmployee;
}&lt;/pre&gt;&lt;br /&gt;
The code shown above defines an Employee collection bound to the ListBox.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;Now in the TextChanged event of the TextBox, add the following LINQ code which filters data from the collection and binds the result to the Listbox:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;txtNameToSearch_TextChanged(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender,
&lt;span style="color: #2b91af;"&gt;TextChangedEventArgs &lt;/span&gt;e)
{
&lt;span style="color: blue;"&gt;  string &lt;/span&gt;txtOrig = txtNameToSearch.Text;
&lt;span style="color: blue;"&gt;  string &lt;/span&gt;upper = txtOrig.ToUpper();
&lt;span style="color: blue;"&gt;  string &lt;/span&gt;lower = txtOrig.ToLower();

&lt;span style="color: blue;"&gt;  var &lt;/span&gt;empFiltered = &lt;span style="color: blue;"&gt;from &lt;/span&gt;Emp &lt;span style="color: blue;"&gt;in &lt;/span&gt;lstEmployee
&lt;span style="color: blue;"&gt;  let &lt;/span&gt;ename = Emp.EmpName
&lt;span style="color: blue;"&gt;  where
&lt;/span&gt;   ename.StartsWith(lower)
   || ename.StartsWith(upper)
   || ename.Contains(txtOrig)
&lt;span style="color: blue;"&gt;   select &lt;/span&gt;Emp;

  lstEmpData.ItemsSource = empFiltered;
}&lt;/pre&gt;&lt;pre class="code"&gt;&amp;nbsp;&lt;/pre&gt;OUTPUT&lt;br /&gt;
&lt;a href="http://lh4.ggpht.com/_0j4bzarlOBg/TFKQGJWBsWI/AAAAAAAABQY/sRTb8dS2CTo/s1600-h/image%5B2%5D.png"&gt;&lt;img alt="image" border="0" height="211" src="http://lh4.ggpht.com/_0j4bzarlOBg/TFKQHJzlSvI/AAAAAAAABQc/G7L_fxYMD8M/image_thumb.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="362" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-610666518106965109?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/15nA2C8pg80" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/15nA2C8pg80/filter-data-in-wpf-listbox.html</link><author>noreply@blogger.com (Mahesh Sabnis)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/filter-data-in-wpf-listbox.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-7999868936047810148</guid><pubDate>Thu, 29 Jul 2010 10:25:00 +0000</pubDate><atom:updated>2010-07-29T03:25:00.908-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Calculate the Size of a Folder/Directory using .NET 4.0</title><description>&lt;div align="justify"&gt;.NET 4.0 introduces &lt;a href="http://www.devcurry.com/2010/06/7-new-methods-to-enumerate-directory.html" target="_blank"&gt;7 New methods to Enumerate Directory and Files in .NET 4.0&lt;/a&gt;. All these methods return Enumerable Collections (IEnumerable&amp;lt;T&amp;gt;), which perform better than arrays. We will be using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.enumeratedirectories.aspx" target="_blank"&gt;DirectoryInfo.EnumerateDirectories&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.enumeratefiles.aspx" target="_blank"&gt;DirectoryInfo.EnumerateFiles&lt;/a&gt; in this sample which returns an enumerable collection of Directory and File information respectively.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align="justify"&gt;Here’s how to calculate the size of a folder or directory using .NET 4.0 and LINQ. The code also calculates the size of all sub-directories. &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;
&lt;/div&gt;C#&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue;"&gt;using &lt;/span&gt;System.Linq;
&lt;span style="color: blue;"&gt;using &lt;/span&gt;System.IO;

&lt;span style="color: blue;"&gt;namespace &lt;/span&gt;ConsoleApplication3
{
&lt;span style="color: blue;"&gt;  class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Program
&lt;/span&gt;  {
&lt;span style="color: blue;"&gt;    static void &lt;/span&gt;Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)
    {
&lt;span style="color: #2b91af;"&gt;      DirectoryInfo &lt;/span&gt;dInfo = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DirectoryInfo&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;@"C:/Articles"&lt;/span&gt;);
&lt;span style="color: green;"&gt;      // set bool parameter to false if you
      // do not want to include subdirectories.
&lt;/span&gt;&lt;span style="color: blue;"&gt;      long &lt;/span&gt;sizeOfDir = DirectorySize(dInfo, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);

&lt;span style="color: #2b91af;"&gt;      Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Directory size in Bytes : " &lt;/span&gt;+
&lt;span style="color: #a31515;"&gt;      "{0:N0} Bytes"&lt;/span&gt;, sizeOfDir);
&lt;span style="color: #2b91af;"&gt;      Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Directory size in KB : " &lt;/span&gt;+
&lt;span style="color: #a31515;"&gt;      "{0:N2} KB"&lt;/span&gt;, ((&lt;span style="color: blue;"&gt;double&lt;/span&gt;)sizeOfDir) / 1024);
&lt;span style="color: #2b91af;"&gt;      Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Directory size in MB : " &lt;/span&gt;+ 
&lt;span style="color: #a31515;"&gt;      "{0:N2} MB"&lt;/span&gt;, ((&lt;span style="color: blue;"&gt;double&lt;/span&gt;)sizeOfDir) / (1024 * 1024));

&lt;span style="color: #2b91af;"&gt;      Console&lt;/span&gt;.ReadLine();
    }

&lt;span style="color: blue;"&gt;    static long &lt;/span&gt;DirectorySize(&lt;span style="color: #2b91af;"&gt;DirectoryInfo &lt;/span&gt;dInfo, &lt;span style="color: blue;"&gt;bool &lt;/span&gt;includeSubDir)
    {
&lt;span style="color: green;"&gt;       // Enumerate all the files
&lt;/span&gt;&lt;span style="color: blue;"&gt;       long &lt;/span&gt;totalSize = dInfo.EnumerateFiles()
                    .Sum(file =&amp;gt; file.Length);

&lt;span style="color: green;"&gt;       // If Subdirectories are to be included
&lt;/span&gt;&lt;span style="color: blue;"&gt;       if &lt;/span&gt;(includeSubDir)
       {
&lt;span style="color: green;"&gt;          // Enumerate all sub-directories
&lt;/span&gt;          totalSize += dInfo.EnumerateDirectories()
                   .Sum(dir =&amp;gt; DirectorySize(dir, &lt;span style="color: blue;"&gt;true&lt;/span&gt;));
       }
&lt;span style="color: blue;"&gt;       return &lt;/span&gt;totalSize;
    }
  }
}&lt;/pre&gt;&lt;br /&gt;
VB.NET 10.0 (converted using online tool)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;Imports &lt;/span&gt;System
&lt;span style="color: blue;"&gt;Imports &lt;/span&gt;System.Linq
&lt;span style="color: blue;"&gt;Imports &lt;/span&gt;System.IO

&lt;span style="color: blue;"&gt;Module &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Module1

&lt;/span&gt;&lt;span style="color: blue;"&gt;Sub &lt;/span&gt;Main()
&lt;span style="color: blue;"&gt;   Dim &lt;/span&gt;dInfo &lt;span style="color: blue;"&gt;As New &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DirectoryInfo&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"C:/Articles"&lt;/span&gt;)
&lt;span style="color: green;"&gt;   ' set bool parameter to false if you
   ' do not want to include subdirectories.
&lt;/span&gt;&lt;span style="color: blue;"&gt;   Dim &lt;/span&gt;sizeOfDir &lt;span style="color: blue;"&gt;As Long &lt;/span&gt;= DirectorySize(dInfo, &lt;span style="color: blue;"&gt;True&lt;/span&gt;)

&lt;span style="color: #2b91af;"&gt;   Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Directory size in Bytes : " &lt;/span&gt;&amp;amp; _
&lt;span style="color: #a31515;"&gt;    "{0:N0} Bytes"&lt;/span&gt;, sizeOfDir)
&lt;span style="color: #2b91af;"&gt;   Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Directory size in KB : " &lt;/span&gt;&amp;amp; _
&lt;span style="color: #a31515;"&gt;    "{0:N2} KB"&lt;/span&gt;, (&lt;span style="color: blue;"&gt;CDbl&lt;/span&gt;(sizeOfDir)) / 1024)
&lt;span style="color: #2b91af;"&gt;   Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;"Directory size in MB : " &lt;/span&gt;&amp;amp; _
&lt;span style="color: #a31515;"&gt;    "{0:N2} MB"&lt;/span&gt;, (&lt;span style="color: blue;"&gt;CDbl&lt;/span&gt;(sizeOfDir)) / (1024 * 1024))

&lt;span style="color: #2b91af;"&gt;   Console&lt;/span&gt;.ReadLine()
&lt;span style="color: blue;"&gt;End Sub

Private Function &lt;/span&gt;DirectorySize(&lt;span style="color: blue;"&gt;ByVal &lt;/span&gt;dInfo &lt;span style="color: blue;"&gt;As &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DirectoryInfo&lt;/span&gt;, _
&lt;span style="color: blue;"&gt;   ByVal &lt;/span&gt;includeSubDir &lt;span style="color: blue;"&gt;As Boolean&lt;/span&gt;) &lt;span style="color: blue;"&gt;As Long
&lt;/span&gt;&lt;span style="color: green;"&gt;   ' Enumerate all the files
&lt;/span&gt;&lt;span style="color: blue;"&gt;   Dim &lt;/span&gt;totalSize &lt;span style="color: blue;"&gt;As Long &lt;/span&gt;= dInfo.EnumerateFiles() _
     .Sum(&lt;span style="color: blue;"&gt;Function&lt;/span&gt;(file) file.Length)

&lt;span style="color: green;"&gt;   ' If Subdirectories are to be included
&lt;/span&gt;&lt;span style="color: blue;"&gt;   If &lt;/span&gt;includeSubDir &lt;span style="color: blue;"&gt;Then
&lt;/span&gt;&lt;span style="color: green;"&gt;     ' Enumerate all sub-directories
&lt;/span&gt;     totalSize += dInfo.EnumerateDirectories() _
      .Sum(&lt;span style="color: blue;"&gt;Function&lt;/span&gt;(dir) DirectorySize(dir, &lt;span style="color: blue;"&gt;True&lt;/span&gt;))
&lt;span style="color: blue;"&gt;   End If
   Return &lt;/span&gt;totalSize
&lt;span style="color: blue;"&gt;End Function

End Module
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;OUTPUT&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
I got the following output after running this code.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://lh6.ggpht.com/_0j4bzarlOBg/TFFTqG3ochI/AAAAAAAABQI/YaQ8v-qVhEY/s1600-h/image%5B14%5D.png"&gt;&lt;img alt="image" border="0" height="69" src="http://lh5.ggpht.com/_0j4bzarlOBg/TFFTqwF4CSI/AAAAAAAABQM/ucvSceKHzCM/image_thumb%5B6%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="403" /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
To confirm that the code worked as expected, I opened Windows Explorer &amp;gt; C Drive &amp;gt; Right clicked the folder &amp;gt; Properties. Here is the screenshot that matches the output we got from our code&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://lh5.ggpht.com/_0j4bzarlOBg/TFFTryuURAI/AAAAAAAABQQ/o9ZdTixU05I/s1600-h/image%5B15%5D.png"&gt;&lt;img alt="image" border="0" height="286" src="http://lh3.ggpht.com/_0j4bzarlOBg/TFFTtYMU-OI/AAAAAAAABQU/W-T9AHL_XcM/image_thumb%5B7%5D.png?imgmax=800" style="border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;" title="image" width="403" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-7999868936047810148?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/3_MnapxsEdA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/3_MnapxsEdA/calculate-size-of-folderdirectory-using.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>2</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/calculate-size-of-folderdirectory-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-8167946670539941961</guid><pubDate>Wed, 28 Jul 2010 11:55:00 +0000</pubDate><atom:updated>2010-07-28T05:15:50.104-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Compare two List&lt;string&gt; using LINQ</title><description>&lt;p align="justify"&gt;In this post, we will see how to compare two List&amp;lt;string&amp;gt; and list the elements found in one List&amp;lt;string&amp;gt; but not in the other. We will be using the &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.except.aspx" target="_blank"&gt;Enumerable.Except&lt;/a&gt; method&lt;/p&gt;&lt;p&gt;C#&lt;br /&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstOne =&lt;br /&gt;        &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;() { &lt;span style="color:#a31515;"&gt;"Jim"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jack"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Kate"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Nope" &lt;/span&gt;};&lt;br /&gt;&lt;br /&gt;   &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstTwo =&lt;br /&gt;       &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;() { &lt;span style="color:#a31515;"&gt;"Jack"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Nope"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jim" &lt;/span&gt;};&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstNew = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:green;"&gt;// Compare two List&amp;lt;string&amp;gt; and display items of lstOne not in lstTwo&lt;br /&gt;    &lt;/span&gt;lstNew = lstOne.Except(lstTwo, &lt;span style="color:#2b91af;"&gt;StringComparer&lt;/span&gt;.OrdinalIgnoreCase);&lt;br /&gt;&lt;br /&gt;    PrintList(lstNew);&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;static void &lt;/span&gt;PrintList(&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; str)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;s &lt;span style="color:blue;"&gt;in &lt;/span&gt;str)&lt;br /&gt;&lt;br /&gt;       &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(s);&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;"-------------"&lt;/span&gt;);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_0j4bzarlOBg/TE1xOOAfegI/AAAAAAAABP8/zrcNh9C3fI8/s1600-h/image%5B2%5D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_0j4bzarlOBg/TE1xPNT6uyI/AAAAAAAABQA/JGEHBLzXSX8/image_thumb.png?imgmax=800" width="139" height="37" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;Read some more tips in my article over here &lt;b&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=447" target="_blank"&gt;Some Common Operations using List&amp;lt;string&amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-8167946670539941961?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/sqdsbfOrHiU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/sqdsbfOrHiU/compare-two-list-using-linq.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/compare-two-list-using-linq.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-7399573317035126185</guid><pubDate>Tue, 27 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-27T03:55:00.622-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">WPF</category><title>Bind Enum to a WPF ListBox using ObjectDataProvider</title><description>&lt;p align="justify"&gt;In programming languages, Enumeration has a specific role for storing values. The &lt;a href="http://msdn.microsoft.com/en-us/library/system.enum.getvalues.aspx" target="_blank"&gt;Enum.GetValues()&lt;/a&gt; method retrieves an array of the values of the constants in an Enum. Let us see how to use this method and bind an Enumeration to a WPF ListBox using the ObjectDataProvider.&lt;/p&gt;&lt;p align="justify"&gt;Create a WPF project with the name of WPF_EnumBinding. In the WPF Project, open the MainPage.Xaml.cs and write an enumeration as shown below:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;public enum &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Department&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    IT,&lt;br /&gt;    System,&lt;br /&gt;    HRD,&lt;br /&gt;    Accts,&lt;br /&gt;    Transport&lt;br /&gt;}&lt;/pre&gt;&lt;p align="justify"&gt;Since ‘Enum’ is defined in mscorlib assembly, it is referred in the Xaml code shown below. The ObjectDataProvider is used to bind the Enumeration with the Xaml. The namespace under which enumeration i.e. WPF_EnumBinding is declared, is also referred in the Xaml. The Xaml code is as below:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Class&lt;/span&gt;&lt;span style="color:blue;"&gt;="WPF_EnumBinding.MainWindow"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;src&lt;/span&gt;&lt;span style="color:blue;"&gt;="clr-namespace:System;assembly=mscorlib"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;data&lt;/span&gt;&lt;span style="color:blue;"&gt;="clr-namespace:WPF_EnumBinding"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;Title&lt;/span&gt;&lt;span style="color:blue;"&gt;="MainWindow" &lt;/span&gt;&lt;span style="color:red;"&gt;Height&lt;/span&gt;&lt;span style="color:blue;"&gt;="350" &lt;/span&gt;&lt;span style="color:red;"&gt;Width&lt;/span&gt;&lt;span style="color:blue;"&gt;="525"&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window.Resources&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ObjectDataProvider  &lt;/span&gt;&lt;span style="color:red;"&gt;MethodName&lt;/span&gt;&lt;span style="color:blue;"&gt;="GetValues"&lt;br /&gt;                             &lt;/span&gt;&lt;span style="color:red;"&gt;ObjectType&lt;/span&gt;&lt;span style="color:blue;"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Type &lt;/span&gt;&lt;span style="color:red;"&gt;src&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Enum&lt;/span&gt;&lt;span style="color:blue;"&gt;}" &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Key&lt;/span&gt;&lt;span style="color:blue;"&gt;="dname"&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ObjectDataProvider.MethodParameters&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Type &lt;/span&gt;&lt;span style="color:red;"&gt;TypeName&lt;/span&gt;&lt;span style="color:blue;"&gt;="data:Department"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Type&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ObjectDataProvider.MethodParameters&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ObjectDataProvider&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window.Resources&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;       &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ListBox &lt;/span&gt;&lt;span style="color:red;"&gt;Height&lt;/span&gt;&lt;span style="color:blue;"&gt;="294" &lt;/span&gt;&lt;span style="color:red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color:blue;"&gt;="Left"&lt;br /&gt;         &lt;/span&gt;&lt;span style="color:red;"&gt;Margin&lt;/span&gt;&lt;span style="color:blue;"&gt;="32,17,0,0" &lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;="lstEnum" &lt;/span&gt;&lt;span style="color:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color:blue;"&gt;="Top"&lt;br /&gt;         &lt;/span&gt;&lt;span style="color:red;"&gt;Width&lt;/span&gt;&lt;span style="color:blue;"&gt;="222" &lt;/span&gt;&lt;span style="color:red;"&gt;DataContext&lt;/span&gt;&lt;span style="color:blue;"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="color:red;"&gt;Source&lt;/span&gt;&lt;span style="color:blue;"&gt;={&lt;/span&gt;&lt;span style="color:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="color:red;"&gt;dname&lt;/span&gt;&lt;span style="color:blue;"&gt;}}"&lt;br /&gt;         &lt;/span&gt;&lt;span style="color:red;"&gt;ItemsSource&lt;/span&gt;&lt;span style="color:blue;"&gt;="{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Binding&lt;/span&gt;&lt;span style="color:blue;"&gt;}"&amp;gt;&lt;br /&gt;       &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ListBox&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Window&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_Y5IUyn2fE28/TE61rzcFH3I/AAAAAAAAAB0/AU9wtZu6v7M/s1600-h/image%5B6%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_Y5IUyn2fE28/TE61sqwaB6I/AAAAAAAAAB4/wLwIyIQcAXI/image_thumb%5B4%5D.png?imgmax=800" width="256" height="118" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-7399573317035126185?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/giVEwLBwdtw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/giVEwLBwdtw/bind-enum-to-wpf-listbox-using.html</link><author>noreply@blogger.com (Mahesh Sabnis)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/bind-enum-to-wpf-listbox-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-821066673542292928</guid><pubDate>Mon, 26 Jul 2010 11:55:00 +0000</pubDate><atom:updated>2010-07-26T04:55:00.792-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>List Common Elements between two List&lt;string&gt;</title><description>&lt;p align="justify"&gt;Here’s a simple post that shows how to list common elements between two List&amp;lt;Strings&amp;gt;. Use the &lt;a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.intersect.aspx" target="_blank"&gt;Enumerable.Intersect&lt;/a&gt; method&lt;/p&gt;&lt;p&gt;C#&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;class &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Program&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstOne =&lt;br /&gt;            &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;() { &lt;span style="color:#a31515;"&gt;"Jim"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jack"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Kate"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Nope" &lt;/span&gt;};&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstTwo =&lt;br /&gt;            &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;() { &lt;span style="color:#a31515;"&gt;"Jack"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Nope"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jim" &lt;/span&gt;};&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstNew = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color:green;"&gt;// Compare two List&amp;lt;string&amp;gt; and display common elements&lt;br /&gt;       &lt;/span&gt;lstNew = lstOne.Intersect(lstTwo, &lt;span style="color:#2b91af;"&gt;StringComparer&lt;/span&gt;.OrdinalIgnoreCase);&lt;br /&gt;       PrintList(lstNew);&lt;br /&gt;&lt;br /&gt;       &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;static void &lt;/span&gt;PrintList(&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; str)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;s &lt;span style="color:blue;"&gt;in &lt;/span&gt;str)&lt;br /&gt;            &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(s);&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;"-------------"&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;VB.NET&lt;/p&gt;&lt;br /&gt;&lt;pre class="code"&gt;    &lt;span style="color:blue;"&gt;Sub &lt;/span&gt;Main()&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim &lt;/span&gt;lstOne &lt;span style="color:blue;"&gt;As New &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;)() _&lt;br /&gt;            &lt;span style="color:blue;"&gt;From &lt;/span&gt;{&lt;span style="color:#a31515;"&gt;"Jim"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jack"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Kate"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Nope"&lt;/span&gt;}&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim &lt;/span&gt;lstTwo &lt;span style="color:blue;"&gt;As New &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;)() _&lt;br /&gt;            &lt;span style="color:blue;"&gt;From &lt;/span&gt;{&lt;span style="color:#a31515;"&gt;"Jack"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Nope"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jim"&lt;/span&gt;}&lt;br /&gt;        &lt;span style="color:blue;"&gt;Dim &lt;/span&gt;lstNew &lt;span style="color:blue;"&gt;As &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;) = &lt;span style="color:blue;"&gt;Nothing&lt;br /&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:green;"&gt;' Compare two List&amp;lt;string&amp;gt; and display common elements&lt;br /&gt;        &lt;/span&gt;lstNew = lstOne.Intersect(lstTwo, &lt;span style="color:#2b91af;"&gt;StringComparer&lt;/span&gt;.OrdinalIgnoreCase)&lt;br /&gt;        PrintList(lstNew)&lt;br /&gt;&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.ReadLine()&lt;br /&gt;    &lt;span style="color:blue;"&gt;End Sub&lt;br /&gt;&lt;br /&gt;    Private Sub &lt;/span&gt;PrintList(&lt;span style="color:blue;"&gt;ByVal &lt;/span&gt;str &lt;span style="color:blue;"&gt;As &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;))&lt;br /&gt;        &lt;span style="color:blue;"&gt;For Each &lt;/span&gt;s &lt;span style="color:blue;"&gt;In &lt;/span&gt;str&lt;br /&gt;            &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(s)&lt;br /&gt;        &lt;span style="color:blue;"&gt;Next &lt;/span&gt;s&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;"-------------"&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color:blue;"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_0j4bzarlOBg/TE1t6wCgROI/AAAAAAAABP0/0mmLHoXq0bA/s1600-h/image%5B2%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TE1t7jpdMTI/AAAAAAAABP4/VszFAPjG2dE/image_thumb.png?imgmax=800" width="113" height="69" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;Read some more tips in my article over here &lt;b&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=447" target="_blank"&gt;Some Common Operations using List&amp;lt;string&amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-821066673542292928?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/kvagddk2T_o" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/kvagddk2T_o/list-common-elements-between-two-list.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/list-common-elements-between-two-list.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-5344702690443839303</guid><pubDate>Sun, 25 Jul 2010 12:35:00 +0000</pubDate><atom:updated>2010-07-25T05:35:00.515-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Free Learning</category><title>Web Camp Training Kit - Recent Microsoft Web Camps Presentations, Demos and Labs</title><description>&lt;p align="justify"&gt;Microsoft recently released the July 2010 release of the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=0a906559-28bd-4f5d-ac18-f895a200a2a5" target="_blank"&gt;Web Camps Training Kit&lt;/a&gt;. &lt;/p&gt;&lt;p align="justify"&gt;The Web Camp Training kit includes all the content presented around the world at the recent Web Camps events; presentations, demos, labs and more. Inside the new kit you’ll find content that covers the following technologies: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;ASP.NET MVC 2 &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;ASP.NET 4 Web Forms &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;jQuery &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Entity Framework &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Visual Studio 2010&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="justify"&gt;Download the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=0a906559-28bd-4f5d-ac18-f895a200a2a5" target="_blank"&gt;Web Camp Training Kit&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-5344702690443839303?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/_gd_ct_ge-w" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/_gd_ct_ge-w/web-camp-training-kit-recent-microsoft.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/web-camp-training-kit-recent-microsoft.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-2602523479938740120</guid><pubDate>Sat, 24 Jul 2010 11:10:00 +0000</pubDate><atom:updated>2010-07-24T04:27:03.050-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>Understanding YSlow – A Firebug Extension to Analyze and Improve Webpage Performance</title><description>&lt;p align="justify"&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5369/" target="_blank"&gt;Yahoo’s YSlow&lt;/a&gt; is a ‘must have’ Firefox add-on and is an extension (for performance) to the &lt;a href="http://www.getfirebug.com/" target="_blank"&gt;Firebug&lt;/a&gt; tool. YSlow analyzes web pages and suggests ways to improve the performance of web pages based on a set of &lt;a href="http://developer.yahoo.com/performance/rules.html" target="_blank"&gt;rules for high performance web pages&lt;/a&gt; laid out by Yahoo. There are 34 rules laid out by Yahoo and YSlow is capable of testing 22 of them. &lt;/p&gt;&lt;p align="justify"&gt;The 22 rules testable by YSlow and as listed in the YSlow &lt;a href="http://developer.yahoo.com/yslow/help/" target="_blank"&gt;user guide&lt;/a&gt;, are:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Minimize HTTP Requests&lt;/li&gt;&lt;li&gt;Use a Content Delivery Network&lt;/li&gt;&lt;li&gt;Add an Expires or a Cache-Control Header&lt;/li&gt;&lt;li&gt;Gzip Components&lt;/li&gt;&lt;li&gt;Put StyleSheets at the Top&lt;/li&gt;&lt;li&gt;Put Scripts at the Bottom&lt;/li&gt;&lt;li&gt;Avoid CSS Expressions&lt;/li&gt;&lt;li&gt;Make JavaScript and CSS External&lt;/li&gt;&lt;li&gt;Reduce DNS Lookups&lt;/li&gt;&lt;li&gt;Minify JavaScript and CSS&lt;/li&gt;&lt;li&gt;Avoid Redirects&lt;/li&gt;&lt;li&gt;Remove Duplicate Scripts&lt;/li&gt;&lt;li&gt;Configure ETags&lt;/li&gt;&lt;li&gt;Make AJAX Cacheable&lt;/li&gt;&lt;li&gt;Use GET for AJAX Requests&lt;/li&gt;&lt;li&gt;Reduce the Number of DOM Elements&lt;/li&gt;&lt;li&gt;No 404s&lt;/li&gt;&lt;li&gt;Reduce Cookie Size&lt;/li&gt;&lt;li&gt;Use Cookie-Free Domains for Components&lt;/li&gt;&lt;li&gt;Avoid Filters&lt;/li&gt;&lt;li&gt;Do Not Scale Images in HTML&lt;/li&gt;&lt;li&gt;Make favicon.ico Small and Cacheable&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p align="justify"&gt;Assuming you have &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5369/" target="_blank"&gt;downloaded YSlow&lt;/a&gt; and installed it in Firefox, let us quickly run the YSlow tool on a website and then dissect the results to understand the tool better. Once installed, the YSlow tool can be invoked from Firefox. Just open your web page in Firefox and click the YSlow tool (lower right corner of the Firefox status bar). Here are the results of running YSlow on a &lt;a href="http://www.dotnetcurry.com/BrowseArticles.aspx" target="_blank"&gt;sample webpage&lt;/a&gt; from my site. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_0j4bzarlOBg/TErIsM7IdBI/AAAAAAAABO0/buVlCIZfzi8/s1600-h/image%5B23%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TErItfk6gFI/AAAAAAAABO4/CCQ7KfCSU_A/image_thumb%5B13%5D.png?imgmax=800" width="572" height="291" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;As you can observe, the results consists of 4 Tabs – Grade, Components, Statistics and Tools. The screenshot also shows the rulesets applied as well as the the Grade received by the website. Let us understand these terms one by one.&lt;/p&gt;&lt;h5&gt;&lt;span style="font-size:130%;"&gt;Rulesets&lt;/span&gt;&lt;/h5&gt;&lt;p align="justify"&gt;Let us first understand the rulesets that YSlow uses to grade pages (we will understand grading shortly). There are 3 predefined rulesets that you can choose to apply on a webpage:&lt;/p&gt;&lt;p&gt;YSlow(V2) - This ruleset contains the 22 rules listed in the beginning of this article.&lt;/p&gt;&lt;p&gt;Classic (V1) - This ruleset contains rules from 1 to 13.&lt;/p&gt;&lt;p&gt;Small Site or Blog - This ruleset contains 14 rules that are applicable to&lt;br /&gt;small websites or blogs. These are Rule 1, 4, 5, 6, 7, 9, 10, 11, 12, 16, 17, 20, 21 and 22.&lt;/p&gt;&lt;p&gt;In addition to these rulesets, you can also create your own set of rules. For more information on creating custom set of rules, read &lt;a href="http://developer.yahoo.com/#customrules" target="_blank"&gt;Customizing Rulesets&lt;/a&gt;.&lt;/p&gt;&lt;h5&gt;&lt;span style="font-size:130%;"&gt;Grade&lt;/span&gt;&lt;/h5&gt;&lt;p align="justify"&gt;‘Grade’ is one of the four tabs as shown below and depicts a report card on our page’s performance. &lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_0j4bzarlOBg/TErIuKuMYNI/AAAAAAAABPA/egCXA9S4EMg/s1600-h/image%5B11%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_0j4bzarlOBg/TErIvD3lVkI/AAAAAAAABPE/9TzDRYA8eY4/image_thumb%5B5%5D.png?imgmax=800" width="175" height="48" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;YSlow examines all the components of a webpage and then grades the web page based on one of three predefined ruleset or even a custom-defined ruleset, we discussed about in the Rulesets section. How the grading works, is when YSlow analyzes a webpage, it deducts points for every breach of a rule and then applies a grade to each rule. Here’s a sample screenshot of the grades received by the webpage for each rule and the suggestion for improvement, shown on the right.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_0j4bzarlOBg/TErIv2_j4-I/AAAAAAAABPI/BgG7naEh6rM/s1600-h/image%5B26%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TErIxFDCPUI/AAAAAAAABPM/6hWKzDbLnEY/image_thumb%5B14%5D.png?imgmax=800" width="544" height="143" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;Then a final grade is computed (in our case ‘B’) by summing up the values of the points gained for each rule, weighted by the rule's importance. &lt;/p&gt;&lt;h5&gt;&lt;span style="font-size:130%;"&gt;Components&lt;/span&gt;&lt;/h5&gt;&lt;p&gt;Components is the second of the four tabs as shown below:&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_0j4bzarlOBg/TErIykZCXsI/AAAAAAAABPQ/f1wSJpdeZTA/s1600-h/image%5B35%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TErIz8TYC7I/AAAAAAAABPU/h9OuXnuD8NI/image_thumb%5B19%5D.png?imgmax=800" width="571" height="220" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;The Component tab shows the various components on the page (javascript, css etc) and information related to each component (click the ‘+’ icon or ‘Expand All’ link). This will give you an idea which component takes more time to load and you can consider to gzip it and improve performance.&lt;/p&gt;&lt;h5&gt;&lt;span style="font-size:130%;"&gt;Statistics&lt;/span&gt;&lt;/h5&gt;&lt;p align="justify"&gt;Statistics is the third tab and provides a graphical representation of the number of HTTP requests made to the server and the total weight of the page in kilobytes for both Empty Cache and Primed Cache scenarios.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_0j4bzarlOBg/TErI09H-oKI/AAAAAAAABPY/WHhVdRwzwGI/s1600-h/image%5B34%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_0j4bzarlOBg/TErI18neP-I/AAAAAAAABPc/i3RMF00QNlg/image_thumb%5B18%5D.png?imgmax=800" width="571" height="168" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;The Empty Cache scenario is when the browser makes the first request to the page and the Primed Cache scenario is when the browser has a cached version of the page. In a Primed Cache scenario, the components are already in the cache, so this will reduce the number of HTTP requests and thereby the weight of the page. &lt;/p&gt;&lt;h5&gt;&lt;span style="font-size:130%;"&gt;Tools&lt;/span&gt;&lt;/h5&gt;&lt;p align="justify"&gt;Tools is the last tab and contains a list of various tools that YSlow suggests to run on the webpage resources (images, JavaScript, CSS) to improve the performance of the page.&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh3.ggpht.com/_0j4bzarlOBg/TErI3Gco8QI/AAAAAAAABPg/glYltuurEFU/s1600-h/image%5B38%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TErI49adRMI/AAAAAAAABPk/yRXs31gy5mk/image_thumb%5B22%5D.png?imgmax=800" width="571" height="216" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;With this, I hope this quick guide explained what YSlow is all about and how you can use it to analyze and improve the performance of your web pages. I am going to apply this tool on my web pages and follow the recommendations made by this tool to improve performance. I hope you do the same for your web pages too! You can read more about YSlow in the &lt;a href="http://developer.yahoo.com/yslow/help/" target="_blank"&gt;YSlow User Guide&lt;/a&gt;. &lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5369/" target="_blank"&gt;Link to Download YSlow&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-2602523479938740120?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/DDgOwA2-0Hc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/DDgOwA2-0Hc/understanding-yslow-firebug-extension.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>2</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/understanding-yslow-firebug-extension.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-8444208033640464958</guid><pubDate>Fri, 23 Jul 2010 11:05:00 +0000</pubDate><atom:updated>2010-07-23T04:05:00.984-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Expand a TextBox on Focus using jQuery</title><description>&lt;p&gt;Here’s how to animate and expand the height and width of a TextBox when it receives focus. After a delay, the TextBox returns to its normal size&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;html &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Expand a TextBox on Focus in jQuery&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;style &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/css"&amp;gt;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:maroon;"&gt;.txt   &lt;br /&gt;    &lt;/span&gt;{&lt;br /&gt;        &lt;span style="color:red;"&gt;width&lt;/span&gt;:&lt;span style="color:blue;"&gt;100px&lt;/span&gt;;&lt;br /&gt;        &lt;span style="color:red;"&gt;height&lt;/span&gt;:&lt;span style="color:blue;"&gt;15px&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;style&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;script  &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;src&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;script &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript"&amp;gt;&lt;br /&gt;    &lt;/span&gt;$(&lt;span style="color:blue;"&gt;function &lt;/span&gt;() {&lt;br /&gt;        $(&lt;span style="color:maroon;"&gt;".txt"&lt;/span&gt;).focus(&lt;span style="color:blue;"&gt;function &lt;/span&gt;() {&lt;br /&gt;            $(&lt;span style="color:blue;"&gt;this&lt;/span&gt;).animate({           &lt;br /&gt;                width: &lt;span style="color:maroon;"&gt;'200px'&lt;/span&gt;,&lt;br /&gt;                height: &lt;span style="color:maroon;"&gt;'40px'&lt;br /&gt;                &lt;/span&gt;},&lt;br /&gt;               &lt;span style="color:maroon;"&gt;"slow"&lt;br /&gt;            &lt;/span&gt;)&lt;br /&gt;            .delay(2000)&lt;br /&gt;            .animate({&lt;br /&gt;                width: &lt;span style="color:maroon;"&gt;'100px'&lt;/span&gt;,&lt;br /&gt;                height: &lt;span style="color:maroon;"&gt;'15px'&lt;br /&gt;                &lt;/span&gt;},&lt;br /&gt;                &lt;span style="color:maroon;"&gt;"slow"&lt;br /&gt;            &lt;/span&gt;);&lt;br /&gt;        });&lt;br /&gt;    });&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;       &lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;input &lt;/span&gt;&lt;span style="color:red;"&gt;class&lt;/span&gt;&lt;span style="color:blue;"&gt;="txt" &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text"&lt;br /&gt;        &lt;/span&gt;&lt;span style="color:red;"&gt;value&lt;/span&gt;&lt;span style="color:blue;"&gt;="Some Text Some Text Some Text" /&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon;"&gt;br &lt;/span&gt;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;div&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon;"&gt;html&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p align="justify"&gt;The code is self explanatory. We first animate the height and width of the TextBox and increase its size. We then set a &lt;a href="http://api.jquery.com/delay/" target="_blank"&gt;delay()&lt;/a&gt; and then animate the height and width back to what it was earlier. &lt;/p&gt;&lt;p&gt;See a &lt;strong&gt;&lt;a href="http://jsbin.com/uduzo" target="_blank"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-8444208033640464958?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/RYvYmjcC_Bs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/RYvYmjcC_Bs/expand-textbox-on-focus-using-jquery.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/expand-textbox-on-focus-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-1040508083759691805</guid><pubDate>Thu, 22 Jul 2010 11:05:00 +0000</pubDate><atom:updated>2010-07-22T04:32:05.454-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><category domain="http://www.blogger.com/atom/ns#">Windows 7</category><title>Free Antivirus Software for your Windows OS</title><description>&lt;p align="justify"&gt;I am a Windows power user and have the habit of regularly backing up my data, use a firewall, understand the pitfalls of bad internet behavior, regularly keep my OS updated with patches and do a lot of other stuff that other power users do to keep the system safe. However in addition to all of these points, I also use an Antivirus for my machine, just to add an extra layer of security.&lt;/p&gt;&lt;p align="justify"&gt;Here is a short review and list of FREE Antivirus Programs if you are running Windows OS. Please note that this list is not comprehensive and contains only the Antivirus programs that I have used and tested on my machine.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://www.microsoft.com/security_essentials/" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;Microsoft Security Essentials&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;IMHO, Microsoft Security Essentials is one of the best Antivirus solutions (in the freebee category) to guard your PC against viruses, spyware, and other malicious software. The automatic upgrades are smooth, the software is lightweight, runs quietly without constant interruptions and is very easy to use. You should have genuine Windows to install Microsoft Security Essentials. There’s also a new &lt;a href="http://windowsteamblog.com/windows/b/bloggingwindows/archive/2010/07/20/beta-for-next-version-of-microsoft-security-essentials-now-available.aspx" target="_blank"&gt;&lt;strong&gt;Beta for Next Version of Microsoft Security Essentials Now Available&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Terms of Use:&lt;/strong&gt; As mentioned in the &lt;a href="http://www.microsoft.com/security_essentials/eula.aspx#mainNav" target="_blank"&gt;Eula&lt;/a&gt;, “&lt;em&gt;You may install and use any number of copies of the software on your devices in your household for use by people who reside there or for use in your home-based small business&lt;/em&gt;”&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;OS Supported:&lt;/strong&gt; Windows XP (Service Pack 2 or Service Pack 3)/Windows Vista (Gold, Service Pack 1, or Service Pack 2)/ Windows 7 (32/64 bit)&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://www.avast.com/free-antivirus-download" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;avast!&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;avast! provides good protection against viruses, spyware and other forms of malicious software. One of the features that I specifically liked was that avast runs in Safe Mode too, has a Boot time scanner, is easy to use and does not take a lot of my system resources. It’s free edition does not contain a spam filter nor does it provide any technical support, which I feel is a serious limitation.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Terms of Use:&lt;/strong&gt; &lt;em&gt;avast! Free Antivirus is free only for personal and non-commercial use&lt;/em&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Features:&lt;/strong&gt; &lt;a title="http://www.avast.com/free-antivirus-download#tab2" href="http://www.avast.com/free-antivirus-download#tab2" target="_blank"&gt;http://www.avast.com/free-antivirus-download#tab2&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;OS Supported:&lt;/strong&gt; Microsoft Windows 2000, Microsoft Windows XP/Vista/7 (32/64 bit)&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://www.free-av.com/en/products/1/avira_antivir_personal__free_antivirus.html" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;Avira AntiVir&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;Avira AntiVir Personal is a free antivirus solution against malicious programs such as viruses, Trojans, backdoor programs, hoaxes, worms, dialers etc. It’s free edition supports Netbook with low resolution, comes with a Generic Repair option for your PC and also &lt;strong&gt;includes customer support&lt;/strong&gt;. Although I haven’t personally used their support, friends have given me a feedback that their support is very prompt. I found that at times it gives out false alerts ‘too frequently’ but that can be controlled by &lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;Terms of Use:&lt;/strong&gt; Free of charge virus protection to home-users, for personal use only, and is not for business or commercial use.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;OS Supported:&lt;/strong&gt; Unix/ Windows 2000, SP4 and update rollup 1, Windows XP, SP2/ Vista (SP 1 recommended)/ Windows 7 (32/64 Bit)&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;u&gt;&lt;span style="font-size:130%;"&gt;Other Free Antivirus Softwares&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;/p&gt;&lt;p align="justify"&gt;Apart from the ones listed above, a quick search reveals some free antivirus solutions like &lt;a href="http://free.avg.com/in-en/download-avg-anti-virus-free" target="_blank"&gt;AVG&lt;/a&gt;, &lt;a href="http://www.clamwin.com/" target="_blank"&gt;ClamWin&lt;/a&gt;, &lt;a href="http://antivirus.comodo.com/antivirus.php" target="_blank"&gt;Comodo&lt;/a&gt; etc. There is also a &lt;a href="http://superuser.com/questions/2/free-antivirus-solutions-for-windows" target="_blank"&gt;good thread on superuser.com&lt;/a&gt; that discusses free antivirus solutions.&lt;/p&gt;&lt;p align="justify"&gt;If you are looking out for a paid Antivirus solutions then I strongly recommend to try &lt;a href="http://www.amazon.com/gp/product/B0024LZD6Y?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B0024LZD6Y" target="_blank"&gt;&lt;strong&gt;ESET NOD32 Antivirus 4&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-1040508083759691805?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/_XXcLvNAB78" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/_XXcLvNAB78/free-antivirus-software-for-your.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/free-antivirus-software-for-your.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-8181190360201258011</guid><pubDate>Wed, 21 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-21T03:55:00.796-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows 7</category><title>Improve Laptop Battery Performance in Windows 7</title><description>&lt;p align="justify"&gt;I use Windows 7 on an &lt;a href="http://www.amazon.com/gp/product/B0032B4ZNM?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B0032B4ZNM" target="_blank"&gt;&lt;strong&gt;ASUS Netbook&lt;/strong&gt;&lt;/a&gt; that runs on a battery for 6-9 hours. One thing that always comes to my mind is why does my battery life fluctuate +-3 hours and how can I improve my netbook’s battery life and performance. &lt;/p&gt;&lt;p align="justify"&gt;Well Windows 7 has just the right utility to provide that information. It’s called PowerCfg. Here’s how to use this utility.&lt;/p&gt;&lt;p align="justify"&gt;Go to Start &amp;gt; All Programs &amp;gt; Accessories &amp;gt; Command Prompt. Right click &amp;gt; Run as administrator.&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://lh6.ggpht.com/_0j4bzarlOBg/TEbMpSn2OYI/AAAAAAAABNg/WqSg75UhNO0/s1600-h/image%5B11%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TEbMqaC2KKI/AAAAAAAABNk/qpFpvmKe-24/image_thumb%5B3%5D.png?imgmax=800" width="404" height="159" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;Type the following command &lt;strong&gt;powercfg –energy &lt;/strong&gt;on the command prompt and hit enter. You will get a screen similar to the following screenshot:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; It’s best to run this command when your system is in an idle state.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_0j4bzarlOBg/TEbMrDORfOI/AAAAAAAABNo/A0wZxe1ioKY/s1600-h/image%5B2%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TEbMrzl5WjI/AAAAAAAABNs/zre_Wv5_wCE/image_thumb.png?imgmax=800" width="512" height="170" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;After 60 seconds, Windows creates an HTML file called ‘energy-report.html’ in C:\windows\system32. This report gives you an overview of your system’s energy efficiency over a 60 second period. Here are some screenshots of the report when I ran it on my netbook.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_0j4bzarlOBg/TEbMsmHH38I/AAAAAAAABNw/28IHOhc9Fsk/s1600-h/image%5B26%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TEbMtuJSOdI/AAAAAAAABN0/hMp0QYtkO8s/image_thumb%5B10%5D.png?imgmax=800" width="480" height="412" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;The report also give warnings of processes with significant processor utilization.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_0j4bzarlOBg/TEbMuvKsFwI/AAAAAAAABN4/s_Eiit2ZgUQ/s1600-h/image%5B18%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TEbMvWwl1qI/AAAAAAAABN8/U2w4noiFLRM/image_thumb%5B6%5D.png?imgmax=800" width="583" height="141" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Read more about this utility in this whitepaper &lt;a href="http://www.microsoft.com/whdc/system/pnppwr/powermgmt/powercfg.mspx" target="_blank"&gt;Using PowerCfg to Evaluate System Energy Efficiency&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-8181190360201258011?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/e5nawG8y1BM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/e5nawG8y1BM/improve-laptop-battery-performance-in.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/improve-laptop-battery-performance-in.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-2272516573801460358</guid><pubDate>Tue, 20 Jul 2010 11:55:00 +0000</pubDate><atom:updated>2010-07-20T04:56:52.976-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Create a List&lt;string&gt; from a Delimited string</title><description>&lt;p align="justify"&gt;Here’s how to create a List&amp;lt;string&amp;gt; from a Delimited string using the &lt;a href="http://msdn.microsoft.com/en-us/library/bb342261.aspx" target="_blank"&gt;Enumerable.ToList&lt;/a&gt; method&lt;/p&gt;&lt;p&gt;C#&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; lstNew = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;br /&gt;    &lt;span style="color:blue;"&gt;string &lt;/span&gt;s = &lt;span style="color:#a31515;"&gt;"jQuery MooTools Prototype"&lt;/span&gt;;&lt;br /&gt;    &lt;span style="color:blue;"&gt;char &lt;/span&gt;separator = &lt;span style="color:#a31515;"&gt;' '&lt;/span&gt;;&lt;br /&gt;    lstNew = s.Split(separator).ToList();&lt;br /&gt;    PrintList(lstNew);&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.ReadLine();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;static void &lt;/span&gt;PrintList(&lt;span style="color:#2b91af;"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; str)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;s &lt;span style="color:blue;"&gt;in &lt;/span&gt;str)&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(s);&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;"-------------"&lt;/span&gt;);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;VB.NET&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;Sub &lt;/span&gt;Main()&lt;br /&gt;    &lt;span style="color:blue;"&gt;Dim &lt;/span&gt;lstNew &lt;span style="color:blue;"&gt;As &lt;/span&gt;IEnumerable(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;) = &lt;span style="color:blue;"&gt;Nothing&lt;br /&gt;    Dim &lt;/span&gt;s &lt;span style="color:blue;"&gt;As String &lt;/span&gt;= &lt;span style="color:darkred;"&gt;"jQuery MooTools Prototype"&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;Dim &lt;/span&gt;separator &lt;span style="color:blue;"&gt;As Char &lt;/span&gt;= &lt;span style="color:darkred;"&gt;" "&lt;/span&gt;c&lt;br /&gt;    lstNew = s.Split(separator).ToList()&lt;br /&gt;    PrintList(lstNew)&lt;br /&gt;    Console.ReadLine()&lt;br /&gt;&lt;span style="color:blue;"&gt;End Sub&lt;br /&gt;&lt;br /&gt;Shared Sub &lt;/span&gt;PrintList(&lt;span style="color:blue;"&gt;ByVal &lt;/span&gt;str &lt;span style="color:blue;"&gt;As &lt;/span&gt;IEnumerable(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;))&lt;br /&gt;    &lt;span style="color:blue;"&gt;For Each &lt;/span&gt;s &lt;span style="color:blue;"&gt;In &lt;/span&gt;str&lt;br /&gt;        Console.WriteLine(s)&lt;br /&gt;    &lt;span style="color:blue;"&gt;Next &lt;/span&gt;s&lt;br /&gt;    Console.WriteLine(&lt;span style="color:darkred;"&gt;"-------------"&lt;/span&gt;)&lt;br /&gt;&lt;span style="color:blue;"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TEWOuHabUrI/AAAAAAAABNc/NHwFsoGjd0I/image%5B2%5D.png?imgmax=800" width="131" height="62" /&gt; &lt;/p&gt;&lt;p align="justify"&gt;Read more tips in my article over here &lt;b&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=449" target="_blank"&gt;Some Common Operations using List&amp;lt;string&amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-2272516573801460358?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/3vo7T4fl4q0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/3vo7T4fl4q0/create-list-from-delimited-string.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/create-list-from-delimited-string.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-8775387651083498944</guid><pubDate>Mon, 19 Jul 2010 11:55:00 +0000</pubDate><atom:updated>2010-07-19T05:02:30.327-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>Test Regular Expressions in Your Browser</title><description>&lt;p align="justify"&gt;After you have created a regular expression, you usually write a script or use a tool to test if the Regex works as expected. Alternatively, if you are using Firefox or Google Chrome, then here are some plug-ins that make it very simple to test regular expression directly from your browser. I had recently written a post on &lt;a href="http://www.devcurry.com/2010/07/validate-us-zip-code-using-javascript.html" target="_blank"&gt;Validate US Zip Code using JavaScript&lt;/a&gt; where I had used the Regex ^[0-9]{5}(?:-[0-9]{4})?$ We will use the same regex for this post and test it using the add-ons for Firefox and Chrome.&lt;/p&gt;&lt;p&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/2077/" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;Regular Expressions Tester 3.0&lt;/span&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;This is a Firefox add-on for regular expressions with color highlighting (including submatches) and helpers for creating expressions. Observe in the screenshot shown below how the color changes to yellow as soon as the Regex matches a valid US zip code.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_0j4bzarlOBg/TEQiBZycoUI/AAAAAAAABNE/gF_FPlv6msI/s1600-h/image%5B3%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TEQiCgHn53I/AAAAAAAABNI/9yZmnskW8Y8/image_thumb%5B1%5D.png?imgmax=800" width="395" height="437" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/extensions/detail/pgnkpcgniljiolidjmodgfljeomjjiha" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;Regular Expression Checker&lt;/span&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;This is a simple add-on for Google Chrome and is inspired by Regular Expressions Tester 3.0. You can save a regular expression and the tool also shows the number of matches, sub patterns etc. The only thing that I was not comfortable with was that this tool wanted access to my browser history to work properly. Now I am not sure why was that required. Nevertheless, here’s a screenshot of the results after testing my Regex.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_0j4bzarlOBg/TEQiDdsYqBI/AAAAAAAABNM/vcKS_5WIMBg/s1600-h/image%5B14%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TEQiEEtEG6I/AAAAAAAABNQ/dDwx3opS1R0/image_thumb%5B6%5D.png?imgmax=800" width="395" height="351" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p align="justify"&gt;I could not find any add-ons for Internet Explorer that can test Regular Expressions. If you know of any such add-on, let me know and I will add it to this list.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-8775387651083498944?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/eyslMLqe1ew" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/eyslMLqe1ew/test-regular-expressions-in-your.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>1</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/test-regular-expressions-in-your.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-4216412417243358033</guid><pubDate>Sun, 18 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-18T03:55:00.428-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><title>Validate US Zip Code using JavaScript</title><description>&lt;p&gt;Here’s how to validate US Zip code using JavaScript. We will be using a Regular Expression to do so.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Validate US Zip Code in JavaScript&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript"&amp;gt;&lt;br /&gt;        function &lt;/span&gt;IsValidZipCode(zip) {&lt;br /&gt;            &lt;span style="color:blue;"&gt;var &lt;/span&gt;isValid = /^[0-9]{5}(?:-[0-9]{4})?$/.test(zip);&lt;br /&gt;            &lt;span style="color:blue;"&gt;if &lt;/span&gt;(isValid)&lt;br /&gt;                alert(&lt;span style="color:#a31515;"&gt;'Valid ZipCode'&lt;/span&gt;);&lt;br /&gt;            &lt;span style="color:blue;"&gt;else &lt;/span&gt;{&lt;br /&gt;                alert(&lt;span style="color:#a31515;"&gt;'Invalid ZipCode'&lt;/span&gt;);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    &lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;form&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;input &lt;/span&gt;&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;="txtZip" &lt;/span&gt;&lt;span style="color:red;"&gt;name&lt;/span&gt;&lt;span style="color:blue;"&gt;="zip" &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text" /&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;br &lt;/span&gt;&lt;span style="color:blue;"&gt;/&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;input &lt;/span&gt;&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;="Button1" &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="submit" &lt;/span&gt;&lt;span style="color:red;"&gt;value&lt;/span&gt;&lt;span style="color:blue;"&gt;="Validate"&lt;br /&gt;&lt;/span&gt;&lt;span style="color:red;"&gt;onclick&lt;/span&gt;&lt;span style="color:blue;"&gt;="IsValidZipCode(this.form.zip.value)" /&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;form&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;The code above validates a US zip code based on both the five digit (12345) as well as nine-digit (12345-1234 ) schemes.&lt;/p&gt;&lt;p&gt;See a &lt;strong&gt;&lt;a href="http://jsbin.com/owalo3" target="_blank"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-4216412417243358033?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/daq1D3r55Sk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/daq1D3r55Sk/validate-us-zip-code-using-javascript.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>2</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/validate-us-zip-code-using-javascript.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-6244836889398261654</guid><pubDate>Sat, 17 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-17T03:55:00.195-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><title>Display Date in MM/DD/YYYY format using JavaScript</title><description>&lt;p&gt;To display a date in mm/dd/yyyy format in JavaScript, use this script&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript"&amp;gt;&lt;br /&gt;    var &lt;/span&gt;currentDt = &lt;span style="color:blue;"&gt;new &lt;/span&gt;Date();&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;mm = currentDt.getMonth() + 1;&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;dd = currentDt.getDate();&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;yyyy = currentDt.getFullYear();&lt;br /&gt;    &lt;span style="color:blue;"&gt;var &lt;/span&gt;date = mm + &lt;span style="color:#a31515;"&gt;'/' &lt;/span&gt;+ dd + &lt;span style="color:#a31515;"&gt;'/' &lt;/span&gt;+ yyyy;&lt;br /&gt;    alert(date);       &lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_0j4bzarlOBg/TEGI4ltADiI/AAAAAAAABM8/1TmoxRHw5zE/image%5B2%5D.png?imgmax=800" width="184" height="175" /&gt; &lt;/p&gt;&lt;p&gt;Similarly if you want to always represent the month as double digits, just add a ‘0’ as shown below:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;mm = currentDt.getMonth() + 1;&lt;br /&gt;mm = (mm &amp;lt; 10) ? &lt;span style="color:#a31515;"&gt;'0' &lt;/span&gt;+ mm : mm;&lt;/pre&gt;&lt;p&gt;The output now is:&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TEGI5UKnmPI/AAAAAAAABNA/NzHDAfjWr0A/image%5B5%5D.png?imgmax=800" width="188" height="173" /&gt; &lt;/p&gt;&lt;p&gt;If you know of a better way without using any JavaScript frameworks, I would love to hear it! Use the comments section.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-6244836889398261654?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/IQy9eLpuwhg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/IQy9eLpuwhg/display-date-in-mmddyyyy-format-using.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>1</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/display-date-in-mmddyyyy-format-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-1509747018745665052</guid><pubDate>Fri, 16 Jul 2010 17:02:00 +0000</pubDate><atom:updated>2010-07-16T10:05:50.562-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Free Learning</category><title>Office 2010 Getting Started and User Resources Guides</title><description>&lt;p align="justify"&gt;If you are excited about the recent Office 2010 release and are keen to learn the new features, then here’s some free learning material for you!&lt;/p&gt;&lt;p align="justify"&gt;Microsoft recently published PDF’s of ‘Getting Started Guides’ and documents related to Office 2010, including an overview, product guide, getting started, and new features.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=689351f3-6d82-4e5c-b3ee-af33008d68fa" target="_blank"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TECQqAuyCwI/AAAAAAAABM4/1p3fsp_8ANc/image%5B4%5D.png?imgmax=800" width="568" height="621" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Download &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=689351f3-6d82-4e5c-b3ee-af33008d68fa" target="_blank"&gt;&lt;strong&gt;Office 2010 User Resources&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-1509747018745665052?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/WDD4551e1Ns" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/WDD4551e1Ns/office-2010-getting-started-and-user.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/office-2010-getting-started-and-user.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-3915915423173104041</guid><pubDate>Thu, 15 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-15T05:19:47.507-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>‘Copy To Clipboard’ functionality for your Website</title><description>&lt;p align="justify"&gt;‘Copy Text To Clipboard’ is a frequently requested feature. Different browsers have different security implications when it comes to manipulating the clipboard. For example Firefox by default, does not allow you to store data in the clipboard, although you can override this setting. &lt;/p&gt;&lt;p align="justify"&gt;Users have used JavaScript and Flash as a workaround. Until Flash 9, you could set data on the system clipboard at any time. However with the &lt;a href="http://www.adobe.com/devnet/flashplayer/articles/fplayer10_security_changes_02.html#head31" target="_blank"&gt;changes in Flash 10&lt;/a&gt;, you can manipulate the clipboard only through ActionScript that originates from user interaction, i.e. an explicit mouse click or through the keyboard. &lt;/p&gt;&lt;p align="justify"&gt;I recently came across a free and open source library that is fully compatible with Flash Player 10 and provides an easy way to copy text to the clipboard using an ‘invisible’ Adobe Flash movie and a JavaScript interface. The library is called ‘&lt;a href="http://code.google.com/p/zeroclipboard/" target="_blank"&gt;&lt;strong&gt;zeroclipboard&lt;/strong&gt;&lt;/a&gt;’. How this library works is that it overlays a Flash object over a button or any other DOM element that initiates the copy. So when the user clicks the element, the Flash object registers an explicit action and copies text into the clipboard, which sounds perfectly ‘legal’ as I may say so.&lt;/p&gt;&lt;p align="justify"&gt;This library requires that the browser has JavaScript enabled and FlashPlayer installed. You can learn how to use the library through the &lt;a href="http://code.google.com/p/zeroclipboard/wiki/Instructions" target="_blank"&gt;Instructions Wiki&lt;/a&gt;. Also see a &lt;a href="http://bowser.macminicolo.net/~jhuckaby/zeroclipboard/" target="_blank"&gt;working Demo&lt;/a&gt;.&lt;/p&gt;&lt;p align="justify"&gt;As always, I would love to hear some alternate solutions. Feel free to drop in your comments!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-3915915423173104041?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/xtZabFkVK4s" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/xtZabFkVK4s/copy-to-clipboard-functionality-for.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/copy-to-clipboard-functionality-for.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-3677198968193246397</guid><pubDate>Wed, 14 Jul 2010 12:00:00 +0000</pubDate><atom:updated>2010-07-14T05:01:26.192-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Product Releases</category><title>Windows Phone 7 Developer Tools Beta and Training Kit</title><description>&lt;p align="justify"&gt;If you are a &lt;a href="http://www.windowsphone7.com/" target="_blank"&gt;Windows Phone 7&lt;/a&gt; Developer, then here’s an update. Microsoft just released the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3" target="_blank"&gt;Windows Phone 7 Developer Tools Beta&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;Check the &lt;a href="http://msdn.microsoft.com/en-us/library/ff637516(v=VS.92).aspx" target="_blank"&gt;Release notes for the Beta&lt;/a&gt;. As quoted in &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/07/12/windows-phone-7-developer-tools-beta-released.aspx" target="_blank"&gt;Scott Gu’s post&lt;/a&gt; and the &lt;a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/07/12/windows-phone-developer-tools-beta-released.aspx" target="_blank"&gt;Official blog post&lt;/a&gt;, here are some major changes:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;b&gt;Microsoft Expression Blend for Windows Phone&lt;/b&gt; – Blend is now integrated completely into the Windows Phone Developer Tools Beta. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;b&gt;Developer Registration Utility&lt;/b&gt; – Now you can unlock you Windows Phone 7 device for development purposes. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;b&gt;XAP Deployment Tool&lt;/b&gt; – if you want to deploy XAP files directly to an unlocked device, now you can. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;b&gt;The Windows Phone 7 API &lt;/b&gt;– we’re getting close to completion.  Many namespaces that were previously distributed over several different DLLs have now been consolidated into one.  In addition, there have been realignments and changes in several other namespaces as well.  Push Notifications, Accelerometer and App Bar APIs have all been updated. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;b&gt;Additional Controls&lt;/b&gt; – There are some additional controls coming in the next few weeks (i.e. Panorama and Pivot) which didn’t make the beta release.  They are coming soon. &lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;&lt;b&gt;Control Templates&lt;/b&gt; – Silverlight for Windows Phone control templates have been updated to match evolutions in the overall OS.&lt;/div&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p align="justify"&gt;You can also download the &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=ca23285f-bab8-47fa-b364-11553e076a9a" target="_blank"&gt;Windows Phone 7 Training Kit for Developers - Beta Refresh&lt;/a&gt;. This  Training Kit will give you a jumpstart into the new Windows Phone world by providing you with a step-by-step explanation of the tools to use and some key concepts for programming Windows Phones&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-3677198968193246397?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/8Y3iFsf0M1E" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/8Y3iFsf0M1E/windows-phone-7-developer-tools-beta.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/windows-phone-7-developer-tools-beta.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-6177511770518509328</guid><pubDate>Tue, 13 Jul 2010 12:05:00 +0000</pubDate><atom:updated>2010-07-13T05:41:27.600-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>Online Tools to Test Mobile Readiness of Your WebSites</title><description>&lt;p align="justify"&gt;There is a surge of mobile phones in the market and users nowadays spend a good amount of their time browsing the Internet on their handsets. In order to target this user base and give them a good ux on their mobile sets, you should consider designing your websites for mobile users too and test it for mobile readiness. This way you can find and fix issues early on during the design and take steps to correct them. &lt;/p&gt;&lt;p align="justify"&gt;Here are some online tools to test mobile readiness for your websites.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://ready.mobi/" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;mobiReady&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;mobiReady evaluates mobile readiness for your websites by doing an in-depth analysis of your pages to determine how well your site performs on a mobile device. I did an analysis of &lt;a href="http://www.facebook.com/" target="_blank"&gt;www.FaceBook.com&lt;/a&gt; and here are the results:&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TDxN1aUBNOI/AAAAAAAABMc/oRYl7zHDAmM/image%5B2%5D.png?imgmax=800" width="397" height="296" /&gt; &lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TDxN25JTv8I/AAAAAAAABMg/-aWzBaafctM/image%5B19%5D.png?imgmax=800" width="543" height="422" /&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://emulator.mtld.mobi/emulator.php" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;dotMobi&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;The dotMobi mobile phone emulator emulates a real mobile phone Web browser. You need to specify a website (in our case Facebook.com) and hit the Submit button to see how your site looks to a mobile phone user. &lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TDxN3fxIugI/AAAAAAAABMk/9Lp-fdAyckE/image%5B14%5D.png?imgmax=800" width="214" height="59" /&gt; &lt;/p&gt;&lt;p align="justify"&gt;Note: You must have JAVA enabled on your browser to utilize the .mobi mobile emulator.&lt;/p&gt;&lt;p align="justify"&gt;As of this writing, there are two skins available for Nokia N70 and Sony K750. Here’s how Facebook looks on a Sony K750 phone.&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TDxN4n-gpnI/AAAAAAAABMo/ScAdSjCxQ_0/image%5B11%5D.png?imgmax=800" width="305" height="643" /&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://iphonetester.com/" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;iPhoneTester&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;iPhoneTester is an online iPhone&lt;em&gt; &lt;/em&gt;simulator to test iPhone specific websites. I tested the Facebook iPhone specific site called &lt;a href="http://iphone.facebook.com/" target="_blank"&gt;iphone.facebook.com&lt;/a&gt; to check if the website fits correctly on the iPhone's limited screen space. Here is how the site looks on a landscape view!&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TDxN5md2_kI/AAAAAAAABMs/XWkwi8WFZMU/image%5B18%5D.png?imgmax=800" width="541" height="315" /&gt; &lt;/p&gt;&lt;p align="justify"&gt;As an alternative to iPhoneTester, you can also use &lt;a href="http://www.testiphone.com/" target="_blank"&gt;TestiPhone&lt;/a&gt; which allows you to pass the simulator request parameters to change the way it behaves.&lt;/p&gt;&lt;p&gt;I hope you liked these tools. If you know of any other online tool to test mobile readiness, please share them with the viewers in the comments section.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-6177511770518509328?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/Ypsc8ECSQK4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/Ypsc8ECSQK4/online-tools-to-test-mobile-readiness.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/online-tools-to-test-mobile-readiness.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-839154118256813918</guid><pubDate>Mon, 12 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-12T03:55:00.383-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JavaScript</category><title>How to Disable JavaScript on browsers running IE6 or Lesser</title><description>&lt;p align="justify"&gt;Web Developers often face requirements to detect the browser type and version and execute some script based on that. If you are not using any JavaScript framework, then here’s how to execute a script only if the Internet Explorer version is greater than 6 (IE6)&lt;/p&gt;&lt;p align="justify"&gt;Just add this piece of code in between the ‘head’ tags&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Execute script only if &amp;gt; IE 6&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&amp;lt;!--[if gte IE 7]&amp;gt;&lt;br /&gt;&amp;lt;SCRIPT LANGUAGE="Javascript"&amp;gt;&lt;br /&gt;alert("You are running Internet Explorer 7 or greater");&lt;br /&gt;&amp;lt;/SCRIPT&amp;gt;&lt;br /&gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;p align="justify"&gt;This is how Microsoft &lt;a href="http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx" target="_blank"&gt;officially recommends&lt;/a&gt; you to detect the browser type and version. As stated in the documentation,&lt;/p&gt;&lt;p align="justify"&gt;&lt;em&gt;“The downlevel-hidden conditional comment contains hyphens ("--") in the opening and closing tag, similar to the basic HTML Comment. The content is placed inside the comment tags. Because the first four characters and the last three characters of the comment are identical to a basic HTML Comment element, downlevel browsers ignore the HTML content inside the comment block”&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-839154118256813918?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/peElqtX5dyM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/peElqtX5dyM/how-to-disable-javascript-on-browsers.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/how-to-disable-javascript-on-browsers.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-728139439020886491</guid><pubDate>Sun, 11 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-11T03:55:00.030-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Convert a List&lt;int&gt; to List&lt;string&gt;</title><description>&lt;p&gt;Here’s how to convert a List&amp;lt;int&amp;gt; to List&amp;lt;string&amp;gt;. Use the &lt;a href="http://msdn.microsoft.com/en-us/library/73fe8cwf.aspx" target="_blank"&gt;List(T).ConvertAll&lt;/a&gt; method&lt;/p&gt;&lt;p&gt;C#&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:green;"&gt;// Convert a List&amp;lt;int&amp;gt; to List&amp;lt;string&amp;gt;&lt;br /&gt;&lt;/span&gt;List&amp;lt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&amp;gt; lstNum = &lt;span style="color:blue;"&gt;new &lt;/span&gt;List&amp;lt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&amp;gt;(&lt;span style="color:blue;"&gt;new int&lt;/span&gt;[] { 3, 6, 7, 9 });&lt;br /&gt;lstNew = lstNum.ConvertAll&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color:blue;"&gt;delegate&lt;/span&gt;(&lt;span style="color:blue;"&gt;int &lt;/span&gt;i)&lt;br /&gt;{&lt;br /&gt;   &lt;span style="color:blue;"&gt;return &lt;/span&gt;i.ToString();&lt;br /&gt;});&lt;br /&gt;PrintList(lstNew);&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;VB.NET&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:green;"&gt;' Convert a List&amp;lt;int&amp;gt; to List&amp;lt;string&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;Dim &lt;/span&gt;lstNum &lt;span style="color:blue;"&gt;As New &lt;/span&gt;List(&lt;span style="color:blue;"&gt;Of Integer&lt;/span&gt;)(&lt;span style="color:blue;"&gt;New Integer&lt;/span&gt;() { 3, 6, 7, 9 })&lt;br /&gt;lstNew = lstNum.ConvertAll(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;)(&lt;span style="color:blue;"&gt;Function&lt;/span&gt;(i &lt;span style="color:blue;"&gt;As Integer&lt;/span&gt;) i.ToString())&lt;br /&gt;PrintList(lstNew)&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_0j4bzarlOBg/TDlkItDB-kI/AAAAAAAABMI/G4ZRuZfHSV8/image%5B2%5D.png?imgmax=800" width="208" height="113" /&gt; &lt;/p&gt;&lt;p&gt;Read more tips over here &lt;b&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=449" target="_blank"&gt;Some Common Operations using List&amp;lt;string&amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-728139439020886491?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/v-1AfZCYDxM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/v-1AfZCYDxM/convert-list-to-list.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/convert-list-to-list.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-4826528447295294759</guid><pubDate>Sat, 10 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-10T03:55:00.747-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>10 Free Tools to Load/Stress Test Your Web Applications</title><description>&lt;p align="justify"&gt;&lt;a href="http://en.wikipedia.org/wiki/Stress_testing_(software)" target="_blank"&gt;Wikipedia&lt;/a&gt; defines Load and Stress Testing as “&lt;em&gt;Load testing is the process of putting demand on a system or device and measuring its response. Stress testing refers to tests that determine the robustness of software by testing beyond the limits of normal operation&lt;/em&gt;”.&lt;/p&gt;&lt;p align="justify"&gt;Due to budget constraints, my clients usually ask for some free tools to load/stress test their application, before going live. Here are some free tools to Load/Stress Test web applications. Please note that this is just a listing and is in ‘no particular order’.&lt;/p&gt;&lt;p align="justify"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;a href="http://grinder.sourceforge.net/" target="_blank"&gt;The Grinder&lt;/a&gt;&lt;/strong&gt;&lt;/span&gt; - The Grinder is a load testing framework that makes it easy to run a distributed test using many load injector machines. Test scripts are written in Jython, and HTTP scripts can be recorded easily from a browser session. &lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;a href="http://www.pylot.org/" target="_blank"&gt;Pylot&lt;/a&gt;&lt;/strong&gt; - Pylot is a free open source tool for testing performance and scalability of web services. It runs HTTP load tests, which are useful for capacity planning, benchmarking, analysis, and system tuning.&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://www.iis.net/community/default.aspx?tabid=34&amp;amp;i=1466&amp;amp;g=6" target="_blank"&gt;&lt;strong&gt;Web Capacity Analysis Tool (WCAT)&lt;/strong&gt;&lt;/a&gt; - Web Capacity Analysis Tool (WCAT) is a lightweight HTTP load generation tool primarily designed to measure the performance of a web server within a controlled environment.  WCAT can simulate thousands of concurrent users making requests to a single web site or multiple web sites.  The WCAT engine uses a simple script to define the set of HTTP requests to be played back to the web server. Extensibility is provided through plug-in DLLs and a standard, simple API.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;a href="http://fwptt.sourceforge.net/index.html" target="_blank"&gt;fwptt&lt;/a&gt;&lt;/strong&gt; - fwptt&lt;strong&gt; &lt;/strong&gt;it's a Web application tester program for load testing web applications. It can record normal and ajax requests. I tested it on asp.net applications, but it should work with jsp, php or other.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;a href="http://sourceforge.net/projects/jcrawler/" target="_blank"&gt;JCrawler&lt;/a&gt;&lt;/strong&gt; - JCrawler is an open-source (under the CPL) Stress-Testing Tool for web-applications. It comes with the crawling/exploratory feature. You can give JCrawler a set of starting URLs and it will begin crawling from that point onwards, going through any URLs it can find on its way and generating load on the web application&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;a href="http://jakarta.apache.org/jmeter/" target="_blank"&gt;Apache JMeter&lt;/a&gt;&lt;/strong&gt; – JMeter&lt;strong&gt; &lt;/strong&gt;is open source software, a 100% pure Java desktop application designed to load test functional behavior and measure performance. It was originally designed for testing Web Applications but has since expanded to other test functions.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;a href="http://www.joedog.org/index/siege-home" target="_blank"&gt;Siege&lt;/a&gt;&lt;/strong&gt; - Siege is an http load testing and benchmarking utility. It was designed to let web developers measure their code under duress, to see how it will stand up to load on the internet. Siege supports basic authentication, cookies, HTTP and HTTPS protocols. It lets its user hit a web server with a configurable number of simulated web browsers.&lt;/p&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;a href="http://www.acme.com/software/http_load/" target="_blank"&gt;http_load&lt;/a&gt;&lt;/strong&gt; - http_load runs multiple http fetches in parallel, to test the throughput of a web server. However unlike most such test clients, it runs in a single process, so it doesn't bog down the client machine. It can be configured to do https fetches as well&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.web-polygraph.org/" target="_blank"&gt;Web Polygraph&lt;/a&gt;&lt;/strong&gt; - Web Polygraph is a freely available performance testing tool for caching proxies, origin server accelerators, L4/7 switches, content filters, and other Web intermediaries&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.opensta.org/" target="_blank"&gt;OpenSTA&lt;/a&gt;&lt;/strong&gt; - OpenSTA is a distributed software testing architecture designed around CORBA. The current toolset has the capability of performing scripted HTTP and HTTPS heavy load tests with performance measurements from Win32 platforms. However, the architectural design means it could be capable of much more.&lt;/p&gt;&lt;p&gt;I hope you liked this list.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-4826528447295294759?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/UkVVYZzCfDw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/UkVVYZzCfDw/10-free-tools-to-loadstress-test-your.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>5</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/10-free-tools-to-loadstress-test-your.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-7683623884370100361</guid><pubDate>Fri, 09 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-16T22:20:00.022-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">jQuery</category><title>Disable Certain Days In a Week using jQuery UI DatePicker</title><description>&lt;p&gt;A couple of days ago, I had posted on &lt;a href="http://www.devcurry.com/2010/07/prevent-users-from-selecting-weekends.html" target="_blank"&gt;Prevent Users from Selecting Weekends using jQuery UI DatePicker&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Dominic mailed asking if it was possible to do this without using the built-in function 'noWeekends'. He wanted to disable Tuesdays and Fridays of every week in the DatePicker. Here’s how to achieve the same:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html &lt;/span&gt;&lt;span style="color:red;"&gt;xmlns&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;Disable Certains Days in a Week using jQuery UI DatePicker&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;title&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;link &lt;/span&gt;&lt;span style="color:red;"&gt;rel&lt;/span&gt;&lt;span style="color:blue;"&gt;="Stylesheet" &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/css" &lt;/span&gt;&lt;span style="color:red;"&gt;href&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://ajax.googleapis.com/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" /&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script  &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript" &lt;/span&gt;&lt;span style="color:red;"&gt;src&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://ajax.microsoft.com/ajax/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;jquery/jquery-1.4.2.min.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript" &lt;/span&gt;&lt;span style="color:red;"&gt;src&lt;/span&gt;&lt;span style="color:blue;"&gt;="http://ajax.googleapis.com/ajax/libs/&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;jqueryui/1.8.2/jquery-ui.min.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script &lt;/span&gt;&lt;span style="color:red;"&gt;type&lt;/span&gt;&lt;span style="color:blue;"&gt;="text/javascript"&amp;gt;&lt;br /&gt;    &lt;/span&gt;$(&lt;span style="color:blue;"&gt;function&lt;/span&gt;() {&lt;br /&gt;        $(&lt;span style="color:#a31515;"&gt;"#datepic"&lt;/span&gt;).datepicker(&lt;br /&gt;        { beforeShowDay: &lt;span style="color:blue;"&gt;function&lt;/span&gt;(day) {&lt;br /&gt;            &lt;span style="color:blue;"&gt;var &lt;/span&gt;day = day.getDay();&lt;br /&gt;            &lt;span style="color:blue;"&gt;if &lt;/span&gt;(day == 2 || day == 5) {&lt;br /&gt;                &lt;span style="color:blue;"&gt;return &lt;/span&gt;[&lt;span style="color:blue;"&gt;false&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"somecssclass"&lt;/span&gt;]&lt;br /&gt;            } &lt;span style="color:blue;"&gt;else &lt;/span&gt;{&lt;br /&gt;                &lt;span style="color:blue;"&gt;return &lt;/span&gt;[&lt;span style="color:blue;"&gt;true&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"someothercssclass"&lt;/span&gt;]&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        });&lt;br /&gt;    });&lt;br /&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;script&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;head&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;input &lt;/span&gt;&lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:blue;"&gt;="datepic"/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;body&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;html&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_0j4bzarlOBg/TDanmjqq9CI/AAAAAAAABME/HvhccVC7XHM/image%5B6%5D.png?imgmax=800" width="338" height="292" /&gt; &lt;/p&gt;&lt;p&gt;See a &lt;strong&gt;&lt;a href="http://jsbin.com/uxowe" target="_blank"&gt;Live Demo&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-7683623884370100361?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/C7kGA9QQC2U" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/C7kGA9QQC2U/disable-certain-days-in-week-using.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>2</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/disable-certain-days-in-week-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-7406522863855723812</guid><pubDate>Thu, 08 Jul 2010 10:55:00 +0000</pubDate><atom:updated>2010-07-08T03:55:00.114-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Misc Ramblings</category><title>Top 10 Questions Related to Data Answered by Microsoft</title><description>&lt;p align="justify"&gt;My colleague and Microsoft MVP &lt;a href="http://amazedsaint.blogspot.com/" target="_blank"&gt;Anoop&lt;/a&gt; shared an interesting tweet yesterday about the &lt;a href="http://msdn.microsoft.com/en-us/data/bb525059.aspx" target="_blank"&gt;&lt;strong&gt;Top 10 Questions Related to Data Answered by Microsoft&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;The questions answered are the following:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;div align="justify"&gt;So what happened to “Oslo”?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Why did you rename ADO.NET Data Services to WCF Data Services?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;Where does Microsoft stand on LINQ to SQL?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;What's happening to the "M" language? How do “M” and the Entity Data Model relate to each other? Which do I choose?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;When does a developer use “M” vs. T-SQL? Should I use “M” rather than T-SQL to define the shape of my data?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;What's New in ADO.NET Entity Framework 4 and WCF Data Services 4?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;What is "Quadrant" and what does it do for me?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;When will the SQL Server Modeling CTP ship?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;How does the SQL Server Modeling CTP relate to .NET?&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div align="justify"&gt;What is the Open Data Protocol (OData)?&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p align="justify"&gt;Check out the answers &lt;a href="http://msdn.microsoft.com/en-us/data/bb525059.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-7406522863855723812?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/q4c8em47FXo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/q4c8em47FXo/top-10-questions-related-to-data.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/top-10-questions-related-to-data.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-9043514982746450761</guid><pubDate>Wed, 07 Jul 2010 09:45:00 +0000</pubDate><atom:updated>2010-07-07T02:46:18.691-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Reviews</category><title>5 JavaScript Books Worth Every Cent</title><description>&lt;p align="justify"&gt;&lt;i&gt;An investment in knowledge always pays the best interest&lt;/i&gt; &lt;em&gt;– Benjamin Franklin&lt;/em&gt;&lt;/p&gt;&lt;p align="justify"&gt;The dynamic web is full of interactive ‘ajaxified’ websites and JavaScript is one of the most important pillars that goes into the construction of these websites. With JavaScript frameworks like jQuery, Prototype, Scriptaculous etc. becoming popular, it has become all the more important to learn and master JavaScript, to be able to use these frameworks effectively and efficiently. To learn a programming language, the simplest way in my opinion is to purchase a good book, read it, and then put the learning into practice, a lot of practice! &lt;/p&gt;&lt;p align="justify"&gt;Here are 5 JavaScript books I strongly recommend if you are looking out to start client-side development and master it. This collection also contains some upcoming books I plan to purchase. I have categorized these books for Beginners as well as Intermediate-Advanced developers.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:Verdana;font-size:130%;"&gt;JavaScript Books For Beginners&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://www.amazon.com/gp/product/1590595335?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1590595335" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;DOM Scripting: Web Design with JavaScript and the Document Object Model&lt;/span&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://www.amazon.com/gp/product/1590595335?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1590595335" target="_blank"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_0j4bzarlOBg/TDQpdMzjVNI/AAAAAAAABLo/hjLLSgEVzCk/image%5B10%5D.png?imgmax=800" width="506" height="572" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;This book is the Get-Start-Go guide for beginners with a good introduction to JavaScript and DOM concepts. Full of clearly explained practical examples (dynamic image gallery, slideshow animations, sample site) that you can use on your website, this book gets you up to speed with JavaScript and DOM in no time. I personally loved Jeremy’s tone of writing as well the presentation of concepts, that makes JavaScript look so easy. Although this book was published a couple of years ago, I strongly recommend this book as an excellent starting point for beginners. Jeremy has also authored &lt;a href="http://www.amazon.com/gp/product/0321472667?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321472667" target="_blank"&gt;Bulletproof Ajax&lt;/a&gt; that you may want to check out. &lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;a href="http://www.amazon.com/gp/product/1847194141?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1847194141" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;Object-Oriented JavaScript: Create scalable, reusable high-quality JavaScript applications and libraries&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://www.amazon.com/gp/product/1847194141?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1847194141" target="_blank"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TDQpe1Q-TOI/AAAAAAAABLs/ODLK0tTRwuA/image%5B11%5D.png?imgmax=800" width="506" height="642" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;After you have read the &lt;a href="http://www.amazon.com/gp/product/1590595335?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1590595335" target="_blank"&gt;DOM Scripting: Web Design with JavaScript and the Document Object Model&lt;/a&gt; book and have gained some level of experience with it, you should consider picking up this book. The first 4 chapters in this book are introductory chapters. The book starts getting exciting Chapter 5 onwards with examples on how to write object-oriented JavaScript. In my opinion, Chapter 8 - Coding and Design Patterns is the best chapter in this book. &lt;/p&gt;&lt;p align="justify"&gt;As a side note, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1843/" target="_blank"&gt;FireBug&lt;/a&gt; comes very handy while reading this book. The hands-on approach demonstrated in this book to write Object Oriented JavaScript code and the usage of patterns, is a reason why I strongly recommend this book.&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;&lt;strong&gt;&lt;span style="font-family:Verdana;font-size:130%;"&gt;JavaScript Books For Intermediate-Advanced Developers&lt;/span&gt; &lt;/strong&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0596517742?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596517742" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;JavaScript: The Good Parts&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0596517742?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596517742" target="_blank"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/_0j4bzarlOBg/TDQpgO3Xg4I/AAAAAAAABL8/90En1S_KAOk/image3%5B1%5D.png?imgmax=800" width="506" height="663" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;&lt;a href="http://www.jslint.com/" target="_blank"&gt;Douglas Crockford&lt;/a&gt;, as many of you already know, is a JavaScript champion and his advices on JavaScript is well known in the community, and when someone like him shares his knowledge through a book, you MUST buy it! This book is not for beginners, but for those who after a brush-up with the language and some hands-on experience, want to take their skills to the next level. &lt;/p&gt;&lt;p align="justify"&gt;This book is to the point, well-written, sincere and does a great job of assessing the good and the bad of JavaScript. The parts where Crockford explains inheritance, invocation, scoping and closures are simply superb. If you are serious about learning JavaScript, you &lt;strong&gt;must have&lt;/strong&gt; this book in your collection. Ever since I read his book, I changed the way I look at JavaScript! &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.amazon.com/gp/product/0596805527?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596805527" target="_blank"&gt;JavaScript: The Definitive Guide: – 6th Edition&lt;/a&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/0596805527?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596805527" target="_blank"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TDQphtmf4YI/AAAAAAAABL0/PNk9n8bzkyo/image17.png?imgmax=800" width="507" height="665" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;Although this book has not yet been released as of this writing, I have David Flanagan’s previous edition – &lt;a href="http://www.amazon.com/gp/product/0596101996?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0596101996" target="_blank"&gt;JavaScript The Definitive Guide (5th Edition)&lt;/a&gt; with me. The 5th Edition was a very popular JavaScript book, gave a deep understanding of JavaScript and was amongst my favorites. &lt;/p&gt;&lt;p align="justify"&gt;There’s no reason for me to believe that the new one will not be as useful as the 5th edition and this one’s definitely going into my collection. From the O’Reilly site: &lt;em&gt;The sixth edition offers comprehensive coverage of ECMAScript 5 (the new language standard) and also the new APIs introduced in HTML5. The chapters on functions and classes have been completely rewritten and updated to match current best practices. A new chapter covers language extensions and subsets.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/193398869X?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=193398869X" target="_blank"&gt;&lt;span style="font-size:130%;"&gt;Secrets of the JavaScript Ninja&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.amazon.com/gp/product/193398869X?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=193398869X" target="_blank"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="JavaScript Ninja" border="0" alt="JavaScript Ninja" src="http://lh6.ggpht.com/_0j4bzarlOBg/TDQpjxX-VuI/AAAAAAAABL4/pLD8Z7kUgJY/image23.png?imgmax=800" width="507" height="565" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p align="justify"&gt;I am a big fan of the creator/lead developer of jQuery and a JavaScript expert, John Resig. I remember purchasing his book &lt;a href="http://www.amazon.com/gp/product/1590597273?ie=UTF8&amp;amp;tag=dotcomandsqlc-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=1590597273" target="_blank"&gt;Pro JavaScript Techniques&lt;/a&gt; way back in 2007 and this is one of the best JavaScript books I have read. &lt;/p&gt;&lt;p align="justify"&gt;I am excited about the soon-to-be-released &lt;em&gt;In Secrets of the JavaScript Ninja&lt;/em&gt; book. In this book, &lt;em&gt;John reveals the inside know-how of the elite JavaScript programmers&lt;/em&gt;. &lt;em&gt;Written to be accessible to JavaScript developers with intermediate-level skills, this book gives you the knowledge you need to create a cross-browser JavaScript library from the ground up.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="justify"&gt;I hope you liked these JavaScript book recommendations. If you are serious about doing some solid client-side development, I would strongly recommend you to invest in these books!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-9043514982746450761?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/eq38GGrVo6k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/eq38GGrVo6k/5-javascript-books-worth-every-cent.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>9</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/5-javascript-books-worth-every-cent.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8980734269859237005.post-2385628282290544591</guid><pubDate>Tue, 06 Jul 2010 12:05:00 +0000</pubDate><atom:updated>2010-07-06T05:05:50.639-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">LINQ</category><title>Count Repeated Words in a List&lt;String&gt;</title><description>&lt;p&gt;Here’s how to count repeated words in a List&amp;lt;string&amp;gt;&lt;/p&gt;&lt;p&gt;C#&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;static void &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;string&lt;/span&gt;[] args)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt; strList = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:blue;"&gt;string&lt;/span&gt;&amp;gt;()&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#a31515;"&gt;"Jane"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Bandy"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Ram"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Jane"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Bandy"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Carol"&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;"Bandy"&lt;br /&gt;    &lt;/span&gt;};&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:green;"&gt;// Count Repeated Words&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;var &lt;/span&gt;q = strList.GroupBy(x =&amp;gt; x)&lt;br /&gt;       .Select(g =&amp;gt; &lt;span style="color:blue;"&gt;new &lt;/span&gt;{ Value = g.Key, Count = g.Count() })&lt;br /&gt;       .OrderByDescending(x =&amp;gt; x.Count);&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:blue;"&gt;var &lt;/span&gt;x &lt;span style="color:blue;"&gt;in &lt;/span&gt;q)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:#2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#a31515;"&gt;"Value: " &lt;/span&gt;+ x.Value + &lt;span style="color:#a31515;"&gt;" Count: " &lt;/span&gt;+ x.Count);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;VB.NET&lt;br /&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;Shared Sub &lt;/span&gt;Main(&lt;span style="color:blue;"&gt;ByVal &lt;/span&gt;args() &lt;span style="color:blue;"&gt;As String&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color:blue;"&gt;Dim &lt;/span&gt;strList &lt;span style="color:blue;"&gt;As New &lt;/span&gt;List(&lt;span style="color:blue;"&gt;Of String&lt;/span&gt;)() &lt;span style="color:blue;"&gt;From &lt;/span&gt;{&lt;span style="color:darkred;"&gt;"Jane"&lt;/span&gt;, &lt;span style="color:darkred;"&gt;"Bandy"&lt;/span&gt;, &lt;span style="color:darkred;"&gt;"Ram"&lt;/span&gt;, _&lt;br /&gt;&lt;span style="color:darkred;"&gt;"Jane"&lt;/span&gt;, &lt;span style="color:darkred;"&gt;"Bandy"&lt;/span&gt;, &lt;span style="color:darkred;"&gt;"Carol"&lt;/span&gt;, &lt;span style="color:darkred;"&gt;"Bandy"&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:green;"&gt;' Count Repeated Words&lt;br /&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;Dim &lt;/span&gt;q = strList.GroupBy(&lt;span style="color:blue;"&gt;Function&lt;/span&gt;(x) x).Select(&lt;span style="color:blue;"&gt;Function&lt;/span&gt;(g) &lt;span style="color:blue;"&gt;New _&lt;/span&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;With &lt;/span&gt;{Key .Value = g.Key, Key .Count = g.Count()}) _&lt;br /&gt;.OrderByDescending(&lt;span style="color:blue;"&gt;Function&lt;/span&gt;(x) x.Count)&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;For Each &lt;/span&gt;x &lt;span style="color:blue;"&gt;In &lt;/span&gt;q&lt;br /&gt;        Console.WriteLine(&lt;span style="color:darkred;"&gt;"Value: " &lt;/span&gt;&amp;amp; x.Value &amp;amp; &lt;span style="color:darkred;"&gt;" Count: " &lt;/span&gt;&amp;amp; x.Count)&lt;br /&gt;    &lt;span style="color:blue;"&gt;Next &lt;/span&gt;x&lt;br /&gt;&lt;span style="color:blue;"&gt;End Sub&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;OUTPUT&lt;/p&gt;&lt;p&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_0j4bzarlOBg/TDMb0iBc5-I/AAAAAAAABLk/peJikxuX0XU/image%5B2%5D.png?imgmax=800" width="213" height="78" /&gt; &lt;/p&gt;&lt;p&gt;Read more tips over here &lt;b&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=449" target="_blank"&gt;Some Common Operations using List&amp;lt;string&amp;gt;&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8980734269859237005-2385628282290544591?l=www.devcurry.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/devcurry/~4/YabwfFvzCak" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/devcurry/~3/YabwfFvzCak/count-repeated-words-in-list.html</link><author>noreply@blogger.com (Suprotim Agarwal)</author><thr:total>0</thr:total><feedburner:origLink>http://www.devcurry.com/2010/07/count-repeated-words-in-list.html</feedburner:origLink></item></channel></rss>
