Monthly Archives: October 2007

Quickly Clone a Serializable Object in C#

Here’s a quick way to get a clone of your serializable object in C#:   public static object GetClone(object cloneThis) { BinaryFormatter bf = new BinaryFormatter(); MemoryStream ms= new MemoryStream(); bf.Serialize(ms, cloneThis); ms.Flush(); ms.Position = 0; return bf.Deserialize(ms); }

Posted in C# | 5 Comments

Fix FireFox SLOWdown on Vista while Debugging localhost

If you use FireFox to debug on Windows Vista, you most likely have noticed how ridiculously slow it is rendering localhost requests versus Internet Explorer.  No, this isn’t a conspiracy, just an issue with IPv6, FireFox, and Windows Vista. To … Continue reading

Posted in FireFox, Visual Studio | Leave a comment

Format Document – The Quick HTML and Code Organizer

I have encountered a lot of bad HTML formating in my days, and one quick way to organize the HTML files via Visual Studio 2005 is to use the Format Document option from the Edit menu. One thing about the … Continue reading

Posted in Visual Studio | Leave a comment

Regex to Clean Out HTML from Text

Ahh, the power (and sometimes slight confusion) of regular expressions.  This seems to work well to remove HTML from text: string htmlstring = { some chunk o html infested text }; Regex cleanOutHtml =     new Regex(@”

Posted in C#, Regular Expressions | 1 Comment

Change Internet Explorer’s “View Source” Editor

To change the default editor for Internet Explorer when you right click on a page and choose “View Source”, do the following: 1) Open up regedit 2) Browse to         HKEY_LOCAL_MACHINE\ Software\ Microsoft\ Internet Explorer\ 3) If they don’t … Continue reading

Posted in Internet Explorer | Leave a comment

Recycle an Application Pool from the Command Line

Sometimes it is a whole lot nicer to recycle the specific Application Pool of concern rather than recycling IIS with “iisreset”. There is a handy script in %windir%\system32 called iisapp.vbs and you can just run : D:\>C:\WINDOWS\System32\iisapp.vbs /a “My Pool” … Continue reading

Posted in IIS | Leave a comment