V mask

Coding styles of our kids

I have been teaching a bit of C-coding to our kids (K, 10 years and J, 9 years). They have made a couple of small exercise programs and now I looked their coding style to see if it reveals anything about how things are going.

J's code is very tight packed, everything clutched together, with minimal number of empty lines and other whitespaces in it. Reading the code you can sense how he has been a bit uncomfortable writing it - he feels this still to be a bit too hard for him. I need to make things easier for him.

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
  if (argc !=2) {
    printf("Anna ohjelmalle nimesi komentorivillä.\n");
    return EXIT_FAILURE;
  printf(" hauska tavata %s .\n", argv[1]);
  return EXIT_SUCCESS;

When K has faintest clue about what some part of the code does, she tends to experiment with it. Her coding ends aesthetically a bit weird, and maybe a bit confused where she has not been paying attention. I've been two minds about if I should force her to follow more pedantic style as she is only learning things and the style I prefer is there to make things clearer and easier to learn. I've ended letting her to enjoy her experiments. She'll learn the best practices in due time and now it's important not to kill her joy. It's also interesting how she lets the history of the code show through. In below example block of handling ages above 150 is the latest addition to the program, and it shows.

#include <stdio.h>
#include <stdlib.h>

int main(int argc,char *argv[])

  int ika;
  int seuraava;

  if (argc != 2) {

    printf("anna ohjelmalle ikäsi komentorivillä.\n");
    return EXIT_FAILURE;

    ika = atoi(argv[1]);

    if  (ika < 0) {

    return EXIT_FAILURE;
    if (ika > 150) {
      printf("et voi olla niin vanha.\n");
      return EXIT_FAILURE; }

    seuraava = ika + 1;

    printf("nyt olet %d.\n", ika);

    printf("seuraavaksi täytät %d.\n", seuraava);

    return EXIT_SUCCESS;

V mask

Freeciv 25 years, November 14th 2020

Today, November 14th 2015 Freeciv project celebrated its 20th birthday. We had a great interview from the original founders of the project, but given the other news of the day I didn't felt like making big headlines of our celebration, as if it would have been what matters most today.

So, I didn't write post about Freeciv's 20th birthday. I hope to write one when Freeciv reach age of quarter century, and I hope it will include something like this:
"Freeciv is a game about civilization. It's a game about war, peace, diplomacy, culture, trade, technological advancement, and many other aspects of a civilization. While it's only a game, and not something one should consider to model real world in any way accurately, it has been interesting to compare our rules to the reality that has played out since November 14th 2015 terrorist attacks to Paris, better know as the day of shameful defeat of terrorism as a strategy. By the means of terrorist attack, they tried to reach their goal of spreading fear to Europe, to fuel our internal conflicts to give space for their own influence to grow, to turn us away from Democratic values toward the apparent security of stricter forms of government. As we now know, they failed miserably. They managed to do their attacks, their means of terrorism, but they did not reach their goal. We didn't hand them what they were after. Europe, and the World, felt sorrow for the victims. We felt terrible, but we didn't give in. We didn't give terror to get hold of us. We refused to get manipulated by the fear."

I hope that in the future we can honestly speak of "Failed terrorist attack of November 14th". Let's make it so.
V mask

(no subject)

Software development Jargon of course includes all the stuff related to SW techniques, tools, concepts, but there's probably even more project-specific jargon in any project. Names of the components being implemented, project milestones, abstraction concepts, tasks (yes, there are "jobs" that exist within one project only) etc. all contribute to the project jargon.

I'm now talking about neither of those jargon types, but about the more humorous results of the heavy abstraction.

Every modern SW has layers after layers of abstractions. Someone implementing user interface is not directly telling which kind of signal should be sent to the monitor, but (s)he considers everything as widgets (buttons, input fields, text labels). There can be dozens of SW layers transforming one abstraction to another until the "text label" turned to "text at specific window" turned to "text at specific location on screen" turned to "font definition" turned to "specific font" turned to "image" ... appears on screen, or abstraction of that (some layers abstracted away the difference between RGB monitor and Braille reader anyway) Of course nothing is as straightforward as that example but abstractions form complicated web.

There's two specific recursive concepts continuosly making misuderstanding things a bit too likely.

First thing is enable/disable functionality. When that goes to layer after layer we have to talk about things like "enabling disabling of option to disable the ..." (actual quote -> "option to disable the" means UI option to turn of an feature, but which we wanted sometimes not to give to the user (thus "disabling" from the UI), but only in specific cases (where 'enabling'))
Yes, there's a risk of confusion and mistakes when a tired persons play around with the "disabling enabling of option to disable.." vs "enabling disabling of option to disable..." and their fundamental differences.

Second one is 'default'. I use freeciv's datafile search mechanism as an example.
User can set FREECIV_DATA_PATH to point to the data file locations. If not given, the freeciv wrapper script defaults to constructing it itself. If wrapper script is not used, freeciv installation uses its internal default. This default can be given when freeciv is built, defaulting to value constructed automatically. The automatically constructed value depends on environment, but in most cases it uses the default from freeciv source code. Value in source code is either dynamically constructed, or failing that defaults to value of deprecated FREECIV_PATH. If FREECIV_PATH is not defined either, it uses the hardcoded default. In theory the hardcoded value depends on the source code copy in question, but one in master copy is the default. Of course, this is only freeciv project part of this. Downstream may add layers above this.
Anyway, ignoring the downstream projects part, default default default default default default default is
where PATH_SEPARATOR is ":" and DATASUBDIR freeciv version (defaulting to "dev") by default.
V mask

E-voting after Sandy

Checking my entry from 6:th of November 2012, I'm surprised to see how mildly I put my opinion about New Jersey establishing e-voting as an emergency measure:
"Maybe it's best of the terrible options, but it sure still is bad."
Well, it was possible that things would work out by luck, so I understand how I were cautious not to predict unavoidable disaster and to risk loss of credibility.

Now, two years later, here's report about it: RutgersLawHurricaneSandyReport.pdf Let's say they now make a bit stronger statements than I did in advance.
V mask

Evolution - the core idea

If someone says that "Evolution as an idea does not work", is it in any way possible that she or he has any idea what the idea/model of Evolution is? After all I've always succeeded in getting evolution based algorithms to work in development of any software where I've needed them.
So, to get to the fundamental basic idea of evolution, let's first cut it off from the complex context of development of life.

What in context of life is "reproducing", is in general terms "copying". Often it's about copying oneself, but "being copied by something else" fits the bill too. Organisms copy themselves, blocks of data in computer's memory can be copied, ideas spread from one person to another, business strategies spread from a company to other.
Then there's the "change". Organisms get mutations, information in the memory of the computer can be changed, ideas can be tweaked, as well as business strategies. This change makes the things being copied different from each other.

So, there are all these things being copied, slightly different from each other. The one that gets copied most efficiently, ends up with more copies than the others. The beneficial difference takes over, more so when this happens over several generations of copy operations.
Usually this is also an iterative process. New changes are regularly introduced to the system and if they are beneficial compared to the previous state, they take over.

As for development of life, any claim that Evolution theory does not make sense or is too complex simply is not true. No other explanation of life has ever become anywhere near to the Evolution theory in the simplicity of the idea. Can you really think about the sentence "The one that gets copied most efficiently, ends up with more copies than the others", and say that it makes no sense to you? By Occam's Razor it's the most probable explanation of life, but I have also much stronger evidence for Evolution theory than that. Since the basic idea of "The one that gets copied most efficiently, ends up with more copies than the others" certainly works under any normal conditions, what would be the mechanism preventing it happening on living organisms? Saying that living organisms develop (only) by some other mechanism than evolution, is a claim that there's both evolution inhibiting mechanism and the life developing mechanism in play.
V mask

IPv6 adoption 0.6%

IPv6 adoption now 0.6% according to ARS Article. Well, that's better than nothing, economical recession -> less need for new IP addresses probably eases the problem of running out of IPv4 addresse, and anyway we survive this one way or other (the way might be that there's a lot less Internet-connected devices than would be otherwise, but I think humanity can survive even that).

IPv4 Exhaustion Counter has following estimates, or days they actually run out of addresses, about remaining RIRs. I've earlier explained what this means.

AfriNIC: Africa: Aug 01, 2019
APNIC: South Asia and Australia: Apr 15, 2011
ARIN: US & Canada: Feb 27, 2015
LACNIC: South America: Jun 10, 2014
RIPE NCC: Europe, Middle-East, North Asia: Sep 14, 2012

To see changes in estimates since Apr 22, 2013, see post of that day. LACNIC has run out of addresses since then.
V mask

"the operation completed succesfully" - That sounds bad!

- ...and then it says "the operation completed succesfully." and then...
- Wait! Wait! It shouldn't say anything.

The "the operation completed succesfully" sounds like translation from numerical error value to English text. Now, it seems that there's no actual error value set, or the error value has been cleared, but the fact is that such an translation of the error value is printed only when there has been an error. The existence of the message "the operation completed succesfully" proves that there has been an error nevermind what the message actually says.
V mask

Drawing comics

I had nothing important to think today. So I thought of wheels of comic cars instead. You know, the car speeding so that the wheels turn oval. What I don't get is why they point backward. I assume the idea to be that speed is so high that shape of the car, or at least that of the wheel, changes. Other parts of the wheel are having hard time following the first moving ones. But what is that first moving part? The car is moved by the wheel, more precisely it's the part of the wheel touching ground dragging rest of it behind. So that oval shape should be drawn so that it's ground-touching part of the wheel that's going ahead of the rest. Unless the car is reversing.

So, I present you the right way to draw a car so it's obvious it's going forward (right) with a high speed.

You naturally already noticed that this was 4-wheel drive as both front and rear wheel are dragging the car along, instead of just hanging along. Here's rear-wheel drive:

(or was it front-wheel drive reversing?)

Writer is usually serious in some work related, or other official, matters. Comics are not his work.
V mask

Speaking as white male

The man, after checking his papers and computer several times: Yes, I can see your service order and confirmation here, but for some reason it has not been entered to our worklists for tomorrow.

Me, absent mindedly replying to that, irrelevant to me, information: Ok, I don't mind, as long as you get it serviced tomorrow.

He: Yes, of course.

Only later when reading the usual set of tweets complaining how life is harder to people who are not white men, it occurred to me that for somebody else it might had not been so clear that they won't try to make their mistake my problem. But also with a bit of wondering if in such a case my certainty that things will work like I want was also the reason they did. Maybe his answer would have been different if I had given him any space to push problem to me?
V mask

"Send me material to blackmail you, I will destroy it without reading"

Dear tech companies. It frustrates me that even when I have some trust in your respect of privacy, your own attempts to convince the public is often based on obviously (for people working on IT security, at least) false statements. Yes, it's much to ask people to trust your good will only, but if there's nothing preventing you from breaching the privacy, don't claim you cannot do it. Too often the formula of such statements is "We have such and such solution in place, that makes it impossible for us to..." Now, if you yourself have complete control of that prevention solution, including disabling it when ever convenient for you, how does it makes it impossible for you to breach the privacy? Not to mention that users have only your word that such an solution exist in the first place. If you ever have hold of the data in unencrypted form, don't claim you cannot read it.
For casual reader I should note that I'm not claiming there's no privacy anywhere. There exist solutions where the privacy breach prevention bit is not controlled by the company providing the service, usually in the form of giving them only encrypted data. Also, even these internal solutions provide a lot of security against unauthorized access of the data by personnel of the companies - any breach would be made by some of the select individuals or as a company, not by any cleaning lady.