Posts about Computer (old posts, page 14)

I had my first computer with 5 and started C programming when I was 13. Then I made some simple websites using PHP which grew into ever more complex ones. In 2007, I created some Java applications, some of them are still among the portfolio on this page. While I was an intern at the DLR, I started to learn Python and IDL, which introduced me to matrix based languages. For the numerical methods lecture and especially my bachelor’s thesis I used C++11. During my master’s thesis I have learned Haskell for fun. Later on for my PhD thesis I also learned R and the Wolfram Language.

This section of my site is for articles about programming practices and performance tests. Also various stuff about computer hardware and software.

Cloud Backup for Linux

I routinely do backups on external hard drives using backintime. It is a tool which uses hard links to create snapshots with deduplication. Restoring is super easy, either use the tool or copy files manually. The directory hierarchy had a directory with time as filename and your whole directory tree below that.

As I only do these backups every couple of weeks, there is a gap of time during which I could lose data. Also on the go I want to have backups. My PhD thesis draft is in a private GitHub repository, so I can just push to that and have a backup in the Microsoft cloud somewhere. For everything else I need something else, so I started researching this a couple years ago. Backblaze offers a software client and unlimited cloud space for 5 USD/month, but just for Windows and macOS.

The SpiderOak service was recommended by Edward Snowden, so i tried that. It works with Linux and has encryption already on my laptop. I just needed around 150 GB of space, they used to charge 10 USD/month for that tier. Their client looks nice to use and I quickly had set it up with the free trial. It took a while before it actually started to upload things. And it seemed to use quite a bit of resources, I guess for encryption and file hashing.

My friend Simon, who had the same problem, discovered that one could also use duplicity with the Backblaze B2 storage backend. Their rates are really affordable and so I had a look at that. One can store unlimited data there and is billed proportional to the amount. I ended up paying a few EUR/month for the service, so it was cheaper than SpiderOak.

I want to show how I did it with duplicity and why I am now back with SpiderOak.

Read more…

Bash and Spaces in File Names

On LinkedIn one can specify skills that one has as a collection of keywords. Contacts can verify these skills by vouching that one has them. A recently added feature is that one can take a 15 question multiple choice test and show a badge if the test result lies in the 0.7 quantile or above. In principle a nice idea.

The tests for C++, Python, R and Git seemed sensible, The one about Bash was rather well for the most part, except for one question:

In order to write a script that iterates through the files in a directory, which of the following could you use?

  1. for $ls; do …; done
  2. for $(ls); do …; done
  3. for i in $(ls); do …; done
  4. for i in $ls; do …; done

Well, the third one will get the job done under a lot of dangerous assumption from the programmer, so it likely is the “correct” answer. But is is terribly brittle and I would never accept that in any code that I review. Let's take a look at this and make it fail.

Read more…

Learning New Programming Languages

Over the time I have learned a lot of programming languages. DOS batch scripts was the first, but that is not really programming, more scripting. Later I started to learn C but got stuck at pointers. At that age I just did not understand this concept from the book I had. My father has showed me HTML and then PHP, I started to create my personal website with that. And then with PHP I was able to program things that other people could see and try out on my website. Then I wanted to write GUI applications and came to Java, programmed a bunch of little games with that. During my high school I also needed to learn Pascal for my computer science class but never gotten far with it.

During my work at DLR I started to learn Python and used it for data analysis. Then at university I attended a course in C given by two very funny mathematicians. This gave me a completely fresh start into C and I shortly after wandered off into the C++ world and still really like it there. I used GNU Octave (the free clone of MATLAB) for my lab courses first and then switched to Python for that task. I picked up Bash scripts somewhere along the way, did some scripting in Vim. Eventually for my master thesis I could do even more C++.

And then during the PhD I seemed to have picked up another trove of languages. My advisor has an R library to analyze the data that we see in that field. PhD students have tried to rewrite it in Python which they liked better, but it just lacked features and maturity. It turned out that learning R was really straightforward at this stage. It just took me a few weeks to get going in the language and after a few months I had the impression to really feel the language. I also picked up Haskell for fun and the Wolfram Language for a specific task.

But why am I writing all this? The interesting thing here are the decreasing costs of learning a new programming language. Just as with spoken languages, the programming languages fall into categories. The very first language you learn will be tough because you will have to learn that particular language but also programming and also patterns. The second language will be easier as you already know how programming works. But you might not have seen enough diversity to abstract the patterns that are there. So the second language will be about that language and abstracting patterns. Just as I learned a lot about German grammar while learning English and having to formalize the concept of grammar.

Read more…

Log Analysis with GoAccess

Several years ago I used Matomo to analyze the traffic that I have on my website. This is a PHP application that uses either JavaScript or a pixel image to track the user's action on the website. It gave me a list of the most popular pages and also told me how people got to the “page not found” page. I could go ahead and improve already popular articles and fix redirections.

There have been somewhat frequent updates to Matomo which I had to install due to security. I did not want to have unpatched PHP stuff on my web server. My website has been static and zero maintenance at that time, so I got annoyed. At tomes I updated Matomo more often than I actually looked at the data. Then came the GDPR and I ditched Matomo because I was not entirely sure what sort of privacy statement I would need on my personal website.

This left a gap and I have thought about filling it. I wanted something that did not require me to update stuff on the server regularly. So I thought about Google Analytics as I would just have to add their little bit of tracking JavaScript. But then all the data would go to Google and it would be even worse than Matomo regarding the GDPR. My web hoster provides logs processed with Webalizer, which look terribly old fashioned. Luckily I have found GoAccess and can download the logs via FTP.

Read more…

Sphinx to Nikola

As you can likely tell, my website looks different now. For a very long time I have been using Sphinx with a custom theme for my personal website. It has served me rather well, but over the time I have been pushing it into ways that are not really how it is designed. Foremost it is a documentation generator. As such it has a hierarchical structure and does not support blog posts or RSS feeds. Some of my content is “timeless” like the study material, but other things slowly outdate and would rather fit into a blog structure. There are extensions to Sphinx that try to add these features, but I rather decided to move it to Nikola instead.

In this post I will describe how I have made the transition and what was needed to get the content moved over.

There is a nice overview of static website generators that lists many static site generators. There are many to choose, but I want to stick with one that is fairly popular and won't have it's support dropped soon. Also it should be mature, I want to keep going with it for a while into the future. In the past I already looked at Pelican and Tinkerer but found them rather cumbersome. And I have looked at Nikola in the past already. What put me off was that it only had two levels of hierarchy for the pages. This seemed to be very limiting at the time, but now I see it much more relaxed and just moved.

I am looking forward to now have it easier to write blog posts and have a better suited tool for that task such that I can concentrate solely on writing the content.

Read more…

Catch-All E-mail Addresses

Most people have an e-mail address like firstname.lastname@provider.example where provider.example is an e-mail provider. They have only this one e-mail address and give it to every service where they sign up.

I use my domain, and I can have virtually unlimited e-mail addresses on it. For a while now I had been using the concept of service e-mail addresses. So when I created an account for buying from the renowned widget store store.example, I would give them as my e-mail address.

Read more…

Logistics of Computer and Board Games

There is a vast array of computer games available. There are single player games without a campaign (Tetris, Mine Sweeper) that you can just play without preparation. Then there are games with a story (The Witcher, Mass Effect, Bioshock). These solitary games are not the scope of the articles. Rather I am concerned with multiplayer games. And there are the kind of cooperative games (Saint's Row, Borderlands, Diablo) and the competitive games (MechWarrior Online, World of Warships).

The multiplayer games can be played on the same computer either via split screen (Need for Speed 3), shared screen (Little Fighter 2) or taking turns with a hot seat (Worms). Other games require a computer for each person and can then be played over the internet or local network (Splinter Cell Blacklist, Borderlands). With these types every player needs to have a license for the game.

The time of split screen games was when laptops were super expensive, only few people had desktop computers and internet access was not available everywhere. Playing with multiple people on the same computer was quite normal. And consoles had the same user experience with up to four players in a lot of games. Even people without computer game experience could just join for a session at no extra onboarding cost.

Read more…

How should I buy my books?

These days one can get a lot of books electronically. I am still not sure whether I prefer books in paper or electronic form. It seems that in principle I prefer electronic books, but the way that one can actually buy them is against my preferences. This is is the crucial distinction that will lead to a conclusion.

Electronic vs. paper

Let us first discuss how electronic books relate to paper books. I will go through the various things that came to my mind.

First of all, electronic books do not require physical space. That means that I can have all of them on my laptop or reader. Additionally I could also have them on my phone if I wanted to. This is great, and I can also go through as many books as I want without them cluttering up my flat.

Read more…

Attaching a Display

Personally and professionally I have seen my fair share of display connectors. At this point it has a Kafkaesque complexity. At the theory department we have computers ranging from around 2006 to current ones. This means that we also have all kinds of display connectors on the workstations and tablets:

  • DisplayPort, VGA
  • VGA
  • DVI-I
  • DMS-59
  • DisplayPort, HDMI, VGA
  • DisplayPort, HDMI
  • Mini-DisplayPort
  • Mini-DisplayPort, VGA
  • DisplayPort, VGA
  • Mini-HDMI
  • Micro-USB

Read more…

Emoji Keyboards

These days I include a lot of emojis in my chat messages. Back in the day one would write stuff like :-D or include some little pixel graphic, but now we just have unicode symbols for this: 😃. Since these symbols are not on a regular keyboard (except perhaps for laptops with touchscreen bars above the keyboard), one needs to enter them somehow different. And this is where it starts to become really inconsistent.

When editing text with different word processors and text editors, you will find that they all have their own spell check dictionary. You start adding words in Vim and when you copy parts of it into an email with Thunderbird, the spell check will not know about your new added words. This makes spell check less useful. On Android your user dictionary is system wide, but that does not help me on the laptop.

Read more…