Oct 302014
 

I’ve been try­ing out Google App Engine, for which I signed up with the Google account where I just enabled 2FA. Of course, that means chan­ging the way I update the uploaded tri­al applic­a­tion; the stand­ard Google pass­word has to give way to either a spe­cific application-based pass­word, or OAu­th 2. OAu­th 2 is obvi­ously (to me) the bet­ter way to go.

The doc­u­ment­a­tion is reas­on­ably straight-forward. It even works as doc­u­mented, assum­ing you’re signed in with the right Google account on your default browser. My work­flow is a little dif­fer­ent — my main browser (Fire­fox) is signed into my main Google account, and I sign into my oth­er Google account (which I’m using for this devel­op­ment pro­ject) on Chrome. Copy­ing the URL from Fire­fox to Chrome to allow the appcfg applic­a­tion access to that Google account worked; it’s refresh­ing to see. I get tired of web applic­a­tions that use some hid­den JavaS­cript magic and give you non­sensic­al res­ults if you copy a URL from one browser to another.

There’s some­thing appeal­ing about OAu­th 2, even if it appears a little too magic­al at times (a bit like git; when it works it’s magic­al, when it doesn’t, good luck!)

Sep 042014
 

August ended up busy, busier than I inten­ded. Bal­is­age was as usu­al full of inter­est­ing dis­cus­sions although some of the people I’d hoped to see weren’t able to make it this year. I took part in a pan­el on Math­ML, figured out (finally) there is an over­lap between the over­lap­ping markup dis­cus­sions and the DOM Level 2 Range spe­cific­a­tion, and gen­er­ally enjoyed myself.

Not long after that I left Design Sci­ence; I was dis­ap­poin­ted it didn’t work out the way I’d hoped, but I did learn a lot about Math­ML and type­set­ting math­em­at­ics that I didn’t know before.

I’ve spent the last couple of weeks talk­ing to people about dif­fer­ent pro­jects in health­care and pub­lish­ing, wheth­er it’s some­thing for me to work at or not. It’s good to be able to take time occa­sion­ally to see what’s out there, what people are work­ing on. I’ve also been get­ting ready for the XML Sum­mer School (there are still a couple of spots left in some of the courses if you’re inter­ested in attend­ing). And I’ve been work­ing on learn­ing plans for my chil­dren since their teach­ers are on strike. Khan Academy, Codec­ademy, and vari­ous work­books to refresh last year’s skills to start with. I hope the strike is resolved before I have to do too much more plan­ning.

At least we man­aged to spend a few week­ends at the cab­in for relax­a­tion among­st all of that.

Jun 242014
 

I’ve been work­ing at Design Sci­ence for a couple of months now, as Seni­or Pro­duct Man­ager con­cen­trat­ing on the Math­Flow products. So I figured I should enable Math­ML sup­port on my blog. It’s not hard, but like everything in tech there are a few nig­gly details. Many of those issues are caused by WordPress’s over-eager help­ful­ness, which has to be reined in on a reg­u­lar basis if you’re doing any­thing at all out of the ordin­ary. Like edit­ing your posts dir­ectly in HTML rather than using some pseudo-WYSIWYG edit­or.

The­or­et­ic­ally, show­ing Math­ML in a browser is easy, at least for the sort of equa­tions that most people put in blog posts, even though not all browsers sup­port Math­ML dir­ectly. You just use the Math­Jax JavaS­cript lib­rary. On Word­Press there is even a plu­gin that adds the right script ele­ment, the MathJax-Latex plu­gin. You can make every page load Math­Jax, or use the [math­jax] short­code to tell it when to load.

The wrinkle comes with Word­Press’ tend­ency to “cor­rect” the markup. When you add the Math­ML, Word­Press sprinkles it with <br/> tags. Math­Jax chokes on those and shows noth­ing. Since the tags don’t show up in the edit­or view, you need some way of stop­ping Word­Press from adding them. The best way I’ve found is with the Raw HTML plu­gin.

But there’s a wrinkle with that too. For some reas­on if you use the short­code ver­sion of the begin and end mark­ers ([raw]) the edit­or decides that the XML char­ac­ters between those mark­ers has to be turned into the char­ac­ter entit­ies, so for example the < char­ac­ters are turned into &lt;. To stop that, you need to a) check all the check­boxes in the Raw HTML set­tings on the post, and b) use the com­ment ver­sion (<– raw –> and <– /raw –>) to mark the begin­ning and end of the sec­tion instead of the short­code ver­sion.

Once it’s done it’s easy to add equa­tions to your pages, so it’s worth the extra few minutes to set it all up.

A couple of examples taken from the Math­Jax samples page

Curl of a Vec­tor Field
×F=(FzyFyz)i+(FxzFzx)j+(FyxFxy)k
Stand­ard Devi­ation
σ=1Ni=1N(xiμ)2

and one from my thes­is 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 teen­ager, or in job inter­views, or when you’re con­tem­plat­ing doing some­thing new, is: what do you want to do? And the ques­tion­er is often dis­ap­poin­ted when you don’t have a barn-burning deeply-held spe­cific desire just wait­ing there. Answers that are more gen­er­ic (albeit equally import­ant), such as ‘some­thing inter­est­ing’, or ‘some­thing use­ful’ are some­how unsat­is­fact­ory, even when coupled with a gen­er­al idea of the area in which you want to do some­thing use­ful and inter­est­ing.

This morn­ing I read From “sit still” to “scratch your own itch” and it’s full of descrip­tions of expect­a­tions for pro­gram­mers that res­on­ate with me, such as the expect­a­tion that “a REAL pro­gram­mer or a REAL open source con­trib­ut­or is sup­posed to be a self-starter who comes up with their own pro­ject ideas from the start”. The art­icle has some tech­niques to stop these expect­a­tions from being over­power­ing or intim­id­at­ing. The author sug­gests, for example, that writ­ing Yet Another {Some­thing Sim­ple} is fine, just like sew­ing an item from a pat­tern (or in my case, knit­ting it). You learn from that, and expand your know­ledge.

In my case, mov­ing from pro­ject man­age­ment back into more tech­nic­al work, what helped was work­ing through online tutori­als until I was far enough along to be able to start writ­ing my own use­ful stand-alone pro­jects. Some­times I’ve sur­prised myself by how much tech­nic­al know­ledge from 10 or more years ago comes back, like wak­ing the tech­nic­al 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.