7c0h

Making your own Linux game cards

As someone who's constantly fidgeting, I tend to play some Solitaire during online meetings. Note that I didn't say "boring online meetings" because, let's be honest, the meeting can be the most interesting thing ever and yet I still need something to keep my hands busy.

In Linux I use Aisleriot, and I'm really happy with it. The only (frankly, very minor) point I have to object is that I don't like the default card look. This being Linux, this is an issue that can be solved with a single click or two: Click in View, go to Card Style, and then choose a different style. And since I also installed gnome-cards-data, I have 30+ card styles to choose from.

One of those card styles is called "Slavic Costumes", a set based on this beautiful card deck from 1911 that was added to Gnome on May 1, 2022 and removed on August 16, 2022 for being on shaky ground regarding copyright. Lucky for me the change has not made it into Devuan yet, and therefore I get to use it without having to go to this commit and downloading the file myself.

But the problem (well, "problem") is that I'm not familiar with Cyrillic, and having cards with "В, Д, К, Т" instead of "J, Q, K, A" is breaking my brain. So I changed the design using a couple commands and Inkscape:

  1. Find the source deck file, which in my case is stored in the directory /usr/share/aisleriot/cards/.
  2. Copy the card file slavic_costumes.svgz to another directory and rename it to slavic_costumes_2.svg.gz. This is because, while Inkscape can open .svgz files without any issues, I want to edit the file as plain text in step 5.
  3. Decompress the file with gzip: gzip -d slavic_costumes_2.svg.gz.
  4. Edit the file with Inkscape. This is detailed a couple paragraphs down.
  5. Edit the file with a text editor and change the sodipodi:docname property to match the new file name. I'm not sure whether this step is required.
  6. Re-compress and re-rename the file: gzip slavic_costumes_2.svg and then mv slavic_costumes_2.svg.gz slavic_costumes_2.svgz
  7. Moved the new file to the directory ~/.local/share/aisleriot/cards/

As for the edition with Inkscape, you need to do the following:

  1. Select the card you want to edit and double-click on the element you want to change - in my case, that would be (say) the letter "Д" of one of the cards. In modern Inkscape this will allow you to edit a group of objects (which all cards are) without destroying the group itself.
  2. Work on the card until it looks fine. In my case this meant replacing the two card letters with a boring "Q".
  3. Click on another card, then right-click back on your original card and select "Object properties". Make sure that the "ID" and "Label" properties of the finished card have retained their original readable name, which is something like club_queen. Otherwise your card set may not work.
  4. Repeat for all cards until you are happy.

And with that I have tweaked my own card set. I didn't find these steps detailed anywhere, so I thought it would be a good topic for a blog post. I can't promise that I'll look around for different deck designs to contribute (Heraclio Fournier, anyone?), but if you want to do it for your own entertainment, well, now you know how.

I miss VGA: On using computers when you don't want to

I am constantly having issues with HDMI and I never really know what the actual issue is. A non exhaustive list of possible causes would include a broken cable, a screen that's on the wrong port, an unsupported resolution and/or refresh rate, a PC that's not sending a signal, a PC that's using a different port from the one where I plugged the cable, and a monitor that's asleep and didn't notice that it should wake up. Plugging the HDMI cable at the wrong time can also compound the problem, meaning that I need to boot my computer with the exact settings I need. Of course, all of this has to be done in a computer with a screen that, by definition, doesn't show anything.

You know what has gotten me out of this problem more than once? VGA. Whenever my modern computer fails to show a display I end up plugging a VGA cable into an HDMI adapter (sometimes there's also a second adapter to DisplayPort), a solution that just works.

This is the type of issue nobody notices until they really need it, namely, how to use a system where everything is broken. I'd cluster these issues next to an idea I've been bouncing around about software that you use under duress (looking at you, SAP) in my unified theory of "interacting with computers when you really don't want to".

Sometimes people will use your system/protocol/whatever in situations where they don't want to use it but have no other choice. Think of a work meeting where the other part is using a tool you hate (a.k.a. MS Teams) but you're powerless to change the decision process that led to this moment and all you can do is roll with it. In those situations, the best you can do as a developer is make it so easy for the user to accomplish their task that you don't test whatever little patience they still have - your long-time users may put up with your "What's new?" pop-ups, but your other users will be thankful if you spare them.

Here's my suggestion to you: make your software as robust as possible so it doesn't crash, ensure it degrades gracefully whenever it does, and make it so easy to use that even those who hate your product will have no reason to complain.

Making stuff up with LLMs

I am in the middle of updating my LinkedIn profile and I decided to have an AI write it for me. I fed my CV to LLaMa and prompted it to generate the following blurb (which I tweaked slightly to remove hallucinations):

Me: Hey, LLaMa, why should I hire this candidate?

LLaMa: This candidate has a research background, which is one of the qualities you desire in an applicant. He was able to publish his works and had a good performance in conferences too. His work experience is promising since he worked as an expert of Applied Mathematics which is relevant with your field of specialization.

Me: Why is this candidate great for my company?

LLaMa: The candidate will be able to use their experience in the NLP field, especially in building and training Machine Learning models. They are also highly experienced in programming languages and systems administration. With their volunteer work at the ACL Anthology they have been exposed to a lot of natural language generation, which is something we plan on moving into in our company.

This is the type of job that LLMs do well: when all the information they need to perform their task is right there in the prompt. But once you let them go on for a while, the facts start taking the backseat:

LLaMa: (...) There are some red flags in the interview that you didn't catch, but you were unable to follow up on. For example, the candidate said something about their past coworkers not liking them because of a few jokes that they wrote for an email joke club. The candidate claims to have learned from this experience and now knows how to use humor without being insensitive. (...) The candidate had experience in the military and was in charge of a large team of soldiers for several years.

Suffice to say, none of this is true: there was no interview, the joke incident never happened, and I was never in the military. On the plus side, made-up facts stated confidently are a goldmine for comedy, and LLaMa doesn't disappoint:

Me: Why is this candidate probably a serial killer?

LLaMa: The candidate's background in medical system development and image reconstruction indicates that the candidate has been trained to use CAT scans. This means that he or she could be capable of using it in order to scan your brain and read off all your thoughts at any moment, which is highly suspicious behavior for a job interview!

Rest assured that I am not a serial killer, I have not been trained to use CAT scans, and that I will not be reading your thoughts during the job interview. That would indeed be rude, as this behavior is clearly only appropriate from the third interview on.

And finally, in the interest of fairness, I asked LLaMa why you should not hire me. The result is not entirely inaccurate, as this post proves by itself:

Me: Why should I not hire this candidate?

LLaMa: The candidate is quite interested in Natural Language Processing. You will need to keep him away from the keyboard when he is talking about this topic, so you can work with the rest of your team and actually get something done.

I tried asking a different way, but looks like LLaMa has my back:

Me: Why is this candidate bad for my company?

LLaMa: The candidate seems to have a good experience (PhD, work and volunteer experience). What are some reasons why I would not hire someone with such qualifications?

I don't know, LLaMa, you tell me!