<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A TiVo Disk Space Viewer, It&#8217;s all about LINQ to XML!</title>
	<atom:link href="http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/</link>
	<description>Specializing in Microsoft Web and Database Technologies</description>
	<lastBuildDate>Thu, 11 Mar 2010 18:01:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Peter Kellner</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-689</link>
		<dc:creator>Peter Kellner</dc:creator>
		<pubDate>Tue, 08 Apr 2008 04:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-689</guid>
		<description>OK, I made another post that has the exe file in them.  Here is a link to that post.  Go to the bottom of the post and download the zip files.  Simply put the two files in the zip in their own directory and make a shortcut to the exe file.  BTW, I&#039;ve tested these files with both XP and Vista.  If anyone else is using another OS, please post your results.

http://peterkellner.net/2008/04/07/tivosummariesexe/</description>
		<content:encoded><![CDATA[<p>OK, I made another post that has the exe file in them.  Here is a link to that post.  Go to the bottom of the post and download the zip files.  Simply put the two files in the zip in their own directory and make a shortcut to the exe file.  BTW, I&#8217;ve tested these files with both XP and Vista.  If anyone else is using another OS, please post your results.</p>
<p><a href="http://peterkellner.net/2008/04/07/tivosummariesexe/">http://peterkellner.net/2008/04/07/tivosummariesexe/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tracey</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-688</link>
		<dc:creator>Tracey</dc:creator>
		<pubDate>Tue, 08 Apr 2008 01:28:44 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-688</guid>
		<description>Got the host file changed, as other poster - no exe, plus does this work on XP?</description>
		<content:encoded><![CDATA[<p>Got the host file changed, as other poster &#8211; no exe, plus does this work on XP?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Kellner</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-687</link>
		<dc:creator>Peter Kellner</dc:creator>
		<pubDate>Fri, 04 Apr 2008 05:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-687</guid>
		<description>There is no exe file in the project.  You must build it.  I&#039;ve sent you an exe as a separate email.</description>
		<content:encoded><![CDATA[<p>There is no exe file in the project.  You must build it.  I&#8217;ve sent you an exe as a separate email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marcus</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-686</link>
		<dc:creator>marcus</dc:creator>
		<pubDate>Fri, 04 Apr 2008 04:24:53 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-686</guid>
		<description>Peter,
I got Mike&#039;s gadget working fine and downloaded your .zip file.  However, I don&#039;t see an .exe file anywhere in the TivoSummaries folder.  Am I missing something on this install?
Thanks.</description>
		<content:encoded><![CDATA[<p>Peter,<br />
I got Mike&#8217;s gadget working fine and downloaded your .zip file.  However, I don&#8217;t see an .exe file anywhere in the TivoSummaries folder.  Am I missing something on this install?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Kellner</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-684</link>
		<dc:creator>Peter Kellner</dc:creator>
		<pubDate>Mon, 21 Jan 2008 15:33:39 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-684</guid>
		<description>Just a quick note that makes installation easier.  You can simply put your IP address of your TiVo in the service number field and then you don&#039;t have to mess with your hosts file.  I&#039;ll fix this and make a new post after I&#039;ve got several other changes incorporated (Like Fabrice&#039;s in the previous comment).</description>
		<content:encoded><![CDATA[<p>Just a quick note that makes installation easier.  You can simply put your IP address of your TiVo in the service number field and then you don&#8217;t have to mess with your hosts file.  I&#8217;ll fix this and make a new post after I&#8217;ve got several other changes incorporated (Like Fabrice&#8217;s in the previous comment).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Stodola</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-683</link>
		<dc:creator>Josh Stodola</dc:creator>
		<pubDate>Mon, 21 Jan 2008 14:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-683</guid>
		<description>Nice work, Peter!  Impressive.</description>
		<content:encoded><![CDATA[<p>Nice work, Peter!  Impressive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabrice</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-682</link>
		<dc:creator>Fabrice</dc:creator>
		<pubDate>Mon, 21 Jan 2008 14:51:35 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-682</guid>
		<description>Your blog engine removed the angle brackets. The method&#039;s signature should be:
public static IDictionary[String, Int64] GetSpaceByCategory(String xmlString)
where the square brackets represent angle brackets.</description>
		<content:encoded><![CDATA[<p>Your blog engine removed the angle brackets. The method&#8217;s signature should be:<br />
public static IDictionary[String, Int64] GetSpaceByCategory(String xmlString)<br />
where the square brackets represent angle brackets.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fabrice</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-681</link>
		<dc:creator>Fabrice</dc:creator>
		<pubDate>Mon, 21 Jan 2008 14:49:18 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-681</guid>
		<description>Peter, good work.
Here is how you can further improve your code.

public static IDictionary GetSpaceByCategory(String xmlString)
{
  XNamespace ns1 = &quot;http://www.tivo.com/developer/calypso-protocol-1.6/&quot;;
  XElement root;

  using (StringReader stringReader = new StringReader(xmlString))
  {
    root = XElement.Load(stringReader);

    var shows =
      from item in root.Elements(ns1 + &quot;Item&quot;)
      let details = item.Element(ns1 + &quot;Details&quot;)
      let links = item.Element(ns1 + &quot;Links&quot;)
      where links.HasElements == true
      let customIcon = links.Element(ns1 + &quot;CustomIcon&quot;)
      where customIcon != null
      select new TivoShowInfo
      {
        Title = (String)details.Element(ns1 + &quot;Title&quot;),
        Duration = (Int32)details.Element(ns1 + &quot;Duration&quot;),
        NumberBytes = (Int64)details.Element(ns1 + &quot;SourceSize&quot;),
        ShowType = (String)customIcon.Element(ns1 + &quot;Url&quot;)
      };

    Int64 totalBytes = shows.Sum(show =&gt; show.NumberBytes);

    var categories =
      from s in shows
      group s by s.ShowType into g
      select
        new
        {
          ShowType1 = g.Key,
          TotalBytes = g.Sum(s =&gt; s.NumberBytes)
        };

    var result = categories.ToDictionary(cat =&gt; cat.ShowType1, cat =&gt; cat.TotalBytes);
    return result;
  }
}

This is only GetSpaceByCategory, but it&#039;s your main method.
For it to work this way, all you need is to add a parameterless constructor to your TivoShowInfo class. You could also use the current constructor in the query if you prefer.

Fabrice</description>
		<content:encoded><![CDATA[<p>Peter, good work.<br />
Here is how you can further improve your code.</p>
<p>public static IDictionary GetSpaceByCategory(String xmlString)<br />
{<br />
  XNamespace ns1 = &#8220;http://www.tivo.com/developer/calypso-protocol-1.6/&#8221;;<br />
  XElement root;</p>
<p>  using (StringReader stringReader = new StringReader(xmlString))<br />
  {<br />
    root = XElement.Load(stringReader);</p>
<p>    var shows =<br />
      from item in root.Elements(ns1 + &#8220;Item&#8221;)<br />
      let details = item.Element(ns1 + &#8220;Details&#8221;)<br />
      let links = item.Element(ns1 + &#8220;Links&#8221;)<br />
      where links.HasElements == true<br />
      let customIcon = links.Element(ns1 + &#8220;CustomIcon&#8221;)<br />
      where customIcon != null<br />
      select new TivoShowInfo<br />
      {<br />
        Title = (String)details.Element(ns1 + &#8220;Title&#8221;),<br />
        Duration = (Int32)details.Element(ns1 + &#8220;Duration&#8221;),<br />
        NumberBytes = (Int64)details.Element(ns1 + &#8220;SourceSize&#8221;),<br />
        ShowType = (String)customIcon.Element(ns1 + &#8220;Url&#8221;)<br />
      };</p>
<p>    Int64 totalBytes = shows.Sum(show =&gt; show.NumberBytes);</p>
<p>    var categories =<br />
      from s in shows<br />
      group s by s.ShowType into g<br />
      select<br />
        new<br />
        {<br />
          ShowType1 = g.Key,<br />
          TotalBytes = g.Sum(s =&gt; s.NumberBytes)<br />
        };</p>
<p>    var result = categories.ToDictionary(cat =&gt; cat.ShowType1, cat =&gt; cat.TotalBytes);<br />
    return result;<br />
  }<br />
}</p>
<p>This is only GetSpaceByCategory, but it&#8217;s your main method.<br />
For it to work this way, all you need is to add a parameterless constructor to your TivoShowInfo class. You could also use the current constructor in the query if you prefer.</p>
<p>Fabrice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Swanson</title>
		<link>http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/comment-page-1/#comment-685</link>
		<dc:creator>Mike Swanson</dc:creator>
		<pubDate>Sun, 20 Jan 2008 22:36:31 +0000</pubDate>
		<guid isPermaLink="false">http://peterkellner.net/2008/01/18/tivospaceviewerwithlinq/#comment-685</guid>
		<description>Great job, Peter. This is a fantastic way to view the space on your TiVo. I learned a bit about LINQ too!</description>
		<content:encoded><![CDATA[<p>Great job, Peter. This is a fantastic way to view the space on your TiVo. I learned a bit about LINQ too!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
