Advent of Code, day 11: to be or not to be…

Though I’m not a fanatic participant in Advent of Code I still like to join in on the fun and challenge myself to solve the puzzles posted every day. I’m one of those players that plays whenever there is time, instead of the top players that set their alarm clocks to be at the ready when the assignment gets published.

When I opened up the assignment for this morning I was pleasantly surprised to see yet another one involving our beloved IntCode computer ๐Ÿ˜‰ (As Jochem already predicted in his blog)
Today’s challenge involves moving a paint robot around using an IntCode program. There was just another twist. Now the IntCode’s program needed to output to a grid from which it read via the input operation. Fortunately for day 7 part 2 I already had to create a helper function that used a generator as input instead of a fixed set of values so I could easily reuse that again.

Read more โ†’

How to use Mycroft in a different language

Mycroft is a voice system that can be configured for any language but it requires language files and most importantly a parser for that language. I was listening to some music the other day and this one line in a song really struck me: “Praat Nederlands met me” (“Speak Dutch to me”). I have been working on a Voice Assistant built on Mycroft for quite a while now but it was always in English. So I thought “How hard can it be?”. Well it is not that hard, but I learned a lot along the way. I’ll show you the steps you need to take to achieve this followed by some insights into how language support is evolving within the Mycroft ecosystem.

Read more โ†’

How to use Azure AD Single sign on with Cypress

The challenge

At my current assignment we recently introduced Azure active directory based single sign on(SSO). Since we are building a React app we were able to leverage the react-adal library and implementing SSO on the front-end side was a matter of hours instead of days.

This however did pose a challenge for our end-to-end tests. We aim to perform a cycle that is as complete as possible in our end-to-end tests and decided that a valid JWT token and its validation should also be part of that suite. Cypress is our end-to-end testing tool and this offers a recipe for testing applications that use single sign on. Unfortunately this recipe didn’t provide us with a working solution, mainly because the (react-)adal library utilizes cross origin iframes for (re-) authentication. Cypress also runs the application under test in an iframe so we cannot leverage the existing iframe detection offered by react-adal.

Read more โ†’

Iterables, Iterators and Generator functions in ES2015

ES2015 adds a lot of new features to javascript that make a number of powerful constructs, present in other languages for years, available in the browser (well as soon as support for those features is rolled out of course, but in the meantime we can use these features by using a transpiler such as Babeljs or Traceur).
Some of the more complicated additions are the iterator and iterable protocols and generator functions. In this post I’ll explain what they are and what you can use them for.

Read more โ†’

AngularJS e2e testing using ngMockE2E

For our project we needed a mock http backend that we could instruct to return predefined responses so we were able to e2e test our full application without having a ‘real’ backend. This way we do not have to account for any state in the backend and can run our tests in isolation.

Requirements

  • Reuse the mockdata object created for our unit tests
  • Reuse the config object in which we define the backend endpoints
  • Have little or no impact on the production code

Read more โ†’