random thoughts to oil the mind

Month: September 2019

Commenting memoQ Light Resources

Editing memoQ’s light resources can be a painful experience, with somewhat clunky interfaces, intimidating lists, small default window sizes, and the inability to add comments to rules written with regular expressions. Anyone who’s tried to pin down an error in a list of dozens of autotranslatable rules will know the maddening experience of trying to wade through to reams of similar-looking rules to find the culprit, especially as any edited rules are automatically re-added to the bottom of the list, so any initial effort at structuring rules according to their purpose gradually falls apart over time.

As Kevin Lossner recently pointed out, one clever strategy is to export copies of the rulesets and, adding comments to these XML files, essentially manage these rules outside of memoQ. This makes the rules themselves easier to navigate, and indeed edit, with changes being implemented with a simple reimport of the file.

However, there can be a couple of disadvantages to this solution, depending your workflow. Firstly, the comments only work in one direction, as they’re lost on import. If you make any alterations to resources from within memoQ, exporting the updated ruleset would mean having to combine the files or otherwise restore all the comments. Secondly, memoQ prevents you from overwriting resources on import, so while you can always add a new version and delete the previous one, it can prove to be a royal pain if you also need to update a large number of templates and/or ongoing projects which are using the resource.

Fortunately there is one more cheeky option available to us to make our rules easier to read, however, and that is to abuse named capturing groups and use them as comments. For example, take a rule from a cascading filter for tagging the asterisks in a Markdown list:

^\s*\*\s+

We can simply give this group a name and make it easy to identify:

(?<unordered_list>^\s*\*\s+)

Once all rules have been commented, we immediately have a much cleaner overview of the ruleset, especially useful when you need to go back in and tweak or add something later.

Example cascading filter for Markdown

Note that one potential side-effect of this strategy is that mixing named and numbered capturing groups may upset the numbering, so particularly for autotranslatable rules it may be easiest simply to use named capturing groups consistently throughout.

[Photo by Daiga Ellaby on Unsplash]

Brexit in Germany

You almost have to feel sorry for Greg Hands, sitting as a guest on Anne Will’s show, trying to defend Tory policy. Invited to a five-to-one Brexit bashing, it’s a debate of the ilk where the quacks aren’t invited in the name of ‘balance’. From the off, and as if to distance himself from the madness he’s supporting, Hands immediately claims to have been anti-Brexit, to have been anti-Boris during the leadership change. But not one to let principles get in the way, he’s supporting both of them because ‘democracy’. What follows is a virtuoso display of logical acrobatics skills as he attempts to defend his position: the shittiness of Britain’s democracy (being old is apparently a compliment?); that the referendum somehow showed clarity of purpose; that Boris threatening to ignore the law to push through a no-deal Brexit is democracy in action; that proroguing parliament is standard procedure and clearly shouldn’t be reconsidered at such a crucial juncture; that an election could show what the people want, but a second referendum would be undemocratic. If he weren’t sitting there looking like a naughty schoolboy called to the headmaster’s office, his mind-bending mental tricks might have earned some applause.

Unfortunately for him, the loudest applause comes when Rolf-Dieter Krause said that the only time Boris Johnson doesn’t lie is when he says his name. You kinda want to give Hands the benefit of the doubt, acknowledge that he’s standing with his back to the wall, maybe find the language barrier in his favour. But then the contents of his words would sound hollow in any tongue. ‘I didn’t vote for Brexit,’ he protests on more than one occasion, trying to distance himself from the shitshow he’s fighting for. Because ‘democracy’. Already proud to show his lack of a spine or conscience, Greg shows he’s also packing a crate of gullibility, when arguing that Johnson is trying to renegotiate, that negotiations are taking place, that there is a solution to the backstop.

He almost looks like he’s break down in tears when discussion turns to the little bone Frau Merkel threw Boris, the notion picked up in British newspapers that the German chancellor was keen on finding a solution within 30 days. The irony of the situation is completely lost on him: the true of the backstop is that it only comes into effect if Britain fucks up in resolving the Irish border, and it is entirely unpalatable to the British parliament because they know they will fuck up.

This is where Hands proudly gets his homework out: a special report he’s been preparing that will finally solve the Gordian knot. I couldn’t help laughing at the top-rate accidental trolling which followed from host Anne Will. Asking the rhetorical question, whether the EU needs to take Britain seriously when they say the ball is in Britain’s court, ‘well here’s Greg Hands, and he not only has a ball, he’s brought a brochure too.’ Sorry Greg, everyone else knows that someone asked you to write that report so they could throw it in the bin. Hope you didn’t put much effort into it.

Whether it’s stupidity, gullibility, or simply brazen loyalty to his football club party, Greg is dancing to the nationalist tune like a good little boy, genuinely espousing the lies and subterfuge of the hardliners or, more likely, swallowing them whole himself. As he seems to keep reminding us, he didn’t want this, he didn’t vote for this, but he’s happy to play his part as a useful idiot. Sitting as a guest on the show, isolated and alone, trying to defend someone else’s corner across an ever widening gulf whilst simultaneously protesting his own innocence, Greg perfectly embodies a microcosm of the shitshow playing out on the European fringe.

[Full programme]

Powered by WordPress & Theme by Anders Norén