C#: Poisoning the well

June 28th, 2009

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.

Author: Drew Crawford Categories: Uncategorized Tags:

If two people see the same color differently…

June 20th, 2009

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.

Author: Drew Crawford Categories: Uncategorized Tags:

The joy of electronic books

June 10th, 2009

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.
Author: Drew Crawford Categories: Uncategorized Tags:

Git saves lives

June 5th, 2009

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.

Author: Drew Crawford Categories: Uncategorized Tags:

Unfuddle Rocks!

June 5th, 2009

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.

Author: Drew Crawford Categories: Uncategorized Tags:

OS X and posix.1b RTS extensions

May 15th, 2009

Why doesn’t OS X support POSIX.1b?  No, really?

I’m working on writing a threadsafe compiler as part of my research project this summer.  The RTS extensions allow you to send an integer or pointer along with a signal (via the sigqueue function).  Unfortunately, sigqueue and much of RTS is missing from OS X Leopard, as it’s an optional part of the SUS / UNIX 03 spec.

The really odd thing is that it implements enough of POSIX.1b to receive integers/pointers from a sending process, but not enough to send them.  WTF?

Any thoughts on portably sending an integer value between process in a high-performance way?  Pipes just don’t seem as clean as a sigqueue call…

Author: Drew Crawford Categories: Uncategorized Tags:

Summer Employment

May 14th, 2009

I ended up accepting a part-time  research position here at LeTourneau University.  I’m also doing some contract iPhone work, and working on my startup.  I think this turned out to be the perfect mix of interesting, fun projects that let me work from my room on my own equipment, pay well, and feel really rewarding.

So how did the job search go?

Note:  I won’t identify the companies I talk about by name unless they specifically promote themselves as having a unique/positive hiring methodology.  I think that’s fair to everyone.

Google

I was really excited about interviewing with these guys.  Unfortunately, I was rather disappointed.  One phone screen was a no-show, and the other was half an hour late.  There was a stack of questions HR forced them to ask that they seemed very disinterested in, and skipped half of them to get to their own questions, which were largely (but not entirely) trivia questions about obscure sorts.  The HR rep was (surprisingly) very helpful, and was open and honest throughout the entire process.  Google is a very big company, and my sampling size was very small, but I find it hard to shake the impression that they seemed rather interested in things that could be found in any reference book or through their own search engine rather than algorithmic thinking.

Fog Creek

Overall, I had the best experience interviewing with these guys.  They were very professional, asked great questions, were timely, and very open and honest.  My only real complaint is their excessive reliance on the phone interview, which I argue is a few steps removed from actually coding.  In the real world, it’s perfectly acceptable to think before you code, but on a phone interview, spinning your wheels for a few minutes is a no-no.  They also seemed particularly tied to C, which is a great language, but I got the strong impression that someone with a few years of C would do better in their process than a great hacker with little C experience.  Ultimately, though, I think they’ve got quite a bit going for them.

Unnamed SF-bay area startup

These guys hired a consultant that was incredibly unprofessional.  On four separate occasions I was confused with another applicant (I received one e-mail, two phone calls, and almost interviewed as someone else).  I was asked to choose an interview timeslot, after which a week would go by before I was informed that the timeslot was now filled.  The only reason I continued with the process was because the company’s reputation was very strong and their problem domain was interesting.  For anything less than a steller company, I would have moved on the first time I got a mis-addressed e-mail.  Think before you let a consultant represent your firm.

This company opened with a written exam, which I blew out of the park (writing, for me, is much closer to coding than talking on the telephone).  They followed it up with two phone screens: I did well on the first, but there was so much consultant fail for the second interview that I was a little exasperated and certainly wasn’t on top of my phone-interview game.

Unnamed YC startup

I’m an avid Hacker News reader, and YC startups hold a special place in my heart.  This company opened with a coding exercise (woot!  Actually hiring me based on code I write!).  I came up with a decent solution, and included a paragraph of text about why I chose this solution, drawbacks and bottlenecks, and gave some O-notation.  They made me an offer on the spot.

Unfortunately, their offer was about half what I made last summer, and about a quarter of what I can make as an iPhone contractor.  Plus the cost-of-living differential between SF Bay and where I currently live is huge.  So in spite of their awesome office, cool product, and YC-ness, I couldn’t justify taking a huge pay cut and moving across the country.

What I learned

I learned that my strengths lie much more in coding than talking about code on the phone.  I need time to carefully think through my code, and for me, that includes copious amounts of silence.  It just doesn’t play well on a phone screen.  I’ve got about a 60% pass rate for a very difficult phone screen–so I can get through 1 fine.  But when you start compounding the probabilities of two or three phone screens, the chances of me getting through are pretty low.  Conversely, my pass rate for people who looked at my code was closer to 90%.

I learned that interview processes are often long and arbitrary, and the longer and more arbitrary it seems, the less likely it is that you’re going to get an offer.  I should have bailed on several of them (to recover my time to work on my startup, school, prep for other interviews, etc.) but I kept hoping things would magically change.

UPDATE: Since press time, someone at Fog Creek has indeed taken a close look at my code, ostensibly in reaction to this blog post.  If you’re reading this, as I said above, you guys were the best and the most professional, and the fact that you actually poked around in response to a random blog entry from an undergrad only confirms that.

I learned that nobody actually reads your resume.  I included several prominent links on my resume to actual websites that I’ve coded, and nobody (NOT ONE PERSON) clicked through the resume links to play with a live site I wrote.  There were also click-through links to actual algorithmic code I’ve written that you can download and stare at (novel approaches to classic CS problems) and nobody (NOT ONE PERSON) clicked through to examine what sort of code I actually write, whether or not I document things, etc.  That was extremely disappointing, as if I were to hire a coder who included either source or live demos on his resume, the first thing I would do is see, you know, what kind of things he codes.

All in all, I think I ultimately found the right mix of good projects at good pay that give me enough autonomy and flexibility.  I’m excited about the things I work on now, which is a good change from schoolwork last semester and the largely-frustrating interview process.  And the people that I’m working with are really top-notch.

Author: Drew Crawford Categories: Uncategorized Tags:

Wow, so it’s been forever

February 26th, 2009

It’s been… over a year since I posted here last? Time for that to change. What’s new?

  • Experiment House.  We can’t really decide if we’re a startup, small business…
  • I’ve been doing some behind-the-scenes music production for music and TV.  All under NDA and uncredited, but hey…  it paid.
  • I’m arduinos… all spread throughout my room.  It’s going to be pretty awesome.  Never done any hardware hacking before, and this is pretty ambitious.  But I can do it.
  • Some really cool algorithm projects.  Check the tab above.
  • Some really cool time hacks, which I hope to blog about soon.  I’ve been making heavy use of Evernote and Dropbox, and I’m working on an awesome top-secret productivity system called Staples that adds hours to my day.
  • I’m looking for work this summer.  Know anyone who needs a top-notch coder?  Have this resume.
Author: Drew Crawford Categories: Uncategorized Tags:

Octavarium Lead Key Solo Vid

January 13th, 2008

I’ve just finished my Octavarium Lead Key Solo vid. You can check it out here.

If you want to hear more of my music, check out my new album, Inevitable Hypocrisy, over here.

I’m also uploading my backing track in both MP3 and RPN (Reason 4) format, in case anyone wants to play with my patches.

Author: Drew Crawford Categories: Uncategorized Tags:

Ignite Video Up!

December 17th, 2007

Check out my Ignite video at http://www.youtube.com/watch?v=HFLHswkdmCs Well… how did I do it?
First of all, I have two pedals. I have a sustain pedal (which lengthens notes) and a patch change pedal, which I’ve set to change Reason’s active track. So whenever I press that pedal down the active track changes, and thus I move to the next series of sounds. Secondly, I’ve designed my tracks in such a way that when I move from one to the next the keyboard zone in which I’m playing remain the same, but the zones in which I am not playing change. For instance, at 1:47 I have a high string part in the upper octaves and more of a synth sound in the lower octaves. I press my patch change pedal at 2:02 while I’m playing the synth part. There is no audible difference, but it remaps the higher octaves to a piano sound which I use a few seconds later at 2:07. Thus I can patch change at my leisure and yet still have plenty of room to include lots of sounds in my performances.

Another interesting tidbit is that sometimes I still run out of room on my keyboard to create enough zones for all the sounds I need to play so I have to resort to interesting tricks. You’ll notice that at 1:30 I have a harmony part in my left hand that sounds an octave higher than the melody in my right–even though on the keyboard it is almost two octaves lower.

As you can imagine all of this leads to a pretty massive Reason rack. In fact, if you add up the total rackspace for this song, my rack is over 72 feet high! I’ve got zoomable rack images at the bottom of the post so you can see just how massive this song really is–there is no way I could ever do this in hardware.

I’m also publishing the backing track I used to make this video in both MP3 and RPS format so you can play this song live yourself. Note that the RNP file requires a massive amount of RAM (Reason swells to consume about 1GB) and the following Refills: Reason Drum Kits 2.0, Reason Pianos, SR Synths 1 R3, and SR Triple Guitar R3. I optimized it enough to work on my machines, but if you don’t have really nice hardware you’ll probably need to optimize it some more.

Check out the front and back of my rack.

Author: Drew Crawford Categories: Uncategorized Tags: