<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments for Graeme Hill's Dev Blog</title>
	<atom:link href="http://graemehill.ca/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://graemehill.ca</link>
	<description></description>
	<pubDate>Sat, 19 May 2012 08:58:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Discard changes in LINQ to SQL DataContext by umair</title>
		<link>http://graemehill.ca/discard-changes-in-linq-to-sql-datacontext/comment-page-1#comment-3063</link>
		<dc:creator>umair</dc:creator>
		<pubDate>Tue, 01 May 2012 16:37:02 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=5#comment-3063</guid>
		<description>This works perfect for me. I hope in future, they will make this much simpler than this.

Thanks</description>
		<content:encoded><![CDATA[<p>This works perfect for me. I hope in future, they will make this much simpler than this.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Updating and restarting a singleton WCF service hosted in IIS by 360 power brick</title>
		<link>http://graemehill.ca/updating-and-restarting-a-singleton-wcf-service-hosted-in-iis/comment-page-1#comment-3056</link>
		<dc:creator>360 power brick</dc:creator>
		<pubDate>Sun, 15 Apr 2012 12:27:20 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=262#comment-3056</guid>
		<description>&lt;strong&gt;Read was interesting, stay in touch…...&lt;/strong&gt;

[...]please visit the sites we follow, including this one, as it represents our picks from the web[...]…...</description>
		<content:encoded><![CDATA[<p><strong>Read was interesting, stay in touch…&#8230;</strong></p>
<p>[...]please visit the sites we follow, including this one, as it represents our picks from the web[...]…&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on High performance database rollback in automated tests with SQL Server by Mose Ellingham</title>
		<link>http://graemehill.ca/high-performance-database-rollback-in-automated-tests-with-sql-server/comment-page-1#comment-3029</link>
		<dc:creator>Mose Ellingham</dc:creator>
		<pubDate>Fri, 09 Mar 2012 03:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=179#comment-3029</guid>
		<description>Heya, I assumed you most likely are able to help me. I have an MSSQL .ldf and .mdf file that I need to restore. Any opinions on how to achieve this?  Many thanks</description>
		<content:encoded><![CDATA[<p>Heya, I assumed you most likely are able to help me. I have an MSSQL .ldf and .mdf file that I need to restore. Any opinions on how to achieve this?  Many thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exporting armature animation with the Blender 2.5 Python API by kikko</title>
		<link>http://graemehill.ca/exporting-armature-animation-with-the-blender-25-python-api/comment-page-1#comment-3026</link>
		<dc:creator>kikko</dc:creator>
		<pubDate>Wed, 29 Feb 2012 15:32:14 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=364#comment-3026</guid>
		<description>so much valuable informations in this article!
I'm actually doing the opposite (applying external pose datas to an armature) and I got good hints there!
thanks for sharing!</description>
		<content:encoded><![CDATA[<p>so much valuable informations in this article!<br />
I&#8217;m actually doing the opposite (applying external pose datas to an armature) and I got good hints there!<br />
thanks for sharing!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exporting armature animation with the Blender 2.5 Python API by twerdster</title>
		<link>http://graemehill.ca/exporting-armature-animation-with-the-blender-25-python-api/comment-page-1#comment-3019</link>
		<dc:creator>twerdster</dc:creator>
		<pubDate>Sat, 18 Feb 2012 22:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=364#comment-3019</guid>
		<description>Do you know how this can be done in 2.61? I cant find matrix_channel ...</description>
		<content:encoded><![CDATA[<p>Do you know how this can be done in 2.61? I cant find matrix_channel &#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Discard changes in LINQ to SQL DataContext by Reza</title>
		<link>http://graemehill.ca/discard-changes-in-linq-to-sql-datacontext/comment-page-1#comment-3008</link>
		<dc:creator>Reza</dc:creator>
		<pubDate>Mon, 30 Jan 2012 08:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=5#comment-3008</guid>
		<description>Compelete code of my Datacontext:


using System;
using System.Collections;
using System.Collections.Generic;
using System.Data.Linq;
using System.Linq;

namespace DataContextDiscardChanges
{
    partial class NorthwindDataContext
    {
        #region Public Members

        public void DiscardChanges()
        {
            this.DiscardUpdates();
            this.DiscardInserts();
            this.DiscardDeletes();
        }

        public void DiscardInserts(Func predicate = null)
        {
            if (predicate != null)
                discardInserts(this.GetChangeSet().Inserts.OfType().Where(predicate));
            else
                discardInserts(this.GetChangeSet().Inserts.OfType());
        }

        public void DiscardInserts()
        {
            discardInserts(this.GetChangeSet().Inserts);
        }

        public void DiscardDeletes(Func predicate = null)
        {
            if (predicate != null)
                discardDeletes(this.GetChangeSet().Deletes.OfType().Where(predicate));
            else
                discardDeletes(this.GetChangeSet().Deletes.OfType());
        }

        public void DiscardDeletes()
        {
            discardDeletes(this.GetChangeSet().Deletes);
        }

        public void DiscardUpdates(Func predicate = null)
        {
            if (predicate != null)
                discardUpdates(this.GetChangeSet().Updates.OfType().Where(predicate));
            else
                discardUpdates(this.GetChangeSet().Updates.OfType());
        }

        public void DiscardUpdates()
        {
            discardUpdates(this.GetChangeSet().Updates);
        }

        #endregion Public Members

        #region Private Memebers

        private void discardInserts(IEnumerable insertedEntities)
        {
            foreach (var insertedItem in insertedEntities)
            {
                this.GetTable(insertedItem.GetType()).DeleteOnSubmit(insertedItem);
            }
        }

        private void discardDeletes(IEnumerable deletedEntities)
        {
            foreach (var deletedItem in deletedEntities)
            {
                this.GetTable(deletedItem.GetType()).InsertOnSubmit(deletedItem);
            }
        }

        private void discardUpdates(IEnumerable updatedEntities)
        {
            foreach (var updatedItem in updatedEntities)
            {
                ModifiedMemberInfo[] modifiedMembers = this.GetTable(updatedItem.GetType()).GetModifiedMembers(updatedItem);

                foreach (var modifiedMember in modifiedMembers)
                {
                    updatedItem.GetType().GetProperty(modifiedMember.Member.Name).SetValue(updatedItem, modifiedMember.OriginalValue, null);
                }
            }
        }

        #endregion Private Memebers
    }
}</description>
		<content:encoded><![CDATA[<p>Compelete code of my Datacontext:</p>
<p>using System;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.Data.Linq;<br />
using System.Linq;</p>
<p>namespace DataContextDiscardChanges<br />
{<br />
    partial class NorthwindDataContext<br />
    {<br />
        #region Public Members</p>
<p>        public void DiscardChanges()<br />
        {<br />
            this.DiscardUpdates();<br />
            this.DiscardInserts();<br />
            this.DiscardDeletes();<br />
        }</p>
<p>        public void DiscardInserts(Func predicate = null)<br />
        {<br />
            if (predicate != null)<br />
                discardInserts(this.GetChangeSet().Inserts.OfType().Where(predicate));<br />
            else<br />
                discardInserts(this.GetChangeSet().Inserts.OfType());<br />
        }</p>
<p>        public void DiscardInserts()<br />
        {<br />
            discardInserts(this.GetChangeSet().Inserts);<br />
        }</p>
<p>        public void DiscardDeletes(Func predicate = null)<br />
        {<br />
            if (predicate != null)<br />
                discardDeletes(this.GetChangeSet().Deletes.OfType().Where(predicate));<br />
            else<br />
                discardDeletes(this.GetChangeSet().Deletes.OfType());<br />
        }</p>
<p>        public void DiscardDeletes()<br />
        {<br />
            discardDeletes(this.GetChangeSet().Deletes);<br />
        }</p>
<p>        public void DiscardUpdates(Func predicate = null)<br />
        {<br />
            if (predicate != null)<br />
                discardUpdates(this.GetChangeSet().Updates.OfType().Where(predicate));<br />
            else<br />
                discardUpdates(this.GetChangeSet().Updates.OfType());<br />
        }</p>
<p>        public void DiscardUpdates()<br />
        {<br />
            discardUpdates(this.GetChangeSet().Updates);<br />
        }</p>
<p>        #endregion Public Members</p>
<p>        #region Private Memebers</p>
<p>        private void discardInserts(IEnumerable insertedEntities)<br />
        {<br />
            foreach (var insertedItem in insertedEntities)<br />
            {<br />
                this.GetTable(insertedItem.GetType()).DeleteOnSubmit(insertedItem);<br />
            }<br />
        }</p>
<p>        private void discardDeletes(IEnumerable deletedEntities)<br />
        {<br />
            foreach (var deletedItem in deletedEntities)<br />
            {<br />
                this.GetTable(deletedItem.GetType()).InsertOnSubmit(deletedItem);<br />
            }<br />
        }</p>
<p>        private void discardUpdates(IEnumerable updatedEntities)<br />
        {<br />
            foreach (var updatedItem in updatedEntities)<br />
            {<br />
                ModifiedMemberInfo[] modifiedMembers = this.GetTable(updatedItem.GetType()).GetModifiedMembers(updatedItem);</p>
<p>                foreach (var modifiedMember in modifiedMembers)<br />
                {<br />
                    updatedItem.GetType().GetProperty(modifiedMember.Member.Name).SetValue(updatedItem, modifiedMember.OriginalValue, null);<br />
                }<br />
            }<br />
        }</p>
<p>        #endregion Private Memebers<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Discard changes in LINQ to SQL DataContext by Reza</title>
		<link>http://graemehill.ca/discard-changes-in-linq-to-sql-datacontext/comment-page-1#comment-3007</link>
		<dc:creator>Reza</dc:creator>
		<pubDate>Sun, 29 Jan 2012 12:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=5#comment-3007</guid>
		<description>hello every body

Discard Updated with Refresh method, reads orginal data from database and it's not good way to Discard in-memory objects

i'm using reflection to solve this problem:


public void DiscardUpdates()
        {
            var changeSet = this.GetChangeSet();
            foreach (var updatedItem in changeSet.Updates)
            {
                ModifiedMemberInfo[] modifiedMembers = this.GetTable(updatedItem.GetType()).GetModifiedMembers(updatedItem);

                foreach (var modifiedMember in modifiedMembers)
                {
                    updatedItem.GetType().GetProperty(modifiedMember.Member.Name).SetValue(updatedItem, modifiedMember.OriginalValue, null);
                }
            }
        }</description>
		<content:encoded><![CDATA[<p>hello every body</p>
<p>Discard Updated with Refresh method, reads orginal data from database and it&#8217;s not good way to Discard in-memory objects</p>
<p>i&#8217;m using reflection to solve this problem:</p>
<p>public void DiscardUpdates()<br />
        {<br />
            var changeSet = this.GetChangeSet();<br />
            foreach (var updatedItem in changeSet.Updates)<br />
            {<br />
                ModifiedMemberInfo[] modifiedMembers = this.GetTable(updatedItem.GetType()).GetModifiedMembers(updatedItem);</p>
<p>                foreach (var modifiedMember in modifiedMembers)<br />
                {<br />
                    updatedItem.GetType().GetProperty(modifiedMember.Member.Name).SetValue(updatedItem, modifiedMember.OriginalValue, null);<br />
                }<br />
            }<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Discard changes in LINQ to SQL DataContext by Andre</title>
		<link>http://graemehill.ca/discard-changes-in-linq-to-sql-datacontext/comment-page-1#comment-2996</link>
		<dc:creator>Andre</dc:creator>
		<pubDate>Fri, 13 Jan 2012 14:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=5#comment-2996</guid>
		<description>It's an incredible article. It's such a simple solution for all my problems with discarding data contexts. 

Thanks so much!</description>
		<content:encoded><![CDATA[<p>It&#8217;s an incredible article. It&#8217;s such a simple solution for all my problems with discarding data contexts. </p>
<p>Thanks so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Exporting armature animation with the Blender 2.5 Python API by davyzhang</title>
		<link>http://graemehill.ca/exporting-armature-animation-with-the-blender-25-python-api/comment-page-1#comment-2994</link>
		<dc:creator>davyzhang</dc:creator>
		<pubDate>Fri, 13 Jan 2012 07:52:16 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=364#comment-2994</guid>
		<description>this is a life saver article! thank you so much !</description>
		<content:encoded><![CDATA[<p>this is a life saver article! thank you so much !</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on C++ const correctness beats the .NET/Java alternatives by Ari Eisinger</title>
		<link>http://graemehill.ca/c-const-correctness-beats-the-netjava-alternatives/comment-page-1#comment-2991</link>
		<dc:creator>Ari Eisinger</dc:creator>
		<pubDate>Mon, 09 Jan 2012 04:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://graemehill.ca/?p=407#comment-2991</guid>
		<description>Sorry:  I was thinking of using a read-only interface when I wrote the above, not a subclass.  The actual type of the object could be determined using RTTI, and the read-only subclass could be upcast to its writeable superclass.

With a read-only subclass, it seems to me that all you'd have to do would be to upcast and then you could use all the base class's functions including the ones that modify the object.

Anyway, it seems to require considerable gyrations to do this kind of thing, which in C++, as you say, can be done with the use of a single keyword.</description>
		<content:encoded><![CDATA[<p>Sorry:  I was thinking of using a read-only interface when I wrote the above, not a subclass.  The actual type of the object could be determined using RTTI, and the read-only subclass could be upcast to its writeable superclass.</p>
<p>With a read-only subclass, it seems to me that all you&#8217;d have to do would be to upcast and then you could use all the base class&#8217;s functions including the ones that modify the object.</p>
<p>Anyway, it seems to require considerable gyrations to do this kind of thing, which in C++, as you say, can be done with the use of a single keyword.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

