Once in a while you want to extract some values from a source file. For example if you want to extract a version number from code to process in a CI server. This example uses the python clang bindings to parse a cpp file and extracts a version number form it. This example used some…
Category: Uncategorized
[ASP.net Core] Body based routing with custom MatcherPolicy
From time to time you have to implement an API that has to have the same endpoint but has to do something differently based on the content of the request. For example take the OAuth2 /token endpoint. (This is an example, in real world use you would choose something more secure than this legacy oauth…
Let docker and ufw work nicely
There are a lot of good guides online that show some facets of letting docker work nicely with ufw as firewall. Unfortunately they all miss some small details that I needed to find out myself. Notably I want to give some credits to this post which helped me the most. https://www.mkubaczyk.com/2017/09/05/force-docker-not-bypass-ufw-rules-ubuntu-16-04/ But now what I…
I am going to Mars
Or at least my name is. The Mars 2020-rover has a chip on board with the names of people who have signed up their name. Do you want your name to also go to mars? Fill in the form in this page and get your own boarding pass. https://mars.nasa.gov/layout/embed/send-your-name/mars2020/certificate/?cn=1
Multiplicative persistence
After watching this @numberphile video I wanted to give it a try. Then I came up with this piece if python code to try to find a possible 12 iteration sequence. Result: Just put the prime factors after each other and you have your initial number. You don’t have to search any further because 222222222222222222222222222222222222222222222222222222…
Calculating prime numbers on all your cores
I was playing a bit with OpenMP in GCC and decided to try something fun. Like calculating the first X number of prime numbers. You know… Numbers that are only dividable by one and itself and that are greater than one. So, 2 is prime. 2 is also the only even prime number because all…