<?xml version="1.0" encoding="utf-8"?>
<!-- generator="wordpress/2.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>George Tsiokos' blog</title>
	<link>http://george.tsiokos.com</link>
	<description>on c#, .NET, SharePoint, Windows and OS X</description>
	<pubDate>Mon, 15 Sep 2008 19:45:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>
	<language>en</language>
			<item>
		<title>LINQ to SQL produces incorrect TSQL when using UNION or CONCAT</title>
		<link>http://george.tsiokos.com/posts/2008/09/10/linq-to-sql-produces-incorrect-tsql-when-using-union-or-concat/</link>
		<comments>http://george.tsiokos.com/posts/2008/09/10/linq-to-sql-produces-incorrect-tsql-when-using-union-or-concat/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 20:50:09 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Bugs]]></category>

		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2008/09/10/linq-to-sql-produces-incorrect-tsql-when-using-union-or-concat/</guid>
		<description><![CDATA[When a LINQ to SQL query contains a Union or Concat with a second query, and the second query references a column twice, a SqlException will occur.
var a = from address in dc.Addresses
select new {
ID = address.AddressID,
Address1 = address.AddressLine1,
Address2 = address.AddressLine2,
};
var b = from address in dc.Addresses
select new {
ID = address.AddressID,
Address1 = address.AddressLine1,
Address2 = address.AddressLine1, [...]]]></description>
			<content:encoded><![CDATA[<p>When a LINQ to SQL query contains a Union or Concat with a second query, and the second query references a column twice, a SqlException will occur.</p>
<pre>var a = from address in dc.Addresses
select new {
ID = address.AddressID,
Address1 = address.AddressLine1,
Address2 = address.AddressLine2,
};
var b = from address in dc.Addresses
select new {
ID = address.AddressID,
Address1 = address.AddressLine1,
Address2 = address.AddressLine1, // notice AddressLine1 repeated
};
var q = a.Take(10).Union (b.Take(10));
q.ToArray ();</pre>
<p>SqlException: <strong>All the queries in a query expression containing a UNION operator must have the same number of expressions in their select lists.</strong></p>
<pre>SELECT [t2].[AddressID] AS [ID], [t2].[AddressLine1] AS [Address1], [t2].[AddressLine2] AS [Address2]
FROM (
SELECT TOP (10) [t0].[AddressID], [t0].[AddressLine1], [t0].[AddressLine2]
FROM [Person].[Address] AS [t0]
UNION
SELECT TOP (10) [t1].[AddressID], [t1].[AddressLine1]
FROM [Person].[Address] AS [t1]
) AS [t2]</pre>
<p><em>Notice the third SELECT statement is only selecting two columns instead of the required three.</em></p>
<p>Please <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=355734">rate and validate</a> this bug at the MSDN Microsoft Product Feedback Center so Microsoft responds with a solution or workaround.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2008/09/10/linq-to-sql-produces-incorrect-tsql-when-using-union-or-concat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Extending LINQ to SQL</title>
		<link>http://george.tsiokos.com/posts/2008/09/09/extending-linq-to-sql/</link>
		<comments>http://george.tsiokos.com/posts/2008/09/09/extending-linq-to-sql/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 16:15:44 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2008/09/09/extending-linq-to-sql/</guid>
		<description><![CDATA[Last year, Scott Guthrie stated “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method.
I would like to modify the following LINQ to SQL query:
using (NorthwindContext northwind = new NorthwindContext ()) {
    [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, Scott Guthrie <a href="http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx">stated</a> “You can actually override the raw SQL that LINQ to SQL uses if you want absolute control over the SQL executed”, but I can’t find documentation describing an extensibility method.</p>
<p>I would like to modify the following LINQ to SQL query:</p>
<pre>using (NorthwindContext northwind = new NorthwindContext ()) {
    var q = from row in northwind.Customers
            let orderCount = row.Orders.Count ()
            select new {
                row.ContactName,
                orderCount
            };
}</pre>
<p>Which results in the following TSQL:</p>
<pre>SELECT [t0].[ContactName], (
    SELECT COUNT(*)
    FROM [dbo].[Orders] AS [t1]
    WHERE [t1].[CustomerID] = [t0].[CustomerID]
    ) AS [orderCount]
FROM [dbo].[Customers] AS [t0]</pre>
<p>To:</p>
<pre>using (NorthwindContext northwind = new NorthwindContext ()) {
    var q = from row in northwind.Customers.With (
                        TableHint.NoLock, TableHint.Index (0))
            let orderCount = row.Orders.With (
                        TableHint.HoldLock).Count ()
            select new {
                row.ContactName,
                orderCount
            };
}</pre>
<p>Which <em>would</em> result in the following TSQL:</p>
<pre>SELECT [t0].[ContactName], (
    SELECT COUNT(*)
    FROM [dbo].[Orders] AS [t1] WITH (HOLDLOCK)
    WHERE [t1].[CustomerID] = [t0].[CustomerID]
    ) AS [orderCount]
FROM [dbo].[Customers] AS [t0] WITH (NOLOCK, INDEX(0))</pre>
<p>Using:</p>
<pre>public static Table&lt;TEntity&gt; With&lt;TEntity&gt; (
    this Table&lt;TEntity&gt; table,
    params TableHint[] args) where TEntity : class {

    //TODO: implement
    return table;
}
public static EntitySet&lt;TEntity&gt; With&lt;TEntity&gt; (
    this EntitySet&lt;TEntity&gt; entitySet,
    params TableHint[] args) where TEntity : class {

    //TODO: implement
    return entitySet;
}</pre>
<p>And</p>
<pre>
public class TableHint {
    //TODO: implement
    public static TableHint NoLock;
    public static TableHint HoldLock;
    public static TableHint Index (int id) {
        return null;
    }
    public static TableHint Index (string name) {
        return null;
    }
}</pre>
<p>Using some type of LINQ to SQL extensibility, other than <a href="http://blogs.msdn.com/mattwar/archive/2008/05/04/mocks-nix-an-extensible-linq-to-sql-datacontext.aspx">this one</a>. Any ideas?</p>
<p><strong>Please comment on this question over at <a href="http://stackoverflow.com/questions/62963/how-do-you-extend-linq-to-sql">StackOverflow.com</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2008/09/09/extending-linq-to-sql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing nComet</title>
		<link>http://george.tsiokos.com/posts/2008/07/09/introducing-ncomet/</link>
		<comments>http://george.tsiokos.com/posts/2008/07/09/introducing-ncomet/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 04:40:34 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[nComet]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2008/07/09/introducing-comet/</guid>
		<description><![CDATA[nComet is a .NET implementation of the Comet (reverse-AJAX push) architecture. This server-side pipeline uses long-lived client-initiated HTTP connections to push messages to the client. Once the client receives a response, it immediately opens another HTTP request, which the server holds until a message is ready. This architecture allows the server to push dynamic html/xml/json/etc [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codeplex.com/ncomet">nComet</a> is a .NET implementation of the Comet (reverse-AJAX push) architecture. This server-side pipeline uses long-lived client-initiated HTTP connections to push messages to the client. Once the client receives a response, it immediately opens another HTTP request, which the server holds until a message is ready. This architecture allows the server to push dynamic html/xml/json/etc to the browser, rather than the browser polling the server.</p>
<p>This project focuses on the .NET server-side architecture, initially providing a HttpListener implementation (for a custom host communicating with HTTP.SYS directly) and may eventually provide a ASP.NET implementation as well. The library will simplify the implementation of common message patterns such as pushing latest data as well as sync. Example code for multiple client-side javascript implementations will also be provided.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2008/07/09/introducing-ncomet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LINQ to SQL - code generation bug</title>
		<link>http://george.tsiokos.com/posts/2008/04/09/linq-to-sql-code-generation-bug/</link>
		<comments>http://george.tsiokos.com/posts/2008/04/09/linq-to-sql-code-generation-bug/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 21:23:38 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Bugs]]></category>

		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2008/04/09/linq-to-sql-code-generation-bug/</guid>
		<description><![CDATA[The code generation performed by MSLinqToSQLGenerator or SQLMetal generates weird property code. For example, in AdvantureWorks, the table Product has a column ProductLine. Using the tools that come with LINQ to SQL, this column translates to a property:
[Column(Storage="_ProductLine", DbType="NChar(2)")]
public string ProductLine
{
  get
  {
    return this._ProductLine;
  }
  set
  [...]]]></description>
			<content:encoded><![CDATA[<p>The code generation performed by MSLinqToSQLGenerator or SQLMetal generates weird property code. For example, in AdvantureWorks, the table Product has a column ProductLine. Using the tools that come with LINQ to SQL, this column translates to a property:</p>
<pre>[Column(Storage="_ProductLine", DbType="NChar(2)")]
public string ProductLine
{
  get
  {
    return this._ProductLine;
  }
  set
  {
    if ((this._ProductLine != value)) {
      this.OnProductLineChanging(value);
      this.SendPropertyChanging();
      this._ProductLine = value;
      this.SendPropertyChanged("ProductLine");
      this.OnProductLineChanged();
    }
  }
}</pre>
<p>The odd code involves the SendPropertyChanging() method call. This method call should pass the name of the property, just like the SendPropertyChanged() method call, according to the <a href="http://msdn2.microsoft.com/en-us/library/system.componentmodel.propertychangingeventargs.propertychangingeventargs.aspx">documentation</a>. Another interesting detail: The OnProductLineChanging and OnProductLineChanged partial method calls are out of order:
<ol>
<li>Call OnProductLineChanging() partial method</li>
<li>Raise PropertyChanging event, but don’t tell which property is changing – send an empty string instead</li>
<li>Set the property’s field’s value to the specified new value</li>
<li>Raise PropertyChanged event and specify which property is changing</li>
<li>Call OnProductLineChanged() partial method</li>
</ol>
<p>Why is the PropertyChanged event raised before calling the OnProductLineChanged partial method?</p>
<p>All classes created by LINQ to SQL add the following protected methods:</p>
<pre>
protected virtual void SendPropertyChanging() {
  if ((this.PropertyChanging != null)) {
    this.PropertyChanging(this, emptyChangingEventArgs);
  }
}
protected virtual void SendPropertyChanged(String propertyName) {
  if ((this.PropertyChanged != null)) {
    this.PropertyChanged(this,
        new PropertyChangedEventArgs(propertyName));
  }
}</pre>
<p>Again, what’s odd about this code is how the SendPropertyChanging() method does not have a property name parameter and sends a emptyChangingEventArgs field reference to the PropertyChanging event rather than creating a new instance of the EventArgs like the SendPropertyChanged() method call does. By creating a new instance of the EventArgs in SendPropertyChanged, it’s able to pass the property name in the constructor (like the documentation says it should).</p>
<p>Here is the field that is passed to all invocations of the event:</p>
<pre>private static PropertyChangingEventArgs emptyChangingEventArgs =
  new PropertyChangingEventArgs(String.Empty);</pre>
<p>As you can see from this constructor, the property that is changing is an <strong>empty string</strong>. Given the fact that this is a private field and should not be modified by extension methods, it’s odd that this field is not static readonly.</p>
<p>My guess is that the code is generated incorrectly to account for a data-binding or allocation problem. I’ve come to this conclusion by the emptyChangingEventArgs field – it reduces the object instance creation in half for each property change when there are event consumers for the changing event. The big disadvantage for event consumers is that they doesn’t know which property is changing on an object instance.</p>
<p>One alternative is to use <a href="http://www.codeplex.com/codesmith">PLINQO</a>, which creates the properties correctly.</p>
<p><strong>UPDATE</strong>: I have found that this <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=290470">has already been reported</a>. Unfortunately, Microsoft has closed this bug and said it was by design, even though the generated code does not follow Microsoft&#8217;s documentation for the <a href="http://msdn2.microsoft.com/en-us/library/system.componentmodel.propertychangingeventargs.aspx">PropertyChangingEventArgs</a> class.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2008/04/09/linq-to-sql-code-generation-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>LINQ - WHERE X IN (&#8230;)</title>
		<link>http://george.tsiokos.com/posts/2007/11/30/linq-where-x-in/</link>
		<comments>http://george.tsiokos.com/posts/2007/11/30/linq-where-x-in/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 16:53:45 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[c#]]></category>

		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/11/30/linq-where-x-in/</guid>
		<description><![CDATA[I couldn&#8217;t figure out a way to perform the equivalent of WHERE Column1 IN ('A', 'B', 'C') in LINQ, where (&#8217;A', &#8216;B&#8217;, &#8216;C&#8217;) would represent an IEnumerable&#60;T&#62; where T is the type of Column1. So I thought it was an excellent time to write an extension method that would generate a dynamic expression tree that [...]]]></description>
			<content:encoded><![CDATA[<p>I couldn&#8217;t figure out a way to perform the equivalent of <code>WHERE Column1 IN ('A', 'B', 'C')</code> in <a href="http://msdn2.microsoft.com/netframework/aa904594.aspx">LINQ</a>, where (&#8217;A', &#8216;B&#8217;, &#8216;C&#8217;) would represent an IEnumerable&lt;T&gt; where T is the type of Column1. So I thought it was an excellent time to write an extension method that would generate a dynamic expression tree that would add <code>AND (Column1 == "A" OR Column1 = "B" OR ...)</code> to the LINQ query. So I wrote the following code:
<pre>public static IQueryable&lt;TSource&gt; WhereIn&lt;TSource, TKey&gt; (
        this IQueryable&lt;TSource&gt; source1,
        Expression&lt;Func&lt;TSource, TKey&gt;&gt; keySelector,
        IEnumerable&lt;TKey&gt; source2) {
    if (null == source1)
        throw new ArgumentNullException (&quot;source1&quot;);
    if (null == keySelector)
        throw new ArgumentNullException (&quot;keySelector&quot;);
    if (null == source2)
        throw new ArgumentNullException (&quot;source2&quot;);
    Expression where = null;
    foreach (TKey value in source2) {
        Expression equal = Expression.Equal (
                    keySelector.Body,
                    Expression.Constant (value, typeof (TKey))
                    );
        if (null == where)
            where = equal;
        else
            where = Expression.OrElse (where, equal);
    }
    return source1.Where&lt;TSource&gt; (
        Expression.Lambda&lt;Func&lt;TSource, bool&gt;&gt; (
            where, keySelector.Parameters));
}</pre>
<p>An example of the usage:
<pre>var q = (from u in db.Users
    where u.LastLogin > new DateTime (2007, 5, 1)
    orderby u.LastLogin descending
    select new { u.FirstName, u.LastName, u.UserName, u.LastLogin }
    ).WhereIn (u => u.UserName, new string[] { "A", "B", "C" });</pre>
<p>A day later, I found <a href="http://www.develop-one.net/blog/2007/11/11/LINQToSQLJoiningDatabaseDataWithNondatabaseData.aspx">the right way</a> that will actually generate &#8220;WHERE X IN (&#8230;)&#8221; in LINQ to SQL thanks to <a href="http://www.develop-one.net/blog/profile.aspx?user=markblomsma">Mark Blomsma</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/11/30/linq-where-x-in/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SqlMetal.exe crashes when a column name in the result set is [ ].</title>
		<link>http://george.tsiokos.com/posts/2007/11/28/sqlmetal-crashes-when-a-column-name-in-the-result-set-is-blank/</link>
		<comments>http://george.tsiokos.com/posts/2007/11/28/sqlmetal-crashes-when-a-column-name-in-the-result-set-is-blank/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 23:46:35 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Bugs]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/11/28/sqlmetal-crashes-when-a-column-name-is/</guid>
		<description><![CDATA[The last message to be written to the console was: “Error : Index was outside the bounds of the array.”.
To reproduce this bug, create this stored procedure and run SqlMetal against it:
CREATE PROCEDURE [dbo].[ThisProcedureWillCauseSqlMetalToCrash] AS
BEGIN
	SET NOCOUNT ON;
	SELECT 1 [A], 2 [ ], 3 [C]
END
Applies to:

Visual Studio 2008 RTM
Microsoft Windows SDK v6.0A

Please rate and validate this [...]]]></description>
			<content:encoded><![CDATA[<p>The last message to be written to the console was: “Error : Index was outside the bounds of the array.”.</p>
<p>To reproduce this bug, create this stored procedure and run SqlMetal against it:<br />
<code>CREATE PROCEDURE [dbo].[ThisProcedureWillCauseSqlMetalToCrash] AS<br />
BEGIN<br />
	SET NOCOUNT ON;<br />
	SELECT 1 [A], 2 [ ], 3 [C]<br />
END</code></p>
<p>Applies to:</p>
<ul>
<li>Visual Studio 2008 RTM</li>
<li>Microsoft Windows SDK v6.0A</li>
</ul>
<p>Please rate and validate this problem at the <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=313167">MSDN Microsoft Product Feedback Center</a> so Microsoft responds with a solution or workaround.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/11/28/sqlmetal-crashes-when-a-column-name-in-the-result-set-is-blank/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Some Enterprise Library 3.0 - April 2007 bug fixes</title>
		<link>http://george.tsiokos.com/posts/2007/05/21/some-enterprise-library-30-april-2007-bug-fixes/</link>
		<comments>http://george.tsiokos.com/posts/2007/05/21/some-enterprise-library-30-april-2007-bug-fixes/#comments</comments>
		<pubDate>Mon, 21 May 2007 13:11:18 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Bugs]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/05/21/some-enterprise-library-30-april-2007-bug-fixes/</guid>
		<description><![CDATA[Here are the bug fixes I wrote for Enterprise Library 3.0 - April 2007, related to using the EntLibLoggingProxyTraceListener to proxy .NET TraceListener messages to enterprise library and logging over MSMQ via MsmqTraceListener.
In Microsoft. Practices. EnterpriseLibrary. Logging. TraceListeners. EntLibLoggingProxyTraceListener, comment out
properties.Add(TraceEventCacheKey, eventCache); // line 66 &#038; 146 (fix for SerializationException)
In Microsoft. Practices. EnterpriseLibrary. Logging. TraceListeners. [...]]]></description>
			<content:encoded><![CDATA[<p>Here are the bug <em>fixes </em>I wrote for Enterprise Library 3.0 - April 2007, related to using the EntLibLoggingProxyTraceListener to proxy .NET TraceListener messages to enterprise library and logging over MSMQ via MsmqTraceListener.</p>
<p>In Microsoft. Practices. EnterpriseLibrary. Logging. TraceListeners. EntLibLoggingProxyTraceListener, comment out<br />
<code>properties.Add(TraceEventCacheKey, eventCache); // line 66 &#038; 146 (fix for SerializationException)</code><br />
In Microsoft. Practices. EnterpriseLibrary. Logging. TraceListeners. MsmqTraceListener, change<code>	queueMessage.Label = messageLabel;</code><br />
to<code>	queueMessage.Label = string.IsNullOrEmpty (messageLabel) ? string.Empty : messageLabel; // line 153 (fix for ArgumentNullException)</code><br />
In LoggingDatabase.sql, change <code>	[Title] [nvarchar](256) NOT NULL,</code><br />
to <code>	[Title] [nvarchar](256) NULL,</code></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/05/21/some-enterprise-library-30-april-2007-bug-fixes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ClickOnce progress suggestion</title>
		<link>http://george.tsiokos.com/posts/2007/03/16/clickonce_progress_disappear/</link>
		<comments>http://george.tsiokos.com/posts/2007/03/16/clickonce_progress_disappear/#comments</comments>
		<pubDate>Fri, 16 Mar 2007 06:06:26 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[ClickOnce]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/03/16/clickonce_progress_disappear/</guid>
		<description><![CDATA[Microsoft:
When a ClickOnce application is updating on startup, please display a wait cursor, or some indication to the user that the application is loading - the progress bar currently disappears after the new version is downloaded. On older computers, the time between the progress bar dissapearing and the application loading can take 30-50 seconds&#8230;
]]></description>
			<content:encoded><![CDATA[<p>Microsoft:</p>
<p>When a ClickOnce application is updating on startup, please display a wait cursor, or some indication to the user that the application is loading - the progress bar currently disappears after the new version is downloaded. On older computers, the time between the progress bar dissapearing and the application loading can take 30-50 seconds&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/03/16/clickonce_progress_disappear/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Internal NullReferenceException in HttpWebRequest when using a CachePolicy</title>
		<link>http://george.tsiokos.com/posts/2007/03/15/nullreferenceexception_httpwebrequest_cachepolicy/</link>
		<comments>http://george.tsiokos.com/posts/2007/03/15/nullreferenceexception_httpwebrequest_cachepolicy/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 05:02:47 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<category><![CDATA[Bugs]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/03/15/nullreferenceexception_httpwebrequest_cachepolicy/</guid>
		<description><![CDATA[Setting the CachePolicy to the default HttpRequestCacheLevel causes an exception internal to HttpWebRequest when a web application is running with an application pool configured to use a custom identity. For example:
HttpWebRequest request = …;
request.CachePolicy =
  new System.Net.Cache.HttpRequestCachePolicy (
    System.Net.Cache.HttpRequestCacheLevel.Default);
request.GetResponse ();
GetResponse () throws a WebException: “The request was aborted: The request was [...]]]></description>
			<content:encoded><![CDATA[<p>Setting the CachePolicy to the default HttpRequestCacheLevel causes an exception internal to HttpWebRequest when a web application is running with an application pool <a href="http://msdn2.microsoft.com/en-us/library/ms998297.aspx">configured to use a custom identity</a>. For example:</p>
<pre>HttpWebRequest request = …;
request.CachePolicy =
  new System.Net.Cache.HttpRequestCachePolicy (
    System.Net.Cache.HttpRequestCacheLevel.Default);
request.GetResponse ();</pre>
<p>GetResponse () throws a WebException: “The request was aborted: The request was canceled.” Inner exception shows that the private method CheckCacheUpdateOnResponse () of System.Net.HttpWebRequest encounters a NullReferenceException.</p>
<p>A “workaround” would involve loading the user’s profile. For example, if the application pool custom identity is DOMAIN\MyWebApp, log in to the server as MyWebApp. The error goes away – until the profile is unloaded.</p>
<p>This problem does not occur when the web application is using the default application pool identity, NetworkService, because I believe that profile is already loaded by default.</p>
<p>Another <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=98156">bug report</a> is somewhat similar to this but only manifests after <em>a few thousand</em> requests. These are probably symptoms of a much larger bug (or design flaw – http request caching is currently implemented through IE’s cache).</p>
<p><strong>Update</strong>: Microsoft has <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=263447">reproduced this bug</a> and will be addressing it in a future release.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/03/15/nullreferenceexception_httpwebrequest_cachepolicy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What happened here?</title>
		<link>http://george.tsiokos.com/posts/2007/03/14/what-happened-here/</link>
		<comments>http://george.tsiokos.com/posts/2007/03/14/what-happened-here/#comments</comments>
		<pubDate>Wed, 14 Mar 2007 12:00:17 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/03/14/what-happened-here/</guid>
		<description><![CDATA[Here&#8217;s a number of inconsistencies with exception constructors:
The message parameter is first and paramName is second for one of ArgumentException&#8217;s constructors.
public ArgumentException(string message, string paramName);
These exceptions inherit ArgumentException:

In one of ArgumentOutOfRangeException&#8217;s constructors, paramName is first and message is second.
public ArgumentOutOfRangeException(string paramName, string message);
In one of InvalidEnumArgumentException&#8217;s constructors, argumentName is used to represent the same value [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a number of inconsistencies with exception constructors:</p>
<p>The <em>message</em> parameter is first and <strong>paramName</strong> is second for one of ArgumentException&#8217;s constructors.<br />
<code>public ArgumentException(string <em>message</em>, string <strong>paramName</strong>);</code></p>
<p>These exceptions inherit ArgumentException:</p>
<ul>
<li>In one of ArgumentOutOfRangeException&#8217;s constructors, <strong>paramName</strong> is first and <em>message</em> is second.<br />
<code>public ArgumentOutOfRangeException(string <strong>paramName</strong>, string <em>message</em>);</code></li>
<li>In one of InvalidEnumArgumentException&#8217;s constructors, <strong>argumentName</strong> is used to represent the same value as <strong>paramName</strong>. This is an overload that doesn&#8217;t include the message parameter, which is normal.<code>public InvalidEnumArgumentException(string <strong>argumentName</strong>, int invalidValue, Type enumClass);</code></li>
<li>In one of DuplicateWaitObjectException&#8217;s constructors, <strong>parameterName</strong> is first, represents the same value as <strong>paramName</strong>, and <em>message</em> is second.<br />
<code>public DuplicateWaitObjectException(string <strong>parameterName</strong>, string <em>message</em>);</code></li>
</ul>
<p>Questions:</p>
<ol>
<li>Why are there three names used to represent <strong>paramName</strong>?</li>
<li>Why was the parameter order changed in the child classes?</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/03/14/what-happened-here/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WCF: Service Name</title>
		<link>http://george.tsiokos.com/posts/2007/03/13/wcf-service-name/</link>
		<comments>http://george.tsiokos.com/posts/2007/03/13/wcf-service-name/#comments</comments>
		<pubDate>Tue, 13 Mar 2007 13:00:39 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/03/13/wcf-service-name/</guid>
		<description><![CDATA[I&#8217;ve been working with a WCF service and wanted to change the name of the service without changing the class name (TypeName). Every example I&#8217;ve seen shows that the name of the type equals the name of the service.
The service is hosted in IIS, and the web.config is configured as:
&#60;system.serviceModel&#62;&#60;services&#62;
&#60;service name=&#34;Namespace.TypeName&#34; …
Filename.svc is configured:
&#60;% @ServiceHost [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with a WCF service and wanted to change the name of the service without changing the class name (<strong>TypeName</strong>). Every example I&#8217;ve seen shows that the name of the type equals the name of the service.</p>
<p>The service is hosted in IIS, and the web.config is configured as:<br />
<code>&lt;system.serviceModel&gt;&lt;services&gt;<br />
&lt;service name=&quot;Namespace.<strong>TypeName</strong>&quot; …</code><br />
Filename.svc is configured:<br />
<code>&lt;% @ServiceHost Service=&quot;Namespace.<strong>TypeName</strong> &quot; %&gt;</code><br />
When you browse to the filename.svc file:</p>
<blockquote><p><strong>TypeName</strong> Service<br />
You have created a service.<br />
To test this service, you will need to create a client and use it to call the service.</p></blockquote>
<p>After looking through the documentation, I found that the service name is configured through the ServiceBehavior attribute:<br />
<code>[ServiceBehavior (<strong>Name</strong> = &quot;The name of the service&quot;)]<br />
public class <strong>TypeName</strong> {…</code></p>
<p>Hope this helps…</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/03/13/wcf-service-name/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Orcas CTP: Synchronization Services</title>
		<link>http://george.tsiokos.com/posts/2007/03/12/orcas_ctp_synchronization_services/</link>
		<comments>http://george.tsiokos.com/posts/2007/03/12/orcas_ctp_synchronization_services/#comments</comments>
		<pubDate>Mon, 12 Mar 2007 18:46:35 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/03/12/orcas_ctp_synchronization_services/</guid>
		<description><![CDATA[Just looking over the latest Orcas CTP I noticed something new:

Synchronization Services lets you synchronize data from disparate sources over two-tier, N-tier, and service-based architectures. Instead of only replicating a database and its schema, the Synchronization Services application programming interface (API) provides a set of components to synchronize data between data services and a local [...]]]></description>
			<content:encoded><![CDATA[<p>Just looking over the <a href="http://www.microsoft.com/downloads/info.aspx?na=22&#038;p=2&#038;SrcDisplayLang=en&#038;SrcCategoryId=&#038;SrcFamilyId=&#038;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d281fcb3d-5e79-4126-b4c0-8db6332de26e">latest Orcas CTP</a> I noticed something new:</p>
<blockquote><p>
<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=02989F70-49AA-43D7-81B8-A651120F8D65">Synchronization Services</a> lets you synchronize data from disparate sources over two-tier, N-tier, and service-based architectures. Instead of only replicating a database and its schema, the Synchronization Services application programming interface (API) provides a set of components to synchronize data between data services and a local store. Applications are increasingly used on mobile clients, such as portable computers and devices, that do not have a consistent or reliable network connection to a central server. It is important for these applications to work against a local copy of data on the client. Equally important is the need to synchronize the local copy of the data with a central server when a network connection is available. The Synchronization Services API is modeled after the ADO.NET data access APIs and gives you an intuitive way to synchronize data. It makes building applications for occasionally connected environments a logical extension of building applications where you can depend on a consistent network connection.
</p></blockquote>
<p>This looks like a great addition to ADO.NET for the .NET 3.5 release. Be sure to check out <a href="http://blogs.msdn.com/synchronizer/">Rafik&#8217;s blog</a> on synchronization services&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/03/12/orcas_ctp_synchronization_services/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Heroes</title>
		<link>http://george.tsiokos.com/posts/2007/02/26/heroes/</link>
		<comments>http://george.tsiokos.com/posts/2007/02/26/heroes/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 04:37:48 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2007/02/26/heroes/</guid>
		<description><![CDATA[Just saw the latest episode of Heroes: The Company Man. Not only is this best episode of Heroes yet, it’s officially the best TV show, ever. Watch the full series premiere for free, or, get the entire season pass on iTunes.
]]></description>
			<content:encoded><![CDATA[<p>Just saw the latest episode of <a href="http://www.nbc.com/Heroes/">Heroes</a>: The Company Man. Not only is this best episode of Heroes yet, it’s officially the best TV show, <em>ever</em>. Watch the full series premiere for <a href="http://www.nbc.com/Video/rewind/full_episodes/heroes.shtml?show=heroes01">free</a>, or, get the entire season pass on <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewTVShow?id=181944930">iTunes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2007/02/26/heroes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Removing a control&#8217;s behavior</title>
		<link>http://george.tsiokos.com/posts/2006/11/21/removing-a-controls-behavior/</link>
		<comments>http://george.tsiokos.com/posts/2006/11/21/removing-a-controls-behavior/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 04:49:30 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/11/21/removing-a-controls-behavior/</guid>
		<description><![CDATA[In Programming .NET Components, Juval Löwy explains the reasoning behind and how to use the EventHandlerList class (It’s used internally in the Control &#038; derived classes to store event subscriptions).
I found that this architecture easily supports the removal of all behavior*:
public static void ClearEventHandlerList (Component component) {
    if (component == null)
  [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.amazon.com/gp/product/0596102070?ie=UTF8&#038;tag=pointinception&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0596102070">Programming .NET Components</a><img src="http://www.assoc-amazon.com/e/ir?t=pointinception&#038;l=as2&#038;o=1&#038;a=0596102070" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, <a href="http://www.idesign.net/">Juval Löwy</a> explains the reasoning behind and how to use the <a href="http://msdn2.microsoft.com/en-us/system.componentmodel.eventhandlerlist.aspx">EventHandlerList</a> class (<em>It’s used internally in the <a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.aspx">Control</a> &#038; derived classes to store event subscriptions</em>).</p>
<p>I found that this architecture easily supports the removal of all behavior*:</p>
<pre>public static void ClearEventHandlerList (Component component) {
    if (component == null)
        throw new ArgumentNullException ("component");
    FieldInfo fieldInfo = (typeof (Component)).GetField ("events",
        BindingFlags.Instance |
        BindingFlags.NonPublic |
        BindingFlags.DeclaredOnly |
        BindingFlags.ExactBinding);
    EventHandlerList currentList =
        fieldInfo.GetValue (component) as EventHandlerList;
    if (currentList != null)
        currentList.Dispose ();
    fieldInfo.SetValue (component, null);
}</pre>
<p>For example, a security component could easily remove a control’s behavior* when the user does not have permission. Keep in mind that this is not a substitute for declarative or imperative security checks - other methods can continued to refer to the control&#8217;s state or subscribe to its events in the future.</p>
<p>Other benefits include the ability for a security component to use a <a href="http://msdn2.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx">ToolTip</a> to notify the user of <strong>access denied</strong> (<em>ToolTips do not function on disabled controls</em>).</p>
<pre>
button.Click += new System.EventHandler (this.button_Click);
// the button_Click method is called when the button is clicked
...
ClearEventHandlerList (button);
// button does not have a click event subscriber anymore
// (button_Click is no longer called when the button is clicked)
</pre>
<p>* <em>behavior</em> as defined by event subscriptions where the event accessor implementation uses the EventHandlerList class.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/11/21/removing-a-controls-behavior/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vista RC1 shutdown notification</title>
		<link>http://george.tsiokos.com/posts/2006/09/11/vista-rc1-shutdown-notification/</link>
		<comments>http://george.tsiokos.com/posts/2006/09/11/vista-rc1-shutdown-notification/#comments</comments>
		<pubDate>Mon, 11 Sep 2006 16:06:13 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/09/11/vista-rc1-shutdown-notification/</guid>
		<description><![CDATA[The shutdown notifications need additional work in Windows Vista RC1:

Run cmd.exe with administrative privileges
Run the following command:
	shutdown /s /t 600
Abort the shutdown with this command:
	shutdown /a

Notification of an aborted system shutdown in Beta 2 had a strange title:

Luckily, Microsoft has enhanced the title in RC1, but there is still room for improvement:

]]></description>
			<content:encoded><![CDATA[<p>The shutdown notifications need additional work in Windows Vista RC1:</p>
<ol>
<li>Run cmd.exe with administrative privileges</li>
<li>Run the following command:<br />
	<code>shutdown /s /t 600</code></li>
<li>Abort the shutdown with this command:<br />
	<code>shutdown /a</code></li>
</ol>
<p>Notification of an aborted system shutdown in Beta 2 had a strange title:<br />
<img id="image78" src="http://george.tsiokos.com/wp-content/uploads/2006/09/vista-shutdown-beta-2.jpg" alt="You are about to be logged off. The scheduled shutdown has been cancelled." /></p>
<p>Luckily, Microsoft has enhanced the title in RC1, but there is still room for improvement:<br />
<img id="image79" src="http://george.tsiokos.com/wp-content/uploads/2006/09/vista-shutdown-rc1.JPG" alt="Logoff is cancelled. The scheduled shutdown has been cancelled." /></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/09/11/vista-rc1-shutdown-notification/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Network Neutrality</title>
		<link>http://george.tsiokos.com/posts/2006/09/01/network-neutrality/</link>
		<comments>http://george.tsiokos.com/posts/2006/09/01/network-neutrality/#comments</comments>
		<pubDate>Fri, 01 Sep 2006 08:00:43 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/09/01/network-neutrality/</guid>
		<description><![CDATA[The Internet is not a big truck. It’s a series of tubes. - Ted Stevens
Check out this clip from The Daily Show where John Hodgman explains the technical implementation of the Internet and why we need network neutrality:

]]></description>
			<content:encoded><![CDATA[<p><i>The Internet is not a big truck. It’s a series of tubes. - Ted Stevens</i></p>
<p>Check out this clip from <a href="http://www.comedycentral.com/tv_shows/thedailyshowwithjonstewart/">The Daily Show</a> where <a href="http://en.wikipedia.org/wiki/John_Hodgman">John Hodgman</a> explains the technical implementation of the Internet and why we need network neutrality:<br />
<embed FlashVars='config=http://www.comedycentral.com/motherload/xml/data_synd.jhtml?vid=71914%26myspace=false' src='http://www.comedycentral.com/motherload/syndicated_player/index.jhtml' quality='high' bgcolor='#006699' width='340' height='325' name='comedy_player' align='middle' allowScriptAccess='always' allownetworking='external' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/09/01/network-neutrality/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Camera metadata</title>
		<link>http://george.tsiokos.com/posts/2006/08/28/camera-metadata/</link>
		<comments>http://george.tsiokos.com/posts/2006/08/28/camera-metadata/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 18:01:14 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/08/28/camera-metadata/</guid>
		<description><![CDATA[I received a lot of JPEG images taken by multiple cameras at my daughter&#8217;s birthday party. My first thought was to import them in to Aperture as a birthday album. Unfortunately, these images contained incorrect capture dates preventing me from organized them in chronological order.
Digital cameras have a clock and store the capture date and [...]]]></description>
			<content:encoded><![CDATA[<p>I received a lot of JPEG images taken by multiple cameras at my daughter&#8217;s birthday party. My first thought was to import them in to <a href="http://www.apple.com/aperture/">Aperture</a> as a birthday album. Unfortunately, these images contained incorrect capture dates preventing me from organized them in chronological order.</p>
<p><strong>Digital cameras have a clock</strong> and store the capture date and time as metadata in the JPEG image. The clock must be set correctly for images from multiple sources to be organized in the order in which they were taken.</p>
<p>To have all of the pictures of the birthday party together in chronological order, I had to:</p>
<ul>
<li>Separate all pictures taken by a specific camera by folder</li>
<li>Perform the following for each folder:
<ul>
<li>Estimate the date and time of one of the pictures taken</li>
<li>Use <a href="http://www.sentex.net/~mwandel/jhead/">jhead</a>, a EXIF command-line utility, <a href="http://collantes.us">David</a> found to fix the metadata
<ul>
<li>Use the <strong>–da</strong> switch to specify the actual and recorded date and time</li>
<li>Execute for all JPEG images (*.JPG)</li>
</ul>
</li>
<li>Import the pictures in to <a href="http://www.apple.com/aperture/">Aperture</a>.</li>
<li>Compare the pictures to others with the correct date and time.</li>
<li>If the images don&#8217;t line up correctly, delete them, and start over again with a better estimate.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/08/28/camera-metadata/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More inaccuracies</title>
		<link>http://george.tsiokos.com/posts/2006/08/20/more-inaccuracies/</link>
		<comments>http://george.tsiokos.com/posts/2006/08/20/more-inaccuracies/#comments</comments>
		<pubDate>Sun, 20 Aug 2006 13:40:00 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[Windows]]></category>

		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/1969/12/31/more-inaccuracies/</guid>
		<description><![CDATA[Daring fireball reveals hypocrisy on a comparison between Windows and Mac OS X. After reading both posts, I’ve found more inaccuracies with Paul Thurrott's preview of the new Mac OS X.]]></description>
			<content:encoded><![CDATA[<p>Daring fireball <a href="http://daringfireball.net/2006/08/jackass_paul_thurrott">reveals hypocrisy</a> on a comparison between Windows and Mac OS X. After reading both posts, I’ve found more inaccuracies with Paul Thurrott&#8217;s <a href="http://www.winsupersite.com/showcase/macosx_leopard_preview.asp">preview</a> of the new Mac OS X.</p>
<blockquote><p>Time Machine is a truly good idea: It helps you automatically back up everything on your system and restore earlier versions of files at any time. (1)</p></blockquote>
<p>It’s much more than just files - it&#8217;s data. Time Machine includes an API for applications to backup/restore data – such as contacts or browser favorites. Unlike other backup software or OS features, you can individually restore a contact deleted in the past using the software that created the contact, Address Book, and Time Machine. This is not possible with any technology Microsoft has shipped or has announced for Vista. The API can be used by applications to support incremental backups of data inside of the application’s data store – instead of the <em>entire data store</em> (think Personal Folders.pst).</p>
<blockquote><p>But this was a great idea over three years ago when Microsoft first added it to Windows Server 2003 as Volume Shadow Copy (VSC, or &#8220;Previous Versions&#8221; to end users). (1)</p></blockquote>
<p>Snapshots are a more advanced technology (2) that are technically better than a file copy for point in time backups of an entire disk volume. So, Microsoft added a better technology (than file copy) to Windows Server 2003 &#038; Windows Vista. Time Machine uses a “file system event notification system” (2) to determine which files to copy the files to the backup device. Since snapshots require source volume, and the idea is to backup to an external volume or network location, snapshots (on their own) are not a viable solution.</p>
<p>That’s why Microsoft is shipping both <a href="http://www.microsoft.com/windowsvista/features/foreveryone/backup.mspx">Previous Versions and Windows Backup</a> as part of Vista. A user can rely on Windows Backup to restore all of the applications and data or selected file types. Previous Versions represents a convenient way to restore files by right-clicking the file, selecting properties, and browsing through the list of every snapshot taken of the file. Windows Backup is slow, performs full and incremental backups, and will notify the user when they should create a new, full backup. Previous Versions is fast and data is stored on the source volume along with the actual data without annoying user prompts. Windows Backup is a traditional backup application, and traditionally, most people do not use these applications.</p>
<p>(1) <a href="http://www.winsupersite.com/showcase/macosx_leopard_preview.asp">Apple Mac OS X Leopard Preview: Who&#8217;s the Copycat Now?</a><br />
(2) <a href="http://arstechnica.com/staff/fatbits.ars/2006/8/15/4995">Time Machine and the future of the file system</a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/08/20/more-inaccuracies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>email2face is live!</title>
		<link>http://george.tsiokos.com/posts/2006/03/27/email2face-is-live/</link>
		<comments>http://george.tsiokos.com/posts/2006/03/27/email2face-is-live/#comments</comments>
		<pubDate>Mon, 27 Mar 2006 16:09:36 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/03/27/email2face-is-live/</guid>
		<description><![CDATA[Find out what someone looks like based on their email address! Most people have online relationships with several people whom they have never met in person. Most of the time, all you have is their email address. email2face is an online directory of photos that are linked to people&#8217;s email addresses. You can register your [...]]]></description>
			<content:encoded><![CDATA[<p>Find out what someone looks like based on their email address! Most people have online relationships with several people whom they have never met in person. Most of the time, all you have is their email address. email2face is an online directory of photos that are linked to people&#8217;s email addresses. You can register your photo as well as search for others&#8217; photos.</p>
<p><a href="http://www.email2face.com">email2face.com</a> | <a href="http://digg.com/links/Find_out_what_someone_looks_like_based_on_their_email_address">digg story</a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/03/27/email2face-is-live/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SxS does not support configuration namespace in app.config files</title>
		<link>http://george.tsiokos.com/posts/2006/01/12/sxs/</link>
		<comments>http://george.tsiokos.com/posts/2006/01/12/sxs/#comments</comments>
		<pubDate>Fri, 13 Jan 2006 03:15:38 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Bugs]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/01/12/sxs/</guid>
		<description><![CDATA[If the configuration namespace is referenced in an app.config, you may receive the following error messages in the system event log:

Syntax error in manifest or policy file file name on line 2. The manifest file root element must be assembly.
The application failed to launch because of an invalid manifest.
Generate Activation Context failed for file name.Manifest. [...]]]></description>
			<content:encoded><![CDATA[<p>If the configuration namespace is referenced in an app.config, you may receive the following error messages in the system event log:</p>
<ul>
<li>Syntax error in manifest or policy file <em>file name</em> on line 2. The manifest file root element must be assembly.</li>
<li>The application failed to launch because of an invalid manifest.</li>
<li>Generate Activation Context failed for <em>file name</em>.Manifest. Reference error message: The operation completed successfully.</li>
</ul>
<p>You may also receive this message box:</p>
<ul>
<li>The operation could not be completed. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.</li>
</ul>
<p>If you were using a beta version of Visual Studio 2005, you may have the configuration namespace, <strong>http://schemas.microsoft.com/.NetConfiguration/v2.0</strong>, referenced in your app.config. This is not supported by SxS, so you application will fail to load when you create an application manifest, or attempt to use ClickOnce.</p>
<p>Please rate and validate this problem at the <a href="http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=ab317f30-b5d2-470d-a345-0116a93b9364">MSDN Microsoft Product Feedback Center</a> so Microsoft responds with a solution or workaround.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/01/12/sxs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ClickOnce does not support mandatory user profiles</title>
		<link>http://george.tsiokos.com/posts/2006/01/12/clickonce-does-not-support-mandatory-user-profiles/</link>
		<comments>http://george.tsiokos.com/posts/2006/01/12/clickonce-does-not-support-mandatory-user-profiles/#comments</comments>
		<pubDate>Fri, 13 Jan 2006 02:46:32 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[Bugs]]></category>

		<category><![CDATA[ClickOnce]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2006/01/12/clickonce-does-not-support-mandatory-user-profiles/</guid>
		<description><![CDATA[When attempting to install a ClickOnce application when using mandatory user profiles, you may receive an error message similar to the following:

The manifest may not be valid or the file could not be opened
Manifest XML signature is not valid
The profile for the user is a temporary profile

Please rate and validate this problem at the MSDN [...]]]></description>
			<content:encoded><![CDATA[<p>When attempting to install a ClickOnce application when using mandatory user profiles, you may receive an error message similar to the following:</p>
<ul>
<li>The manifest may not be valid or the file could not be opened</li>
<li>Manifest XML signature is not valid</li>
<li><strong>The profile for the user is a temporary profile</strong></li>
</ul>
<p>Please rate and validate this problem at the <a href="http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=8eba2e10-e890-428c-b4e4-6ad54f347c0d">MSDN Microsoft Product Feedback Center</a> so Microsoft responds with a solution or workaround.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2006/01/12/clickonce-does-not-support-mandatory-user-profiles/feed/</wfw:commentRss>
		</item>
		<item>
		<title>yield return &#8220;elegant code&#8221;</title>
		<link>http://george.tsiokos.com/posts/2005/08/29/yield-return-elegant-code/</link>
		<comments>http://george.tsiokos.com/posts/2005/08/29/yield-return-elegant-code/#comments</comments>
		<pubDate>Tue, 30 Aug 2005 04:55:27 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/08/29/yield-return-elegant-code/</guid>
		<description><![CDATA[I didn’t think the new iterator pattern in c# 2.0 would be as useful as the other new features. I though, how many problems are solved with enumerators? Well, here is a great example where creating an enumerator isn’t the problem being solved, it’s an elegant HTTP application pipeline that uses the state machine automatically [...]]]></description>
			<content:encoded><![CDATA[<p>I didn’t think the new iterator pattern in c# 2.0 would be as useful as the other new features. I though, how many problems are solved with enumerators? Well, here is a great example where creating an enumerator isn’t the problem being solved, it’s an elegant HTTP application pipeline that uses the state machine automatically created by the c# compiler for handling asynchronous work. The new yield return statement simplifies the code significantly.</p>
<p><a href="http://tirania.org/blog/archive/2005/Aug-28.html">Iterators and Efficient Use of the Thread Pool</a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/08/29/yield-return-elegant-code/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ISNULL in c#</title>
		<link>http://george.tsiokos.com/posts/2005/08/27/isnull-in-c-sharp/</link>
		<comments>http://george.tsiokos.com/posts/2005/08/27/isnull-in-c-sharp/#comments</comments>
		<pubDate>Sun, 28 Aug 2005 01:48:07 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/08/27/isnull-in-c-sharp/</guid>
		<description><![CDATA[If you’ve used SQL Server, you’ve probably used the ISNULL function. It replaces NULL with the specified replacement value. In .NET 2.0, c# gets this capability with a new ?? operator – the null coalescing operator. So when you define nullable types, you can check for null, and replace it with another value with this [...]]]></description>
			<content:encoded><![CDATA[<p>If you’ve used SQL Server, you’ve probably used the ISNULL function. It replaces NULL with the specified replacement value. In .NET 2.0, c# gets this capability with a new ?? operator – the <em>null coalescing operator</em>. So when you define nullable types, you can check for null, and replace it with another value with this simple syntax:</p>
<pre>int? x = 5;
int? y = null;
// since x is not null, (x ?? 0) returns 5.
Assert.AreEqual(5, (x ?? 0));
// since y is null, (y ?? 0) returns 0.
Assert.AreEqual(0, (y ?? 0));
</pre>
<p>The operator also works with reference types:</p>
<pre>// table can be null
public static int Fill(DataTable table)
{
  // if table is null, _defaultDataTable is used instead
  foreach(DataRow dataRow in table.Rows ?? _defaultDataTable.Rows)
  {
    // do work
  }
  return 0;
}
</pre>
<p>Video presentation from Tech·Ed 2005: <a href="http://msdn.microsoft.com/vcsharp/community/events/teched05/videos/DEV340.htm">An In-Depth Look at C# 2.0</a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/08/27/isnull-in-c-sharp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Not going to the PDC</title>
		<link>http://george.tsiokos.com/posts/2005/08/15/pdc-2005/</link>
		<comments>http://george.tsiokos.com/posts/2005/08/15/pdc-2005/#comments</comments>
		<pubDate>Mon, 15 Aug 2005 22:28:24 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/08/15/pdc-2005/</guid>
		<description><![CDATA[I&#8217;ve always wanted to go to the PDC, i’ve just never been in the position to go. For example, for the 2000 Professional Developer’s Conference (PDC), I was an undergraduate student at the University of Central Florida working as a professor’s assistant, making just enough money to pay the bills. I visited the Orlando Convention [...]]]></description>
			<content:encoded><![CDATA[<p><img id="image71" src="http://george.tsiokos.com/wp-content/uploads/2006/08/pdc2000.jpg" alt="PDC 2000 .NET CDs" align="left" border="0" />I&#8217;ve always wanted to go to the PDC, i’ve just never been in the position to go. For example, for the 2000 <a href="http://msdn.microsoft.com/events/pdc/">Professional Developer’s Conference</a> (PDC), I was an undergraduate student at the <a href="http://www.ucf.edu/">University of Central Florida</a> working as a professor’s assistant, making just enough money to pay the bills. I visited the Orlando Convention Center on the last day of the PDC and picked up the first public release of <a href="http://msdn.microsoft.com/netframework/">.NET</a> and <a href="http://msdn.microsoft.com/vstudio/">Visual Studio .NET</a> on four CDs. It was great! I was able to teach myself .NET and c# from the Tech Preview CDs and <a href="http://msdn.microsoft.com/">MSDN online</a>. It was then that I realized how important the PDC was to software developers.</p>
<p>I had a scheduling problem with the 2003 PDC – you could imagine my surprise when I found out it conflicted with my honeymoon. I realized that I had to push my employer (for two years) to budget for training for the next PDC. My work paid off – In January of 2005, my supervisor informed me that I was going to the PDC. Unfortunately, in May, I accepted a position with another company.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/08/15/pdc-2005/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Time to change your pin</title>
		<link>http://george.tsiokos.com/posts/2005/07/12/time-to-change-your-pin/</link>
		<comments>http://george.tsiokos.com/posts/2005/07/12/time-to-change-your-pin/#comments</comments>
		<pubDate>Tue, 12 Jul 2005 16:03:19 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/07/12/time-to-change-your-pin/</guid>
		<description><![CDATA[Some guy has posted a list of everyone&#8217;s pin!
read more &#124; digg story
]]></description>
			<content:encoded><![CDATA[<p>Some guy has posted a list of everyone&#8217;s pin!</p>
<p><a href="http://positiveatheism.org/crt/pin.htm">read more</a> | <a href="http://digg.com/security/Time_to_change_your_pin">digg story</a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/07/12/time-to-change-your-pin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WSS-RSS Version 1.4</title>
		<link>http://george.tsiokos.com/posts/2005/07/04/wss-rss-14/</link>
		<comments>http://george.tsiokos.com/posts/2005/07/04/wss-rss-14/#comments</comments>
		<pubDate>Mon, 04 Jul 2005 22:18:26 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[Business]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/07/04/wss-rss/</guid>
		<description><![CDATA[I have released a new version of my <a href="http://george.tsiokos.com/projects/wss_rss/">Windows SharePoint Services RSS/ATOM reader</a>. It now supports the two most requested optional features: items displayed in a new window &#038; not displaying item descriptions.]]></description>
			<content:encoded><![CDATA[<p>I have released a new version of my <a href="http://george.tsiokos.com/projects/wssrss/">Windows SharePoint Services RSS/ATOM reader</a>. It now supports the two most requested features: items optionally displayed in a new window &#038; optionally displaying item descriptions. As with previous versions, you may generate DWP files for use in SharePoint directly from my website or, for companies with tight security, download the source and perform the transformation locally.</p>
<p>For proxy servers &#038; faster performance, I recommend downloading <a href="http://www.gnu.org/software/wget/wget.html">Wget</a> to automatically retrieve RSS feeds from outside the company to a locally run web server. Wget can retrieve remote RSS feeds through proxies that require authentication. You can create a batch file that runs Wget against all external RSS feeds, and configure it to run as a scheduled task. Then, point msxsl to the local web server&#8217;s cached copy to generate the DWP file. In this configuration, WSS-RSS will retrieve the RSS feed from your local web server for display in SharePoint. You should also lower SharePoint&#8217;s cache time of WSS-RSS because it is retrieving the feed locally. Because the latency and bandwidth favor your local network, performance will be greatly improved. I will provide a downloadable sample shortly.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/07/04/wss-rss-14/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Busy, busy, and busy</title>
		<link>http://george.tsiokos.com/posts/2005/05/24/busy-busy-and-busy/</link>
		<comments>http://george.tsiokos.com/posts/2005/05/24/busy-busy-and-busy/#comments</comments>
		<pubDate>Tue, 24 May 2005 06:16:42 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/05/24/busy-busy-and-busy/</guid>
		<description><![CDATA[It&#8217;s been a while since my last post. I&#8217;ve accepted a position with ASPSOFT and have been extremely busy since March. I&#8217;m hard at work on a new community site for .NET development that should ease coding for multiple versions of .NET as well as the transition to new versions (such as .NET 2.0/Visual Studio [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since my last post. I&#8217;ve accepted a position with <a href="http://www.aspsoft.com/">ASPSOFT</a> and have been extremely busy since March. I&#8217;m hard at work on a new community site for .NET development that should ease coding for multiple versions of .NET as well as the transition to new versions (such as <a href="http://msdn.microsoft.com/netframework/">.NET 2.0</a>/<a href="http://msdn.microsoft.com/vstudio/">Visual Studio 2005</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/05/24/busy-busy-and-busy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>.NET HTTPS Security</title>
		<link>http://george.tsiokos.com/posts/2005/02/10/net-https-security/</link>
		<comments>http://george.tsiokos.com/posts/2005/02/10/net-https-security/#comments</comments>
		<pubDate>Fri, 11 Feb 2005 02:29:45 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/02/10/net-https-security/</guid>
		<description><![CDATA[System.Net.WebException: The underlying connection was closed: Could not establish trust relationship with remote server. This usually happens on a client calling a secure web service. Did you write this code to solve the problem?]]></description>
			<content:encoded><![CDATA[<p>Did you ever get this exception when using HTTPS?</p>
<p><i>System.Net.WebException: The underlying connection was closed: Could not establish trust relationship with remote server.</i></p>
<p>This usually happens on a client calling a secure web service with a user generated certificate. Did you write this code to solve the problem?</p>
<pre>public class TerribleCertificatePolicy : System.Net.ICertificatePolicy {
  public bool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest req, int problem) {
      return true;
    }
  }
...
System.Net.ServicePointManager.CertificatePolicy = new TerribleCertificatePolicy();</pre>
<p>So now you’ve made this HTTPS transport security insecure and susceptible to a man-in-the-middle attack. If you compare this with an Internet Explorer dialog box, it’s basically clicking yes to every security alert. If you <a href="http://www.google.com/search?q=ICertificatePolicy">search for ICertificatePolicy</a> on the web, you’ll find many results showing the same insecure code (including <a href="http://support.microsoft.com/?scid=kb;en-us;823177">Microsoft support</a>). Two popular options to <strong>maintain</strong> HTTPS security are to either import the web server’s certificate or root certificate to the client machine’s trusted certificates store, or <strong>verify the public key</strong> byte[] returned from the certificate.GetPublicKey() method. If you verify the issuer name, you’re wasting CPU cycles.</p>
<p>To demonstrate how easy it is for someone to view your HTTPS conversation between your client and server, download <a href="http://www.oxid.it/cain.html">Cain</a>. With this software, you target your client&#8217;s IP Address with ARP poisoning, and essentially become the man-in-the-middle. So Cain’s pretty cool in the sense it will download the public key from the real server and create another public/private key that looks just like the real one (other than the fact that it has a different public <strong>key</strong>). After it does this, your client establishes a HTTPS connection with Cain – and it has no idea. The DNS, the IP Address; everything looks great. Cain has a HTTPS connection with the real server – and the fun begins. All that’s required are a couple of clicks in Cain. If this wasn&#8217;t a security issue it would be <em>really</em> funny since you&#8217;ve established a secure connection with the hacker! Did you realize these tools are so sophisticated?</p>
<p><img alt="Security Alert - Click No! If a hacker is using Cain the certificate will look just like the real one." src="http://george.tsiokos.com/post/2005/02/10/net-https-security/01.gif" /></p>
<p>Click <a href="http://george.tsiokos.com/posts/2004/08/26/reference-or-value-equality/">here</a> for an example (at the bottom of the post) that shows how to securely verify a server&#8217;s certificate.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/02/10/net-https-security/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Florida Code Camp 2005</title>
		<link>http://george.tsiokos.com/posts/2005/02/09/florida-code-camp-2005/</link>
		<comments>http://george.tsiokos.com/posts/2005/02/09/florida-code-camp-2005/#comments</comments>
		<pubDate>Thu, 10 Feb 2005 00:27:28 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/02/09/florida-code-camp-2005/</guid>
		<description><![CDATA[I had a great time at the Florida Code Camp 2005. The Indigo presentation was awesome – I’d really like to see some more details on the new Windows Activation Service that Indigo supports for application hosting. I was also particularly impressed with Visual Studio Team System’s ability to get the analyst, architect, developer, and [...]]]></description>
			<content:encoded><![CDATA[<p>I had a great time at the Florida Code Camp 2005. The Indigo <a href="http://blogs.msdn.com/dougturn/archive/2005/02/05/367782.aspx">presentation</a> was awesome – I’d really like to see some more details on the new Windows Activation Service that Indigo supports for application hosting. I was also particularly impressed with Visual Studio Team System’s ability to get the analyst, architect, developer, and server administrators to collaborate. I can’t wait to see if it works!</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/02/09/florida-code-camp-2005/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows SharePoint Services RSS (WSS-RSS)</title>
		<link>http://george.tsiokos.com/posts/2005/01/11/wss-rss/</link>
		<comments>http://george.tsiokos.com/posts/2005/01/11/wss-rss/#comments</comments>
		<pubDate>Tue, 11 Jan 2005 22:00:00 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[Business]]></category>

		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/01/11/wss-rss/</guid>
		<description><![CDATA[SharePoint RSS/ATOM reader - XSL converts RSS to a native Windows SharePoint Services DataViewWebPart DWP file - No binaries, installation or server configuration necessary.]]></description>
			<content:encoded><![CDATA[<p><strong>SharePoint RSS/ATOM reader</strong></p>
<p><img id="image72" src="http://george.tsiokos.com/wp-content/uploads/2006/08/sharepoint.gif" alt="Microsoft SharePoint RSS feed rendered by the DataViewWebPart with the help of WSS-RSS" /></p>
<p>XSL converts RSS to a native Windows SharePoint Services DataViewWebPart <strong>DWP</strong> file.</p>
<ul>
<li>No binaries, installation or server configuration necessary.</li>
<li>Supports RSS versions 0.90, 0.91, 0.92, 1.0, and 2.0.</li>
<li>Supports the Atom Syndication Format 0.3.</li>
<li>Supports Microsoft&#8217;s Channel Definition Format.</li>
<li>Html output is similar to the links list summary view.</li>
<li>Title, Description, and DetailLink come from the RSS channel element.</li>
<li>RSS 2.0&#8217;s time to live attribute or RSS 1.0&#8217;s syndication module are used to determine cache time for the webpart.</li>
<li>Please <a href="mailto:george@tsiokos.com">email me</a> any suggestions/bugs/fixes.</li>
<li>Absolutely free: MIT License.</li>
</ul>
<p>Known issues:</p>
<ul>
<li>Does not support feeds requiring authentication.</li>
<li>Sometimes doesn&#8217;t support feeds containing accents.</li>
</ul>
<p>The service has moved to <a href="http://sharepointrss.com">SharePointRSS.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/01/11/wss-rss/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Halo 2 was depressing yesterday</title>
		<link>http://george.tsiokos.com/posts/2005/01/09/halo-2-was-depressing-yesterday/</link>
		<comments>http://george.tsiokos.com/posts/2005/01/09/halo-2-was-depressing-yesterday/#comments</comments>
		<pubDate>Sun, 09 Jan 2005 15:03:13 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/01/09/halo-2-was-depressing-yesterday/</guid>
		<description><![CDATA[On Wednesday, I had some great scores and my level went from 4 to 5 after the first game on Saturday. Then I started to play against opponents whose level was between 5 and 10! It was really bad, and my level went back to 4. How depressing.]]></description>
			<content:encoded><![CDATA[<p>&#8220;Games against similarly skilled opponents and with similarly skilled teammates tend to be the most fun.&#8221; - <a href="http://www.bungie.net/Stats/page.aspx?section=FAQInfo&#038;subsection=stats&#038;page=statoverview">Bungie</a></p>
<p>I disagree with that statement. I find that games against <em>slightly less skilled</em> opponents are the most fun. On Wednesday, I had some great scores and my level went from 4 to 5 after the first game on Saturday. Then I started to play against opponents whose level was between 5 and 10! It was really bad, and my level went back to 4. How depressing.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/01/09/halo-2-was-depressing-yesterday/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Not just another year</title>
		<link>http://george.tsiokos.com/posts/2005/01/09/not-just-another-year/</link>
		<comments>http://george.tsiokos.com/posts/2005/01/09/not-just-another-year/#comments</comments>
		<pubDate>Sun, 09 Jan 2005 05:23:09 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2005/01/09/not-just-another-year/</guid>
		<description><![CDATA[I&#8217;ve finally gotten around to writing my first entry for the New Year. I’ve got many things planned for this website as well as some freeware and commercial apps coming later this year. For example, typereference.com will contain the most comprehensive class library documentation for .NET as well as showcase my new commercial web platform, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally gotten around to writing my first entry for the New Year. I’ve got many things planned for this website as well as some freeware and commercial apps coming later this year. For example, <a href="http://typereference.com">typereference.com</a> will contain the most comprehensive class library documentation for .NET as well as showcase my new commercial web platform, currently in alpha. I also plan to go to a “professional software developer’s conference” – <strong>finally</strong>! More importantly, a little surprise is on the way:</p>
<p><img id="image76" src="http://george.tsiokos.com/wp-content/uploads/2006/08/baby.jpg" alt="Baby!" /></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2005/01/09/not-just-another-year/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Collection equality regardless of item order</title>
		<link>http://george.tsiokos.com/posts/2004/12/03/collection-equality-regardless-of-item-order/</link>
		<comments>http://george.tsiokos.com/posts/2004/12/03/collection-equality-regardless-of-item-order/#comments</comments>
		<pubDate>Fri, 03 Dec 2004 23:13:24 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/12/03/collection-equality-regardless-of-item-order/</guid>
		<description><![CDATA[I wanted to test collection equality disregarding order. One int array of 1,2,3,4 and another of 4,2,3,1 would be equal. Also, collections of collections would be compared only by their items and the number of times those items appear in any collection.]]></description>
			<content:encoded><![CDATA[<p>I wanted to test collection equality disregarding order. One int array of 1,2,3,4 and another of 4,2,3,1 would be equal. Also, collections of collections would be compared only by their items and the number of times those items appear in any collection.</p>
<pre>char[] charsA = new char[] { 'a', 'b', 'c', 'a' };
char[] charsB = new char[] { 'a', 'c', 'b', 'a' };
Assert.IsTrue(Collection.Equals(charsA, charsB, false));
int[] intA = new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5 };
int[] intB = new int[] { 9, 8, 7, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0 };
Assert.IsTrue(Collection.Equals(intA, intB, false));
ArrayList arrayListA = new ArrayList();
ArrayList arrayListB = new ArrayList();
arrayListA.Add(charsA); // Adds the array as an item
arrayListB.AddRange(charsB); // Adds the items from the array
arrayListA.Add(intA);
arrayListB.AddRange(intB);
Assert.IsTrue(arrayListA.Count == 2);
Assert.IsTrue(arrayListB.Count == 20);
Assert.IsTrue(Collection.Equals(arrayListA, arrayListB, false));</pre>
<p>I had to create the <a href="/posts/2004/12/02/missing-icomparer/">RelaxComparer</a> so I could add all types to two SortedList collections that are built by the algorithm to determine equality. The SortedList objects are also used to keep track of the number of times each item appears in each collection.</p>
<p>I merged the CollectionEquals method I created <a href="/posts/2004/08/26/reference-or-value-equality/">earlier</a> together with this new algorithm to a new Collection class that can test both types of collection equality:</p>
<p> <a href="http://george.tsiokos.com/posts/2004/12/03/collection-equality-regardless-of-item-order/#more-32" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/12/03/collection-equality-regardless-of-item-order/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RelaxComparer : Missing IComparer?</title>
		<link>http://george.tsiokos.com/posts/2004/12/02/missing-icomparer/</link>
		<comments>http://george.tsiokos.com/posts/2004/12/02/missing-icomparer/#comments</comments>
		<pubDate>Thu, 02 Dec 2004 22:47:31 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/12/02/missing-icomparer/</guid>
		<description><![CDATA[I created the RelaxComparer class to perform sorting with objects of different types. So now you can add strings, chars, ints in any order and sort the items with the sort method of ArrayList.]]></description>
			<content:encoded><![CDATA[<pre>
5.CompareTo(4); // returns 1 <em>(greater than)</em>
5.CompareTo(5); // returns 0 <em>(equal)</em>
5.CompareTo(6); // returns -1 <em>(less than)</em>

// A class will only compare to its same type.
5.CompareTo(&#8217;c'); // Throws ArgumentException
</pre>
<p>I created the following class to use instead of the default Comparer class (which just calls the CompareTo method of each object implementing IComparable) to perform sorting (and other comparison related algorithms) with objects of different types.</p>
<pre>
/// &lt;summary&gt;
/// Compares two objects for equivalence, where objects of different
/// types are compared by their string representations.
/// &lt;/summary&gt;
public class RelaxComparer : IComparer
{
  public int Compare(object x, object y)
  {
    Type typeX = x.GetType(), typeY = y.GetType();
    /* IComparable.CompareTo(object obj) The parameter, obj, must be
     * the same type as the class or value type that implements this
     * interface; otherwise, an ArgumentException is thrown */
    if (typeX == typeY &amp;&amp; typeof(IComparable).IsAssignableFrom(typeX))
      return ((IComparable)x).CompareTo(y);
    else
      return x.ToString().CompareTo(y.ToString()); // use strings
  }
}
</pre>
<p>So now you can add strings, chars, ints in any order and sort the items with the sort method of ArrayList:</p>
<pre>
char[] chars = new char[] { 'a', 'd', 'c', 'b' };
int[] ints = new int[] { 4, 3, 1, 2, 0 };
char[] CHARS = new char[] { 'B', 'C', 'D', 'A' };

ArrayList arrayList = new ArrayList();

foreach(char x in chars)
  arrayList.Add(x);

foreach(int x in ints)
  arrayList.Add(x);

foreach(char x in CHARS)
  arrayList.Add(x);

arrayList.Sort(new RelaxComparer());

foreach(object o in arrayList)
  Console.Write(string.Format(&quot;{0} &quot;, o));

// output: 0 1 2 3 4 A B C D a b c d
</pre>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/12/02/missing-icomparer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How To Retrieve Column Schema by Using the IDataReader GetSchemaTable Method</title>
		<link>http://george.tsiokos.com/posts/2004/12/01/idatareader-getschematable/</link>
		<comments>http://george.tsiokos.com/posts/2004/12/01/idatareader-getschematable/#comments</comments>
		<pubDate>Wed, 01 Dec 2004 18:08:48 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/12/01/idatareader-getschematable/</guid>
		<description><![CDATA[The Microsoft KB example code or class library documentation do not explain how to efficiently return a table’s schema. I fill in what’s missing.]]></description>
			<content:encoded><![CDATA[<p>The Microsoft <a href="http://support.microsoft.com/kb/310107/EN-US/">KB example code</a> or <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlclientsqldatareaderclassgetschematabletopic.asp">class library documentation</a> do not explain how to efficiently return a table’s schema. For example, this code follows the documentation:</p>
<pre>
DataTable dataTable = null;
using(IDbConnection dbConnection = (IDbConnection)database.Unwrap())
{
  dbConnection.Open();
  using (IDbCommand dbCommand = dbConnection.CreateCommand())
  {
    dbCommand.CommandType = CommandType.Text;
    dbCommand.CommandText = &quot;SELECT * FROM SomeLargeTable;&quot;;
    using (IDataReader dataReader =
    dbCommand.ExecuteReader(CommandBehavior.KeyInfo))
    {
      dataTable = dataReader.GetSchemaTable();
      dataReader.Close();
    }
  }
  dbConnection.Close();
}
// look at table schema stored in dataTable
</pre>
<p>Results in the following SQL executed on Sql Server:</p>
<pre lang="text">SET FMTONLY OFF; SET NO_BROWSETABLE ON;
SELECT * FROM SomeLargeTable; SET NO_BROWSETABLE OFF;</pre>
<p>If you add &#8220;| CommandBehavior.SchemaOnly&#8221; to the ExecuteReader method call:</p>
<pre lang="text">SET FMTONLY OFF; SET NO_BROWSETABLE ON; <strong>SET FMTONLY ON</strong>;
SELECT * FROM SomeLargeTable; <strong>SET FMTONLY OFF</strong>; SET NO_BROWSETABLE OFF;</pre>
<p>In the SqlDataReader implementation, the CommandBehavior.SchemaOnly sets FMTONLY ON which, according to the Transact-SQL Reference, &#8220;No rows are processed or sent to the client as a result of the request when SET FMTONLY is turned ON.&#8221; With (CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly), I had a significant preformance increase - makes perfect sense since returning 100,000,000 rows to retrieve table schema is inefficent, to say the least.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/12/01/idatareader-getschematable/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQLite</title>
		<link>http://george.tsiokos.com/posts/2004/10/24/sqlite/</link>
		<comments>http://george.tsiokos.com/posts/2004/10/24/sqlite/#comments</comments>
		<pubDate>Mon, 25 Oct 2004 02:02:22 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/10/24/sqlite/</guid>
		<description><![CDATA[SQLite was the topic at the last ONETUG meeting here in Orlando, FL. I was surprised to find that SQLite was exactly what I was looking for in a client-side database - slim and easy to deploy. There’s also an ADO.NET data provider open-source project where they provide everything you need to use SQLite inside [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sqlite.org/">SQLite</a> was the topic at the last <a href="http://www.onetug.org">ONETUG</a> meeting here in Orlando, FL. I was surprised to find that SQLite was exactly what I was looking for in a client-side database - slim and easy to deploy. There’s also an <a href="http://sourceforge.net/projects/adodotnetsqlite/">ADO.NET data provider open-source project</a> where they provide everything you need to use SQLite inside you .NET application. Personally, I was able to modify one of my applications to use it in less than thirty minutes and found both the database and ADO.NET provider to be extremely useful and fast!</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/10/24/sqlite/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CountryWide PayPlan/52</title>
		<link>http://george.tsiokos.com/posts/2004/09/11/countrywide-payplan-52/</link>
		<comments>http://george.tsiokos.com/posts/2004/09/11/countrywide-payplan-52/#comments</comments>
		<pubDate>Sat, 11 Sep 2004 21:57:48 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/09/11/countrywide-payplan-52/</guid>
		<description><![CDATA[Countrywide wants me to believe that making more payments on my loan will benefit me. For example, with PayPlan/52, I could pay off my mortgage every week. 
You may be able to save thousands of dollars in interest payments and reduce the term of your loan by several years, or just enjoy the ability to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://my.countrywide.com/">Countrywide</a> wants me to believe that making more payments on my loan will benefit me. For example, with PayPlan/52, I could pay off my mortgage every week. </p>
<blockquote><p>You may be able to save thousands of dollars in interest payments and reduce the term of your loan by several years, or just enjoy the ability to have your payment drafts occur when you receive your paycheck.</p></blockquote>
<p>In reality, they take my money every week but hold it until they&#8217;ve accumulated enough to pay the monthly bill. So the fact I made weekly payments had no effect on the loan. In the event I paid more than what was due for the month, it went against the principal, consequently reducing the interest and term of the loan.<br />
<blockquote>While other lenders may offer similar plans, they also charge significant up-front fees, which can add up to hundreds of dollars. With PayPlan/52, you pay nothing to enroll, and <b>a nominal fee of $1.00 for each weekly transaction</b>.
</p></blockquote>
<p>I can pay additional principal when I make my monthly payment, consequently reducing the interest and term of the loan. So where&#8217;s the benefit of spending an additional $52/year for this PayPlan service?</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/09/11/countrywide-payplan-52/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IPAddress class serializable?</title>
		<link>http://george.tsiokos.com/posts/2004/09/06/ipaddress-class-serializable/</link>
		<comments>http://george.tsiokos.com/posts/2004/09/06/ipaddress-class-serializable/#comments</comments>
		<pubDate>Tue, 07 Sep 2004 03:33:04 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/09/06/ipaddress-class-serializable/</guid>
		<description><![CDATA[Back in 2002 I posted a question in Usenet about the IPAddress class being serializable, but not serializing in ASP.NET. I just found the post, and noticed that no one responded with the reason why.]]></description>
			<content:encoded><![CDATA[<p>Back in 2002 I posted a question in Usenet about the IPAddress class being serializable, but not serializing in ASP.NET. I just found the <a href="http://groups.google.com/groups?hl=en&#038;lr=&#038;ie=UTF-8&#038;threadm=Swyd8.239036%24jO5.30824907%40typhoon.tampabay.rr.com&#038;rnum=3&#038;prev=/groups%3Fq%3D%2522IPAddress%2Bclass%2Bserializable%2522%26hl%3Den%26lr%3D%26ie%3DUTF-8%26filter%3D0">post</a>, and noticed that no one responded with the reason why. So, here it is:</p>
<p>There are two types of serialization in .NET: System.Runtime.Serialization and System.Xml.Serialization. Runtime serialization uses the serializable attribute while XML serialization does not. Since ASP.NET uses XML serialization, the attribute was irrelevant.</p>
<p>The error I received was &#8220;System.Net.IPAddress cannot be serialized because it does not have a default public constructor.&#8221; One of the requirements of the XmlSerializer is that the class it is trying to serialize <strong>must have a default public constructor</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/09/06/ipaddress-class-serializable/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Is it reference or value equality?</title>
		<link>http://george.tsiokos.com/posts/2004/08/26/reference-or-value-equality/</link>
		<comments>http://george.tsiokos.com/posts/2004/08/26/reference-or-value-equality/#comments</comments>
		<pubDate>Thu, 26 Aug 2004 13:03:00 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/08/26/reference-or-value-equality/</guid>
		<description><![CDATA[Probably reference. Checking for value equality is unintuitive - by default, ==  is a reference equality check. I've posted my solution to perform value equality for collections, CollectionEquals().]]></description>
			<content:encoded><![CDATA[<p>Probably reference. Checking for value equality is unintuitive - by default == is a reference equality check.
<div style="font-family: Consolas, Courier New; font-size: 10pt; color: black; background: white;">
<pre style="margin: 0px;"><span style="color: blue;">object</span> a = 1;</pre>
<pre style="margin: 0px;"><span style="color: blue;">object</span> b = 1;</pre>
<pre style="margin: 0px;">Assert.IsFalse (a == b);</pre>
<p></div>
<p>Object <strong>a</strong> doesn&#8217;t equal object <strong>b</strong> since <a href="http://msdn2.microsoft.com/en-us/library/yz2be5wk.aspx">boxing</a> <strong>a</strong> as object created once instance, and boxing <strong>b</strong> created another. Since == is a &#8220;reference type equality operator&#8221;, it will only compare the references.</p>
<p>Using any of these methods works fine:</p>
<div style="font-family: Consolas, Courier New; font-size: 10pt; color: black; background: white;">
<pre style="margin: 0px;">Assert.IsTrue (a.Equals (b));</pre>
<pre style="margin: 0px;">Assert.IsTrue (((<span style="color: blue;">int</span>)a).Equals (b));</pre>
<pre style="margin: 0px;">Assert.IsTrue (<span style="color: teal;">Object</span>.Equals (a, b));</pre>
<pre style="margin: 0px;">Assert.IsTrue ((<span style="color: blue;">int</span>)a == (<span style="color: blue;">int</span>)b);</pre>
<p></div>
<p>When passing objects around, the simple solution is to use the Equals() method as it <em>may</em> perform value equality if the object overrides Equals(). So, value equality is somewhat easy to accomplish for individual objects, but you run into this problem again with collections:</p>
<div style="font-family: Consolas, Courier New; font-size: 10pt; color: black; background: white;">
<pre style="margin: 0px;">Assert.IsFalse (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">string</span>[] { <span style="color: maroon;">&#8220;abc&#8221;</span>, <span style="color: maroon;">&#8220;def&#8221;</span> }.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">string</span>[] { <span style="color: maroon;">&#8220;abc&#8221;</span>, <span style="color: maroon;">&#8220;def&#8221;</span> }));</pre>
<pre style="margin: 0px;">Assert.IsFalse (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }.Equals (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }));</pre>
<pre style="margin: 0px;">Assert.IsFalse (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">object</span>[] { 4, <span style="color: maroon;">&#8220;stuff&#8221;</span>, <span style="color: teal;">DateTime</span>.Parse (<span style="color: maroon;">&#8220;1/1/2004 1:00 AM&#8221;</span>) }.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">object</span>[] { 4, <span style="color: maroon;">&#8220;stuff&#8221;</span>, <span style="color: teal;">DateTime</span>.Parse (<span style="color: maroon;">&#8220;January 1, 2004 01:00&#8243;</span>) }));</pre>
<p></div>
<p>There is only reference equality with ArrayList since Object.Equals() is inherited not overridden.</p>
<div style="font-family: Consolas, Courier New; font-size: 10pt; color: black; background: white;">
<pre style="margin: 0px;">Assert.IsFalse (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }) == </pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }));</pre>
<pre style="margin: 0px;">Assert.IsFalse (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }).Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 })));</pre>
<p></div>
<p><a href="/posts/2004/12/03/collection-equality-regardless-of-item-order/#more-32">Here&#8217;s my solution</a> to perform value equality for collections. And now:</p>
<div style="font-family: Consolas, Courier New; font-size: 10pt; color: black; background: white;">
<pre style="margin: 0px;">Assert.IsTrue (Collection.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }), </pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (<span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }), <span style="color: blue;">true</span>));</pre>
<pre style="margin: 0px;">Assert.IsTrue (Collection.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }, <span style="color: blue;">new</span> System.Collections.<span style="color: teal;">ArrayList</span> (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }), <span style="color: blue;">true</span>));</pre>
<pre style="margin: 0px;">Assert.IsTrue (Collection.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">object</span>[] { 1, 2, 3 }, </pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">int</span>[] { 1, 2, 3 }), <span style="color: blue;">true</span>);</pre>
<pre style="margin: 0px;">Assert.IsTrue (Collection.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">object</span>[] { 4, <span style="color: maroon;">&#8220;stuff&#8221;</span>, <span style="color: teal;">DateTime</span>.Parse (<span style="color: maroon;">&#8220;1/1/2004 1:00 AM&#8221;</span>) }, </pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">object</span>[] { 4, <span style="color: maroon;">&#8220;stuff&#8221;</span>, <span style="color: teal;">DateTime</span>.Parse (<span style="color: maroon;">&#8220;January 1, 2004 01:00&#8243;</span>) }), <span style="color: blue;">true</span>);</pre>
<p></div>
<p>Here&#8217;s a real world example:</p>
<div style="font-family: Consolas, Courier New; font-size: 10pt; color: black; background: white;">
<pre style="margin: 0px;"><span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;summary&gt;</span><span style="color: green;">Always accepts the public key hardcoded in the byte array as a valid certificate.</span><span style="color: gray;">&lt;/summary&gt;</span></pre>
<pre style="margin: 0px;"><span style="color: blue;">public</span> <span style="color: blue;">sealed</span> <span style="color: blue;">class</span> <span style="color: teal;">AcceptTrustedCertificate</span> : <span style="color: teal;">ICertificatePolicy</span> {</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">bool</span> CheckValidationResult (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: teal;">ServicePoint</span> srvPoint,</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: teal;">X509Certificate</span> certificate,</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: teal;">WebRequest</span> request,</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">int</span> certificateProblem) {</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">//TODO: verify certificateProblem is an acceptable value</span></pre>
<pre style="margin: 0px;">&nbsp;</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// return true if certificate returned is equal to the certificate&#8217;s public key</span></pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> Collection.Equals (</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; certificate.GetPublicKey (),</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">new</span> <span style="color: blue;">byte</span>[] { 48, 130, 1, 10, 2, 130, 1, 1, 0, 206, 214, 212 }, <span style="color: blue;">true</span>);</pre>
<pre style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</pre>
<pre style="margin: 0px;">}</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/08/26/reference-or-value-equality/feed/</wfw:commentRss>
		</item>
		<item>
		<title>XML/object libraries are deprecated</title>
		<link>http://george.tsiokos.com/posts/2004/07/15/xml-object-libraries-are-deprecated/</link>
		<comments>http://george.tsiokos.com/posts/2004/07/15/xml-object-libraries-are-deprecated/#comments</comments>
		<pubDate>Fri, 16 Jul 2004 03:01:23 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/07/15/xml-object-libraries-are-deprecated/</guid>
		<description><![CDATA[Libraries who read and write objects or structures to and  from an XML file are deprecated. These libraries should evolve to solve a different problem: generating libraries that read and write specific XML formats.]]></description>
			<content:encoded><![CDATA[<p>If you take any one of the many RSS libraries, including my own RSS.NET, ATOM libraries, or even OPML libraries, you find mostly the same functionality. Each read and write to a specific XML format. Some take advantage of the XML libraries provided by the environment, and some even read and write through streams. But they all solve the same problem - reading and writing objects or structures to and from an XML file, abstracting away XML from the client.</p>
<p>From my experience with RSS.NET, I believe that this code is useless. These formats will eventually evolve and new formats will arise. These libraries should evolve to solve a different problem: <strong>generating libraries</strong> that read and write specific XML formats.</p>
<p>Armed with a XML schema and an object mapping XML file, this new type of library should be able to generate libraries themselves whose purpose is to read and write to a specific XML file format. After this assembly is produced, developers can use this &#8220;strongly typed&#8221; object and its <em>format</em>Reader and <em>format</em>Writer objects to read and write documents. Since this library would use code generation, developers would code this library against the XML schema standard, resulting in generic code that could be applied to any XML format.</p>
<p><img id="image75" src="http://george.tsiokos.com/wp-content/uploads/2006/08/reusable_object_library.jpg" alt="Reusable object library generation" /></p>
<p>The result could be RSS, ATOM, and OPML objects who can read and write their respective formats a piece at a time (by using a stream) or, all at once. They would be schema compliant, optimized for each specific version, and most importantly, extremely easy to use by the end developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/07/15/xml-object-libraries-are-deprecated/feed/</wfw:commentRss>
		</item>
		<item>
		<title>This weblog is preliminary and is subject to change.</title>
		<link>http://george.tsiokos.com/posts/2004/07/09/terms-of-use/</link>
		<comments>http://george.tsiokos.com/posts/2004/07/09/terms-of-use/#comments</comments>
		<pubDate>Sat, 10 Jul 2004 02:44:55 +0000</pubDate>
		<dc:creator>George Tsiokos</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://george.tsiokos.com/posts/2004/07/09/terms-of-use/</guid>
		<description><![CDATA[Through his network of websites, George provides you with access to a variety of resources, including source code, download areas, communication forms, and product information (collectively “Content”). This Content, including any updates, enhancements, new features, and/or the addition of new Content, as subject to the TOU.]]></description>
			<content:encoded><![CDATA[<p>The services that George provides to you are subject to the following Terms of Use (TOU). George reserves the right to update the TOU at any time without notice to you. The most current version of the TOU can be reviewed <a href="http://george.tsiokos.com/posts/2004/07/09/terms-of-use/">here</a>.</p>
<p>Through his network of websites, George provides you with access to a variety of resources, including source code, download areas, communication forms, and product information (collectively &#8220;Content&#8221;). This Content, including any updates, enhancements, new features, and/or the addition of new Content, as subject to the TOU.</p>
<p>This website supports a preliminary release of a weblog that may be changed substantially prior to final public release. This website is provided for informational purposes only and George makes no warranties, either express or implied, in this website. Information in this website, including all postings, URL and other Internet Web site references, is subject to change without notice. The entire risk of the use or the results from the use of this website remains with the user. Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, no part of this website may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of George.</p>
<p>George may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this website. Except as expressly provided in any written license agreement from George, the furnishing of this website does not give you any license to these patents, trademarks, copyrights, or other intellectual property.</p>
<p>The opinions expressed herein do not represent George&#8217;s personal opinions or his employer&#8217;s, family, or friends&#8217; view in any way.</p>
<p><b>Source code</b></p>
<p>Source code (software) that is available on this website is licensed under this license:</p>
<p>Copyright © 2003-2007, George Tsiokos. All Rights Reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<ul>
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>Neither the name of this website nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ul>
<p><code>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</code></p>
]]></content:encoded>
			<wfw:commentRss>http://george.tsiokos.com/posts/2004/07/09/terms-of-use/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
