<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Ted Dziuba</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/" />
    <link rel="self" type="application/atom+xml" href="http://teddziuba.com/atom.xml" />
    <id>tag:teddziuba.com,2008-02-02://1</id>
    <updated>2008-07-04T17:55:27Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Open Source 4.1</generator>

<entry>
    <title>Corporate Competence</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/07/corporate-competence.html" />
    <id>tag:teddziuba.com,2008://1.29</id>

    <published>2008-07-04T17:33:25Z</published>
    <updated>2008-07-04T17:55:27Z</updated>

    <summary><![CDATA[ I really love it when people just do their jobs.&nbsp; I feel gifted whenever I call a company and get a customer support representative who know what they are doing and actually cares about me.It's rare, but it happens.Worst...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="1213940897512.jpg" src="http://teddziuba.com/1213940897512.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="360" width="328" /></span> <div>I really love it when people <i>just do their jobs</i>.&nbsp; I feel gifted whenever I call a company and get a customer support representative who know what they are doing and actually cares about me.<br /><br />It's rare, but it happens.<br /><b><br />Worst ISP Ever</b><br /><br />For a while, I had Comcast's cable internet service.&nbsp; It was clear after two years of putting up with their horseshit that they don't care about customers at all.<br /><br />Oh, wait, they set up a <a href="http://twitter.com/comcastcares">Twitter account</a>.<br /><br />Fantastic, but my BitTorrent shit still didn't work on their network.&nbsp; Their installation staff is rude and has questionable hygeine, and their customer support representatives are downright lazy.<br /><br /><b>Switch to AT&amp;T Now</b><br /><br />When I moved, my first order of business was to call Comcast and tell them it's over.&nbsp; They said my service wouldn't end until I brought back my cable modem, and of course, the place I need to bring it back to is only open during working hours.<br /><br />I took off work early to get this little brick of dissatisfaction back to its rightful owner, because fuck them.<br /><br />At the same time, I was waiting for AT&amp;T to show up and install U-Verse internet service.&nbsp; They did, and shit was <i>impressive</i>.<br /><br /><ul><li>They told me the tech would be at my house any time from noon to 2pm on a Sunday.&nbsp; The tech showed up at noon on the dot.</li><li>It took him about an hour to set up the service.&nbsp; When he left, he gave me a card with his direct cell phone number.&nbsp; If I had any problem in the next ten days, I called him directly and he would come fix it.</li><li>An hour after he left, the service went out.&nbsp; I called him, and he was back at my house within 30 minutes.&nbsp; It turns out there was something wrong with the line from the street to my house, and he had to get <i>another</i> tech out to fix it.&nbsp; That guy showed up, fixed the problem, and was on his way.&nbsp; The two of them were at my place until 8pm on a Sunday until the job was done right.</li></ul>I've been using the service for almost a week now and it's great.<br /><br /><ul><li>No BitTorrent fuckery.&nbsp; All my torrents work great, and I can seed.</li><li>10 megabits downstream, 1.5 megabits upstream.</li></ul>Great job, AT&amp;T, you actually care about the people paying your salaries.<br /><br /><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Having Fun At Mahalo&apos;s Expense</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/07/having-fun-at-mahalos-expense.html" />
    <id>tag:teddziuba.com,2008://1.28</id>

    <published>2008-07-03T03:57:29Z</published>
    <updated>2008-07-03T04:21:46Z</updated>

    <summary><![CDATA[Holy crap this is awesome.&nbsp; Mahalo, the "human powered search engine", now lets the general public edit parts of its pages.For the uninformed, Mahalo is a for-profit installation of MediaWiki founded by notable blowhard Jason Calacanis and backed by Sequoia...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[Holy crap this is awesome.&nbsp; Mahalo, the "human powered search engine", now lets the general public edit parts of its pages.<br /><br />For the uninformed, Mahalo is a for-profit installation of MediaWiki founded by notable blowhard Jason Calacanis and backed by Sequoia Capital.&nbsp; They're aiming to be a hand-vetted search engine to compete with Google.&nbsp; Right.<br /><br />Anyway, now you can edit their pages anonymously.&nbsp; Since they're a capitalist version of Wikipedia, they need to pay people to review edits, so they aren't too quick on the uptake.&nbsp; Here's how to do it:<br /><b><br />Step 1: Search for something at mahalo.com</b><br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="mahalo_search.png" src="http://teddziuba.com/2008/07/02/mahalo_search.png" class="mt-image-center" style="border: 1px solid black; margin: 0pt auto 20px; text-align: center; display: block;" height="199" width="702" /></span><b><br /></b> <div><b>Step 2: Click the 'edit' link</b><br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="loren_page.png" src="http://teddziuba.com/2008/07/02/loren_page.png" class="mt-image-center" style="border: 1px solid black; margin: 0pt auto 20px; text-align: center; display: block;" height="375" width="538" /></span><b>Step 3: Add your verbiage. </b>Remember, this is MediaWiki syntax, so you can link to other Mahalo pages.<br /><br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="edit_page.png" src="http://teddziuba.com/2008/07/02/edit_page.png" class="mt-image-center" style="border: 1px solid black; margin: 0pt auto 20px; text-align: center; display: block;" height="184" width="663" /></span><br /><b>Step 4: Hit 'save' and collect your winnings</b><br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="win.png" src="http://teddziuba.com/2008/07/02/win.png" class="mt-image-center" style="border: 1px solid black; margin: 0pt auto 20px; text-align: center; display: block;" height="237" width="365" /></span><br />A search engine that anyone can edit.&nbsp; What could possibly go wrong?<br /></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Practical Unique Identifiers</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/07/practical-unique-identifiers.html" />
    <id>tag:teddziuba.com,2008://1.27</id>

    <published>2008-07-02T05:16:13Z</published>
    <updated>2008-07-02T17:57:37Z</updated>

    <summary><![CDATA[There have been a handful of places within the Persai pipeline where I have needed unique identifiers of varying length.&nbsp; 64 bits here, 32 bits there.&nbsp; I'm not the only one to ever have to solve this problem, but I...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="dogs_love_md5.jpg" src="http://teddziuba.com/2008/07/01/dogs_love_md5.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="230" width="307" /></span>There have been a handful of places within the Persai pipeline where I have needed unique identifiers of varying length.&nbsp; 64 bits here, 32 bits there.&nbsp; I'm not the only one to ever have to solve this problem, but I could never find a concise toolbox of information on it.<br /><b><br />Automatic Increment or Not</b><br /><br />MySQL has the AUTO_INCREMENT modifier for integral record keys.&nbsp; That's great, if you're using MySQL.&nbsp; In general, prefer a non-automatically increasing record identifier, unless you have a specific reason.&nbsp; Here's why:<br /><br /><ul><li>You may actually have to think about thread synchronization at some point when creating records.</li><li>If these identifiers become publicly visible, they can leak information about how many records are in your database.</li><li>If you make identifiers out of other pieces of data (say URLs), then you can't get the identifier value of a given datum without a table lookup.&nbsp; And even then, you'll need another index on <i>that</i> field.<br /></li></ul>There are a few cases where automatic increment identifiers are good, though:<br /><br /><ul><li>You are using a MySQL database and are setting up a simple structure of tables. (i.e. MySQL handles synchronization for you and it's actually harder to <i>not</i> use automatic increment)</li><li>The creation order of records is really important to you, but not important enough to store a timestamp field.</li></ul><br /><b>Making an Identifier Out Of Arbitrary Data</b><br /><br />Easy, right?&nbsp; Just hash whatever data you've got.&nbsp; It's not reversible and spread uniformly over the identifier space.&nbsp; However, many times the output of a standard hashing algorithm is too big.&nbsp; SHA-1, for example, is 160 bits wide.&nbsp; Way too long for most purposes.<br /><br />In this case, I truncate the output.&nbsp; Yes, this is mathematically valid, because any good hashing algorithm's output will be uniform over the range of the function.&nbsp; And by uniform, I mean really uniform.&nbsp; For example, if you take the first 64 bits of a 160-bit SHA-1 hash and call that your unique identifier, the probability of a collision is going to be uniform over the space of all 64-bit numbers.&nbsp; If it wasn't (i.e. the first 64-bits of a SHA-1 hash were distributed, say normally), then the hash function would be cryptographically insecure.<br /><br />Don't try to swing your dick around and come up with your own hash function.&nbsp; You'll screw it up.&nbsp; I know I have.<br /><br /><b>
GUIDs</b><br />
<br />
I got an e-mail from a reader about using GUIDs for unique identifiers.&nbsp; This fits with the hashing scheme, but for the most part, I think GUIDs are far too large, especially if you are storing a lot of records.&nbsp; GUIDs are 128 bits wide, so if you have a hundred million records, that's about 1.5GB worth of identifiers.&nbsp; Use a 64-bit identifier, and your space is halved, without a significant increase in collision probability.<br /><br /><b>Making An Identifier Easier On The Eyes</b><br /><br />If you need to put a unique identifier in a URL, it can't look too nerdy.&nbsp; For example, this URL looks like shit:<br /><br /><blockquote><code>http://www.website.com/document?id=1b25a53bf21d0206</code><br /></blockquote>Too many numbers.&nbsp; So, to make it look better, Base-64 encode it.&nbsp; It will lengthen the code a little, but it's much easier to look at:<br /><br /><blockquote><code>http://www.website.com/document?id=ZnJvc3RlZCBidXR0cw==</code><br /></blockquote>Eh, well it looks better to me.&nbsp; Personal taste, I guess.<br /><br />You'll need to make sure that your Base-64 alphabet doesn't include the + and / characters: they aren't URL safe.<br /><br /><b>Sort Orderings</b><br /><br />Don't worry about sort ordering unless you have to worry about sort ordering.&nbsp; Duh.&nbsp; The vast majority of Persai's data is stored simply as files, and for most purposes we don't have to care about the processing order.&nbsp; We're fortunate in that regard (well maybe not <i>fortunate</i>, I mean that's like saying you're <i>fortunate</i> that you're not fat because you exercise and eat sensibly).<br /><br />Anyway, there are a couple of places in Persai where sort order matters.&nbsp; The ordering of recommendations, for example.&nbsp; There, though, we're just ordering by time, and we need to display the exact time, not just the relative times of the recommendations, so we store a date field and order data by it in the store.<br /><br />This drives one of my earlier points home: <i>if you need ordering by time, don't count on an automatic increment unique identifier to do it</i>.&nbsp; It's much more robust to store a timestamp.<br /><br />In fact this point goes deeper.&nbsp; Very rarely do you actually need records sorted by record identifier.&nbsp; What you need is the records sorted by some other value that happens to be reflected in the record identifier by virtue of automatic increment and the insertion order.&nbsp; It's always more robust to store the actual value you need to sort by.<br /><br /><b>I'm Not Going To Tell You How To Write Code</b><br /><br />Because I don't really care.&nbsp; This is how I do it, though.<br /> <div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>So Close Now I Can Taste It</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/06/so-close-now-i-can-taste-it.html" />
    <id>tag:teddziuba.com,2008://1.26</id>

    <published>2008-07-01T02:49:42Z</published>
    <updated>2008-07-01T03:19:04Z</updated>

    <summary><![CDATA[Matt, Kyle and I are wrapping things up for the public launch.&nbsp; I have spent the last week writing Nagios alerts for some really esoteric details of our system.&nbsp; We're sending Persai out into the world in July, if everything...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="1204606927018.jpg" src="http://teddziuba.com/2008/06/30/1204606927018.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="312" width="300" /></span>Matt, Kyle and I are wrapping things up for the public launch.&nbsp; I have spent the last week writing Nagios alerts for some really esoteric details of our system.&nbsp; We're sending Persai out into the world in July, if everything goes right.&nbsp; It has been a long time coming - the system has been in development for over a year.<br /><br /><b>That Ride Sucks, Anyway</b><br /><br />Why is this thing taking so long to launch?&nbsp; We've had a lot of failures along the way, but we've finally converged on a system that I believe to be correct.&nbsp; The focus of the product has changed a little bit, too.<br /><br />Our pitch used to be: <i>a content filtering and delivery system that learns about what you're really interested in, and shows you news based on your feedback.</i><br /><br />That doesn't sit too well with investors, it turns out.<br /><br />Now, it's: <i>a persistent search that learns the nuanced details of what you like.</i><br /><br />That one picked up a few ears, and got a few pens working.<br /><br />We ended up re-writing the internals of this beast three times before we had what's running today.&nbsp; Now it's lean and mean.&nbsp; Our classifiers went through a massive reduction in feature space: about six orders of magnitude.&nbsp; Some of our linguistics algorithms got ten times faster, and we are crawling thousands more sources.<br /><br />The next couple of weeks are going to be very busy and very exciting.&nbsp; We will likely have a launch party, but we're not pissing away our investors' money on it.&nbsp; It'll be a barbecue in the back yard of the "office" with a bunch of beer.&nbsp; Maybe 111 Minna next time.<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Datacenter Fire Causes Persai Outage</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/06/datacenter-fire-causes-persai.html" />
    <id>tag:teddziuba.com,2008://1.25</id>

    <published>2008-06-01T18:32:45Z</published>
    <updated>2008-06-01T18:36:46Z</updated>

    <summary><![CDATA[ A generator fire at a datacenter has caused Persai to be down since yesterday.We'll be moving ourselves from that datacenter shortly - this is why the service is in beta.Yeah, hosted applications are the wave of the future.&nbsp; Yessiree....]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="gridirongroinkick.jpg" src="http://teddziuba.com/2008/06/01/gridirongroinkick.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="293" width="340" /></span> <div>A generator fire at a datacenter has caused Persai to be down since yesterday.<br /><br />We'll be moving ourselves from that datacenter shortly - this is why the service is in beta.<br /><br />Yeah, hosted applications are the wave of the future.&nbsp; Yessiree.<br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>An Engineer&apos;s Guide To Weight Loss</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/05/an-engineers-guide-to-weight-l.html" />
    <id>tag:teddziuba.com,2008://1.24</id>

    <published>2008-05-20T15:28:00Z</published>
    <updated>2008-05-21T03:37:38Z</updated>

    <summary><![CDATA[After a year of the Google cafeteria and another year of eating low cost Startup FounderChow, I put on a few pounds.&nbsp; Now, I'm starting to shed them, and&nbsp; I'll tell you how.Before I get into it, I want to...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="1208418061380.jpg" src="http://teddziuba.com/2008/05/20/1208418061380.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="249" width="200" /></span>After a year of the Google cafeteria and another year of eating low cost Startup FounderChow, I put on a few pounds.&nbsp; Now, I'm starting to shed them, and&nbsp; I'll tell you how.<br /><br />Before I get into it, I want to lay down a few prerequisites.&nbsp; There are a lot of diet guides out there that will bullshit you into thinking that the process is easy.&nbsp; This is a lie.&nbsp; <b>Dieting and exercising suck.&nbsp; This is possibly the most miserable thing you can do to yourself.</b>&nbsp; You are not going to have fun.<br /><br />To that end, if you are more than 50 pounds overweight, are unmarried, have no children, and your only reason to get up in the morning is your shitty software job, the healthy lifestyle is not for you.&nbsp; You are better off eating yourself to the grave: you will get much more satisfaction out of life by eating cheeseburgers than you will by torturing the pounds of fat off your gut.<br /><br /><b>Simple I/O Operation</b><br /><br />The science of weight loss is simple: eat fewer calories than your burn.&nbsp; You have heard this before, I trust.&nbsp; To follow this principle, you need to start quantifying.&nbsp; I use a web service called <a href="http://www.fitday.com/">FitDay</a> to track the calories I eat versus the calories I burn.<br /><br />Start by running a 1,000 calorie per day deficit.&nbsp; To lose a pound of fat, you need to burn around 3,500 calories, so you'll lose two pounds in a week.&nbsp; Just to be clear, <b>doing this sucks ass</b>.&nbsp; However, there are a few easy ways to trim calories here and there.<br /><br /><i>Go Easy On The Drinking</i><br />When I go out on a Friday night to have a few beers, it's not hard for me to consume 800 calories worth of booze.&nbsp; Yes, liquor helps to numb the pain of writing XML parsers all day, but it comes at an expense.&nbsp; To compensate, take up smoking.&nbsp; I smoke more cigars now: it's a good zero-calorie alternative.<br /><br /><i>Eat One Serving</i><br />There are eight servings in a box of Barilla pasta.&nbsp; I used to eat half a box of pasta in a single sitting, 4 servings worth.&nbsp; Since you're counting your calories anyhow, you'll already be monitoring servings.&nbsp; You will also spend less money this way: since I started counting my calories, I've been spending 50% less per week on food.&nbsp; More money for cigars.<br /><br /><i>Drink More Coffee</i><br />Caffeine is an appetite suppressant.&nbsp; In large enough quantities, it can be used as an amphetamine.&nbsp; Drink up.<br /><br /><i>Ice Cream Keeps You Sane</i><br />Low-fat ice cream has around 120 calories per half cup.&nbsp; Fat calories keep you feeling satiated for longer.&nbsp; The Dreyer's brand (sold as Edy's on the east coast) doesn't suck that much.<br /><br />After you have been limiting your calorie intake for two weeks, your stomach will shrink enough that it takes significantly less food to satisfy you.&nbsp; So that's step one: stop eating so damn much.&nbsp; Step two is exercise.&nbsp; And yes, it's awful.<br /><br /><b>See What Condition My Condition Was In</b><br /><br />The only real <i>benefit</i> to exercise is being able to hold your nose over people who don't exercise.&nbsp; That's pretty cool if you're looking to take your misery out on your co-workers.&nbsp; Protip: it's better for your general well-being to be a prick to your colleagues than to your family.<br /><br />You will lose more weight by dieting than by exercise if you are eating 1,000 fewer calories per day than you burn by doing nothing, so use exercise only as a supplement to your calorie loss.<br /><br />If you're going to exercise, use an elliptical machine.&nbsp; Treadmills are terrible: they make you run.&nbsp; If you're like me, you have horrific flashbacks of being 10 year old, sucking wind, being the one that got nailed by the cops because your friends were all physically fit and managed to get away.&nbsp; Failure.<br /><br />If you're going to pussyfoot around and work out for 30 minutes in your "fatburn" zone&nbsp; three times a week, don't even bother.&nbsp; You're just wasting your time.&nbsp; One hour per day, hard.&nbsp; You should be close to vomiting by the end of that hour.<br /><br /><b>Well, That's It</b><br /><br />Easy, huh.&nbsp; Stop eating so damn much and get off your fat lazy ass.<br />]]>
        
    </content>
</entry>

<entry>
    <title>Weekend Science Project</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/05/weekend-science-project.html" />
    <id>tag:teddziuba.com,2008://1.21</id>

    <published>2008-05-10T23:37:36Z</published>
    <updated>2008-05-10T23:40:40Z</updated>

    <summary><![CDATA[I built an HD antenna today.&nbsp; Using these instructions and less than $15 worth of materials, I can get a few local channels in HD over the air.&nbsp; Check this sucker out:Ugly as hell, but I can watch Lost in...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[I built an HD antenna today.&nbsp; Using <a href="http://www.metacafe.com/watch/762088/coat_hanger_hdtv_antenna_better_than_store_bought_amazing/">these instructions</a> and less than $15 worth of materials, I can get a few local channels in HD over the air.&nbsp; Check this sucker out:<br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="antenna.JPG" src="http://teddziuba.com/2008/05/10/antenna.JPG" class="mt-image-center" style="margin: 0pt auto 20px; text-align: center; display: block;" height="346" width="461" /></span><br /><div>Ugly as hell, but I can watch Lost in HD without paying Comcast an extra dime.<br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>JavaFX Native Look and Feel</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/05/javafx-native-look-and-feel.html" />
    <id>tag:teddziuba.com,2008://1.20</id>

    <published>2008-05-10T17:14:02Z</published>
    <updated>2008-05-10T17:22:55Z</updated>

    <summary><![CDATA[I have been toying around with JavaFX, Sun's answer to Adobe AIR and Microsoft Silverlight.&nbsp; Since JavaFX is pretty much an easy way to do Swing, you can get Swing's pluggable look and feel in Java FX programs.&nbsp; Thank Christ,...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[I have been toying around with JavaFX, Sun's answer to Adobe AIR and Microsoft Silverlight.&nbsp; Since JavaFX is pretty much an easy way to do Swing, you can get Swing's pluggable look and feel in Java FX programs.&nbsp; Thank Christ, because the Swing UI components look like shit:<br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="demo-swing.png" src="http://teddziuba.com/2008/05/10/demo-swing.png" class="mt-image-center" style="margin: 0pt auto 20px; text-align: center; display: block;" height="90" width="512" /></span><br /> <div>Versus the GTK look and feel:<br /><br /><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="demo-gtk.png" src="http://teddziuba.com/2008/05/10/demo-gtk.png" class="mt-image-center" style="margin: 0pt auto 20px; text-align: center; display: block;" height="94" width="477" /></span><br />This was done by adding the following snippet to my JavaFX code:<br /><br /></div><pre><code>
import javax.swing.UIManager;
 
 UIManager.setLookAndFeel(
            UIManager.getSystemLookAndFeelClassName()); </code></pre><br />Oh neat, native UI components.]]>
        
    </content>
</entry>

<entry>
    <title>Eclipse Crashes in Ubuntu Hardy Heron</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/04/eclipse-crashes-in-ubuntu-hard.html" />
    <id>tag:teddziuba.com,2008://1.19</id>

    <published>2008-04-27T01:37:22Z</published>
    <updated>2008-04-27T05:46:44Z</updated>

    <summary><![CDATA[I just upgraded my workstation to Hardy and got a SIGSEGV when starting Eclipse.&nbsp; It appears to be a bug in the Sun JVM that ships with Hardy, and it only happens on AMD64.If you're set on using this runtime,...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[I just upgraded my workstation to Hardy and got a SIGSEGV when starting Eclipse.&nbsp; It appears to be a bug in the Sun JVM that ships with Hardy, and it only happens on AMD64.<br /><br />If you're set on using this runtime, the fix is to disable the JIT compiler by launching Eclipse with -Xint, but that's comes with a severe performance penalty.<br /><br />The fix I used was to simply downgrade the Hardy JRE (6-06-0ubuntu1) to the Gutsy version (6-03-0ubuntu2).&nbsp; You'll have to edit /etc/apt/sources.list to add a Gutsy repository.<br /><br />I'm pretty sure this is the Sun bug: <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6614100">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6614100</a><br /><br />And this is the Ubuntu bug: <a href="https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/174759">https://bugs.launchpad.net/ubuntu/+source/eclipse/+bug/174759</a><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>I&apos;m Going To Scale My Foot Up Your Ass</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/04/im-going-to-scale-my-foot-up-y.html" />
    <id>tag:teddziuba.com,2008://1.18</id>

    <published>2008-04-24T14:03:43Z</published>
    <updated>2008-04-24T14:37:12Z</updated>

    <summary><![CDATA[ Engineers love to talk about scalability.&nbsp; It makes us feel like the bad ass, dick-swingin' motherfuckers that we wish we could be.After we talk about scalability with our co-workers (Yeah, Rails doesn't scale!), we flex our true engineering prowess...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="1205210029413.jpg" src="http://teddziuba.com/2008/04/24/1205210029413.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="166" width="399" /></span> <div>Engineers love to talk about scalability.&nbsp; It makes us feel like the bad ass, dick-swingin' motherfuckers that we wish we could be.<br /><br />After we talk about scalability with our co-workers (<i>Yeah, Rails doesn't scale!</i>), we flex our true engineering prowess by writing a post about it on our blog.&nbsp; Once that post hits Reddit, son, everyone will know <i>how hardcore</i> you really are.&nbsp; Respect.<br /><br /><b>People Who Talk Big About Scalability Don't Need To Worry About It</b><br /><br />Fact:&nbsp; every chest-thumping blog post I have seen written about scalability is either about architecture, Memcached, or both.&nbsp; Some asshole who writes shitty code starts pontificating about <i>"scalable architecture"</i> with data storage, web frontends, whatever-the-fuck.&nbsp; Dude, your app isn't having scalability problems because of the <i>architecture</i>.&nbsp; It's having scalability problems because you coded a ton of N^2 loops into it and you're too self-important to get peer reviews on your commits.<br /><br />And let's not forget the tools who discover Memcached for the first time, install it on a web server, and notice how fast their app runs now.&nbsp; Yeah, welcome to the modern age.&nbsp; Hope you know what a cache expiry policy is.<br /><br /><b>If You Haven't Discussed Capacity Planning, You Can't Discuss Scalability</b><br /><br />You don't need to worry about scalability on your Rails-over-Mysql application because nobody is going to use it.&nbsp; Really.&nbsp; Believe me.&nbsp; You're going to get, at most, 1,000 people on your app, and maybe 1% of them will be 7-day active.&nbsp; Scalability is not your problem, getting people to give a shit is.<br /><br />Unless you know what you need to scale <i>to</i>, you can't even begin to talk about scalability.&nbsp; How many users do you want your system to handle? A thousand?&nbsp; Hundred thousand? Ten million?&nbsp; Here's a hint: the system you design to handle a quarter million users is going to be different from the system you design to handle ten million users.<br /><br />Of course you'll point to the engineer's wet dream: linear scalability.&nbsp; <i>Lulz but when we get more users we just add more machines you are so stupid ted. uncov sucks.</i><br /><br />Yeah, great, well it doesn't exist.&nbsp; Oh no, go ahead and try out Amazon SimpleDB and think to yourself that it will scale linearly.&nbsp; Then, when you get enough users that the latency becomes a problem, blame it on "those shitty Amazon datacenters".<br /><br /><b>Choosing Technology Don't Mean Shit If You Don't Know How To Use It</b><br /><br />The most common butthurt about scalability is this:&nbsp; choose a technology.&nbsp; If you like the technology, claim <i>"technology X scales better!"</i> If you don't like it, claim <i>"technology X doesn't scale!"</i><br /><br />Saying "Rails doesn't scale" is like saying "my car doesn't go infinitely fast".&nbsp; Alternatively, saying "We'll have no problems scaling because we're using Django" is like saying "I will win every race because my car is the most powerful".&nbsp; Maybe so, but you suck at driving, and you're up against professionals.<br /><br />If you're having scalability problems and blaming it on a single technology, chances are, you're doing it wrong.<br /><br /><b>tl;dr</b><br /><br />Shut up about scalability, no one is using your app anyway.<br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>Don&apos;t Serialize Java Objects In Hadoop SequenceFiles</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/04/dont-serialize-java-object-in.html" />
    <id>tag:teddziuba.com,2008://1.17</id>

    <published>2008-04-08T15:28:29Z</published>
    <updated>2008-04-08T15:56:17Z</updated>

    <summary><![CDATA[Not if you can avoid it, at least.Hadoop provides you with the Writable interface if you want to write your object to a SequenceFile.&nbsp; It's up to you to implement the write() and readFields() methods for your object.&nbsp; It's easy...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[Not if you can avoid it, at least.<br /><br />Hadoop provides you with the <code>Writable</code> interface if you want to write your object to a <code>SequenceFile</code>.&nbsp; It's up to you to implement the <code>write()</code> and <code>readFields()</code> methods for your object.&nbsp; It's easy if your object is simple: just write each of your instance variables to a <code>DataOutput</code> and read them back in the same order from a <code>DataInput</code>.<br /><br /><b>Don't Write Your Object As A Serialized Byte Array<br /></b><br />I got lazy when I was implementing the Writable interface with one of our classes because it had a ton of instance variables.&nbsp; I figured I'd just serialize it to a byte array, then write the array length and the whole array to the DataOutput.&nbsp; And on the read, well, just unserialize the object from the byte array.&nbsp;&nbsp; This was my <code>write()</code>:<br /> 

<pre><code>
@Override
public void write(DataOutput out) throws IOException {
	ByteArrayOutputStream byteOutStream = new ByteArrayOutputStream();
	ObjectOutputStream objectOut = new ObjectOutputStream(byteOutStream);
		
	objectOut.writeObject(getContainedObject());
	objectOut.close();
		
	byte[] serializedObject= byteOutStream.toByteArray();
		
	out.writeInt(serializedObject.length);
	out.write(serializedModel);

}
</code></pre>

Naw, dude.  Bad idea.<br /><br />I knew that I'd be paying some overhead in both space and time for this little scheme, but I didn't know how much.&nbsp; It was just a little bit per object, but when we started seeing MapReductions take way too much time in I/O, it was time to revisit this.<br /><br /><b>What This Cost In Space And Time</b><br /><br />First, the Java serialization space overhead.&nbsp; On a toy example of this object, serialization to a byte array used 953 bytes.&nbsp; Properly writing out the instance variables consumed 296 bytes.&nbsp; In production, doing it the right way shrunk a 1,600-record <code>SequenceFile</code> from 1.4GB to 825MB.<br /><br />Time savings were great, too.&nbsp; In the same toy example, it took my JVM 7.2 milliseconds to serialize the object and 1.7 milliseconds to unserialize.&nbsp; Doing with with stream I/O only took 76,000 nanoseconds to serialize, 58,000 nanoseconds to unserialize.<br /><br />I love order-of-magnitude improvements.<br /><br />Lesson learned: get off your lazy ass and do it right.<br />]]>
        
    </content>
</entry>

<entry>
    <title>Plugged in the New York Times</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/03/plugged-in-the-new-york-times.html" />
    <id>tag:teddziuba.com,2008://1.16</id>

    <published>2008-03-20T19:34:18Z</published>
    <updated>2008-03-20T19:37:50Z</updated>

    <summary><![CDATA[Me, Persai, and Uncov got a plug in the New York Times today.&nbsp; We've been in VentureBeat, Slate, and now NYT, but not TechCrunch.&nbsp; Something tells me that's not an accident....]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[Me, Persai, and Uncov got a <a href="http://www.nytimes.com/2008/03/20/technology/personaltech/20basics.html">plug in the New York Times</a> today.&nbsp; We've been in VentureBeat, Slate, and now NYT, but not TechCrunch.&nbsp; Something tells me that's not an accident. ]]>
        
    </content>
</entry>

<entry>
    <title>A Magic Elixir</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/02/a-magic-elixir.html" />
    <id>tag:teddziuba.com,2008://1.14</id>

    <published>2008-02-28T03:47:14Z</published>
    <updated>2008-02-28T04:08:45Z</updated>

    <summary><![CDATA[In software, there are no silver bullets.&nbsp; In internal combustion engine mechanics, however, there are plenty. And I just discovered one.It's called Sea Foam, and it will cure what ails 'ya.My wife's first motorcycle was a Honda Rebel 250.&nbsp; She...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="piglet.jpg" src="http://teddziuba.com/piglet/piglet.jpg" class="mt-image-right" style="margin: 0pt 0pt 20px 20px; float: right;" height="253" width="338" /></span>In software, there are no silver bullets.&nbsp; In internal combustion engine mechanics, however, there are plenty. And I just discovered one.<br /><br />It's called <a href="http://www.amazon.com/Sea-Foam-Marine-Motor-Treatment/dp/B0002ZVMQO">Sea Foam</a>, and it will cure what ails 'ya.<br /><br />My wife's first motorcycle was a Honda Rebel 250.&nbsp; She upgraded too late in the season and couldn't sell the starter before winter showed up.&nbsp; Winter time is a dead zone for the used motorcycle market in the San Francisco Bay Area, so the Rebel sat in the parking garage for 5 months.&nbsp; Being lazy, I didn't properly store it.&nbsp; <br /><br />We went to fire it up yesterday to prepare it for its 15 minutes of Craigslist fame, and it wouldn't turn over.&nbsp; Gasoline, if left long enough, will degrade into a mucky varnish that cakes the inside of your carburetors.<br /><br />I poured half a can of Sea Foam into the tank and let it sit for a few minutes.&nbsp; I cranked it again and it made a few pathetic putts.&nbsp; A few more cranks, a few more putts, but after about 5 tries, the Rebel roared to life.<br /><br />A six dollar bottle of some petroleum distillate has the same end effect as a three hundred dollar carburetor job.<br /><br />I am detecting much win in this sector.<br /><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Amazon EC2 Is Half As Fast As It Should Be</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/02/the-amazon-ec2-swindle.html" />
    <id>tag:teddziuba.com,2008://1.13</id>

    <published>2008-02-23T23:30:27Z</published>
    <updated>2008-02-28T15:41:54Z</updated>

    <summary><![CDATA[Update: This post is made of fail.&nbsp; I trusted other peoples' benchmarks instead of doing my own.&nbsp; If you want details, go read Don MacAskill's butthurt response on the SmugMug blog.The fun part about running a virtualized server environment on...]]></summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[<b>Update:</b> This post is made of fail.&nbsp; I trusted other peoples' benchmarks instead of doing my own.&nbsp; If you want details, go read <a href="http://blogs.smugmug.com/don/2008/02/27/ec2-isnt-50-slower/">Don MacAskill's butthurt response</a> on the SmugMug blog.<br /><br />The fun part about running a virtualized server environment on a heterogeneous hardware setup is that you can play word games with the specifications.&nbsp; Let's take, oh, I don't know, Amazon EC2 for example.&nbsp; This article is going to be all "science", but the takeaway is this: <b>in Amazon's EC2 environment, you only get half of the CPU performance you would expect.</b><br /><br />When EC2 launched, the specifications for the machine were "the equivalent of a 1.7GHz x86 processor".&nbsp; Crappy by the day's standards, but only a dime per hour.&nbsp; Fine.<br /><br />As EC2 developed, Amazon came up with the idea of the "Compute Unit" to describe the power you get out of the instances.&nbsp; From the documentation:<br /><i><br /></i><blockquote><i><span class="small">One EC2 Compute Unit provides the equivalent CPU
capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor. This is
also the equivalent to an early-2006 1.7 GHz Xeon processor referenced
in our original documentation.</span></i><br /><i><span class="small"></span></i></blockquote><i><span class="small"></span></i><span class="small">I won't get nitpicky about how they think that 2006 megahertz are slower than 2007 megahertz; I just want to show how nebulous the specification is. <br /><font style="font-size: 1.25em;"><b><br />Processes Run Half As Fast As You Think They Should</b></font><br /><br />I figured this little nugget out last week.&nbsp; I had failed a piece of code to the point where an infinite loop would happen in an edge case.&nbsp; It took a while to debug this because looking at <code>top</code> in the EC2 instance only showed 40-50% CPU usage.<br /><br />At the same time, I noticed another metric, the CPU <code>%st</code>, hovering around 50%.&nbsp; This stands for "CPU time stolen", and you'll notice that as your CPU usage rises, so does steal-time.&nbsp; What exactly does "stolen" mean?&nbsp; <i>Time is stolen when your instance requests CPU time but the Xen virtualizer chooses to give that CPU time to something else, such as somebody else's instance.</i><br /><br />I am not the only one to notice this, either.&nbsp; <a href="http://developer.amazonwebservices.com/connect/thread.jspa?messageID=56568&amp;">There</a> <a href="http://developer.amazonwebservices.com/connect/message.jspa?messageID=60958">are</a> <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=16912">threads</a> on the AWS forums by other users who are seeing their code run half as fast as it should, given the specifications for a Compute Unit.&nbsp; These posts are met by dismissive replies from Amazon employees.&nbsp; Great job.<br /><font style="font-size: 1.25em;"><b><br />How They Can Get Away With This</b></font><br /><br />I think that many EC2 users are more I/O bound than CPU bound.&nbsp; If you make a simple Rails app backed by MySQL, chances are you're not going to consistently burn the CPU, so you won't even notice the slowdown.&nbsp; However, if you have some work that <i>is</i> CPU bound, this restriction becomes painfully obvious.<br /><br />They also get to mince words with the <i>equivalent-to</i> metric.&nbsp; You don't actually get 1.7 billion clock cycles per second.&nbsp; This comparison is made by considering the machine as a whole: disk controller speed, memory bus speed, and evidently to a much lesser extent, CPU speed.<br /><br />After doing Uncov, it's hard for me to tell the difference between a swindle and incompetence.<br /></span> ]]>
        
    </content>
</entry>

<entry>
    <title>Good Persai Writeup on Slate</title>
    <link rel="alternate" type="text/html" href="http://teddziuba.com/2008/02/good-persai-writeup-on-slate.html" />
    <id>tag:teddziuba.com,2008://1.12</id>

    <published>2008-02-20T23:25:39Z</published>
    <updated>2008-02-20T23:27:39Z</updated>

    <summary>A controlled experiment to test its learning ability:http://www.slate.com/id/2184810/...</summary>
    <author>
        <name>Ted Dziuba</name>
        
    </author>
    
    
    <content type="html" xml:lang="en" xml:base="http://teddziuba.com/">
        <![CDATA[A controlled experiment to test its learning ability:<br /><br /><a href="http://www.slate.com/id/2184810/">http://www.slate.com/id/2184810/</a><br /> ]]>
        
    </content>
</entry>

</feed>
