Posts

  • Implementing x² in C++

    Many equations require to compute the square of some quantity x. Unfortunately, C++ does not provide an operator for exponentiation like Julia or Fortran. One can rely on two solutions:

  • A tutorial about parametric constructors in Julia (2/2)

  • A tutorial about parametric constructors in Julia (1/2)

  • How to write your curriculum — Student's edition

    I have been part of several selection committees for postdoctoral positions and other jobs related to academia, and one thing that I have consistently seen with amazement is the low quality of the curriculum vitae (CVs) the candidates submitted. By “low quality”, I do not mean that they were not fit for the job. Rather, the applicant seriously underestimated their actual achievements; they even forgot to put something totally relevant for the job!

  • Retroprogramming with Borland Turbo C++ 3.0

    Since a few years I am a teacher assistant in a C++ class for second-year students at the department of physics of the Università degli Studi di Milano. It is a mandatory class where students learn how to use C++ and Object-Oriented Programming to solve numerical problems like root finding, integration, and differential equation solving. The teacher does not force people to use specific tools, but most of the students rely on G++ and Visual Studio Code to write their code. (It is mandatory that students use GNU Make to write their code, as the teacher believes that this is more instructive than learning higher-level tools like CMake.) The usage of Visual Studio Code is a big step forward, as in the pre-COVID era they all used Gedit, as VSCode was not available in the computers in the lab!

  • Morley's triangles

    A few days ago I recalled an old article I read many years ago about “Morley’s triangles”. It is a geometrical property of triangles found by Frank Morley (1860–1937): if you trisect each of the three inner angles and intersect the lines, you will get an inner triangle that is always equilateral. You can find more information and proofs in the Wikipedia page and on MathWorld. I remember that the article I read many years ago tried to explain why such a simple result was not discovered by Greek mathematicians, since a large part of Euclid’s Elements covers their properties. The most likely reason is that ancient Greeks didn’t like the idea of “trisecting” an angle, as it cannot be done with a ruler and a compass.

  • xdotool!

    In my first post on this new platform, I want to tell you how I use xdotool, a command-line program to simulate mouse actions and keypresses.

subscribe via RSS