Friday, March 13, 2015

A Human Colony on Mars? Not So Fast.


In 1698 the Scots, in a frenzy of nationalism,  invested an enormous amount of money, 20% of the entire nation's money, on a  quest to colonize Panama.  The project failed spectacularly two years later due to disease - a condition that could easily have been foreseen, but Scots neglected due diligence and wasted many fortunes.

I fear our country is neglecting due diligence on our space colonization efforts.

For the long term human survival on Mars, the big question is not whether we can build shelters against the deadly radiation, or grow our own food in hostile soil or can we get water, but can a human fetus grow to adulthood in 38% gravity.  I doubt it.

Astronauts staying aloft in the International Space Station for extended periods have many physical issues like heart, bone, and eye problems. Many, many questions need to be answered, like "Since Martian-born humans would probably be taller with thinner bones, would the volume of marrow inside those bones make the appropriate amount of blood?".

We need to fund something like the Mars Gravity Biosatellite before spending any more money on a manned trip to mars.  Conceptually we need to put mice in 55 gallon drum  in the International Space Station spinning just fast enough  so the centrifugal force simulates Mars gravity.  Let's see if the mice can survive and reproduce two generations.  It would be better to know now if earth mammals can reproduce in 38% gravity than after we have spent an astronomical amount of money.

 I personally would rather NASA be spending our precious space dollars on sending robotic craft to all the moons in our solar system and building telescopes, instead of a project which, like the Scotish colonization of Panama, may be doomed from the start.


Json.NET Error: Could not create an instance of type IAmAnInterface

While using NewtonSoft's excellent Json.NET library, I was trying to deserialize a dictionary containing interface objects and got this error message:

"Could not create an instance of type IAmAnInterface. Type is an interface or abstract class and cannot be instantiated. "

Fortunately Json.NET has a very easy way around this by telling it to save the type metadata in the output.  To serialize the dictionary:



        static readonly Object Locker = new object();
        public void Save()
        {
            lock (Locker)
            {
                File.WriteAllText(reportFilePath,
                    JsonConvert.SerializeObject(_dictionary, Formatting.Indented, new JsonSerializerSettings
                    {
                        TypeNameHandling = TypeNameHandling.Objects,
                        TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Simple
                    }));
            }
        }


To bring the objects back:

         public void Load()
        {
            _dictionary = JsonConvert.DeserializeObject>(File.ReadAllText(reportFilePath),
                new JsonSerializerSettings
                {
                    TypeNameHandling = TypeNameHandling.Objects
                });
        }



This does make the json file larger, but for us, it's well worth the price.