Duane’s Quick Posts

 

Sign the Get FISA Right Open Letter

This open letter is the product of a long and thoughtful process that I've been paying attention to, associated with a mailing list led by Jon Pincus.

Please add your name to the list of concerned Americans if you care about restoring our right to know when we're being wiretapped by the government (unless there's a warrant), and especially if you believe the "national security letters" should be done away with.

I think it's a terrible thing for a government to be able to systematically silence citizens who oppose it, and this open letter seems to be a positive action in that direction.

Loading mentions Retweet

Comments [0]

Reading a File with Node.js

I'm playing with Node.js right now for one of my side projects and found that it was a little more difficult to read a file than I had anticipated.  First, I looked for an "obvious" function that would read in an entire file, but there didn't seem to be anything like Ruby's IO.read (I was wrong, however, see the posix.cat solution below).

In order to get the benefits of Node.js's event-based system, we have to use the posix utilities.  Here's what I tried first:

var prepareTemplate = function(file, callback) {
  posix.open(file, posix.O_RDONLY).addCallback(function(fd) {
    if (fd) {
      posix.read(fd, 100000, 0).addCallback(function(data, bytes_read) {
        var template = jsont.fromString(data);
        callback(template);
      });
      posix.close(fd);
    } else {
      sys.puts("Unable to read file: " + file);
    }
  });
};

Node.js croaked with the following error, however:

/Users/duanejohnson/Projects/hello.js:15
  posix.open(file, process.O_RDONLY);
        ^
TypeError: Bad argument

Contrary to these presumably out-of-date slides, the documentation shows that the O_CREAT, O_RDONLY etc. constants are to be found in the "process" namespace (not the "posix" namespace).  That was easy to switch.... but same error.  It turns out the "mode" parameter is not optional:

var prepareTemplate = function(file, callback) {
  posix.open(file, posix.O_RDONLY).addCallback(function(fd) {
    if (fd) {
      posix.open(file, process.O_RDONLY, 438).addCallback(function(fd) {

The "438" in there is simply octal "666" (read/write permissions) turned into decimal.

Last but not least, I found that there is a "trick" to loading files if you don't care about concurrency (for example, when the server starts up and you want to load templates):

var data = posix.cat(file).wait();

Alternatively, you can use addCallback() instead of wait() to get around the concurrency issues.

Loading mentions Retweet

Comments [0]

End the Fed Rally Chicago

Kelty and I just went for a walk in Millenium Park and happened across an End the Fed rally. It was neat to see support for Ron Paul's "Audit the Federal Reserve" bill there.


Sent from my iPhone

Loading mentions Retweet

Comments [0]

Audit the Fed Bill Approved

This is a snippet of the good news:

The House Financial Services Committee has approved Rep. Ron Paul’s measure to drastically expand the government’s power to audit the Federal Reserve.

Thank goodness Rep. Mel Watt's anti-transparency measure was given the no-go.

Loading mentions Retweet

Comments [0]

Flu Vaccine Needs Further Testing?

The Atlantic has published an interesting article about the current state of knowledge in flu vaccinations.  Based on this article, it seems that we don't have any good double-blind studies to show that the vaccination actually has the effect we hope it does.  This is an interesting problem, because since a majority of health professionals believe that it does help, it is unethical in their view to return to "square one" and attempt such a study:

Demonstrating the efficacy (or lack thereof) of vaccine and antivirals during flu season would not be hard to do, given the proper resources. Take a group of people who are at risk of getting the flu, and randomly assign half to get vaccine and the other half a dummy shot. Then count the people in each group who come down with flu, suffer serious illness, or die. (A similarly designed trial would suffice for the antivirals.) It might sound coldhearted, but it is the only way to know for certain whether, and for whom, current remedies actually work.

...

In the absence of such evidence, we are left with two possibilities. One is that flu vaccine is in fact highly beneficial, or at least helpful. Solid evidence to that effect would encourage more citizens—and particularly more health professionals—to get their shots and prevent the flu’s spread. As it stands, more than 50 percent of health-care workers say they do not intend to get vaccinated for swine flu and don’t routinely get their shots for seasonal flu, in part because many of them doubt the vaccines’ efficacy. The other possibility, of course, is that we’re relying heavily on vaccines and antivirals that simply don’t work, or don’t work as well as we believe. And as a result, we may be neglecting other, proven measures that could minimize the death rate during pandemics.

A very good read if you are interested in the current vaccine debate.

Loading mentions Retweet

Comments [0]

Nobel Peace Prize goes to Obama

Announced today.  I definitely support Obama's direction (see his remarkable Cairo speech from last June).  I'd like to see faster resolution in Iraq and Afghanistan but I know it's a difficult situation.  He didn't start the wars, so I give him credibility there.

Loading mentions Retweet

Comments [0]

I'm back, after two weeks of silence online

I've been less verbose than usual over the past two weeks: in fact, I didn't even email anyone except while at work.  I've been on a two-week "computer fast" while at home after business hours, and it's been a neat experience.

My first benefit was quite unexpected, although it's probably obvious from many perspectives.  After two or three days of spending time being a little more social in the hallways and with people (especially my wife) after work, I started to become more verbally capable than my usual geeky self.  It's not that I can't usually speak, it's just that I consider myself "slow of speech" to use a biblical term, due to my frequent computer activity and infrequent human activity.  It was pleasant to feel more comfortable around people after an initial bumpy few days.

Second, I noticed that I was quite bored.  Almost immediately after returning home from work, I would have intentions that, more often than not, centered around computer use.  In fact, even when I wanted to do something offline I would try to plan through the computer!  For example, I had wanted to purchase a northpaw kit and build it myself--something that was obviously a more hobby-ish thing to do, and did not require a computer.  But the ordering and the build instructions are all online!  So I made a compromise with Kelty: she would order it for me and print the instructions and then I could have the benefit without breaking the pledge.

Third, I got a lot of stuff done!  It turns out that boredom is a fantastic motivator to get things done that I would normally have placed far below high priorities like surfing the web for news items, scanning programmer websites for "cool tricks", or watching funny youtube clips.  I was able to organize our (physical book) library, make dinner on several occasions, read from several books I've been meaning to read, and complete several projects that had been on the back burner (including the northpaw).

All in all, it was a fun challenge that was right on the mark for me--not too challenging, but just challenging enough.  If you'd like to take the two-week torch and make this a relay race, let me know!

Loading mentions Retweet

Comments [0]

What if technology gave us an incentive to tell the truth?

This is a fascinating new way to help groups make an honest valuation of something they will share: check if their brains say "that's fair" when they assign a price for their portion.

Scientists Develop Novel Use Of Neurotechnology To Solve Classic Social Problem

It seems to me this could really be a legitimate use of neurotechnology on the social scale--although I never thought I'd say that.  New power comes with new responsibility, as always.

My slightly cautious attitude comes from Isaac Asimov's short story Franchise (1955) in which the 2008 election is determined entirely by a computer with the aid of a single man, randomly chosen, to help add stochastic inputs (presumably incalculable elements of the human will) to the results of the election algorithm.

Having read that story, it feels really weird to me to accept that it is now technologically feasible to determine the value of a public good given neurological data from a sample of the population.  If it's now feasible, will we eventually accept it?

Loading mentions Retweet

Comments [1]

Nanosolar has turned its factory on

I think this may be the first in a series of exciting milestones over the next 5 years: Nanosolar has opened its robotic manufacturing facility in Germany for mass-production of thin-film solar panels.

Loading mentions Retweet

Comments [0]

I'm in Boston, Experiencing AJAX!

Tomorrow is the AJAX conference in Boston where I and my colleagues from Getco will be learning about ways to improve our javascript and web interface style.  If you're in the area, give me a tweet or an email!

Loading mentions Retweet

Comments [0]