Shenzhen I/O #1 - Security Camera

A few days ago I tried out SHENZHEN I/O. It is some kind of puzzle game in which you need to solve little tasks using assembler and programming a microcontroller. The solution is then ranked in three categories and compared to friends: Product Cost: depends on the hardware you did choose Power Usage: Is increased with more complex and expensive commands Lines of code There is no tutorial. All you have is a 50 sheet documentation about the chips an the commands. That sounds pretty shitty in the beginning but is a nice, realistic thing I started to like pretty quickly. It’s like doing an exam with docs allowed. ...

February 24, 2021 Â· 2 min Â· 315 words Â· Robert

Advent of Code Day #6

Day 6 is again pretty nice to solve with Ruby. Today it is all about customs declaration. We again have different groups seperated by a newline containing multiple lines with characters. Each line represents a person and each character represents a different question answered with “yes”. abc a b c ab ac a a a a In this example we do have four groups of people. The first group only has one person which answered three questions. The second group as three people which answered three (different) questions. The third group has two people, they both answered question a and then two different questions. In the fourth group every of the four people answered one (the same) question. ...

December 6, 2020 Â· 2 min Â· 328 words Â· Robert

Advent of Code Day #5

Day five is all about the airplane seating. One seat it represented by something like this: FBFBBFFRLR. The first eight characters are for the row, the last three for the seat. Part 1 We need to find the highest seat id to solve the first part. The seat id is calculated with: row-id * 8 + column. For the rows you start with a range of 0 to 127. F means use the first half B means use the last half With this in mind you need to iterate over the first eight characters to get your seat. ...

December 5, 2020 Â· 2 min Â· 263 words Â· Robert

Advent of Code Day #4

In day 4 we need to deal with passports (yay!) and check if they are valid for given criterias. The passworts do have multiple fields (key:value) and are divided by a newline. ecl:gry pid:860033327 eyr:2020 hcl:#fffffd byr:1937 iyr:2017 cid:147 hgt:183cm iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884 hcl:#cfa07d byr:1929 hcl:#ae17e1 iyr:2013 eyr:2024 ecl:brn pid:760753108 byr:1931 hgt:179cm The fields are given and expected like so: byr (Birth Year) iyr (Issue Year) eyr (Expiration Year) hgt (Height) hcl (Hair Color) ecl (Eye Color) pid (Passport ID) cid (Country ID) Splitting them into “passports” is as easy as it gets. ...

December 4, 2020 Â· 2 min Â· 255 words Â· Robert

Advent of Code Day #3

In day 3 you have a ever repeating map with trees and free spaces. You move over this map and have to count how many trees (#) you will hit. Part 1 Given is a pattern in which you move right and down. In part 1 we start in the top left corner and always move 3 right and one down until we reach the last line. ..##.........##.........##.........##.........##.........##....... ---> #...#...#..#...#...#..#...#...#..#...#...#..#...#...#..#...#...#.. .#....#..#..#....#..#..#....#..#..#....#..#..#....#..#..#....#..#. ..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.#..#.#...#.# .#...##..#..#...##..#..#...##..#..#...##..#..#...##..#..#...##..#. ..#.##.......#.##.......#.##.......#.##.......#.##.......#.##..... ---> .#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....#.#.#.#....# .#........#.#........#.#........#.#........#.#........#.#........# #.##...#...#.##...#...#.##...#...#.##...#...#.##...#...#.##...#... #...##....##...##....##...##....##...##....##...##....##...##....# .#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.#.#..#...#.# ---> Since the map is repeating we need to reset the x position if we reach the end of the line in the given example. Theoretical you could achieve this with a simple modulo, but I did it without because I hadn’t it in mind when I was in a hurry. The rest of part 1 is very simple looping without any suprises. ...

December 3, 2020 Â· 2 min Â· 282 words Â· Robert

Advent of Code Day #2

In day 2 you were given a set of rules to be parsed first. The looked like this: 1-3 a: abcde 1-3 b: cdefg 2-9 c: ccccccccc Each line contains two numbers, a character and a password Part 1 In part 1 you have to check if the given character appears at least and at most times given by the numbers. Each password that matches this behavior is considered valid. Part 2 In part 2 you need to check if the given character is on one of the two given positions indicated by the numbers. ...

December 2, 2020 Â· 1 min Â· 95 words Â· Robert

Advent of Code Day #1

First day was fairly simple. You need to find the two-pair combination (part 1) that sums up to 2020 and the three-pair combination (part 2). Then simply multiply each of the numbers within the combination. The result is the solution for the puzzle. Unfortunately due to an outage day 1 will not result in any points on the leaderboards.

December 1, 2020 Â· 1 min Â· 59 words Â· Robert

Emgithub shortcode

During the upcoming AoC I want to post some small posts about each little puzzle. In preparation of this I was looking for a way in hugo to include and highlight source code from GitHub without copying it to each article. I discovered emgithub and wrote a little shortcode for it and you can find it here.

November 22, 2020 Â· 1 min Â· 57 words Â· Robert

Let's encrypt - Free, automated and open

Seit einiger Zeit gibt es nun schon Let’s Encrypt. Und seit einigen Wochen auch eine Betaphase die Anfang Dezember öffentlich wird. Ich fasse mich hier jetzt einfach mal kurz und zeige wie man sich in wenigen Schritten seine Zertifikate automatisiert generieren kann. Als ersten müssen wir natürlich den Client von Let’s Encrypt installieren - aktuell (und vermutlich wird das so bleiben) ist es nur per Api möglich Zertifikate zu erstellen. ...

November 17, 2015 Â· 3 min Â· 504 words Â· Robert

Wenn Limonade in den Betatest geht..

Heute hab ich mich mal daran versucht Limonade herzustellen. Dabei wollte ich als Geschmack vorallem Ananas, Limette und Grenadine haben. Nach einer Weile klicken im Internet hab ich eine grobe Vorstellung davon gehabt was ich denn so alles brauchen werde. Dann gab es noch einen Tipp des Diners meines Vertrauens. Was brauchen wir denn alles: 100 ml frischer Limettensaft (aus etwa 3 Limetten) 200 ml Ananassaft 1200 ml Leitungswasser 200 ml Grenadinesirup ...

May 3, 2015 Â· 1 min Â· 180 words Â· Robert