Link Diary December 2023
-
-
-
- Loosing weight quick
- Recipe for an indian sweet
- Bullet Journal base concept
- Interview with the inventor of the Bullet Journal
- A song about caring
- Bassist hears Maxwell Murder
- Life and struggle of Tim Armstrong
- Viral chinese math problem solved
- Practical coding with ChatGPT
- Demographics and the end of the world
- Addictive learning
- Folding a bookmark
- Housetour at Asmongold's
Reset MAID on Android
Once you reset your "Mobile Advertisement ID" (MAID), advertisers have to start fresh to profile you. Can help to get out of ad filter bubbles one has been put in by "the algorithms".
That's how it worked for me on my Android So geht's bei mir. Ich habe ein Android 11, Xiaomi Mi 10.
- Open Android settings
- Click "Google"
- Click "Ads"
- Click "Reset adverting ID".
If you want to know how google profiled you, this can be interesting:
- Open the "Google" App.
- Click your Profile image.
- Click "Settings"
- Click "Privacy & Security"
- Click "Ads personalization"
I stumbled upon it watching the 37C3 talk "Die Akte Xandr: Ein tiefer Blick in den Abgrund der Datenindustrie" (german), but the links there seemed outdated.
Steam Favourites gone?
Help! My "Favourites" Category is gone! And no setting to be found to bring them back, OMG … well…
In my case, it seems an update has removed all my favourites.
Having no favourites, also does not show the category anymore.
Adding a Game to Favourites again does the job.
When you need to know emo-triggers in movies beforehand
Some people cannot handle dogs dying in movies apparantly. Anyway, this website warns you and features all sorts of other triggers.
Switch axes of a LibreOffice table
You need the table in LibreOffice Calc.
- Mark the table and copy it.
- Paste it using
Strg-Shift+V
- In the dialog click "Transpose all"
Advent of Code & Python
Things I searched for to solve parts of the challenges.
Search & Replace in String with groups
re.sub(r"<regex-with-groups>", r"<mytext>\1\2, str))
Replace without regex
txt.replace("bananas", "apples")
Convert all strings in a list to int
list = [int(x) for x in listOfString)]
or faster
list = map(int, listOfString)
Switch-case syntax
match checkValue: case "foo": print("That's foo!") case "bar" | "baz": print("So bar/z!") case checkValue if len(checkValue) > 3: print("Bigger!") case _: print("The fallback")
https://hellocoding.de/blog/coding-language/python/pattern-matching
Loop through a list by two's
for i in range(0,10,2): pass
Loop backwards through a list
range()
ends one early which is usually desireable in forward-loops.
for i in range(len(list)-1,-1,-1): print(list[i])
ceil & floor
import math math.floor(x) math.ceil(x)
Replace only the first occurance
txt.replace("bananas", "apples", 1)
abs, min and max
abs(x) min(x,y) max(x,y)
Find value in a dictionary
if "value" in dictionary.values(): pass
Sort a dictionary by keys
sorted_dict = dict(sorted(my_dict.items()))
https://www.freecodecamp.org/news/python-sort-dictionary-by-key/
Sort a list backwards
list.sort( reverse=True )
Initialize a set
mySet = set(())
Increase recursion depth limit
import sys sys.setrecursionlimit(4096)
Get the smallest item of a list
smallest = min( myList )
Get the position of an element in a list
pos = -1 try: pos = list.index(search) except: pass
Find intersection point of 2 vectors
Finding the shortest path using Dijkstra
Advent of Code & Bash
One challenge looked like it could be solved on bash, this is what I researched while doing it.
Get the first line of a file
input=`head -1 $input`;
Get the length of a variable
length=${#input}
Loop through all characters of a string
for ((i = 0; i < $length;i++)); do char=${input:i:1} done
Only get the matching part of a grep
grep -o "this.*that" myfile.txt
Search & Replace with groups using sed
sed "s/\(...\)/\1/";
Add 1 to an int
turns=0 # some loop... turns=$(($turns+1));
Discussion