<?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"
	>

<channel>
	<title>Tom Distler</title>
	<atom:link href="http://tdistler.com/feed" rel="self" type="application/rss+xml" />
	<link>http://tdistler.com</link>
	<description></description>
	<pubDate>Mon, 17 Nov 2008 20:49:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>How to Print a Stack Backtrace Programatically in Linux</title>
		<link>http://tdistler.com/2008/11/15/how-to-print-a-stack-backtrace-programatically-in-linux</link>
		<comments>http://tdistler.com/2008/11/15/how-to-print-a-stack-backtrace-programatically-in-linux#comments</comments>
		<pubDate>Sun, 16 Nov 2008 00:36:58 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[C++]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[GNU]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=149</guid>
		<description><![CDATA[So here&#8217;s a cool feature of GNU&#8217;s implementation of libc: you can get a stack backtrace (as an array of strings) dynamically in your code. This can be really useful when trying to determine the code path taken when an error occurs. Most times, it&#8217;s faster to just run the code in a debugger and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="/media/images/GNULogo.jpg" alt="GNU Logo" />So here&#8217;s a cool feature of <a title="GUN libc" href="http://www.gnu.org/software/libc/" target="_blank">GNU&#8217;s implementation of libc</a>: you can get a stack backtrace (as an array of strings) dynamically in your code. This can be really useful when trying to determine the code path taken when an error occurs. Most times, it&#8217;s faster to just run the code in a debugger and use it to display a backtrace, but there are instances when doing it programmatically is your best option. For example, you could get a backtrace in your application&#8217;s exception handler and use it to augment error log messages.</p>
<p>First, you need to include execinfo.h to your code:</p>
<p class="codeblock">#include &lt;execinfo.h&gt;</p>
<p>Next, call the backtrace() function to get an array of void pointers that represents the current stack (the pointers are the return addresses for each stack frame).</p>
<p class="codeblock">void* tracePtrs[100];<br />
int count = backtrace( tracePtrs, 100 );</p>
<p>The backtrace() function returns the number of entries in the array (read the man pages for more info about the array size).</p>
<p>Finally, you need to resolve the function names associated with the pointers. You have 2 options: backtrace_symbols() and backtrace_symbols_fd(). Both of these methods resolve the pointers to strings, but the difference is that backtrace_symbols() allocates the strings on the heap while backtrace_symbols_fd() writes the strings to a file descriptor that you can read. Just keep in mind that backtrace_symbols() won&#8217;t work if the heap has been trashed.</p>
<p>Here&#8217;s an example using backtrace_symbols():</p>
<p class="codeblock">char** funcNames = backtrace_symbols( tracePtrs, count );<br/><br />
// Print the stack trace<br />
for( int ii = 0; ii &lt; count; ii++ )<br />
&nbsp;&nbsp;&nbsp;printf( &#8220;%s\n&#8221;, funcNames[ii] );<br/><br />
// Free the string pointers<br />
free( funcNames );</p>
<p>NOTE: Make sure you call free() on the array of strings returned from backtrace_symbols().</p>
<p>For more information, <a title="Linux Journal: Stack Backtraceing Inside Your Program" href="http://www.linuxjournal.com/article/6391" target="_blank">here&#8217;s a good article from the Linux Journal</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/15/how-to-print-a-stack-backtrace-programatically-in-linux/feed</wfw:commentRss>
		</item>
		<item>
		<title>Debugging: ACE, Windows, and Memory Leak Detection</title>
		<link>http://tdistler.com/2008/11/14/debugging-ace-windows-and-memory-leak-detection</link>
		<comments>http://tdistler.com/2008/11/14/debugging-ace-windows-and-memory-leak-detection#comments</comments>
		<pubDate>Sat, 15 Nov 2008 00:26:30 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[ACE]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=148</guid>
		<description><![CDATA[The Windows development environment provided by VisualStudio has some neat tools for detecting memory leaks in code. You simply #define _CRTDBG_MAP_ALLOC before including your headers, and #include &#60;crtdbg.h&#62; as the last header:
#define _CRTDBG_MAP_ALLOC
// Include header files here
#include &#60;crtdbg.h&#62;
Then, you call _CrtDumpMemoryLeaks() before your application exits. If your program exits at many points, you can alternatively [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="/media/images/ACE_Logo.jpg" alt="ACE Logo" />The Windows development environment provided by VisualStudio has some neat tools for detecting memory leaks in code. You simply #define _CRTDBG_MAP_ALLOC before including your headers, and #include &lt;crtdbg.h&gt; as the last header:</p>
<p class="codeblock">#define _CRTDBG_MAP_ALLOC<br/><br />
// Include header files here<br/><br />
#include &lt;crtdbg.h&gt;</p>
<p>Then, you call _CrtDumpMemoryLeaks() before your application exits. If your program exits at many points, you can alternatively call _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ) at the beginning of you application, which will cause the leaks to also be printed when it exits. The results are printed to the Debug Window and look like the following:</p>
<p class="codeblock">Detected memory leaks!<br />
Dumping objects -&gt;<br />
C:\PROGRAM FILES\VISUAL STUDIO\MyProjects\leaktest\leaktest.cpp(20) : {18}<br />
normal block at 0&#215;00780E80, 64 bytes long.<br />
Data: &lt;                &gt; CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD<br />
Object dump complete.</p>
<p>Cool, Huh?! However, some libraries don&#8217;t play nice with this, as I explain below.</p>
<p><span id="more-148"></span><strong>Memory Leak Detection and ACE:</strong></p>
<p>I&#8217;ve mentioned <a title="Adaptive Communication Environment" href="http://www.cs.wustl.edu/~schmidt/ACE.html" target="_blank">ACE</a> before in a previous post <a title="C++ Portable Runtime Evaluation" href="http://tdistler.com/2007/11/01/c-portable-runtime-evaluation" target="_blank">evaluating portable runtime environments</a>. It&#8217;s a pretty cool set of libraries that provides a portable OS abstraction layer and communication environment. If you write your application using ACE, it will compile and run on a whole host of system types&#8230; but I digress.</p>
<p>One problem with ACE is that it conflicts with the Windows leak check code. If you define _CRTDBG_MAP_ALLOC before the ACE headers, you will get build errors like the following:</p>
<p class="codeblock">1&gt;..\include\ace\os_ns_unistd.h(154) : error C2059: syntax error : &#8216;constant&#8217;</p>
<p>What&#8217;s happening is that the ACE headers try to enable the leak detection code themselves, which causes the overridden memory functions to conflict with the original versions. In essence, ACE is trying to define malloc (for example) after crtdbg.h has already overridden it.</p>
<p>So, how do you get your application to build with leak detection and ACE? Define _CRTDBG_MAP_ALLOC after the ACE headers (Remember: the ACE headers must <em>always </em>be included before other headers&#8230; another complaint I have).</p>
<p class="codeblock">#include &#8220;ace/ACE.h&#8221;<br/><br />
#define _CRTDBG_MAP_ALLOC<br/><br />
// Include other headers here<br/><br />
#include &lt;crtdbg.h&gt;</p>
<p>Okay, your application should compile now. Run it and look at the output window. For a simple application that does nothing but return, this is what I see:</p>
<p class="codeblock">Detected memory leaks!<br />
Dumping objects -&gt;<br />
{178} normal block at 0&#215;00CDBD78, 50 bytes long.<br />
Data: &lt;&#8212;TEST&#8212;      &gt; 2D 2D 2D 48 45 4C 4C 4F 2D 2D 2D 00 CD CD CD CD<br />
{173} normal block at 0&#215;002EAAC8, 8 bytes long.<br />
Data: &lt;  .     &gt; C0 A1 2E 00 CD CD CD CD<br />
{172} normal block at 0&#215;002EAA78, 20 bytes long.<br />
Data: &lt;4  Z       Z    &gt; 34 90 F3 5A 0A 01 00 00 F3 17 DA 5A 03 00 00 00<br />
{171} normal block at 0&#215;002EAA18, 32 bytes long.<br />
Data: &lt;   Z  ]         &gt; C4 91 F3 5A C0 FB 5D 00 FF FF FF FF 00 00 00 00<br />
{170} normal block at 0&#215;002EA9B8, 32 bytes long.<br />
Data: &lt;   Z  ]         &gt; C4 91 F3 5A 88 FB 5D 00 FF FF FF FF 00 00 00 00<br />
{169} normal block at 0&#215;002EA958, 32 bytes long.<br />
Data: &lt;   ZP ]         &gt; B4 91 F3 5A 50 FB 5D 00 FF FF FF FF 00 00 00 00<br />
{168} normal block at 0&#215;002EA910, 8 bytes long.<br />
Data: &lt;   Z    &gt; D4 91 F3 5A 00 00 00 00<br/><br />
&#8230; Truncated for sanity (30 more leaks follow) &#8230;<br/><br />
Object dump complete.<br />
The program &#8216;[14288] simple.exe: Native&#8217; has exited with code 0 (0&#215;0).</p>
<p>These are very likely false-positives, but they are annoying. There are other problems too:</p>
<ol>
<li>There are no file/line numbers printed, so we can&#8217;t track down the code to verify if the errors are real or not.</li>
<li>File and line numbers don&#8217;t show up for errors <em>outside </em>of ACE (the first leak is mine).</li>
<li>All this output adds noise that can hide other memory leaks (I wish Microsoft would add a way to suppress errors we don&#8217;t care about&#8230; props to <a title="Valgrind" href="http://valgrind.org/" target="_blank">Valgrind</a> for doing this).</li>
</ol>
<p>Anyways, all of this is quite frustrating. I was hunting around on the ACE newsgroup for solutions and could only find <a title="ACE Newsgroup: checking application for memory leaks" href="http://groups.google.co.kr/group/comp.soft-sys.ace/browse_thread/thread/cc1c9642efaf17d7/36e97ef862bb84c0?#36e97ef862bb84c0" target="_blank">this thread</a>:</p>
<blockquote><p>&#8220;In general, we track memory issues on Windows using Purify, so you might try going that route.&#8221;<br />
Douglas Schmidt</p></blockquote>
<blockquote><p>&#8220;Correct. This memory tracking scheme and the ACE restrictions onheader file placement are at odds here. You have two choices:</p>
<p>1. Use a different memory tracking scheme such as Purify, which Doug<br />
suggested.</p>
<p>2. Develop, or sponsor, necessary changes to remove ACE&#8217;s restrictions<br />
on header file placement.&#8221;<br />
Steve Huston</p></blockquote>
<p>So there you have it: ACE and Window memory leak detection don&#8217;t play nice together. I hate encountering a problem without a viable solution&#8230; it bugs me (no pun intended). I even tried modifying the ACE headers with marginal results (it came close to compiling). Oh well&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/14/debugging-ace-windows-and-memory-leak-detection/feed</wfw:commentRss>
		</item>
		<item>
		<title>Image: Powered By GNU/Linux</title>
		<link>http://tdistler.com/2008/11/14/image-powered-by-gnulinux</link>
		<comments>http://tdistler.com/2008/11/14/image-powered-by-gnulinux#comments</comments>
		<pubDate>Fri, 14 Nov 2008 19:46:17 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[Oh So Random]]></category>

		<category><![CDATA[Tech and Security]]></category>

		<category><![CDATA[GNU]]></category>

		<category><![CDATA[image]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Tux]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=147</guid>
		<description><![CDATA[I saw a Linux logo I liked on Google Images a while back, but all instances of it have been removed. I got tired of searching, so last night I hacked around in Photoshop and recreated it.


500 x 750 JPEG
500 x 750 PNG

]]></description>
			<content:encoded><![CDATA[<p>I saw a Linux logo I liked on Google Images a while back, but all instances of it have been removed. I got tired of searching, so last night I hacked around in Photoshop and recreated it.</p>
<p style="text-align: center;"><img style="vertical-align: middle;" src="/media/images/PoweredByGNULinuxSmall.jpg" alt="Powered By GNU/Linux thumbnail" /></p>
<ul>
<li><a title="Powered By GNU/Linux JPEG" href="/media/images/PoweredByGNULinux.jpg" target="_blank">500 x 750 JPEG</a></li>
<li><a title="Powered By GNU/Linux PNG" href="/media/images/PoweredByGNULinux.png" target="_blank">500 x 750 PNG</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/14/image-powered-by-gnulinux/feed</wfw:commentRss>
		</item>
		<item>
		<title>Debugging: C++ Templates, Brekpoints, and GDB</title>
		<link>http://tdistler.com/2008/11/13/debugging-c-templates-brekpoints-and-gdb</link>
		<comments>http://tdistler.com/2008/11/13/debugging-c-templates-brekpoints-and-gdb#comments</comments>
		<pubDate>Fri, 14 Nov 2008 01:28:57 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[breakpoint]]></category>

		<category><![CDATA[C++]]></category>

		<category><![CDATA[debugging]]></category>

		<category><![CDATA[GDB]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[programming]]></category>

		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=146</guid>
		<description><![CDATA[Debugging C++ templates is difficult. Debugging C++ templates with GDB can be an act of torture for even seasoned GDB users. I like GDB, but there are some tricks you should know when using it to debug templates. In this post, I deal with setting breakpoints.
Breakpoint Basics:
Setting a breakpoint in GDB is supposed to be [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="/media/images/GNULogo.jpg" alt="GNU Logo" />Debugging C++ templates is difficult. Debugging C++ templates with GDB can be an act of torture for even seasoned GDB users. I like GDB, but there are some tricks you should know when using it to debug templates. In this post, I deal with setting breakpoints.</p>
<p><strong>Breakpoint Basics:</strong></p>
<p>Setting a breakpoint in GDB is supposed to be simple. Here we set a breakpoint at line 50 in file main.cpp:</p>
<p class="codeblock">(gdb) b main.cpp:50<br />
Breakpoint 1 at 0&#215;804937a: file main.cpp, line 50.</p>
<p>We can also use the function name and GDB will attempt to find the correct location for us:</p>
<p class="codeblock">(gdb) b DoSomething<br />
Breakpoint 2 at 0&#215;8049334: file main.cpp, line 150</p>
<p>Simple, right? Just wait&#8230;</p>
<p><strong>Breakpoint Gotchas:</strong></p>
<p>GDB&#8217;s breakpoint logic is pretty handy for simple projects, but it can break down fast when things get more complicated.</p>
<p>For example, let&#8217;s say your application is plugin-driven, with each plugin being a separate library. Now assume each plugin has a Plugin.cpp file under it&#8217;s own Source directory. Try to set a breakpoint in the Initialize() method of the Plugin class:</p>
<p class="codeblock">(gdb) b Initialize<br />
Breakpoint 3 at 0&#215;8049717: file main.cpp, line 230</p>
<p>Oops! There is an Initialize() method in main.cpp and GDB thought that&#8217;s where we wanted to put it: wrong!</p>
<p><span id="more-146"></span>Okay, let&#8217;s be more specific:</p>
<p class="codeblock">(gbd) b Plugin::Initialize<br />
Breakpoint 4 at 0&#215;8046194: file Source/Plugin.cpp, line 89</p>
<p>Okay, that looks better, but <em>which </em>Plugin.cpp file did GDB put the breakpoint? How do we know it&#8217;s the file for the plugin we want?</p>
<p>If we used namespaces, then we can get more specific:</p>
<p class="codeblock">(gdb) b MY_PLUGIN_A::Plugin::Initialize<br />
Breakpoint 5 at 0&#215;8050039: file Source/Plugin.cpp, line 130</p>
<p>We can see from the address and line number that the previous breakpoint was at the wrong place. Okay, moving on&#8230;</p>
<p><strong>Setting Breakpoint in Templates:</strong></p>
<p>Templates can be much harder to set breakpoints in because we have to specify the <em>exact </em>prototype for the fully-defined template. We as programmers are used to the compiler handling the template type stuff for us, so it can be difficult to guess the correct type.</p>
<p>For example, assume we have some abstract class BarAbstract that uses the template Foo&lt;&gt; to make it concrete. Now assume we&#8217;re really clever and we want to hide this from the users of our class. We could use a typedef to hide the true type:</p>
<p class="codeblock">typedef Foo&lt;BarAbstract&gt; Bar;</p>
<p>Now, all the user needs to do is instantiate Bar without a thought to the Foo&lt;&gt; template.</p>
<p class="codeblock">int DoSomething()<br />
{<br />
Bar b;<br />
return b.Baz();<br />
}</p>
<p>So far so good? Okay, now how the heck do you set a breakpoint in the Baz() method of class Bar?</p>
<p>The quick answer: use objdump, c++filt, and grep to find the complete definition that GDB will need.</p>
<p class="codeblock">$ objdump -t libMyLib.so | c++filt | grep &#8216;BarAbstract.*Baz&#8217;<br />
0000d2d6 w F .text 0000000a     MY_PLUGIN_A::Foo&lt;MY_PLUGIN_A::BarAbstract&gt;::Baz()</p>
<p>Now, simply copy-n-paste the full method definition to GDB when setting the breakpoint:</p>
<p class="codeblock">(gdb) b MY_PLUGIN_A::Foo&lt;MY_PLUGIN_A::BarAbstract&gt;::Baz()<br />
Breakpoint 6 at 0&#215;8048890: file Source/Bar.cpp, line 355</p>
<p>That&#8217;s it! Happy debugging!</p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/13/debugging-c-templates-brekpoints-and-gdb/feed</wfw:commentRss>
		</item>
		<item>
		<title>Enabling X Server Remote Connections on Fedora 9</title>
		<link>http://tdistler.com/2008/11/11/enabling-x-server-remote-connections-on-fedora-9</link>
		<comments>http://tdistler.com/2008/11/11/enabling-x-server-remote-connections-on-fedora-9#comments</comments>
		<pubDate>Tue, 11 Nov 2008 21:38:26 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[Tech and Security]]></category>

		<category><![CDATA[Fedora]]></category>

		<category><![CDATA[gdmsetup]]></category>

		<category><![CDATA[KDE]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[X Server]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=145</guid>
		<description><![CDATA[Recently, I was trying to run a GUI front-end to Valgrind (Valkyrie) from within a chroot&#8217;d environment on Fedora 9. It failed to run, and after some searching I figured out the problem. Here&#8217;s the story.
First, I made sure to disable access control from outside the chroot (warning: make sure you understand the security implications [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="/media/images/Fedora_Logo.gif" alt="Fedora Logo" />Recently, I was trying to run a GUI front-end to <a title="Valgrind" href="http://valgrind.org/" target="_blank">Valgrind</a> (<a title="Valkyrie" href="http://www.open-works.net/projects/valkyrie.html" target="_blank">Valkyrie</a>) from within a chroot&#8217;d environment on <a title="Fedora" href="http://fedoraproject.org/" target="_blank">Fedora</a> 9. It failed to run, and after some searching I figured out the problem. Here&#8217;s the story.</p>
<p>First, I made sure to disable access control from outside the chroot (warning: make sure you understand the security implications of this!):</p>
<p class="codeblock">[dev]$ xhost + localhost<br />
localhost being added to access control list</p>
<p>Next, I entered the chroot&#8217;d environment and attempted to run the application, but it failed with the following error:</p>
<p class="codeblock">[chroot]$ valkyrie<br />
valkyrie: cannot connect to X server 127.0.0.1:0.0</p>
<p>The problem is that the X server is configured by default NOT to listen for remote connections (usually on port 6000). I verified that this was the problem by leaving the chroot and trying to connect via telnet:</p>
<p class="codeblock">[dev]$ telnet 127.0.0.1 6000<br />
Trying 127.0.0.1&#8230;<br />
telnet: connect to address 127.0.0.1: Connection refused</p>
<p>The way to fix this on previous Fedora installations was to use gdmsetup. However, this is no longer available. Hunting through the KDE config files I found the solution: change the arguments passed to the X server after login in the kdmrc file. </p>
<p><b>NOTE</b>: I&#8217;m using <a title="fluxbox" href="http://fluxbox.org/" target="_blank">fluxbox</a> as my desktop environment&#8230; KDE is used for the Fedora login screen, which is why we are messing with its config files.</p>
<p class="codeblock">[dev]$ sudo su<br />
[root]# cd /etc/kde/kdm<br />
[root]# cp kdmrc kdmrc.old<br />
[root]# vi kdmrc</p>
<p>On my system, the problem was this line:</p>
<p class="codeblock">ServerArgsLocal=-br -nolisten tcp</p>
<p>I simply changed it to:</p>
<p class="codeblock">ServerArgLocal=-br</p>
<p>I restarted my X server and tried to connect with telnet again (this time with success):</p>
<p class="codeblock">[dev]$ telnet 127.0.0.1 6000<br />
Trying 127.0.0.1&#8230;<br />
Connected to 127.0.0.1.<br />
Escape character is &#8216;^]&#8217;.</p>
<p>Then, I once again disabled X access control (`xhost + localhost`) and everything worked fine. Hope this helps!</p>
<p><b>EDITED 11/17/2008: Changed &#8216;xhost +&#8217; to &#8216;xhost + localhost&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/11/enabling-x-server-remote-connections-on-fedora-9/feed</wfw:commentRss>
		</item>
		<item>
		<title>Windows 7 Development Guide</title>
		<link>http://tdistler.com/2008/11/04/windows-7-development-guide</link>
		<comments>http://tdistler.com/2008/11/04/windows-7-development-guide#comments</comments>
		<pubDate>Tue, 04 Nov 2008 18:39:40 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[Tech and Security]]></category>

		<category><![CDATA[DirectX]]></category>

		<category><![CDATA[media foundation]]></category>

		<category><![CDATA[windows]]></category>

		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=144</guid>
		<description><![CDATA[Microsoft has started to release developer information for Windows 7 (the follow-on to Windows Vista). Of particular interest to me is the Windows 7 Developer Guide. It discusses many of the new features that will be available when this new version of Windows is released.
Of particular interest to me are the changes to DirectX 10, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="/media/images/windows-7-construction.jpg" alt="Windows 7: Under Construction" />Microsoft has started to release developer information for Windows 7 (the follow-on to Windows Vista). Of particular interest to me is the <a title="MSDN: Windows 7 Developer Guide" href="http://code.msdn.microsoft.com/Win7DeveloperGuide" target="_blank">Windows 7 Developer Guide</a>. It discusses many of the new features that will be available when this new version of Windows is released.</p>
<p>Of particular interest to me are the changes to DirectX 10, Media Foundation, and the new DirectX 11. Here are some highlights.</p>
<p>DirectX 11:</p>
<ul>
<li>&#8220;&#8230;resource creation and management has been optimized for multithreaded use, enabling more efficient dynamic texture management for streaming.&#8221;</li>
<li>Several improvements have been made to the high-level shading language (HLSL), such as a limited form of dynamic linkage in shaders to improve specialization complexity, and object-oriented programming constructs like classes and interfaces.&#8221;</li>
</ul>
<p>DirectX 10 improvements:</p>
<ul>
<li>&#8220;The pipeline also introduces the geometry shader stage, which offloads work entirely from the CPU to the GPU. This new stage enables you to create geometry, stream the data to memory, and render the geometry with no CPU interaction.&#8221;</li>
<li>Predicated rendering performs occlusion culling to reduce the amount of geometry that is rendered. Instancing APIs can dramatically reduce the amount of geometry that needs to be transferred to the GPU by drawing multiple-instances of similar objects. Texture arrays enable the GPU to do texture swapping without CPU intervention.&#8221;</li>
</ul>
<p>Media Foundation improvements:</p>
<ul>
<li>&#8220;&#8230;Media Foundation has been enhanced to provide better format support, including MPEG-4, as well as support for video capture devices and hardware codecs.&#8221;</li>
<li>&#8220;In Windows 7, Media Foundation provides extensive format support that includes codecs for H.264 video, MJPEG, and MP3; new sources for MP4, 3GP, MPEG2-TS, and AVI; and new file sinks for MP4, 3GP, and MP3.&#8221;</li>
<li>&#8220;In Windows Vista, Media Foundation exposed a relatively low-level set of APIs. These APIs are flexible, but may not be appropriate for performing tasks. Windows 7 adds new high-level APIs that make it simpler to write media applications in C++.&#8221;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/04/windows-7-development-guide/feed</wfw:commentRss>
		</item>
		<item>
		<title>Direct3D 9.0 Graphics Pipeline</title>
		<link>http://tdistler.com/2008/11/03/direct3d-90-grphics-pipeline</link>
		<comments>http://tdistler.com/2008/11/03/direct3d-90-grphics-pipeline#comments</comments>
		<pubDate>Mon, 03 Nov 2008 17:36:42 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[Direct3D]]></category>

		<category><![CDATA[DirectX]]></category>

		<category><![CDATA[graphics]]></category>

		<category><![CDATA[pipeline]]></category>

		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=143</guid>
		<description><![CDATA[Here&#8217;s great diagram of the Direct3D 9.0 graphic pipeline (thanks Amanda for bringing this to my attention). I know DirectX 10 is out, but this diagram serves as a good reference for anyone interested in the nitty-gritty of a 3D graphics pipeline.



]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" style="float: right;" src="/media/images/DirectX90.jpg" alt="DirectX 9.0" />Here&#8217;s great diagram of the Direct3D 9.0 graphic pipeline (thanks Amanda for bringing this to my attention). I know DirectX 10 is out, but this diagram serves as a good reference for anyone interested in the nitty-gritty of a 3D graphics pipeline.</p>
<p style="text-align: center;"><a href="/media/images/Direct3DPipeline9.0.jpg"><br />
<img src="/media/images/Direct3DPipeline9.0Thumb.jpg" alt="" /><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/11/03/direct3d-90-grphics-pipeline/feed</wfw:commentRss>
		</item>
		<item>
		<title>Stanley Clarke: Upright Bass Solo</title>
		<link>http://tdistler.com/2008/10/30/stanley-clarke-upright-bass-solo</link>
		<comments>http://tdistler.com/2008/10/30/stanley-clarke-upright-bass-solo#comments</comments>
		<pubDate>Thu, 30 Oct 2008 17:51:12 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Tunes and Grooves]]></category>

		<category><![CDATA[bass]]></category>

		<category><![CDATA[Stanley Clarke]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=142</guid>
		<description><![CDATA[I&#8217;ve been meaning to post this video for awhile (been busy). Stanley Clarke is one of the most amazing bass players I&#8217;ve seen. He really explores the instrument and is not afraid to push it to new sounds. This upright bass solo is just awesome!

(requires Adobe Flash plugin&#8230; click HERE to watch it on YouTube)
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been meaning to post this video for awhile (been busy). Stanley Clarke is one of the most amazing bass players I&#8217;ve seen. He really explores the instrument and is not afraid to push it to new sounds. This upright bass solo is just awesome!</p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/Py3jT0uaZw0&amp;hl=en" width="425" height="355"><param name="movie" value="http://www.youtube.com/v/Py3jT0uaZw0&amp;hl=en" /><param name="FlashVars" value="playerMode=embedded" /><param name="wmode" value="transparent" /></object></p>
<p style="text-align: center;">(requires <a href="http://www.adobe.com/products/flashplayer/" target="_blank">Adobe Flash</a> plugin&#8230; click <a href="http://www.youtube.com/watch?v=Py3jT0uaZw0" target="_blank">HERE</a> to watch it on YouTube)</p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/10/30/stanley-clarke-upright-bass-solo/feed</wfw:commentRss>
		</item>
		<item>
		<title>Setting the DHCP Hostname on Linux</title>
		<link>http://tdistler.com/2008/10/14/setting-the-dhcp-hostname-on-linux</link>
		<comments>http://tdistler.com/2008/10/14/setting-the-dhcp-hostname-on-linux#comments</comments>
		<pubDate>Tue, 14 Oct 2008 22:59:27 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Code Monkey]]></category>

		<category><![CDATA[Configuring]]></category>

		<category><![CDATA[DHCP]]></category>

		<category><![CDATA[Fedora Core]]></category>

		<category><![CDATA[Hostname]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[network]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=141</guid>
		<description><![CDATA[I&#8217;m always forgetting how to register my machine name with the DHCP server so I can ping my box without having to remember my IP address. Here&#8217;s how to do it on Fedora Core 9:

Set the hostname: `# hostname &#60;hostname&#62;`
Add &#8216;HOSTNAME=&#60;hostname&#62;&#8217; to &#8216;/etc/sysconfig/network&#8217; (makes the change permanent).
Add &#8216;DHCP_HOSTNAME=&#60;hostname&#62;&#8217; to &#8216;/etc/sysconfig/network-scripts/ifcfg-eth0&#8242;
Restart the networking service: `# service [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m always forgetting how to register my machine name with the DHCP server so I can ping my box without having to remember my IP address. Here&#8217;s how to do it on Fedora Core 9:</p>
<ol>
<li>Set the hostname: `# hostname &lt;<em>hostname</em>&gt;`</li>
<li>Add &#8216;HOSTNAME=&lt;<em>hostname</em>&gt;&#8217; to &#8216;/etc/sysconfig/network&#8217; (makes the change permanent).</li>
<li>Add &#8216;DHCP_HOSTNAME=&lt;<em>hostname</em>&gt;&#8217; to &#8216;/etc/sysconfig/network-scripts/ifcfg-eth0&#8242;</li>
<li>Restart the networking service: `# service network restart`</li>
</ol>
<p>Volia! Now you can connect to your box via hostname.</p>
<p>References:</p>
<ul>
<li><a title="nixCraft" href="http://www.cyberciti.biz/faq/howto-get-linux-static-dhcp-address/" target="_blank">Configuring Linux Static DHCP Clients by Sending Host Name</a></li>
<li><a title="nixCraft" href="http://www.cyberciti.biz/faq/linux-setting-hostname-and-domain-name-of-my-server/" target="_blank">Linux setting hostname and domain name of my server</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/10/14/setting-the-dhcp-hostname-on-linux/feed</wfw:commentRss>
		</item>
		<item>
		<title>ASCII Video Rendering</title>
		<link>http://tdistler.com/2008/10/03/ascii-video-rendering</link>
		<comments>http://tdistler.com/2008/10/03/ascii-video-rendering#comments</comments>
		<pubDate>Sat, 04 Oct 2008 00:32:44 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
		
		<category><![CDATA[Oh So Random]]></category>

		<category><![CDATA[Tech and Security]]></category>

		<category><![CDATA[ASCII]]></category>

		<category><![CDATA[libcaca]]></category>

		<category><![CDATA[MPEG]]></category>

		<category><![CDATA[renderer]]></category>

		<category><![CDATA[ssh]]></category>

		<category><![CDATA[text]]></category>

		<category><![CDATA[video]]></category>

		<category><![CDATA[xterm]]></category>

		<guid isPermaLink="false">http://tdistler.com/?p=140</guid>
		<description><![CDATA[So, we&#8217;ve been developing a slick cross-platform media framework to standardize or products on (proprietry, of course), and I couldn&#8217;t resist building an ASCII text renderer. It was surprisingly easy using our SDK and a free library called libcaca&#8230; seriously, that&#8217;s it&#8217;s name. It looks okay small, but of course it breaks down as you [...]]]></description>
			<content:encoded><![CDATA[<p>So, we&#8217;ve been developing a slick cross-platform media framework to standardize or products on (proprietry, of course), and I couldn&#8217;t resist building an ASCII text renderer. It was surprisingly easy using our SDK and a free library called <a title="Caca Labs: libcaca" href="http://caca.zoy.org/wiki/libcaca" target="_blank">libcaca</a>&#8230; seriously, that&#8217;s it&#8217;s name. It looks okay small, but of course it breaks down as you scale up. Anyways, now we can watch video using xterm via ssh&#8230; use case? Who cares!&#8230; it&#8217;s ASCII video <img src='http://tdistler.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img src="/media/images/PelcoReferenceRendererSmall.jpg" alt="Pelco Reference Renderer - Small" width="100" height="75" /> <img src="/media/images/PelcoASCIIRendererSmall.jpg" alt="Pelco ASCII Renderer - Small" width="100" height="84" /></p>
<p style="text-align: left;">Okay, now the large size (video source: D1 MPEG-4 30 fps):</p>
<p style="text-align: center;"><img src="/media/images/PelcoReferenceRenderer.jpg" alt="Pelco Reference Renderer" width="500" height="374" /></p>
<p style="text-align: center;"><img src="/media/images/PelcoASCIIRenderer.jpg" alt="Pelco ASCII Renderer" width="500" height="421" /></p>
]]></content:encoded>
			<wfw:commentRss>http://tdistler.com/2008/10/03/ascii-video-rendering/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.506 seconds -->
