<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35206409</id><updated>2011-12-12T12:52:00.084-06:00</updated><title type='text'>Copy. Paste. Repeat</title><subtitle type='html'>Scrounging the web for code.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://copy-paste-repeat.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://copy-paste-repeat.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Darryl Whitmore</name><uri>http://www.blogger.com/profile/03765295949216395328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35206409.post-7957440407257316588</id><published>2006-10-10T09:48:00.000-05:00</published><updated>2006-10-10T09:53:38.673-05:00</updated><title type='text'>FatalExecutionEngineError with EventPool</title><content type='html'>At work I have been converting our product to Visual Studio.Net 2005. After Visual Studio converted the solution, and I fixed all the compiler warnings caused by stuff that has been obsoleted in the .Net Framework 2.0, I pressed F5 to run. The app started up successfully, but when I tried any functionality, I got a nasty error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;FatalExecutionEngineError was detected&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Message: The runtime has encountered a fatal error. The address of the error was at 0x79f783dd, on thread 0x5d0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The error was presented in a &lt;a href="http://msdn2.microsoft.com/en-us/library/d21c150d.aspx"&gt;Managed Debugging Assistant &lt;/a&gt;(MDA), which is something new for Visual Studio.Net 2005:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger2/5385/4297/1600/MDA.0.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger2/5385/4297/320/MDA.0.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I tracked the issue down to a call in some &lt;a href="http://www.marcclifton.com/tabid/88/Default.aspx"&gt;EventPool &lt;/a&gt;code that we got from &lt;a href="http://www.marcclifton.com"&gt;Marc Clifton's&lt;/a&gt; site. There was a demo program (EventPoolDemo.zip; you need to register with the site to be able to see the download link) available, so I downloaded it and loaded the solution in Visual Studio.Net 2005. The solution was written in Visual Studio.Net 2003, so the conversion wizard popped up and converted it without any issue. I pressed F5 to run, and Presto, I hit the same error. &lt;/p&gt;&lt;p&gt;I next checked the forums on Marc's site and discovered that &lt;a href="http://www.marcclifton.com/Forum/tabid/85/Default.aspx?dnnbbfid=1&amp;dnnbbtid=14"&gt;someone else&lt;/a&gt; had hit this issue too. Unfortunately, nobody had posted a response. I decided to drop a line to Marc to see if he had any clues. &lt;/p&gt;&lt;p&gt;I spent the rest of the day banging my head against the wall trying to figure out the issue by debugging and Googling. I made no progress and by the end of the day had a real headache.&lt;/p&gt;&lt;p&gt;And then, as I was ready to throw in the towel for the day, up popped an email reply from Marc.&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Hi Darryl,&lt;br /&gt;&lt;br /&gt;See if the solution posted in this link solves the problem.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.codeproject.com/csharp/eventpool.asp?msg=1541283#xx1541283xx" target="_blank"&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;http://www.codeproject.com/csharp/eventpool.asp?msg=1541283#xx1541283xx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;br /&gt;Marc&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Holy &lt;a href="http://en.wikipedia.org/wiki/Deus_ex_machina"&gt;deus ex machina&lt;/a&gt;, Batman, it worked! The problem was a naming conflict in the EventPool code. All I had to do was rename a delegate that conflicted with System.MulticastDelegate from this:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;protected delegate void &lt;span style="color:#cc33cc;"&gt;MulticastDelegate&lt;/span&gt;(object sender, EventArgs e);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;to this:&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;protected delegate void &lt;span style="color:#cc33cc;"&gt;EpMulticastDelegate&lt;/span&gt;(object sender, EventArgs e);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Hooray, the app is working again! Until I hit the next conversion issue...&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35206409-7957440407257316588?l=copy-paste-repeat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://copy-paste-repeat.blogspot.com/feeds/7957440407257316588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35206409&amp;postID=7957440407257316588' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default/7957440407257316588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default/7957440407257316588'/><link rel='alternate' type='text/html' href='http://copy-paste-repeat.blogspot.com/2006/10/fatalexecutionengineerror-with.html' title='FatalExecutionEngineError with EventPool'/><author><name>Darryl Whitmore</name><uri>http://www.blogger.com/profile/03765295949216395328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35206409.post-7659007408484950865</id><published>2006-10-06T15:38:00.000-05:00</published><updated>2006-10-06T15:59:37.958-05:00</updated><title type='text'>Araxis Merge with Rational ClearCase</title><content type='html'>About a year ago I finally got tired of the Diff tool that comes with Microsoft Visual Source Safe (VSS). A little Googling pulled up this Coding Horror &lt;a href="http://www.codinghorror.com/blog/archives/000024.html"&gt;post&lt;/a&gt; on &lt;a href="http://www.araxis.com/merge/"&gt;Araxis Merge&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;After a quick download and 30 day free trial, I was hooked. It is sooooooo sweet, and if you've never used anything better than the dumb VSS Diff, you don't know what you're missing. Then the 30 days came to an end.&lt;br /&gt;&lt;br /&gt;Cheap, it is not. But hey, I rationalized: I'm a developer, and a good Diff tool is essential for the toolbox. I found that I was easy to convince. So, I bought it for myself with my own &lt;a href="http://en.wikipedia.org/wiki/Fictional_currency"&gt;Buckazoids&lt;/a&gt; (more on those &lt;a href="http://www.sq7.org/omnipedia/index.php/Buckazoid"&gt;here&lt;/a&gt;, if you're interested). Since then have used it nearly every day, and it makes doing a diff nearly enjoyable. It was well worth the cost, and I only wish I had found it years earlier.&lt;br /&gt;&lt;br /&gt;But then I changed jobs, and joined a place where Rational ClearCase is used. The ClearCase Diff tool was better than VSS' tool, but I preferred to stick with my beloved Araxis Merge. How to integrate it with ClearCase?&lt;br /&gt;&lt;br /&gt;Fortunately Araxis had a &lt;a href="http://www.araxis.com/merge/scm_integration.html"&gt;page&lt;/a&gt; devoted to this topic, and an entry for ClearCase. This led me to Ganesh Viswanathan's nifty &lt;a title="External link to http://blog.genotrance.com/applications/clearaxis/" href="http://blog.genotrance.com/applications/clearaxis/"&gt;Clearaxis utility&lt;/a&gt;. A quick download and Presto, I was back in business with Merge.&lt;br /&gt;&lt;br /&gt;After a few days of use, I noticed a little problem with Clearaxis: files in paths with embedded spaces would not load into Merge properly. I sent an email to Ganesh, and within a few days, he had provided me with a fix to try out, and it worked like a charm. Now that's terrific support. If you use ClearCase and Araxis Merge, you need Clearaxis!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35206409-7659007408484950865?l=copy-paste-repeat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://copy-paste-repeat.blogspot.com/feeds/7659007408484950865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35206409&amp;postID=7659007408484950865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default/7659007408484950865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default/7659007408484950865'/><link rel='alternate' type='text/html' href='http://copy-paste-repeat.blogspot.com/2006/10/araxis-merge-with-rational-clearcase.html' title='Araxis Merge with Rational ClearCase'/><author><name>Darryl Whitmore</name><uri>http://www.blogger.com/profile/03765295949216395328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35206409.post-115948295868606401</id><published>2006-09-28T17:34:00.000-05:00</published><updated>2006-09-28T17:35:58.686-05:00</updated><title type='text'>Shredding a file in C#</title><content type='html'>A possible project that I have in mind would have the need to &lt;em&gt;shred&lt;/em&gt; a file. That is, not just to delete the file, but to wipe its contents from the disk such that a snoop with the right tools would be unable to recover it.&lt;br /&gt;&lt;br /&gt;How to do this in C#? I knew there were tools that do this, but I'd never come across any code that does it. Trusty Google turned up a post by &lt;a href="http://www.darrellhawley.com"&gt;Darrell Hawley&lt;/a&gt; (whose parents gave him a great name but alas, spelled it incorrectly) who &lt;a href="http://www.darrellhawley.com/2006/04/shredding-file.html"&gt;pondered&lt;/a&gt; the same question.&lt;br /&gt;&lt;br /&gt;Resuming my search, I found a great article by Gregory A. Wolking from 2001: &lt;a href="http://www.pcmag.com/article2/0,1759,13352,00.asp"&gt;Shred Deleted Files&lt;/a&gt;. Unfortunately, the source was not available for free. Cheapskate that I am, I kept looking, and finally found the source (SHRED.ZIP) &lt;a href="http://cyberia.dnsalias.com/Windows.App.10.Htm"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I took a quick look at the C++ source and found that the task didn't seem as involved as I had thought that it might be. A key point in the code seemed to be opening the file with disabled write caching via the FILE_FLAG_WRITE_THROUGH flag. I Googled that flag and found a C# article named &lt;a href="http://www.codeproject.com/dotnet/CryptoLib.asp"&gt;.NET cryptography library for files and strings&lt;/a&gt; which uses the flag in a method named OpenFileForSecureOverwrite(). Perfect!&lt;br /&gt;&lt;br /&gt;That's about as far as I got, but these resources should be a good starting point if that project of mine ever gets beyond a germ of an idea.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.darrellhawley.com/2006/04/shredding-file.html"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35206409-115948295868606401?l=copy-paste-repeat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://copy-paste-repeat.blogspot.com/feeds/115948295868606401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=35206409&amp;postID=115948295868606401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default/115948295868606401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35206409/posts/default/115948295868606401'/><link rel='alternate' type='text/html' href='http://copy-paste-repeat.blogspot.com/2006/09/shredding-file-in-c.html' title='Shredding a file in C#'/><author><name>Darryl Whitmore</name><uri>http://www.blogger.com/profile/03765295949216395328</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
