<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/1.5.2" -->
<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/"
>

<channel>
	<title>fdiv.net</title>
	<link>http://fdiv.net</link>
	<description>the floating point divide</description>
	<pubDate>Wed, 30 Jul 2008 17:51:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5.2</generator>
	<language>en</language>

		<item>
		<title>Apple Mail Hack: Move Message To Sent Folder</title>
		<link>http://fdiv.net/2008/04/20/apple-mail-hack-move-message-to-sent-folder/</link>
		<comments>http://fdiv.net/2008/04/20/apple-mail-hack-move-message-to-sent-folder/#comments</comments>
		<pubDate>Sun, 20 Apr 2008 14:43:27 +0000</pubDate>
		<dc:creator>smokris</dc:creator>
		
	<category>Apple</category>
	<category>Not Apple</category>
	<category>Software Development</category>
		<guid>http://fdiv.net/2008/04/20/apple-mail-hack-move-message-to-sent-folder/</guid>
		<description><![CDATA[	In the year that has elapsed since I failed to explain why I was using PINE for email, I&#8217;ve switched to Apple Mail.  Don&#8217;t ask.
	Well, it&#8217;s been alright, but much to my regret the improved latency due to keystrokes only traveling around my local machine &#8212; instead of through the interweb and back as [...]]]></description>
			<content:encoded><![CDATA[	<p><img style="background-color: #808080" align="right" src="http://img.b33p.net/pub/bMIYbDwt8DlYjnZCp4wFZ7KxnbSr1o7L" alt="Apple Mail Icon" />In the year that has elapsed since I <a href="http://fdiv.net/2007/05/12/keybindings-in-macosx-terminal-app/">failed to explain</a> why I was using PINE for email, I&#8217;ve switched to <a href="http://www.apple.com/macosx/features/mail.html">Apple Mail</a>.  Don&#8217;t ask.</p>
	<p>Well, it&#8217;s been alright, but much to my regret the improved latency due to keystrokes only traveling around my local machine &#8212; instead of through the interweb and back as was the case with PINE on a remote machine &#8212; makes it almost justifiable.  Almost.<br />
<a id="more-124"></a></p>
	<p>Apple Mail makes it really easy to delete messages.  You just press the &#8220;Delete&#8221; button.  Poof.</p>
	<p>Apple Mail, however, makes it a lot more difficult to SAVE messages.  You have to go to the &#8220;Message&#8221; menu, then select &#8220;Move To&#8221;, then select the mailbox you want to save it in.  Or use the mouse to drag-and-drop it into your mailbox of choice.  But this is not acceptable as using the mouse depletes one&#8217;s indie cred even more than simply using a GUI mail client in the first place.</p>
	<p>So, armed with <a href="http://www.bazza.com/~eaganj/weblog/2008/02/16/demystifying-mailapp-plugins-for-leopard/">James Eagan&#8217;s article on writing mailbundles</a> I wrote a hack which adds a menu item, complete with keyboard shortcut, allowing the user to easily and quickly file one or more messages away in the &#8220;Sent&#8221; folder (*).  See here:</p>
	<p><img align="right" src="http://img.b33p.net/pub/9uPTamngrrI4UzA_STkwRLK0tdJ4o0Rn" alt="Move to Sent Menu Screenshot" /></p>
	<p>(*) Since switching to Apple Mail &#8212; and having access to its nifty and swift full-text search capabilities &#8212; I&#8217;ve abandoned the thousand-or-so individual folders in which I used to file things away.  Mail in my Inbox now goes to one of two destinations:  <i>Trash</i>, for spam and automatic notifications and other stuff I have no interest in ever looking at again, or <i>Sent</i>, for anything written by a human and on occasion important things written by computers.</p>
	<p>Download <a href="http://softpixel.com/~smokris/widgets/appleMail/MoveMessageToSentFolder-1.0.zip">MoveMessageToSentFolder-1.0.zip</a>.<br />
Leopard (Mac OS X 10.5) only.</p>
	<p>To install:</p>
	<ul>
	<li>Copy the mailbundle to <code>~/Library/Mail/Bundles</code>.  Create this folder if it doesn&#8217;t already exist.</li>
	<li>Open Terminal and run the following commands to enable mailbundle support:
	<pre>
defaults write com.apple.mail EnableBundles 1
defaults write com.apple.mail BundleCompatibilityVersion 3
</pre>
	</li>
	</ul>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2008/04/20/apple-mail-hack-move-message-to-sent-folder/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Is Smaller Better?</title>
		<link>http://fdiv.net/2008/02/03/is-smaller-better/</link>
		<comments>http://fdiv.net/2008/02/03/is-smaller-better/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 03:39:07 +0000</pubDate>
		<dc:creator>mradcliffe</dc:creator>
		
	<category>Social Story</category>
	<category>Antisocial Story</category>
	<category>Apple</category>
	<category>Not Apple</category>
		<guid>http://fdiv.net/2008/02/03/is-smaller-better/</guid>
		<description><![CDATA[	
	In the past couple of months I thought about spending some money on either a Nintendo Wii or a multi-purpose media box (not to mention my anxiety over buying an unmodifiable blackbook).  Over the past 3 years I&#8217;ve looked at smaller cases as &#8220;better&#8221;.  Before that it was always the full tower case [...]]]></description>
			<content:encoded><![CDATA[	<div style="float: right; padding: 5px;"><img src="http://softpixel.com/~mradcliffe/images/epia_ex.png" border="0" alt="Epia EX small"/></div>
	<p>In the past couple of months I thought about spending some money on either a <a href="http://wii.nintendo.com">Nintendo Wii</a> or a multi-purpose media box (not to mention my anxiety over buying an unmodifiable <a href="http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?ncto=MacBook&#038;aa=6E1BC8D9&#038;mco=6E1BC8D9">blackbook</a>).  Over the past 3 years I&#8217;ve looked at smaller cases as &#8220;better&#8221;.  Before that it was always the full tower case that provided more room and ease-of-use.  In this vein I&#8217;ve been looking at the world of <a href="http://en.wikipedia.org/wiki/Mini_itx">mini-itx</a> for the past several months.</p>
	<p>VIA created the mini-itx specification for itself, but since its creation other companies started creating motherboards with this spec and recently so has <a href="http://www.intel.com">Intel</a>.  The spec allows for a low-power consumption CPU, which is great for point-of-sales machines, thin clients, and more.  The other use of mini-itx, popular amongst personal users, is as a <a href="http://en.wikipedia.org/wiki/Htpc">Home Theater PC</a> (HTPC) or media center.</p>
	<p><a id="more-116"></a></p>
	<div style="float: left; padding: 5px;"><img src="http://softpixel.com/~mradcliffe/images/xbmc.png"/></div>
	<p>There are several solutions available in this market.  By far the most popular media box in the past few years has been a Microsoft product, the <a href="http://www.xbox.com">XBox</a>.  You can slap on an open source GPL media player onto the xbox - <a href="http://www.xboxmediacenter.com">XBox Media Center</a> (XBMC).  This was great as a video, audio, and game machine for dvds, mpeg4 (xvid), and various audio formats.</p>
	<div style="float: right; padding: 5px;"><img src="http://softpixel.com/~mradcliffe/images/appletv.png"/></div>
	<p>Alternatively <a href="http://www.apple.com">Apple</a> sells the <a href="http://www.apple.com/appletv/">Apple TV</a>, which not only plays movies, but can connect to your shared ITunes library.  However as with many things Apple (and not-Apple) it has limited uses even with the <a href="http://www.engadget.com/2007/03/23/apple-tv-reportedly-hacked-for-xvid-support/">hack</a> to allow xvid and DivX support.  <i>Author&#8217;s Note: I first wrote this before Mac World Expo January 2008.</i></p>
	<p>The two products mentioned above are limited by their age.  Both are not powerful enough to decode h.264 matroska encapsulated video or HDMI video input.  This is the problem.  Would I be able to build a mini-itx machine capable of doing what these once-awesome products do not?  My requirement was pretty simple.  I&#8217;ve dealt with TV Tuners and HDTV before, and I&#8217;m not interested in building a true &#8220;HTPC&#8221; or personal video recorder (PVR).  That ship has sailed.  Not to mention all the hullaboo about DRM in bluray/hd-dvd, hd capable monitors, video cards, etc&#8230;</p>
	<p>After investigating hardware articles and reviews of the boards on <a href="http://www.mini-itx.com">mini-itx.com</a> I narrowed down my search to the <a href="http://www.via.com.tw/en/products/mainboards/motherboards.jsp?motherboard_id=450">VIA Epia EX 15000G</a>.  This newer board offered a &#8220;fast&#8221; 1.8ghz VIA C7 processor.  A PCI slot would take care of a wireless card as I wouldn&#8217;t be dragging cat5 down from the router upstairs to the TV.  It seemed to offer everything that I was looking for.  It even had an on-board graphics chip with a mpeg2/mpeg4 hardware decoder though underpowered in 3d acceleration!</p>
	<p>The VIA Epia boards are also highly compatible in linux so that&#8217;s a plus.  I delved deeper.  I wanted to make sure that this board would suffice.  After all I&#8217;ve never touched a processor other than AMD or Intel.</p>
	<p>However I&#8217;m afraid to say that the Unichrome Pro II mpeg2/mpeg4 hardware decoder is not usable at the current time.  There have been <a href="http://forums.viaarena.com/messageview.aspx?catid=32&#038;threadid=77918&#038;highlight_key=y&#038;keyword1=h.264">numerous</a> <a href="http://forums.viaarena.com/messageview.aspx?catid=32&#038;threadid=69894&#038;highlight_key=y&#038;keyword1=h264">complaints</a> that hardware decoding doesn&#8217;t work for .mkv files and even in Windows!  Surprisingly the only h.264 playback possible was in <a href="http://www.kernel.org">linux</a> with the now seemingly defunct <a href="http://sourceforge.net/projects/vemp">Via enhanced MPlayer</a>.</p>
	<p>This was the nail in the coffin.  I&#8217;m not going to buy a board because it *may* work in linux with the supposed mpeg4 hw decoding support (and not at all in Windows).  What does this leave us with?  Software decoding?  The C7 processor is not powerful enough to decode 720p let alone 1080p content.</p>
	<p>The cost of this machine and project will significantly increase switching from a mini-itx C7 processor board to perhaps an intel mini-itx core 2 duo mobile board or switch to micro-atx (about $150-$200 increase in budget with a core 2 duo mobile or desktop).</p>
	<p>The smallest really isn&#8217;t better.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2008/02/03/is-smaller-better/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Zero Grams of Trans Fat Binaries</title>
		<link>http://fdiv.net/2007/12/19/zero-grams-of-trans-fat-binaries/</link>
		<comments>http://fdiv.net/2007/12/19/zero-grams-of-trans-fat-binaries/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 05:36:15 +0000</pubDate>
		<dc:creator>cwright</dc:creator>
		
	<category>Antisocial Story</category>
	<category>Apple</category>
	<category>Not Apple</category>
	<category>Software Development</category>
	<category>Kosada</category>
		<guid>http://fdiv.net/2007/12/19/zero-grams-of-trans-fat-binaries/</guid>
		<description><![CDATA[	People like their applications to work.  Even better, they like them to work, even when things change.  For the WinTel world, this isn&#8217;t a big deal (Vista aside ;), because the underlying CPU architecture hasn&#8217;t really changed, from a program&#8217;s point of view, in the past two decades.  Unless you have a [...]]]></description>
			<content:encoded><![CDATA[	<p><img align="right" src="http://img.b33p.net/pub/ywiHvPcTv8ZWhWv6nf-AHhne2GUlkx99/png-indexed-64" alt="tons of xcode build targets" />People like their applications to work.  Even better, they like them to work, even when things change.  For the WinTel world, this isn&#8217;t a big deal (Vista aside ;), because the underlying CPU architecture hasn&#8217;t really changed, from a program&#8217;s point of view, in the past two decades.  Unless you have a weird program that&#8217;s designed for AMD&#8217;s 3DNow! instruction set and you switch to an Intel CPU, or perhaps an application designed for a more esoteric old SIMD architecture, your application should run just fine (as long as your Operating System is ok with it).</p>
	<p>Mac OS X doesn&#8217;t have the luxury of working on the same underlying CPU though, so things need to be handled a little bit differently.  The solution Apple came up with was <a id="more-115"></a>the idea of a &#8220;Fat&#8221; binary, sometimes called a &#8220;Universal Binary&#8221;.  In other words, instead of a single program being contained in a program file, the program file can contain several programs for different architectures.  For example:</p>
	<pre class="code">
cwright@phendrana:~>file /bin/ls
/bin/ls: Mach-O universal binary with 2 architectures
/bin/ls (for architecture i386):	Mach-O executable i386
/bin/ls (for architecture ppc7400):	Mach-O executable ppc
</pre>
	<p>or an even more convoluted example:</p>
	<pre class="code">
cwright@phendrana:~>file GLTools
GLTools: Mach-O universal binary with 4 architectures
GLTools (for architecture ppc7400):	Mach-O bundle ppc
GLTools (for architecture i386):	Mach-O bundle i386
GLTools (for architecture ppc64):	Mach-O 64-bit bundle ppc64
GLTools (for architecture x86_64):	Mach-O 64-bit bundle x86_64
</pre>
	<p>This increases file size considerably (4x in the last example), but it provides you with the cool side effect of being able to drop the exact same program onto a PowerPC Mac, and have it operate identically &#8212; as long as you&#8217;re properly handling architectural differences such as <a href="http://en.wikipedia.org/wiki/Endianness">endianness</a>.  Overall, this is a pretty slick solution, and with the exception of a few small tweaks, I doubt I could have come up with a better idea.  (The small tweaks, in case you&#8217;re wondering, would be shared data segments across the binaries inside, such that non-code stuff only needs to be included once, instead of 4 times.  This doesn&#8217;t work well when the data contains code though, so you&#8217;d need to have flags to control how it operates).</p>
	<p>One of many problems rears its ugly head though when developing such portable applications:  Linking with static and dynamic libraries.</p>
	<p>Out of the box, OS X ships with many libraries that are all appropriately compiled to support all the above architectures, so you never notice this problem when compiling against standard included libraries.  However, if you stray off the beaten path, and use another library, you&#8217;re destined for trouble.  Open Source libraries, especially the ones whose build system depends on the monstrosity that is <a href="http://en.wikipedia.org/wiki/Autoconf">AutoConf</a> (<code>./configure</code> scripts and all that), are surprisingly difficult to get working.  In part, because they&#8217;re not designed to be built for multiple architectures in parallel, and in part because AutoConf is infuriatingly worthless when it comes to documentation.</p>
	<p>Of course, since I&#8217;m writing all of this, I&#8217;m obviously in the middle of such a battle :)</p>
	<p>By default, I run configure like this: </p>
	<pre class="code">
CFLAGS=\"-Os -fomit-frame-pointer\" ./configure [options]
</pre>
	<p>where options is stuff like <code>--enable-shared</code> and other library stuff.  On occasion (only 85% of the time), I also have to override other environment variables because parts like <code>pkg-config</code> don&#8217;t work, because other libraries don&#8217;t install properly, and a whole host of other problems.  I really can&#8217;t believe I actually <i>liked</i> dealing with this crap when I used linux&#8230;  but I digress.</p>
	<p>So first off, I think &#8220;Hey, I can add some magic to the CFLAGS parameter, and it&#8217;ll just compile!&#8221; &#8230; hahaha &#8230; I wish.  Here&#8217;s what happens:</p>
	<pre class="code">
cwright@phendrana:~/Desktop/Recent Source Stuff/libSomeLib-X.Y.Z>CFLAGS=\"-Os -fomit-frame-pointer -arch i386 -arch ppc -arch x86_64 -arch ppc64\" ./configure --enable-shared
</pre>
	<p>Configure does its thing, and then says it&#8217;s done and you&#8217;re ready to build.  It&#8217;s lying, of course:</p>
	<pre class="code">
cwright@phendrana:~/Desktop/Recent Source Stuff/libSomeLib-X.Y.Z>make
make  all-recursive
Making all in libSomeLib
/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I..    -Os -fomit-frame-pointer -arch i386 -arch ppc -arch x86_64 -arch ppc64 -MT io.lo -MD -MP -MF .deps/io.Tpo -c -o io.lo io.c
 gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Os -fomit-frame-pointer -arch i386 -arch ppc -arch x86_64 -arch ppc64 -MT io.lo -MD -MP -MF .deps/io.Tpo -c io.c  -fno-common -DPIC -o .libs/io.o
gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
make[2]: *** [io.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
</pre>
	<p>So, -M options aren&#8217;t allowed to have multiple arch flags, says gcc.  I do some spelunking to find out exactly what these flags do, and find that they&#8217;re for creating Makefile dependencies.  But wait a minute, isn&#8217;t that Configure&#8217;s job?  Man these build tools are awesome. &#8230;  (technically speaking, it <i>is</i> Make&#8217;s job to make this stuff.  There just isn&#8217;t a hook to add architecture support anywhere else without completely re-engineering the build system.)</p>
	<p>Next up, I read some Apple documentation to see how they go about doing it (for stuff like OpenSSL, etc.).  They recommend making a new XCode project, and then making a <a href="http://developer.apple.com/opensource/images/AllTargets.cropped.jpg">zillion build targets</a>, taped together with some <a href="http://developer.apple.com/opensource/images/BuildPPCScript.cropped.jpg">shell scripts</a>.  To be honest, it doesn&#8217;t seem very Apple-like.  If I&#8217;m going to be dealing with shell scripts, I&#8217;ll just do it myself in Terminal.</p>
	<p>The second attempt consists of duplicating the source tree into 4 directories, one for each architecture.  Then, my plan goes, I&#8217;ll use <code>lipo</code> to glue them all together into a fat binary, and I&#8217;ll be on my way.</p>
	<p>I run configure in each directory tree, careful to include only one <code>-arch</code> parameter in each one.  I issue make in the i386, ppc, and x86_64 trees without issue, and start to think a bit smugly to myself that I&#8217;ve defeated this silly monster.  But then, another Configure Dragon charges.</p>
	<pre class="code">
cwright@phendrana:~/Desktop/Recent Source Stuff/libSomeLib-X.Y.Z-ppc64>CFLAGS=\"-Os -fomit-frame-pointer -arch ppc64\" ./configure --enable-shared
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/bin/sh: /Users/cwright/Desktop/Recent: No such file or directory
configure: WARNING: `missing' script is too old or missing
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
</pre>
	<p>Of course, whenever configure tells you to check &#8220;config.log&#8221; for more details, it&#8217;s about as informative as reading a <a href="http://www.thecybersource.com/images/bsod.jpg">Blue Screen</a>.  Also, note the 4th or 5th line, which shows a lack of quoted paths.  That looks safe&#8230;</p>
	<p>The problem, according to configure, is that it &#8220;cannot run C compiled programs,&#8221; which is actually accurate for this case:  Rosette doesn&#8217;t translate ppc64 binaries to x86.  However, gcc can compile such programs, so we know we can do it.  Configure suggests using the &#8220;-<nop />-host&#8221; command.</p>
	<p>Running configure with -<nop />-help reveals how -<nop />-host is supposed to be used.  It&#8217;ll look like this, I suppose:  &#8220;-<nop />-host=ppc64&#8243;.</p>
	<p>It issues this warning, but continues to do its thing:</p>
	<pre class="code">
configure: WARNING: In the future, Autoconf will not detect cross-tools
whose name does not start with the host triplet.  If you think this
configuration is useful to you, please write to autoconf@gnu.org.
</pre>
	<p>I hope that&#8217;s ok.. ?</p>
	<p>I run make, and it builds, and finishes.  A bit earlier than the others.  In the .libs directory, there&#8217;s no .dylib, which is what &#8211;enable-shared is supposed to create.  So, I look at the output from previous builds, and copy the line it inexplicably skips.  It&#8217;s a pretty long, but simple gcc line that takes all the .o&#8217;s and makes them into a .dylib.  No idea why it skipped over that one&#8230;</p>
	<p>And at last, we&#8217;re able to build our fat binary using lipo.  Hurray for portable cross-platform build tools!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2007/12/19/zero-grams-of-trans-fat-binaries/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>fAIL: The Self-Replicating Network Connection</title>
		<link>http://fdiv.net/2007/12/11/fail-the-self-replicating-network-connection/</link>
		<comments>http://fdiv.net/2007/12/11/fail-the-self-replicating-network-connection/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 13:55:03 +0000</pubDate>
		<dc:creator>mradcliffe</dc:creator>
		
	<category>Social Story</category>
	<category>Antisocial Story</category>
	<category>Not Apple</category>
	<category>Kosada</category>
		<guid>http://fdiv.net/2007/12/11/fail-the-self-replicating-network-connection/</guid>
		<description><![CDATA[	


	Good morning gentle readers.  I opened up my craptop this morning to witness the struggles of what seemed to be a laptop battling cancer.  No, this was not another case of opteron cancer.   Instead I found that Windows, unable to cope with my Cisco Aironet 350 wireless card, was creating network [...]]]></description>
			<content:encoded><![CDATA[	<div style="float: right;">
<image src="http://img.b33p.net/pub/z1QUKOctz9KGEcYtr10csyTHjvH40t5I/thumbnail-256" border=0><br />
</image></div>
	<p>Good morning gentle readers.  I opened up my <a href="http://www.lenovo.com/us/en/">craptop</a> this morning to witness the struggles of what seemed to be a laptop battling cancer.  No, this was not another case of <a href="http://fdiv.net/2007/03/20/amd-opteron-dual-core-meltdown/">opteron cancer</a>.   Instead I found that Windows, unable to cope with my <a href="http://www.cisco.com">Cisco</a> Aironet 350 wireless card, was creating network connections one after another in the system tray.</p>
	<p><a id="more-113"></a></p>
	<p>Recently I have been taking out my wireless network card while at work, which used to always reside in my laptop&#8217;s PCMCIA slot.  At the end of the day I&#8217;d plug it back in usually either before or after I had sent my laptop into power save mode.</p>
	<p>So this morning like all mornings I take out my laptop, set it up, open the lid and log in.  Within seconds I notice my system tray bombarded by a new wireless network connection appearing once every second or so, enlarging the system tray beyond its normal size (note the arrow to the far right of the screenshot).  My esteemed colleague <a href="http://softpixel.com/~cwright/">Chris Wright</a> and I were both disappointed that the info bubble did not in fact pop up for each of those connection icons.  Luckily this cancer seemed benign, and within a few seconds Windows realized there actually was only one wireless networking device.</p>
	<div style="text-align: center;">
<img src="http://softpixel.com/~mradcliffe/images/self-replicating-network-connection.png" border=0/>
</div>
	<p>Though it seems this all boils down to the lesson: <b>never mess with an IBM trying to get some sleep</b>.   Whether it&#8217;s not waiting long enough for a print process to get out of the queue causing endless beeping or windows self-replicating wireless network connections, you&#8217;ll face the seemingly impossible behavior of a laptop pushing the boundaries of sanity.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2007/12/11/fail-the-self-replicating-network-connection/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>iPhoto-Thunderbird Bridge</title>
		<link>http://fdiv.net/2007/08/22/iphoto-thunderbird-bridge/</link>
		<comments>http://fdiv.net/2007/08/22/iphoto-thunderbird-bridge/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 11:59:11 +0000</pubDate>
		<dc:creator>cwright</dc:creator>
		
	<category>softpixel</category>
	<category>Apple</category>
	<category>Not Apple</category>
	<category>Software Development</category>
	<category>Photography</category>
	<category>Kosada</category>
		<guid>http://fdiv.net/2007/08/22/iphoto-thunderbird-bridge/</guid>
		<description><![CDATA[	For years, iPhoto users have been stuck using a limited number of email clients to send their photos easily.  This was mostly remedied by the iPhoto Mailer Patcher, but it left out non-applescript aware applications because, after all, iPhoto uses applescript to interface with them.  One of the more notable omissions is Thunderbird.
	Finally, [...]]]></description>
			<content:encoded><![CDATA[	<p><img align="right" alt="iPhoto logo" src="http://img.b33p.net/pub/HK0-oPRuL9-u_9Wz5KxycaakqUdEXdfI" />For years, iPhoto users have been stuck using a limited number of email clients to send their photos easily.  This was mostly remedied by the <a href="http://homepage.mac.com/jacksim/software/imp403.html">iPhoto Mailer Patcher</a>, but it left out non-applescript aware applications because, after all, iPhoto uses applescript to interface with them.  One of the more notable omissions is Thunderbird.</p>
	<p>Finally, this void has also been filled, via the <a href="http://softpixel.com/~cwright/programming/iPhoto/">iPhoto Thunderbird Bridge</a>.  It&#8217;s still quite primitive, but all the basics are there for iPhoto-Thunderbird integration.</p>
	<p>If you&#8217;re an iPhoto/Thunderbird user, give it a whirl.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2007/08/22/iphoto-thunderbird-bridge/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Leaky NSSpeechSynthesizer</title>
		<link>http://fdiv.net/2007/07/23/leaky-nsspeechsynthesizer/</link>
		<comments>http://fdiv.net/2007/07/23/leaky-nsspeechsynthesizer/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 22:34:24 +0000</pubDate>
		<dc:creator>cwright</dc:creator>
		
	<category>Antisocial Story</category>
	<category>Apple</category>
	<category>Not Apple</category>
	<category>Software Development</category>
		<guid>http://fdiv.net/2007/07/23/leaky-nsspeechsynthesizer/</guid>
		<description><![CDATA[	NSSpeechSynthesizer, the Cocoa class responsible for giving applications a voice under OS X, is leaky.  Creating and destroying thousands of instances of this class slowly consumes all the available memory in a system, leading to degrading performance and eventual application instability.
	The disappointing part is that this bug was first noticed almost two years ago. [...]]]></description>
			<content:encoded><![CDATA[	<p>NSSpeechSynthesizer, the Cocoa class responsible for giving applications a voice under OS X, is leaky.  Creating and destroying thousands of instances of this class slowly consumes all the available memory in a system, leading to degrading performance and eventual application instability.</p>
	<p>The disappointing part is that this bug was <a href="http://www.cocoabuilder.com/archive/message/cocoa/2005/12/20/152921">first noticed</a> almost two years ago.  <a id="more-106"></a>While the extent isn&#8217;t nearly as bad, it&#8217;s still not clean.</p>
	<p>This bug came up in our Speech Synthesizer patch for Quartz Composer, featured at <a href="http://kineme.net/QuartzComposerPatches/SpeechSynthesisPatch">kineme</a>.  After much testing, profiling, and refactoring, a splendidly small demonstration program emerged.</p>
	<pre class="code">
#import &lt;Cocoa/Cocoa.h&gt;
	
int main()
{
        while(1)
        {
                NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                NSSpeechSynthesizer *speech = [[NSSpeechSynthesizer alloc] init];
                [speech release];
                [pool release];
        }
	
        return 0;
}
</pre>
	<p>This program endlessly allocates an NSAutoreleasePool, used for memory management,  and then an NSSpeechSynthesizer object.  After creating them, it destroys them.  Destroying the synthesizer object should free any associated memory with the object, and releasing the pool should free up any odds and ends left over, just in case.</p>
	<p>Reality paints a much more disappointing picture:</p>
	<pre class="code">cwright@phendrana:~/projects/SpeechTest>./rapid
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Segmentation fault
</pre>
	<p>It starts off looking ok.  It spins for about 15 seconds or so, but then trouble strikes.  As you an see, the class starts to have difficulty mapping a voice file (this is only mentioned once in all of Google&#8217;s wisdom, with no useful insight as to what it means), and eventually the inevitable crash occurs.</p>
	<p>smokris tried this on his MacBook Pro..  Same thing there:</p>
	<pre class="code">
smokris@etu 6 ~/Desktop -> time ./a.out
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Speech Synthesis can't map voice file (12)
Segmentation fault
	
real    0m4.479s
user    0m0.286s
sys     0m0.153s
</pre>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2007/07/23/leaky-nsspeechsynthesizer/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Project Hayate - Prolonging the Inevitable - Part 1</title>
		<link>http://fdiv.net/2007/05/12/project-hayate-prolonging-the-inevitable-part-1/</link>
		<comments>http://fdiv.net/2007/05/12/project-hayate-prolonging-the-inevitable-part-1/#comments</comments>
		<pubDate>Sun, 13 May 2007 01:42:33 +0000</pubDate>
		<dc:creator>mradcliffe</dc:creator>
		
	<category>Social Story</category>
	<category>Antisocial Story</category>
	<category>Not Apple</category>
		<guid>http://fdiv.net/2007/05/12/project-hayate-prolonging-the-inevitable-part-1/</guid>
		<description><![CDATA[	Author&#8217;s Note: Forgive this preamble I promise that they&#8217;ll be juicy links and google page rank increases in Part 2.
	
	After my October escapade in Boston &#8212; with a brief layover at Yon Reptile Campaign &#8212; Life™ decided to shine a ray of hope in my general direction, after Thanksgiving.  However, quick to grant me [...]]]></description>
			<content:encoded><![CDATA[	<p><i>Author&#8217;s Note: Forgive this preamble I promise that they&#8217;ll be juicy links and google page rank increases in Part 2.</i></p>
	<p><a href="http://softpixel.com/~mradcliffe/images/hayate/harmless.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/harmless_small.jpg" align="right"/></a></p>
	<p>After my October escapade in <a href="http://www.youtube.com/watch?v=nh6k4BggTdk">Boston</a> &#8212; with a brief layover at Yon Reptile Campaign &#8212; <b>Life™</b> decided to shine a ray of hope in my general direction, after Thanksgiving.  However, quick to grant me access to enough income to pay rent, <b>Life™</b> viciously raped my ATI Radeon 9800 Pro, and I was unable to use <a href="http://www.mplayerhq.hu">MPlayer</a> to play movies, use GL to play games, or whatever else we non-Apple people do with our video cards. <a id="more-85"></a> With a hole in my pocket called &#8220;month-to-month&#8221; Harmless lay <i>infected</i> with a Savage 2000 card that I bummed from a co-worker while working for <a href="http://www.chase.com">JP Morgan Chase</a>.  Luckily I began a more permanent presence at Yon Reptile Campaign helping cope with a couple of rambunctious Windows servers, and so I can begin this tale of&#8230;</p>
	<p><font style="font-size: 18px;">&#8220;Project <a href="http://gerbils.servebeer.com">Hayate</a> - Prolonging the Inevitable <a href="http://www.apple.com">Shaving</a> of my <a href="http://www.slackware.org">Metaphorical</a> <a href="http://www.kernel.org">Neckbeard</a>, Part One&#8221;</font></p>
	<p>After a few months of researching I decided that my best choice economically would be to go with an Intel Core 2 Duo 1.83ghz.  However with the Intel price drop on April 22nd I, being the simple-minded consumer that economists &#038; marketing analysts love, bought the new <a href="http://www.intel.com/products/processor/core2duo/specifications.htm">Intel Core 2 Duo e6420 2.13ghz</a> instead.  Not that I needed a 4mb cache anyway.  I quickly found the Gigabyte 965p-DS3 as a relatively compatible motherboard for Linux, purchased 2gb of ddr2-800 from Corsair, a 250gb Western Digital SATA drive, and of course a video card, the XFX Nvidia GeForce 7900 GS PCI-E (so long ATI!).  Although if I had more available funds it would have been best to purchase the latest and greatest of Nvidia 8xxx series, but alas that will have to wait.</p>
	<p><a href="http://softpixel.com/~mradcliffe/images/hayate/the_goods.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/the_goods_small.jpg" align="left"/></a></p>
	<p>I returned from my usual weekly business trip in a state of panic.  <a href="http://www.fedexsucks.com">FedEx</a> no longer requires signature by default, and they had most likely left this precious package on my doorstep where no doubt <b>Life™</b> would have snatched it away and into the hands of some bastard.  Despite the 9:34am &#8220;delivery time&#8221; and confirmation of no package on my doorstep at 10:30am I came home to a package on my doorstep.  My descent into <a href="http://myspaceemosuicidegirl.ytmnd.com/">emo</a> would have to wait for another day.</p>
	<p>I shut down Harmless for the last time, shed a tear of sorrow for the lost, and took its shell (and my BenQ DD DVD Writer :).</p>
	<p>With surprising ease I slipped the new power supply and <a href="http://softpixel.com/~mradcliffe/images/hayate/gigabyte-ds3-mainboard-blurred.jpg">motherboard</a> into the mid-tower case that once housed Harmless.  I made sure to put on one drop of Arctic Silver Thermal Paste, and dabbed it evenly over the clean face of the Core 2.</p>
	<p><a href="http://softpixel.com/~mradcliffe/images/hayate/core2duo-6420-2.13-4ml2.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/core2duo-6420-2.13-4ml2_small.jpg" width="250" /></a> <a href="http://softpixel.com/~mradcliffe/images/hayate/core2duo+arcticsilverpaste.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/core2duo+arcticsilverpaste_small.jpg" width="250" /></a></p>
	<p>It took a few minutes to learn the essentials of Socket LGA775, but I found it much easier than messing with those damn clips from Socket 478.  I was amazed that the Arctic Cooling Freezer 7 Pro Heatsink even fit in the case.  It was a close fit, but damn that&#8217;s hot (no pun intended).</p>
	<p><a href="http://softpixel.com/~mradcliffe/images/hayate/artec-cooling-monster-heatsink-blurred.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/artec-cooling-monster-heatsink-blurred_small.jpg" width="250" /></a> <a href="http://softpixel.com/~mradcliffe/images/hayate/heatsink-view-2.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/heatsink-view-2_small.jpg" width="250" /></a></p>
	<p>And the fan, that&#8217;s hotter.  And fast forward to everything in the case.</p>
	<p><a href="http://softpixel.com/~mradcliffe/images/hayate/artec-cooling-freezer-pro-7.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/artec-cooling-freezer-pro-7_small.jpg" width="250" /></a> <a href="http://softpixel.com/~mradcliffe/images/hayate/almost-done.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/almost-done_small.jpg" width="250" /></a></p>
	<p><a href="http://softpixel.com/~mradcliffe/images/hayate/kernel-bug-yay.jpg"><img src="http://softpixel.com/~mradcliffe/images/hayate/kernel-bug-yay_small.jpg" align="right"/></a><br />
&#8230; I stood flabbergasted.  Was it really that easy?  No, the hard part was yet to come &#8212; full of doubting Slackware, my sanity, aggravating search queries on Google for pages you knew existed, and fun kernel messages like the one to the right.  The night was far from over.  However I&#8217;ll spare you gentle readers until another episode.</p>
	<p>&nbsp;</p>
	<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRSS>http://fdiv.net/2007/05/12/project-hayate-prolonging-the-inevitable-part-1/feed/</wfw:commentRSS>
	</item>
	</channel>
</rss>
