Oct 302014
 

I’ve been trying out Google App Engine, for which I signed up with the Google account where I just enabled 2FA. Of course, that means changing the way I update the uploaded trial application; the standard Google password has to give way to either a specific application-based password, or OAuth 2. OAuth 2 is obviously (to me) the better way to go.

The documentation is reasonably straight-forward. It even works as documented, assuming you’re signed in with the right Google account on your default browser. My workflow is a little different – my main browser (Firefox) is signed into my main Google account, and I sign into my other Google account (which I’m using for this development project) on Chrome. Copying the URL from Firefox to Chrome to allow the appcfg application access to that Google account worked; it’s refreshing to see. I get tired of web applications that use some hidden JavaScript magic and give you nonsensical results if you copy a URL from one browser to another.

There’s something appealing about OAuth 2, even if it appears a little too magical at times (a bit like git; when it works it’s magical, when it doesn’t, good luck!)

Sep 042014
 

August ended up busy, busier than I intended. Balisage was as usual full of interesting discussions although some of the people I’d hoped to see weren’t able to make it this year. I took part in a panel on MathML, figured out (finally) there is an overlap between the overlapping markup discussions and the DOM Level 2 Range specification, and generally enjoyed myself.

Not long after that I left Design Science; I was disappointed it didn’t work out the way I’d hoped, but I did learn a lot about MathML and typesetting mathematics that I didn’t know before.

I’ve spent the last couple of weeks talking to people about different projects in healthcare and publishing, whether it’s something for me to work at or not. It’s good to be able to take time occasionally to see what’s out there, what people are working on. I’ve also been getting ready for the XML Summer School (there are still a couple of spots left in some of the courses if you’re interested in attending). And I’ve been working on learning plans for my children since their teachers are on strike. Khan Academy, Codecademy, and various workbooks to refresh last year’s skills to start with. I hope the strike is resolved before I have to do too much more planning.

At least we managed to spend a few weekends at the cabin for relaxation amongst all of that.

Jun 242014
 

I've been working at Design Science for a couple of months now, as Senior Product Manager concentrating on the MathFlow products. So I figured I should enable MathML support on my blog. It's not hard, but like everything in tech there are a few niggly details. Many of those issues are caused by WordPress's over-eager helpfulness, which has to be reined in on a regular basis if you're doing anything at all out of the ordinary. Like editing your posts directly in HTML rather than using some pseudo-WYSIWYG editor.

Theoretically, showing MathML in a browser is easy, at least for the sort of equations that most people put in blog posts, even though not all browsers support MathML directly. You just use the MathJax JavaScript library. On WordPress there is even a plugin that adds the right script element, the MathJax-Latex plugin. You can make every page load MathJax, or use the [mathjax] shortcode to tell it when to load.

The wrinkle comes with WordPress' tendency to "correct" the markup. When you add the MathML, WordPress sprinkles it with <br/> tags. MathJax chokes on those and shows nothing. Since the tags don't show up in the editor view, you need some way of stopping WordPress from adding them. The best way I've found is with the Raw HTML plugin.

But there's a wrinkle with that too. For some reason if you use the shortcode version of the begin and end markers ([raw]) the editor decides that the XML characters between those markers has to be turned into the character entities, so for example the < characters are turned into &lt;. To stop that, you need to a) check all the checkboxes in the Raw HTML settings on the post, and b) use the comment version (<-- raw --> and <-- /raw -->) to mark the beginning and end of the section instead of the shortcode version.

Once it's done it's easy to add equations to your pages, so it's worth the extra few minutes to set it all up.

A couple of examples taken from the MathJax samples page

Curl of a Vector Field
×F=(FzyFyz)i+(FxzFzx)j+(FyxFxy)k
Standard Deviation
σ=1Ni=1N(xiμ)2

and one from my thesis from way back when

fλ=n!i<k(li-lk)l1!l2!lr!
Dec 112013
 

My Mum used to make ginger beer on the farm. We would seal it in the glass bottles with bottle caps that you tapped on with a hammer, trying hard not to break the glass. A bottle or two would occasionally explode during the fermentation process, which was exciting, and messy.

I’ve taken to making it. Home-made ginger beer is a refreshing, fizzy drink, much less sweet than commercial soft drinks, with a pleasing zing. There is a small amount of alcohol in it due to the yeast-making-bubbles fermentation step, but it’s minimal. The process of making it is fun, teaches the kids something about chemistry, and is much less messy with the advent of PET bottles.

The process is reasonably simple. You start with a ginger beer plant (actually a fungus yeast and a bacterium; more details here). You feed it ginger and sugar every day until it’s ready, then add the liquid to a mixture of water, sugar, and lemon juice. Bottle, store for a few days, and enjoy!

There are a number of places on the internet you can get a ginger beer plant. I made my own; as a consequence it may not be a ‘real’ ginger beer plant, but given the ginger beer it produces is good, I’m not bothered by that fact. There are lots of variations; this is the recipe I follow.

To make the plant, put the following ingredients in a jug or jar.

  • 8 organic sultanas (golden raisins). You need organic (or other unprocessed, if you’re lucky enough to be able to get them) to get access to the natural yeasts that live on the sultana skins. Modern processed sultanas are too clean and don’t have those yeasts on them, so the ginger beer won’t ferment properly.
  • ¼ cup lemon juice. Use real lemons to get the juice, not something that comes in a bottle. Organic is nice, but not necessary.
  • 1 teaspoon grated lemon zest. Make sure you wash the lemon first to get rid of any coating that might interfere with the yeast.
  • 1 tablespoon sugar. I use white sugar, but you can use any type.

  • 2 teaspoons ground ginger. You can also grate fresh ginger if you like, but I find that’s too much work.
  • 2 cups water. I usually use ordinary water, since our tap water isn’t too heavily chlorinated. If you wouldn’t drink your tap water, use bottled or filtered (but not distilled).

Stir, and cover the jar loosely with a cloth. You want air to get in (for the natural yeasts) but not bugs (in summer this is a magnet in my kitchen for fruit flies). Keep at normal room temperature. Feed every day with 2 teaspoons ground ginger and 2 – 4 teaspoons of sugar (I use 4, you may like it slightly sweeter or less sweet). After a couple of days, you should notice some bubbles in the mix, and even a slight smell of fermentation as the natural yeasts go to work on the sugar and ginger. The plant will be more active in summer, when the kitchen is warmer.

After a week or three (the period depending on how much time I have in any given week), make the ginger beer. You will need around 12 one-litre PET bottles. If you don’t have those at home, a local beer-brewing shop will be happy to sell some to you, complete with the caps. Wash in soapy water, and rinse to get the bubbles out. You don’t need to sterilise the bottles, I find the usual detergents to be adequate.

In a large pot, boil 5 cups of water with 3 cups of sugar. Stir to make sure the sugar is all dissolved, then take the pot off the heat. Add the juice of three fresh lemons (yes, the prohibition against bottled lemon juice applies here too). If you have small lemons, make that the juice of four lemons. Place a clean cloth (an old linen tea towel, for example) over a sieve or colander and pour the ginger beer plant through the cloth into the pot. Squeeze the cloth to get as much liquid out of the plant and into the pot as possible. Add 7 litres of water to the pot (same comments on the water as above; I use tap water). Bottle the ginger beer, leaving some space at the top of the bottle for expansion.

The contents of the cloth are the ginger beer plant itself. Take approximately half of it, put in a clean jar with two cups of water, and feed. I also put another couple of sultanas in at this stage. This is the basis for the next batch of ginger beer, so feed every day as before. Give the other half of the plant to someone, or add to your compost bin. The plant gets better as it ages, so it’s worthwhile keeping it going rather than starting new each time.

After a couple of days, you should see some small bubbles in the bottles, and the bottles should be firmer. This stage may take a couple of days longer in winter than summer. You can drink the ginger beer at this stage, but it tastes better if you can leave it at least a week.

Apr 292013
 

One of the things people always ask you as a teenager, or in job interviews, or when you’re contemplating doing something new, is: what do you want to do? And the questioner is often disappointed when you don’t have a barn-burning deeply-held specific desire just waiting there. Answers that are more generic (albeit equally important), such as ‘something interesting’, or ‘something useful’ are somehow unsatisfactory, even when coupled with a general idea of the area in which you want to do something useful and interesting.

This morning I read From “sit still” to “scratch your own itch” and it’s full of descriptions of expectations for programmers that resonate with me, such as the expectation that “a REAL programmer or a REAL open source contributor is supposed to be a self-starter who comes up with their own project ideas from the start”. The article has some techniques to stop these expectations from being overpowering or intimidating. The author suggests, for example, that writing Yet Another {Something Simple} is fine, just like sewing an item from a pattern (or in my case, knitting it). You learn from that, and expand your knowledge.

In my case, moving from project management back into more technical work, what helped was working through online tutorials until I was far enough along to be able to start writing my own useful stand-alone projects. Sometimes I’ve surprised myself by how much technical knowledge from 10 or more years ago comes back, like waking the technical brain up again that was dormant for a while. I guess, for me, that was the itch that needed to be scratched.

Mar 012013
 

Shoulder mechanics seem to be one of those topics that people don’t talk about much, but any time I mention the issues I have with my shoulders (too much time at the computer each day) I’m by no means the only one affected. I’ve been doing Pilates for years, which has helped, but that’s only a couple of hours a week, which leaves lots of time during the rest of the week to undo the good work.

I spent a bit of time sitting at my desk, figuring out in which position my shoulders and wrists would be happiest. I talked to the people at ErgoCanada (they’re very helpful and very knowledgeable and I recommend talking to them if you’re based in Canada) and ended up with a split keyboard that can be placed in a number of configurations, the Kinesis Corporation Freestyle2 (Amazon US link). The first few days using it were a little weird, while I got used to having to use the recommended hand for each letter, and getting used to the placement of the backspace and delete keys. I played around with the configurations, starting with the splayed configuration, but at the moment I use the straight configuration with some 10cm between the two halves. The spacing I use varies a little depending on what I’m doing, if it’s mostly writing or a lot of mouse work. The keyboard is quiet, with a good feel; the keys are light but stable. There’s also a bunch of accessories to tilt the keyboard in various ways, or enable a wider gap between the halves, but I haven’t seen the need for those yet. One day I may get the Mac version to go with my laptop; since it splits into two pieces it does pack a lot smaller for travel than a regular keyboard.

As well as using the keyboard, I’ve tried to get into the habit of doing small simple shoulder rolls on a regular basis, to keep the ball aligned better in the socket. There are lots of web sites that explain versions of how to do these but most seem to be aimed at bodybuilders; this page from the Yoga journal is more gentle than most.

These two things, put together, seem to be helping. Either or both would be worth thinking about if you have shoulder or arm issues and spend hours at a computer each day.