Friday, January 31, 2014

DayZ, Diaries of the Damned #2

Daytime, Castle

I have found both a can of beans and a screwdriver which opens cans, whereas a shovel will not, nor a rock, nor stern looks. But the screwdriver allows me to open and eat the food I find. Presumably I can stab zombies with it, though that seems unsanitary. Fortunately I have also found a baseball bat.

I have made my way uphill to a castle. I avoided the telecomm tower, it looked as frightening to climb as they do in real life. If I find a gun, it might be fun to go up and pick off zombies there, except that there don't seem to be any around here. But now I am at the castle, which has been conveniently marked as a point of historic interest. Personally I'm interested in seeing if anyone through history has left a shirt with pockets or a pair of cargo pants--anything to let me carry more items than a bat, a screwdriver, and a partially spilled open can of beans.

The ground floors have nothing. But stairs lead upward. If I wanted to leave junk somewhere that the zombies wouldn't get it, I'd put it upstairs. The top of the tower is empty, which is a rip since there's not much of a view here, either. But there's a lower building with scaffolding next to it.

There's nothing there, either, and the walls get in the way of the view. Never mind, time to move on in my search for a plaid shirt or cargo pants. I go to the wall and step over.

Apparently the "step over" command suddenly means "throw yourself forward and off of the high scaffold", because I have catapulted into space and died upon impact with the ground. Funny, it looked high enough to break an arm but not enough to kill me from below. No, the screen says that I am dead.

DayZ, Diaries of the Damned #1

DayZ, Diaries of the Damned #3

DayZ, Diaries of the Damned #4

DayZ, Diaries of the Damned #5

...

DayZ, Diaries of the Damned #10

DayZ, Diaries of the Damned #1

Daytime, Country Farm Town

I still had nothing when the zombie came at me, so I ran. I ran to the woods. Apparently zombies have a confused sense of the rules of hide and seek, as once there it stopped and began counting to 100.

Good enough for me. I ran back into town and searched the buildings. I must have been looking for me in the woods still, as I went through the entire place without being accosted again.

I collected a motorcycle helmet, a backpack, new pants and a manly lumberjack shirt. I found a pipe wrench, which will be handy when the time comes that I require a trade to earn my citizenship. I also found about fifteen cans of food and a well. I drank myself full at the well several times, as I have heard that you can go for days without food if you stay well hydrated. Though I have all these cans of food, I have no way of opening them.

I am starving, it says. I have cans of tuna in my shirt pockets. My pants pockets are stuffed with cans of beans. Finally I find a shovel. Hurray! I have opened cans with a shovel in real life, it's messy but it works. What's this? The shovel will not open the beans. Neither will the wrench. I can't grind off the lip of the can on a rock. The lights go dim.

I go unconscious. I am alone. I have starved with a backpack full of food.

DayZ, Diaries of the Damned #2

DayZ, Diaries of the Damned #3

DayZ, Diaries of the Damned #4

DayZ, Diaries of the Damned #5

...

DayZ, Diaries of the Damned #10

Wednesday, January 15, 2014

Commercial Spaceflight Isn't About Sending Fatcats to Space

I've seen a fair bit of "hate the rich" sentiment toward various "space tourism" ventures out there, such as Virgin Galactic's White Knight 2, XCOR's Lynx, and other development efforts toward reusable suborbital spaceflight. I feel this is driven by the usual specious reports by the media about space tourism and seat costs in the range of hundreds of thousands of dollars to drive the class warfare point home. Naturally, the first image that will come to someone's mind when seeing these reports is some overstuffed fat cat buying themselves a $200,000 joy ride at the expense of others.

The fact is, a point has been missed here. Space tourism is the economic model that's being used to draw investment for this work, but it's not the reality of where this work is going. In order to get money to do something new, without a proven business model, you have to build a business model from scratch. This means finding something that will presumably pay the bills and earn enough to pay investors a return at least as good as an investment in another proven economic activity, such as investing in a restaurant or manufacturing. In fact, the return needs to be better, at least on paper, to induce investors to take the risk of not putting their money into something proven.

For reusable suborbital launches, the case was made using space tourism. That's because none of the other potential uses is really well known, but a unique luxury offering could be pretty well characterized, and counted on to deliver a return.

But the real value in these quick trips to space lies elsewhere than in joy rides for someone with $200,000 burning a hole in their pocket.

It's Like a Reusable Mercury-Redstone for Suborbital Research

The Next Generation Suborbital Researchers' Conference is one group that's excited about the prospect of cheap suborbital flights. Currently, the overall cost of a sub-orbital flight on a sounding rocket is about $3.5M. The costs to the users are less, because much of that costs is subsidized by NASA, and by sharing of launches between institutions. It costs each institution about $50,000 to $500,000 per launch with somewhere from half a dozen to a dozen institutions sharing the costs between themselves. This gives them the chance to launch about a half a cubic foot to a cubic foot of payload on a short flight on a rocket. It will experience at least 25Gs of acceleration, with shocks of double that or more. Nobody can ride along, so the success of the flight will depend on the researchers' ability to automate their payload (adding considerably to the costs of building and testing the payload before flight.)

Flight on one of the new commercial launchers will cost the institutions about $50,000 to $400,000 per launch. They get to send a person to operate the experiment, and likewise to experience the ride, if they choose. They may also buy a package where they send their equipment, which will then be operated by a space tourist paying their own way who has been trained to operate the experiment, or the package may be activated by the spacecraft's crew.

The commercial space operators are already putting together special deals for the space researchers. They can buy into multiple flights at discounted rates.

Plus, their payloads can experience flight at human comfort levels, 3Gs or less, with controlled temperature, air, etc. This results in far less cost. The same instrument package used on the desktop at the university's lab can be the same one sent on the flight. It doesn't have to go through vacuum testing, extensive testing of the automation under different conditions, hardened against high shock loads, etc. Standard safety design and testing for not bursting into flames and filling the cabin with smoke will still be necessary, but that's a big step down in cost and effort from what's required for a sounding rocket flight. That drops research costs even more.

Another important point is that these flights will be far more available than sounding rocket flights. NASA launches somewhere around a dozen sounding rocket flights each year. The commercial flights will be more frequent, and easier for an institution to get a payload on board, deal with schedule changes, and so on.

Teachers in Space
Another purpose of the new commercial "tourism" flights is to send the sort of tourists I think most of us would want to send. Teachers in Space is a program that can't wait to use commercial spaceflight to send teachers into space with student research at all levels of education. Speaking as a part-time teacher myself, I can say that it helps the students a lot to hear about science and spaceflight from someone who's actually been involved in it. If we have a growing cadre of science teachers who can start a statement to students with, "When I flew in space...", work alongside them on projects they're building that will actually go into space, it will bring a sense of reality and engagement to their education that's so hard to get otherwise.

Other Desirable Space Tourists

There are plenty of other people we, as a society, would like to see get a chance to experience space travel. Make A Wish Foundation flights? Rewards for science fairs? Small companies doing their own research to compete against larger ones? There are many, many uses for these vehicles that have nothing to do with the ultra-rich burning off spare dollars.

Opening Up Space

That just happens to be the easiest way to show that there's a potential profit at the end of the long development process for those who invest in the companies making this happen. So don't be fooled by reports making the commercial space industry out to be nothing more than a new form of luxury for plutocrats. This is about giving little people the access to space that's so far been limited to governments and richer institutions. This is the same sort of revolution that we got with the microprocessor, which brought computers into our homes then into our pockets. Once upon a time, the computer was known to the average person as a tool of oppression. When your bank or government told you that their computer said you owed them so much money, you were stuck fighting a battle against the authority of a tool you didn't have. When we got our own computers, we got the power to tell them back, "Well, my computer says..."

Now, we're on the verge of having space access be democratized in the same fashion. Virgin Galactic, XCOR, and Blue Origin are not the end of this particular road, any more than the first heavy, balky, difficult to build and use microcomputers from before 1977 were the end of the process of democratizing the computer. But if early public sentiment had risen to kill off the early small computers as nothing more than toys for the rich, where would your tablet and cell phone come from today?

Be glad the rich are there, willing to buy tickets for a space adventure. Because they're there, the way is being opened for your kids and their teachers, their work and research.

In the words of Alan Stern, "The access revolution is about to happen. When these guys are flying all the time, and you can fly an experiment over and over and over and get different data sets all the time, close the loop and fly an experiment the next week and the week after, I think we're going to see the best applications be things we haven't thought of yet, because we're kind of looking at it through old eyes." (Aviation Week, June 17, 2013, "Suborbital, But Reusable" reporting on the 2013 NGSRC.)

Monday, January 6, 2014

Parallel Processes on the XMOS StartKIT

XMOS StartKIT board and its shipping box.

XMOS sent me a free StartKIT development board just in time for Christmas. Now that the festivities are over, I've had a chance to get started with it. It's a bit frustrating because XMOS's documentation has the necessary information scattered rather broadly, and documents that you'd expect to contain certain pieces of information do not.* It's all there, just poorly organized & often hidden in long documents where you wouldn't expect it.

That said, the hardware is exciting in its potential. Once I got through the basic tutorial stuff I went to write a simple multiprocessing program--handing over the blinking of two LEDs on the board to two independent processes.

Here again I ran into documentation deficiencies. XMOS presents code examples in their docs as snippets, not full programs. This leads to misunderstandings due to lack of context. I was able to get a program going, on the third attempt. The first syntax I tried created two dependent processes. The second's syntax was not accepted even though it was copied from a sample snippet--it had a variable that needed to be declared, but I didn't know what type to declare it as, and the declarations are left out of the snippets. The third try worked, but only after enough time spent reading and time spent doing some fortunate guesswork to have gotten a lot further with another, better documented hardware platform.

Lighting a Candle While Cursing the Darkness

I still think this is the right platform for the initial ideas I had for it, though. So as I press on, step by step, in implementing those ideas, I'm going to document what I learn & hope to save others time and trouble. I've made a couple of resolutions about the code, similar to those on the code for my Begin with Java blog:

1. All examples will be presented as complete, compilable programs.

2. All examples will use multiprocessing syntax and structure.

Look for this code to appear on my website, saundby.com soon.

Until then:

Don't follow the example syntax XMOS uses of writing your code inside main(). All main() should contain is channel declarations and par{} blocks. Put all your code into functions to be called inside par{} blocks.

The code for the dual process LED blinker:

/*
 * LED Tests.xc
 *
 *  Created on: Jan 5, 2014
 *      Author: saundby
 */
#include <xs1.h>

out port    p1              =   XS1_PORT_1A;    //PORT 1A for D1 LED
out port    p2              =   XS1_PORT_1D;    //PORT 1D for D2 LED

void led1(){
    while(1){ //run forever
        p1 <: 1; // LED D1 On
        delay_milliseconds(200);
        p1 <: 0; // LED D1 Off
        delay_milliseconds(200);
    }
}

void led2(){
    while(1){ // run forever
        p2 <: 0; // LED D2 Off
        delay_milliseconds(50);
        p2 <: 1; // LED D2 On
        delay_milliseconds(350);
    }
}

int main(void) {
    // Note: put the 'forever' loop in each of the 
    // individual tasks, not out here.
   par{
       led1();
       led2();
   }
   return 0;
}

* It took me forever to find the electrical characteristics of the I/Os in the data sheets, but they are there. There just isn't a data sheet for the specific IC used in the StartKIT, which is a unique item not for sale separately. Personally, I consider it a major oversight to not either provide a data sheet for this specific IC or to include that information in the Hardware Manual for the StartKIT. Based on the scuttlebutt in the forums, I'm using the datasheet for the XS1-A8A-64-FB96 (PDF) as the closest analogue.