<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>dholm.com</title>
	
	<link>http://www.dholm.com</link>
	<description>The trouble with programmers is that you can never tell what a programmer is doing until it's too late.</description>
	<lastBuildDate>Wed, 16 Feb 2011 06:00:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dholm" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="dholm" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">dholm</feedburner:emailServiceId><feedburner:feedburnerHostname xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Tumblelog 110216</title>
		<link>http://www.dholm.com/2011/02/16/tumblelog-110216/</link>
		<comments>http://www.dholm.com/2011/02/16/tumblelog-110216/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 06:00:45 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1228</guid>
		<description><![CDATA[This is likely to be the last of my tumblelog entries as I recently made the move to microblogging using twitter. This blog will of course remain and I will go on producing classic blog entries. If you have appreciated my tumblelog please follow dholmcom on Twitter. TAU &#8211; Tuning and Analysis Utilities, are a [...]]]></description>
			<content:encoded><![CDATA[<p>This is likely to be the last of my tumblelog entries as I recently made the move to microblogging using twitter. This blog will of course remain and I will go on producing classic blog entries. If you have appreciated my tumblelog please follow <a title="dholmcom" href="http://twitter.com/#!/dholmcom">dholmcom</a> on Twitter.</p>
<p><a title="TAU - Tuning and Analysis Utilities" href="http://www.cs.uoregon.edu/research/tau/home.php">TAU &#8211; Tuning and Analysis Utilities</a>, are a set of tools for profiling and tracing applications written in C/C++, Java, Fortran or Python.</p>
<p><a title="Intel Performance Tuning Utility" href="http://software.intel.com/en-us/articles/intel-performance-tuning-utility/">Intel Performance Tuning Utility</a>, yet another tool for profiling code specifically targeting the x86, x86-64 and ia64 architectures based on Intel VTune.</p>
<div id="attachment_1251" class="wp-caption alignnone" style="width: 574px"><a href="http://www.shafqatahmed.com/WindowsLiveWriter/OpenSourceLicenseComparison.png"><img class="size-full wp-image-1251 " title="Open Source License Comparison" src="http://www.dholm.com/wp-content/uploads/2011/02/OpenSourceLicenseComparison.png" alt="" width="564" height="434" /></a><p class="wp-caption-text">Open Source License Comparison</p></div>
<p><a title="GHDL" href="http://ghdl.free.fr/">GHDL</a>, is an open source VHDL simulator.</p>
<p><a title="ROCCC" href="http://roccc.cs.ucr.edu/">ROCCC</a>, provides an open source C to VHDL compiler which integrates with Eclipse.</p>
<p><a title="John Kent's VHDL FPGA Projects" href="http://members.optushome.com.au/jekent/FPGA.htm">John Kent&#8217;s VHDL FPGA Projects</a>, has several good links on FPGAs and is a good starting place if you want to learn more about this particular subject.</p>
<p><a title="Genode" href="http://genode.org/">Genode</a>, an operating system framework based on the L4 microkernel architecture capable of running a plethora of kernels.</p>
<p><a title="Programming from the Ground Up" href="http://savannah.spinellicreations.com/pgubook/ProgrammingGroundUp-1-0-booksize.pdf">Programming from the Ground Up</a>, is a nice little free book detailing all the basics of programming. Highly recommended for any aspiring software engineer.</p>
<p><a title="Ghosts of Unix Past: a historical search for design patterns" href="http://lambda-the-ultimate.org/node/4156">Ghosts of Unix Past: a historical search for design patterns</a>, a historical walk through memory design patterns lane.</p>
<p><a title="Introduction to OpenCL" href="http://www.realworldtech.com/page.cfm?ArticleID=RWT120710035639">Introduction to OpenCL</a>, seeing how OpenCL has already picked up a lot of traction already this introduction might be posted a bit late but to the uninitiated it might prove useful.</p>
<p><a title="Throwing Destructors" href="http://www.kolpackov.net/projects/c++/eh/dtor-1.xhtml">Throwing Destructors</a>, throwing from a C++ destructor is generally thought of as a big no-no and this article discusses all the issues related to it and suggests a couple of solutions. An interesting read!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2011/02/16/tumblelog-110216/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The world’s most useless piece of machinery!</title>
		<link>http://www.dholm.com/2011/02/10/the-worlds-most-useless-piece-of-machinery/</link>
		<comments>http://www.dholm.com/2011/02/10/the-worlds-most-useless-piece-of-machinery/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 20:36:26 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1257</guid>
		<description><![CDATA[http://www.youtube.com/watch?v=jN4RaPfgP1U]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=jN4RaPfgP1U">http://www.youtube.com/watch?v=jN4RaPfgP1U</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2011/02/10/the-worlds-most-useless-piece-of-machinery/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Tumblelog 101220</title>
		<link>http://www.dholm.com/2010/12/20/tumblelog-101220/</link>
		<comments>http://www.dholm.com/2010/12/20/tumblelog-101220/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 06:00:54 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1205</guid>
		<description><![CDATA[The Dave Haynie Archives, where he has collected old Commodore documentation on various kinds of Amiga hardware. Gprof2Dot, is a tool that produces call graph profiles based on data from a plethora of profiling tools. A Bit of Physics Humour, or how to measure the height of a tall building by using a barometer. Linux [...]]]></description>
			<content:encoded><![CDATA[<p><a title="The Dave Haynie Archives" href="http://www.thule.no/haynie/">The Dave Haynie Archives</a>, where he has collected old Commodore documentation on various kinds of Amiga hardware.</p>
<p><a title="Gprof2Dot" href="http://code.google.com/p/jrfonseca/wiki/Gprof2Dot">Gprof2Dot</a>, is a tool that produces call graph profiles based on data from a plethora of profiling tools.</p>
<div id="attachment_1221" class="wp-caption alignnone" style="width: 650px"><a href="http://www.viruscomix.com/"><img class="size-full wp-image-1221" title="The Maturity Climb" src="http://www.dholm.com/wp-content/uploads/2010/11/gotes.jpeg" alt="" width="640" /></a><p class="wp-caption-text">The Maturity Climb by Virus Comix</p></div>
<p><a title="A Bit of Physics Humour" href="http://vijaysrinivasan.wordpress.com/2008/08/06/a-bit-of-physics-humour/">A Bit of Physics Humour</a>, or how to measure the height of a tall building by using a barometer.</p>
<p><a title="Linux Compose Key" href="http://sivers.org/compose-key">Linux Compose Key</a>, learn how to effectively write characters that aren&#8217;t available on most standard keyboards.</p>
<p><a title="SCIgen - An Automatic CS Paper Generator" href="http://pdos.csail.mit.edu/scigen/">SCIgen &#8211; An Automatic CS Paper Generator</a>, generate computer science papers on-the-fly. Would be cooler if you could actually control the subject, nevertheless it&#8217;s still an interesting concept.</p>
<p><a title="The V4Z80P" href="http://www.retroleum.co.uk/electronics-articles/previous/the-v4z80p-a-z80-based-laptop/">The V4Z80P</a>, a Z80 laptop. Mucho geeky!</p>
<p><a title="google-perftools" href="http://code.google.com/p/google-perftools/">google-perftools</a>, provides profiling tools for multi-threaded C++ applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/12/20/tumblelog-101220/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tumblelog 101206</title>
		<link>http://www.dholm.com/2010/12/06/tumblelog-101206/</link>
		<comments>http://www.dholm.com/2010/12/06/tumblelog-101206/#comments</comments>
		<pubDate>Mon, 06 Dec 2010 06:00:00 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1187</guid>
		<description><![CDATA[A Guide to Debouncing, an indepth guide on contact bouncing in electronics and different solutions to the problem. 10 Tools To Add Some Spice To Your UNIX Shell Scripts, some useful shell scripting tips like being able to trigger notifications in the desktop environment. Once, Weakly, advanced C++ topics which was once posted weekly. Silhouette: [...]]]></description>
			<content:encoded><![CDATA[<p><a title="A Guide to Debouncing" href="http://www.ganssle.com/debouncing.htm">A Guide to Debouncing</a>, an indepth guide on contact bouncing in electronics and different solutions to the problem.</p>
<p><a title="10 Tools To Add Some Spice To Your UNIX Shell Scripts" href="http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html">10 Tools To Add Some Spice To Your UNIX Shell Scripts</a>, some useful shell scripting tips like being able to trigger notifications in the desktop environment.</p>
<div id="attachment_1209" class="wp-caption alignnone" style="width: 610px"><a href="http://www.davidshrigley.com/photo_htmpgs/notice.html"><img class="size-full wp-image-1209" title="Notice by David Shrigley" src="http://www.dholm.com/wp-content/uploads/2010/11/notice.jpg" alt="" width="600" height="450" /></a><p class="wp-caption-text">Notice by David Shrigley</p></div>
<p><a title="Once, Weakly" href="http://semantics.org/weekly.html">Once, Weakly</a>, advanced C++ topics which was once posted weekly.</p>
<p><a title="Silhouette: The Story" href="http://www.patpend.net/articles/ar/sil10.html">Silhouette: The Story</a>, of this highly mysterious almost perfect SNES emulator (during a time when the competition was still struggling to run homebrew).</p>
<p><a title="Open64" href="http://www.open64.net/">Open64</a>, is a open source compiler originally from SGI based on their MIPSPro compiler.</p>
<p><a title="SGI Developer Books" href="http://techpubs.sgi.com/library/dynaweb_docs/0530/SGI_Developer/books/">SGI Developer Books</a>, an archive of different books on subjects relating to developing for different SGI technologies.</p>
<p><a title="Mechanical Keyboard Guide" href="http://www.overclock.net/keyboards/491752-mechanical-keyboard-guide.html">Mechanical Keyboard Guide</a>, this is a guide to all the different kinds of computer keyboards that you will find including details on actuation, materials and virtually anything else that goes into defining the quality of the device.</p>
<p><a title="UML Graphical Notation Overview and Reference" href="http://www.uml-diagrams.org/">UML Graphical Notation Overview and Reference</a>, provides an excellent online reference for the various UML diagram standards.</p>
<p><a title="Practical File System Design" href="http://www.nobius.org/~dbg/practical-file-system-design.pdf">Practical File System Design</a>, is a freely available book by one of the developers of the Be File System (BeFS) and explains everything you ever wanted to know about file systems.</p>
<p><a title="Dirty Coding Tricks" href="http://www.gamasutra.com/view/feature/4111/dirty_coding_tricks.php">Dirty Coding Tricks</a>, pulled off by various desperate game programmers on the virge of product release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/12/06/tumblelog-101206/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tumblelog 101122</title>
		<link>http://www.dholm.com/2010/11/22/tumblelog-101122/</link>
		<comments>http://www.dholm.com/2010/11/22/tumblelog-101122/#comments</comments>
		<pubDate>Mon, 22 Nov 2010 06:00:17 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1157</guid>
		<description><![CDATA[Data Structures and Algorithms with Object-Oriented Design Patterns in Python, learn algorithms and ADTs in Python by reading this online book. C++ Templates: The Complete Guide, like the title says it is a complete guide to C++ templates. Dynamic Re-compilation of Binary RISC Code for CISC Architectures, this is the thesis of the venerable Michael [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Data Structures and Algorithms with Object-Oriented Design Patterns in Python" href="http://www.brpreiss.com/books/opus7/html/book.html">Data Structures and Algorithms with Object-Oriented Design Patterns in Python</a>, learn algorithms and ADTs in Python by reading this online book.</p>
<p><a title="C++ Templates: The Complete Guide" href="http://codeidol.com/cpp/cpp-templates/">C++ Templates: The Complete Guide</a>, like the title says it is a complete guide to C++ templates.</p>
<div id="attachment_1184" class="wp-caption alignnone" style="width: 499px"><a href="http://frozenly.com/2009/12/flying-bridge/"><img class="size-full wp-image-1184" title="Flying Bridge" src="http://www.dholm.com/wp-content/uploads/2010/10/flying_bridge.jpeg" alt="" width="489" height="305" /></a><p class="wp-caption-text">Flying Bridge</p></div>
<p><a title="Dynamic Re-compilation of Binary RISC Code for CISC Architectures" href="http://softpear.sourceforge.net/down/steil-recompilation.pdf">Dynamic Re-compilation of Binary RISC Code for CISC Architectures</a>, this is the thesis of the venerable Michael Steil on dynamic binary translation.</p>
<p><a title="x86 Instruction Set Reference" href="http://siyobik.info/index.php?module=x86">x86 Instruction Set Reference</a>, <a title="80386 Programmer's Reference Manual" href="http://www.fermi.mn.it/linux/quarta/x86/index.htm">80386 Programmer&#8217;s Reference Manual</a> and the <a title="X86 Opcode and Instruction Reference" href="http://ref.x86asm.net/">X86 Opcode and Instruction Reference</a>, these references are not as cumbersome to open as the offical Intel PDFs.</p>
<p><a title="CUDA, Supercomputing for the Masses: Part 1" href="http://www.drdobbs.com/high-performance-computing/207200659">CUDA, Supercomputing for the Masses: Part 1</a>, a very long running series of articles on nVidia CUDA by Rob Farber.</p>
<p><a title="A Brief Introduction to Rvalue References" href="http://www.artima.com/cppsource/rvalue.html">A Brief Introduction to Rvalue References</a>, C++0x introduces rvalue references and this is an explanation of how they work and why we need to extend references.</p>
<p><a title="OpenFst Library" href="http://www.openfst.org/">OpenFst Library</a>, build finite state transducers using C++ templates.</p>
<p><a title="Hg Init: a Mercurial Tutorial by Joel Spolsky" href="http://hginit.com/">Hg Init: a Mercurial Tutorial by Joel Spolsky</a>, as he has become a born again DVCS proponent Joel put together this awesome tutorial on mercurial.</p>
<p><a title="PoCC: the Polyhedral Compiler Collection" href="http://www-roc.inria.fr/~pouchet/software/pocc/">PoCC: the Polyhedral Compiler Collection</a>, is a compiler collection implementing the polyhedral model.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/11/22/tumblelog-101122/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tumblelog 101108</title>
		<link>http://www.dholm.com/2010/11/08/tumblelog-101108/</link>
		<comments>http://www.dholm.com/2010/11/08/tumblelog-101108/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 06:00:49 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1131</guid>
		<description><![CDATA[Wonders of Math &#8211; The Game of Life, learn the basic rules of the game of life. How to Write an Operating System, a simple and basic introduction to writing an operating system kernel. Miniature Art on the Tip of Pencil by Dalton Ghetti, amazing art sculpted on the tips of pencils. Rare IBM M15 [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Wonders of Math - The Game of Life" href="http://www.math.com/students/wonders/life/life.html">Wonders of Math &#8211; The Game of Life</a>, learn the basic rules of the game of life.</p>
<p><a title="How to Write an Operating System" href="http://www.acm.uiuc.edu/sigops/roll_your_own/">How to Write an Operating System</a>, a simple and basic introduction to writing an operating system kernel.</p>
<div id="attachment_1177" class="wp-caption alignnone" style="width: 510px"><a href="http://www.maximumpc.com/article/news/motherboard_city_model_full_awesome"><img class="size-full wp-image-1177" title="Motherboard City" src="http://www.dholm.com/wp-content/uploads/2010/10/Motherboard_City_Big.jpg" alt="" width="500" /></a><p class="wp-caption-text">Motherboard City</p></div>
<p><a title="Miniature Art on the Tip of Pencil by Dalton Ghetti" href="http://oddstuffmagazine.com/extraordinary-art-on-pencil-tips-by-dalton-ghetti.html">Miniature Art on the Tip of Pencil by Dalton Ghetti</a>, amazing art sculpted on the tips of pencils.</p>
<p><a title="Rare IBM M15 split ergonomic keyboard hits eBay, bidding war pushes it over $1600" href="http://www.geek.com/articles/chips/ibm-m15-split-ergonomic-keyboard-hits-ebay-bidding-war-2010101/">Rare IBM M15 split ergonomic keyboard hits eBay, bidding war pushes it over $1600</a>, this is one piece of computer history that landed on eBay. A buckling spring, ergonomic and foldable IBM keyboard.</p>
<p><a title="Einstein for Everyone" href="http://www.pitt.edu/~jdnorton/teaching/HPS_0410/chapters/index.html">Einstein for Everyone</a>, if you want to understand Einstein&#8217;s work but feel you do not know the basics of the physics supporting it.</p>
<p><a title="A Git User's Guide to Mercurial Queues" href="http://stevelosh.com/blog/2010/08/a-git-users-guide-to-mercurial-queues/">A Git User&#8217;s Guide to Mercurial Queues</a>, understand how Mercurial queues work and how they compare to git.</p>
<p><a title="Homebrew Cray-1A" href="http://chrisfenton.com/homebrew-cray-1a/">Homebrew Cray-1A</a>, a miniature fully working Cray-1A implemented in an FPGA.</p>
<p><a title="A Dynamically Recompiling ARM Emulator" href="http://www.davidsharp.com/tarmac/tarmacreport.pdf">A Dynamically Recompiling ARM Emulator</a>, is a very nice project report on how to implement a binary translator for running ARM code on an x86.</p>
<p><a title="InteLib" href="http://www.intelib.org/">InteLib</a>, will enable you to code Lisp S-expressions in C++.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/11/08/tumblelog-101108/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tumblelog 101025</title>
		<link>http://www.dholm.com/2010/10/25/tumblelog-10102/</link>
		<comments>http://www.dholm.com/2010/10/25/tumblelog-10102/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 06:00:02 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1083</guid>
		<description><![CDATA[CLiki, the definitive Common Lisp wiki. Some AI Koans, from the MIT AI Lab. Royal Precision Electronic Computer LGP-30 Programming Manual, the very same machine mastered by Mel, the worlds greatest programmer. zzuf, is a deterministic input fuzzer which can be used as a tool to discover bugs in applications. www.Visual6502.org, provides a visual simulation [...]]]></description>
			<content:encoded><![CDATA[<p><a title="CLiki" href="http://www.cliki.net/index">CLiki</a>, the definitive Common Lisp wiki.</p>
<p><a title="Some AI Koans" href="http://www.catb.org/~esr/jargon/html/koans.html">Some AI Koans</a>, from the MIT AI Lab.</p>
<div id="attachment_1135" class="wp-caption alignnone" style="width: 410px"><a href="http://www.threadless.com/submission/285917/Monster_in_the_closet"><img class="size-full wp-image-1135" title="Monster in the closet by EPalacios" src="http://www.dholm.com/wp-content/uploads/2010/09/Monster-in-the-closet.jpg" alt="" width="400" /></a><p class="wp-caption-text">Monster in the closet by EPalacios</p></div>
<p><a title="Royal Precision Electronic Computer LGP-30 Programming Manual" href="http://ed-thelen.org/comp-hist/lgp-30-man.html">Royal Precision Electronic Computer LGP-30 Programming Manual</a>, the very same machine mastered by Mel, the worlds greatest programmer.</p>
<p><a title="zzuf" href="http://caca.zoy.org/wiki/zzuf">zzuf</a>, is a deterministic input fuzzer which can be used as a tool to discover bugs in applications.</p>
<p><a title="www.Visual6502.org" href="http://www.visual6502.org/">www.Visual6502.org</a>, provides a visual simulation of a running MOS 6502 at the transistor level using HTML5.</p>
<p><a title="Programming in Emacs Lisp" href="http://www.rattlesnake.com/intro/index.html">Programming in Emacs Lisp</a>, a complete guide to getting started with programming in Emacs Lisp.</p>
<p><a title="Fuel Injector information &amp; Specifications specs" href="http://www.robietherobot.com/storm/fuelinjectorguide.htm">Fuel Injector information &amp; Specifications specs</a>, a comprehensive guide to different types of fuel injectors and their pros and cons.</p>
<p><a title="C++ Exceptions: Pros and Cons" href="http://www.codeproject.com/KB/cpp/cppexceptionsproetcontra.aspx">C++ Exceptions: Pros and Cons</a>, provides an in-depth analysis of the use of exceptions in C++ and why or why not you should use them in your project.</p>
<p><a title="Expressive C++: Why Template Errors Suck and What You Can Do About It" href="http://cpp-next.com/archive/2010/09/expressive-c-why-template-errors-suck-and-what-you-can-do-about-it/">Expressive C++: Why Template Errors Suck and What You Can Do About It</a>, presents several valid techniques for improving error reporting when using templates.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/10/25/tumblelog-10102/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tumblelog 101011</title>
		<link>http://www.dholm.com/2010/10/11/tumblelog-101011/</link>
		<comments>http://www.dholm.com/2010/10/11/tumblelog-101011/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 06:00:59 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Tumblelog]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1065</guid>
		<description><![CDATA[Autodependencies with GNU make, leverage the GCC dependency calculation feature to automatically provide you with dependency chains for your makefiles. Signals and Systems, a Wikibook on engineering signals and systems. This is a good starting place if you, for instance, want to start out in the DSP world. American and British english differences, understand the [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Autodependencies with GNU make" href="http://scottmcpeak.com/autodepend/autodepend.html">Autodependencies with GNU make</a>, leverage the GCC dependency calculation feature to automatically provide you with dependency chains for your makefiles.</p>
<p><a title="Signals and Systems" href="http://en.wikibooks.org/wiki/Signals_and_Systems">Signals and Systems</a>, a Wikibook on engineering signals and systems. This is a good starting place if you, for instance, want to start out in the DSP world.</p>
<div id="attachment_1122" class="wp-caption alignnone" style="width: 610px"><a href="http://www.smashingmagazine.com/2010/06/06/designing-the-world-of-programming-infographic/"><img class="size-full wp-image-1122" title="The World of Programming by Adit Gupta" src="http://www.dholm.com/wp-content/uploads/2010/10/aboutprogramming04.jpg" alt="" width="600" /></a><p class="wp-caption-text">The World of Programming by Adit Gupta</p></div>
<p><a title="American and British english differences" href="http://en.wikipedia.org/wiki/American_and_British_English_differences">American and British english differences</a>, understand the differences in these two languages before deciding which one is more suitable for your writing style.</p>
<p><a title="SSE Performance Programming" href="http://developer.apple.com/hardwaredrivers/ve/sse.html">SSE Performance Programming</a>, guides you through the intricacies of SSE programming and the differences between it and AltiVec.</p>
<p><a title="Data alignment: Straighten up and fly right" href="http://www.ibm.com/developerworks/library/pa-dalign/">Data alignment: Straighten up and fly right</a>, teaches why and how to properly align data in memory.</p>
<p><a title="Labor of Division (Episode I)" href="http://ridiculousfish.com/blog/archives/2010/02/15/labor-of-division-episode-1/#fish_made_a_mess">Labor of Division (Episode I)</a>, division isn&#8217;t always as simple for the CPU as one might expect.</p>
<p><a title="Prex" href="http://prex.sourceforge.net/">Prex</a>, a portable realtime microkernel for embedded systems released under a BSD license.</p>
<p><a title="Stockfish Chess Engine" href="http://www.stockfishchess.com/">Stockfish Chess Engine</a>, a very powerful open source chess engine.</p>
<p><a title="Gambit Scheme" href="http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php/Main_Page">Gambit Scheme</a>, a portable implementation of Scheme which allows you to compile Scheme into C-code.</p>
<p><a title="The Computer History Simulation Project" href="http://simh.trailing-edge.com/">The Computer History Simulation Project</a>, provides a simulator capable of simulation such machines as the DEC PDP-10, IBM System 3 and MITS Altair 3000 among others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/10/11/tumblelog-101011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Binding C++ to Lua, Part 3; Pushing C++ Objects to Lua</title>
		<link>http://www.dholm.com/2010/10/07/binding-c-to-lua-part-3/</link>
		<comments>http://www.dholm.com/2010/10/07/binding-c-to-lua-part-3/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 11:50:13 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1006</guid>
		<description><![CDATA[Part 3 of my Lua C++ binding series has been 95% ready for several months now and I finally got around to finished the last five percent. In this part I will add code which enables us to return a class instance usable from Lua as a value from a method or function call. By [...]]]></description>
			<content:encoded><![CDATA[<p><em>Part 3 of my Lua C++ binding series has been 95% ready for several months now and I finally got around to finished the last five percent.</em></p>
<p>In this part I will add code which enables us to return a class instance usable from Lua as a value from a method or function call. By calling the static member <em>push</em> we can put objects onto Lua&#8217;s stack (see section <a title="3.1 - The Stack" href="http://www.lua.org/manual/5.1/manual.html#3.1">3.1 &#8211; The Stack</a> in the Lua reference manual).</p>
<p>First we need to rewrite our garbage collection code so that it is able to differentiate between objects that are managed by Lua and objects that are deleted elsewhere. We will control this by adding a new field to our class instance metatable called &#8220;<em>unmanaged</em>&#8220;. If the metatable has the unmanaged field we will not delete the C++ object instance when Lua is executing its garbage collector.</p>
<pre>static int gcT(lua_State* l) {
    if (luaL_getmetafield(l, 1, "unmanaged")) {
        lua_pushvalue(l, 1);
        lua_gettable(l, -2);
        if (!lua_isnil(l, -1)) {
            return 0;
        }
    }

    Userdata* ud = reinterpret_cast(lua_touserdata(l, 1));
    T* obj = ud-&gt;pT;
    delete obj;
    return 0;
}</pre>
<p>The <em>allocUserdata</em> allocates room for a light userdata item in the specified table of the specified size and returns a pointer to the data region. Light userdata is a pointer to a C object stored in Lua and we use it to store the pointer to our object instance.</p>
<pre>static Userdata* allocUserdata(lua_State* l, Index table, void* key, std::size_t size) {
    Userdata* userdata = NULL;
    lua_pushlightuserdata(l, key);
    lua_gettable(l, table);
    if (lua_isnil(l, -1)) {
        lua_pop(l, 1);
        lua_checkstack(l, 3);
        userdata = reinterpret_cast&lt;Userdata*&gt;(lua_newuserdata(l, size));
        lua_pushlightuserdata(l, key);
        lua_pushvalue(l, -2);
        lua_settable(l, -4);
    }
    return userdata;
}</pre>
<p>Weak tables are tables who reference data that is not to be garbace collected by Lua and they are explained in section <a title="2.10.2 - Weak Tables" href="http://www.lua.org/manual/5.1/manual.html#2.10.2">2.10.2</a> of the reference manual. The mode of the weak table defines whether the key, value or both are to be considered weak and protected from collection.</p>
<pre>static void weaktable(lua_State* l, const char* mode) {
    lua_newtable(l);
    lua_pushvalue(l, -1);
    lua_setmetatable(l, -2);
    lua_pushliteral(l, "__mode");</pre>
<p>The mode field is a string literal whose values are defined in section 2.10.2 of the Lua reference manual.</p>
<pre>    lua_pushstring(l, mode);
    lua_settable(l, -3);
}</pre>
<p>A subtable to the metatable of our object is used to store the mode setting for garbage collection.</p>
<pre>static void subtable(lua_State* l, Index metatable, const char* name, const char* mode) {
    lua_pushstring(l, name);
    lua_gettable(l, metatable);
    if (lua_isnil(l, -1)) {
        lua_pop(l, 1);</pre>
<p>If the table hasn&#8217;t been defined we create a new one otherwise we just reuse the old one.</p>
<pre>        lua_checkstack(l, 3);
        weaktable(l, mode);</pre>
<p>Three spaces are allocated on the stack and we put a weak table with the specified mode parameter on the first position.</p>
<pre>        lua_pushstring(l, name);
        lua_pushvalue(l, -2);
        lua_settable(l, metatable);</pre>
<p>Finally we set <em>metatable[name] = weaktable</em> so that our garbage collection setting is associated with the object instance.</p>
<pre>    }
}</pre>
<p>Now we have the necessary methods we need so let&#8217;s move on to the meat of it all, the <em>push</em> method.</p>
<pre>static Index push(lua_State* l, T* instance, bool gc = false) {
    if (!instance) {
        lua_pushnil(l);
        return 0;
    }</pre>
<p>First we add a safety measure so that if a NULL instance is pushed we put a nil on Lua&#8217;s stack.</p>
<pre>    luaL_getmetatable(l, T::s_lunaClassName);
    if (lua_isnil(l, -1)) {
        luaL_error(l, "[Luna::%s] Class %s has not been commited!", __func__, T::s_lunaClassName);
        return 0;
    }
    Index metatable = lua_gettop(l);</pre>
<p>Next we attempt to locate the metatable (the implementation) for the class type that we are going to push. If that particular class hasn&#8217;t been registered with Lua we raise an error.</p>
<pre>    subtable(l, metatable, "userdata", "v");</pre>
<p>Since we now have the metatable defining the class API we need to create a subtable to hold the user data (the instance pointer) which we can put on the stack and that makes sense to Lua.</p>
<pre>    Userdata* userdata = allocUserdata(l, metatable, instance, sizeof(Userdata));</pre>
<p><em>allocUserdata</em> allocates an entry in <em>metatable[instance]</em> to hold a <em>userdata</em> (see <a title="2.2 - Values and Types" href="http://www.lua.org/manual/5.1/manual.html#2.2">2.2 &#8211; Values and Types</a>) instance for us to store the object instance pointer in.</p>
<p>Now we move on to the final part of the process which is to associate the object instance table with the class definition table and set the appropriate memory management type.</p>
<pre>    if (userdata) {
        userdata-&gt;pT = instance;
        lua_pushvalue(l, metatable);
        lua_setmetatable(l, -2);</pre>
<p>Here we push the class definition (var: <em>metatable</em>) onto the stack and associate the element at <em>stack[-2]</em> (which happens to be our userdata subtable) with it.</p>
<pre>        if (!gc) {
            lua_checkstack(l, 3);
            subtable(l, metatable, "unmanaged", "k");
            lua_pushvalue(l, -2)
            lua_pushboolean(l, 1);
            lua_settable(l, -3);
            lua_pop(l, 1);
        }</pre>
<p>If we push the object instance with garbage collection disabled we have to add the &#8220;<em>unmanaged</em>&#8221; subtable that we talked about when we implemented the new garbage collector which acts as a tag to inform it that the object instance should not be automatically garbage collected (i.e. someone has to call <em>delete</em> on it from C++).</p>
<pre>    }
    lua_replace(l, metatable);
    lua_settop(l, metatable);
    return metatable;
}</pre>
<p>Finally we replace the old metatable with our modified one containing the object instance, reset the stack and then returns the index of our metatable so that Lua knows where we put the object instance.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/10/07/binding-c-to-lua-part-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft .net vs Java Trailer</title>
		<link>http://www.dholm.com/2010/10/03/microsoft-net-vs-java-trailer/</link>
		<comments>http://www.dholm.com/2010/10/03/microsoft-net-vs-java-trailer/#comments</comments>
		<pubDate>Sun, 03 Oct 2010 18:34:30 +0000</pubDate>
		<dc:creator>dholm</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.dholm.com/?p=1132</guid>
		<description><![CDATA[http://www.youtube.com/watch?v=H7QVITAWdBQ A really funny norwegian Java trailer.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=H7QVITAWdBQ">http://www.youtube.com/watch?v=H7QVITAWdBQ</a></p>
<p>A really funny norwegian Java trailer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dholm.com/2010/10/03/microsoft-net-vs-java-trailer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 0.927 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-05 20:00:52 -->

