Sunday 10 May 2015

Chocolate

Chocolate

Ninety percent of British chocolate comes from cocoa beans grown in West Africa. The main cocoa harvest is in March. Cocoa beans are dried in the sun for a week before being shipped.

When the beans arrive, they are mixed with grit, bits of string, and sometimes even shoes and snakes! They are passed through sieves to separate out the junk from the beans.

The cocoa beans are broken open to release the so called nib. The nibs are roasted and then processed to form a thick brown liquid called cocoa liquor.

Saturday 9 May 2015

Crush Syndrome, Ebola and Eyes, Sommardojorna

Crush Syndrome

In response to a massive injuries, the body releases toxins which can cause the kidneys to shut down as they try to filter them out of the blood.

Ebola and Eyes

It's possible for Ebola to remain in the eye even though the person is clear of it in their blood. For the case mentioned in the linked report, it was not present in tears or other external bodily fluid so it would not be spread by casual contact.

Sommardojorna

Today I learnt some Swedish slang which my mother-in-law used when changed her winter tyres to summer tyres. The word she used was sommardojorna. Sommar is summer. Dojor is slang for shoes and it comes from a language used by chimney sweeps to communicate while inside someone's house.

Friday 8 May 2015

ex Unit, Commercial bread, Deleting a GitHub Repo

Ex Unit

As well as the units px and em there is also ex which the height of the X in that typeface.

Commercial Bread

Instead of just plopping the dough into the tin, it's rolled and then cut into four pieces which are placed in the tin. This makes the bread less likely to rip when being buttered.

Deleting a GitHub Repo

I needed to test some code today, and in order to do so I needed to put up a pull request and then delete the repo the branch was in. Fortunately the GitHub instructions were nice and easy to follow, and even though I have nothing of interest in any of my repos on GitHub it was still slightly scary to do!

Preventing Curling in Tunisian Crochet, Reverse Stitch, Yeast

Preventing Curling and Reverse Stitch

Continuing with Tunisian crochet, I found some tips to prevent rolling. You can work into the back of the chain, do some rows in reverse stitch at the beginning and end of the sample, and use a hook two or more sizes bigger than recommended for knit/crochet. This worked quite well on the small sample I did of reverse stitch. I'm working my way through this play list by Kim Guzman

Yeast

Yeast is all around us. A particularly good source is oak bark.

In a commercial environment, it takes four days to produce 30,000 kg from just 0.1g of yeast and huge quantities of sugar! The yeast doubles its numbers every three hours.

Dried yeast keeps for two years. Live yeast in a block keeps for about a month.

Memory, Flour Dust, Soya in bread

Memory

We remember pictures far better than we remember things we read so it's more effective to produce information in pictures than in words. The brain has to convert the words to meanings and the meanings to pictures in order for us to remember them. I have a great deal of trouble remembering formulae so when I think of Pythagoras' Theorem, I see a triangle and I think of the two shorter sides coming together to give the longer side. The only word involved it "squaring" and I don't think of that as an image of a square, just squaring and then arrows bringing the sides together.

Similarly, to remember how to calculate sine, cosine and tan of an angle in a right angled triangle I have a visual relationship of the sides. Cosine is like a snapping jaw where the angle is between the jaws, sine is that side way over there (opposite) divided by the longest side (hypotenuse), and tangent is that side over there divided by this close one here. At some point, I tried to learn SOH CAH TOA but I can't work out the letters so to type that I had to think what sides were involved so I knew which letters they were. I do however remember that tan = sin/cos and sin/cos looks right but cos/sin doesn't.

Flour Dust

Flour dust is combustable and a spark can ignite it. Trucks carrying flour have to be earthed to prevent static build up and thus explosions in the confined environment. A truck load of flour (twenty-eight tonnes) will produce about sixty thousand loaves of bread!

Soya in Bread

Soya is added to bread to make it whiter.

Thursday 7 May 2015

Nepal, Tunisian Crochet

Nepal Earthquake

I was classifying damage in Nepal today at the Tomnod site. I've seen pictures and new reports and read what has happened to people but seeing the before and after pictures and actively doing something brought the reality of it crashing home to me. By taking part in clicking on damaged buildings, seeing rubble where once a house stood, tents where people have now found shelter, it ceased to be something distant and incomprehensible. What I learnt is that the simple act of clicking images makes me involved, makes it part of my life, makes it real.

Tunisian Crochet

I've continued with the series of videos mentioned in an earlier post and learnt the twisted purl and honeycomb stitches.

Wednesday 6 May 2015

Every Sperm is Sacred, Marriage and the Church, Internal Personas

Every Sperm is Sacred

I've always thought the Monty Python sketch "Every Sperm is Sacred" was taking things too far. That was until I watched a BBC series about Sex and the Church and it makes sense why things have developed as they have. In Old Testament times, the Jews needed to increase their population. They also believed that the whole child was contained within the sperm, and that the woman only provided an incubator. No wonder they didn't want to waste those potential children!

Marriage and the Church

For the first thousand years of the Church, marriage was purely a civic concern and the Church kept away from it. When the first marriages were conducted by the Church, they were conducted in the porch of the Church and only after the couple were married did they move inside. This wasn't very practical and eventually it was moved inside.

Internal Personas

We all have multiple internal personas which are the way we see ourselves in different situations. We try to be consistent according to these personas. If we don't see ourselves in a particular way, then we won't do something. However, we may do small things which are only slightly outside our persona. When we do these small things we adjust our persona to stay consistent. This means that something that we previously would not have done because it was not consistent with our persona then becomes consistent with it. I guess that's why small steps work in moving us from one habit or behaviour to another.

Tuesday 5 May 2015

Tunisian Crochet - Preventing Curl, Reverse Stitch and Knit Stitch

Preventing Curling and Reverse Stitch

Continuing with Tunisian crochet, I found some tips to prevent rolling. You can work into the back of the chain, do some rows in reverse stitch at the beginning and end of the sample, and use a hook two or more sizes bigger than recommended for knit/crochet. This worked quite well on the small sample I did of reverse stitch.

I'm currently working my way through this play list by Kim Guzman. There is also a left hand version on her YouTube channel.

Monday 4 May 2015

Tunisian Crochet

Basic Stitch, Crossed Stitch, Lace Stitch

I learnt three Tunisian Crochet stitches today. There were the basic stitch, crossed stitch, and lace stitch. I'm crocheting too tightly at the moment so I'm finding it difficult to crochet the loops of the hook on the return row. The first cross over row of the crossed stitch was hard and I ended up using a stitch holder throw all the loops so I could find them as the crossing over action tended to hide the skipped stitch. Lace stitch is pretty and surprisingly easy for its elegance.

The basic and crossed stitch samples, both very firm, are rolling horribly but the less dense lace is staying reasonably flat.

Helicopters in Vietnam, TypeScript and Generics, Type Definition Files in TypeScript

Helicopters in the Vietnam War

At the end of the Vietnam War, unneeded helicopters were pushed overboard so that the ships would have more room to take rescued troops.

TypeScript and Generics

You can use generics in TypeScript. They're code templates. They're re-useable and flexible. You can use them instead of using the type `any`. The type is supplied when it is used and thus type checking can be enforced for the particular type supplied and wherever that particular thing is used elsewhere in the code.

Type Definition Files

There are type definition files available at the site Definitely Typed for most of the major JavaScript libraries so that you can check whether you are using the library correctly at compile time.

Friday 1 May 2015

Kelp, Organisation, Messenger

Organisation

It's surprising how quickly things get tidy or sorted out with just a small fixed amount of time per day. It's also a lot easier to deal with throwing things out when you're happy and feel secure.

Messenger

Messenger crashed into Mercury today. Even though it had solar panels, it also had to use fuel to keep positioned correctly to protect the scientific equipment protected from solar radiation.

Tuesday 28 April 2015

Shoes on the Bank of the Danube, iframes, The Fold

Shoes on the Bank of the Danube

Today I read about the sculpture of shoes on the bank of the Danube in Budapest, where 70 years ago Jews were forced to take off their shoes before being shot so they fell into the Danube which carried their bodies away. The article The Shoes on the Danube Promenade – Commemoration of the Tragedy goes into more detail.

iframes

When you use an iframe on a page, it can access things on the page. However if the content on the iframe is from a different server, security protocols kick in and the iframe no longer has access to the rest of the page.

The Fold

Where is the fold? The website I am the fold measures the window height of all visitors to the site showing a large range of sizes. Gave me something to think about concerning designing for the fold, when it's not at all clear where it might be.

Monday 27 April 2015

Fantasy Castle, Performance and S3, TypeScript Interfaces

Fantasy Castle

I do love the Guardian's How to Draw... series. I'm pretty terrible at drawing but with their help I get something that doesn't look like a 5 year old drew it. Today I learnt to draw a enchanted forest. I haven't got a fine black pen to go over the pencil, and I definitely need more practice, but for a first attempt I'm happy.

Performance and S3

CDNs (Content Delivery Networks) allow information to be sent to a visitor from nearby. Unfortunately, with Amazon's S3 you are tied to a particular location so although it's cloud storage, it's not going to be delivering stuff locally to the visitor.

TypeScript Interfaces

In TypeScript you can use interfaces to check the classes implement all the parameters and functions as stated. There is no implementation of this in JavaScript so it's purely used as a consistency check at compile time.

Sunday 26 April 2015

Skateboarding in Afghanistan, Gentoo Penguins and Knitting: Two Colour Star Stitch

Skateboarding in Afghanistan

Girls in Afghanistan aren't allowed to ride bicycles but they are allowed to skateboard. Through the organisation @stakeistan, girls can skateboard, try out other sports and even get an education.

Gentoo Penguins

While marking penguins in photos for Zooniverse's Penguin Watch, the Gentoo penguins all seemed to have two chicks.

I wasn't sure whether I was seeing things or whether that fluffy mass at the parent's feet was really two penguin chicks. Turns out they do have two chicks, and even though the eggs are laid four days apart, they hatch within 24 hours of each other.

Two Colour Star Stitch

This is a stitch I found at The Weekly Stitch.I found it quite quick and simple to work up, but I only used one colour. I've seen other stitches called star stitch so I'm wondering how to classify stitches so that I can keep track of what I have and haven't done.

Saturday 25 April 2015

Penguins, Knitting: Garter Tab Cast On and Chevrons

Garter Tab Cast On

This is a cast-on which can be used for shawls which are worked from the top down. It consists of a few stitches knitted into a rectangle, and then picking up stitches from a side and the cast-on row of the rectangle.

Chevrons

This is a pattern on 2 (mod 14 stitches) over two rows, and can be worked in garter or stockinette stitch. For example, row 1 is purl and row two is knit 1, then (increase 1 on/around next stitch), then knit 4, [(decrease 2 over the next 4 stitches) knit 4, (increase 2 over the next 2 stitches), knit 4] repeating the stitches in [] until the last two stitches which are (increase 1 over last but one stitch), knit 1.

For a sample pattern and video see The Weekly Stitch.

This is my first attempt.

World Penguin Day

It's world penguin day. There are 14 million penguins in the Antartic, spread over eight species.

Friday 24 April 2015

More Cable Knitting, Bootstrap Forms, Mint Julip

More Cable Knitting

After yesterday's success at a basic cabling stitch, I jumped in with both feet and went for woven lattice cable stitch. It's a pattern on 2 (mod 6) stitches with an eight row repeat. This involves three cable stitching I haven't done before. Cable four front (like cable four back), twist four front and twist four back. The two twist stitches both involve two knit and two purl stitches. They're all demonstrated in the video below, along with the stitch itself.

Bootstrap Forms

I finished watching the videos on edX's Bootstrap course. The final section was on forms. Most of the course covered things I'd used before, or at least knew about since I worked with Bootstrap for a year and a half in my last job. It was encouraging to see that I do know things as I'm usually only aware of the mountain of things I don't know. There were a few things I learnt from the course though. I haven't set up a navbar, didn't know you could use nav-fixed-bottom so that the navbar is at the bottom of the window and always visible when the user scrolls. I also learnt how to made forms have a checkmark or cross or whatever else to the right of the input box using has-feedback on the form-group and form-control-feedback on the thing to go at the end of the input box.

Mint Julip

If you are going to use mint in a drink, you need to be careful not to damage the leaves too much as this will make the drink bitter. Instead of crushing the leaves, just bruise them between the flats of your hand.

Thursday 23 April 2015

Soil Type, Knitting: Cabling and Russian Join

1. Cabling

I did my first bit of cabling today. I cast on 20 stitches, then four rows as follows

  1. knit
  2. (knit 2 purl 4)* knit 2
  3. knit
  4. (knit 2 purl 4)* knit 2

then I followed the instructions from New Stitch a Day to make the cable four behind (C4B) in the positions given below

  1. (knit 2, cable 4 behind)* knit 2
  2. (knit 2 purl 4)* knit 2

and then I repeated all six rows another two times before casting off to make my sample.

2. Garden Soil

To see what type of garden soil you have you can use a screw top jar. You half fill it with soil, then top up with water leaving an inch gap at the top. Shake well and then leave over night. The sand, silt and clay will separate out into layers.

3. Russian Join

Another problem I have with knitting is joining in new yarn. Russian join is a secure way to join in new yarn with minimum fuss.

Wednesday 22 April 2015

GPU accelerated CSS, Knitting: Double Moss Stitch, Granite Relief Stitch

1. Double Moss Stitch

Double moss stitch is a pattern on four rows on an even number of stitches.

  1. knit 1, purl 1 across row
  2. purl 1, knit 1
  3. purl 1, knit 1
  4. knit 1, purl 1

2. Granite Relief Stitch

Granite relief stitch is a knitting stitch consisting of four repeated rows on an even number of stitches. Let the number of stitches be 2n.

  1. knit (right side – 2n stitches)
  2. knit two together across the row (n stitches)
  3. knit into the front and back of the stitch (2n stitches)
  4. purl (2n stitches)

3. Using the GPU to accelerate CSS

The GPU can be used to remove jank in a webpage. Modern browsers use the GPU when a 3D transform is used so the browser. This can be used to trick the browser into using the GPU. See the Treehouse blog for more details.

Knitting: Lace Stitch, Long Tail Cast-On, Lifeline

1. Lace Stitch

It took me five attempts to get the first row right on this stitch. I kept missing yarn overs and ending up with somewhat arbitrary numbers of stitches. Lace stitch is a two row pattern, working on x stitches where x = 1 (mod 4).

  1. purl (wrong side)
  2. knit 1, (yarn over, slip one as if to knit, knit two together, slip the slipped stitch over the knit two together, yarn over, knit)* repeat

2. Long Tail Cast-On

I've always hated casting on. Well, that was until I came across long tail cast on. It gives a nice even edge and is quick and easy to do once you get the hang of it.

3. Lifeline

One of the reasons I prefer crochet over knitting is it's so much easier to recover from a mistake and undo several rows. When I try this with knitting, I drop stitches, get the stitched twisty or just get in a horrible mess. Well, I just learnt about a lifeline. What you do is slip a thin yarn through all the stitches on a row so that if you do make a mistake, you can easily pick up from that row again! I wish I'd known this when I was trying the lace stitch and had to cast on six times in the end to just do a small sample!

Sideways Herringbone, Fulgurite, Sand Stitch

1.Knitting: Sideways/Horizontal Herringbone

Sideways herringbone is a very tight, dense stitch. It consists of two rows on an even number of stitches (although I think it would work on any number of stitches).

  1. Knit two together through the back loop, slipping only the first loop off the left needle. Repeat across the row, finishing with a knit through the back loop.
  2. Purl two together, slipping only the first loop off the left needle. Repeat across the row, finishing with a purl.

I found the second row a bit tricky as it was hard to flick only one of the two loops off the left needle, and I found myself leaving the stitches on the sloped end of the needle so they ended up too tight.

2. Fulgurite

When lightning hits sand, it sometimes forms tubes of glass called fulgurites. The centre is vaporised and then the sand around heated so that it becomes a glassy substance called lechatelierite.

3. Knitting: Sand Stitch

I found sand stitch a lot easier than the other stitches. It's a four row repeat on a even number of stitches (although again I think it would work on any number).

  1. knit
  2. knit 1, purl 1 to end of row
  3. knit
  4. pur1 1, knit 1 to end of row

Hope and Inspiration

Knitting: Simple Seed Stitch, Box Stitch, Fishtail Stitch

1. Simple Seed Stitch

This is mostly a stockinette stitch with the occasional purl thrown in to make a small bump in the fabric. It's an eight row repeat on 1 (mod 4) stitches.

  1. purl 1, (knit 3, purl 1)*
  2. purl
  3. knit
  4. purl
  5. knit 2, purl 1 (knit 3 purl 2)* knit 2
  6. purl
  7. knit
  8. purl

2. Box Stitch

This is a flat stitch which is the same back and front. It consists of four rows on 2 (mod 4) stitches.

  1. (knit 2, purl 2)*, knit last 2
  2. (purl 2, knit 2)* purl last 2
  3. (purl 2, knit 2)* purl last 2
  4. (knit 2, purl 2)*, knit last 2

3. Fishtail Stitch

Fishtail stitch consists of six rows on 1 (mod 8) stitches. The edge is scalloped and would make a pretty folded back lacy cuff.

There is a repeated stitch in the middle, which I'm going to call "special": [slip 1, knit 2 together, pass slip stitch over knit] as I kept losing my place in the pattern.

  1. knit 1, (yarn over, knit 2, special , knit 2, yarn over, knit 1)*
  2. purl
  3. knit 2, (yarn over, knit 1, special, knit 1, yarn over, knit 3)* The final repeat with end with knit 2 instead of 3.
  4. purl
  5. knit 3, (yarn over, special, yarn over, knit 5)* The final repeat with end with knit 3 instead of 5.
  6. purl

Tuesday 21 April 2015

Knitting: Reverse Stockinette Stitch, Seed Stitch, Double Seed Stitch

1. Reverse Stockinette Stitch Stripe

Reverse stockinette stitch is a six row pattern on any number of stitches. The first time I did this, I missed the last knit row so I ended up with the second panel reversed. My second attempt went a lot better, and it worked up nice and easily.

  1. knit
  2. purl
  3. knit
  4. purl
  5. purl
  6. knit

2. Seed Stitch

Seeds stitch is another knit and purl stitch, but this time it alternates along the row. It is a two row pattern on an even number of stitches.

  1. k1, p1
  2. p1, k1

3. Double Seed Stitch

It's a bit harder to remember which row you're on with double seed stitch. It has a repeat of four rows on an even number of stitches.

  1. k1, p1
  2. k1, p1
  3. p1, k1
  4. p1, k1

Hope and Inspiration

Monday 20 April 2015

Cold Spots in the Universe, Purse Stitch, Garter Stitch Stripe

1. Cold Spots in the Universe

According to a Guardian article on astronomy, there is less dense area in the Universe with is 20% less dense than the rest of the Universe. This is unusual because the Universe is fairly evenly distributed. This area is also a cold spot. It's 1.8 billion light years across.

2. Purse Stitch

Purse stitch is a rather pretty lacy stitch. It felt a bit awkward for the first two rows, but then I got into the swing of it. It's quite easy in that there is no need to keep track of which row or where in the pattern you are as it's a very simple repeat. It's consists of a single row on an even number of stitches.

  1. knit 1 (yarn over, slip stitch next stitch as if to knit, then the same for the next, put the left needle back through the two stitches, then knit them) repeat to the end, knit the final stitch

3. Garter Stitch Stripe

Garter Stitch Stripe is a simple stitch consisting of four rows.

  1. knit
  2. purl
  3. knit
  4. knit

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.

Sunday 19 April 2015

Bootstrap, Search Engine Market Share, jQuery

1. Bootstrap

Although I've used Bootstrap before, I'd used a slightly different method for switching the order of elements from smaller to larger screen sizes. What clicked today was the use of col-md-push-6 and col-md-pull-6.

2. Search Engine Market Share

In the USA, the search engine market share is split between Google (64.4%), Microsoft's Bing (20.1%) and Yahoo (12.7%). In Europe, Google has 90-95%.

3. jQuery and AngularJS

I saw $document.one() in some code I was reading today and thought it was a typo for $document.on(). It's not. It does the same as $document.on() but is only called once, and is unbound afterwards.

Wednesday 15 April 2015

Multiplication and Division Symbols, Simultaneous Equations, Bootswatch

1. Multiplication and Division Symbols

It was an English mathematician, William Oughtred, in 1631 who used × to represent multiplication and : to represent division. See Enlightening Symbols by Joseph Mazur, p83.

I find it interesting that : is only used in the UK for ratios, rather than division itself whereas in Finland it is still used to indicate division.

2. The Flower of Thymaridas

A rule to solve some sets of simultaneous equations was known in early Pythagorean times. It was known as the Flower of Thymaridas. For example for four variables, you will need to know the sum of all four variables and then to find one particular variable, you will need to know the sum of that variable and each of the other three. For example, the sum of all four is 20, and the sum of the quantity we want to know and the second quantity is 7, and the sum with the next quantity is 6 and the sum with the final quantity is 15. In algebraic terms, if x is the quantity we want to know, we have the following.

     x + y + z + w = 20  (1)
     x + y         =  7  (2)
     x     + z     =  6  (3)
     x         + w = 15  (4)

To find the desired quantity, sum the sums of the pairs, and then subtract the sum of the four numbers. We then divide by the number of equations we added minus one, so in our example, we sum 7, 6 and 15 to get 28 and then subtract 20 leaving 8. This is then divide by 3-1 = 2 so our unknown quantity is 8/2 = 4. In algebraic terms, this means the following.

(2) + (3) + (4)    3x + y + z + w = 28  (5)
                    x + y + z + w = 10  (1)
                   ___________________
(5) - (1)          2x             =  8  (6)
(6)/2               x             =  4  
See Enlightening Symbols by Joseph Mazur, p93. and Wikipedia

3. Bootswatch

Instead of using Bootstrap straight out of the box or spending a considerable amount of time customising it yourself, you can use themes created by other people such as at Bootswatch.

Tuesday 14 April 2015

Swedish, TypeScript, Control

1. Cheese Plane

I lived in Sweden for seven or eight years. For some things which I hadn't seen before in England, I use the Swedish word. Osthyvel is one of these things.


Wikipedia - Jonas Bergsten

I suppose you could say it's a cheese slicer but there are so many different ways to slice cheese, and this is a particular tool. Well, today, while looking for microplane zesters, I stumbled across an osthyvel at Ocado. They call it a "cheese plane" which is so much more precise than cheese slicer.

2. TypeScript

You can use classes in TypeScript along with private and static. Static properties and functions live on the class, and are shared between all instances. If you make a variable private, then it will only be accessible from within the class.

3.High Control Groups

Four tactics used by high control groups, such as cults, are:

  • Behaviour control,
  • Information control,
  • Thought control,
  • Emotional control.

Monday 13 April 2015

Type A/B, jQuery, Loops in JavaScript

1. Type A and Type B

The original Type A and Type B tests were funded by the tobacco industry and the link between heart disease and personality type is disputed.

2. jQuery

jQuery was originally called JSelect but because the domain jselect.com was taken, John Resig had to come up with a new name. Apparently, there was also Java SQL library also called jQuery, before JavaScript's jQuery, but they had let the domain lapse. Source: Annotations on an early version of jQuery by John Resig.

3. Loops in JavaScript

There are risks with hoisting and scope when using for-loops in JavaScript so in general it's better to use underscore's _.each function. However, for a simple loop and where response time is critical, creating _.range in order to use _.each outweighs the benefits.

Sunday 12 April 2015

Drugs, Flowers, Multiplication

1. Drugs

One thing I hadn't realised until today is that I had no idea how people smoke something like crystal meth because to me smoking means setting something on fire and inhaling the burning fumes. I hadn't considered that something where the substance is heated (as opposed to burnt) to turn it into a gas could be considered as smoking.

2. Skeleton Flower

There's a plant called the skeleton flower (Diphylleia grayi) which turns transparent on contact with water.

3. Multiplying Numbers up to 10

Today I learnt a method of multiplication found in sixteenth century texts. To multiply two numbers, 8 and 7, in the example, subtract each from 10. Multiply the results of these subtractions to get 6, which is the units value. Subtract one of the original numbers by the result of subtracting the other number from ten, so in this case 8-3 (or 7-2) to get 5. Put these answers together to get 56. See table below.

NumberNumber subtracted from 10
810-8=2
710-7=3
8-3=52x3=6

I don't know how they would handle numbers such as 7x6 where the product of the result of the subtractions is two digits, in this case, 3x4=12 although it would be simple enough to carry the one.

NumberNumber subtracted from 10
710-7=3
610-6=4
7-4=33x4=12

In this case the 1 from 12 should be added to the 3 but whether this is how people in the sixteenth century handled it is a mystery to me.

Why does it work?

Suppose the first number is x and the second y.

NumberNumber subtracted from 10
x10-x
y10-y
x-(10-y)(10-x)(10-y)

Since the result in the first column represents a digit in the tens column, we multiply it by 10 before adding it to the result in the second column, to get the result below.

10(x-(10-y)) + (10-x)(10-y) = (10x-100+10y) + (100-10x-10y+xy)
                            = xy

This proves that this method does indeed produce the product xy of x and y.

Saturday 11 April 2015

Pig in a Poke, Mayan Number, Baldwin Effect

1. Pig in a Poke

I'd heard the expression "pig in a poke" before but I didn't know what it meant. Apparently a poke comes from the French word poque (same root as pocket), and means a bag. Don't buy a pig in a poke means don't buy something without looking at it first. A trick in mediaeval times was to put a dog or cat in the bag instead. The trick would be revealed by letting the cat out of the bag.

2. Mayan Numbers

Mayan numbers were constructed using dots (representing 1), dashes (representing 5) and a shell-like symbol which was a placeholder, used like 0 in 103 to indicate that 1 represents 100 rather than 10. It is partially a base 20 system although not quite. For example,

   .
   -       1+5=6 which is multiplied by 18 x 20 x 20

  . .      2 which is multiplied by 18 x 20

   -       5 which is multiplied by 20

  ...      
   _
   _
   _       5+5+5+3=18 (units)

is the number 6x18x20x20 + 2x18x20 + 5x20 + 18 which is 44038.

3. Baldwin Effect

The Baldwin effect is when a learnt behaviour evolves into an inherited instinct through natural selection.

Eggs, AngularJS Scope, Opposable Thumbs

2. Angularjs Scope

In a directive scope:true creates a new scope with prototypical inheritance from the parent scope. When scope: {...} is used, an isolate scope is created which can not read from or write to the parent scope unless specific two-way or one-way bindings are set up.

3. Koalas

Koalas not only have opposable thumbs, but they have two of them on each of their two forefeet.

Vaccinations, TypeScript, Hebrew Numbers

1. Vaccinations in the UK

It's important for the population for a large percentage (usually somewhere around 90% depending on the disease) to be vaccinated to provide herd immunity (if enough are vaccinated, the disease can't jump from person to person and so is unable to spread much.) Herd immunity helps to protect children too young to have the vaccine, and those who have compromised immune system such as those receiving cancer treatments or with AIDS.

Different countries have different policies to attempt to achieve this. In the article Should childhood vaccination be compulsory in the UK?, I learnt some of the issues determining policies. One of the problems of forcing children to be vaccinated is that it erodes trust between the parents and health provider, and between the parents and government. Parents who do not vaccinate their children tend to do so because of a fear of doing harm, a fear as to the safety of vaccines, or the belief that their child will not catch the infection, or if they do, it will not be severe.

Vaccination in the UK is not compulsory, yet there is a high uptake.

2. TypeScript

TypeScript is a superset of JavaScript which means that any JavaScript file is already a TypeScript file. TypeScript compiles into JavaScript (ES3, ES5 or ES6). It has type annotation, where you declare a type such as in

var x: number = 3;
and type inference, where it knows the type from what you set the variable equal to. In the next example, it infers that x is of type number.

var x = 3;

Since TypeScript is compiled into JavaScript, it has no impact on runtime.

3. Hebrew Numbers

Hebrew numbers are written using the letters in the alphabet, so א is used to represent 1. In order to show that it's the number 1 instead of the letter, it is prepended by ׳ giving ׳א. Numbers not represented by the letters of the alphabet, are formed by summing, so 12 is written using the symbols for 10 (י) and 2 (ב) giving י״ב. The ״ is used to show that it is a number rather than a word. It is placed before the last number (reading right to left) so 780 would be written as תש״פ where פ is 80, ת is 300, and פ is 400. Note that Hebrew is written from right to left, with the usual convention that the smallest number is on the left. There are some exceptions. To avoid writing the names of god, 15 is written as 9+6 ט״ו‎, and 16 as 9+7 ט״ז‎‎. Sometimes the order is rearranged to avoid words with negative connotations.

Thursday 9 April 2015

Plus Symbol, Symbol, Gulp

1. The Plus Symbol

The plus symbol + comes from the letter t in Latin word et meaning and.

2. Symbol

The word symbol comes from the Greek word for token or token of identity. This word is made up from two Greek words sum (together) and ballo (to throw). In ancient times, a stick or bone was broken into two and each party took a piece. The pieces were a symbol of the relationship, confirmed by the two pieces fitting perfectly together.

3. Gulp

I've just started the edX TypeScript course. So far I'm enjoying it although it's quite challenging. In the second lesson, there's a rather large jump with some missing information, but with the help of a link in the forums to a blog post I was able to set up a typeScript workflow using gulp.

What is significant about this for me is that two months ago I have no idea how build scripts worked. They were in the scary mystery bucket. To make a small change to some code, I needed to understand the build process, and so I'd worked my way through the project's grunt file. Grunt is, like gulp, a build task runner. Because of their similarity, I understood, at least on a surface level, what the gulp file was doing. I'd learnt more than I thought I had!

Tuesday 7 April 2015

Werewolf, Egg within an Egg, Upside Down Photos

1. Werewolf

When I was looking at the etymology of dummvirate, I saw mention of werewolf. The root of were is also vir, but via the old English, wer meaning man, male person.

2. Egg within an egg

I watched this video of a large egg, which when cracked contained a smaller fully formed egg complete with shell.

I didn't know whether it was a spoof or not, and if not a spoof then how was it formed?

Formation of an Egg

An egg is formed through several stages.

  1. Yolk: The oocyte (yolk) is produced by the ovary, and enters the oviduct.
  2. White: In the first part of the oviduct, the magnum, the yolk is covered with the white (albumen).
  3. Membrane: In the next section of the oviduct, the isthmus, a membrane is deposited over the partially formed egg.
  4. Shell: Next the egg reaches the uterus (shell gland) where a layer of calcium carbonate is deposited around it. This takes between nineteen and twenty-six hours. This forms the shell.
  5. Protective bloom: The last layer, protective bloom, is deposited around the egg. This seals the pores in the shell and keeps the egg fresher for longer.
  6. Finally the egg is laid.

The egg-in-egg phenomenon occurs when a second oocyte is released before the first egg is laid. A contraction occurs, called a counter-peristalsis contraction, which causes the egg to travel backwards through the oviduct, where it joins with the second oocyte to be coated with albumen, membrane and shell again. It ends up as a rather large egg for the poor hen to lay!

3. Upside Down Photos

A friend of mine was having some problems with images on his website. Some of the images displayed upside down and some the right way up. However, when the images were opened in a new tab, they were the right way up. What on earth was going on?

You can take a photo with an iPhone in different orientations. For speed, instead of saving the correctly orientated version of the photo, Apple adds an EXIF tag 'orientation' which tells apps which way up the image should be displayed. Using Jeffrey's Exif Viewer, you can see the details saved along with the image. For example, for an image that was taken with the phone upside down, you get

orientation 180 degree

but for the right way up you instead see

orientation horizontal (normal)

Mystery solved. Now we know what is going on, the next problem is what to do about it. It seems that the solution is to rotate the photos before uploading. There are tools which enable you to do this by rotating based on the orientation. Note that I have not tried and of these tools.

Sunday 5 April 2015

Duumvirate, Fluency, Alcohol Content

1. Duumvirate

The word duumvirate means the joint office or authority of two. Similarly triumvirate means the joint authority of three people. Duumvirate comes from the Latin for man which is vir, and two which is duo.

2. Fluency

Whenever I've filled in a form, I've had problems working out what level I am in a language. What does fluent mean? I don't want to put something untrue on my CV, and I don't want to overclaim my ability, but what can I claim? Well, I still can't answer that question, but I do understand better why I've had so much trouble with working it out. http://www.babbel.com/magazine/myths-of-fluency

3. Proof and Alcohol by Volume

A friend made some limoncello using Everclear. I hadn't heard of this product so I looked it up. That led me to wondering about different measuring systems between the USA and the UK. For instance, in the USA, a tablespoon is 14.8 ml and in the UK it's 17.8 ml. Confusing, isn't it? Well, why should the way alcohol is measured in drinks be any different?

Historically, in the UK, a drink would be proved to test how much alcohol it had by pouring some on gunpowder and lighting it. If it burnt with a steady flame, it was 100 degrees proof. If it burnt too quickly, it was overproof and if it failed to burn at all it was underproof. The amount of alcohol required for 100 degrees proof is 57.15% by volume (unsure what temperature this is at.

In the USA, the proof of a drink is twice the percentage of alcohol by volume at 60\deg; Fahrenheit (15.6\deg; Celsius).

Fortunately, the international standard defined by International Organization of Legal Metrology is now used in the USA and the UK amongst others. The alcohol by volume (ABV) used is the percentage of alcohol at 20\deg; C (68\deg; F).

Sources

Saturday 4 April 2015

The Blink Tag, Asterisk, Caduceus

1. The Origin of the <blink> Tag

Back in the late '90s, I remember coming across the blink tag. It was horrible. Flash flash flash all over the place. Yuck. Well, today I found out how it came about in a Friday night discussion at a bar. The next morning, it had already been implemented in the UNIX version of Netscape! It spread to the Windows and Mac versions and was release with no fanfair. People found out and sadly the web became full of flashy nastiness!

2. Etymology of Asterisk

The word "asterisk" comes Late Latin asteriscus and Greek asteriskos which means little star. Compare with astro- for words related to the stars.

3. Caduceus

I learnt today that this symbol:

is called the caduceus, which comes from the Greek for herald's staff. It was carried by Hermes, the messenger of the gods.

Patternicity, Renewable Energy, Progeria

1. Patternicity

I came across the word "patternicity" today in the comments on a blog post about people associating the full moon with crazy behaviour. I can imagine that if there ever has been some sort of positive correlation between extra rowdiness and the full moon, then it would have been in an era when night time lighting wasn't a thing and to be able to be out at night was more difficult. More people about, more likelihood of bad behaviour.

Patternicity is the finding of non-existent patterns, and as such seems like it might be another word for pareidolia. Not recognising real patterns is called apatternicity. From an evolutionary point of view, apatternicity is much more dangerous than patternicity since a false positive is less likely to kill you than a false negative – is it a snake or not? If it is and you think it isn't you could die. If it isn't an you think it is, no harm done.

2. Renewable Energy

A few years ago, I went to a talk about an optimist's tour of the future. We hear so much doom and gloom about the future, but this talk was a light in the darkness. It gave a glimpse into how people are coming up with ingenious solutions to today's problems from revitalising the farmland in Australia to growing human organs to capturing carbon dioxide from the atmosphere.

Today I read an article on renewable energy sources which falls into the same category of ingenious solutions. This solutions range from artificial tree wind turbines which work at half the windspeed of the giant concrete windmills scattered about the countryside, to harnessing the excess heat in the London Underground to heat local homes, to giant solar powered ducks! The wind turbine trees are being tested in Paris this spring and are due to be installed across France later this year.

3. Progeria

There was an article in the Telegraph today about a girl with Progeria died. Progeria is a progressive genetic disorder which causes aging at up to ten times the normal rate. People with this disorder have dwarfism and small faces, and problems associated with aging. They usually don't live past 13. There are only around 70 known cases of it.

Thursday 2 April 2015

CSS attr, Angularjs, Tetrodotoxin

1. CSS attr

You can take the attributes values from the parent and display them using the pseudo elements ::before and ::after. See MDN's page on attr for further details.


<html>
  <head>
    <style>
      p::before {
        content: attr(data-foo) " small small " attr(data-bar) " ";
      }
    </style>
  </head>
  <body>
    <p data-foo="hello" data-bar="crazy">world</p>
  </body>
</html>

This displays "hello small small crazy world" in the page. I don't think this is going to be a good way to use it. Using the chrome extension chromeVox which simulates a screen reader, only the word "world" is read out. This is also the only word that can be copied from the visible text on the page. Looks like it could be useful for testing though.

2. Angularjs

This one is harder to pin down. I'm working my way through the angular.js developer documentation so I'm cementing my knowledge of angular and filling in various holes. I started with directives today and will finish off tomorrow.

3. Tetrodotoxin - the poison in puffer fish

Tetrodotoxin is found in various different species, mostly marine, but recently it has been found in a flatworm. Some use it for defence (the pufferfish has it in its skin), some for attack (the Bipalium flatworms has it mostly in its head)and some even to find mates! A few millilitres of this poison will kill a person within 20 minutes. This usually occurs by the paralysis of the diaphragm, thus causing respiratory failure.

Wednesday 1 April 2015

Grep, Dry Skin, W3C Tools

1. What grep stands for

The first thing I learnt today is that grep stands for globally (g) search a regular expression (re) and print (p). (Thanks Jennie.)

2. Dry Skin

Apparently udder cream is really good for very dry skin. Yes, udder as in the thing cows have. I'd never heard of udder cream before.

3. W3C tools

Unicorn

I knew about W3C's HTML validator and CSS validator but I didn't know there is a combined tool called unicorn.

Cheatsheet

All I can say about this is how did I not know about it?

w3c cheatsheet showing search box and tabs

The cheatsheet has search functionality for HTML, JavaScript, CSS, SVG, and XPath, as well as guidelines on accessibility, mobile best practices, typography, and internationalisation.

The Beginning

I'm going to challenge myself to learn three things every day. They can be small things like the meaning of a new word or bigger things like a whole new concept, or maybe how to make something, or a new cooking technique or just cementing a concept. So what are today's new things?

1. JavaScript and NaN

JavaScript has so many gems. Consider the following:

var x = NaN;
var y = x === x;

So what is y? Is it true or false? Spoiler (highlight area to read): It's false. I knew what NaN === NaN would give but then I wondered whether using a variable would make a difference? For instance, {} === {} is false, but what is y in the following?

var x = {};
var y = x === x;

In this case what is y? Spoiler: It's true.

2. The Importance of Companies Showing They Care

Yesterday, I finished off the Thinkful Modern Web Design course, and today I had my exit interview. The exit interview was for me to give feedback on the course. Someone taking the time to ask me what I thought of the course, to listen to my feedback and to show appreciation of the feedback, harsh as it was, gave me a very positive view of the company and whether their courses are worth taking. (My mentor was amazing, but I think the course itself needs some work. Given that someone took the time to personally gather feedback by meeting with me, I am confident that Thinkful takes feedback seriously and will actively work towards improving their courses.) For me, this cements the idea that it doesn't matter what a company might say about caring, what really matters to me as a consumer of their services is the action. They showed me they care.

3. Software Engineering Myths

I thought that the 10x engineer term that I've heard a lot recently was just a trendy over-the-top description that didn't mean anything. I found out today that it is based on data from the 1970s, a whole different world in computing. I can imagine that maybe back then, it could be true that one programmer was 10x better than some other since there was no Google, no easy way to look things up, no quick cycle to test and correct your code, and it could even take a day to see if your code runs properly.