<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Evilertoaster's Weblog</title>
	<atom:link href="http://evilertoaster.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://evilertoaster.wordpress.com</link>
	<description>Random Ramblings</description>
	<lastBuildDate>Sun, 16 Oct 2011 08:28:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='evilertoaster.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Evilertoaster's Weblog</title>
		<link>http://evilertoaster.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://evilertoaster.wordpress.com/osd.xml" title="Evilertoaster&#039;s Weblog" />
	<atom:link rel='hub' href='http://evilertoaster.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Extract torrent from Blizzard downloader</title>
		<link>http://evilertoaster.wordpress.com/2010/04/25/extract-torrent-from-blizzard-downloader/</link>
		<comments>http://evilertoaster.wordpress.com/2010/04/25/extract-torrent-from-blizzard-downloader/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:44:38 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=57</guid>
		<description><![CDATA[A double post today to make up for my extended absence. Mentioned a while back in another post, here&#8217;s how to extract the .torrent file from a blizzard downloader (useful if you have your own torrent program set up to download better than the built in one from blizzard). A hex editor will make things [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=57&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A double post today to make up for my extended absence. Mentioned a while back in another post, here&#8217;s how to extract the .torrent file from a blizzard downloader (useful if you have your own torrent program set up to download better than the built in one from blizzard).</p>
<p>A hex editor will make things easy here, I use mirkes.de &#8220;Tiny hexer&#8221; as my editor of choice.</p>
<p>Simply open the file, and look for the torrent file header, which is &#8220;64 38 3A 61 6E 6E 6F 75 6E 63 65&#8243; or &#8220;d8:announce&#8221; as text.<br />
All you have to do is copy from the start of the header, to the end of the file and save it as a .torrent file.<br />
<a href="http://evilertoaster.files.wordpress.com/2010/04/select.jpg"><img src="http://evilertoaster.files.wordpress.com/2010/04/select.jpg?w=450&#038;h=296" alt="" title="Select" width="450" height="296" class="alignnone size-full wp-image-59" /></a></p>
<p>
<a href="http://evilertoaster.files.wordpress.com/2010/04/saveas.jpg"><img src="http://evilertoaster.files.wordpress.com/2010/04/saveas.jpg?w=199&#038;h=559" alt="" title="SaveAs" width="199" height="559" class="alignnone size-full wp-image-58" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=57&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2010/04/25/extract-torrent-from-blizzard-downloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>

		<media:content url="http://evilertoaster.files.wordpress.com/2010/04/select.jpg" medium="image">
			<media:title type="html">Select</media:title>
		</media:content>

		<media:content url="http://evilertoaster.files.wordpress.com/2010/04/saveas.jpg" medium="image">
			<media:title type="html">SaveAs</media:title>
		</media:content>
	</item>
		<item>
		<title>Base64 code table index</title>
		<link>http://evilertoaster.wordpress.com/2010/04/25/base64-code-table-index/</link>
		<comments>http://evilertoaster.wordpress.com/2010/04/25/base64-code-table-index/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 17:17:13 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=53</guid>
		<description><![CDATA[Been awhile&#8230;been busy. Recently I was converting program from C into C# and ran across what I thought to be a proprietary encoding algorithm: I didn&#8217;t immediately recognize it and didn&#8217;t debug it very much, but I was looking at the output trying to figure out what it was. Eventually I found it to be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=53&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Been awhile&#8230;been busy. Recently I was converting program from C into C# and ran across what I thought to be a proprietary encoding algorithm:</p>
<pre class="brush: cpp;">
private void NormalizeBlock(ref byte[] inBytes, ref byte[] outBytes)
        {
            toLen = 0;
            for (int n = 0; n &lt; inBytes.Length; n++)
            {
                bitStream(ref outBytes, inBytes[n] &amp; 0xff);
            }
            bitStream(ref outBytes, -1);
        }
 public static void bitStream(ref byte[] inChar, int inCharPos)
        {
            for (bitMask = 0x80; bitMask != 0x00; )
            {
                curChar &lt;&lt;= 1;
                if ((inCharPos &amp; bitMask) != 0)
                    curChar |= 1;
                bitsReady++;
                if (bitsReady &gt; 5)
                {
                    if (curChar == 0x00)
                        inChar[toLen++] = (byte)0x40;
                    else
                        inChar[toLen++] = (byte)curChar;
                    curChar = 0;
                    bitsReady = 0;
                }
                bitMask &gt;&gt;= 1;
                bitMask &amp;= 0x7f;
            }
        }
 &lt;/code&gt;
</pre>
<p>I didn&#8217;t immediately recognize it and didn&#8217;t debug it very much, but I was looking at the output trying to figure out what it was.<br />
Eventually I found it to be Base64 encoding, except it did not actually do the encoding, it just gave the index to the conversion table (as the index, not the value).</p>
<p>I was looking to make the code a little more readable so I took a look at the Microsoft implementation inside their Convert.ToBase64String() method (mscorlib.dll) with reflector. They seemed to have a slightly cleaner implementation, and better yet, it was easy to leave the value as the index rather than resolving it to the code page. The C# version is:</p>
<pre class="brush: csharp;">
        public List&lt;byte&gt; NormalizeBlock(List&lt;byte&gt; inData)
        {
            int leftOver = inData.Count % 3;
            if (leftOver == 1)
                inData.Add((byte)0);
            if (leftOver &gt; 0)
                inData.Add((byte)0);
            int l = inData.Count;
            int index = 0;
            byte[] outChars = new byte[(4*l)/3];
            for (int i = 0; i &lt; l; i+=3)
            {
                outChars[index] = (byte)((inData[i] &amp; 0xfc) &gt;&gt; 0x02);
                outChars[(index + 1)] = (byte)(((inData[i] &amp; 3) &lt;&lt; 4) | ((inData[(i + 1)] &amp; 240) &gt;&gt; 4));
                outChars[(index + 2)] = (byte)(((inData[(i + 1)] &amp; 15) &lt;&lt; 2) | ((inData[(i + 2)] &amp; 0xc0) &gt;&gt; 6));
                outChars[(index + 3)] = (byte)(inData[(i + 2)] &amp; 0x3f);
                index += 4;
            }
            List&lt;byte&gt; retVal = outChars.ToList();
            if (leftOver == 1)
                retVal.RemoveAt(retVal.Count - 1);
            if (leftOver &gt; 0)
                retVal.RemoveAt(retVal.Count - 1);
            int next = retVal.IndexOf(0x00);
            while (next &gt;= 0)
            {
                retVal[next] = 0x40;
                next = retVal.IndexOf(0x00);
            }
            return retVal;
        }
</pre>
<p>I had also been playing around with my own version, which &#8216;looks&#8217; a bit cleaner (at least it&#8217;s easier to see what&#8217;s happening on the bit level):</p>
<pre class="brush: csharp;">
[StructLayout(LayoutKind.Explicit, Size = 5, CharSet = CharSet.Ansi)]
        private struct ByteField //5 bytes: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
        {                  //FieldOffests:     4        3        2        1        0
            [FieldOffset(1)]
            public uint word;           // XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
            [FieldOffset(0)]
            public uint last3;          //          XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
            [FieldOffset(1)]
            public UInt16 last2;        //                   XXXXXXXX XXXXXXXX
            [FieldOffset(1)]
            public byte byte1;          //                            XXXXXXXX
            [FieldOffset(2)]
            public byte byte2;          //                   XXXXXXXX
            [FieldOffset(3)]
            public byte byte3;          //          XXXXXXXX
            [FieldOffset(4)]
            public byte byte4;          // XXXXXXXX
        }
        public List&lt;byte&gt; NormalizeBlock(byte[] inBytes)
        {
            int arraySize = inBytes.Length;
            List&lt;byte&gt; normalizedBytes = new List&lt;byte&gt;(arraySize * 2);
            int leftOver = arraySize % 3;
            ByteField byteField = new ByteField();
            for (int n = 0; n &lt; arraySize; n += 3)
            {
                byteField.byte4 = inBytes[n];
                if (n + 1 &lt; arraySize) byteField.byte3 = inBytes[n + 1]; else byteField.byte3 = 0x00;
                if (n + 2 &lt; arraySize) byteField.byte2 = inBytes[n + 2]; else byteField.byte2 = 0x00;
                byteField.word &gt;&gt;= 2; byteField.last3 &gt;&gt;= 2; byteField.last2 &gt;&gt;= 2; byteField.byte1 &gt;&gt;= 2;
                normalizedBytes.AddRange(BitConverter.GetBytes(byteField.word).Reverse());
            }
            if (leftOver == 1)
                normalizedBytes.RemoveAt(normalizedBytes.Count - 1);
            if (leftOver &gt; 0)
                normalizedBytes.RemoveAt(normalizedBytes.Count - 1);

            int next = normalizedBytes.IndexOf(0x00);
            while (next &gt;= 0)
            {
                normalizedBytes[next] = 0x40;
                next = normalizedBytes.IndexOf(0x00);
            }
            normalizedBytes.Add(0x00);

            return normalizedBytes;
        }
        }
</pre>
<p>It was an interesting endeavor&#8230; </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=53&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2010/04/25/base64-code-table-index/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Updates&#8230;</title>
		<link>http://evilertoaster.wordpress.com/2009/10/06/updates/</link>
		<comments>http://evilertoaster.wordpress.com/2009/10/06/updates/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 20:26:25 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[News Items That Make Me Frown]]></category>
		<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=48</guid>
		<description><![CDATA[Updated the Diablo II post (http://evilertoaster.wordpress.com/2008/05/19/diablo-2-111-save-file/) with some new information. Also: -News Items That Make Me Frown- http://games.slashdot.org/story/09/08/04/1319221/California-Student-Arrested-For-Console-Hacking http://it.slashdot.org/story/09/08/11/2340221/In-UK-Two-Convicted-of-Refusing-To-Decrypt-Data http://www.mediapost.com/publications/?fa=Articles.showArticle&#038;art_aid=114264 http://www.ticalc.org/archives/news/articles/14/145/145316.html http://games.slashdot.org/story/09/10/01/0626228/Wii-Update-42-Tries-and-Fails-To-Block-Homebrew<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=48&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Updated the Diablo II post (http://evilertoaster.wordpress.com/2008/05/19/diablo-2-111-save-file/) with some new information.<br />
Also:<br />
-News Items That Make Me Frown-</p>
<p>http://games.slashdot.org/story/09/08/04/1319221/California-Student-Arrested-For-Console-Hacking</p>
<p>http://it.slashdot.org/story/09/08/11/2340221/In-UK-Two-Convicted-of-Refusing-To-Decrypt-Data</p>
<p>http://www.mediapost.com/publications/?fa=Articles.showArticle&#038;art_aid=114264</p>
<p>http://www.ticalc.org/archives/news/articles/14/145/145316.html</p>
<p>http://games.slashdot.org/story/09/10/01/0626228/Wii-Update-42-Tries-and-Fails-To-Block-Homebrew</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=48&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2009/10/06/updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Unhappy things and recent developments.</title>
		<link>http://evilertoaster.wordpress.com/2009/08/04/unhappy-things-and-recent-developments/</link>
		<comments>http://evilertoaster.wordpress.com/2009/08/04/unhappy-things-and-recent-developments/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 09:40:52 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[News Items That Make Me Frown]]></category>
		<category><![CDATA[Things of little consequence]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=45</guid>
		<description><![CDATA[New post category- &#8216;News Items That Make Me Frown&#8217;. Every so often I get reminded of new failures of humanity Lets start with these here from slashdot- http://yro.slashdot.org/story/09/07/31/2236229/RIAA-Awarded-675000-In-Tenenbaum-Trial http://tech.slashdot.org/story/09/07/23/1817225/Stroustrup-Says-New-C-Standard-Delayed-Until-2010-Or-Later http://yro.slashdot.org/story/09/07/18/0337223/UK-Police-Raid-Party-After-Seeing-All-Night-Tag-On-Facebook Besides that, a grammatical note, the word &#8216;hmyer&#8217; shall henceforth encompass all variations of the slanged word (here-myier,heremyer,ha-mya ect). It&#8217;s some sort of accentuated &#8216;here&#8217;. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=45&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>New post category- &#8216;News Items That Make Me Frown&#8217;. Every so often I get reminded of new failures of humanity <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Lets start with these here from slashdot-<br />
<a href="http://yro.slashdot.org/story/09/07/31/2236229/RIAA-Awarded-675000-In-Tenenbaum-Trial">http://yro.slashdot.org/story/09/07/31/2236229/RIAA-Awarded-675000-In-Tenenbaum-Trial</a><br />
<a href="http://tech.slashdot.org/story/09/07/23/1817225/Stroustrup-Says-New-C-Standard-Delayed-Until-2010-Or-Later">http://tech.slashdot.org/story/09/07/23/1817225/Stroustrup-Says-New-C-Standard-Delayed-Until-2010-Or-Later</a><br />
<a href="http://yro.slashdot.org/story/09/07/18/0337223/UK-Police-Raid-Party-After-Seeing-All-Night-Tag-On-Facebook">http://yro.slashdot.org/story/09/07/18/0337223/UK-Police-Raid-Party-After-Seeing-All-Night-Tag-On-Facebook</a></p>
<p>Besides that, a grammatical note, the word &#8216;hmyer&#8217; shall henceforth encompass all variations of the slanged word (here-myier,heremyer,ha-mya ect). It&#8217;s some sort of accentuated &#8216;here&#8217;. e.g one might say &#8220;I&#8217;m going to sit right over hmyer&#8221;.</p>
<p>What else&#8230; WoW 3.2 this week&#8230;probably&#8230;</p>
<p>Almost done with a major coding project of mine&#8230;I&#8217;ll have to make a post about that sometime.</p>
<p>I watched  an anime called &#8220;Real Dive&#8221; recently. It was aight&#8230; (Kinda reminded me of Ghost in Shell:SAC which is one of my favs) The intro was a pretty addictive song.</p>
<p>Ramble Ramble&#8230; </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=45&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2009/08/04/unhappy-things-and-recent-developments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Three Problems, Three Solutions</title>
		<link>http://evilertoaster.wordpress.com/2009/06/23/three-problems-three-solutions/</link>
		<comments>http://evilertoaster.wordpress.com/2009/06/23/three-problems-three-solutions/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 18:59:38 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=31</guid>
		<description><![CDATA[1. Cookieless, Session-based webstates in asp.net- So, you want to track and save user settings or data in your web application but can&#8217;t use cookies or support use of a &#8216;sign-on&#8217; system to track users (or collect other personal information). Well one solution is tracking via SessionID (only valid for that web session). Snippets for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=31&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. <span style="text-decoration:underline;">Cookieless, Session-based webstates in asp.net</span>-<br />
So, you want to track and save user settings or data in your web application but can&#8217;t use cookies or support use of a &#8216;sign-on&#8217; system to track users (or collect other personal information). Well one solution is tracking via SessionID (only valid for that web session). Snippets for this functionality using linq (SQL in the background storing the data):</p>
<pre class="brush: csharp;">
    public partial class DatabaseName: DataContext
    {
        public Table&lt;linqClass&gt; DatabaseTableName;
        public DatabaseName(string connection) : base(connection) { }
    }
    [Table(Name = &quot;DatabaseTableName&quot;)]
    public class linqClass
    {
        [Column(IsPrimaryKey = true)]
        public string SessionID;
        [Column]
        public string SomeData;
    }
    DatabaseName db = new DatabaseName(@&quot;Data Source=server\instance;Initial Catalog=    DatabaseName;Integrated Security=True&quot;);

    linqClass linqInterface= new linqClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            linqInterface.SessionID = Session.SessionID;
            linqInterface.SomeData= &quot;&quot;;
            db.DatabaseTableName.InsertOnSubmit(linqInterface);
            db.SubmitChanges();
        }
    }
    protected void btnSomeButtom_Click(object sender, EventArgs e)
    {
        linqInterface = db.DataBaseTableName.Single(tWss =&gt; tWss.SessionID == Session.SessionID);
        if linqInterface == null)
        {
            //Error Handle
            return;
        }
       linqInterface.SomeData = &quot;Uses the 'red' theme&quot;;
       db.SubmitChanges();
    }
</pre>
<p>2. <span style="text-decoration:underline;">Visual Studio 2010 &#8211; Compiled VC++ program gives &#8220;Unhandled exception at 0&#215;12345678 in YourApp.exe: 0xC0000005: Access violation reading location 0&#215;12345678&#8243;</span></p>
<p>0&#215;12345678 are arbitrary memory locations. In particular this is relating to this happening only with Visual Studio 2010 but working fine on older versions. Solution that worked for me:<br />
Project properties-&gt;Configuration Properties-&gt;Platform Toolset-&gt; change from v100 to v90</p>
<p>3. <span style="text-decoration:underline;">Posting code snippets in WordPress.com (not the wordpress.org package)</span></p>
<p>there are tags! &#8211; <a href="http://support.wordpress.com/code/">http://support.wordpress.com/code/</a><br />
You&#8217;d think I would have noticed that sooner <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=31&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2009/06/23/three-problems-three-solutions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows Forms &#8211; Control updates from another thread</title>
		<link>http://evilertoaster.wordpress.com/2009/05/12/windows-forms-control-updates-from-another-thread/</link>
		<comments>http://evilertoaster.wordpress.com/2009/05/12/windows-forms-control-updates-from-another-thread/#comments</comments>
		<pubDate>Tue, 12 May 2009 19:42:09 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=29</guid>
		<description><![CDATA[More of a note to self than anything but here&#8217;s a code-base for updating a windows form control from another thread (one that didn&#8217;t create the control). Done in C#- public delegate void ButtonStateDelegte(object inTarget, bool enabled); public void ButtonState(object inTarget, bool enabled) { (inTarget as Button).Enabled = enabled; } private void SomeThread() { ButtonStateDelegte [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=29&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>More of a note to self than anything but here&#8217;s a code-base for updating a windows form control from another thread (one that didn&#8217;t create the control). Done in C#-</p>
<p><code>public delegate void ButtonStateDelegte(object inTarget, bool enabled);</code></p>
<p><code>public void ButtonState(object inTarget, bool enabled)<br />
{<br />
(inTarget as Button).Enabled = enabled;<br />
}</p>
<p></code></p>
<p><code>private void SomeThread()<br />
{<br />
ButtonStateDelegte tempDelegate = new ButtonStateDelegte(ButtonState);<br />
btnStart.Invoke(tempDelegate, new object[] { btnStart, true });<br />
}</code></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=29&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2009/05/12/windows-forms-control-updates-from-another-thread/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>European Language Packs on U.S. World of Warcraft (Patch 3.0.3)</title>
		<link>http://evilertoaster.wordpress.com/2009/01/08/european-language-packs-on-us-world-of-warcraft-patch-303/</link>
		<comments>http://evilertoaster.wordpress.com/2009/01/08/european-language-packs-on-us-world-of-warcraft-patch-303/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 04:09:50 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=23</guid>
		<description><![CDATA[Another adventure today trying to get my WoW client to play in German on a US server. I had done this previously ever since language packs for WoW existed but in the most recent patch (3.0.3) there seems to have been a restructuring of how additional languages are installed, and my previous set up didn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=23&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Another adventure today trying to get my WoW client to play in German on a US server. I had done this previously ever since language packs for WoW existed but in the most recent patch (3.0.3) there seems to have been a restructuring of how additional languages are installed, and my previous set up didn&#8217;t work after I patched it.</p>
<p>Now that I&#8217;ve had some time since the patch came out, I went back to try and get the language pack to work again on my US-English client. There is one thing clear though&#8230; it seems Blizzard made some intentional changes to the langauge packs to explicitly prevent them for being installed if certian conditions are present. Some of these restrictions make sense (in particualr, pertaining to the russian lanauge pack, since there are character set problems to consider), others don&#8217;t seems to make sense from a functionaly stand point.</p>
<p>In any event, I thought I&#8217;d post my work around here for anyone wanting to use a ELP on a US client. This assumes you already have a fully working and functional English US installation patched to 3.0.8. Also, it is only confirmed to work for the German language pack, and only using Server 2008 (or Vista I&#8217;d assume).</p>
<p>1. Back up your enUS folder (it&#8217;s inside the Data folder of your WoW installation). This is important, becuase you will be copying this back.</p>
<p>2. Down the Langauge pack from WoW europe. (<a href="http://www.wow-europe.com/en/downloads/elp/">http://www.wow-europe.com/en/downloads/elp/)</a></p>
<p>3. Extract the file &#8220;InstallerFileList.xml&#8221; from the installer tome MPQ. There are several ways to do this, and if you don&#8217;t know how you probably shouldn&#8217;t be trying this.</p>
<p>4. Open up the XML file and a few lines down from the top you&#8217;ll see a section that has logic for disallowing the installation for certain conditions (it&#8217;s commented as such). Remove the section and save the file.</p>
<p>5. Put the XML file in the root of your harddrive. For some reason, the installer tome will use it ( I have my own theory as to why). Also put a file calld EULA.html (just a blank text file renamed will work) in the root of your hard drive. So the paths woud be (in my case) C:\InstallerFileList.xml and C:\EULA.html</p>
<p>6. Now run the installer. After it&#8217;s done, do not start the launcher. First go to your WoW folder and open up the Data directory.  Rename the enUS folder to something else (I just used ienUS).</p>
<p>7. Now start the launcher (it should be in the language you just installed) and download all the updates (it will be version 3.0.1, so you&#8217;ll need to download and install 3.0.2 and 3.0.3 patches for the language)</p>
<p>8. <del datetime="2010-03-15T04:08:49+00:00">Once it&#8217;s fully updated, open you langauges data folder and find the realmlist.wtf file. Change the first line for the realm list from eu.logon.worldofwarcraft to us.logon.worldofwarcaft and save it. </del><br />
3.3.2: The realmlist file is apparently not working. So the game is still trying to authenticate to the EU servers (which gives &#8220;There isn’t a wow account associated with this battle.net account&#8221;). The workaround is OS specific, but you basically need to redirect the EU logon server back to the US logon server. In Windows XP, you can do this via the hosts file (similar to Jared Kipe&#8217;s first comment). Here&#8217;s what my hosts file has:<br />
<code>12.129.206.130 213-248-127-130.customer.teliacarrier.com<br />
12.129.206.130 eu.logon.worldofwarcraft.com<br />
12.129.206.130 eu.logon.battle.net</code></p>
<p>You might not need all 3 lines, but i added em all in and didn&#8217;t bother checking which was the right one.</p>
<p>Now&#8230;this creates a tentative problem because IP addresses can change, and it probably shouldn&#8217;t be static (it sometimes load-balances to different authentication servers I think&#8230;) but the basic idea works. It adds another layer of complexity, but if you really want your alternate language, it&#8217;s an option.</p>
<p>9. You can now change the name of your enUS folder back to enUS.</p>
<p>10. At this point you should be able to play the language you installed. But for me, when I tried to play it in English again it would crash on open. To fix that, I copied my enUS data folder from backup to the WoW data folder.</p>
<p>Also note that for some reason, the launcher seemed to not close during some updates, and it would cause the updater to hang until I closed the launcher process via task manager.</p>
<p>Edit (21/3/09):<br />
If you used this method and then merge your WoW account into the new battle.net account, you&#8217;ll get a &#8220;unable to validate game version&#8221; when you try to login. You have to go back to your data folder and rename the local folder that you&#8217;re not using to something else.  For example, I have enUS and deDE. In order to play I rename my deDE folder to anything else that doesn&#8217;t register as a language folder&#8230; I use &#8216;ideDE&#8217;.</p>
<p>Edit (14/3/2010, 1 week short of 1 year later!):<br />
As of Patch 3.3.2:<br />
realmlist.wtf settings don&#8217;t seem to be honored (or something&#8230;.). There is a workaround for step 8.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=23&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2009/01/08/european-language-packs-on-us-world-of-warcraft-patch-303/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Viewstate Problems in IIS and ASP.NET</title>
		<link>http://evilertoaster.wordpress.com/2008/10/03/viewstate-problems-in-iis-and-aspnet/</link>
		<comments>http://evilertoaster.wordpress.com/2008/10/03/viewstate-problems-in-iis-and-aspnet/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 21:14:36 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=21</guid>
		<description><![CDATA[I discovered a curious bit of .NET and IIS (mis)functionality recently when setting up a new home page on a website. There are a few things that seem to trigger this problem, but I wasn’t ever able to get a solid answer about it specifically. The general case is this- You have a WebSite in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=21&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">I discovered a curious bit of .NET and IIS (mis)functionality recently when setting up a new home page on a website.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">There are a few things that seem to trigger this problem, but I wasn’t ever able to get a solid answer about it specifically. The general case is this- </span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">You have a WebSite in IIS.<br />
You have a subsite in that WebSite.<br />
You’re main Websites “default content page” is located in that subsite.<br />
Your “default content page” has a postback event.<br />
You had an old “default content page” that has the same filename as the current one.<br />
The old “default content page” did not have a postback event.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">Though some or all combinations of these conditions, an error happens when you try to browse your main website root in a web browser. The page will open, and load its default content page from “subsite/page.aspx”, but when you try to use the postback event on the page you get this error-</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">&#8220;<em>Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the same validationKey and validation algorithm</em>&#8220;</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">Now the error doesn’t happen if you access the page directly (e.g. <span> </span>www.mainsite.com/subsite/page.aspx ). But when you the page via an IIS provided default content page (e.g www.mainsite.com ) it defiantly has a problem.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">After a long excursion trying various page directives , web.config settings, <span> </span>clearing ASP.NET caches, and IIS restarts, I finally observed a solution that seemed to fix it without fail. All that had to be done was move the default content page to the mainsite, and give it a different file name. So instead of “mainsite/subsite/page.aspx” with a default content page of “subsite/page.aspx”, you have “mainsite/defualtpage.aspx” with “defualtpage.aspx” as the default content page.</span></p>
<p class="MsoNormal" style="margin:0 0 10pt;"><span style="font-size:small;font-family:Calibri;">The solution is kind of unsettling, since it forces you to have a directory structure that may simply not work in some situations. Unfortunately it that only way I was able to find the completely solved the problem. </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=21&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2008/10/03/viewstate-problems-in-iis-and-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Webcrawler class in C#</title>
		<link>http://evilertoaster.wordpress.com/2008/08/28/webcrawler-class-in-c/</link>
		<comments>http://evilertoaster.wordpress.com/2008/08/28/webcrawler-class-in-c/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 20:36:31 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=19</guid>
		<description><![CDATA[Long time since last post, but this&#8217;ll be a big &#8216;n. Been doin  a lot of C# development lately, and thought I&#8217;d share on of the new classes I wrote. It&#8217;s designed to be used in Web crawler type applications as it facilitates opening a page from code, enumerating the links on it, and allowing you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=19&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Long time since last post, but this&#8217;ll be a big &#8216;n.</p>
<p>Been doin  a lot of C# development lately, and thought I&#8217;d share on of the new classes I wrote. It&#8217;s designed to be used in Web crawler type applications as it facilitates opening a page from code, enumerating the links on it, and allowing you to open those links in turn.</p>
<p><em> class WebLink<br />
       {<br />
           public string URL;<br />
           public string LinkText;<br />
           public string href;<br />
           public WebLink(string inHTML, string root)<br />
           {<br />
               if (inHTML.StartsWith(&#8220;&lt;a&#8221;))<br />
               {<br />
                   try<br />
                   {<br />
                       int Start = inHTML.IndexOf(&#8220;href=&#8221;) + 5;<br />
                       if (inHTML.Substring(Start, 1) == &#8220;\&#8221;")<br />
                           Start += 1;<br />
                       int End = inHTML.IndexOf(&#8216;&#8221;&#8216;, Start);<br />
                       if (End == -1)<br />
                       {<br />
                           End = inHTML.IndexOf(&#8216;&gt;&#8217;);<br />
                       }<br />
                       href = inHTML.Substring(Start, End &#8211; Start);<br />
                       if (href.StartsWith(&#8220;/&#8221;))<br />
                           URL = root + href;<br />
                       else<br />
                           URL = href;<br />
                       Start = inHTML.IndexOf(&#8220;&gt;&#8221;) + 1;<br />
                       End = inHTML.IndexOf(&#8220;&lt;/&#8221;);<br />
                       LinkText = inHTML.Substring(Start, End &#8211; Start);<br />
                       return;<br />
                   }<br />
                   catch (Exception Ex)<br />
                   {<br />
                       href = &#8220;Error resolving &lt;a&gt; tag: &#8221; + inHTML;<br />
                       LinkText = Ex.ToString();<br />
                       return;<br />
                   }<br />
               }<br />
               if (inHTML.StartsWith(&#8220;&lt;img&#8221;))<br />
               {<br />
                   try<br />
                   {<br />
                       int Start = inHTML.IndexOf(&#8220;src=&#8221;) + 4;<br />
                       int End = inHTML.IndexOf(&#8220;\&#8221;");<br />
                       href = inHTML.Substring(Start, End &#8211; Start);<br />
                       LinkText = &#8220;&#8221;;<br />
                       return;<br />
                   }<br />
                   catch (Exception Ex)<br />
                   {<br />
                       href = &#8220;Error resolving &lt;img&gt; tag: &#8221; + inHTML;<br />
                       LinkText = Ex.ToString();<br />
                       return;<br />
                   }<br />
               }<br />
               href = &#8220;Invalid HTML: &#8221; + inHTML;<br />
               LinkText = &#8220;&#8221;;<br />
           }<br />
           public bool IsLocalTo(string inParent)<br />
           {<br />
               if (URL.StartsWith(inParent, StringComparison.CurrentCultureIgnoreCase))<br />
                   return true;<br />
               return false;<br />
           }<br />
       }<br />
       class WebPage<br />
       {<br />
           public string URL;<br />
           public ArrayList Links;<br />
           public string Status;<br />
           private string GetRoot(string inRoot)<br />
           {<br />
               int start = inRoot.IndexOf(&#8216;/&#8217;, 8);<br />
               if (start == -1)<br />
                   return inRoot;<br />
               return inRoot.Substring(0, start);<br />
           }<br />
           public WebPage(string inUrl) : this(inUrl, 0) { }<br />
           public WebPage(string inURL, int linkSearchStartIndex)<br />
           {<br />
               URL = inURL;<br />
               Status = &#8220;OK&#8221;;<br />
               string HTML;<br />
               Links = new ArrayList();<br />
               try<br />
               {<br />
                   HTML = new StreamReader(WebRequest.Create(URL).GetResponse().GetResponseStream(), System.Text.Encoding.GetEncoding(&#8220;utf-8&#8243;)).ReadToEnd();<br />
               }<br />
               catch (WebException ex)<br />
               {<br />
                   HTML = &#8220;&#8221;;<br />
                   Status = ex.Status.ToString();<br />
                   return;<br />
               }<br />
               catch (Exception exx)<br />
               {<br />
                   HTML = &#8220;&#8221;;<br />
                   Status = exx.ToString();<br />
                   return;<br />
               }<br />
               int start;<br />
               int end;<br />
               int index = linkSearchStartIndex;</em></p>
<p><em>               WebLink TempLink;</em></p>
<p><em>               while (true)<br />
               {<br />
                   start = HTML.IndexOf(&#8220;&lt;a &#8220;, index);<br />
                   if (start == -1)<br />
                       break;<br />
                   try<br />
                   {<br />
                       end = HTML.IndexOf(&#8220;&lt;/a&gt;&#8221;, start) + 4;</em></p>
<p><em>                       TempLink = new WebLink(HTML.Substring(start, end &#8211; start), GetRoot(URL));</em></p>
<p><em>                   }<br />
                   catch (ArgumentOutOfRangeException)<br />
                   {<br />
                       break;<br />
                   }<br />
                   bool add = true;<br />
                   foreach (WebLink testLink in Links)<br />
                   {<br />
                       if (testLink.URL == TempLink.URL)<br />
                       {<br />
                           add = false;<br />
                           break;<br />
                       }<br />
                   }<br />
                   if (add)<br />
                       Links.Add(TempLink);<br />
                   index = end;<br />
               }<br />
           }<br />
       }</em></p>
<p>The WebPage class take a URL string for its constructor and an optional starting position int. The starting position tells at what point in the HTML to start looking for links. The WebPage will build a list of links which you can enumerate though and get their URL to make more WebPage objects.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/evilertoaster.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/evilertoaster.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=19&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2008/08/28/webcrawler-class-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
		<item>
		<title>Altenating Character Case In A String</title>
		<link>http://evilertoaster.wordpress.com/2008/06/26/altenating-character-case-in-a-string/</link>
		<comments>http://evilertoaster.wordpress.com/2008/06/26/altenating-character-case-in-a-string/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 22:01:56 +0000</pubDate>
		<dc:creator>evilertoaster</dc:creator>
				<category><![CDATA[Wide World Of Computers]]></category>

		<guid isPermaLink="false">http://evilertoaster.wordpress.com/?p=17</guid>
		<description><![CDATA[Ochay, an interesting piece of logic here- Imagine you have a string of characters (say &#8220;Evilertoaster&#8221; for example), and you want to get a list of all possible versions of this string by changing the case of each letter, the output would get something like- evilertoaster Evilertoaster eVilertoaster EVilertoaster evIlertoaster ect...  When solving this problem, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=17&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ochay, an interesting piece of logic here-</p>
<p>Imagine you have a string of characters (say &#8220;Evilertoaster&#8221; for example), and you want to get a list of all possible versions of this string by changing the case of each letter, the output would get something like-</p>
<p><code><br />
evilertoaster<br />
Evilertoaster<br />
eVilertoaster<br />
EVilertoaster<br />
evIlertoaster<br />
ect...<br />
</code></p>
<p> When solving this problem, using binary numbers jumped out as an easy way to signify if the letter should be capitalized or not (000000000001,000000000010,000000000011,000000000100 ect), I first implemented this in code via the following script:</p>
<p><em>$input=StringLower(InputBox(&#8220;Enter Phrase&#8221;,&#8221;"))<br />
if $input=&#8221;" then Exit<br />
$file=FileOpen(@scriptdir&amp;&#8221;\output.txt&#8221;,2)<br />
for $i=0 to 2^StringLen($input)-1<br />
    $tempstring=&#8221;"<br />
    for $n=1 to StringLen($input)<br />
        if StringMid(_ToBinaryString($i,Stringlen($input)),$n,1)=&#8221;1&#8243; Then<br />
            $tempstring&amp;=StringUpper(StringMid($input,$n,1))<br />
        Else<br />
            $tempstring&amp;=StringMid($input,$n,1)<br />
        EndIf<br />
    Next<br />
    FileWriteLine($file,$tempstring)<br />
Next</em></p>
<p><em>func _ToBinaryString($in,$length)<br />
    $out=&#8221;"<br />
    for $i=1 to $length<br />
        if Mod($in,2)=1 then<br />
            $out&amp;=&#8221;1&#8243;<br />
        Else<br />
            $out&amp;=&#8221;0&#8243;<br />
        EndIf<br />
        $in=Floor($in/2)<br />
    Next<br />
    Return $out<br />
EndFunc</em></p>
<p>It worked, but it&#8217;s quite silly to have to convert it into a string of characters to represent the binary number. I was having a huge mental block on doing this the right way for a few days until it just kinda came to me:</p>
<p><em>$input=StringLower(InputBox(&#8220;Enter Phrase&#8221;,&#8221;"))<br />
if $input=&#8221;" then Exit<br />
$file=FileOpen(@scriptdir&amp;&#8221;\output.txt&#8221;,2)<br />
$StringLen=StringLen($input)<br />
$Iterations=2^$StringLen-1<br />
for $i=1 to $Iterations<br />
 $tempstring=&#8221;"<br />
 for $n=1 to $StringLen<br />
  if BitShift(BitAND($i,2^($n-1)),$n-1)=1 Then<br />
   $tempstring&amp;=StringUpper(StringMid($input,$n,1))<br />
  Else<br />
   $tempstring&amp;=StringMid($input,$n,1)<br />
  EndIf<br />
 Next<br />
 FileWriteLine($file,$tempstring)<br />
Next</em></p>
<p>Considerably more elegant, and faster too :)<br />
 </p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/evilertoaster.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/evilertoaster.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/evilertoaster.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/evilertoaster.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/evilertoaster.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/evilertoaster.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/evilertoaster.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/evilertoaster.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/evilertoaster.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/evilertoaster.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=evilertoaster.wordpress.com&amp;blog=3026922&amp;post=17&amp;subd=evilertoaster&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://evilertoaster.wordpress.com/2008/06/26/altenating-character-case-in-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d934afb97081f3d208a8dd4cbb1ad757?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">evilertoaster</media:title>
		</media:content>
	</item>
	</channel>
</rss>
