The Escape, or “I Still Miss Canada!”
When we lived in Canada, we spent a lot of time biking. Road biking, mountain biking, a bit of touring, we were always on our bikes (when we weren’t in kayaks...).
A recent video on PinkBike brought it all back to us. We sat there (me with a little tear in my eye, I have to say) watching a couple of guys MTB touring around British Columbia, ending up on Vancouver Island, where they visited a bunch of places we used to go to all the time (the Riding Fool in Cumberland!), took ferries all over the place (it’s the BC way) and rode in the rain, in the sun and everything in between.
It looked amazing, and brought back so many memories. I do still miss Canada.
Nothing new under the sun
I remember being pretty blown away by the constraint-based drawing tools in AutoCAD the first time I used them, and I’ve been try for a long time to make some space to work on this sort of thing for myself (I got started a while ago, but stalled through lack of time).
Of course, there really is nothing new under the sun. Constraint-based drawing started in the 1960s, using hardware built in the 1950s (built using individual transistors: no integrated circuits back then!). Ivan Sutherland‘s Sketchpad was where it all started. I was reminded of this by a short article about Sutherland I only got around to reading this morning. The article is only so-so, but there are links to some videos taken from a TV programme made in the 1960s about the MIT Lincoln lab where Sutherland worked. They knew how to make science TV in those days. The steady hum of the air conditioning in the machine room, the formal “Well, here’s how it works, John” presentation, the suits and ties. Ah, I can almost smell the Bakelite and ozone. It’s great. Go and watch them and wallow in the techno-nostalgia.
So, this TV programme was recorded in 1963. And they had: GUI display with light pen interaction; 2-D constraint-based drawing; zooming user interfaces; 3-D graphics with hidden line removal; 3-D constraint-based drawing; object linking and embedding. 1963! How the hell did they do all that? Most of those ideas didn’t make it into commercial software until the 1990s, and a lot of people still don’t really know about the constraint-based stuff.
There’s a great quote on the Wikipedia page about Sutherland:
When asked, “How could you possibly have done the first interactive graphics program, the first non-procedural programming language, the first object oriented software system, all in one year?” Ivan replied: “Well, I didn’t know it was hard.”
That’s the attitude you need: forge ahead in ignorance of what received wisdom says is possible. That’s a credo I could like by. If it doesn’t contradict the laws of physics, it’s not impossible, so get on and try it!
Radian—Now Open Source
My Radian HTML plotting library is now open source! You can read about it on the BayesHive website here.
BayesHive Beta
For the past few months, I’ve been spending most of my working hours on BayesHive, the brainchild of Tom Nielsen, CEO of OpenBrain. This is a web platform for doing Bayesian data analysis, intended to make these powerful methods more accessible for scientists and other data analysts.
We opened the system to some alpha users a while ago, but this week we’ve decided we’re ready for wider beta testing, for people to have a look, kick the tyres and tell us what they think.
I’ve mostly been working on the web app part of the system, but in this post I want to talk a little bit about the general idea behind the system and the Bayesian approach to statistics. (As far as BayesHive goes, the system is made up of a reasonably complicated single page web app using the AngularJS framework, a Yesod server process to deal with the management of documents, data and models, and a model compiler and inference engine that does all the clever stuff.)
In Soviet Russia, Boilerplate Scrap You
I’ve been working on BayesHive with Tom Nielsen for something like six months now, and it’s been a lot of fun. We’ve been ironing bugs out of the back-end of the system, which implements a probabilistic functional language (called Baysig). We found an entertaining thing the other day–I raised the bug report, Tom found out what was going on, and I laughed quite a lot when he told me.
We use the Scrap Your Boilerplate generics framework for doing various transformations of the AST of the Baysig language. It’s a great way to define transformations of complex hierarchical data structures in a nice compact way. It does have a trap for the unwary though...
Austerity Kills
Well, who’d have thought it? Cut back on public services, work as hard as you can to entrench the inequalities in society that lead to unemployment, homelessness and mental illness, and what do you get? Increased suicide rates, widespread depression and suffering. But no matter. We have to hold the course. Austerity is the watchword. Belt tightening all round. Jonquil might even not get a new pony this year! What are a few community centres closing, a few old people being ever more isolated, prisoners in their own homes, compared to that?
Seriously, it’s pretty damn obvious that a policy of rigid austerity (for the little people) is not an appropriate response to a recession and widespread unemployment. But, if you’re too stupid to attend to lessons like that of the US post-World War II public works programme, there is now some more recent and pretty unequivocal evidence.
Remember Iceland? A few years ago, they were faced with financial disaster, and all the predictions were dire. In the face of widespread condemnation from other European governments and the banking sector, the Icelandic public essentially voted to tell the banks holding their national debt to piss off. And now? They’re doing fine, thank you very much. Unemployment down, economy booming.
That’s just one example of many. Across the board, austerity measures are correlated with negative outcomes, both economically and socially. Investment in public health and social welfare provide a better return, euro for euro, than investment in any other sector, including tax cuts for industry and defence, the two holy cows of the right.
Go and read the article. It’s pretty depressing.
This Is A Good Place...
In Kim Stanley Robinson’s Antarctica, there is a character, Ta Shu, who is a famous Chinese feng shui expert. Ta Shu is travelling around Antarctica with an adventure tour group, relaying his experiences back to an audience at home. His descriptions of the landscape are detailed and insightful and extremely poetic. In Chinese, at least. His English is more limited, which leads to some of the other characters in the book underestimating his intelligence, particular as he responds to most of their queries about what he thinks of places with the phrase “This is a good place” as a substitute for the detailed explanation he would give in Chinese.
Anyway, yesterday we went to a place that Ta Shu would have described as a “good place”. We were spending the day with Rita’s parents, her brother and his girlfriend, and her parents. They were all visiting our part of the country for a “parents meet the parents” holiday. We first drove from Igls to Achensee, a long lake in the mountains about 50 km east of Innsbruck. While the others went on a boat trip, Rita’s parents, Rita, me and Winnie went up on a cable car to do a bit of walking. The weather wasn’t great and there was still a lot of snow around, so we didn’t get all that far (although Winnie did a bit of marmoset-chasing, which was more fun for her than for me, as I had to then chase her...). After coffee and schnapps in the hut at the top of the cable car, we headed back down to meet the others.
Cabal Version Bounds
TL; DR: use package version number bounds in the build-depends
clauses of your Cabal files. You may save yourself some time and frustration.
Most Haskell programmers seem to have Cabal war stories to tell. Library version management in Haskell is complicated by the aggressive inter-module optimisation that GHC tries to do, which makes Cabal’s life tough and sometimes necessitates blowing away both Cabal and GHC’s knowledge of installed packages to start over. It’s also frustratingly easy to inadvertently get into a state where you have versions of packages installed that prevent Cabal from finding a consistent set of packages to install to satisfy the constraints for a new package you’re trying to install.
I thought I’d cleverly avoided most of these problems by using the hsenv sandboxing tool, which allows you to isolate the set of packages needed for a particular project, and even to maintain projects that use different versions of GHC, and cabal-meta, which allows you to build multiple packages from source together so that Cabal can find a set of package versions that are acceptable for all of the packages at once. I often found myself succumbing to a smug sense of self-satisfaction as I read about other peoples’ Cabal problems on haskell-cafe.
Of course, pride goeth before a fall. My hubristic little bubble was burst the other day when I decided to reset my sandbox for a project I’m currently working on. For some reason, typing cabal-meta install
just wasn’t working, and I was being told that there was no set of package versions that could consistently satisfy the requirements of the packages I was trying to build from source.
Zonkatonium
In the last three days, I’ve averaged 10 hours of billable time per day. That’s ten hours per day actually standing at my desk coding, perhaps 10-20% more than that “on the job”. I’ve been working on social and search aspects of the BayesHive web app: we have a pile of different kinds of items (data sets, documents, models, and some others) that are all searchable and shareable in slightly different ways, and this all needs to be managed in a sensible way.
After a frenzy of hacking, I merged the branch I’d been working on just before dinnertime. It all works pretty well, I think, although there are probably some holes. It’s pretty inefficient, but we’re planning to move to a different storage system for documents and data soon, and that will make full-text indexing much easier, streamlining all of this stuff, so I was happy to produce a clean design and not worry too much about optimisation for now.
I’ve been really enjoying this work. I think what we have now may be one of the more complex Haskell web apps out there, and we’re gradually converging on a design that looks really pretty nice. The combination of Haskell, Yesod and AngularJS is very effective, and there’s enough Haskell work to balance out the horror that is JavaScript.
Tom should be inviting some people to start playing with BayesHive some time in the next week or so. It will be good to get some other eyes on what we’re doing. I’m going to spend some of tomorrow trying to do some example analyses, but I’m too familiar with the foibles of the web app to be a really good tester.
The only question now is whether, after three glasses of wine, I’ll still wake up at dawn (about 5:30 here right now) tomorrow morning, as I’ve done for the last few days...
Little Predators
I’m a good dog, I am!
Our dog Winnie is a great little dog. Of course, we would say that, but it really is true. The more I read about dog development and behaviour, the more pleased I feel about how far she’s come since we adopted her.
Sweet as she is though, there’s one thing she does that drives both me and Rita spare, something that can make a nice outing into a big pile of stress. Winnie is a hunting dog, and oh, does she love to hunt. She never catches anything, but she loves to chase things. Birds and squirrels mostly, but deer, hares, cats, anything that runs away. (She will stand and watch deer that aren’t moving or that haven’t seen her, but if they run, she’s off.) She has in the past thought about chasing Gämse in the high mountains, but I managed to put her off that–she had no chance of getting anywhere near them and she would probably have killed herself falling off a cliff trying to keep up with them...
Books for Yoga Anatomy
Copyright 2010 Raymond Long
When I started doing yoga, it looked simple. Twist yourself into a little pretzel, sit there for a little while, then choose a different pretzel shape and repeat. It turns out that things aren’t quite so simple. You have to engage muscles to remain in these twisty positions and even to pull yourself further into the postures.
Knowing which muscles to engage and where to focus your attention in each posture is something that a good teacher would help with, of course, but I’m a bit teacherless. There is some advice available online, much of it expressed in terms of analogies (“embrace your thigh”, and so on). That’s OK, but it’s not a substitute for a precise anatomical description of what’s going on.
AngularJS + D3.js = Radian
UPDATE: Radian is now open source. Read about it on the BayesHive website here.
Courtesy of Hideharu Sakai, this article is also available in Japanese.
One of the things we needed to be able to do for the BayesHive software I’m working on with Tom Nielsen of OpenBrain is easily produce plots within our front-end web app. There are lots of JavaScript libraries for doing this: Tom started off using Flot, which is very quick and easy to use, but wasn’t really flexible enough for what we wanted.
I’d just been working on another part of the software, a tool for constructing algebraic representations of dynamical systems (defined by systems of ordinary or stochastic differential equations), and I’d been using the AngularJS framework. It took a while to get used to, but it seemed as though it might, in conjunction with D3.js, provide a way to produce a declarative plotting API that would be really easy to use and could take advantage of the clever data binding features of Angular.
Thus was Radian born: a declarative extension to HTML for rendering data and functional plots as SVG graphics. You can go straight to a gallery of examples here. Details and some more examples below the fold. (Note that, since Radian uses SVG graphics, you’ll need a fairly recent browser to see anything...)
Ashtanga Yoga
When we lived in Canada, we exercised a lot: mountain and road biking, running, sea kayaking, CrossFit. That dropped off in France, but I managed to do some gymnastics and basic conditioning, which continued for the first summer here in Austria (lots of gymnastics: I even managed to do a few muscle-ups on my rings!).
Over the winter in Igls, I’ve not been doing a whole lot, partially for lack of time (I keep telling myself that three hours of dog-walking a day has to be worth something), partially for lack of inclination, and partially because the pull-up bar is too cold to hold onto in the mornings when it’s -10°C outside (that sounds like a better excuse than “lack of inclination”!). I’d been thinking for a while that I needed to start doing something again, and Rita had a yoga book lying around, so I thought I’d give that a go, if only for a while.
Upgrading to Hakyll 4
So, I lied a little in my last post. I didn’t quite get to go off right away and update my Beeminder totals, because I had a bit a problem with my blogging software. I use Jasper Van der Jeugt’s Hakyll, a Haskell static site generator. Jasper recently (well, not that recently...) released a new major version of Hakyll, Hakyll 4. I had been putting off upgrading because I have so much custom code that it’s kind of a big job–my blog is a little different to most Hakyll sites, so I had to write quite a bit of extra stuff to work around that.
The War on Akrasia
I learnt a new word yesterday: akrasia (rhymes with “aphasia” and “Malaysia”). It means not doing the things you want to do and know that you want to do; acting against your better judgement. The classic example of akratic behaviour is weight loss (or weight control). That extra slice of pie always looks like such a good idea at the time and there’s no short-term consequence. It’s only later that you look back with a queasy feeling of regret at the empty pie dish and think of how your rolls of kidney flab are just not fashionable any more (and probably haven’t been since the 1830s).
Everyone is akratic to some extent. I know that I am. Some days I just can’t face the work I have to do (even though it’s usually fun once I get started) and just doodle around on the internet. I’ve tried various methods for organising myself (I use org-mode in Emacs for pretty much everything: TODO lists, scheduling, time tracking for invoicing), I’ve tried structured procrastination. Sometimes these things work and sometimes they don’t. The main problem is that, while these methods can help you to organise yourself, they don’t impose any short-term consequences on you to make you do things.