<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Implementing infinite undo/redo (Matt Gertz)</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx</link><description>(This is the second part in my series on creating a Paint-by-Numbers designer application.) 
 This is the first application that I’ve built specifically for this blog, where I’m actually writing the code while I’m writing the blog. (For example, the</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Implementing infinite undo/redo (Matt Gertz)</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#9399960</link><pubDate>Fri, 06 Feb 2009 01:08:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9399960</guid><dc:creator>VBTeam</dc:creator><description>&lt;p&gt;Not off the top of my head, Freud. &amp;nbsp;In practice (or at least in my experience), the stacks don't build up a lot of undos before they get flushed by the opposite action followed by new content, so we never really see much inefficiency. &amp;nbsp;Our own undo-redo stacks in Visual Studio basically work the way I've detailed them in this blog, and while we have a number of performance or memory issues that we concentrate on, this hasn't been a problem areas. &amp;nbsp;Limiting them to some arbitrary number is, as you say, even problematic. &amp;nbsp;(The only reason to do it is in low-memory cases, and that's just not an issue in these days.)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9399960" width="1" height="1"&gt;</description></item><item><title>re: Implementing infinite undo/redo (Matt Gertz)</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#9398936</link><pubDate>Thu, 05 Feb 2009 19:08:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9398936</guid><dc:creator>freud</dc:creator><description>&lt;p&gt;I'm using a LIFO Stack(Of ) without limit, but i think that in a long day of work this could be so much inefficient. And the idea of limiting a stack (to twenty i.e.) &amp;nbsp;could even be more inefficient, because the action of pop the last element causes: pop the n elements and copy to another one( or an array), eliminate the bottom of the stack and then copy the rest back to the stack, and repeat this procedure for any undo action that the user perform.&lt;/p&gt;
&lt;p&gt;Any better idea ?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9398936" width="1" height="1"&gt;</description></item><item><title>How to Do Cool Things in Visual Basic</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#3962809</link><pubDate>Fri, 20 Jul 2007 00:14:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3962809</guid><dc:creator>Computer Science Teacher - Thoughts and Information from Alfred Thompson</dc:creator><description>&lt;p&gt;OK here's the deal. If you are teaching Visual Basic, programming in Visual Basic for fun or profit,&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3962809" width="1" height="1"&gt;</description></item><item><title>How to Do Cool Things in Visual Basic</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#3951761</link><pubDate>Thu, 19 Jul 2007 11:33:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3951761</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;OK here&amp;amp;#39;s the deal. If you are teaching Visual Basic, programming in Visual Basic for fun or profit&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3951761" width="1" height="1"&gt;</description></item><item><title>re: Implementing infinite undo/redo (Matt Gertz)</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#3802037</link><pubDate>Tue, 10 Jul 2007 21:50:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3802037</guid><dc:creator>VBTeam</dc:creator><description>&lt;p&gt;Bill: &amp;nbsp;You are absolutely correct, I am abusing ListOf to be a stack here. &amp;nbsp;When I wrote the code, I was actually adding it to the end of the list, and then said, &amp;quot;Well, I don't want to always be figuring out what the last element in the list is, so let's be lazy; I'm not going to have to pop the stack very often.&amp;quot; &amp;nbsp;But of course I am inserting fairly often, which is indeed inefficient. &amp;nbsp;It's a very easy fix which I will take care of before I publish the final version later this week -- thanks for bringing this up. &amp;nbsp;I'll add a note in the blog.&lt;/p&gt;
&lt;p&gt;Aaron: &amp;nbsp;Thanks, you are also right. &amp;nbsp;That was a copy error from some if/then logic that got left behind -- I had gotten the whole thing working using conditionals, and then said &amp;quot;Well, that's stupid -- let's just use the value directly -- but then forgot to complete it for the second line. &amp;nbsp;D'Oh! &amp;nbsp;I'll repair that one in the blog itself.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3802037" width="1" height="1"&gt;</description></item><item><title>Link Listing - July 9, 2007</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#3790685</link><pubDate>Tue, 10 Jul 2007 05:27:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3790685</guid><dc:creator>Christopher Steen</dc:creator><description>&lt;p&gt;The Distributed Observer Pattern | The REST Dialogues [Via: (author unknown) ] PainlessSVN - Subversion...&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3790685" width="1" height="1"&gt;</description></item><item><title>re: Implementing infinite undo/redo (Matt Gertz)</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#3783787</link><pubDate>Mon, 09 Jul 2007 20:28:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3783787</guid><dc:creator>Aaron</dc:creator><description>&lt;p&gt;Thanks, good series. I think there might be bug in: &lt;/p&gt;
&lt;p&gt;Me.ShowSolution = Not Me.ShowSolution&lt;/p&gt;
&lt;p&gt;Me.ShowSolutionToolStripMenuItem.Checked = False&lt;/p&gt;
&lt;p&gt;Me.Invalidate()&lt;/p&gt;
&lt;p&gt;I think the middle line ought to be:&lt;/p&gt;
&lt;p&gt;Me.ShowSolutionToolStripMenuItem.Checked = Me.ShowSolution&lt;/p&gt;
&lt;p&gt;Otherwise, the menu item never gets checked. &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Aaron&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3783787" width="1" height="1"&gt;</description></item><item><title>re: Implementing infinite undo/redo (Matt Gertz)</title><link>http://blogs.msdn.com/b/vbteam/archive/2007/07/06/implementing-infinite-undo-redo-matt-gertz.aspx#3741339</link><pubDate>Sat, 07 Jul 2007 09:05:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3741339</guid><dc:creator>Bill_McC</dc:creator><description>&lt;p&gt;Inserting into the start of the list and then removing from the start of the list is really inefficient. It causes array copies for the entire amount in memory effectively doubling the memory requirement and increasing garbage clean ups.&lt;/p&gt;
&lt;p&gt;The sotrage you use should be one that is optimised for Last In is First Out (LIFO), which would be a Stack(Of T)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3741339" width="1" height="1"&gt;</description></item></channel></rss>