Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
|
Parsing JSON
I have expressed some interest in developing the interface with the Hatchery for the MCH2022 badge. The
plan is that a REST API will be
developed for the Hatchery. For this it will be needed to parse some
JSON. For this, I am looking
into some existing JSON parsing libraries. These are the libraries that I
looked into:
- cJSON: Ultralightweight JSON parser in ANSI C. I would not call it
ultralightweight, because it builds a tree structure when parsing the JSON.
But for processing JSON it is not neccessary to first build a generic
data structure and next process this structure. I think that in an
embedded system memory allocations should be avoided as much as possible.
The fact that it does not use a union in the definition of the nodes, does
not make it particular lightweight with respect to memory usage.
- JSMN jsmn (pronounced like
'jasmine') is a minimalistic JSON parser in C. It looks a little more
leightweight because it does not build up a structure, but instead fills
an array with tokens that point to the JSON input. It does thus not
allocate any memory when called, but you have to specify the number of
tokens before calling the function. That is nice when you for parsing JSON
messages with a known structures and a limited length. This too is a
library that parses the whole JSON in one go and requires you to process
the result.
- Frozen: JSON parser and emitter
for C/C++. It has a different approach. It has a SAX parser where you need to provide a call-back function.
Personally, I dislike SAX like parsers.
But beside this it also has some other methods to extract data from a
JSON string similar to the scanf function. It also has some functions to parse JSON arrays.
- Parson is a lightweight json
library written in C. Also uses some internal structure to represent the
JSON.
- tiny-json also parses
a JSON string into a tree. Also provides some methods to navigate that
structure.
- JSON-C: A JSON
implementation in C. It looks very complete, but not very lightweight.
- Jansson. Also looks very
complete, but again not very lightweight. In the load.c, I did find the lex_scan function, that
implements a lexical scanner for JSON.
I am thinking about developing my own JSON parser as an iterator, much like
the lex_scan function from Jansson, for processing data received from
the Hatchery. I think, I first want to study the code from performing an
HTTP request in the badge and/or storing the data in a local file system (for
caching).
Staggering Genius
I finished reading the book A Heartbreaking Work of Staggering Genius by Dave Eggers, which I
started reading on May 6 after I bought it on Friday,
April 29 second-hand. On the front of the book there is a round sticker
from Illini Union Bookstore with
the text '30% off' suggesting that the book was bought there. On May 8, I already wrote something about the book. At some point, I was
afraid that the author was just being funny for the sagke of being funny, but
the book also has some serious content. I found the book a bit long-winded here
and there, especially regarding the parts with internal dialogue. I searched
about some information about the Might magazin but did not find much.
With respect to implementing an app store for the the MCH2022 badge, have been studying the ESP HTTP Client and the example program . It works with a callback function that is called
whenever results are received. If the data is JSON and you immediately want
to process it, you need a JSON parser that can process chunks of data. If you
immediately want to process the parsed JSON, you could use some technique
like protothreads for C.
I started to write some example code.
KunstenLandschap
This afternoon, I biked around the route of KunstenLandschap 2022. I found the following works
worth mentioning:

Een oude stem van wind en zout
I also paid a visit to Rijksmuseum Twenthe,
which also made part of the event, where I saw the following works part of the
exhibition Collectie Wilploo:
- Wetmatige
Beweging (Zwart-Wit) (1965) by Peter Struycken.
- Buiten de oever (2002) by Elsbeth Cochius.
- Beukenbos (2006) by Elsbeth Cochius.
- The Embium Building in the Sky (2011) by Rik Smits.
- Recreatiegebied #9 (2003) by Renie Spoelstra.
- ZT (B03#12) (2019) by Ruri Matsumoto.
- Zonder titel (2011) by Abdalbagi Ainyal.
On the way home, I went to bookshop Broekhuis,
were at 17:02:39, I bought the book Henry & June written by
Anaïs Nin,
translated from the
English edition into Dutch by Margaretha Dorothea Ferguson, published
by Volkskrant Verboden Boeken in 2012,
ISBN:8710371001989, for € 6.95. At home I discovered that I already
at an edition of this book.
Books and cable
Around 11 o'clock, I got two books and a USB-cable in the mail. The books are:
The USB cable is to connect my Panasonic Lumix
DMC-TZ8 and download the date. Just like in 2018 the SD card has become stuck in the camera after a period where it
did not want to stay inside and I had to push it in during taking a photograph.
This was also after the cover for the SD card and the battery broke off. Since
some time the camera also has some wear on the LCD screen. But for the rest, it
is still working. This time, I thought it was beter not to try to repair the
SD card holder like I did before, but use the USB cable. It took me some time
to figure out which USB cable I needed.
Doublets
After I saw the exhibition Ergens in het
midden... again, I went to Concorodia, where I saw the exhibition
Doublet with murals by Petra
van Noort (who is from Rotterdam) and an installation by
Marleen Kappe (who is from
Amsterdam).
Drents Museum
Conny and I went to the Drenthe province. We first went to Drents Museum in Assen,
the capital of Drenthe. There we saw several exhibitions. The first exhibition we saw was Under the Spell of Mount Ararat.
Next, we saw the exhibition Sam Drukker, which consist mainly of self-portrait of the painter
Sam Drukker. I found the following
paintings noteworthy:
- Self-Portrait with Lobster, 2002
- Portrait, 2009
- In the Bath with Marat, 2005
- Without Title (Naked Self-Portrait), 2019
- Portrait with Green Collar, 2015
- Self-Portrait with Bare Shoulder, 2004
- Self-Portrait in front of Easel, 2010
- It is a Boy, 1996
- The Connoisseur, 2002
- Remembrance of Matthijs / After Matthijs Röling, 2003
- The Nose Picker, circa 2006
- Lying man, 2009
- Self-Portrait with Red Shirt, 2022
- The Potato-Eater, 1993
- Portrait 464, 2003
- The Teacher, 1993
- Self-Portrait with Paper Hat, 2006
Next we saw three works by Merlijne Marell:
- Dandelion and bumblebee, 2022
- River bullhead, 2022
- Stag-beetle, 2022
The last exhibition we saw, was Unlimited with self-portraits from the collection of the museum. I found
the following self-portraits noteworthy:
- Self-Portrait in Red Bathrobe, Barend Blankert, 2007
- Self-Portrait, Rsemin Hendriks, 2003
- Self-Portrait, Louis Albert Roessingh, 1832
- Self-Portrait, Alfred Hafkenscheid, 2014
- Self-Portrait with Paintbrush, Theo l'Herminez, 1990
- Self-Portrait, Thy Jansen, 2008
- Self-Portrait, Jan Mankes, date unknown
- Self-Portrait, Sinta Salter-Heddema, date unknown
- Soulmate, Tamara Müller, 2007
- Self-Shortened, Arout van Albada, 2008
- Self-Portrait, Jan Roëde, date unknown
- Self-Portrait, Georg Ruefer, date unknown
- Self-Portrait, Chris Lebean, circa 1933
- Self-Portrait, Hans Hoekstra, 2013
- Self-Portrait Naked Full-Length, Karel Bushes, 1995
- Self-Portrait, Herman Tulp, 1978
- Self-Portrait with Snorkel, Pieter Pander, 2004
- The Mole Catcher, Rinus van der Meer, 1984
- Videocalling with Background, Peter Hartwig, 2021
- Toilet, Tamara Müller, 2009
- Jealousies, Ilse Meijer, 1996
- Self-Portrait, Theo l'Herminez, 1996
- Monochrome Self-Portrait with Cap, Philips Akkerman, 2003
- Self-Portrait, Philips Akkerman, 2007
- Inferior with Painter and his Model, Matthijs Röling, 1970
- Self-Portrait with wife, Bart Peizel, 1918
- In-Between Self, Deborah Poynton, 2021
Afterwards, we went walking in Dwingelderveld National Park where we saw Dwingeloo Radio Observatory near the offices of ASTRON.
This morning, I finished reading the book
Nietzsche written by Paul van Tongeren, who recently has been granted the honorary title
'Thinker of the Fatherland'. I started reading the book on May 29. I bought
the book on November 27. The book is about
Friedrich
Nietzsche, his life as a philisopher and less about his personal life.
(The name of Lou Salomé is only mentioned twice in the book.) After finishing
the book, I felt that the life of Nietzsche has some resemblance with that
of Vincent van Gogh. I liked the book and I got the impression that it is a
good introduction to Nietzsche as a philosopher.
Truck Run 2022
Today, Andy and I joined the yearly Truck Run
organized by De
Tukker Truckers, just like we did four years
ago. The GPS-track of how we drove in KML file
for Google Earth.
AKI MUPI route 2022
I found AKI MUPI ROUTE 2022 and spend some time in Google Earth connecting the
locations in order to be able to calculate a shortest route to visit all the
MUPIs. Then I decided to write a program, ParseMUPIkml.cpp, to parse the KML file and generate input for
the TSP solver, I wrote last year.
32.1° Celsius
The temperature at Twenthe Airport has gone up to
32.1° Celsius, which breaks the previous record of 31.3° on this date
in 2016.
The past two evening, I spend finding a new optimal route. The first short
route did look a bit strange, crossing itself. When I added more connections,
the TSP solver kept on finding only longer
routes. This evening, I made some changes to the solver, which came down to
grouping all variants of the same length together and only keeping one. That
did result in an interesting route.
Visiting all MUPIs
This morning, I biked along all the MUPIs with a picture of a work of one of
the AKI graduates on the back. I had written the names of all the students on
a piece of paper and if I had not had this, I might have missed one of the
MUPIs. It took me two hours and fourty minutes to finish the trip, which was
about 26Km. I found the works of the following four students noteworthy:
Deventer murder trial
Today, the Dutch newspaper De Volkskrant reported about the report of the cold case team that looked
at the Deventer murder trial. Just recently,
the 2020 film The Judgement (Dutch: De veroordeling) was broadcast on Dutch TV, which
is based on a non-fiction book by journalist Bas Haan about the murder case.
The film focusses on the fact that Maurice de Hond in the media claimed that a handyman of the murdered
woman, Michaël de Jong, as being the murder without there being any
substantial proof and that by doing so, damaged him. According to the book and
the film, it was a case of trial by media. According to investigative journalist Bas Haan, the
report by the cold case team is not about new insights and new data. In a
sense this is true. However, it is remarkable that now a police team concludes
that exculpatory evidence for Louwes was withheld by the police and that
various disastrous mistakes were made during the investigation. It seems that
the report states that the two most important pieces of evidence on which the
conviction was based, do not hold. It states that it is indeed possible that
the cell phone of Ernst Louwes connected with the cell tower in Deventer over
a distance of 25Km, and that this fact can no longer be used to proof that he
was in Deventer during that time. In the withheld information a connection with
a cell tower more than three times the distance was mentioned. The report also
states that the evidence based on the presence of DNA is invalid, because the
blouse on which it was found, was not handled properly. Bas Haan states that
doubts about the reliability of the evidence was known to the judge who
convicted Ernst Louwes. The question is what would be the judgement of a judge
when presented with this case now. It seems that the public opinion now is that
Ernst Louwes is the perpetrator and that Maurice de Hond is wrong.
Home
| May 2022
| July 2022