Dominik Meyerhttps://smartmeyer.de/2021-01-20T14:00:00+01:00Personal PageDexter Konfigurator2021-01-19T14:00:00+01:002021-01-20T14:00:00+01:00Dominiktag:smartmeyer.de,2021-01-19:/dexter-konfigurator-de.html<p class="first last">Ein interaktiver Drag and Drop Konfigurator für den
Dexter Kaminofen mit Beistellboxen.</p>
<p>Möchte man sich einen Kaminofen Dexter der Firma <a class="reference external" href="https://www.austroflamm.com/">Austroflamm</a>
zulegen, so steht man vor der Entscheidung, wie dieser zusammengesetzt werden soll.
"Soll ich nur eine Kiste darunter packen, oder brauche ich vielleicht doch rechts eine
breite mehr für das Holz", wird sich so mancher fragen. Und wie sieht das dann eigentlich
aus im Ensemble. Bisher musste man sich das vorstellen und aus einem der Beispiele
im Werbeprospekt zusammensetzen. Vor genau dem gleichen Problem stand ich auch und
habe daher vorrangig für mich selbst einen
<a class="reference external" href="https://smartmeyer.de/files/202101/dexter/dexter-konfigurator.html">Dexter Konfigurator</a> implementiert, der
im Webbrowser läuft und mit dem man sich sein individuelles Ensemble zusammenstellen
kann.</p>
<p>Ein Hinweis: Dieser Konfigurator wird nicht offiziell von der Firma Austroflamm bereit
gestellt oder unterstützt. Dies ist ein Privatprojekt unter Ausschluss jeglichen
Support oder Garantie für Richtigkeit.</p>
<p><a class="reference external" href="https://smartmeyer.de/files/202101/dexter/dexter-konfigurator.html">Konfigurator öffnen</a></p>
<div class="figure align-center" style="height: auto;">
<img alt="dexter" src="https://smartmeyer.de/files/202101/images/dexter.png" style="width: 60%;height: auto;"/>
<p class="caption">Ein Beispiel aus dem Konfigurator.</p>
</div>
Denkfehler mit Wahrscheinlichkeiten2017-08-30T17:00:00+02:002016-08-30T17:00:00+02:00Dominiktag:smartmeyer.de,2017-08-30:/denkfehler-mit-wahrscheinlichkeiten-de.html<p class="first last">Im alltäglichen Leben muss jeder Mensch mit Wahrscheinlichkeiten
umgehen und meist klappt dies intuitiv. Oft aber steht uns das
menschliche Gehirn im Weg, wenn es um kompliziertere und nicht
offensichtliche Entscheidungen im Zusammenhang mit Wahrscheinlichkeiten
geht. Wie kann man sich im Alltag besser entscheiden, wenn
Unsicherheiten bestehen?</p>
<p>Soll ich zur Krebsvorsorge gehen? Oh mein Gott, der Test war positiv!
Intuitiv macht es natürlich Sinn (und in den meisten Fällen natürlich nicht nur
intuitiv, sonder ganz reell) zur Krebsvorsorge zu gehen. Meist, wenn ein
Test positiv ist, dann ist man auch mit ziemlicher Sicherheit krank - aber
nur mit ziemlicher Sicherheit. Man könnte auch gesund sein. Vor allem,
wenn der Test viele so-genannte False-Positives (Falsch-Positiv) Fälle
anzeigt. Ob man dann wirklich Krank ist, oder nicht doch lieber noch einen
Test macht kann man dann in den einfachsten Fällen mit Hilfe der <a class="reference external" href="https://de.wikipedia.org/wiki/Satz_von_Bayes">Bayes Regel</a>
entscheiden. Eben leider nur in den einfachsten Fällen und meist ist
in Sachen Gesundheit die Lage viel komplizierter. Vor allem bei der
Vorsorgeuntersuchung.</p>
<p>Nichtsdestotrotz sollen diese Beispiel als Illustration für Fehlschlüsse
gelten, die vom Menschen oft gemacht werden, wenn es um Unsicherheit der
Entscheidung geht. Auch sollen drei einfache Wege aufgezeigt werden, wie
solche Fehlschlüsse vermieden werden können.</p>
<p>Das alles gibt es in diesem Dokument zum Download und zum Nachlesen:</p>
<p><a class="reference external" href="https://smartmeyer.de/files/201708/denkfehler-mit-wahrscheinlichkeiten.pdf">Denkfehler mit Wahrscheinlichkeiten</a></p>
Monty Hall Problem2017-08-30T17:00:00+02:002016-08-30T17:00:00+02:00Dominiktag:smartmeyer.de,2017-08-30:/monty-hall-problem.html<p class="first last">The Monty Hall problem is a widely known philosophical problem
lossely based on a TV game show. It illustrates nicely how to use
probability theory in order to determine the odds when faced with
a decision in the show. Several explanations on how to solve the
problem exist, but unfortunately none will help in the actual game
show.</p>
<p>Imaging you are in a game show where you can choose between three identical
doors, where behind one door a car is hidden whereas behind the other two
goats are hidden. You can now choose which door to open and if you happen to
choose the door where the car is, this car is yours. After you made the decision,
the showhost stops and doesn't open the door immediately but gives you the
chance to reconsider. He encourages you to rethink if you really want to open
this door by opening a door where there is for sure a goat hidden behind.
The big question you are facing now is: What are my chances of winning the
car by keeping my decision or changing to the other closed door?</p>
<p>Intuitively, one would think that the probability for the car being behind
each door is one third and by opening the door where there is a goat hidden
the probability stays the same. Therefore, it should not matter if the
door is changed or not, right? No. Actually, it matters, because the odds
for winning when changing the door are two third, whereas the odds when
staying with the original decision is one third. How can that be?</p>
<p>One of the easier graspbable methods of determining this solution is
by simple counting. It is assumed that the probability of where the car
is hidden is uniformly determined, this means that the probability of
the car being behind a certain door is one third at the beginning of the
game. The game consists not only of one decision but has to be treated
as a sequence of decisions to determine the final probabilities. Therefore,
we can define a triple <tt class="docutils literal">(your choice, door opened by host, door with car)</tt>
to describe one sequence of game playing. As the game is symmetrical, we
can investigate one of the cases and extend the result to the others.
So if we choose to open door 1 and then the host opens door 2, but the
car was hidden behind door 1, this would be the tuple <tt class="docutils literal">(1, 2, 1)</tt>.
For the symmetrical case, where we start with choosing door one, there
are four possible outcomes of the game, those are</p>
<blockquote>
<tt class="docutils literal">(1, 2, 1) (1, 3, 1) (1, 2, 3) (1, 3, 2)</tt>.</blockquote>
<p>Now we can begin to count: The two last cases, where the car was hidden
behind door 3 or door 2, which we both didn't choose in the beginning,
we can assign a probability of one third each. Why one third for four
cases? Yes, we have to treat the first two cases as separate, because the
probability of one third for hiding the car behind door 1 has to be
distributed to those two cases. Therefore, these are assign probability
of one sixth. To now determine the probability of winning when switching
the door, we have to count the cases <tt class="docutils literal">(1, 2, 3)</tt> and <tt class="docutils literal">(1, 3, 2)</tt> and
add up their probability, which amounts to two third. The probability for
staying with the decision and winning is the probability of the two
first cases added, which is one third. Therefore, it is better to change.</p>
<p>Another solution method would be simple and stupid simulation. This means
a program plays a lot of games and decides randomly between doors and
randomly decides to stay or switch. Then the numbers of winning and loosing
for each case are recorded and the average probability can be calculated.
In general such a method is called <a class="reference external" href="https://en.wikipedia.org/wiki/Monte_Carlo_method">Monte Carlo method</a>.</p>
<p>When I was first encountering the problem a few years ago, I couldn't wrap
my head around the solution and couldn't believe this to be true. Therefore,
I implemented a simulation of the game in Python. It can be downloaded
at my Github page <a class="reference external" href="https://github.com/meyerd/monty-hall-problem">monty-hall-problem</a>.</p>
<p>If you are interested in the Monty Hall problem and its history, as well
as a lot of discussion of different solution methods and strategies, I
highly recommend the book</p>
<blockquote>
<tt class="docutils literal">J. Rosenhouse. The Monty Hall Problem: The Remarkable Story of Math's Most Contentious Brainteaser, Oxford University Press, new Yord, 2009</tt>.</blockquote>
<p>Alternatively, you can also find the basic description of the solution
methods and a discussion of strategies on <a class="reference external" href="https://en.wikipedia.org/wiki/Monty_Hall_problem">Wikipedia</a>.</p>
<p>One last question remains: Does this help us if we would be actually
playing in the game show? Actually, no. The problem posed in the gameshow
is different as the show host didn't always open one other door. Also
he tried to influence the participants through tricks. Therefore, the
real problem is not as rigorous as the theoretical one.</p>
Digits2017-07-25T14:00:00+02:002016-07-25T14:00:00+02:00Dominiktag:smartmeyer.de,2017-07-25:/digits.html<p class="first last">An interactive in-browser example classifying handwritten
digits in the browser using convolutional neural networks.</p>
<p>Since a few year now deep learing neural networks are very successful at
various tasks in machine learning. One very popular application is the
classification of image data. When testing a new framework or algorithm
for image data classification, one very popular example dataset is the
handwritten digits <a class="reference external" href="http://yann.lecun.com/exdb/mnist/">MNIST</a> classification task. In this dataset 60000
images of digits can be used as training data and an additional 10000 images
serve as the testing data.</p>
<p>When looking at convolutional neural network (CNN) implementations, therefore
naturally testing a CNN on this dataset is very popular. Many framworks for
implementing CNNs are available and one easy to use for Python is called
Lasagne. In this code repository of course one example for classifying the
MNIST data with a CNN is available <a class="reference external" href="https://github.com/Lasagne/Lasagne/blob/master/examples/mnist.py">LasagneMnist</a>. This example is all
nice if you are only interested in seeing if the network is able to learn
and are satisfied with some accuracy numbers.</p>
<p>To play around with the trained network, some interactive example would be
nice. I am sure that some interactive MNIST JavaScript examples do already
exist, but there is nothing to learning like implementing it oneself. Therefore,
I modified the Lasagne example to learn on the training data and output
the learned weights to a JSON file.</p>
<p>This JSON file then gets loaded in the browser to a pure JavaScript CNN
implementation, called <a class="reference external" href="https://github.com/karpathy/convnetjs">ConvNetJS</a>. With a little glue code and a simple
drawing application for a canvas element the result can be seen in the
demo below.</p>
<p>In order for this demo to work properly, you have to view this
page in a browser, that supports HTML5.</p>
<script type="text/javascript">
window.onload = function() {
canvasDrawingApp.init();
//convnetApp.init(canvasDrawingApp, "/files/201707/mnist-cnn-model.json");
convnetApp.init(canvasDrawingApp, "/files/201707/mnist-convnet-model.json");
};
</script>
<div style="display: table;">
<div id="canvas_controls" style="display: table-row;">
<button id="clear_canvas_button" type="button">clear</button>
</div>
<div id="draw_and_output" style="display: table-row;">
<div style="display: table-cell; vertical-align: middle; text-align: left; padding: 5px;">
Draw here: <div id="draw_canvas"></div>
</div>
<div style="display: table-cell; vertical-align: middle; text-align: center; padding: 5px;">
Network input: <div id="debug_canvas"></div>
</div>
<div style="display: table-cell; vertical-align: middle; text-align: center; padding: 10px;">
Is recognized as: <div id="digit_output">-</div>
<span style="white-space: nowrap"><span id="digit_confidence">0</span>% confidence.</span>
</div>
</div>
</div><p>As you can see, this simple example and network far from perfect yet, but it illustrates
the purpose. For implementational details, I would like to refer to the (very choppy) implementation
itself. Everything can be downloaded on Github <a class="reference external" href="https://github.com/meyerd/digits">DigitsGithub</a>, including the Python
code for training the network and all the JavaScript code running on this page.</p>
Unsmart2017-07-09T14:00:00+02:002016-07-09T14:00:00+02:00Dominiktag:smartmeyer.de,2017-07-09:/unsmart-de.html<p class="first last">Heutzutage sind immer mehr Geräte mit dem Internet verbunden. So auch Smart TVs. Möchte man nun die Funktionalitäten, die eine Internetverbindung voraussetzen nicht nutzen und trennt den Fernseher vom Netz, so stallt sich heraus, dass einiges nicht mehr funktioniert (z.B. Abspielen von lokalen Dateien von einer USB-Festplatte). Unsmart macht es möglich diese wieder zu verwenden, indem eine funktionierende Internetverbindung vorgegaukelt wird, aber keine Daten zum Hersteller weitergeleitet werden.</p>
<p>Als ich mir den Samsung UE40F5400 "Smart" TV kaufte, habe ich diesen
für einige Zeit normal mit dem Internet verbunden verwendet. Ich stellte
aber fest, dass ich die meisten Apps und Funktionen gar nicht verwendet
habe, sondern nur Fernsehsendungen aufgezeichnet und lokale Dateien von
Festplatte angesehen habe. Also habe ich im Sinne der Datensparsamkeit
den Fernseher vom Internet getrennt. Daraufhin waren die meisten Funktionen
nicht mehr verfügbar, selbst wenn diese keine Internetverbindung vorausgesetzt
haben. Die große Frage ist nun, wieso der Fernseher mit dem Internet
verbunden sein muss um lokale Dateien abzuspielen? Was macht Samsung
mit meinen Daten, und welche Daten werden überhaupt rausgesendet?</p>
<p>Dieses Verhalten ist unakzeptabel und hat mich dazu bewogen mir die
ganze Sache einmal etwas genauer unter die Lupe zu nehmen.</p>
<p>Da ich sowieso noch einen ungenutzten Raspberry Pi in meinem lokalen
Netzwerk am laufen hatte, habe ich diesen verwendet um den Netzwerkverkehr
von und zum Ferneseher über diesen umzuleiten und mittels Wireshark
zu inspizieren. Dazu muss man nicht einmal einen externen Monitor mit
dem Raspberry verbinden.</p>
<p>Als allererstes muss die Paketweiterleitung auf dem Raspberry mittels</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> sudo sysctl -w net.ipv4.ip_forward<span class="o">=</span><span class="m">1</span>
</pre></div>
<p>aktiviert werden. Dies funktioniert nur für IP4, aber IP6 ist für dieses
Produkt sowieso irrelevant ...</p>
<p>Anschließend leitet man den Verkehr mittels NAT vom Fernseher durch
den Raspberry. Am Fernseher wir dann die IP des Raspberry als Gateway
Adresse eingestellt.</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> sudo iptables -t nat -F
<span class="gp">$</span> sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
<span class="gp">$</span> sudo iptables -A FORWARD -i eth0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
<span class="gp">$</span> sudo iptables -A FORWARD -i eth0 -o eth0 -j ACCEPT
</pre></div>
<p>Um den Verkehr dann remote via wireshark auf einem Rechner inspizieren
zu können leitet man die Ausgabe von tcpdump mittels</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> ssh <raspberry pi> <span class="s2">"sudo tcpdump -U -s0 -w - 'not port 22'"</span> <span class="p">|</span> wireshark -k -i -
</pre></div>
<p>um.</p>
<p>Schaut man nun in den Datenverkehr, so passiert schon eine Menge an
Verker alleine beim Einschalten. Manche Verbindungen verschlüsselt,
viele aber auch unverschlüsselt. Um festzustellen, ob der Fernseher
mit dem Internet verbunden ist, so scheint es wird eine Anfrage an
samsung.com gestellt und eine XML-Datei heruntergeladen (die Frage ist
ja auch, was passiert wenn samsung.com offline ist ...). Diese Datei
scheint einige US Börsendaten zu beinhalten, hat aber auch 3 sehr seltsame
Bytes am Anfang der Datei. Wird die Datei simuliert ohne diese 3 Bytes,
so funktioniert der Fernseher nicht. Darin scheint also etwas spezielles
zu passieren.</p>
<p>Um diese exakte Datei zu bekommen, kann man nun in Wireshark "Follow TCP Stream"
anwählen und den Inhalt der Verbindung abspeichern. Anschließend
kann mittels einem dnsmasq server auf dem Raspberry und einem sehr
simplen Python TCP Server, der nur die abgespeicherte Datei ausliefert,
die Internetverbindung simuliert werden. Ist es gewünscht, dass doch
noch einzelen Apps (z.B. YouTube) funktionieren sollen, so müssen die
entsprechenden Domains in der dnsmasq Konfiguration freigeschaltet werden.</p>
<p>Alle Informationen und Konfigurationsdateien und wie sie zu verwenden
sind können im Github Repoitory <a class="reference external" href="https://github.com/meyerd/unsmart">Unsmart</a> eingesehen werden.</p>
Unsmart2017-07-09T14:00:00+02:002016-07-09T14:00:00+02:00Dominiktag:smartmeyer.de,2017-07-09:/unsmart.html<p class="first last">You have the feeling that an internet connection for your smart tv is not necessary, but when you unplug some features are not longer accessible (e.g. playing recordings from the attached harddrive). Then unsmart is for you. Disconnecting the tv but faking a working internet connection.</p>
<p>I own a Samsung UE40F6400 "smart" tv and I did use it for quite some
time connected to the internet. But at some point I did realize, that
I didn't really use all the builtin apps and features, that would
require a internet connection (since the browser is pretty much unusable
anyways). So I decided to disconnect the tv.</p>
<p>After a while I wanted to watch a video file from the attached harddisk
and to my surprise this wasn't possible anymore. Wait? You have to be
connected to the internet in order to watch a file from local storage?
You got to be kidding me!</p>
<p>This is unaceptable to me and therefore I dived into reverse engineering
what is sent over the network and what prevents me from watching my local
video files.</p>
<p>As I had a raspberry pi idling on the local network anyways, I did use
this to sniff some of the local network traffic sent fto and from the tv
set. This is done quite easily and does not even require you to connect
a monitor to the raspberry pi.</p>
<p>First on the raspberry, enable ip forwarding (ip4 only, you really thought
this product is using ip6 ...) via</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> sudo sysctl -w net.ipv4.ip_forward<span class="o">=</span><span class="m">1</span>
</pre></div>
<p>Then via NAT the traffic from the tv can be redirected through the
raspberry. Just use the raspberry pi's IP as the gateway address.</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> sudo iptables -t nat -F
<span class="gp">$</span> sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
<span class="gp">$</span> sudo iptables -A FORWARD -i eth0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
<span class="gp">$</span> sudo iptables -A FORWARD -i eth0 -o eth0 -j ACCEPT
</pre></div>
<p>Then remotely sniffing all traffic passing trough the raspberry can
be done via wireshark</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> ssh <raspberry pi> <span class="s2">"sudo tcpdump -U -s0 -w - 'not port 22'"</span> <span class="p">|</span> wireshark -k -i -
</pre></div>
<p>If you look into the traffic, all kind of things are going on. Some
encrypted requests and even some unecrypted data requests are made.
Apparently, to check, whether the internet connection works, the TV
makes a request to samsung.com and retrieves an xml file (it is to
be determined, if all users cannot watch local movies once the samsung
site ist down ...). This file seems to contain US stockticker data,
but has some very strange 3 bytes in the beginning, without them the
connectivity is not confirmed.</p>
<p>So to retreive the file, clock follow TCP stream for the according
packet of the xml file in wireshark and save the bytes of this request
to a file.</p>
<p>Then a small dnsmasq server can be set up on the raspberry pi to
redirect all requests from the TV to the local raspberry address.
In the code repository there is a very simple server, that just sends
out this captured xml file on any request. That seems to be enough
to satisfy the online check. If you wish to use other services and
apps on the TV, then obviously some other domains for those services
have to be whitelisted by configuring the dnsmasq server accordingly.</p>
<p>All the configurations and how to use them can be found in the Github
repository <a class="reference external" href="https://github.com/meyerd/unsmart">Unsmart</a>.</p>
Funktrainer2017-05-17T18:00:00+02:002016-05-17T15:00:00+02:00Dominiktag:smartmeyer.de,2017-05-17:/funktrainer-de.html<p class="first last">Funktrainer ist eine Android App zum lernen auf die auf die Amateurfunkprüfung der Klasse E und A in Deutschland. Alle aktuellen Prüfungsfragen des amtlichen Prüfungskatalogs sind vorhanden.</p>
<p>Erst kürzlich habe ich meine nun finale Amateurfunkprüfung für die Klasse
A bestanden. Davor habe ich die Prüfung für die Klasse E absolviert. Wie
viele amtliche Prüfungen in Deutschland wird von einem vordergründig viel
auswendig gelerntes Wissen in der Form eine Multiple-Choice Prüfung
abverlangt. Natürlich geht es hier um mehr. Man soll die technischen und
gesetzlichen Hintergründe und Regelungen verstehen und hernach in seinem
Hobby korrekt anwenden. Nur so hat man viel Spaß am Gerät, ohne mit der
Bundesnetzagentur in Konflikt zu geraten.</p>
<p>Nun gut, dieses Grundwissen wird vom DARC in exzellent organisierten
und durchgeführten Kursen von freiwilligen Funkamateuren beigebracht.
Besonders viel Spaß macht dann natürlich der fortgeschrittene Klasse A
Kurs, bei dem auch viele elektrotechnischen Grundlagen an einfachen
Schaltungen direkt ausprobiert und das Ergebnis am Oszilloskop bestaunt
werden können.</p>
<p>Leider geht es, wie gesagt, am Ende des Tages dann doch nur noch darum
die Prüfung erfolgreich zu bestehen. Dies sollte dank der exzellenten
Vorbereitung kein Problem sein. Um mich dann endgültig auf die Prüfung
vorzubereiten, habe ich nach einer Möglichkeit gesucht einfach die
Fragenkataloge durchzugehen und mein Wissen aufzustocken und zu überprüfen,
ob ich denn bestehen würde.</p>
<p>Leider konnte ich zum Zeitpunkt des Kurses keine passende App für mein
Mobiltelefon finden, die den Kriterien kostenlos und keine unnötigen
Android-Rechte entsprach. Zum Glück erinnerte ich mich noch an den Segelschein,
den ich ein Jahr zuvor gemacht hatte und bei dem ich in der selben
Situation war. Dort hat Matthias Wimmer den exzellenten <a class="reference external" href="https://github.com/mawis/sailtrainer">Sailtrainer</a>
kostenlos zur Verfügung gestellt und war so nett mir zu erlauben seinen
Code als Basis für eine eigene Lern-App für die Amateurfunkprüfung zu
nehmen.</p>
<p>Nun, nach einigen Iterationen, vielen Änderungen in der Software Architektur
und der GUI und dem erfolgreichen Einsatz durch mindestens mich selbst,
behaupte ich nun, dass man den von mir subjektiv besten Funktrainer,
den es im Play Store gibt nun frei verwenden kann. Installieren ganz
einfach über den Play Store: <a class="reference external" href="https://play.google.com/store/apps/details?id=de.hosenhasser.funktrainer">Funktrainer-Appstore</a>.</p>
<p>Der Code ist selbstverständlich verfügbar unter <a class="reference external" href="https://github.com/meyerd/funktrainer">Funktrainer</a> und kann
gerne für Verbesserungen herangezogen werden.</p>
<p>Die grundsätzliche Funktionalität ist natürlich das Lernen von
Prüfungsfragen für die einzelnen Untergebiete der entsprechenden
Prüfungen, die man im Startbildschirm auswählen kann.</p>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 01" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_01.png" style="width: 40%;height: auto;"/>
<p class="caption">Funktrainer Startbildschirm.</p>
</div>
<p>Jede Frage hat die vier möglichen offiziellen Antworten und kann durch
antippen ausgewählt werden. Direkt darauf wird angezeit, ob die Antwort
richtig war oder nicht. Mit einer Wischgeste nach rechts, kann man sich
die Antworten auf die letzten 30 Fragen noch einmal ansehen und durchgehen,
was falsch gemacht wurde.</p>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 02" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_02.png" style="width: 40%;height: auto;"/>
<p class="caption">Fragenbildschirm</p>
</div>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 03" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_01.png" style="width: 40%;height: auto;"/>
<p class="caption">Upps, falsche Antwort, da ist wohl noch Lernen angesagt.</p>
</div>
<p>Zusätzlich, um sich dann wirklich auf die Prüfung unter fast realistischen
Bedingungen vorbereiten zu könne, gibt es einen Prüfungsmodus. Dabei werden
aus dem entsprechenden Gebiet, aus jeweil jedem Untergebiet zufällig einige
Fragen ausgewahlt und eine Prüfung zusammengestellt. Links unten läuft dann
ein Timer, wie viel Zeit man noch hat. Nach einem Klick rechts unten auf
auswerten, bekommt man die Information ob man bestanden hätte und welche
Fragen noch Fehlerhaft waren.</p>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 06" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_06.png" style="width: 40%;height: auto;"/>
<p class="caption">Prüfungssimulation Themenauswahl.</p>
</div>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 04" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_04.png" style="width: 40%;height: auto;"/>
<p class="caption">In der Prüfung tickt die Zeit ...</p>
</div>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 05" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_05.png" style="width: 40%;height: auto;"/>
<p class="caption">Wenn man keine Frage beantwortet, kann man auch nicht bestehen ...</p>
</div>
<p>Zu guter Letzt kann man in den Einstellungen noch sein persönlichen
Präferenzen wählen. Zum Beispiel möchte manch einer auch Fragen geziehlt
überspringen können, ohne dass die Antwort in die Statistik mit hinein
zählt, oder im Falle der Klasse A Prüfung, bei der über 1000 Fragen gelernt
werden müssen, werden nicht alle Fragen 5 mal (wie voreingestellt), sondern
nur zweimal abgefragt, wenn man die dritte Option wählt. So kann man die
Fragen einmal durchackern, auch wenn nicht mehr so viel Zeit bis zur
Prüfung ist.</p>
<div class="figure align-center" style="height: auto;">
<img alt="screenshot 07" src="https://smartmeyer.de/files/201705/images/funktrainer_screenshot_07.png" style="width: 40%;height: auto;"/>
<p class="caption">Einstellungsbildschirm.</p>
</div>
<p>Ich hoffe, diese App ist nützlich für den oder die ein oder andere und
ich wünsche viel Erfolg bei den Prüfungen. Wie gesagt, kostenloser
Download im Play Store: <a class="reference external" href="https://play.google.com/store/apps/details?id=de.hosenhasser.funktrainer">Funktrainer-Appstore</a>.</p>
<p>vy 73 de DL9DM.</p>
Funktrainer2017-05-17T18:00:00+02:002016-05-17T15:00:00+02:00Dominiktag:smartmeyer.de,2017-05-17:/funktrainer.html<p class="first last">Funktrainer is an Android app to study for the german ham radio license A and E. It contains all the current official questions.</p>
<p>Sorry, this article is only available in german. Please refer to
the german version above for the full article.</p>
A Fading Blinker2017-04-11T19:00:00+02:002016-04-11T19:00:00+02:00Dominiktag:smartmeyer.de,2017-04-11:/fadeblinker.html<p class="first last">You need a simple blinky for demo purposes. Toss in an Arduino, use some PWM and you are done - or use some electronic engineering. Because you are cool.</p>
<p>Recently, I had to cobble together a mockup of some blackbox, looking
scary, as if something dangerous was inside. Of course such a box has
to have a atom warning sign on top and of course it has to blink with
orange warning lights.</p>
<p>Additionally, the warning lights are not allowed to just blink, but have
to alternatingly fade in and out nicely. This task is easy: just throw
in any arduino, use the PWM outputs and write a little piece of code
to fade in and out the LEDs. But sometimes, easy is not enough. Sometimes,
the inner engineer wants to learn something new and wants to achieve
something not the (nowadays) easy, but seemingly hard way (from the
perspective of a computer science guy).</p>
<p>Therefore, we will to this think good old-school analog.</p>
<p>Where to start? I remembered that as a kid, my dad showed me to solder simple
electronic circuits. He could draw down a <a class="reference external" href="https://en.wikipedia.org/wiki/Multivibrator#Astable_multivibrator">AstableMultivibrator</a> from the
top of his head. I soldered it together and was amazed how it blinked away.
So quickly google that circuit and mash it together.</p>
<p>Ok, it blinks, but how to steer the blinking frequency and make it nice
and fady? So, some more engineering has to be done, I guess. To be able
to design the circuit and size the components (mainly being able to tell what
of the spare parts I had lying around I could use), I fired up <a class="reference external" href="http://www.linear.com/designtools/software/">LTSpice</a>.</p>
<p>After drawing up a multivibrator circuit, I complemented the design with
two fade in and out circuits.</p>
<div class="figure align-center" style="height: auto;">
<img alt="fadeblinker schematic" src="https://smartmeyer.de/files/201704/images/fadeblinker_sch.png" style="width: 100%;height: auto;"/>
<p class="caption">Schematic from the LTSpice simulation.</p>
</div>
<p>After running the simulation and tinkering with the component sizing,
the timing seemed reasonable for a slow but steadily frightening atom blinking
sequence.</p>
<div class="figure align-center" style="height: auto;">
<img alt="fadeblinker simulation plots." src="https://smartmeyer.de/files/201704/images/fadeblinker_plot.png" style="width: 100%;height: auto;"/>
<p class="caption">Signal plot of the simulation. Oscillator outputs in red and turquoise. Diode currents in green and blue.</p>
</div>
<p>Now you might ask, why in the hell did that guy use two resistors in parallel?
Easy answer: I forgot to design for two LEDs in series and already had soldered
the two 470 resistors, so I botched up a second in parallel to get the current
up to desired LED brightness.</p>
<div class="figure align-center" style="height: auto;">
<img alt="fadeblinker board" src="https://smartmeyer.de/files/201704/images/board.png" style="width: 100%;height: auto;"/>
<p class="caption">Put together on a prototype board. Such beautiful placement!</p>
</div>
<p>After prototyping everything was assembled on a board with the famous place first
then think about routing algorithm. What was missing was the case and the LEDs,
of which the top part can be seen in the next image.</p>
<div class="figure align-center" style="height: auto;">
<img alt="fadeblinker board and topside case" src="https://smartmeyer.de/files/201704/images/board_and_top.png" style="width: 100%;height: auto;"/>
<p class="caption">Finished board and 3D printed case top.</p>
</div>
<p>Putting it all together, I realized that those bloody 9V blocks are bulkier than
anticipated. Therefore, the ugly wire outside ... something to learn for next
time.</p>
<div class="figure align-center" style="height: auto;">
<img alt="fadeblinker put together." src="https://smartmeyer.de/files/201704/images/board_top_wiring.png" style="width: 100%;height: auto;"/>
<p class="caption">Finished board and top. Make sure to use lots of hotglue. This shows quality engineering work.</p>
</div>
<p>Look at the final product, intimidating, isn't it? No?</p>
<div class="figure align-center" style="height: auto;">
<img alt="fadeblinker animation" src="https://smartmeyer.de/files/201704/images/fadeblinker.gif" style="width: 196px;height: auto;"/>
<p class="caption">Blinker in action.</p>
</div>
<p>Download the LTSpice simulation file <a class="reference external" href="https://smartmeyer.de/files/201704/downloads/fadeblinker.asc">here</a>.</p>
Onkyo TX-SR313 Repair2016-06-14T19:00:00+02:002016-06-14T19:00:00+02:00Dominiktag:smartmeyer.de,2016-06-14:/onkyo-tx-sr313-repair.html<p class="first last">My AV receiver died on me in the midst of binge-watching. So shame on you for interrupting my viewing experience. But luckily it was a cheap fix. This article describes what was broken and how to replace it.</p>
<p><strong>Disclaimer: I do not advise you to try repairing any equipment connected
to mains power on your own if you have no clue. Especially, while it is
connected to the mains power. Proceed at your own risk. Remember: I told you
do not even think of opening up that receiver case!</strong></p>
<p>I have my Onkyo TX-SR313 since a few years now and it is a very nice piece
of amplifier equipment. The sound quality is really superb and it has all
the connections and functionalities I need. Unfortunately, when watching
some of my favourite series, in the midst of an action scene, suddenly, the
receiver shut off. First, I suspected some overheating issue or similar,
so I continued watching with my crappy built-in TV speakers, but then after
a while the amplifier would not turn on. This is when I started worrying
(in reality, I already worried before, since it had never overheated before, even
on high volumes and there is nothing blocking the airflow above it, so this
should not be an issue).</p>
<p>Even on the next day (because a lot of guides on the net suggest letting
it cool down and decharge all the caps and such), the thing would not work.
The only indication of life it was giving was a constant glowing "HDMI Thru".
When I pressed the power button, nothing would happen, except the "HDMI Thru"
led would start blinking. No satisfyingly clicking relais inside, nothing.</p>
<p>Apparently, the most common fault in receiver amplifiers with dedicated
transistors in the amp is such a transistor shorting out. This can be due
to overheating or more likely due to a faulty bias current resistor. These
resistors are the white blocks in front of each transistor pair. Therefore,
I went ahead and checked every resistor if it has the correct value and
every transistor if it was shortened out from collector to emitter. For further
details, I would like to refer to the many excellent youtube videos out there.</p>
<p>Every resistor and every transistor checked out positively and by visual
inspection of the rest of the device, I could not find any obvious broken
components (for example bulged up capacitors or something like that). At first,
I was tempted to give up, since a quick research could not bring up any
other obvious things to check or obvious faults in similar devices, that
would exhibit the same behaviour.</p>
<p>But then taken by my ambition I decided to repair that sucker. I downloaded
the schematics and started looking through it. Especially through the
amplifier section, since I still suspected some protective circuit to shut
down the device immediately. After a while of studying and more youtube
videos about receiver repairs, I encountered one specific video by the
excellet <a class="reference external" href="https://www.eevblog.com/">EEVBlog</a>, where a broken Yamaha receiver gets fixed, which has
a fault in the standby power supply circuit. This gave me the idea to look
more specifically at this section and check out the voltages there.</p>
<p>If you look at this part of the schematic, it is clear that a 12V support
voltage is generated which is supplied to the main IC and then two more
interesting lines come back, which are those which trigger the main supply
relais. Especially, <tt class="docutils literal">POWERD</tt>.</p>
<div class="figure align-center" style="height: auto;">
<img alt="onkyo power supply schematic" src="https://smartmeyer.de/files/201606/images/onkyo_schematic.png" style="width: 100%;height: auto;"/>
<p class="caption">Schematic for the power supply section.</p>
</div>
<p>So it ocurred to me to check out the relais in the first place, since if
there is still some protective circuit engaged, the relais should be triggered
at least once and then immediately release again when the power button is
pressed (which it did not!).</p>
<p>So supplying 12V to the lines <tt class="docutils literal">+12VD_ST</tt> and GND to <tt class="docutils literal">POWERD</tt> did not
produce any clicking sound. Very odd. Could it be the relais itself is broken?
A quick bridging of the relais ...</p>
<div class="figure align-center" style="height: auto;">
<img alt="bridged relais" src="https://smartmeyer.de/files/201606/images/onkyo_relais_bridge.jpg" style="width: 100%;height: auto;"/>
<p class="caption">Dangerously bridged relais makes it work.</p>
</div>
<p>revealed, that indeed the relais is broken. The reveiver turned on and did
it's job flawlessly. So now we know who is to blame.</p>
<p>A quick search brought up that the type of relais <tt class="docutils literal">Tyco</tt> is more or less not
available to the end user for buying. Therefore, a suitable replacement had
to be found. The datasheet of the <tt class="docutils literal">Tyco <span class="pre">SDT-S-109LMR2</span></tt> relais revealed,
that it is a relais designed for 9V operation and the coil is supposed to
have 540 Ohms with a max coil power of 150 mW. Good luck finding exactly
a matching piece.</p>
<p>Digging around further in the schematics, reveals that the relais is driven
by a <tt class="docutils literal">KRC105S</tt> transistor, which is rated up to 100 mA, so we should aim
for maximum coil current of 50 mA, just to be safe.</p>
<p>Fortunately, I could find in an old stack of discarded PC power supplies one
which not only has 230 V input but also a switched 230 V output for a monitor
or such (thumbs up for that old things lying around). It had a relais in,
which pretty much matched the requirements.</p>
<div class="figure align-center" style="height: auto;">
<img alt="replacement relais" src="https://smartmeyer.de/files/201606/images/onkyo_replacement_relais.jpg" style="width: 100%;height: auto;"/>
<p class="caption">Replacement Relais.</p>
</div>
<p>5 amps of switching at the 230 V side and a coil resistance of around 330 ohms.
Almost perfect. Almost, because desoldering the old relais</p>
<div class="figure align-center" style="height: auto;">
<img alt="desoldered that thing" src="https://smartmeyer.de/files/201606/images/onkyo_relais_desolder.jpg" style="width: 100%;height: auto;"/>
<p class="caption">Desolder the old relais.</p>
</div>
<p>revealed, that the new one was too short to perfectly fit in there.</p>
<div class="figure align-center" style="height: auto;">
<img alt="the new one is too short, bummer" src="https://smartmeyer.de/files/201606/images/onkyo_relais_tooshort.jpg" style="width: 100%;height: auto;"/>
<p class="caption">The new one is too short, bummer.</p>
</div>
<p>But a electronical engineer approved solution, helped to get the new component
in place.</p>
<div class="figure align-center" style="height: auto;">
<img alt="there - I fixed it" src="https://smartmeyer.de/files/201606/images/onkyo_relais_fix.jpg" style="width: 100%;height: auto;"/>
<p class="caption">There - I fixed it!</p>
</div>
<div class="figure align-center" style="height: auto;">
<img alt="no one will find out ..." src="https://smartmeyer.de/files/201606/images/onkyo_relais_fix_replaced.jpg" style="width: 100%;height: auto;"/>
<p class="caption">No one will find out that is not original.</p>
</div>
<p>After testing the new relais, the machine was working perfectly again.</p>
<div class="figure align-center" style="height: auto;">
<img alt="job done" src="https://smartmeyer.de/files/201606/images/onkyo_relais_working.jpg" style="width: 100%;height: auto;"/>
<p class="caption">Done.</p>
</div>
Structured Environments in Reinforcement Learning2016-05-11T18:00:00+02:002016-05-11T18:00:00+02:00Dominiktag:smartmeyer.de,2016-05-11:/structured-environments-in-reinforcement-learning.html<p class="first last">In many machine learning tasks the structure of the problem plays a big role in the performance of the learning algorithm. Detecting and exploiting structure in such settings can be beneficial to the performance of learning algorithms. In this article I will give a few thoughts on structure and symmetries in reinforcement learning problems.</p>
<p>Well, upon writing this article, it ocurred to me, that the abstract of the article will very likely be shorter than the
article itself. That is due to the fact, that I summarized the thougts a while ago in form of a pdf document already. The
report be downloaded
<a class="reference external" href="https://smartmeyer.de/files/201605/documents/dominik_symmetries-and-structure-in-reinforcement-learning-problems.pdf">here</a>.</p>
<p>Later a student, Özlem, did look further in the problems of structure in reinforcement learning and conducted expereiments
within the game of tic-tac-toe. The results she acquired can be studied in her
<a class="reference external" href="https://smartmeyer.de/files/201605/documents/oezlem_investigation-structured-environments.pdf">project report</a>.</p>
Mini Laser2016-04-19T17:41:00+02:002016-04-19T17:41:00+02:00Dominiktag:smartmeyer.de,2016-04-19:/mini-laser.html<p class="first last">In this article the build of a mini laser engraver from old dvd burners is described.</p>
<p>I built a mini laser engraver. This article will describe how I did that.</p>
This Website2016-04-19T17:41:00+02:002016-04-25T19:12:00+02:00Dominiktag:smartmeyer.de,2016-04-19:/this-website.html<p class="first last">This website is generated by a static website generator, called pelican. This article sums up how that works.</p>
<p>I wanted to have a personal website. Common solutions, like for example a wordpress
blog were no option for me, since I didn't want to install any scripting language
on this server. All the complicated updating and monitoring of security mailinglists
is just too much of a hassle. Also I didn't want to rely on some commercial or ad-financed
company providing personal blog pages. So, whats the solution -- a static website.</p>
<p>Coding a fully static website with all the design and directly typesetting articles
in HTML is also no option. Luckly, others have similar problems and a wide range of solutions,
generating static websites using a theme and restructured source files, exist.</p>
<p>The first solution I had a look at was <a class="reference external" href="https://jaspervdj.be/hakyll/">Hakyll</a>. It is
implemented in Haskell and although I really like functional programming, having to
install a ~1GB development environment and packages was just too much of an overkill for
me. Also I wanted something easy to handle and lightweight. Python is installed on all
my machines anyways, so therefore I opted for the Python-based solution
<a class="reference external" href="http://blog.getpelican.com/">Pelican</a>.</p>
<p>To get started is pretty easy and straightforward. On a Debian-based system a simple</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> apt-get install pelican
</pre></div>
<p>does the trick. A simple boilerplate can be setup with</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> pelican-quickstart
</pre></div>
<p>What that also does is to setup a makefile to assist in developing and uploading the
final generated HTML files. Therefore, a simple</p>
<div class="highlight"><pre><span></span><span class="gp">$</span> make publish
<span class="gp">$</span> make rsync_upload
</pre></div>
<p>builds the page and uploads via <tt class="docutils literal">ssh+rsync</tt>. Well ... theoretically, after a few
very minor steps ...</p>
<p>At first, the default boilerplate has the same template set as for the Pelican
homepage. A little bit more personal touch would be nice. Therefore, let us create
a custom template.</p>
<p>Start by for example looking at a sample template on one of the numerous free
template sites, like for example <a class="reference external" href="http://www.styleshout.com/demo/?theme=keepitsimple">Keep It Simple</a>. Luckily the themes on that
page are licensed under the Creative Commons License and can be used and modified
to fit the own style. Just do not forget to give a link to the original theme
page, like stated in the license. What we have now is a big example HTML page showing
off all the fancy HTML5 and CSS features the designer thought up.</p>
<p>Start by chopping up the page into different sections. The most important is the
<tt class="docutils literal">base.html</tt> template. Here the structure of the basic page is set and the content
sections are included, depending on which type of page should be rendered. This
and all other templates can be obtained by taking the chopped up original template,
throwing out all javascript that is not needed and taking the header and footer
section together in this file. The page content will be inserted, where the
<tt class="docutils literal">{{page.content}}</tt> placeholder will be put. If that all is too much work, then
a premade template from the <a class="reference external" href="https://github.com/getpelican/pelican-themes">Pelican Github</a> repository can be chosen (as for example
the theme of this page is also available on my <a class="reference external" href="https://github.com/meyerd/pelican-keepitsimple">Github</a>). Just put
it in the <tt class="docutils literal">themes</tt> subdirectory and configure the name of the theme in the
main <tt class="docutils literal">pelicanconf.py</tt> file.</p>
<p>Content can be generated by putting one reStructured text file per page in the
content folder. If the corresponding configuration option is set, then each subdirectory
in the content folder will be a category and all the pages therein will be placed
in that subcategory.</p>