Etherplex

Rick Dillon's home on the net…

Author Archive

Audio Blog – Logitech Revue & Google TV

without comments

I’ve decided to try out audio blogging for fun.  I recently got a Google TV unit from Logitech, and these are some of my initial thoughts about it.

Audio

Written by Rick

October 29th, 2010 at 10:41 am

Posted in Audio Blog

The Google-Verizon Net Neutrality Proposal: Absurd Coverage

without comments

The “Google-Verizon Deal“, as everyone seems to be calling it, is not a deal at all, but rather a proposal whose intended audience is primarily the government and perhaps other corporate stakeholders in the internet service provider regulation.  The reactions to the proposal have been overwhelmingly negative, and while I understand why, I thought this might be a good time to engage in discussion about the current understanding of where we are, and where the proposal would take us.

A Working Definition of “Net Neutrality”

It is important to outline exactly where we stand on net neutrality.  First, a working definition: net neutrality is intended to ensure that internet service providers do not prioritize (or throttle) traffic based on the owner of the traffic or the specific application of that traffic.  In general, this is intended to allow actions like optimizing VoIP traffic to minimize latency (so your internet calls don’t have a high delay because someone next door is torrenting the latest Ubuntu ISO).  On the other hand, it is intended to prevent the prioritization of one VoIP service (or client) over another: Vonage, TMobile @ Home and Skype should all receive the same priority because they are all VoIP applications. 

As a good friend of mine said when we discussed it: if you own a website, net neutrality dictates that you shouldn’t be able to go to your customers’ ISPs and buy better access to them.

Do We Even Have Net Neutrality?

Many people believe neutrality is a good idea, including Google.  But there seems to be a misunderstanding on where we currently stand with respect to net neutrality.  Much of the coverage seems to indicate that we somehow already have network neutrality.  We don’t.  We never have.  It is well known that various ISPs reduce bandwidth to particular sites like YouTube because of disproportionate traffic consumption coming from those sites.  Bittorrent has been a whipping boy as well; Comcast actually won in court after throttling consumers’ bandwidth if they used Bittorrent.  So, this concept that seems to floating around that we all live in a net neutral world is false.  NPR’s coverage of the “deal”, as they insist on calling it, is but one example of this misunderstanding:

In a move that could change the landscape of the Internet, Google and Verizon are reportedly close to a deal that would allow Internet service providers to prioritize traffic from certain websites.

Not only does the article call it a “deal” (it is not at all clear that there is any deal) but the phrase “that would allow Internet service providers to prioritize traffic from certain websites” makes it sound like they currently can’t.  But NPR is not the only reputable news source to get it wrong.  In the article from the New York Times covering Comcast’s win in court, they said:

A federal appeals court ruled on Tuesday that regulators had limited power over Web traffic under current law. The decision will allow Internet service companies to block or slow specific sites and charge video sites like YouTube to deliver their content faster to users.

Note the phrasing: “The decision will allow Internet service companies to block or slow specific sites”.  Embedded in that phrasing is the notion that prior to this decision, companies could not do this.  But, there wouldn’t have ever been a court case if that were true.  The reason Comcast was brought to court was because they engaged in this activity.  The court essentially clarified the current situation on net neutrality: there isn’t any.

I don’t know how to make this any clearer, so I’ll just say it: we do not currently live in a world in which net neutrality is a reality.  Net neutrality is an idea that a lot of people agree with (like world peace), but it isn’t real, either in the wired networks that run to our homes and businesses or the wireless networks that we use on our phones.  The only news coverage I’ve been able to find that actually acknowledges this reality is the article on TorrentFreak discussing this exact issue:

Seriously, we don’t understand where all the hatred towards Google comes from. The proposal is not going to destroy Net Neutrality, simply because Net Neutrality doesn’t exist yet.

My sentiments exactly.

But, that doesn’t stop the vitriol from spewing forth from publications like eWeek, The Huffington Post, The Last Watchdog, and even the very respectable Ars Technica, who dubbed the proposal a “flip-flop”.

A Step Towards a Common Understanding

The ISPs’ Position

So, it is in this context that we come to the Google-Verizon proposal.  After a decade of stagnation on the net neutrality front (or even a regression, if you count Comcast’s win) both ISPs and websites want some certainty in a highly uncertain landscape.  On one hand, many internet service providers also engage in other businesses, and may wish to provide “private” services alongside the broadband internet service.  This usually includes legacy information dissemination mechanisms, most notably television service, but also other services like VoIP.

Let’s take an example using VoIP, which would be a bundled service in a package like AT&T’s UVerse.  Back in the old days when VoIP was newer, I remember having trouble with Vonage; if I were downloading a large file (let’s say I was executing a large apt-get install command and my Linux computer) and my friend called, I would answer the phone and they would immediately complain: “Hey, Rick, I can’t hear you.  What’s going on?”  This was a real problem, and while it’s gotten better (as bandwidth has increased), there is an idea that providers should be able to identify latency-sensitive types of traffic and prioritize them accordingly.  Hopefully that is something we can agree on, because it has nothing to do with net neutrality, because it isn’t about service providers buying better access to customers.

Here’s where it gets interesting.  If you do decide to buy AT&T UVerse, should AT&T be able to bundle in phone service and make guarantees that the phone service won’t have choppy audio, even when you saturate your entire bandwidth with a torrent you’re downloading?  What about TV?  Should AT&T be able to guarantee that your TV channels still come in clearly and without horrendous compression artififacts even if someone in your home is watch Netflix for Hulu or downloading Bioshock off of Steam?  As I read the Google-Verizon proposal, this is what they mean when they talk about service providers being able to provide “differentiated services”.  Everyone should be asking “Differentiated from what, exactly?”  I think the answer is differentiated from “normal” or “public” internet.  The internet you’re using to read this post.

But let’s explore what happens if we don’t let providers do this.  Consider the same example.  Currently, cable providers already carve out a chunk of the data coming over the wire for channel information, but no one really cares, because it operates independently of the piece carved out for the “public” internet.  The provider is sending prioritized data, but since people don’t think of it as being on their internet connection, they don’t seem to mind.  Now consider the case in which cable providers wanted to switch to an IP-based distribution mechanism, opening up the rest of that coax cable for internet use, but prioritizing their own video streams so that if someone was watching TV, they would be guaranteed a good picture.  Even though this scenario would be a win for all players, it would violate net neutrality in its purest form.  Enforcing pure net neutrality in that case would hinder progress.  So, Google and Verizon introduced the concept of these “differentiated services” that I imagine would include things like VoIP and TV service.

But that’s not the whole story.

The Web Sites’ Position

On the other side of the debate is the web sites that are engaging in significant research and development to introduce new, competitive offerings that challenge traditional business models.  Netflix, Youtube and Hulu come to mind.  These websites have to deliver their services over a wire that is owned by the very companies they are competing with.  In the absence of network neutrality, that poses a very risky proposition.  Since businesses like these have enormous up-front investments, there is a big risk that as soon as they make those investments and become relevant, their competitors like Verizon, Comcast and other digital media providers will drop the hammer on them.  So, in the interest of maintaining innovation on the web, it is vital that these companies have some kind of assurance that their competitors won’t unfairly deprive them of their right to compete on the basis of their products’ and services’ merit.  That assurance is network neutrality.  The need for some kind of regulation in this regard is quite clear.  But why?

The one remaining piece of the puzzle lies in the fact that like so many utilities (water, power, telephone), wired internet providers have a virtual monopoly.  The right way to handle all this would normally be through the free market; if an ISP ruined your experience watching Hulu so they could push you their own video streams, you would simply switch to another that didn’t do that.  But that’s not possible, since providers have a stranglehold on the geographic location in which you live.  Unless you’re willing to pick up and move so you can get better internet access, the lack of competition is a real problem.  That’s the motivation for government regulation.

Wrapup

So where does that leave us?

Well, given that we don’t have net neutrality in either wired or wireless forms yet, and given that we all agree that it would be a good thing to have, I have to say that while I’m a bit disappointed by portions of the current proposals (both those coming from the FCC and those drafted by Google-Verizon), after years of making no progress, it is good to finally get some movement on this.  Getting formal, public agreement that public internet should operate in a neutral way is a big step: a step we haven’t seen before.

I think it is clear that we will need wireless net neutrality as well, although I agree that we’re still figuring out exactly what wireless networks will look like.  The market is still changing very fast in the wireless space, with very distruptive changes (like flat rate, capped or metered data plans) still being figured out.  As phones become more like mini-laptops and laptops replace laptops, the importance of wireless is undisputed.  How exactly to manage the complexity of a such a dynamic market is another question which Google and Verizon have rightfully (in my humble opinion) decided to postpone resolution of.

Written by Rick

August 13th, 2010 at 11:37 pm

Posted in Web

Org-Mode Powered Literate Programming

with one comment

One of my first projects to push to GitHub was my Emacs initialization files. Emacs is precisely as powerful as Neal Stephenson suggests, but I find that people are unwilling to use it because they find it difficult to configure to do what they want. I thought that I might help by not only making my Emacs configuration public, but by using Org-Mode and Org-Babel to make my Emacs initialization a literate program — one that doesn’t just have comments, but that is itself an executable document meant to be read by humans.

I completed the port this weekend, posted it to GitHub, and am making a weave of the file available as a static page here on Etherplex. I’ll be updating it as it changes, and hope someone finds it to be useful.

Written by Rick

July 11th, 2010 at 9:27 pm

Posted in Programming

Code Moving to GitHub

with one comment

I’m a big fan of distributed version control for a lot of reasons, but sites like GitHub and BitBucket really strike at the heart of the issue: real coding should be a social phenomenon, if for no other reason than code is really about sharing ideas, and code should be addressed to human beings rather than to a computer.

The self-hosted Mercurial repositories I used to host at http://code.etherplex.org are now gone, and the subdomain is now a redirect to my GitHub profile, where I’ll be migrating all my active and psuedo-active coding efforts. While I tend to prefer Mercurial, the community at large has spoken, and I’m happy to use Git for the majority of my work if it helps engage the community. So, head on over to Code Etherplex and check out what I’ve posted. Not much yet, but I’ll be pushing a lot of my in-progress work to GitHub in the next couple of weeks.

Written by Rick

July 11th, 2010 at 9:15 pm

Posted in Programming

The Importance of Decentralized Services

without comments

The majority of this post was written before all the Facebook privacy concerns of May 2010 occurred, but those events make the whole issue much more relevant.I commented on a story about a user who loved AIM shortly after Buzz was launched, and, as I have in the past, I got reactions of confusion from some of my followers.

So I wanted to take a moment and outline some of the principles that guided the design of the internet, and identify some recent trends that violate those principles.

Computers and Connections Are Unreliable

When it was first designed, the internet was not a commercial enterprise.  It was designed around the concept that many computers all over the country/world that could talk to one another.  Because the computers are spread out geographically, in order to allow them to talk, they had to be connected by wires.  This led to a situation where wires were strung out across vast distances, and an obvious concern arose that the wires could be cut or otherwise damaged.  Another concern was that sometimes computers crashed, making them unavailable.  This was particularly damaging in the case where computers would send messages to each other through other computers.  For example, if a computer in New York wanted to send a message to a computer in San Diego, it might first hand the message to a computer in Chicago, and that computer would then hand the message to the destination in San Diego.  But what if the computer in Chicago lost power?  That would be a situation very much like a wire getting cut.
So, there was a realization that the network was vulnerable to attack and/or failure.  This led to an attitude being adopted that we couldn’t really count on any particular machine being reachable at any given time.  But, the designers still thought they could make use of the network to accomplish useful things, even with the uncertainty about how the computers were connected.  To do this, they designed the services on the web to be federated.

Solution: Federated Services

A federated service is designed the same way as states are under a federal government.  The United States are a collection of states, but they are joined together as a federation by a federal government.  If California has a budget crisis, the damage is somewhat contained to California; North Dakota can still have a budget surplus and a healthy economy (maybe).  So, the idea was to make services on the internet like that: if one service provider failed, the other service providers would be mostly unaffected.
The most successful example of a federated service is email.  Many different companies, organizations and individuals run mail servers, and those servers form a federation with each other to route mail through the entire system.  Yahoo might lose connectivity to the federation one day, and Yahoo’s users won’t be able to send mail anymore, but everyone else, like my mail server on http://etherplex.org, will still work.
So, federated services avoid having a single point of failure.  That means that in order to shut down email worldwide, there’s no single place that you could destroy; instead, you’d have to destroy thousands of places to make a real dent in the global email system.  There are lots of internet services that implement this model, and almost all of them were designed in the early days of the internet.  Internet Relay Chat (IRC), Usenet (newsgroups), email, and HTTP (web browsing!) are all federated, in that the crash of one computer in the network won’t prevent all the users of the service from accessing it.  This is good!  Imagine an internet where a crash on Microsoft’s web site would prevent users from accessing Amazon’s web site.  Because they are independent sites, this doesn’t happen.
How do you design a federated service?  Well, you get everyone to agree on how the servers should talk to one another.  This is called a specification.  Then, programmers can take the specification and program a computer to do what the specification says.  When they connect that computer to the network, it can now be part of the federation.  So, the specification for the service is openly available.  Because anyone can implement it, another property of federated services is that software that allows a computer to join the federation is often open source, giving even people with limited technical knowledge and resources the ability to join the federation.  There are open source web servers, IRC servers, newsgroup servers and email servers.

The Trend Away From Federation

The idea of federation gained favor before the internet was commercial.  In recent years, the commercialization of the internet has fueled an interest in create reliable servers with reliable connections.  This allows companies that want to make money to create services that no one else has by putting their offerings on reliable servers and not sharing the specification for them with anyone.  Lots of services follow this model: Google (in its search business), Twitter, MySpace, Facebook, Yahoo, AOL instant messenger, Skype, Ventrilo, TeamSpeak, and Apple’s MobileMe are all examples.  Another reason centralization is so attractive to companies is that it allows them to compile information about their users, which provides credible backing for the internet’s biggest money-maker: advertising.  The theory goes that if you know your users well, then you can advertise to them more effectively.
But it’s not just that new services tend not be federated.  Companies have also found a way to “unfederate” the old services, like web sites and email.  Huge email providers, like Hotmail, Yahoo Mail and GMail have so many users that the loss of any one of those services really would cripple the email infrastructure.  Running a web server is fairly easy, but many online startups need to grow their business quickly, and buying computers and hiring an administrator to run hundreds of web servers is harder.  So, Amazon makes their “cloud” of computers available for rent.  As online startups need more computers, they just rent compute power from Amazon, which is cheaper and easier than trying to manage their own servers.  The problem with this is that when Amazon’s collection of computers goes offline, all those companies that relied on them go offline as well.  So, what was once federated is now centralized.

What We’ve Lost, And How We Can Get It Back

What’s the problem with centralization?  Well, it leads to systems that are prone to failure in way federated systems are not.  It makes users dependent on a single company for a service they might have come to depend on.  It allows one entity to collect information in one place about users.  Because centralized services don’t have to play nicely with the rest of the internet, it makes it possible for users to put data into that service, but not be able to get that data back out.  What does it mean to get your data “out” of a service?  With email, it means being able to download it to your computer.  With Twitter, it means downloading an archive of all your posts.  With Facebook, you should be able to get an archive with all your notes, wall posts, photos and chat history.  With Google Docs, it means I should be able to download, in bulk, my documents in a format that can be edited on my own computer.  With a contact list, you should be able to export your contacts to vCard or CSV format.  Some services offer this kind of data extraction, but many do not.  That means that users will spend time uploading and organizing their data with a service, but if they want to take that data elsewhere, they have to start over.  This gives the company a sort of “lock-in” competitive advantage, but is bad for users, since it makes it hard to choose the best service since they’ll tend to stick with the service they are already using because the switching cost is so high.

The Three Critical Questions

So, when you choose to use various services on the web, it is important to evaluate them in terms of both what it costs to join them, and what it would cost to switch away from them.  To crystallize your thinking, it is useful to have some questions already outlined that help you determine whether a service is at risk of locking you in.
  1. Does this service operate with other services of its type?
    If it is a messaging service, social network or chat service, does it allow you to chat with other providers?  If not, then be aware that you’ll have to choose your service based on where your friends are.  This is bad for the consumer, but good for the business: it leads to an avalanche effect in which one service tends to definitively “win”, at least for a while.  See “Facebook”.  Compare the situation with social networks with that of email providers.
  2. Can I only access the service in a web browser, or does it provide a way for other programs to interact with it?
    This is related to the notion that the service provides a way for programmers to access its functionality (this is known to programmers as an “API”, or application programming interface.  It is a form of openness, but by no means guarantees federation: Twitter, for example, has an API, but is not federated.  Still, it’s nice to be able to update Twitter with the tool of your choice, whether it be the browser, a desktop client, or on your mobile.
  3. If I need (or want) to leave this service, can I get my data out of it?
    If it is a service whose value lies in storing your data, how easy is it to get you data out of it, into a standard format that you could import into a new service or program?  For email, usually you can extract your data over POP or IMAP and store it however you like.  For social networks, this topic is still largely unexplored.  For photos, there are services, like Picasa, that allow entire albums to be downloaded at full resolution.  Other services, like Facebook, permanently degrade the quality of the photos uploaded, and provide no mechanism to even get those back to your computer.
AIM supports instant messaging, but so does Jabber (which is what powers GTalk), and Jabber can interact with many chat providers.  A federated version of Twitter exists called identi.ca, which supports OpenMicroBlogging, a standard specification for Twitter-like services (that Twitter itself doesn’t implement!)  One of the reasons I support Google more often than its competitors is that they stand out as a company that supports federated services more than any other major internet player.  From Google Wave to WebFinger, Google integrates federated services into their architecture whenever possible.  When they deployed a competitor to AIM and ICQ, it was Jabber-based.  When they deployed a successor to email, it was open and federated.  It’s good to be on the look-out for companies that understand the network and understand that the health of the internet fundamentally relies on federated services.

Written by Rick

June 20th, 2010 at 9:20 am

Posted in Web

Thoughts on Apple’s Hypocricy

without comments

This one is going to be as short as I can make it, and to the point.  Apple is getting more and more ridiculous in their anti-Flash arguments.  Anyone who knows me knows I hate Flash (because it breaks the web…especially keyboard-based control of my browser), but it should be my choice whether to use it, not Apple's.

So, I brought this up a few weeks ago when Steve Jobs posted his Thoughts On Flash.  Taken out of context:

"Adobe’s Flash products are 100% proprietary. They are only available from Adobe, and Adobe has sole authority as to their future enhancement, pricing, etc. While Adobe’s Flash products are widely available, this does not mean they are open, since they are controlled entirely by Adobe and available only from Adobe. By almost any definition, Flash is a closed system."

Everyone that reads the post will know I pulled this out of context…but his passing reference to Apple's proprietary products doesn't even begin to scratch the surface of how absurdly closed the whole iPhoneOS ecosystem is.  Apple is guilty of all that and more.

But Jobs has a plan.  And that plan is HTML5.  Apple's hypocrisy has reached new heights with the release of the HTML5 Showcase, a source for applications that don't use Adobe's proprietary add-ons to the web.  No, these apps are based on "web standards [that] are open, reliable, highly secure, and efficient. They allow web designers and developers to create advanced graphics, typography, animations, and transitions. Standards aren’t add-ons to the web. They are the web. And you can start using them today."

Awesome, let's get started!  Oh wait:

So…let's get this straight — Apple doesn't want you to download anything from Adobe, but they'll be happy to have you install a new browser.  At least Flash is available on my Ubuntu laptop that I'm typing this on.

All this is to say: it seems as though Apple is becoming less and less reasonable in its positions as it gains market share.  I recently ditched my Macbook for a Ubuntu-powered Dell Latitude 13n (which I'm typing this on).  I have to say, I haven't been disappointed.  I'll be replacing my Mac desktop as well if Apple can't convince me that this is all some sort of fever-dream aberration on their part.

via Rick’s Posterous

Written by Rick

June 4th, 2010 at 6:48 am

Posted in Web

Larry Lessig on Remixing (2007)

without comments

I feel like I'm cheapening the "Favorite this video" action on Youtube because I want to do it for every TED Talk I watch.  Actually, I'm probably cheapening the TED Talks; they are some of the most insightful, relevant and intelligent material I've ever watched.

Larry Lessig did a talk in 2007 on the shear between the process by which people exercise creativity and current laws that restrict those very creative instincts.

Lessig asserts that the language that "our kids" speak is different than ours, in that we have been raised as a generation of content consumers, but our kids, largely because of the internet, have grown up with the instinct that they are able to both read and write content.  The fact that, in most cases, the participatory nature of of the "write" aspect is perceived to be in violation of copyright laws, is incidental, and effectively serves only to create an entire generation of criminals.

Jonathon Schwartz, when he was CEO of Sun Microsystems, one said that we had moved beyond the information age, and were entering the Participation Age.  As he said, "If the Information Age was passive, the Participation Age is active."

As insightful and well presented talk as it was, Lessig does not really address the fact that people who were born before the United States Civil War began only just (in 2010) had their works move into the public domain.  This issue is tangential to his core closing point, in that elements that deeply define our culture, and that were written before any person on the planet was born, somehow are still under copyright.  Lessig talks of laws violating common sense, and I think our current copyright terms clearly are among them.  It's too bad he didn't broach the topic in his talk.

via Rick’s Posterous

Written by Rick

May 13th, 2010 at 7:46 am

Low Learning Curve

without comments

In computers, why is "easy to use" the metric everyone cares about?  I was listening to some Linux-inspired electro-industrial today at 5:50 AM on Jamendo (long story), and the vocal track started off with "I've found it a very very easy to use system."

Forget easy to use.  No one gets into a Corvette or a Porsche and says "Oh yeah, this is so so easy to drive."  Heck no.  Those are cars that would shred a beginning driver.  Good, because those cars are optimized to be awesome, not to conform to some idealized notion of "easy".  But enough about cars.

Linux is optimized for power.  As the man page for eshell says:

The role of a command shell is to give you more control over what

your computer does for you.  Not everyone needs this amount of control,
and it does come at a cost: Learning the necessary script commands to
express what you want done… But if you find yourself using your

computer frequently enough, it is more than worthwhile in the long run.
Any tool you use often deserves the time spent learning to master it.

Emphasis mine.  Optimizing for a beginner is a huge mistake, in my opinion.  Sure, if you want to make a lot of money in this early stage of computer development, when adoption isn't very high yet, then it makes sense to optimize the entire experience for beginners.  But in the long haul, we will develop a population of experienced users, not beginners.  And once the average users has not years, but decades of experience with computers, shouldn't we admit that any tool you use that much deserves the time spent learning to master it?  And, given that you are going to master a tool, it makes sense to choose a tool worthy of your time.  That should be the analysis new users should be making, rather than seeing how much they can get done in the first 15 seconds using the system.

As the ironically defunct Ion Window Manager's author, Tuomo Valkonen, said (before leaving Linux and developing solely for Windows):

So-called “modern desktop environments” converge on total unusability, and present-day mainstream graphical user interfaces in general are far less usable than they are praised to be. Usability simply does not equal low learning curve, and hiding system details from the user, as the Official Truth seems to be these days.

He was right.  It's too bad he left Linux to develop closed software for Windows.

via Rick’s Posterous

Written by Rick

April 25th, 2010 at 5:23 am

Posted in Emacs,Programming

Speed Problems: C vs. Gambit Scheme

with 7 comments

My Gambit Scheme code is taking 500 times longer than the equivalent C program, and I don’t know why.

So, there’s a really horrible way to spend processor time to calculate pi that involves taking the unit square and inscribing a circle inside it with radius 1/2.  You then partition the square into N partitions on each axis (the code below uses 12,000).  This gives you a unit square and places it on a grid with 12,000 on each side, for a total number of grid squares of 12,000^2 = 144,000,000.  The algorithm then iterates through the center of each square and checks to see if it is inside of the circle.  It sums the number of points inside the circle, divides it my the total number of points, and multiplies by 4, which produces an approximation of pi.

For those already initiated, this is like a deterministic Monte Carlo approach.

Here’s the C implementation (from the professor of my Architecture of Parallel Computers course):

#include <stdio.h>

int main(int argc, char*argv[])

{
  int numPartitions = 12000;
  int circleCount = 0;
  double interval = 0, pi = 0;

  int i = 0, j = 0;

  interval = 1.0/(double)numPartitions;
  for (i = 0; i < numPartitions; i++) {

    double a = (i + .5)*interval;
    for (j = 0; j < numPartitions; j++) {
      double b = (j + .5)*interval;

      if ((a*a + b*b) <= 1) circleCount++;
    }
  }

  pi = (double)(4*circleCount)/(numPartitions * numPartitions);

  printf("Estimate of pi is: %10.8lf\n", pi);

  return 0;
}

Here’s the (mostly equivalent, I hope) Scheme implementation:

(define (main args)
  (let* ((partitions 12000)
         (increment (expt partitions -1))
         (count 0))

    (do ((y 0 (+ 1 y)))
        ((= partitions y) (* 4 (/ count (* partitions partitions))))
      (let ((b (* increment (+ y .5))))
        (do ((x 0 (+ 1 x)))

            ((= partitions x))
          (let ((a (* increment (+ x .5))))
            (if (< (+ (* a a) (* b b)) 1)
                (set! count (+ 1 count)))))))))

(display (string-append (number->string (exact->inexact (main '()))) "\n"))

OK, so, running these on my three-year-old Intel Core 2 Duo T7200 (under Linux 2.6.31), the C version takes 1.03 seconds, consistently.  The Scheme version, compiled with Gambit Scheme 4.6.0, takes about 8 minutes 19 seconds.  I am using a complied binary of the Scheme code, and Gambit was built for the machine I’m running it on, i.e. –enable-single-host was supplied to the configure script.

So, the point of this post is not really that Scheme is slow — in fact, I vastly prefer it.  Rather, I’m looking for some input from people more knowledgeable in Scheme as to what I’m doing wrong here.  I assume do is well optimized, but I’m I suffering because of the let* or nested lets?  What’s killing my performance?

I’ll try to profile it, but I’m not sure how to do that in a way that traces back to the Scheme source after it’s been compiled and linked.  The is the first time I’ve used Gambit (I used PLT in the past, and I’ve done quite a bit of work in Clojure on the JVM), so I could use advice from anyone that knows the C or Gambit environments.

Written by Rick

March 14th, 2010 at 8:36 pm

Posted in Programming

RSI Woes, Finally Solved

without comments

I've had RSI/carpal tunnel syndrome for about ten years now, and last week, I finally found a solution that didn't involve surgery.

A Tiny Bit of History

My freshman year I enjoyed my new-found freedom in a few different ways, but one way playing computer games whenever I felt like it. I played a lot of Quake online. Then Quake 2 and Quake 3. Half-life and Counterstrike held my attention for a few months. By the time I got into Everquest, my wrist had already accumalated probably close to five thousand hours of mousing time, and my main character in Everquest accumulated close to 120 days of play time before I finally quit. During that time, I didn't think much about my wrists, but my bad habits caught up with me shortly after graduation (in 2000), and my desktop gaming really declined because of persistent wrist pain in my mousing hand.

Possible Solutions

I didn't give up without a fight, mind you. I tried more ergonomic mice, switched to trackballs to minimized wrist movement, added various wrist braces, consulted with ergonomics professionals on the height of my desk and chair, and used various wrist rests. As a professional programmer, I've optimized all my programming (and other computer use) around extensive use of the keyboard. This ended up being a good thing simply because it sped everything up so much, but the wrist problems remained; even after just a few minutes of using a mouse (rather than a trackball), my wrist would start to flare up with pain that could last hours or even a whole day.

VerticalMouse to the Rescue

In addition to surgery, I had looked at another possible soluion: the Evoluent VerticalMouse 3. It feel neatly into the it-might-work-but-it-will-cost-$100-plus-shipping-to-find-out category. There are lots of products that didn't quite work, and there was no reason to believe the VerticalMouse would be the solution.

Last week, however, I got to talking to some of my friends about my ongoing problems, which they'd all heard me complain about for the past 5 or so years. We discussed making some kind of homegrown solution, and as we were engrossed in that discussion, one of my friends slid his phone over to me to show me an email reciept for the VerticalMouse he'd just purchased as we had been talking, as if to say "Screw it, if you're not going to give this thing a shot, I'll force you to by buying you one!".

Two days later, it arrived, and I swapped out my Logitech Cordless Optical Trackman (awesome trackball, by the way) for the VerticalMouse, and after more than 20 hours mousing with it this past week, in both games and on the desktop, I can safely say it has resolved 95% of my problems. It's actually a pretty nice device. It has native 1200dpi resolution, and the wireless version is very responsive, since it never shuts the optical sensor off. Despite always being on, it still has about a three month battery life when running on a fresh pair of AA alkalines.

I can't say exactly how the VerticalMouse works for others, but it has really helped me. I have no vested interest in pushing the VerticalMouse, but maybe someone who has had similar problems might find my experience to be an interesting data point in their searches for a solution.

via Rick’s Posterous

Written by Rick

February 10th, 2010 at 8:06 pm

Posted in HowTo