Friday, March 13, 2015

A Human Colony on Mars?


In 1698 the Scots, in a frenzy of nationalism,  invested an enormous amount of money, 20% of the entire nation's capital, on a  quest to colonize Panama.  The project failed spectacularly two years later due to disease and hostilities - conditions 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 extreme radiation, or grow our own food, but can a human fetus develop normally in 38% gravity.  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 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 spinning just fast enough  so the centrifugal force simulates Mars gravity.  Let's see if the mice can survive and reproduce two generations.  I doubt it.

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


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.