An Amsterdam Sunday

Stendhal syndrome, Stendhal’s syndrome, hyperkulturemia, or Florence syndrome is a psychosomatic disorder that causes rapid heartbeat, dizziness, fainting, confusion and even hallucinations when an individual is exposed to an experience of great personal significance, particularly viewing art.

We did three museums in one day. That’s really pushing it. But we stayed ahead of the above effects. Here’s what we saw:

After this journey into aesthetics, we relocated to a new  had very good pizzas at Mediamatic ETEN. Elderflower lemonade! Someone speaking Danish tended the bar. “Take a look around!” Aquaponics gardening in a greenhouse with colored LEDs. “Oh, all food here’s vegan.”

Next door was the open-to-the-sky bar Hannekes Boom. The sky was golden and the moon was a thin sliver. Patrons were joyous, the barman was cheerful.

Before heading home to the ironing board and the blogging, we couldn’t resist peeping into the KLIMMUUR CENTRAAL-marked warehouse. My friend C had identified the name to be “Climbing Wall Central”. It was a huge building, very, very tall, covered in handholds and climbing lines. In the middle of the room, there was a group of tables where people could enjoy themselves, or eat something. A non-ascetic place! We bought ice-cream and lounged in a huge couch outside in the evening light.

Boats of all types rushed by. Suddenly, it was time to get back. We discovered a shorter path to walk home – a boon.

An Amsterdam Saturday, a sketch

Amsterdam in harsh, punishing sunlight.

A pre-cold is threatening my weekend, reminding me of bodily frailty, as I and my companion trudge through cobbled streets fraught with traffic peril from onrushing bikes, their bike bells a-clanging.

The street scenes in the city center were the ones I’d been told to expect: tourists toting tourist gear, the smell of people smoking not-cigarettes, everywhere, and lots bikes.

We saw: a cat café, which was not a café – more of a feline prison.

At a critical juncture, we taught ourselves to use Amsterdam’s “collective traffic” (public transportation, as a Swedish-speaking person might say it). That was good. Our reach extended, we grasped for better and fancier environs. The plan was to do something more cultural.

Then, a cup of espresso quickly followed by a well-chilled ginger ale, and in we went to the Museum Het Rembrandthuis. We got an etching-and-printing demonstration, as well as a glimpse of an oil-paint-making demonstration.

We then trudged and traveled to get to our hotel. It was good.

Today I also learned about Happy Cow, a search engine for vegetarian eating. Here’s a sample search.

Having used it, we then promptly ditched all those finely annotated search results, threw caution to the wind, and frequented a recommended Indonesian place: Kartika on Overtoom 68. “Sorry, we only have two fixed options: the vegetarian one, and the other one. Serves two, at minimum.” We agreed to the veg option and were inundated with amazing dishes in bowls, on a long metal warmer. Food was enumerated, then enjoyed. Thoroughly.

After this, a stroll in the park, as the last rays painted immaculate contours around everything. A stand-up comedian was entertaining a big audience. People in the park had not yet given up on the park-life and were frolicking on grass, playing instruments and enjoying themselves.



Ruby feature: Regular Expression replace once

About a year ago, programmer Tony Arcieri posed a question on the Ruby language bug tracker:  Why was Thread.exclusive deprecated?

Among the answers to this question, Shyouhei Urabe’s one of the tersest feature descriptions yet: “we already have such thing, to some extent at least”:

  1. The pair of slashes are Regular Expression delimiters.
  2. A Regular Expression in Ruby allows String interpolation, just like the double-quoted String does. The #{} contains interpolated Ruby code.
  3. The modifier o at the end of the Regular Expression stands for “once”. So, the regex engine would keep track of this replacement, and do it just once.

The Malmo.rb named this expression (//o) the face-palm operator.

Malmö Coders’ Book Club

Quick report on Malmö coders’ book club: This was the initial sitting, and we were 7 people around the table. One academic, two leads, and four software engineers. We spoke English, since we were an international crowd.

At least three physical notebooks full of written notes were out, and the conversation was started based on questions people had during their reading. The conversations were personal, kind, and focused. It brings more perspective, to have people of different backgrounds, of different roles.

This was one of the peer groups I’d been looking for. 5 out of 5 thumbs.

PS: We had been reading Michael Feathers’ Working Effectively With Legacy Code. 

JRuby to support \K escape sequence in

Allow me to celebrate the JRuby team (and nearby efforts) in that the next patch release of it will include \K as a regular expression special character.

This GitHub Issue was just closed with a resolution in the Joni library:

Its support is in a little select company, randomly listed at StackOverflow, which has such google-juice that it felt worth it to shout about JRuby on there.

I’ll repeat the example from the GitHub Issue:

$ irb
2.3.1 :001 > 'street'.match( /s\Kt/)
 => #<MatchData "t"> 

Travel report: MirageOS hack retreat in Marrakesh 2017

I am just back from a week off in Marrakesh.

Together with a hearty group of people from many places, I wrote and documented software in the heart of the medina. We also ascended the snow-covered mountain in the picture above.

A group around the ambitious MirageOS project gathered to enjoy community around the programming language OCaml.

The week was spent in an artsy hostel with a roof terrace and a cool riad. The sun baked during the day, the moon chilled the nights.

The week was a so-called hack retreat, with goals of making the MirageOS ecology of software better in some way. Some people brought their own agendas of what to make, and others, like me, found them when in place.

Most of this time was spent squinting at some screen or other: learning, listening, exploring. At work and in my spare time, I program Ruby in a Web setting, whereas here it was a systems programming language, in a system setting. But, I’m a dabbler at heart, and trying to keep a beginner’s mind.

Learning OCaml can be a hard slog, even if you know a few programming languages. Many alien concepts, and at times not much of a railing to hold on to. Many possibilities to describe things better for the new-comer. I was helped along by helpful and knowledgeable people. Sometimes, I could make a mental breakthrough by plowing through domain-specific jargon, translating it to something familiar. But more often it was by being near someone who was at the same place I was, the foreigner, the outsider, and we could quickly learn new things together.

I found a great collaborator in Matt, an English chap who had taken on an issue in the mirage-tcpip library. “There’s no need to use floating-point arithmetic here, we can change that to Int64 calculations on 64-bit integers instead.” I got to join him on this quest. To make the change, we read the section of the RFC over and over, made calculations on paper, authored unit tests (that became integration-like). And we fixed our mistakes in calculations on paper. At the end of the day, we had a Pull Request for the project, and were able to get some feedback. It felt great. And it was great. It even got merged.

Later, I collaborated on some package management issues in a SOCKS4 proxy library, which was improving a lot during the event.

The days were much the same: get up, clean up, have breakfast, continue programming, complain about slow the Internet. Suddenly: lunch, followed by some more programming, and then it was suddenly dinner.

At some points, the inviting organizer of the event made a “call” for talks, like: “Hey Spiros, I heard you would like to give a presentation of your parsing system Angstrom. Say at six o’clock?” Graciously, the speaker would then concede that this was a good time to present their work.

One of the talks was about solo5.  That is a “unikernel monitor”, a very thin thing to wrap the running of a unikernel. As a companion explainer, the presenter took care to link to this 5-page PDF of Williams and Koller’s conference paper from HotCloud16 (“Unikernel Monitors: Extending Minimalism Outside of the Box”). Check it out if minimalist systems is your thing.

We made a few outings, climbing the Atlas mountains and visiting a herbalist. But mostly we kept to the retreat itself.

Here is a short list of software projects I engaged with, however little:

Rating 10/10, A-plus, would learn to program OCaml with these people again.

Here is some Twitter extracts:






Automate finding misspellings in source code

Typos and misspellings in code can be difficult.

Finding them and keeping them out takes vigilance. Lots of mental energy wasted.

The misspellings tool written in Python can be installed using pip install misspellings.

This tool looks for commonly misspelled words in source code. It has a built-in list of common spelling mistakes.

Example: List all Ruby files and pass each of them to the misspellings tool, with the -f option (file list) set to - for standard input.

$ find . -name '*.rb' | misspellings -f -
./lib/celluloid/exceptions.rb:12: occured -> "occurred"
./spec/celluloid/calls_spec.rb:12: wasnt -> "wasn't"
./spec/shared/actor_examples.rb:950: slighly -> "slightly"
./spec/support/configure_rspec.rb:44: occured -> "occurred"

(As a courtesy, I edited those misspellings in the Celluloid project. It wouldn’t do to let it be made an example of and then not fixing it.)

How to use very latest Bundler in Travis

TL;DR: When Bundler has fixes in master that you need, use the specific_install Rubygems plugin to install and use Bundler directly from a git branch. Example Travis YAML configuration excerpt:

  - gem update --system
  - gem install specific_install
  - gem specific_install
Picture: taken at Cambridge U Library. This is a CC0 free stock photo. But those are nice columns surrounding and wrapping the body of the page. Also: note the shadows of the supporting lines still visible in the finished book.

I will spend the rest of this post unpacking what the above means.

In Ruby, there is a package manager called Bundler. It’s continuously developed, and like all software, can have bugs.

When a Bundler bug gets fixed, the code changes are “merged to master branch”. Then we all wait for the next release. The workarounds are about sticking to an older, non-broken version: use the -v option to choose an exact release. Example: gem install bundler -v'1.13.7'

The Rubygems system does not have a way to install gems “from a Git source URI”, but it does have a plugin system. And luckily, one of the plugins available (but not on that page) is specific_install.

allows you to install an “edge” gem straight from its github repository, or install one from an arbitrary url

In order to work around the “we all wait for the next release” step, we can install the latest and greatest using this plugin.

The plugin’s has also aliased its specific_install action to git_install. The manual claims:

This alias is shorter and is more intention-revealing
of the gem's behavior.

Source: The above Travis configuration snippet comes from a PR to the releaf project.

Cinemateket: a personal failure to build habit

The new slimmer Cinemateket. It never really came together, my going there out of habit. Habit-forming failure, if you will.

Now that they’ve scaled it all back to a trickle of must-see films from the nowadays-much-smaller showable-as-analog past, it’s lost much of its previous smorgasbord charm for me. Choosing not to view a certain film isn’t so very charming when it’s the only film.

In unrelated habit-building: My quest to see all of Star Trek: The Next Generation, with the redoubtable Sir Patrick Stewart intoning the Federation‘s credo about not meddling where one should not meddle, continues. if a little abated. I’ve noted a tendency to fall asleep at the tail end of the story, in the late act II. Note to self: perhaps one episode is enough for a night.

Recently, I have met several trekkies, whereas before I seldom met anyone who professed to know the slightest thing about the Star Trek franchise.  Of these enthusiasts, one is a lawyer, one a nurse who speaks Chinese, and one works with computer gaming industry issues. All of them highly knowledgeable on matters Trek.

Onward, into the year. Habits will form. I’m sure of it.


Here, a random Star Trek TNG piece of gossip: That replacement doctor – Dr. Pulaski – won’t come back in later episodes, because of the following, passively-worded reason:

Maurice Hurley, head writer and showrunner, did not like working with McFadden, and McFadden was fired at the end of the season 1. Diana Muldaur joined the production as the Enterprise’s new chief medical officer, Dr. Katherine Pulaski, for season 2.

Series creator Gene Roddenberry admitted that the Dr. Pulaski character did not develop a chemistry with the other characters, so McFadden was approached to return as Dr. Crusher for the third season. At first, she was hesitant, but after a phone call from co-star Patrick Stewart, McFadden was persuaded to return to the role, which she subsequently continued to play through the remainder of the series.

Source: the Gates McFadden wikipedia entry


Export data from MongoDB 3.0 and import it into MongoDB 2.6

I just had the dream meeting with a dockerized app. This is a use-case for containerization.

I had to use MongoDB 3.0 to export some data and place it in a 2.6. Ouch: The 2.6 can’t connect to the 3.0.

A genius sat down at the exact moment of my complaining. “Just use Docker.”

So – to get and run the 3.0 Docker image of MongoDB – started with a bash shell:

docker run -ti --rm -v /Users/olle/slask/portal-test:/backup mongo:3.0 /bin/bash

(Related: this works because of the last line in its ENTRYPOINT script: (see 3.0/

When that pulls down and starts the shell, things are automated, and we land in a shell.

There, we can do the 3.0 invocation of mongodump:

mongodump -h -d portal-test -u portal-user -p secret -o /backup/portal-test

This gave me a dump folder at:


I had been too generous with the wrapping folders. No biggie.

Then, the local 2.6 invocation:

mongorestore -d portal-test /Users/olle/slask/portal-test/portal-test/portal-test