Pages
Categories
Archives
- September 2025
- Juli 2025
- Juni 2025
- Mai 2025
- März 2025
- Januar 2025
- Dezember 2024
- November 2024
- Juli 2024
- Januar 2024
- Oktober 2023
- September 2023
- August 2023
- Juli 2023
- Juni 2023
- April 2023
- März 2023
- Januar 2023
- Dezember 2022
- November 2022
- August 2022
- Mai 2022
- April 2022
- Dezember 2021
- November 2021
- Oktober 2021
- August 2021
- Mai 2021
- Februar 2021
- Januar 2021
- Dezember 2020
- August 2020
- Juli 2020
- April 2020
- Dezember 2019
- März 2018
- September 2017
- Mai 2017
- April 2017
- März 2017
- November 2016
- Juni 2016
- Februar 2016
- Januar 2016
- Oktober 2015
- August 2015
- Juli 2015
- Juni 2015
- Februar 2015
- Januar 2015
- November 2014
- Oktober 2014
- Mai 2014
- April 2014
- März 2014
- Februar 2014
- Dezember 2013
- November 2013
- August 2012
- März 2012
- Dezember 2011
- August 2011
- Juli 2011
- Mai 2011
- Februar 2011
- Dezember 2010
- November 2010
- September 2010
The Internet Security Architecture
19. Januar 2023 in Society, Graphics, Multimedia.
Eine Bemerkung über das Funktionieren
16. Dezember 2022 in Society, Technology.
Nach einer Weile hört man immer mal wieder gewisse Sprüche über das Funktionieren irgendwelcher Produkte, Technologien, Techniken, Lösungswege, Praktiken oder Konfigurationen X:
- “Was funktioniert [also X], ist gut.”
- “X ist nicht schön, aber es funktioniert.”
- “Hauptsache, es [gemeint ist X] funktioniert.”
- “Wieso, es [X] funktioniert doch!”
- “Wir wissen zwar nicht warum, aber es [X] funktioniert.”
Lösungen für drängende Probleme müssen gefunden werden, und es gibt Situationen, da müssen Nägel mit Köpfen gemacht werden. Zuweilen muss ich aber auch mal auf die Bremse treten, so etwa, wenn ich erkenne, dass ein Lösungsvorschlag X (vielleicht) momentan eine Lösung darstellt, auf Dauer aber zum Problem werden wird.
Die Geisteshaltung “was funktioniert, ist gut” ist mitreißend, und die Sprüche sind eingängig, also habe ich mir für den Fall, dass ich dagegen halten muss, eine ähnlich eingängige Gegenbemerkung zurechtgelegt:
“X ist total super, solange es funktioniert.”
Es gibt auch eine universelle Form:
“Alles ist total super, solange es funktioniert.”
Removing the Builtin Inline CSS from WordPress
27. August 2022 in Programming.
Should you – as i did – wonder why WordPress renders a bucket of inline CSS into the HTML output (such as --wp--preset--font-size--normal in <html> or --wp--preset--color--white in <body>): This is done to accomodate frontend editing with Gutenberg. If you – as i do – are not using Gutenberg frontend editing, then the following PHP code can be included in the functions.php of a custom theme or the php file of a custom plugin. Sorry, Gutenberg folks – no means no. 🙂
Updated Common Prefix Notation Transformation
2. Februar 2024 in Programming.
This is an update to my previous article on determining the common prefixes of a set of strings (passed a sequence of lines) and printing them in common prefix notation (CPN). The problem of reconstructing strings from the original input that are complete prefixes of other input strings is addressed.
The code is now in a Git repository:
Project information not readable.Print XDG Desktop Definition for Application
3. November 2024 in Administration, GNU/Linux.
Update Nov 3 2024:
-
- There is an update to this article that provides this script as commandline utility.
- There is also a Git repository.
For an application given by “application name” or “executable name”, output the corresponding .desktop file, if any:
#!/bin/sh
IFS=":"
xdg_data_dirs=${XDG_DATA_DIRS:-/usr/local/share:/usr/share}
search=$1
for i in $xdg_data_dirs ; do
a="$i/applications"
[ -d $a ] && for d in "$a"/*.desktop ; do
grep -q -e "^Name=.*$search" -e "^Exec=.*$search" "$d" && {
echo "# $d:"
grep -Ev '^(Comment|GenericName|Keywords|Name\[)' "$d"
}
done
done
To try this code out, save it to /usr/local/bin/xdg-desktop-search, make it executable and test it, for example, as follows:
xdg-desktop-search gnome-terminal
Transforming Sets of Strings to their Common Prefix Notation
26. Juli 2025 in Programming.
Update Aug 20 2022:
-
- There is an update to this article that fixes a known issue.
- There is also a Git repository containing a reference implementation.
Any two strings s1, s2 have a common prefix cp, which is the string of characters that s1 and s2 have in common up from the start. If s1, s2 have no such common characters, cp is the empty string. Let s̅1, s̅2 be the remainders or suffixes of s1 and s2 if cp is removed from them. Then, the common prefix notation (CPN) of s1, s2 – in short, cpn(s1,s2) – shall be:
cpn(s1,s2) := cp{s̅1,s̅2}
Given the definition above, for any given CPN of a set of strings s1, s2, …, sn, the CPN of the set extended by an additional string sn+1 is defined as follows:
Case 1: If the suffix of sn+1 with cp removed, s̅n+1, has no nonempty common prefix with any of the suffixes s̅1, s̅2, …, s̅n:
cpn(s1,s2,…,sn+1) := cp{s̅1,s̅2,…,s̅n+1}
Case 2: Otherwise, since the first characters of s̅1, s̅2, …, s̅n are distinct, there can only be one element s̅m that has a nonempty common prefix with s̅n+1. Given s̅m to be that element:
cpn(s1,s2,…,sn+1) := cp{s̅1,s̅2,…,cpn(s̅m,s̅n+1),…,s̅n}
Examples:
cpn("a", "b") = "{a,b}"
cpn("aa", "ab") = "a{a,b}"
cpn("aa", "ab", "abc", "abd") = "a{a,b{c,d}}"
cpn("a", "ab", "abc") = "{a{b{c}}}"
Note: For the sake of reasoning, strings containing the CPN’s reserved characters {, } and , shall be considered invalid input. In a practical implementation, a syntax for “escaping” these reserved characters should be available.
Given a set of strings, one per line, on standard input, the following Python program prints the CPN of these strings on standard output: /ref/trie1.py
Try the examples:
./trie1.py << EOF
a
b
EOF
./trie1.py << EOF
aa
ab
EOF
./trie1.py << EOF
aa
ab
abc
abd
EOF
The following example renders the wrong output, because a trie does not actually store the common prefix (this is what a suffix tree would accomplish), it just stores different prefix paths, and a, ab and abc have no different prefix paths, it’s just a degenerate tree a → b → c:
./trie1.py << EOF
a
ab
abc
EOF
So my guess is, i must implement one of these fancy suffix tree algorithms to get it done right. (see the update instead) 🙂
In the meantime, try this:
find /etc -type d | ./trie1.py
🙂
Pinguin-Patenschaft
31. Dezember 2021 in Other.
Mein Arbeitgeber, B1 Systems GmbH hat in meinem Namen eine Patenschaft für einen afrikanischen Pinguin gesponsert. 🙂