Archive for June, 2009

C#: Poisoning the well

RMS has just published a position paper against Mono.  FTA:

Debian’s decision to include Mono in the default installation, for the sake of Tomboy which is an application written in C#, leads the community in a risky direction. It is dangerous to depend on C#, so we need to discourage its use.

The problem is not unique to Mono; any free implementation of C# would raise the same issue. The danger is that Microsoft is probably planning to force all free C# implementations underground some day using software patents.

This is the worst sort of fear-mongering.  First of all, in addition to the better-known Mono project, the FSF has their own free C# implementation.  The reason you haven’t heard of it is because it’s unable to compete on merit with Mono; its only (purported) advantage is its GPL licensing (Mono’s licensing is more piecemeal: GPL, LGPL, MIT, depending on the component).

Note that RMS is merely poisoning the well here; Microsoft is “probably planning” this or that, but there’s no halloween document; there’s no evidence of Microsoft every suing anybody over .NET; in fact the only public interaction Mono and Microsoft has had is to announce the (Mono) Moonlight project as the official Linux implementation of Silverlight.  This means that a key part of Mono is the official, Microsoft-supported way to use C# code on Linux.

Oddly, Stallman has no problem with plain old C, which is covered by numerous patents by another convicted monopolist, AT&T.  If his argument was ideologically sound, he would oppose C, C++, and every other popular programming language that FSF software is written in.  In fact, he only opposes languages like Java and C#, which pose a credible threat to C/C++ popularity, which the FSF is heavily invested in, being that they hold copyright on a number of C/C++ tools.  The success of C#, a technologically superior solution for many problems relative to C/C++, which is on equal legal footing with C/C++, which is being used in 100% free software stacks (GPL and MIT all the way down), to advance the cause of Linux on the desktop, is somehow bad and evil.  This is absolutely absurd on its face, even from Stallman’s own purported ideological views.

Jo Shields wrote a fantastic piece a few months ago that is incredibly well-grounded and destroys the entire argument:

Regardless of whether or not any specific patent licenses over ECMA 334 and 335 cover Mono’s implementation of those standards, if indeed such agreements are available (ITWire’s curlish “attempt” to secure such an arrangement aside), the fact that statements have been made in public supporting the idea of royalty-free licensing essentially reduces the financial impact of such infringement to zero. If Foocorp has a license to use patents, under a “non-discriminatory” license, and did not pay for them – then it would be discriminatory to change anyone else for them (breaking the signed terms regarding patent licensing), and as such, those patents lose any financial value. They may, however, still hold non-financial value (such as their use in defending against patent-related attacks), hence not making the patents “free for all” in any understood sense…
The layering of escape routes is extensive in Mono, especially Mono in Debian/Ubuntu. In the first instance, the contentious Microsoft-sourced non-ISO libraries such as System.Windows.Forms are not included by default, and are rarely used in Free applications anyway (because WinForms looks like ass, amongst other things). If a reason is found to remove these non-standardised libraries, then bam, they’re gone – without harming Free apps.

Stallman is using his prominent position in the Free Software world to spread totally unfounded FUD about a free software stack that is absolutely critical to the success of the free software movement.  While Mono isn’t 100% GPL, it is 100% Free Software according to the FSF’s own definition.  The patent claims Stallman makes vague reference to is nothing more than FUD.  ”Discourag[ing] people from writing software in C#”, as RMS advocates, is completely at odds with his own ideological positions on free software.  The only possible downside is that Microsoft might get some good press, and the FSF would have to concede that Microsoft might have a few good ideas.  This sort of Us vs. Them thinking has no place in a rational discussion, and it saddens me to see a once-great software leader now doing so much to destroy his own movement.

If two people see the same color differently…

It’s time to put this failed thought experiment to sleep for good.  Here’s a simple way to remove 99% of the cases:

Consider the color spectrum (ROYGBV).  Now consider a bizarro person who has two colors randomly flipped in their own private spectrum (such that they perceive ROYGBV to be RGYOBV).  WTF?  Now we have green in between yellow and red , when, by definition, any transition from red to green must include yellow.

Similar arguments exclude all but the complete inversion case (I got this far in fifth grade.  Science is finally catching up!)  And for that, we turn to Wikipedia:

Realistically, since the spectrum of color is only a section of the much larger electromagnetic spectrum, an inverted frequency of electromagnetic radiation (not just visible light) would cause catastrophic physical problems far greater than an altered perception of color. Most supporters of the “Inverted Spectrum” argument have an illogical understanding of colors and their corresponding frequencies.

And check out this ridiculous quote:

In his book I Am A Strange Loop, Douglas Hofstadter argues that the inverted spectrum argument entails a form of solipsism in which people can have no idea about what goes on in the minds of others– contrary to the central theme of his work. He presents several variants to demonstrate the absurdity of this idea: the “inverted political spectrum”, in which one person’s concept of liberty is identical to another’s concept of imprisonment; an inverted “sonic spectrum” in which low musical notes sound like “high” ones and vice versa (which he claims is impossible because low sounds can be felt physically as vibrations); and a version in which random, complex qualia such as riding a roller coaster or opening presents are reversed, so that everyone perceives the world in radically different, unknowable way

And then this guy completely runs away with it, and finally explains that crazy image I always see in the Mac color calibrator:

So is color real? Well, photons with specific wavelengths seem to correspond to specific colors. But the interior of the CIE 1931 color space is a representation of the a most ridiculously abstract concept, labels that aren’t even labels, something our brain experiences and calculates from averaged photon wavelengths. It is an example of what philosophers call qualia – a subjective quality of consciousness.

The joy of electronic books

If you’re anything like me, you read a lot. A lot. I’ve got a collection of around three thousand books. I’ve given up all hope of taking them with me when I move (semi-nomadic student; they don’t even fit in my car). I’ve got a smaller subset of my favorites that follow me around wherever I go–but we’re talking thousands of pounds of paper.

When I was younger, I used to read whole books at a time, but I find that now I primarily use them for reference. Being well-read and having a large supply of material to draw from lets me churn out thoughtful papers in record time. But most of my books aren’t really in the “reference” genre–I might remember a quote by Mark Twain, but who knows which of his twenty or so books I might have to read through before I find it.

Sure, I could bite the bullet and get a Kindle (or just use the iPhone app), but I’m no fan of DRM.  I want to be able to grep and parse my books; I want to read them from various computers I have lying around the house, and I want the images and technical drawings to render well.  I read a lot of old, obscure books that Amazon and Co. will never get around to digitizing.  Plus, I’m a poor college student, who doesn’t want to re-buy every book he already owns in digital format.

So, with a little trepidation, I decided to embark on a quest to scan and digitize every book I own. I’ve been at this in my spare time for several months now, and I’ve got it down to a science. It’s really not as bad as you might think once you know the pitfalls to avoid.

Step 1: Get the cover off. This is often the trickiest part of the entire enterprise. Paperbacks covers can be carefully peeled off (I’ve torn a few). Hardbacks will require you to slice through the cover lining.

Step 2:

books

Take the bound pages to a printshop and get them to cut it into loose-leaf pages. Most printshops will cut a book for about a quarter; I found an on-campus bookshop that does it for free.

Step 3: Scan. I found an awesome scanner for my mac, the ScanSnap S510M (no, I am not getting paid):

scansnap

This thing has the smallest footprint I have ever seen, and it burns through my textbooks faster than can be described. I can burn through a small paperback in 5-6 minutes, and large reference works like von Mises’ thousand-page Human Action over the evening news. I got it for a mere $350 refurbed on NewEgg, and it’s the best $350 I’ve ever spent.  Don’t let its cute appearance fool you, this scanner is SERIOUS.

4. OCR. OCR software for Mac is notoriously bad. The stuff that comes with the ScanSnap is actually quite decent, although rather slow. Fortunately it requires no interaction of any kind, so you can just let it run and come back later. For text-and-illustration kinds of things, I leave it on “text and images only.” There’s another option that embeds the text in an invisible layer under the page image, which creates much larger files, but you have the original page to refer to, which works well for complex diagrams and such. I’ve also looked at both ReadIris and OmniPage, and have been rather unimpressed.

5. Binding: For awhile, this was the slowest part; I would add ten pages or so and apply some glue, wait a few hours to dry, repeat. Then I discovered gorilla glue. This stuff (not the wood glue crap, the real glue) is seriously strong–strong enough to bind everything with just one or two layers. I stack all the pages in between two phone books, clamp them with some c-clamps, and apply a layer of Gorilla Glue:

glue

In an hour or so, my book is bound more firmly than it was the day it was printed. Another dab of glue puts the spine on, and that’s about it! Finished result:

Grepping through Harry Potter:

picture-36

Reading on my iPod with Stanza:

stanza

Spotlighting for “Narnia” in my (still-incomplete) library:

picture-37

Did C.S. Lewis ever say anything about the Snow White Disney movie?

picture-4

Let’s hand my phone to a friend so he can see what books are on my shelf:

img_0295

I should be on track to digitize EVERYTHING by this summer.  What I’ve learned:

  • Having my whole library on my iPhone vastly changed my definition of “reading time.”  Now, I can catch a paragraph while I’m waiting at the checkout line.  It’s one tap to bring up the last book I was reading with the correct page.
  • I find myself reading–really reading–more than I’ve ever done since childhood
  • Spotlighting a personal library is ridiculously powerful.  You feel almost giddy.  ”I don’t know the frequency of EM fields, but I did scan this electricity textbook…”  BAM, there’s the answer.
  • You start doing random searches, and the results are scary.  How many books reference the wood chuck chuck question?  Let’s graph my books by publishing date.  Can we use a bayesian network to classify my books by genre?  Can we write a script to rip cover art from Amazon.com?  The possibilities are endless.

Git saves lives

I love git. Now I don’t even need Unfuddle to host code locally, and even EH is pondering using Dropbox+Git as project hosting (even though Unfuddle is worth every penny)

Git saved my life today.

drew$ git checkout master

Hmm, the drawing code’s not fast enough.  Let’s rewrite our Quartz calls in OpenGL.

drew$ git branch opengl
drew$ write-code
drew$ git commit -a -m "OpenGL support!"

Hmm… it’s faster, but not quite fast enough. Plus, this quick GL prototype is buggy relative to my old Quartz code. Let’s roll back to our master branch and see if we can’t optimize somewhere else instead.

drew$ git checkout master
drew$ write-code
drew$ git commit -a -m "Improved polygon processing code!"

Hmm. It’s better, but it’s not fast enough.

You know, if only there was some way to get this attempt and the last attempt in to the same working copy. There’s no way though… I’ve edited the same line of code in some places. If it’s anything like on Subversion, conflict resolution’s gonna be a nightmare. Worth a shot, I suppose.

drew$ git merge opengl
Applying: Working on opengl
Updating e2285f1..55a600e
Fast forward
Classes/sketchitViewController.m |  103 +++++-----------
sketchit.xcodeproj/drew.mode1v3  |   10 +-
sketchit.xcodeproj/drew.pbxuser  |  251 ++++++++++++++++++++++++++++----------
3 files changed, 219 insertions(+), 145 deletions(-)
drew$ 

WTF! That can’t be right.

drew$ xcodebuild
Project built succesfully.

WTF! There has to be something wrong with this.

[Run program]
[Realize program is now fast enough]
[Realize git just saved your sorry behind]

But then you say, wait! I can’t use git! I have to commit to this svn repository! I can’t switch! There’s no way the people on my team are smart enough to use git! They’re married to their little tortoiseSVN GUI!

Behold, from the manpage of the gateway drug git-svn:

Once tracking a Subversion branch (with any of the above methods), the
git repository can be updated from Subversion by the fetch command and
Subversion updated from git by the dcommit command.

Unfuddle Rocks!

I’ve been an Unfuddle user for the last few years.  Unfuddle powers my personal projects, Experiment House stuff, and the research project I’m working on.

The Simplex Engine is one of the first projects Bion and I worked on (Bion and I are now Directors at EH).  It was going to be a 2D/3D combo game for XNA.  We got really far, but ultimately scrapped it for a variety of reasons.  At any rate, it’s been dormant for years now.

A few days ago, I got this e-mail from Unfuddle Support:

Earlier today, at approximately 10:15EST, the server upon which your Unfuddle account (simplexengine.unfuddle.com) lives experienced a hardware failure with its attached storage (an Amazon EBS volume).

Immediately upon failure, we contacted the Amazon support team and began the process of diagnosing the problem. At approximately 20:00EST, the hardware failure was remedied, the volume was restored and all Unfuddle accounts on that server were available as normal.

Why did we take so long to respond? Unfuddle keeps hourly snapshots of all customer data, so it would have been possible from the very moment of the outage to revert to a saved snapshot. However, doing so would have caused everyone on the server to lose approximately one hour of activity on their account — a situation we clearly wanted to avoid. As we worked with Amazon throughout the day, it was looking probable that the data on the volume would be recoverable, avoiding any data loss. However, only in the early evening was it actually guaranteed to us by Amazon the volume was intact and had been recovered successfully.

As many of you know, we have been with Amazon EC2 since the beginning of this year and this is the first significant outage we have experienced since then. Our current data partitioning and snapshotting scheme has been excellent at mitigating risk for our customers. Even today, only about 7% of all Unfuddle accounts were affected. However, we do not consider this outage to be acceptable, and in hindsight we should have probably not waited for the volume to be rebuilt, but rather restored directly from the last viable snapshot.

This morning’s events have given us some very practical ideas as to how we can even further improve upon our snapshotting strategy so that this kind of hardware failure is even less likely to affect our customers in the future. We are already working on implementing these changes.

I want to personally apologize for the disruption that this outage has caused you and your teams. As a software development team ourselves, we truly understand the kind of problems that this has caused. I know that for many of you, there is nothing that we can do to replace the time lost. However, as we take this type of incident very seriously, we will be automatically waiving your entire June payment.

If you have any questions, please do not hesitate to contact me personally.

Kind Regards,

Josh


Joshua W. Frappier
Chief Unfuddler
Unfuddle LLC

This wins all sorts of awards. Working tirelessly to save me from having to do a 1hr rollback on a project that’s years old? (No, none of my active projects were affected). For data that everybody has a local back up of anyway? (Hey, it’s version control). For a problem that’s Amazon’s fault? This level of customer support (and “admission” of “responsibility”) completely blew me away.

Return top