Monday 20 April 2015

Tardigrades, The Command Key and Keyup, TypeScript Classes, Goats in Rwanda

1. Tardigrades

Tardigrades are tiny creatures, around 1mm long that can survive extreme conditions. Some were sent into space on a satellite and not only did many of them survive but they even had healthy young.

These remarkable creatures can survive in a dehydrated state of suspended animation and can even repair damaged DNA when they come out of it. Some of them can survive radiation, extreme heat and extreme cold.

3. TypeScript Classes

The following is a TypeScript class

class Something {
  thing: string;
  constructor (thing: string){
    this.thing = thing;  
  }
}
var something = new Something ('whatever');

which produces the JavaScript

var Something = (function () {
  function Something () {
    this.thing = thing;  
  }
  return Something;
})();

var something = new Something ('whatever');

However, there is a simpler version of the TypeScript that will give the same result.

class Something {
  constructor (private thing: string){  
  }
}
var something = new Something ('whatever');
You can also make it public, which again results in the same JavaScript.
class Something {
  constructor (public thing: string){  
  }
}
var something = new Something ('whatever');

Although the JavaScript is the same, TypeScript will catch errors related to the private field. Note that everything is public by default.

Hope and Inspiration

Goats in Rwanda

It's easy to get bogged down by all the bad news and negative things highlighted around us so I'm going to add a section on stories, blog posts, articles that I find bring hope. The first of these is an article about a family in Rwanda who received a goat from a charity called Heifer International five years ago. It was a life changing event for the family.

Heifer International is an organisation which trains people in better farming practices along with giving them animals and tools to get started. Receiving an animal means the family gets increased food supplies directly through milk or eggs and indirectly through the increased yields of their crops through fertiliser made from dung.

There are other organisation which do this, but the principle that I particularly like about this organisation and their sister organisation Send A Cow, is the "pass it on" principle. The first female offspring of any animal they receive, along with training is passed on to another person, so not only is the first person helped, but they participate in helping another, and the chain continues.

This whole process has dramatic effects on the families receiving gifts. Their health improves through better nutrition. They receive extra income from the abundance of produce. They can afford to send their children to school.

No comments:

Post a Comment