Uncategorized 02 Mar 2010 12:23 pm

Cold Freeze

CPR paddles seem to be working. Blog showing peripheral signs of life. On the verge of entering beta testing on two different iPhone apps, one for the mothership and one for a contract gig.

More to follow soon.

C# & Uncategorized 22 May 2007 07:16 pm

C# on Mac OS X

Turns out it’s a snap to start developing with C# on Mac OS X. The hard work is already done for you. First, download and install the latest Mono framework binary for OS X.

This blog from Brian Ray gives a nice Hello World example. The gist is:

  1. Compile with “/Library/Frameworks/Mono.framework/Commands/mcs hello.cs”
  2. Run with “/Library/Frameworks/Mono.framework/Commands/mono hello.exe”

TextMate fans can have it even easier. This close-to-anonymous C# TextMate bundle gives us the basics, including syntax coloring and some handy tab-completions. Install it by unzipping it and opening the bundle file. TextMate will install it for you.

To add a Run command, open the TextMate Bundle Editor, select the crisp new C# bundle, and add a New Command to it.

EXE_FILE=`echo $TM_FILEPATH | sed -e 's/\..*$//'`.exe
/Library/Frameworks/Mono.framework/Commands/mcs $TM_FILEPATH
/Library/Frameworks/Mono.framework/Commands/mono $EXE_FILE

picture-2.png Then, write your code and hit Cmd-R to compile and run the current source file. Snap!

Life 12 Feb 2007 11:53 am

The Return of Clamtar

WFMU presents The Giant Stringed Instruments of The Yi People. If you thought Clamtar was intimidating, behold The Son of Clamtar:

Son of Clamtar

Rails 12 Feb 2007 07:11 am

Flaming Hoops: Rails Logging Tricks

Many people enjoy the sideshow carnival cliche of mammals jumping through flaming hoops. It’s quick, it’s fun, and it invokes a harmless façade of danger. In that vein, this new series of hoop-vaulting articles will push against the bumper-guards of the average Ruby on Rails playground, exploring faux danger and hopefully providing some light entertainment.

This first batch of tips fiddles with unit test logging by tweaking the test/unit/test_helper.rb file. By default, when you run rake test:units from the top level directory of your Rails application, all logging output goes into log/test.log. If that’s not good enough, if you want a different name or location for your test output, the change is easy. Add this to the end of test_helper.rb:

TESTLOG = File.expandpath(”#{RAILSROOT}/log/flamey-test.log”) ActiveRecord::Base.logger = Logger.new(TESTLOG)

If you’re writing a standalone ActiveRecord application outside of a Rails environment, you’ll have to explicitly create and assign a logger yourself. The easiest solution is to pass Logger.new a simple file name.

ActiveRecord::Base.logger = Logger.new(”test.log”)

Unfortunately this will drop the log file into whichever relative directory you run the tests from. What you probably want is to anchor it to the test_helper.rb file (which you’ll also have to create yourself in a standalone application).

TESTLOG = File.expand_path(File.dirname(FILE) + “/test.log”) ActiveRecord::Base.logger = Logger.new(TESTLOG)

A slightly better place is in a log directory, sibling to the test directory:

TESTLOG = File.expand_path(File.dirname(FILE) + “/../log/test.log”) ActiveRecord::Base.logger = Logger.new(TESTLOG)

More tips on the flip side…


Continue Reading »

Rails 11 Feb 2007 07:37 pm

Nginx at 10,000 Feet

Lately, five letters have begun to rattle around the Ruby on Rails universe with increasing frequency: nginx (allegedly pronounced “engine x”). This new toy is a reverse proxy HTTP server that can serve as a high-performance, lightweight replacement for Apache. In particular, it works well as a load-balancing front end for a Mongrel cluster running a Ruby on Rails application.

According to one elated nginx user:

The only solution I know of that’s extremely high performance that offers all of the features that you want is Nginx… I currently have Nginx doing reverse proxy of over tens of millions of HTTP requests per day (thats a few hundred per second) on a single server. At peak load it uses about 15MB RAM and 10% CPU on my particular configuration (FreeBSD 6).

Under the same kind of load, Apache falls over (after using 1000 or so processes and god knows how much RAM), Pound falls over (too many threads, and using 400MB+ of RAM for all the thread stacks), and Lighty leaks more than 20MB per hour (and uses more CPU, but not significantly more).

It does seem like a lean, powerful solution for sites that control their entire technology stack; of course, it doesn’t help those of us on shared hosting providers like Dreamhost who must wait for the admins to carefully and excruciatingly evaluate each new service they roll out.

A quick Googlry turns up quite a few articles on nginx:

If you’re able, I’d highly recommend checking it out. On the other hand, if you’re one of the poor, lonely stack-impaired minions like myself, maybe you can wring a few drops of vicariousness from the gushy victory stories above.

Comedy & Politics 08 Feb 2007 08:26 am

Disembepowerment

John Oliver is one of the funniest “correspondents” on The Daily Show, which is in turn one of the funniest shows on television. Last week, Jon Stewart was fretting that no matter what we do, the Bush Administration still claims we’re emboldening the enemy. Questioning the war policies? Emboldening the enemy. Sending a mixed message? Emboldening the enemy.

Thankfully, John Oliver was there to explain what the behoovus is engoing on:

Well, this is an odd, unconventional war. This isn’t like World War II where there were “winners” and “losers”. It’s a new kind of war where enemies can either be emboldened or beweakened. So we have to enscare them to the point where they rebecave themselves. We must disimagine the very figment of misunsuccessiveness. That is what we have to bedo.

Apparently the problem is that too few of us are fluent lectors of Newspeak.

Rails 07 Feb 2007 05:49 pm

Testing Rails Model Plugins

Extending your Ruby on Rails application with a plugin is very simple: run the code generator to create the template code, then drizzle your yummy application and test code into the supplied directories. Rails automatically adds all plugin lib directories to the $LOAD_PATH. Add a class to your plugin and your Rails application can start using it immediately. You don’t even need a require statement. This is the same mechanism that auto-loads model classes in the app/models directory.

This works nicely for the plugin’s lib directory, but what about its test directory? Unfortunately, by default plugin tests are pretty bland. They use the plain unit test suite supplied by Ruby, and not any of the extended Rails test framework. This will leave our plugin’s test classes with no access to fixtures, database.yml configuration, or any of those nice class auto-loading features.

Fear not! It’s easy to wire the full Rails model testing framework into any plugin. Details below….


Continue Reading »

Politics 05 Nov 2006 10:49 am

Battlestar Iraqtica

The Sci-Fi channel’s reconstituted Battlestar Galactica show has apparently inspired a gaggle of Conservative fans to compare it fancifully with the current US War on Terror. The first two seasons fit the metaphor pretty well, with the Cylons (Extremist Muslims) invoking a surprise genocidal war against the innocent Human Race (Americans) and harassing them with sleeper agents and terror strikes. Unfortunately, for the metaphorists, the writers broke the perfect picture:

In its third season, the show has morphed into a stinging allegorical critique of America’s three-year occupation of Iraq. The trouble started at the end of the second season, when humanity briefly escaped the Cylons and settled down on the tiny planet of New Caprica. The Cylons soon returned and quickly conquered the defenseless humans. But instead of slaughtering everyone, the Cylons decided to take a more enlightened path by “benevolently occupying” the planet and imposing their preferred way of life by gunpoint. The humans were predictably not enthused about their allegedly altruistic rulers, and they immediately launched an insurgency against them using improvised explosive devices and suicide bombers.

It’s so frustrating when you can’t tell the good guys from the bad guys.

Politics 04 Sep 2006 09:14 pm

Iraq Study Group

Former Secretary of State for Bush Sr., James Baker, is hard at work on a bipartisan commission to create an alternative Iraq policy to sell to the current Bush Administration.

Since April, operating almost entirely under the radar, the task force has spawned four working groups, recruiting scores of U.S. experts on Iraq and the Middle East to look at military and security issues, Iraqi politics, reconstruction, and the regional and strategic environment surrounding the war.

Although it’s nice to see some serious effort to design a bipartisan policy for Iraq — and some would say that Baker is one of the few heavyweights with enough leverage to change the President’s mind — it’s still a shame that the process is being so methodically buried in secrecy:

It’s hard to know what the commission is really up to because its inner workings are nearly as secretive as those of the White House. Baker has imposed an ironclad gag order on all of its participants. … “[Baker is] very secretive, he keeps his distance, and he compartmentalizes everything, which is not a bad way to organize a political conspiracy,” says another member of one of the working groups.


Continue Reading »

Politics 03 Aug 2006 11:01 am

Who NEADS The Truth?

A recent Vanity Fair article brings to light some troublingly fascinating 9/11 recordings culled from ancient reel-to-reel recorders at hte Northeast Air Defense Sector (NEADS) airbase in Rome, New York. The Pentagon released them to Vanity Fair after much deliberation. Kos at Daily Kos lays it out nicely in a post yesterday: “Cheney lied about issuing 9-11 command”, highlighting the political angle.

The Vanity Fair article goes into great detail about the ongoing NEADS chatter throughout the 100 minutes of the actual attack. The article provides written and audio transcripts of the critical parts, and portrays a situation much different than was commonly reported:

For the NEADS crew, 9/11 was not a story of four hijacked airplanes, but one of a heated chase after more than a dozen potential hijackings—some real, some phantom—that emerged from the turbulence of misinformation that spiked in the first 100 minutes of the attack and continued well into the afternoon and evening.


Continue Reading »

Next Page »