<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.81 (http://www.squarespace.com/) on Thu, 09 Feb 2012 06:51:48 GMT--><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Jan Rychter: Blog [EN]</title><link>http://jan.rychter.com/enblog/</link><description></description><lastBuildDate>Thu, 26 Jan 2012 11:17:55 +0000</lastBuildDate><copyright></copyright><language>en-US</language><generator>Squarespace Site Server v5.11.81 (http://www.squarespace.com/)</generator><item><title>Fixing a Tektronix 2246A oscilloscope</title><dc:creator>Jan Rychter</dc:creator><pubDate>Thu, 26 Jan 2012 11:13:40 +0000</pubDate><link>http://jan.rychter.com/enblog/2012/1/26/fixing-a-tektronix-2246a-oscilloscope.html</link><guid isPermaLink="false">329406:3464523:14739434</guid><description><![CDATA[<p>I bought an (obviously used) Tektronix 2246A oscilloscope at an auction site. It wasn't expensive, it looked fairly good and the seller was nice and provided start-up warranty.</p>

<p>After getting the scope it turned out that channel 3 was dead. Channels 1, 2 and 4 worked fine, but channel 3 would just draw a flat line, no signals registered.</p>

<p>I negotiated a discount deal with the seller and set on to repair the thing. Thank heavens for the extremely detailed service manuals! The manual for the 2246A Mod A wasn't difficult to find. I opened the enclosure and after performing the standard self-test procedures suggested by the manual started following the channel 3 signal path with an old scope I had.</p>

<p><span class="thumbnail-image-float-right ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2FIMG_1971.jpg%3F__SQUARESPACE_CACHEVERSION%3D1327576547673',1530,1920);"><img src="http://jan.rychter.com/storage/thumbnails/3464443-16247288-thumbnail.jpg?__SQUARESPACE_CACHEVERSION=1327576560682" alt=""/></a></span><span class="thumbnail-caption">Tektronix 2246A main board</span></span>I quickly discovered that the input signal was fine right until it entered the preamp IC (U230), a custom Tektronix chip. The inputs were fine, the output was flat. I was rather disappointed, as a failed IC would mean I'd need to find a replacement, which would be neither easy nor inexpensive.</p>

<p>But -- I then supplied the same signal to channel 4 and started comparing the two paths. According to the schematics, they should be identical. When I got to the preamp IC for channel 4, I started comparing the preamp ICs for both channels pin by pin. And… it turned out that the enable signal for U230 wasn't there!</p>

<p><span class="thumbnail-image-float-right ssNonEditable"><span><a href="javascript:showFullImage('/display/ShowImage?imageUrl=%2Fstorage%2FIMG_1968.jpg%3F__SQUARESPACE_CACHEVERSION%3D1327576623606',1435,1920);"><img src="http://jan.rychter.com/storage/thumbnails/3464443-16247296-thumbnail.jpg?__SQUARESPACE_CACHEVERSION=1327576634235" alt=""/></a></span><span class="thumbnail-caption">One of these solder joints is unlike the others...</span></span>The enable signals are generated in the U600 ("slow logic ic") chip, at the back of the main board. This is where things got weird, as the service manual I had diverged from the board I had in front of me. Not sure why, but clearly my main board was very different, with U600 and U602 placed in completely different locations and rotated. But, with some detective work I managed to figure out which chip is the U600 "slow logic ic". And the enable signal for channel 3 preamp was clearly there on the chip's pin. So I started following the signal and bingo! One of the resistors on the CH 3 EN signal path wasn't soldered at all!</p>

<p>Now, I'm not sure how this is possible -- would a cold solder joint produce such an effect? But clearly the connection was broken. Fortunately, this was easily fixable with a soldering iron, and a couple of minutes later I had my scope with all 4 channels working just fine.</p>

<p>Given that I paid about $200 for the scope, I'm quite happy with the end result.</p>

<p>[Posts like this one are written for search engines: one day someone might be looking for repair tips and find this page. I hope it helps someone.]</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-14739434.xml</wfw:commentRss></item><item><title>Making your Targus Bluetooth Presenter actually usable</title><category>mac</category><dc:creator>Jan Rychter</dc:creator><pubDate>Tue, 08 Mar 2011 22:12:11 +0000</pubDate><link>http://jan.rychter.com/enblog/2011/3/8/making-your-targus-bluetooth-presenter-actually-usable.html</link><guid isPermaLink="false">329406:3464523:10714145</guid><description><![CDATA[<p>Here's a tip that will come in useful if you'd like to use a Targus Bluetooth Presenter (AMP11US or AMP11EU) with your Mac.</p>

<p>It seems that the Targus wireless presenter remote (an otherwise nice device) was designed by a committee of morons, none of which actually ever gave any Keynote presentations.</p>

<p>Apparently someone at Targus said that the buttons are supposed to be for "Next Slide" and "Previous Slide", which other people took <em>literally</em>, so the buttons just jump over to the next slide, skipping any builds or transitions that you might have in place. All you can have is flat slides. Goodbye builds, goodbye special effects, goodbye bullet points, goodbye movies. The buttons generate "Shift-CursorDown" and "Shift-CursorUp", forcibly skipping over anything that isn't a full slide.</p>

<p>Am I being unnecessarily harsh calling the designers "morons"? I don't think so. If you design a device whose only purpose is to facilitate presenting, and then you create a version specifically for the Mac (I quote from the Targus web page: "the only wireless presenter dedicated to Mac users") to be used with Keynote — is it too much to ask that you design it so that the two keys on the device actually perform useful functions? I mean, seriously — two keys, next step and previous step, how hard is that?</p>

<p>It's also rather clear that most "reviews" that you can find online are junk and the "reviewers" haven't actually used the device to perform presentations.</p>

<p>Fortunately, there is a solution. There is a small, free utility called <a href="http://pqrs.org/macosx/keyremap4macbook/">KeyRemap4Macbook</a>. Download it, install it (requires a restart), then go into your Mac OS X Preferences, access the KeyRemapper panel, and from within its last settings pane access the private.xml file that stores custom key mappings.</p>

<p>Once you get there, enter the following:</p>

<pre><code>
&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;list&gt;
    &lt;item&gt;
      &lt;name&gt;Targus Wireless Presenter Keynote Fix&lt;/name&gt;
      &lt;identifier&gt;private.targus_wireless_presenter_keynote_fix&lt;/identifier&gt;
      &lt;autogen&gt;--KeyToKey-- KeyCode::CURSOR_DOWN, VK_SHIFT, KeyCode::CURSOR_RIGHT&lt;/autogen&gt;
      &lt;autogen&gt;--KeyToKey-- KeyCode::CURSOR_UP, VK_SHIFT, KeyCode::CURSOR_LEFT&lt;/autogen&gt;
    &lt;/item&gt;
  &lt;/list&gt;
&lt;/root&gt;
</code></pre>

<p>Save the file, go back to the first pane of the KeyRemap configuration and click "Reload XML". You might also want to check the box that says "Don't remap an internal keyboard".</p>

<p>And there you go — what this does is remaps the useless key combinations that the Targus Presenter generates to simple "cursor right" and "cursor left", which do the right thing in Keynote.</p>

<p>Enjoy!</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-10714145.xml</wfw:commentRss></item><item><title>Check your provider's spam reputation before signing up</title><category>bluemile</category><category>spam</category><category>spamhaus</category><dc:creator>Jan Rychter</dc:creator><pubDate>Tue, 30 Nov 2010 16:12:01 +0000</pubDate><link>http://jan.rychter.com/enblog/2010/11/30/check-your-providers-spam-reputation-before-signing-up.html</link><guid isPermaLink="false">329406:3464523:9602344</guid><description><![CDATA[<p>Before you choose a hosting provider, always check their reputation with <a href="http://spamhaus.org/">Spamhaus</a>.</p>

<p>I rent virtual servers with Bluemile (formerly also Fivebean). This morning I was greeted with bouncing E-mail, and a quick check showed:</p>

<p><em>
Ref: SBL99441
68.68.16.0/20 is listed on the Spamhaus Block List (SBL)
30-Nov-2010 08:26 GMT | SR02</p>

<p>bluemilenetworks.com (escalation)</p>

<p>BLUEMILENETWORKS.COM ignores spam complaints, hosts spammers including known spam operations (ROKSO), assigns non-SBL'd IPs to spammers who get their assigned IPs listed in SBL, provides snowshoe spam configurations, fails to provide rwhois information as required by ARIN (thus providing anonymity for spammers) and generally acts like a network unconcerned with its mailing reputation. Spamhaus thereby treats it accordingly.
</em></p>

<p>Here's a <a href="http://www.spamhaus.org/sbl/sbl.lasso?query=SBL99441">link</a> to the actual updated spamhaus page, which might be different when you look it up. Notice that's a /20 block that is being blocked — I can't do anything about it!</p>

<p>I reported this to Bluemile support, who were completely unconcerned. They would deal with it once an engineer comes to work in the morning (business hours). Well, several hours have passed, then several business hours have passed, and there are no results to be seen. Meanwhile, almost all my outgoing e-mail keeps bouncing, which I have zero control over.</p>

<p>I am not a spammer. I take extensive care to make sure my servers never relay any E-mail. And yet here I am, listed in the SBL because I didn't check my provider's reputation.</p>

<p>I am really angry. And for those of you who suggest changing providers: sure, but moving mail and DNS servers is not that easy. It takes time and effort.</p>

<p>One thing is sure: the next time I look for a hosting provider, I will check their IP ranges and check with spamhaus (and other lists, possibly) to see if they are a spammer haven. I don't want to have anything to do with providers that are.</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-9602344.xml</wfw:commentRss></item><item><title>Drobo and DroboShare — a review</title><dc:creator>Jan Rychter</dc:creator><pubDate>Fri, 18 Jun 2010 09:02:28 +0000</pubDate><link>http://jan.rychter.com/enblog/2010/6/18/drobo-and-droboshare-a-review.html</link><guid isPermaLink="false">329406:3464523:8021546</guid><description><![CDATA[<p>Executive summary: don't buy it.</p>

<p>Convinced by people on podcasts (mostly TWiP and This Week in Tech) raving about how great the <a href="http://drobo.com/">Drobo</a> (from Data Robotics) storage device is, I decided to budget two into a project I'm working on. Expectations were high — Drobo marketing pushes the devices as easy to use, reliable and flexible. Being a Mac user, I expected an "Apple experience": plug it in and forget it's even there.</p>

<p>Nothing could be farther from the truth.</p>

<p>To begin with, the Drobo is Loud. Not just "loud", but REALLY LOUD. And it isn't the drives, it's the fan that cools the whole thing. To give you an idea of what I mean by Loud, one single Drobo with ultra-quiet WD Green drives spun down is louder than my 8-core Mac Pro with 4 drives and an army of fans in it. It's that loud. To make matters worse, the fan in the Drobo turns on very frequently, even when the drives have been spun down for hours. I don't know why, as the drives are very cool to the touch.</p>

<p>You won't want to have a Drobo under your desk, or anywhere in your vicinity, trust me. And that means the fancy fast FireWire-800 interface that you just paid for is pretty much useless. I used a DroboShare to setup my Drobo in a remote location where I can't hear it.</p>

<p>The DroboShare comes with Gigabit Ethernet, as the marketing will point out. What they won't point out is that it connects to your Drobo with a USB cable, which (together with SMB) pretty much limits your transfer speeds to about 5-8MB/s. That's about 6 times slower than when connected via FireWire-800.</p>

<p>What you should also know is that using the DroboShare will provide its own annoyances. As an example, I found it impossible to create a sparsebundle disk image for use with SuperDuper on the Drobo. Go figure. SMB introduces other annoying problems, too — I couldn't copy my music collection onto the Drobo, because some filenames had non-ascii characters in them.</p>

<p>But all of the above are merely inconveniences. The real issue is with reliability. I bought the Drobo so that I can trust it with my data and forget about failing drives and losing data. Which is why I was slightly miffed when Drobo Dashboard kept crashing on me and reporting unreliable data, annoyed when it hung in the middle of the night when doing my first real backup, slightly angry when support told me my Drobo is defective and needs to be replaced, and really pissed off when the second unit I got corrupted my volume and lost data (when connected to a DroboShare). And then Data Robotics support asked me... whether I have a backup. Or a copy of DiskWarrior.</p>

<p>I have so far been through TWO Drobo replacements. Despite my asking, Data Robotics was unwilling to provide an upgraded (better) unit.</p>

<p>What's worse is that now I don't trust the Drobo at all. I looked closer: the DroboShare seems to use the plain Linux support for HFS+ that is known to be shaky. There is NO FSCK (Filesystem Check) program for HFS+ at all! Data Robotics will tell you that you can switch your Drobo between a Mac and DroboShare and you will be ok — but that seems to be exactly what resulted in my data corruption problems.</p>

<p>Then there is Data Robotics support. When you make "reliable data storage devices", you really need to have support that cares about customers, reads their emails and responds instantly. Responding after one business day is not enough. Given that support people will forget what was written before, or begin by asking what your address is and when you bought your Drobo, it will easily take a week before you get to the real issue.</p>

<p>What you should also realize is that when your Drobo unit fails, there is no way for you to read data off the drives. You need a working Drobo unit to do that, and it has to recognize the filesystem and mount it.</p>

<p>I bought a Drobo so that I can have reliable data storage without worrying about reliable data storage. The net effect was that I got an unreliable solution that I have to manage, worry about and spend time and money on. That's a failure in my book. I will never buy another Drobo unit again.</p>

<p>[... the above was been drafted, and then 3 months passed ...]</p>

<p>So, today my volume (drobo mounted via a droboshare) unexpectedly disappeared on my Mac. Investigation of the DroboShare logs shows:</p>

<pre><code>
MOUNT HFS+ : s_id = [sda1]
scsi: unknown opcode 0xea
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105544
Buffer I/O error on device sda1, logical block 566638188
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105552
Buffer I/O error on device sda1, logical block 566638189
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105560
Buffer I/O error on device sda1, logical block 566638190
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105568
Buffer I/O error on device sda1, logical block 566638191
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105576
Buffer I/O error on device sda1, logical block 566638192
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105584
Buffer I/O error on device sda1, logical block 566638193
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105592
Buffer I/O error on device sda1, logical block 566638194
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105600
Buffer I/O error on device sda1, logical block 566638195
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105608
Buffer I/O error on device sda1, logical block 566638196
usb 1-1: USB disconnect, address 2
SCSI error : <2 0 0 0> return code = 0x70000
end_request: I/O error, dev sda, sector 4533105616
Buffer I/O error on device sda1, logical block 566638197
[...]

Buffer I/O error on device sda1, logical block 270838
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 270838
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 276472
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 276472
scsi2 (0:0): rejecting I/O to dead device
Buffer I/O error on device sda1, logical block 422806275
Buffer I/O error on device sda1, logical block 422806276
Buffer I/O error on device sda1, logical block 422806277
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
scsi2 (0:0): rejecting I/O to dead device
</code></pre>

<p>Drobo Dashboard doesn't launch, console shows me crash logs for the ddserviced daemon, which crashes every 10 seconds or so. Reinstalling drobo dashboard doesn't help.</p>

<p>I am <em>so tired</em>. I bought the Drobo so that I can save time, not so that I can run around and service it all the time, jumping through hoops set up by "support" from Data Robotics. I can already see how I'll have to spend several hours debugging the problems, dealing with support, reinstalling things.</p>

<p>I am posting this so that people are warned. Hopefully people will google for "Drobo" before buying it and I will save someone the hassle and frustration.</p>

<p>Will I lose data again this time?</p>

<p>Don't buy a Drobo.</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-8021546.xml</wfw:commentRss></item><item><title>Who's the sheep?</title><dc:creator>Jan Rychter</dc:creator><pubDate>Mon, 05 Apr 2010 18:59:30 +0000</pubDate><link>http://jan.rychter.com/enblog/2010/4/5/whos-the-sheep.html</link><guid isPermaLink="false">329406:3464523:7234710</guid><description><![CDATA[<p>Cory Doctorow <a href="http://www.boingboing.net/2010/04/02/why-i-wont-buy-an-ipad-and-think-you-shouldnt-either.html">tells us we shouldn't buy iPads</a>. Others <a href="http://thefastertimes.com/mediaandtech/2010/04/04/the-ipad-an-unhappy-return-to-the-past/">join him</a>, whining about how iPad makes us all consumers, sheep, or worse, and how we are headed for a future similar to the one in <a href="http://www.imdb.com/title/tt0387808/">Idiocracy</a>, where we won't be able to do much except consume digital media.</p>

<p>To all those who complain about how un-hackable the iPad is: what have you hacked recently? Have you actually modified any hardware? Written interesting new software for an existing device? Released anything as open-source perhaps?</p>

<p>Well guess what: I have. I have been using Linux for 15 years, on desktops, laptops, handhelds, servers, tablets and embedded devices. I compiled software, fixed bugs, wrote drivers, improved things. I took to my HP-48G with a soldering iron and expanded the memory. I struggled with Linux on a Sharp Zaurus because I believed in an open device. I had to reverse engineer a Fujitsu tablet and write a Linux driver for a microcontroller that serviced the keys and orientation sensor, just so that I could use Linux on that tablet.</p>

<p>And you know what -- life is too short. I'll be buying an iPad so that I can work on more interesting things than making my hardware work properly. I'll use the device to jot down ideas, read articles, write notes, create presentations, sketch diagrams.</p>

<p>I'm not "losing" anything by buying and using the iPad. Just as I don't have to tinker with the jet engine of the airplane that will take me to London, I don't have to tinker with the internals of the iPad. If I want to tinker and hack, I can build a model airplane or an ultralite. In the computer world, there is <a href="http://www.arduino.cc/">Arduino</a>, <a href="http://wiki.openmoko.org/wiki/Main_Page">OpenMoko</a>, and many other similar projects. Tinker and hack to your heart's delight and get educated about how electronics and software work on every level.</p>

<p>But I wonder -- why aren't <em>you</em> hacking and tinkering? Where are those <a href="http://www.boingboing.net/2010/04/02/why-i-wont-buy-an-ipad-and-think-you-shouldnt-either.html">"cool ideas from the creative universe"</a> that you need so badly to give to me to run on my hardware? </p>

<p>More importantly, why aren't you designing something better?</p>

<p>Look at you: you have to actively <em>convince</em> people <em>not to buy</em> iPads. This means the product is so good and people want it so badly, that you have to fight the trend. So why hasn't anyone invented and designed a product that is this good and ships with full schematics and has this all-open architecture you crave?</p>

<p>Why haven't you?</p>

<p>If you actually wanted to write software for your iPad, instead of writing lengthy articles complaining about stuff, nothing prevents you from doing so. Just download the SDK and off you go. Yes, you will need Apple's acceptance to <em>sell</em> your app in the App Store, but it's all about <em>ideals</em>, isn't it, so no worries.</p>

<p>I know. It's easier to complain. But who's the sheep now?</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-7234710.xml</wfw:commentRss></item><item><title>Dear American Website Owner</title><dc:creator>Jan Rychter</dc:creator><pubDate>Wed, 31 Mar 2010 12:16:36 +0000</pubDate><link>http://jan.rychter.com/enblog/2010/3/31/dear-american-website-owner.html</link><guid isPermaLink="false">329406:3464523:7186082</guid><description><![CDATA[<p>You live in the United States of America. You design all your forms to have a mandatory "State" field. And then you decide it might just be a good idea to sell to the other 95.4% of the world. But you know, most of the world does not use the concept of a "State" all that much.</p>

<p>The moment you put a "country" field in your form, two things should happen:</p>

<ul>
<li>you should remove the State field if the country isn't set to U.S.A. or at least make it optional</li>
<li>you should stop insisting on NANPA-formatted phone numbers (NNN-NNNNNNN)</li>
</ul>

<p>I write this after wrestling with a number of unbelievably stupid web forms, all of which required me to provide a "State" name (I don't have one), choose from a list of states, or provide a fake phone number just to satisfy a stupid validator routine.</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-7186082.xml</wfw:commentRss></item><item><title>HTML5, H.264 and Free Software: it's the wrong game!</title><dc:creator>Jan Rychter</dc:creator><pubDate>Mon, 25 Jan 2010 09:58:22 +0000</pubDate><link>http://jan.rychter.com/enblog/2010/1/25/html5-h264-and-free-software-its-the-wrong-game.html</link><guid isPermaLink="false">329406:3464523:6423343</guid><description><![CDATA[<p>Two <a href="http://weblogs.mozillazine.org/roc/archives/2010/01/video_freedom_a.html">important</a> <a href="http://www.0xdeadbeef.com/weblog/2010/01/html5-video-and-h-264-what-history-tells-us-and-why-were-standing-with-the-web/">articles</a> appeared in the last few days, both elaborating on why Mozilla is reluctant to adopt the <span class="caps">H.264 </span>video codec. Both are well thought out, but Mozilla is playing the wrong game here.</p>

<p>The implied conclusion is that we should all switch to Theora, since that is unencumbered with patents. Well guess what — pretty much every algorithm used in modern video compression is patented. And there are only so many ways you can slice and 2D-DCT a macroblock. There is no reason to believe that Theora is somehow designed "around" <strong>all</strong> those patents. It might very well be <em>impossible</em> to create a video codec that doesn't infringe on <strong>something</strong>. <a href="http://lockshot.wordpress.com/2009/07/30/whats-the-problem-with-ogg-theora/">This article</a> has a much more realistic approach to the issue at hand.</p>

<p>The game to play is to either abolish the patent system altogether (it has outlived its usefulness), or to make patent claims on algorithms void and unenforceable. Simply avoiding <span class="caps">H.264 </span>just because the licensing situation there is sorted out won't get us anywhere. We'll end up adopting something else (be it Theora or On2 VPwhatever) and finding out about patent claims years later, once the codec becomes popular.</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-6423343.xml</wfw:commentRss></item><item><title>Mozilla, HTML5 and H.264</title><dc:creator>Jan Rychter</dc:creator><pubDate>Sat, 23 Jan 2010 14:53:22 +0000</pubDate><link>http://jan.rychter.com/enblog/2010/1/23/mozilla-html5-and-h264.html</link><guid isPermaLink="false">329406:3464523:6406518</guid><description><![CDATA[<p>Robert <span class="caps">O&#8217;C</span>allahan, Mozilla Hacker, <a href="http://weblogs.mozillazine.org/roc/archives/2010/01/video_freedom_a.html">wrote an interesting article</a> about why he believes Mozilla should not support the <span class="caps">H.264 </span>format.</p>

<p>Other issues aside, I don&#8217;t understand why supporting a proprietary Flash plugin from a single vendor is better than opening support for a standardized (albeit similarly patent-encumbered) video format with open-source implementations.</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-6406518.xml</wfw:commentRss></item><item><title>x86 assembly encounter</title><dc:creator>Jan Rychter</dc:creator><pubDate>Fri, 04 Dec 2009 14:59:48 +0000</pubDate><link>http://jan.rychter.com/enblog/2009/12/4/x86-assembly-encounter.html</link><guid isPermaLink="false">329406:3464523:5986822</guid><description><![CDATA[<p>Every couple of years I have an encounter with assembly programming. It's funny how rules that applied years ago are useless now. The most recent encounter lasted about two weeks and resulted in a 600x speedup in a critical function. But, all wasn't nice and rosy: it was more difficult than I initially planned, took more time and provided a few surprises.</p>

<p>Key takeaway points, so that I can remember them and so that people googling for answers may find them:</p>

<ul>
<li>If you're looking for the <span class="caps">PSRLB </span>(parallel shift right logical bytes) <span class="caps">SSE </span>instruction, it isn't there. But there are two ways around it: you can either shift words using <span class="caps">PSRLW </span>and then mask out the higher bits, or for shifts with a count of one, use (xmm14 contains 1 in every byte and xmm15 is 0):</li>
</ul>


<pre class="prettyprint">
   psubusb xmm0, xmm14
   pavgb xmm0, xmm15
</pre>



<ul>
<li>If you need to "horizontally" sum 16 bytes in an <span class="caps">XMM </span>register, you will find that the <span class="caps">PHADDB </span>instruction doesn't exist, either. There is <span class="caps">PHADDW </span>and you could use that in combination with <span class="caps">PMADDUBSW </span>(multiply-add bytes to words), but the resulting sequence of instructions is far from optimal. Fortunately, there is a trick: use <span class="caps">PSADBW.</span> This computes the sum of absolute differences, which if you use 0 as the source parameter will correspond to your sum, and stores it in two quadwords, which gets you halfway there. In my case, I simply accumulated the results using two quadwords per register, and combined them at the end.</li>
</ul>

<ul>
<li>There is a nice <span class="caps">PMOVMSKB </span>instruction which converts a byte mask to a bit mask. But why, oh why isn't there an instruction which does the opposite? Extracting a 16-bit mask to a 16-byte register turns out to be painful.</li>
</ul>

<ul>
<li>The last time I programmed in x86 assembly was using a Pentium 4 with the infamous NetBurst architecture. It was an ugly, unpredictable beast, where a mispredicted branch could cost you a fortune in performance terms. It seems that with the newer Nehalem chips Intel really got things right -- latencies for most instructions are small and predictable and overall performance is more consistent across the board. There are fewer traps. And unaligned data accesses aren't penalized as badly as before!</li>
</ul>

<ul>
<li><span class="caps">LOOP </span>is slower than </li>
</ul>


<pre class="prettyprint">
   sub rcx, 1
   jnz .loop
</pre>


<p>Go figure.</p>

<ul>
<li>Thank God and <span class="caps">AMD </span>for <span class="caps">FINALLY </span>adding registers. Back in the P4 days it was ridiculous: having a 3GHz processor with only 6 usable general-purpose registers and 8 <span class="caps">SIMD </span>ones sounded like a joke.</li>
</ul>

<p>And the final observation: just as several years ago, the state of x86 assemblers is a sad, sad affair. To use a construction industry metaphor, an average x86 assembler has the complexity and usefulness of a hammer, while the <span class="caps">DSP </span>world is using high-speed mag-rail blast-o-matic nail guns with automatic feeders and superconducting magnets. I mean, seriously, do I really have to manually track register allocations?! Manually reorder instructions and measure performance to see which arrangement is faster (hoping not to break any dependencies)? Manually update stack pointer offsets after pushing something onto the stack? Write prologs and epilogs for C-linkable functions myself?</p>

<p>If anybody is thinking about writing or improving an x86 assembler, take a look at what Texas Instruments provides for their <span class="caps">DSP</span>s. See how you can write "linear assembly" and have your compiler schedule <span class="caps">VLIW </span>execution units for you. See how you don't need a piece of paper with a huge table detailing which registers are used in which part of your code.</p>

<p>I find it ridiculous that the most popular computing platform in the world does not have a decent assembler. What's even worse, from the discussions I've seen on the net, people are mostly interested in how fast the assembler is (?!) rather than how much time it saves the programmer.</p>

<p>Anyway, the net result of this encounter is a function that is about 600x faster than the original C implementation. It is about 4x slower than the theoretical limit (calculated assuming only arithmetic ops, no overhead, no memory accesses, and 16 ops per cycle), which I'm very happy with.</p>

<p>x86 assembly, see you in several years!</p>

<p><strong><span class="caps">UPDATE </span>(22.12.2009):</strong> I wrote this post hoping that it will help people searching for the non-existing <span class="caps">PSRLB </span>instruction -- and it worked -- I can already see it in the logs!</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-5986822.xml</wfw:commentRss></item><item><title>Folder actions on Mac OS X: usable now?</title><category>mac</category><dc:creator>Jan Rychter</dc:creator><pubDate>Thu, 01 Oct 2009 17:46:18 +0000</pubDate><link>http://jan.rychter.com/enblog/2009/10/1/folder-actions-on-mac-os-x-usable-now.html</link><guid isPermaLink="false">329406:3464523:5357824</guid><description><![CDATA[AppleScript <a href="http://developer.apple.com/mac/library/releasenotes/AppleScript/RN-AppleScript/RN-10_6/RN-10_6.html">release notes for Snow Leopard</a> (Mac OS 10.5.6):<br />
<blockquote>Folder Actions now attempts to delay calling “files added” actions on files until they are done being copied. Previous versions called “files added” actions on new files as soon as they appeared in the file system. This was a problem for files that were being copied into place: if the file was sufficiently large or coming over a slow server link, the file might appear several seconds before it was done being copied, and running the folder action before it finished copying would behave badly. Folder Actions now watches if the file is changing size: if it stays the same size for more than three seconds, it is deemed “done”, and the action is called.</blockquote>

<p>My experience with folder actions was that they are one big race condition waiting to bite you. It&#8217;s something all the tutorials conveniently glossed over. I kept wondering why Apple kept them if they are so obviously unreliable.</p>

<p>Hopefully that change, while far from correct, will make them usable.</p>
]]></description><wfw:commentRss>http://jan.rychter.com/enblog/rss-comments-entry-5357824.xml</wfw:commentRss></item></channel></rss>
