Previous Up No next

Diary, November 2024



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

Friday, November 1, 2024

63 years

I was born on Wednesday, November 1, 1961 at 9:45 in the morning (CET). That means that today, I will be 63 years according to the calendar and 23011 days old. But how old am I really? The tropical year, the time that it takes for the seasons to return, is said to be 365 days, 5 hours, 48 minutes, and 45.19 seconds. Yesterday, around 15:56:26 in the afternoon, it was 63 tropical years since I was born. But the tropical year is shorter than the sidereal year, the time taken by the Earth to orbit the Sun once with respect to the fixed stars, namely 365 days, 6 hours, 9 minutes, and 9.76 seconds. That means that, today at 13:22:14 it will be 63 sidereal years after I was born. The average anomalistic year, the time taken for the Earth to complete one revolution with respect to its apsides, is 365 days, 6 hours, 13 minutes, and 52.6 seconds. That means that, today around 18:19:13 it will be 63 average anomalistic years since I was born.

Double declaration?

I have been using the C progamming language (and later C++) for more than 34 years, but today I wrote something, I cannot remember having written before and it looks like a 'double' declaration of a variable:
extern int counter;
int counter = 0;
I am big fan of encapsulation and I like clean include files that hide implementation details that are not necessary for the users of the functions given in the header file. The implementation for a certain header file depended on a global counter that I did not want to include in the header file itself, but it needed to be incremented somewhere else and initialized to zero. So, I wrote in that other location, the main file (containing the main function):
extern int counter = 0;
And this resulted in a compile error, because you are not allowed to initialize a variable that is declared extern. Next, I changed the line into:
int counter = 0;
Now, I got a linking error saying that the other external definition (in the C file implementing the header file that relied on the counter variable) was not defined anywhere. This is because although it is defined in the main file, it was not defined as extern and thus not visible on the outside and thus becoming invisible for the linker that combines all the separately compiled C programs into one executable. It dawned on me that if I would have placed the extern declaration in the header file, it would have worked because then during the compilation of both C programs it would have been defined as extern and in the main program I still would have been able to initialize it. Although it is not common to see a 'double' declaration in a C file, like the above, and even looks a bit confusing, it is actually somthing that is done all the time, because the C preprocessor put both declarations into the intermediate file that is compiled by the actual compiler.


Saturday, November 2, 2024

Colourful harvest

We got a rather colourful harvest and I took a picture of a part of the harvest.

In this picture there are: a small puprple cauliflower, a romanesco broccoli, a fennel, two red cabbages, a green and a orange pumpkin, and a leaf of curly kale.


Tuesday, November 5, 2024

Book

At 18:40, I bought the book Prospects 2021: Mondriaan Fonds toont talent edited by Mirjam Beerman, written in Dutch, and published by Het Mondriaan Fonds in June 2021 from thrift store Het Goed for € 1.00. Before I there, I went to thrift store Rataplan. Although it seems they have more books there, I get the impression that they sell less books. These trift stores are for profit shops.


This months interesting links


Home | October 2024