initial commit, add Publish, add minimal theme, add content

This commit is contained in:
Felix Förtsch
2024-03-24 20:24:51 +01:00
commit cd2f440141
1240 changed files with 194709 additions and 0 deletions
@@ -0,0 +1,29 @@
---
layout: post
title: "Use Picture-in-Picture Mode on Mac and iPad with a Bookmarklet"
categories:
- Tips
tags:
- English
- Apple
last_modified_at: 2020-07-20
excerpt_separator: <!-- more -->
---
[Quinn](https://twitter.com/SnazzyQ) from [Snazzy Labs](https://www.youtube.com/channel/UCO2x-p9gg9TLKneXlibGR7w) just posted an [interesting video](https://www.youtube.com/watch?v=cqjpa8-Cp-s) about some macOS utilities. I love small utilities, but I like it even better, when a problem can be solved with system functions. That is the case here. He mentions Helium - an app to use a form of picture in picture mode for websites that don't support the native PIP.
However, there is a better solution! And this solution works on Mac as well as iPad!
<!-- more -->
You can use a small [bookmarklet](https://en.wikipedia.org/wiki/Bookmarklet) that pushes the current HTML5 video on screen into the native PIP. And yes, it also works with Netflix, **if** you are on macOS Mojave or up (as far as I can tell, Netflix doesn't run in the previous versions of Safari).
Create a new bookmark, enter the following string as the address, give it a nice emoji (like this: ⤵️), voilà! You can now use the native PIP for nearly all your videos!
Here is the code:
```
javascript:document.querySelector(%22video%22).webkitSetPresentationMode(%22picture-in-picture%22);
```
@@ -0,0 +1,71 @@
---
layout: post
title: "How to Begin an English Sentence"
categories:
- Tutorials
tags:
- English
- Writing
last_modified_at:
excerpt_separator: <!-- more -->
---
During the writing of my thesis, I collected some English words you can use two empower your writing style.
<!-- more -->
Addition:
also, again, as well as, besides, coupled with, furthermore, in addition, likewise, moreover, similarly
Consequence:
accordingly, as a result, consequently, for this reason, for this purpose,
hence, otherwise, so then, subsequently, therefore, thus, thereupon, wherefore
Generalizing:
as a rule, as usual, for the most part,
generally, generally speaking, ordinarily, usually
Exemplifying:
chiefly, especially, for instance, in particular, markedly, namely,
particularly, including, specifically, such as
Illustration:
for example, for instance, for one thing, as an illustration,
illustrated with, as an example, in this case
Emphasis
above all, chiefly, with attention to, especially, particularly, singularly
Similarity:
comparatively, coupled with, correspondingly, identically, likewise, similar, moreover, together with
Exception:
aside from, barring, besides, except, excepting, excluding, exclusive of, other than, outside of, save
Restatement:
in essence, in other words, namely, that is, that is to say,
in short, in brief, to put it differently
Contrast and Comparison:
contrast, by the same token, conversely, instead, likewise,
on one hand, on the other hand, on the contrary, rather,
similarly, yet, but, however, still, nevertheless, in contrast
Sequence:
at first, first of all, to begin with, in the first place, at the same time,
for now, for the time being, the next step, in time, in turn, later on,
meanwhile, next, then, soon, the meantime, later, while, earlier,
simultaneously, afterward, in conclusion, with this in mind,
Summarizing:
after all, all in all, all things considered, briefly, by and large, in any case, in any event,
in brief, in conclusion, on the whole, in short, in summary, in the final analysis,
in the long run, on balance, to sum up, to summarize, finally
Diversion:
by the way, incidentally
Direction:
here, there, over there, beyond, nearly, opposite, under, above,
to the left, to the right, in the distance
@@ -0,0 +1,52 @@
---
layout: post
title: "Blackhole"
categories:
- Art
tags:
- English
- Reading
last_modified_at:
excerpt_separator: <!-- more -->
---
This is a text I found on the internet and saved it. If anybody knows the source, please tell me, so I can give credit.
<!-- more -->
# Blackhole
Imagine, just for a moment, that you are aboard a spaceship equipped with a magical engine capable of accelerating you to any arbitrarily high velocity. This is absolutely and utterly impossible, but it turns out it'll be okay, for reasons you'll see in a second.
Because you know your engine can push you faster than the speed of light, you have no fear of black holes. In the interest of scientific curiosity, you allow yourself to fall through the event horizon of one. And not just any black hole, but rather a carefully chosen one, one sufficiently massive that its event horizon lies quite far from its center. This is so you'll have plenty of time between crossing the event horizon and approaching the region of insane gravitational gradient near the center to make your observations and escape again.
As you fall toward the black hole, you notice some things which strike you as highly unusual, but because you know your general relativity they do not shock or frighten you. First, the stars behind you — that is, in the direction that points away from the black hole — grow much brighter. The light from those stars, falling in toward the black hole, is being blue-shifted by the gravitation; light that was formerly too dim to see, in the deep infrared, is boosted to the point of visibility.
Simultaneously, the black patch of sky that is the event horizon seems to *grow* strangely. You know from basic geometry that, at this distance, the black hole should subtend about a half a degree of your view — it should, in other words, be about the same size as the full moon as seen from the surface of the Earth. Except it isn't. In fact, it fills half your view. Half of the sky, from notional horizon to notional horizon, is pure, empty blackness. And *all* the other stars, nearly the whole sky full of stars, are crowded into the hemisphere that lies behind you.
As you continue to fall, the event horizon opens up beneath you, so you feel as if you're descending into a featureless black bowl. Meanwhile, the stars become more and more crowded into a circular region of sky centered on the point immediately aft. The event horizon does not *obscure* the stars; you can watch a star just at the edge of the event horizon for as long as you like and you'll never see it slip behind the black hole. Rather, the field of view through which you see the rest of the universe gets smaller and smaller, as if you're experiencing tunnel-vision.
Finally, just before you're about to cross the event horizon, you see the entire rest of the observable universe contract to a single, brilliant point immediately behind you. If you train your telescope on that point, you'll see not only the light from all the stars and galaxies, but also a curious dim red glow. This is the cosmic microwave background, boosted to visibility by the intense gravitation of the black hole.
And then the point goes out. All at once, as if God turned off the switch.
You have crossed the event horizon of the black hole.
Focusing on the task at hand, knowing that you have limited time before you must fire up your magical spaceship engine and escape the black hole, you turn to your observations. Except you don't see anything. No light is falling on any of your telescopes. The view out your windows is blacker than mere black; you are looking at non-existence. There is *nothing* to see, *nothing* to observe.
You know that somewhere ahead of you lies the singularity … or at least, whatever the universe deems fit to exist at the point where our mathematics fails. But you have no way of observing it. Your mission is a failure.
Disappointed, you decide to end your adventure. You attempt to turn your ship around, such that your magical engine is pointing toward the singularity and so you can thrust yourself away at whatever arbitrarily high velocity is necessary to escape the black hole's hellish gravitation. But you are thwarted.
Your spaceship has sensitive instruments that are designed to detect the gradient of gravitation, so you can orient yourself. These instruments should point straight toward the singularity, allowing you to point your ship in the right direction to escape. Except the instruments are going haywire. They seem to indicate that the singularity lies *all around you.* In *every* direction, the gradient of gravitation increases. If you are to believe your instruments, you are at the point of lowest gravitation inside the event horizon, and every direction points "downhill" toward the center of the black hole. So *any direction you thrust your spaceship* will push you closer to the singularity and your death.
This is clearly nonsense. You cannot believe what your instruments are telling you. It must be a malfunction.
But it isn't. It's the absolute, literal truth. Inside the event horizon of a black hole, there *is* no way out. There are no directions of space that point away from the singularity. Due to the Lovecraftian curvature of spacetime within the event horizon, all the trajectories that *would* carry you away from the black hole now point into the past.
In fact, this is the definition of the event horizon. It's the boundary separating points in space where there *are* trajectories that point away from the black hole from points in space where there are none.
Your magical infinitely-accelerating engine is of no use to you … because you cannot find a direction in which to point it. The singularity is all around you, in every direction you look.
And it is getting closer.
@@ -0,0 +1,26 @@
---
layout: post
title: "Die Rechnung"
tags:
- Deutsch
- Checklist
last_modified_at: 2019-03-25
excerpt_separator: <!-- more -->
---
Die Rechnung ist eines der wesentlichsten Dokumente des Geschäftsverkehrs. Da sie ein formales Dokument ist, müssen einige Regeln eingehalten werden, damit eine Rechnung _gültig_ ist und der Kunde bezahlen muss. Der Gesetzgeber hat eindeutig festgelegt, welche Angaben enthalten sein müssen ([§ 14 UStG](https://www.gesetze-im-internet.de/ustg_1980/__14.html)):
<!-- more -->
- Der vollständige Name und die Anschrift des Rechnungs**steller**
- Der vollständige Name und die Anschrift des Rechnungs**empfänger**
- Die Steuernummer des Rechnungs**stellers**
- Das Ausstellungsdatum
- Eine eindeutig Rechnungsnummer
- Die Menge und Art der gelieferten Leistung
- Das Datum der Lieferung (auch wenn identisch mit oben!)
- Der Netto-Betrag der Lieferung
- Den anzuwendenden Steuersatz
- Den anfallenden Steuerbetrag
@@ -0,0 +1,29 @@
---
layout: post
title: "iPad Gestures"
categories:
- Tips
tags:
- English
- Apple
last_modified_at:
excerpt_separator: <!-- more -->
---
I did it! I bought an iPad and an Apple Pencil for christmas last year. I write a lot for my university classes and I didn't like that I often had to cross out things on paper (because I wrote something down wrong) and had to write them again. I was not sure, if an iPad is the right device for me -- but turns out it is. It is awesome. If you make a mistake, you erase it and write it again. Wrong sequence of your sentences? Just move them around. The notes come out awesome.
Additionally I learned a few gestures that are really useful:
<!-- more -->
- Swipe with two fingers on the virtual keyboard to move cursor.
- Tap and hold with two fingers to begin selecting, then move fingers to expand selection, OR
- Tap once with two fingers to select single word.
- Double tap with two fingers to select sentence.
- Triple tap with two fingers to select paragraph.
While text is selected:
- Swipe left/up with two fingers to move left selection handle.
- Swipe right/down with two fingers to move right selection handle.
- Tap once with two fingers to exit selection and return to cursor mode.
@@ -0,0 +1,81 @@
---
layout: post
title: "Use the Pumping Lemma for Regular Languages"
categories:
- Tutorials
tags:
- Proof
- Computer Science
last_modified_at: 2019-04-04
excerpt_separator: <!-- more -->
---
This semester I finished my course about automata and languages. I learned a lot and it was really enjoyable. From this field, there was [a question about the Pumping Lemma on the computer science subreddit](https://old.reddit.com/r/computerscience/comments/atrs4y/pumping_lemma_in_theory_of_computation/). So naturally, if someone ask about a thing I know about, I'll try to explain it as best as I can -- repetition is key for retaining knowledge!
<!-- more -->
# My Explanation
[My original post on Reddit.](https://old.reddit.com/r/computerscience/comments/atrs4y/pumping_lemma_in_theory_of_computation/eh3aw9k/)
To understand the PL, we think about it in two steps. I'll do it for the regular languages. You can do the same on your own for the context free languages. The idea is the same.
1. We create a visual model to understand what it is about.
2. We do a PL proof.
## 1. Creating a visual model in your mind.
Firstly, we have to keep in mind that we want to show that a language is not regular. Let's reason a little bit more about regular languages:
- Regular languages can be accepted by finite automata (FA). That means: if your language is regular, there is an FA that accepts this language.
- To check, whether a word is accepted by an FA, you start in a state, start reading in letters of your word and follow the edges through the FA. If the whole word is read and we end up in a final state, the FA accepts the word.
- But hold on a second! FA can also accept words that have more letters than we have states and edges. How can that be?! The answer: loops.
- Now, given any regular language, we **know** that there is an FA that accepts it (this is a theorem).
- That means: if we have a word, that has more letters than we have states, but is still accepted by our FA, we **have to have** a loop in our FA.
- Think about it: we can repeat this loop as many times as we want and the FA would still accept words that are processed by going through the loop repeatedly. **It has to!**
- This repeating of the loop is referred to as pumping a word up or down.
## 2. Doing a proof.
Now, secondly, you want to proof something using this lemma. Let's start with the PL (really try to understand this line!):
`L ∈ REG → ∃n ∈ ∀x ∈ L: |x| ≥ n ∃u, v, w: x = u ∘ v ∘ w, |v| ≥ 1, |uv| ≤ n ∀i ∈ : u ∘ vⁱ ∘ w ∈ L`
I'll break it down. Remember: This is a theorem. If you meet the conditions of the implication (part on the left), you now **know** that the part on the right is true.
1. `L ∈ REG →`: "Given a regular language, the following is true."
2. `∃n ∈ `: "There is a natural number"
3. `∀x ∈ L: |x| ≥ n`: "For every word `x` that is in the language and longer than this natural number"
- Remember the argument with the loops from part 1. This just says: we now have a word that has more letters than we have states.
4. `∃u, v, w: x = u ∘ v ∘ w, |v| ≥ 1, |uv| ≤ n`: "You can split up the word `x` into three parts: `u, v, w` where the length of `v` is equal to or bigger than `1` and the length of `u ∘ v` is smaller than our natural number from before"
- Here we describe the loop in more detail. `v` is the part that we can pump, because there is a loop that processes v (and can thus process arbitrary iterations of v - or skip it altogether. And because `u ∘ v` is smaller than `n`, we didn't need a loop until now. We only really **need** a loop, if our word has more letters than we have states!
5. `∀i ∈ : u ∘ vⁱ ∘ w ∈ L`: "If all the conditions before have been met, we can now pump `v` up or down and the resulting word is still in the language!"
- Since it is a loop, pumping doesn't make a difference. If you go the loop a million times, the word is still in the language.
That's it. Again, because it is proved, you **know** it's true if all the conditions are met.
We want to use the lemma to show, that a language **is not** a regular language. Let's have a look at the implication from above. Think about the left part of the implication (`L ∈ REG`) as `A` and the right part (`∃n ∈ ∀x ∈ L: |x| ≥ n ∃u, v, w: x = u ∘ v ∘ w, |v| ≥ 1, |uv| ≤ n ∀i ∈ : u ∘ vⁱ ∘ w ∈ L`) as `B`: `A → B`.
We can now do the following transformation:
`A → B ≡ ¬B → ¬A`
To pull in the negation on the right side of this transformation, all the quantifiers have to "flip around". This means the sentence now looks like this:
`∀n ∈ ∃x ∈ L: |x| ≥ n ∀u, v, w: x = u ∘ v ∘ w, |v| ≥ 1, |uv| ≤ n ∃i ∈ : u ∘ vⁱ ∘ w ∉ L → L ∉ REG`
Again, this is still the Pumping Lemma. We didn't change it, we just used an transformation for the implication that is equivalent. If you meet the conditions on the left, you **know** the sentence on the right is true.
Let's use this on an example: Show that `L = {aᵏ ∘ bᵏ | k ≥ 0}` is not regular.
1. Take any number `n`.
2. Select a word with the requirement `x ∈ L` with `|x| ≥ n`. Your mathematical creativity is requested here! You need to pick a word that helps you show the rest of the conditions easily! We are going to pick: `x = aⁿbⁿ`. This is convenient, because its obvious that it is as least as long as n (n occurs twice in it as an exponent). The important property to note: there are exactly as many `a` as there are `b` in this word. So if we can pump it in a way, that this is not the case anymore, we are golden!
3. Now we have to look at **all** of the partitions `x = uvw` with the conditions `|v| ≥ 1` and `|uv| ≤ n`. Since we have to look at all of them we just say: Let's assume these conditions are met (we can now use them in the next step).
4. Pick an `i` that shows that `u ∘ vⁱ ∘ w ∉ L`. Let's take `i = 0`.
- Since our word is `aⁿbⁿ` and one of the conditions is `|uv| ≤ n`, we know that `uv` can **only** consist of the letter `a`.
- And because we have the condition `|v| ≥ 1`, we also know that `v` has to contain **at least** one letter `a`.
- If we now remove this letter (or maybe its more than one letter, it doesn't matter), the amount of letters `a` in the word `x` is now not equal to the amount of letters `b` in the word.
- Hence: Our word is not part of the language any more (`u ∘ v⁰ ∘ w ∉ L`), violating the PL.
This shows that `L = {aᵏ ∘ bᵏ | k ≥ 0}` is not a regular language.
@@ -0,0 +1,25 @@
---
layout: post
title: "Collection of High Quality Swift Libraries"
categories:
- Programming
tags:
- English
- Swift
last_modified_at: 2019-03-30
excerpt_separator: <!-- more -->
---
Libraries are an important part of programming. However, there should be a **really** good reason, if you decide to use a library. And if you use one, it should be a good one. These are some from my collection:
<!-- more -->
- [JTAppleCalendar](https://github.com/patchthecode/JTAppleCalendar): Need a calendar view? Don't roll your own.
- [Keychain](https://github.com/evgenyneu/keychain-swift): Have something that need secure storage, like a password? Put it in the keychain.
- [SPPermission](https://github.com/IvanVorobei/SPPermission): Your app needs permissions? Inform the user properly. It's important.
- [SwiftDate](https://github.com/malcommac/SwiftDate): Handles all your date and time needs. [Don't roll your own](https://www.youtube.com/watch?v=-5wpm-gesOY).
- [WhatsNewKit](https://github.com/SvenTiigi/WhatsNewKit): Welcome your new user like apple does.
## Helper
- [SwiftyUserDefaults](https://github.com/radex/SwiftyUserDefaults): A small wrapper around NSUserDefaults that makes the usage swifter.