Dr Administrator

Author's posts

Book review: Numbers and the making of Us by Caleb Everett

numbersMy next read is Numbers and the Making of Us by Caleb Everett. It is a book about our innate numerical senses, and how we developed skills beyond them that are enabled by the language of numbers.

The book starts with an overview of numbers in writing systems. Highlighting that ways of recording numbers, in the form of tallies, appeared before full blown language. Tallies seem to be evident in prehistoric artefacts before being found in the Fertile Crescent where they were used to record quantities of grain and the like in early written languages. Later in the book Everett proposes that “static” agriculture drives the development of numerical language, citing as evidence the fact that the few remaining hunter-gatherer societies have fewer number-words than their agricultural counterparts. He suggests that as specialisation due to agricultural occurs, it becomes necessary to record amounts of food so that they can be bought and sold (or exchanged for other goods).  

I was interested to read that many human number systems are quinary, decimal or vigesimal, or put more simply based on 5, 10 and 20. This relates to the number of fingers and toes we have, our number words are linked to the numbers of our fingers and toes because they are used for counting. In some languages the link to fingers and toes is explicit, whilst in Western European languages it is not. Vigesimal vestiges remain – in English the number 20 has it’s own special word – score. And in French eighty is quatre vingt and ninety is quatre vingt dix. Later in the book, Everett suggests that our bipedalism helps with the development of counting – our fingers being relatively available (unlike toes) and also important because of our use of tools.

Numbers don’t just come into language in the form of numbers, they can be inferred in the plurals of nouns, or in the forms of verbs. In English we are used to the idea of adding an “s” at the end of a word to make a noun a plural. This is common across many languages. Plurals can also be formed with prefixes (at the start of the word), and even “Infixes”. For example in the Tuwali Ifugao language woman is babai but women is binabai. The plural is formed by adding –in- within the word. But not only this, number can be indicated in the conjugation of forms, and pronoun forms. English is a bit sparse in this regard, other languages have pronouns indicating two or three people as well as just the English divisions of one (I) and many (we).

It seems we have an innate, “exact” number sense for numbers up to three. Beyond three we have a innate, fuzzy number sense meaning we can tell when objects groups are more than or less than one another but where we cannot accurately subject the numbers of objects in a group. Beyond these two senses is a matter of learning.

The evidence for this comes from a number of places, the first of these are experiments with people from anumeric Amazonian tribes and Nicuraguan home signers, who are also anumeric. By anumeric, we mean that they do not have number words beyond three. These people are able to distinguish small numbers exactly but become increasingly inaccurate beyond 3.  

A second strand of evidence comes from the investigation of numeric ability in children, some as young as 48 hours old! Although older children can be questioned directly in spoken language regarding numbers, for younger children it is necessary to use indirect methods. In particular, researchers can track gaze, and watch the absence of sucking on a dummy. Children (and adults), turn their gaze to things they find interesting or unusual and will stop chewing/swallowing/sucking as well. An example experiment in this area is to hide an object behind a screen, and then pretend (or not) to add a second object of the same type, or remove the object. If the child shows excessive gaze, or reduced sucking then it is inferred they are surprised by what they see when the screen is dropped again. That’s to say if they see 2 objects when they expected 1, or vice versa. This surprise implies the ability to count.

Evidence for the exact and fuzzy number sense is also found in experiments on animals. Although some animals, following much training appear to be able to count exactly beyond 3 they are rare. Otherwise they show the same types of innate abilities that we have.

Language is the enabler for exact counting beyond three, clearly sometime in the past one or more humans has learned how to count. Embodying this ability into language enabled it to be transmitted to other, less gifted humans.   

I found this book really fascinating, interested, as I am in both words and numbers.

Book review: Women in Science by Rachel Ignotofsky

women_in_scienceWomen in Science by Rachel Ignotofsky is a whistle-stop tour of 50 women in science mainly from the mid-19th century onwards. Each woman gets a double page spread, with a few paragraphs of text on one page and a cartoon drawing of them and some catchphrases on the other. As well as this there is a centrefold of lab equipment, a timeline and some very brief descriptions of 14 further women in science at the end. You can see more on the authors website, here.

Also included are some statistics on women in science, technology, engineering and maths (STEM), I suspect the figures relate to the US but the picture would not be dramatically different in the UK. On the plus side the proportion of women in STEM has increased from 14% in 1970 to 41% in 2011 and it has been rising steadily. The proportion of engineers who are women rose from 3% in 1970 but has been on a plateau at 13% since 1990. In computer work the proportion of women peaked in 1990 and has been dropping since then, it now stands at 27%.

Why is this important? Historically women have been treated as second class citizens. It wasn’t that they tried to do the things that men did traditionally, and failed. They were very actively prevented from studying in their chosen fields. They weren’t allowed into science labs or science lectures. And if by some chance they did manage to train themselves, there were no jobs or facilities for them to continue their work because they were women. This is the legacy we are trying to overcome.

It isn’t a matter of deep history, women alive today will have been refused access to degree courses in their chosen subjects. Cambridge University, for example, only awarded the first full degree to a woman in 1946, which is the year my mother was born. The parents of men alive today would have kept those systems in place. Women only got the vote in the UK during the lifetime of my grandparents. After I was born my mother was denied an application form for an administrative job at a local garage because the owner felt that her place was at home with her young children. Since the 1970s the spirit of the welfare system in the UK has changed to one in which it is seen as best for both parents to work. And yet historically women have been denied access to many careers. This leaves a legacy because people tend to recruit other people like themselves. The aspirations of children and young people are shaped by the roles they see people like them undertaking.

This book provides a set of role models that show that women can be successful in science.

The 50 chosen women are from a range of sources, many of them are from the rather sparse roll-call of female Nobel Prize winners. Some of the names I recognised: Marie Curie, Jocelyn Bell-Burnell, Jane Goodall, Ada Lovelace, Katherine Johnson (through my very recent reading), Dorothy Hodgkin, Rachel Carson, Lise Meitner. Others I had never heard of, like Lillian Gilbreth who worked on psychology and industrial design. Or Patricia Bath, who founded the American Institute for the Prevention of Blindness.

I’ve looked through the book with my son (aged 5), he seemed to like it – although his main questions on each page were “Where was she born?” and “Where did she go?”. Then again in a book on the history of art his questions were “Where’s Jesus?” and “Why are those people naked?”. I suspect it is better suited to children a little older than him.

Currently my son is binge watching “Horrible Histories”, a programme for children about history. It is a string of vignettes from history acted as adverts, as music videos, game shows or just plain acted. It is lively and educational. It strikes me that Women in Science would provide an excellent source for a sister programme.

I don’t think I am the intended audience for this book but it did remind me to put some more biographies of women in science on my reading list. I’m pleased to see there is a biography of Maria Sibylla Merian, 17th century illustrator and entomologist. Ada Lovelace and Mary Anning are also on my list.

Book Review: Scala for the Impatient by Cay S. Horstmann

scala_for_impatientI thought I should learn a new language, and Scala seemed like a good choice so I got Scala for the Impatient by Cay S. Horstmann.

Scala is a functional programming language which supports object orientation too. I’m attracted to it for a number of reasons. Firstly, I’m using or considering using a number of technologies which are based on Java – such as Elasticsearch, Neo4j and Spark. Although there are bindings to my favoured language, Python, for Spark in particular I feel a second class citizen. Scala, running as it does on the Java Virtual Machine, allows you to import Java functions easily and so gives better access to these systems.

I’m also attracted to Scala because it is rather less verbose than Java. It feels like some of the core aspects of the language ecosystem (like the dependency manager and testing frameworks) have matured rapidly although the range of available libraries is smaller than that of older languages.

Scala for the Impatient gets on with providing details of the language without much preamble. Its working assumption is that you’re somewhat familiar with Java and so concepts are explained relative to Java. I felt like it also made an assumption that you knew about the broad features of the language, since it made some use of forward referencing – where features are used in an example before being explained somewhat later in the book.

I must admit programming in Scala is a bit of a culture shock after Python. Partly because its compiled rather than interpreted, although the environment does what it can to elide this difference – Scala has an REPL (read-evaluate-print-loop) which works in the background by doing a quick compile. This allows you to play around with the language very easily. The second difference is static typing – Scala is a friendly statically typed language in the sense that if you initialise something with a string value then it doesn’t force you to tell it you want this to be a string. But everything does have a very definite type. It follows the modern hipster style of putting the type after the symbol name (i.e var somevariablename: Int = 5 ), as in Go rather than before, as in earlier languages (i.e int somevariablename = 5).

You have to declare new variables as either var or val. Variables (var) are mutable and values (val) are immutable. It strikes me that static typing and this feature should fix half of my programming errors which in a dynamically typed language are usually mis-spelling variable names, changing something as a side effect and putting the wrong type of thing into a variable – usually during I/O.

The book starts with chapters on basic control structures and data types, to classes and objects and collection data types. There are odd chapters on file handling and regular expressions, and also on XML processing which is built into the language, although it does not implement the popular xpath query language for XML. There is also a chapter on the parsing of formal grammars.

I found the chapter on futures and promises fascinating, these are relatively new ways to handle concurrency and parallelism which I hadn’t been exposed to before, I notice they have recently been introduced to Python.

Chapters on type parameters, advanced types and implicit types had me mostly confused although the early parts were straightforward enough. I’d heard of templating classes and data strctures but as someone programming mainly in a dynamically typed languages I hadn’t any call for them. I turns out templating is a whole lot more complicated than I realised!

My favourite chapter was the one on collections – perhaps because I’m a data scientists, and collections are where I put my data. Scala has a rich collection of collections and methods operating on collections. It avoids the abomination of the Python “dictionary” whose members are not ordered, as you might expect. Scala calls such a data structure a HashMap.

It remains to be seen whether reading, once again, chapters on object-oriented programming will result in me writing object-oriented programs. It hasn’t done in the past.

Scala for the Impatient doesn’t really cover the mechanics of installing Scala on your system or the development environment you might use but then such information tends to go stale fast and depends on platform. I will likely write a post on this, since installing Scala and its build tool, sbt, behind a corporate proxy was a small adventure.

Googling for further help I found myself at the Scala Cookbook by Alvin Alexander quite frequently. The definitive reference book for Scala is Programming in Scala by Martin Odersky, Lex Spoon and Bill Venners. Resorting to my now familiar technique of searching the acknowledgements for women working in the area, I found Susan Potter whose website is here.

Scala for the Impatient is well-named, it whistles through the language at a brisk pace, assuming you know how to program. It highlights the differences with Java, and provides you with the vocabulary to find out more.

Book review: The Man Who Ate the Zoo by Richard Girling

AteTheZooA second birthday book: The Man Who Ate the Zoo by Richard Girling is the biography of Francis (Frank) Buckland who lived 1826-80 and can best be described as a naturalist populariser. His father William Buckland was a famous naturalist, and also Dean of Westminster.

The book is chronological in its layout, starting with something of Buckland’s father William Buckland. Who coined the term coprolites to describe fossilised faeces. An early geologist he was also a theologian, rising to become the Dean of Westminster and by this connection his son Frank was exposed to the best in society from a young age.

Girling writes less of Buckland’s mother but there is a rather poignant letter to him from her as he leaves at the age of five to go to boarding school. It is loving but bemoans his impatience and lack of obedience, a letter I might write to my own son!

Buckland’s life at school and then university was unremarkable from an academic point of view but rather exotic. At school he seems to have spent a great deal of time dissecting any number of animals which came under his hand including numerous domestic cats. At the time this appears to have been unusual but no cause for concern. At university he kept something of a menagerie including a bear, named Tiglath-Pileser.

Following university Buckland trained as a surgeon, travelling to Paris in 1849 to dissect victims of cholera, who were in ample supply – the disease killed 19,000 people in that city. After training he joined the Life Guards in London as a surgeon. This does not appear to have been an onerous job since he managed to write a great deal during this time and dissect pretty much what he wanted.

He left the army in 1863, and took up residence in Albany Street, close to London Zoo and married Hannah Papps, who had borne him a child some years previously, out of wedlock – which would have been scandalous at the time. The child, Physie (Francis John), died at the age of four and a half.

Writing then became Buckland’s career. He published Curiosities of Natural History and wrote copious articles for periodicals such as The Field. The house at Albany Street played host to the famous and the “freakish”. Buckland’s interest in nature extended to the unusual in humans: giants, dwarves, hairy women and Siamese twins. Somewhat quaintly the author claims we no longer have the terrible freak shows of Victorian times. I suggest he peruse a few documentaries on TV! 

Buckland was a member of the British Acclimatisation Society whose purpose was introducing new domestic animals into the United Kingdom for the purposes of feeding the masses more cheaply, or better for the same sum. This led to a life of eating all manner of strange and exotic creatures. Perhaps happily little came of their investigations.

Buckland was appointed Inspector of Fisheries in 1867. This started in inland waters where he travelled the country inspecting salmon rivers and also worked on fish farming, eventually sending salmon eggs around the world to populate New Zealand rivers. He was keen to restore the inland waterways to make them liveable for salmon both in terms of their cleanliness and the infrastructure in them – putting salmon ladders beside man-made weirs. Subsequently he worked on marine fisheries. His final substantial work was a report on marine fisheries: Report on the sea fisheries of England and Wales.

The Victorian period was a time of change, early in the 19th century the first animal protection legislation was enacted and towards the end there was a growing realisation of the impact of man on the environment. In a way Report on sea fisheries was a swansong to the old way of thinking, it put forward the idea that the sea fisheries were effectively limitless in their capacity but called for more research into these critical food animals.

Buckland, and his father, lived in the time of Charles Darwin although his father died before the publication of On the Origin of Species  in 1859. The origins of life had been a topic of scientific interest to which both Bucklands made their contribution, on the side of the what we would now call the Creationists.

I couldn’t help thinking of Michael Faraday and David Attenborough when reading about Frank Buckland, neither can claim to be the greatest of scientists but their impact through communicating a wonder of science and nature (and a genuine deep knowledge of them) has been enormous.

The Man Who Ate the Zoo is a pleasant enough read, Buckland is an interesting character and left a legacy in fisheries research. 

Book review: BDD in Action by John Ferguson Smart

bddinactionBack to technical reading with this book BDD in Action by John Ferguson Smart. BDD stands for Behaviour Driven Development, a relatively new technique for specifying software requirements.

Behaviour Driven Development is an evolution of the Agile software development methodology which has project managers writing “stories” to describe features, and sees developers writing automated tests to guide the writing of code – this part is called “test driven development”. In behaviour driven development the project manager, along with their colleagues who may be business analysts, testers and developers, write structured, but still “natural language”, acceptance criteria which are translated into tests that are executed automatically.

Behaviour Driven Development was invented by Dan North whilst at Thoughtworks in London, there he wrote the first BDD test framework, JBehave and defined the language of the tests, called Gherkin. Gherkin looks like this:

Scenario: Register for online banking

Given that bill wants to register for online banking

When he submits his application online

Then his application should be created in a pending state

And he should be sent a PDF contract to sign by email

The scenario describes the feature that we are trying to implement, and the Given-When-Then steps describe the test, Given is the setup, When is an action and Then is the expected outcome. The developer writes so called “step definitions” which map to these steps and the BDD test framework arranges the running of the tests and the collection of results. There is a bit more to Gherkin than the snippet above encompasses, it can provide named variables and values, and even tables of values and outputs to be fed to the tests.

Subsequently BDD frameworks have been written for other languages, such as Lettuce for Python, SpecFlow for .NET and Cucumber for Ruby. There are higher level tools such as Thucydides and Cucumber Reports. These tools can be used to generate so-called “Living Documentation” where the documentation is guaranteed to describe the developed application because it describes the tests around which the application was built. Of course it is possible to write poorly considered tests and thus poor living documentation but the alternative is writing documentation completely divorced from code.

Reading the paragraph above I can see that for non-developers the choice of names may seem a bit whacky but that’s a foible of developers. I still have no idea how to pronounce Thucydides and my spelling of it is erratic.

BDD in Action describes all of this process including the non-technical parts of writing the test scenarios, and the execution of those scenarios using appropriate tools. It takes care to present examples across the range of languages and BDD frameworks. This is quite useful since it exposes some of how the different languages work and also shows the various dialects of Gherkin. BDD in Action also covers processes such as continuous integration and integration testing using Selenium.

As someone currently more on the developer side of the fence, rather than the (non-coding) project manager BDD seems to add additional layers of complexity since now I need a library to link my BDD style tests to actual code, and whilst I’m at it I may also include a test-runner library and a library for writing unit tests in BDD style (such as spock).

I’ve had some experience of managing Agile development and with that hat on BDD feels more promising, in principle I can now capture capabilities and feature requirements with my stakeholders in a language that my developers can run as code. Ideally BDD makes the project manager and stakeholders discuss the requirements in the form of explicit examples which the developers will code against.

BDD in Action has reminded why I haven’t spent much time using Java: everything is buried deep in directories, there are curly brackets everywhere and lots of boilerplate!

I suspect I won’t be using BDD in my current work but I’ll keep it in the back of my mind for when the need arises. Even without the tooling it is a different way of talking to stakeholders about requirements. From a technical point of view I’m thinking of switching my test naming conventions to methods like test_that_this_function_does_something arranged in classes named like WhenIWantToDoThisThing, as proposed in the text.

In keeping with my newfound sensitivity to the lack of women in technical writing, I scanned the acknowledgements for women and found Liz Keogh – who is also mentioned a number of times in the text as an experienced practioner of BDD. You can find Liz Keogh here. I did look for books on BDD written by women but I could find none.

If you want to know what Behaviour Driven Design is about, and you want to get a feel for how it looks technically in practice (without a firm commitment to any development language or libraries) then BDD in Action is a good place to start.