This morning Sophie asked for a poem and I asked which one she wanted, expecting it to be The Jumblies or something else from Edward Lear. Instead she threw me by asking for a poem about a pink turtle and a blue turtle. I was pretty pleased with what I came up with on the spot, and tried to write it down as soon as I had a chance. I was already having trouble remembering it all, but this was as close as I could get.
Sunday, October 12, 2014
The Turtle who was Pink and the Turtle who was Blue
Monday, June 9, 2014
Tygers - Chapter 3
I started wrote this in my journal a while ago, after Rosie wanted another Tiger story at bed time. I intended to add more to it, but never thought of anything good to add, so I figured I'd just throw in some illustrations and leave it as it is.
It was a sunny morning in early Spring. The streams were burbling happily to themselves, glad to be free of the winter ice, and feeling important because they were taking the melted snow water down to the river. The squirrels emerged, bleary eyed, from their tree trunks and tried to remember where they had hidden their nuts. And high in the branches a robin cautiously cleared its throat and tested its voice before commencing its morning song. It was on a morning such as this that two young tigers set out to explore the sights and sounds of Spring.
They had been been walking for about fifteen minutes when the older tiger, Rosie, noticed a scufflement at the base of a moss-covered bush. They went a little closer to investigate a saw a small brown animal snuffling among the roots. It had a black, twitchy nose, two black twinkly eyes, and, covering its back were prickles. The animal paused to look at the two approaching tigers.
"What kind of animal are you?" asked Sophie, the younger tiger, curiously.
"Ah," said the animal impressively, "I is an Erinaceus Europaeus, of the order Erininaceomorpha." Then, as the tigers look confused, it added "What is commonly called an 'edge 'og. And what might you two stripey young ladies be, if I might be so bold as to ask?".
"We're Tigers," said Rosie proudly. "I'm Rosie."
"And I'm Sophie," said Sophie.
"Bernard Tiggiewinkle Esquire. Delighted to make your aquaintance," said the hedge hog."I was named after Saint Tiggiewinkles 'edge 'og 'ospital where I was born," he explained. "Bernard is after Saint," he added.
"Oh," said Rosie. "Why do you keep scratching yourself with your hind leg?"
"Ah," said Bernard Tiggiewinkle, "that would be on account of these 'ere fleas itching something terrible. We 'edge 'ogs 'ave an awful lot of fleas."
Both the tigers took a few steps back.
"Not to worry missies," said the hedgehog. "'Edge 'og fleas is most particular. Not interested in other sorts of animals."
"What are you doing?" asked Sophie curiously.
"Looking for slugs," said Bernard Tiggiewinkle. "They're delicious," he said. "Look here's one."
Bernard held up a large, semi-translucent, wriggling slug that seemed to ooze slime. The two tigers, who had moved closer after hearing that they were safe from hedgehog fleas, took a step back again.
"Would you like to try one?" the hedgehog asked Rosie.
"No thank you," Rosie said politely.
"Are you sure? They're fresh. This one looks especially juicy."
"No thank you," said Rosie again.
"What about you, Miss?" said Bernard Tiggiewinkle turning to Sophie. "Very good for you slugs is. Highly nutritious."
"No thank you," said Sophie as politely as she could manage.
"Mighty fine slug this. Don't recall seeing better."
"It's very kind of you," said Sophie, "but I'm really not hungry."
"Ah well," said the hedgehog. "Suit yourself."
"There was a loud slurping noise as the slug disapeared into Bernard Tiggiewinkles mouth. The two twitching antennae were the last part to vanish. There followed by a few minutes of munching and swallowing noises, and then a the hedgehog emitted a soft "burp".
"As I thought," he said to himself. "Mighty fine slug that."
"Well," said Rose politely, "it was a pleasure meeting you Mister Tiggiewinkle."
The hedgehog nodded his head towards them in a formal manner before turning back to the bushes to search for more slugs, and the two tigers continued on their way.
Thursday, February 27, 2014
A Proposal for Assessing the Severity of Medical Conditions
Eventually I'm forced to conclude that the scale is in fact an arbitrary judgement, similar to the scoring system for Olympic figure skating, which then begs the question of whether pain should receive a different score if, say, it's inflicted by a Russian or a Korean athlete.
Of course figuring all this out distracts from the task at hand.
In order to avoid such confusion, I'm proposing that the medical community adopts a system of scales based upon more tangible concepts, such as, say, living organisms. If using organisms the comparative values can take into account a variety of factors such as complexity, position on the food chain, and, most importantly, coolness.
For example, a particularly nasty virus has recently been working it's way around my household and I was the last member of my family to succumb. A few days ago, when my wife asked me how I was feeling, I said that on a scale from Amoeba to Bengal Tiger, I rated as a sea slug. I then went back to bed for the remainder of the morning.
The following day I felt much better and rated myself, on the same scale, as a pygmy tree shrew. (The highest I seem to be able to get on this particular scale is about Aardvark, before some new blight is bought home from pre-school).
Of course it is quite possible to vary these scales in order to get a more accurate response from the patient. For example if a patient had an interest in architecture, one could ask them to use a scale from porta-potty to The Great Pyramids of Giza, while a chef might use a scale from cheez-wizz to Piedmontese white truffles. Some experimentation may be necessary in order find the optimal scale for each individual.
(*) I also feel that cheese should be ordered by volume, while my local cheesemongers want me to order by weight and do not seem to be aware of the density of individual cheeses. I've found that the best compromise to this problem is to order by specifying the angle to be cut from a wheel of cheese, which leaves the problem of whether to use degrees or radians.
Sunday, October 20, 2013
Tygers - Chapter 2
When Sophie the Tiger was big enough, she loved to go on adventures with her big sister Rosie. Rosie loved to teach Sophie all the things she’d learnt, like how to prowl, how to growl as ferociously as possible, how to catch fish and which ones are the tastiest, and the best places to lie in the sun on a warm day. Sophie loved to follow Rosie around and try to do whatever she did. But mostly the two sisters loved to be near each other.
One sunny autumn afternoon, after they had spent the morning practicing their ferocious growls on a small family of beetles (or perhaps it was a family of small beetles, I don’t quite recall), and the beetles had gotten so upset that they had scurried into a crack in the ground and refused to emerge until the following spring, Rosie and Sophie were lying on a grassy bank watching the stream flow lazily by, and wondering what to do next.
Rosie lay on her back in the warm grass, feeling the sun on her tummy fur. A mother duck was swimming downstream, leading her family of five fluffy ducklings. She gave a cautions “quack” when she saw Rose and Sophie, and lead her ducklings towards the middle of the river. The last and littlest duckling swam curiously towards the bank. Sophie turned and sniffed at the duckling who paddled away furiously to catch up with his mother and siblings.
“I know,” said Rosie, “Let’s go and look for dinosaur bones.”
Sophie jumped to her paws. “Are there any dinosaurs?” she asked, her ears quivering with excitement. “I’ve never seen one.”
“No,” said Rosie, “the dinosaurs are all gone. But some of their bones have turned into fossils. I learnt about them at pre-school when we went to the Hall of Science.”
“What’s a fussel?” asked Sophie.
“They’re things you dig up,” said Rosie, not being quite sure herself.
“You mean like a carrot?” asked Sophie. “I dug up a carrot once. But I gave it to a bunny rabbit.”
“I think so,” said Rosie. “Only I think you have to dig deeper. More like a potato.”
“Oh,” said Sophie, and thought a little. “They have potatoes at that people-village up in the hills,” she said. “Maybe they grow fussels there too?”
“Yes,” said Rosie. “They’re sure to”, she said. “Come on. Let’s go.”
And so the two tigers headed off together.
Rosie and Sophie walked side by side along the path that ran by the side of the river. After a while the path became narrower and Sophie and Rosie had to walk one in front of the other. They came to a place where a narrow path lead off to the right. There was a post in the ground, and a board nailed to it upon which was written “Little Pig”. Underneath was a smaller board saying “No soliciting”, and underneath that was a piece of note paper, upon which was written, “No Big Bad Wolves”. Rosie turned to Sophie and asked “Shall we see what’s down here?”. Sophie nodded.
The path ended in front of a small brick house. On the porch, a small, pink pig sat in a rocking chair, chewing a piece of grass. “Hello little Tigers,” said the pig.
“Hello,” said Rosie curiously, “Do you live here by yourself?”
The pig explained that his two brothers used to live next door, but that their houses had been demolished due to not meeting the local building codes, and they had moved to Florida, so he was feeling a little lonely. “Would you like some tea?” he asked.
Rosie and Sophie followed the pig into his house. He made a large pot of tea and put out a plate full of scones with a bowl jam and and another of clotted cream.
“We’re looking for dinosaur bones,” said Sophie after she’d finished her fourth scone. “Would you like to come?” she asked, and licked a blob of clotted cream of her nose.
“Oh yes!” said the piggy. “I have a a very good nose for finding things that are buried.”
The two tigers and the pig set off through the forest. The pig put his snout to the ground and sniffed and the tigers followed. They threaded their way between the trees and up a muddy river bank. Suddenly Rosie stopped. “Look!” she called. Sophie came to stand beside her and the pig scurried back to see what she had found.
Rosie pointed with her nose at the mud in front of her. “Tracks,” she said. The other animals peered at the paw prints in the mud.
“What are they?” asked Sophie. “They look like tiger paws, but they’re too small.”
“But they’re much too big for a kitty-cat,” said the piggy.
“Maybe a leopard,” suggested Rosie thoughtfully. “Let’s follow them and see where they lead.”
The two tigers and the pig set off, this time with Rosie in the front. The tracks continued through the trees for a little while longer and then climbed a hill. At the top was a mound of loose earth. The pig sniffed. “There’s something buried underneath,” he said. Sophie and Rose started to dig with their big front paws.
After about ten minutes, Sophie’s claw hit something hard. There was a small metalic “clink” sound. They carefully dug a little further and brushed the dirt away to reveal a large wooden box, fastened with iron straps and hinges. It was too heavy for either tiger to lift by herself, so Rose took one side and Sophie took the other, and together they lifted the chest out of the pit.
Fortunately there was no lock on the box. But the hinges had rusted and creaked loudly as the three animals pushed and pulled at the lid to open it. At last, with one last creak, the like swung open, and inside Rosie and Sophie saw the largest bone they had ever seen. It was a soft mottled white colour, smooth, and several inches longer than Rosie’s tail. Around one end was tied a paper tag on which the words “This dinosaur bone belongs to Baby” were written in large letters, and on the other side of the tag was written just “Baby” in big letters.
“Wow!” said Sophie, licking the tip of her nose.
“We’d better put it back,” said Rosie. “It belongs to someone else.” They put the bone back in the box, lowered it into the pit, and filled it up with earth until it was just as they had found it.
When they were done, Rosie and Sophie noticed that the pig was busy sniffing around the base of a tree and burrowing with his snout. After a minute he came up holding something black and wrinkly between his teeth. “Look!” he cried triumphantly.
“What is it?” asked Rose and Sophie together, coming a bit closer.
“It’s a truffle,” said the pig. “They’re delicious, and only we pigs can find them. C’mon!” And he trotted back to his home, holding the truffle proudly between his teeth, while Rose and Sophie followed curiously behind.
By the time Rose and Sophie reached the pig’s little brick house, he had already put on his apron and put a large pot of water on the stove to boil. The pig made three plates of fresh pasta and put shaved truffles and parmesan cheese on top. The two tigers were so hungry after all the digging they’ed done, that they both licked their plates clean. They both said “Yum!” and thanked the piggy lovingly for his hospitality, and then went on their way, purring softly to themselves.
Thursday, October 3, 2013
Making Visual Studio Solutions, CMake and Cygwin Play Nicely Together
I'm currently involved in development and maintenance of a set of command-line tools for analyzing Affymetrix micro-array data. The tools are developed in C++ and intended to be platform independent (compiled and tested on a couple of different Linux flavors, Windows using Visual C++, and OS X). We're working on version 2.0 which is the first major rewrite in several years.
Previous versions relied on separate Visual Studio solution files for Windows, and makefiles for Linux, which needed to be maintained in parallel. This was a pain, particularly in the Windows world: for Unix/Linux, Make hasn't changed much for decades, and if you learnt to use it in the 80's you'll probably still be able to get by. But, for Visual Studio things can change drastically between versions, so that the solution and project files in VS2008 and 2010 are completely different, and required a major transition. So, in version 2.0 we decided to switch to CMake to generate our build scripts across all platforms.
We've also been using Bamboo to run our continuous integration builds and nightly regression tests. For Linux this meant having Bamboo execute a bash script. So as to make things as uniform as possible between platforms, we opted to use a bash script under cygwin to run the builds and tests on Windows.
I found a number of issues and complications in getting cygwin to work with Visual Studio 2010/2012 solutions and CMake - some I found details of on the web, and others required experimentation to fix. Since there wasn't one place I could go to find out all these things, and much of the information I found was outdated, I'm going to gather them all together in one place as a public service. The intended audience is people who are familiar with CMake and bash, but struggling with getting things working in the Windows world.
Setting environment variables for MSBuild/VC++
There are a bunch of environment variables needed for running Visual Studio solutions in the command line, which can be set by one of the bat files vcvars*.bat (see http://generally.wordpress.com/2006/11/28/building-visual-studio-solutions-using-msbuild-in-cygwin/), Since were doing 64 bit only, we want the ones called vcvarsx86_amd64.bat. We need to call the right one for the version of Visual Studio we're using:
# Read vcvars.bat file to set Windows tools settings
CMD=/cygdrive/c/Windows/system32/cmd
# VS2012 version
#
${CMD} /c "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
Or for Visual Studio 2010:
# VS2010 version
#
${CMD} /c "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\x86_amd64\vcvarsx86_amd64.bat"
Running CMake from cygwin
First we need to pick the appropriate executables for CMake and CPack:
CMAKE="/cygdrive/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" CTEST="/cygdrive/c/Program Files (x86)/CMake 2.8/bin/ctest.exe"
We're doing an out-of-source build, so we use two environment variables, SRCROOT for the source directory (in our case an svn checkout), and CMAKEROOT for the build directory. We may have to create the CMAKEROOT directory if it's not there already:
# Create cmake directory if not present
if [[ ! -d "${CMAKEROOT}" ]]
then
mkdir "${CMAKEROOT}"
fi
In order to run CMake we'll need to specify the Generator, and to feed it the source directory in Windows path format. If you do "cmake --help" it will provide a list of available generators. In our case we want "Visual Studio 11 Win64". To get the directory name in the format CMake wants, rather than in cygwin format we use the "cygpath -w" utility.
This next bit is important:
We now come to a particularly annoying and hard to diagnose bug (see http://www.cmake.org/Bug/print_bug_page.php?bug_id=13131): cygwin by default declares certain environment variables like TEMP and TMP. CMake will use certain environment variables, including tmp and temp, In cygwin this is fine and good, but Windows applications, and particularly MSBuild, do not distinguish between environment variables based on case. So when you run MSBuild after CMake in the cygwin environment, MSBuild will die because it sees that there are multiply defined environment variables.
The worst thing about this is that, once you've encountered the problem, simply undef-ing the relevant variables won't fix it. MSBuild starts some processes the first time it's run and those will continue to break. At this point you have to go into the Task Manager and kill any MSBuild processes before you can contiue. The work around is to undef all the variables before the first call of CMake.
This is the code from our scripts which runs CMake:
# Set the generator - VS2012 version
#
CMAKE_GENERATOR='Visual Studio 11 Win64'
# Have to unset some environment variables because of a weird bug with cmake under cygwin
# - see http://www.cmake.org/Bug/print_bug_page.php?bug_id=13131
unset tmp TMP temp TEMP
# Now call CMake
cd "${CMAKEROOT}"
"$CMAKE" -G "$CMAKE_GENERATOR" "$(cygpath -w ${SRCROOT})"
cmake_rv=$?
if [ "${cmake_rv}" != 0 ]
then
echo "CMake encountered errors"
exit 1
fi
Using MSBuild to build a Visual Studio solution file
CMake should create a .sln file and a bunch of vcxproj files (one for each target). First we need to pick the right MSBuild executable, and also decide on the configuration and platform for our build:
# This maybe system dependent MSBUILD=/cygdrive/c/Windows/Microsoft.NET/Framework64/v4.0.30319/MSBuild.exe # We're going to do a 64 bit release build BUILD_CONFIG=Release PLATFORM=x64
Checking for errors in MSBuild
With Make in the Linux/Unix world, we can check the output value ("$?") to see if the build was successful. With MSBuild this doesn't necessarily work. Consequently, to check for a successful build we need to generate a log file, and scan the log file for an errors message - the log file should contain the line '0 Error(s)' if it was successful. (In the following the environment variable SLN_FILE is set to the name of the solution file).
MSBUILD_LOG=msbuild.log
"${MSBUILD}" ${SLN_FILE} /fl /property:Configuration=${BUILD_CONFIG};Platform=${PLATFORM}
msbuild_rv=$?
if [ ${msbuild_rv} != 0 ]
then
echo "MSBuild ${SLN_FILE} exited with status '${msbuild_rv}'"
exit 1
fi
grep -q '0 Error(s)' ${MSBUILD_LOG}
if [ $? != 0 ]
then
echo "MSBuild ${SLN_FILE} detected errors"
exit 1
fi
(The /fl option causes MSBuild to write a log file).
Using MSBuild to build a Project file
Our CMake scripts are configured to create a number of additional custom targets which are not part of the default build target (do not have ALL set), such as a target regression which will update the regression test data and run the regression tests. In Linux these translate to Makefile targets which are not called as part of the default target. In Visual Studio, these give rise to .vcxproj files which are not built by default when one builds the main project .sln file.
To build these we can call MSBuild directly on a project file:
REGRESSION_PROJ_FILE=regression.vcxproj
#
# Build regression project
"${MSBUILD}" ${REGRESSION_PROJ_FILE} /fl /property:Configuration=${BUILD_CONFIG};Platform=${PLATFORM}
And that's all. Hope this is useful to someone out there.
Thursday, August 8, 2013
The Tyger - Epilogue
Wednesday, August 7, 2013
The Tyger
A bed-time story for Rosie
After a while Rosie came to a field full of tall wheat. She looked down and saw a field mouse scurrying around and looking for seeds. The field mouse looked up and lifted his cap. “Good day to you Miss Tiger”, he said. (Field mice are not at all afraid of tigers - I don’t know why.)
“Don’t know about any pizzas about here, Miss,” said the field-mouse. “But this ‘ere is wheat, see!” he added. “You makes flour out of it, then you makes dough, and that you makes that into pizza. An’ bread ‘n all, so they say.”
“Thank you,” said Rosie. She gathered up as many stalks of wheat as she could carry and went on with her search.
After a while she came to another field where tall tomato plants grew, lined up neatly and climbing up on stakes. Resting on one of the leaves of the nearest tomato plant was a red ladybug with black spots. “Hello Miss Ladybug,” said Rosie.
“I’m looking for a pizza,” said Rosie, “have you seen any?”
“Nope,” said the ladybug, “no pizzas round here.” She thought for a moment. “But these red things,” she said, “they’re tomatoes. They’re very tasty on pizzas, I believe.”
“Thank you,” said Rosie. She picked as many tomatoes as she could carry, and continued on her way.
After walking for what seemed like an awfully long time, Rosie came to a big green field full of grass. In the middle of the field was a large brown cow.
“Mmmmmm, Hellooo Deary,” said the cow, munching lazily. (Cows are sometimes afraid of tigers, but Rosie was only a Small Tiger, and this really was a Very Large Cow, so she didn’t seem much concerned.)
“Mmmmmmmmm, Nooooooo,” said the cow considering. Rosie looked very sad. “But I’ve just been making some cheese,” said the cow kindly. “Would you like some?”.
“Thank you,” said Rosie, and took two large balls of soft white cheese.
Rosie was starting to wonder whether she’d ever find a real live pizza, when she smelt something, It smelt warm and inviting, like a cozy fireplace on a Winter’s night. She followed the smell into a forest and through some trees, and came out suddenly in a small clearing. In the middle of the clearing was a small wood-burning oven made of bricks, and sitting in front of it were three bears.
“I’m hungry Mommy,” said the smallest bear. “That nasty little girl with the yellow hair ate all my porridge.”
“I know dear,” said the middle sized bear sadly. “And then she ran away before we had a chance to eat her up. Very rude I thought.”
“Humph!” said the biggest bear. “If only I had some flour, at least we could make pizza.”
“Excuse me,” said Rosie shyly, “but I have some wheat here. Would you like it?”.
“Thank you Little Tiger!” said the big bear. He took the wheat and ground it into flour. Then he added some water and salt to make dough. He rolled it out into two large round disks.
“It’s a pity we don’t have any tomatoes,” said the middle sized bear. “It’s so much better with them.”
“I have some tomatoes,” said Rosie. “Would you like them?”
“Landsakes! Thank you Little Tiger!”, said the middle size bear. She sliced the tomatoes and spread them over the two disks of dough.
“But I like cheese on my pizza,” said the littlest bear sadly.
“Oh, I have some cheese,” said Rosie. “Would you like it?”
“Oh, Goody!” said the little bear excitedly, “Thank you Little Tiger!”. He took the cheese balls from Rosie and gave them to his mother who sliced them and put them on top of the tomatoes.
“Really,” said Rosie, licking her nose, “it’s a pity we don’t have any anchovies”.
“Oh, we have lots of those!” said the biggest bear, taking a small rectangular tin off a large pile. “They were on special offer at CostCo last week.”
The middle sized bear opened the can and put the anchovies on top of the cheese. Then the biggest bear put the two disks of dough into the wood-burning oven. After a little while they started to smell very good indeed.
Just when Rosie was feeling like she couldn’t wait any longer, the big bear took the two disks out of the oven. Magically they had transformed into the two most delicious looking pizzas that Rosie had ever seen.
“Would you like one?” asked the big bear.
“Oh, yes please!” said Rosie. “Thank you very much!”.
“Not at all,” replied the big bear. “Thank you!”. He placed one of the pizzas in a square cardboard box and handed it to Rosie.
Rosie proudly carried the pizza home for her family to eat for dinner. But it was a long way back and she was getting to be very hungry, so she did stop and eat two slices on the way.















