I need help

One of the defining qualities of a good developer, in my opinion, is to know when to ask for help. And I’ve been battling this issue for way to longer than I should have. But since this is a solo open source project, it is a bit of special circumstance, normally I would have asked a colleague to have a look with me ages ago. Anyhow, if any Java developer with a Tesla wants to help out, that would be highly appreciated!

(more…)

Continue ReadingI need help

Covid-19 vaccination – yes, it’s a free choice, but…

I have been getting a lot of “free choice” stories in my stream the last weeks. High moral talk about why people did not get vaccinated against Covid, and about respecting choices. It is really starting to annoy me. So in light of the other important right, free speech, I’m voicing my opinion about Covid vaccination and free choice.

(more…)

Continue ReadingCovid-19 vaccination – yes, it’s a free choice, but…

Naming Docker container images

  • Post category:dockerJava

This is something I’ve needed to get off my chest; I really and truly don’t understand the logic behind the scheme of Docker container image names. The first time I tried to grasp it, I got mentally stuck, because it feels to me it blatant ignores any convention. At the moment it is a matter of accepting that this it how it works, but my neurotic side keeps protesting every time I tag an image. Let me explain the beef I have, and then maybe someone can enlighten me.

(N.B. I’m using “docker” in this post, but I actually am using “podman”. But their APIs are identical, so because docker is better known, I’m typing “docker” in this post.)

When you create a new image using the “docker build” command, the newly created image is uniquely identified by a hash, something in the line of 21df6af2a82e0135661ce18a621112450992914e1fcfc0edb285c332318e3e23. This id is totally impossible to convey to other people, so Docker has the possibility to add tags to images. A typical build command looks like

$ docker build --tag my-tag .

This is will use the Dockerfile (Containerfile for podman) to generate an image and add it to the local registry. You can see this by executing a list command:

$ docker images

REPOSITORY        TAG             IMAGE ID      CREATED         SIZE
localhost/my-tag  latest          99bd5445f871  22 minutes ago  280 MB

Wait! What? What is the localhost doing there? And latest?

(more…)

Continue ReadingNaming Docker container images

The default verb

  • Post category:JavaOOP

Naming things in coding is always something of great debate, and important to give appropriate consideration, because it greatly influences readability. And readability -as we all know- is the second most important aspect of source code, the most important one being that it should work of course 🙂

There are competing naming styles; camelcase starting with or without a capital, underscores, all caps, etc. But I do not want to get into that, to each his own. Or her own. Personally I prefer the Java style, with the difference in naming between classes (CamelCase) and methods (camelCase), so I’m going to use that for the examples here.

What I would like to talk about is the concept of a “default verb”. As a rule of thumb class names are nouns; they’re a Factory, or a Singleton, or Person. And methods perform actions on classes, so their name should start with a verb; getName, createInstance, build, walk, …, they do something.

(more…)

Continue ReadingThe default verb

The YAML threshold

  • Post category:JavaXMLYAML

I’m not using YAML a lot. If I need an easy-to-read configuration file, I’m using TECL, but usually XML serves me fine. It is a one-stop-shop for a lot of stuff; anything not code usually can be done nicely with XML. And its verbosity is not really a problem with the current bandwidths, unless you need to send a lot of data. And it is easy enough to read for a human.

(more…)

Continue ReadingThe YAML threshold

Time travel 101

  • Post category:icalJava

Suppose you take 2:30 AM at some random day in the year, and add 366 times one day to it, when do you end up? Yes… 367 times if it’s a leap year, wise guys. But still, when do you end up?

Calendar cal = new GregorianCalendar(2020, 11-1, 1, 2, 30);
cal.setTimeZone(TimeZone.getTimeZone("Europe/Rome"));
ZonedDateTime zdt = ZonedDateTime.of(2020, 11, 1, 2, 30, 00, 00, ZoneId.of("Europe/Rome"));
for (int i = 0; i < 366; i++) {
	System.out.println(cal.toInstant() + "   " + zdt);
			
	cal.add(Calendar.DATE, 1);
	zdt = zdt.plusDays(1);
}

Take a guess before reading on!

(more…)

Continue ReadingTime travel 101

The correcting case of the closed-off cloud

That title sounds like one from a boy’s book, a Tintin (Kuifje) or Spike and Suzy (Suske en Wiske) comic, but this blog is about Tesla, cloud computing, and hexagons.

In the middle of September 2020 Tesla suddenly blocked all network traffic originating from any of the major cloud providers, like Amazon, Google and Microsoft. A number of of third party Tesla apps were suddenly in big problems because of this, including my TeslaTasks. A lot of developers had to scram to work around that unexpected situation.

(more…)

Continue ReadingThe correcting case of the closed-off cloud

TECL

People have complaints about configuration languages all the time; properties are too simple, XML is too verbose, JSON doesn’t allow comments, YAML is only suited for small configuration files, TOML’s tables are a bit weird (IMHO). So how about we throw all the good aspects onto a heap and see what comes out of it? And with only one task in mind: configuration. (Just like JSON is intended for datatransfer, hence it does not support comments.) Therefor I’m introducing TECL, the Totally Encompassing Configuration Language. But the name is open for suggestions. 😀

The goals are:

  • Simple, like properties, but supporting a hierarchy
  • Compact, like JSON, but allowing comments
  • Formal hierarchy, unlike YAML’s indentation based one
  • Schema support
  • Conditions
  • Multi line strings
  • Tables
(more…)

Continue ReadingTECL

Corona: Netherlands vs Italy

There is a lot of fuss about the Netherlands blocking aid to Italy. To prevent any misunderstanding (especially by my non Dutch readers), I’ve written this small explanation. And I’ll be using the words “sneaky bastard”. 😀

After the banking crisis in 2008 the Dutch national debt grew to 68% of our GDP, well past the maximum of 60% required by the EU. As a result we started to reduce expenses, and in 2019 our debt was below 50%.

In the same period Italy’s debt grew as well, but they never reduced their expenses. So it kept on growing to 138% in 2019. They were addressed on this by the member states of the EU, but the populist government gave the EU the big finger.

(more…)

Continue ReadingCorona: Netherlands vs Italy

Corona – devilish dilemmas

This blog is just based on my own opinion, as a software engineer I do not have the qualifications to have a professional one.

The situation

Corona has arrived. The world has dodged the bullet with SARS and MERS, but the third time seems to be the charm, and a pandemic is rolling around the globe as I type this. Corona isn’t like the zombie virus from the movies, it’s closer to a standard influenza flue, except that the human world population has never encountered it before and thus no one has any immunity. The infection rate is higher than that of influenza.

Let’s examine some rough numbers, they don’t need to be exact for the point I want to make. Experts seem to agree that 60-70% of all people will get the corona virus. Given a country like the Netherlands with just over 17 million people, that will mean around 11 million people. About 80% of those will only get mild or moderate symptoms, which can go away in 3 days, but can also last up to two weeks. In any case no hospital care is required. It’s the remaining 20% that is the cause for alarm, because those need medical care. And with 11 million infected people, that would mean over 2 million people will be in the hospital. But our country only has 37.000 hospital beds. Total.

Now, those two million people will not become sick all at the same time, but assuming the severe cases are sick for two weeks, than we have 4 million hospitalbed-weeks to handle. This means that given the current capacity, we need 108 weeks worth of these 37.000 beds. Or in other words: we need to spread out the sick people over more than two years. And that is at 100% hospital capacity; there is no room for anything else in the mean time; no accidents, no cancer, no nothing.

Okay… So that is not going to work out. At all.

(more…)

Continue ReadingCorona – devilish dilemmas