<?xml version="1.0" encoding="iso-8859-1"?>
	<rss version="2.0" 
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		xmlns:admin="http://webns.net/mvcb/"
		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
		xmlns:content="http://purl.org/rss/1.0/modules/content/">

	<channel>
		<title>VirtualBlog</title>
		<link>http://virtualdub.org/blog/index.php</link>
		<description>Life as the author of VirtualDub</description>
		<dc:language>en-us</dc:language>
		<dc:creator></dc:creator>
		<dc:rights>Copyright 2008</dc:rights>
		<dc:date>2008-05-11T20:15:32-04:00</dc:date>
		<admin:generatorAgent rdf:resource="http://www.pivotlog.net/?ver=Pivot+-+1.15%3A+%27Soundwave%27" />
		<admin:errorReportsTo rdf:resource="mailto:rsserrors@pivotlog.net"/>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
		<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
	<item>
		<title>Fixing games for dad</title>
		<link>http://virtualdub.org/blog/pivot/entry.php?id=201</link>
		<comments>http://virtualdub.org/blog/pivot/entry.php?id=201#comm</comments>
		<description>Occasionally, whenever I visit my parents, I end up fixing something on their computer. Yeah, I know what you're thinking, but it's a bit different. My dad's not the most technical guy in the world, but he tends to wait to&amp;nbsp;ask me for help until after he's tried swapping the video card and reinstalling Windows, so the problems I get to look at are a bit more annoying than just clicking a checkbox somewhere. Hardware, he can usually figure out, but it's software that gives him real problems -- specifically, the casino games he likes to play sometimes don't work when he reinstalls them on different machines.
The first time, the problem was that the game was hanging on launch on a second machine. I had thought, bah, it's just an outdated video driver. Sure enough, the installed video driver was ancient, and I updated it, but still no-go. Eventually I ended up running the game under ntsd.exe and discovering that the game was stuck in&amp;nbsp;a QueryPerformanceCounter() loop. It seems that the&amp;nbsp;programmers that wrote the game figured that the 64-bit LARGE_INTEGER returned by QueryPerformanceCounter() always counted up at somewhere between 1-4MHz&amp;nbsp;and hardcoded that fact in a weird way that&amp;nbsp;the game&amp;nbsp;hung in a speed regulation loop when run on an AMD Athlon. I just ended up hacking out a branch instruction in the EXE to fix it.
The second time, different game,&amp;nbsp;checked the video driver again, no go. The symptom was a silent crash to desktop&amp;nbsp;shortly after the game launched -- pretty user unfriendly, but not unusual for a game. I ran it again under NTSD, and I got a call stack with a module called ixvpd.dll on the stack. No clues on a web search. I checked the game vendor's website, and all I found was a lame &quot;codec patch&quot; that apparently &quot;fixes&quot; a codec compatibility issue by uninstalling ffdshow and avisplitter. (Sigh.) ixvpd.dll didn't have a version description block, but a strings search did reveal that it was a decoder of some sort, and renaming it did fix the problem. It turned out to be a poorly written DirectShow-based video codec that came with the software package from a webcam that my dad no longer uses, so I uninstalled that and that fixed the problem proper.
If you think about it, with issues like these, it's no wonder that average people just throw their hands up in the air and say their computer's broken. It's hard enough to tell what's going on if you are a programmer, much less if you're not.</description>
		<guid isPermaLink="false">201@http://virtualdub.org/blog/</guid>
		<content:encoded><![CDATA[ <p>Occasionally, whenever I visit my parents, I end up fixing something on their computer. Yeah, I know what you're thinking, but it's a bit different. My dad's not the most technical guy in the world, but he tends to wait to ask me for help until after he's tried swapping the video card and reinstalling Windows, so the problems I get to look at are a bit more annoying than just clicking a checkbox somewhere. Hardware, he can usually figure out, but it's software that gives him real problems -- specifically, the casino games he likes to play sometimes don't work when he reinstalls them on different machines.</p>
<p>The first time, the problem was that the game was hanging on launch on a second machine. I had thought, bah, it's just an outdated video driver. Sure enough, the installed video driver was ancient, and I updated it, but still no-go. Eventually I ended up running the game under ntsd.exe and discovering that the game was stuck in a QueryPerformanceCounter() loop. It seems that the programmers that wrote the game figured that the 64-bit LARGE_INTEGER returned by QueryPerformanceCounter() always counted up at somewhere between 1-4MHz and hardcoded that fact in a weird way that the game hung in a speed regulation loop when run on an AMD Athlon. I just ended up hacking out a branch instruction in the EXE to fix it.</p>
<p>The second time, different game, checked the video driver again, no go. The symptom was a silent crash to desktop shortly after the game launched -- pretty user unfriendly, but not unusual for a game. I ran it again under NTSD, and I got a call stack with a module called ixvpd.dll on the stack. No clues on a web search. I checked the game vendor's website, and all I found was a lame "codec patch" that apparently "fixes" a codec compatibility issue by uninstalling ffdshow and avisplitter. (Sigh.) ixvpd.dll didn't have a version description block, but a strings search did reveal that it was a decoder of some sort, and renaming it did fix the problem. It turned out to be a poorly written DirectShow-based video codec that came with the software package from a webcam that my dad no longer uses, so I uninstalled that and that fixed the problem proper.</p>
<p>If you think about it, with issues like these, it's no wonder that average people just throw their hands up in the air and say their computer's broken. It's hard enough to tell what's going on if you are a programmer, much less if you're not.</p> ]]></content:encoded>
		<dc:subject>default</dc:subject>
		<dc:date>2008-05-11T19:58:00-04:00</dc:date>
    </item>

	<item>
		<title>stdext::hash_set</title>
		<link>http://virtualdub.org/blog/pivot/entry.php?id=200</link>
		<comments>http://virtualdub.org/blog/pivot/entry.php?id=200#comm</comments>
		<description>A couple of days ago I found myself writing a breadth-first search routine in C++&amp;nbsp;for a particular puzzle (Klotski, to be specific). Since I was using Visual C++, I needed&amp;nbsp;a set for the board database, and decided to use its stdext::hash_set.
stdext::hash_set... sucks.
See, Visual C++'s Standard Template Library (STL) is based on the implementation from Dinkumware, and has the following prototype:
template&amp;lt;class Key,         class Traits = hash_compare&amp;lt;Key, less&amp;lt;Key&amp;gt; &amp;gt;,         class Allocator = allocator&amp;lt;Key&amp;gt; &amp;gt;class hash_set;
Notice two things about this hash set implementation: it takes a less-than predicate, and it doesn't take an equality predicate. What the frick kind of hash table requires a less-than predicate??? And we're not talking about a predicate for the hash code here, but a less-than comparison operator for the whole key. It&amp;nbsp;defeats one of the main advantages of a hash container, since IMO it's often easier to write&amp;nbsp;hash and equality predicates instead of a less-than predicate, as long as you aren't dealing with floats.&amp;nbsp;I've never seen a hashed container that required this -- not in SGI-STL/STLport, not in Java, not in the .NET Framework. As you might expect, this means that VC8's hash_set is a pain in the butt to use and is slow. Thankfully, C++ TR1's unordered_set follows the SGI-STL/STLport path rather than Dinkumware's.
I haven't really had a need for&amp;nbsp;a full blown hash_map or a hash_set in VirtualDub, but I'm thinking that if I do, I'll be better off writing my own....</description>
		<guid isPermaLink="false">200@http://virtualdub.org/blog/</guid>
		<content:encoded><![CDATA[ <p>A couple of days ago I found myself writing a breadth-first search routine in C++ for a particular puzzle (<a href="http://en.wikipedia.org/wiki/Klotski">Klotski</a>, to be specific). Since I was using Visual C++, I needed a set for the board database, and decided to use its stdext::hash_set.</p>
<p>stdext::hash_set... sucks.</p>
<p>See, Visual C++'s Standard Template Library (STL) is based on the implementation from Dinkumware, and has the following prototype:</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px"><pre>template&lt;class Key,<br  />         class Traits = hash_compare&lt;Key, less&lt;Key&gt; &gt;,<br  />         class Allocator = allocator&lt;Key&gt; &gt;<br  />class hash_set;</pre></blockquote>
<p>Notice two things about this hash set implementation: it takes a less-than predicate, and it doesn't take an equality predicate. What the frick kind of hash table requires a less-than predicate??? And we're not talking about a predicate for the hash code here, but a less-than comparison operator for the whole key. It defeats one of the main advantages of a hash container, since IMO it's often easier to write hash and equality predicates instead of a less-than predicate, as long as you aren't dealing with floats. I've never seen a hashed container that required this -- not in SGI-STL/STLport, not in Java, not in the .NET Framework. As you might expect, this means that VC8's hash_set is a pain in the butt to use and is slow. Thankfully, C++ TR1's unordered_set follows the SGI-STL/STLport path rather than Dinkumware's.</p>
<p>I haven't really had a need for a full blown hash_map or a hash_set in VirtualDub, but I'm thinking that if I do, I'll be better off writing my own....</p> ]]></content:encoded>
		<dc:subject>default</dc:subject>
		<dc:date>2008-05-03T21:07:00-04:00</dc:date>
    </item>

</channel>
</rss>