Friday, August 22, 2008

CodeStriker: Inappropriate IOCTL for device

I just had a troubleshooting session with a nifty code review tool called codestriker.

All of a sudden, we're getting an error of: "Inappropriate IOCTL for device" during creation of a new topic. This is maddening. I found lots of references to this, but nothing about what's going on to cause it. I can write to the directory, I can touch files there, everything seems to work, but no joy.

So, I tried putting in a modification to test the return values of the open statements in the code (/var/www/codestriker/codestriker-1.9.4/lib/Codestriker/Repository/Subversion.pm):


push @args, '--revision';
push @args, 'HEAD';
push @args, $self->{repository_url} . '/' . $url;

my $read_stdout_data;
my $read_stdout_fh = new FileHandle;
my $ret = open($read_stdout_fh, '>', \$read_stdout_data);
if (not $ret) { die("Died on open of file stderr",
$read_stdout_fh, ", msg: ", $!); }


my $read_stderr_data;
my $read_stderr_fh = new FileHandle;
my $ret = open($read_stderr_fh, '>', \$read_stderr_data);
if (not $ret) { die("Died on open of file stderr",
$read_stdout_fh, ", msg: ", $!); }


Codestriker::execute_command($read_stdout_fh, read_stderr_fh, $Codestriker::svn, @args);
$file_url = 1;
open($read_stderr_fh, '<', \$read_stderr_data); while(<$read_stderr_fh>) {
if (/^svn:.* refers to a directory/) {
$file_url = 0;
last;
}
}

Adding the 'if not ret...' lines after the opens fixed the problem. Note, I had to restart apache with /etc/init.d/httpd restart and tail /var/www/error_log to fix a minor syntax error first, but it worked out.

Tuesday, August 12, 2008

How I Would Run the Stargate System

How I Would Run the Stargate Program
by Kevin J. Rice

Preface: This is written as if Stargate was real. It isn't, it's a nice pair of shows on TV with human actors and all that. But, sometimes it's fun to put yourself into a fictional 'universe' and think about how you'd run things differently.

In the Stargate: SG1 and Stargate:Atlantis universe, the SGn teams and Atlanteans venture forth to interact with several worlds in which large numbers of humans live at roughly an 1850's level of civilization. There is a lot of rough housing, with some horse and buggy transportation, outhouses, and a lot of preindustrial development.

This is mostly consistent throughout the gate network: Settlements on most worlds have a relatively low technological level compared with modern U.S. manufacturing and service-sector capabilities.

If I were in charge of Atlantis, I would be doing things quite a bit differently. I would create a set of survival packs (gift packs to newly met worlds) and start visiting these worlds with the express intent of bringing them up to modern standards of development capacity.

Here are my plans and reasoning:

1. Reveal the Gate

Everyone (on other planets) presumes we know about the gate already anyway. Domestically, all major Earth governments know about it and have adjusted their foreign policies somewhat. So, why not? It seems to me that very little is to be gained by keeping the Gate system secret from the population of Earth. In fact, I would argue that a large scale commerce between various worlds would be the best course of action. Certainly, many more kids would be inspired to study hard so they could grow up to be engineers and businessmen building things on other planets.

2. Set Up A Stargate Emigration Authority

Many millions of people around the world would love to emigrate to a near-'virgin' planet where they could farm, raise cattle, prospect/mine, be left alone, etc. There are lots of countries that are very repressive and if it were known that it was possible or even easy to emigrate to one such world, they would flee their home country and ask for transport to the new world. This would presumably be pretty cheap to do. We witnessed this writ large in the 1800's into the American midwest. This would take significant population pressure off portions of the globe where resources are scarce and populations large.

3. Reveal Spaceflight Technology

Spaceflight tech in the SG1 universe is presented as having many solved problems available. In fact, the dreadnaught spaceships already built are testimony that the Americans, at least, know how to build and use this technology.

Likewise, spreading out to create outposts on other planets and in large, independent, and dispersed space stations lowers the risk of catastrophic attack on Earth affecting Human tech development. Every computer programmer knows, if you have something important, back it up! Humanity is important, let's "back it up". Outposts do that.

4. Develop large-scale Ring-based Transportation Infrastructure

I would create a special set of rail lines that allow two way rail transport through the ring system. This would enable large industrial commerce. Further transport could be enabled with the Al-Kesh transport ships.

Commerce, and therefore GDP growth, depends on transportation infrastructure. Getting goods to and from market efficiently lowers the cost of the goods.

5. Create a "Gate System Peace Corps"

Peace Corps volunteers/employees have taught schools, built bridges, wells, roads, etc., all over the world and have created both goodwill and a better educated populace. This obviously benefits both the U.S. and the host country. The hosts get a higher standard of living, they buy our goods and sell us things, use the money to create better factories and a richer populace that can better afford our products and vice versa, etc. Economics of free trade are not zero-sum: they are positive-sum in that everyone benefits.

A gate corps would do the same thing, and present significant opportunities for good storytelling. Story lines could be culled from the annals of the Peace Corps themselves. Most of all, we should send teachers and textbooks to other worlds, getting them into the 20th century so we are better able to become a galaxy-spanning civilization capable of resisting outside threats like aliens and inside threats like pandemics and terrorism.

6. Explore from Another Planet

Many times during SG1 it was demonstrated that merely dialing up another world could present huge problems and possibly destroy Earth:
- Black hole world
- Nasty parasitic insect world
- Gua'ould worm world
- etc.

So, my proposal is the creation of an Gate EXploration Authority (GEXA) on ANOTHER planet. This would be a well-defended but very much separate world in which gate teams explore new worlds and report back on their findings. Should contact with the GEXA planet be lost, Earth is still safe. Automated receivers hidden on nearby moons could receive log reports broadcast non-directionally; we could gate to a nearby world, then fly a ship to pick up the logs from those receivers, should contact be lost, etc.

7. Ring System to Earth's Moon

I don't know if this is possible in the fictional phyics of Stargate. However, it would be cool and solve many problems of mass transportation to/from this location. An outpost there would have some very cool aspects, including a great tourist industry, and reinforcing the idea that the Earth is a very small place. Then, maybe our petty fights (wars) might be less interesting compared to getting rich off-planet.

8. Reveal Some Military Tech

Further, if we want to create viable defenses against "the bad guys", we have to create and deploy large scale defensive systems. The nations of the Earth are engaged in an arms race, but with tech that doesn't match the 'bad guys'. So, fix that, and we'll be able to defend ourselves because we've already fought each other with this technology. Note, this could be troublesome.

---------

Overall, I would be running things significantly differently than the SG1 universe presents it. Of course, writers, you're welcome to my ideas if you thank me in the credits!