Learnings #1
What this is
I currently have two problems. Let me tell you.
I learn a lot of things in a day. Most of them are loosely related to software development, but there are other topics I learn about as well. For some of those, I write articles on this site. But most of the things I learn feel too small to write a distinct blog post for.
I write those things down in my note taking app (currently Roam Research) and transfer some of them over to my knowledge base (this process is very bulky and I'm thinking about how to make this easier), but I don't write about them on this site, since they feel too insignificant. That's the first problem.
The second problem is that I would love to publish more on this page, but I only have limited time during the week. Writing a longer article (like Using sass variables for svg background-image fill) can take up two or three evenings.
Luckily, there is a simple solution for both problems: Squeeze mutliple things I learned into a single article. This way, I will have the feeling that it contains sufficient information to be published and I don't have to invest too much time since I already wrote up most of the things anyways.
So, this is what this is.
The actual thing
Rails testing
I was in the situation that my tests were running, but there was no output at all. Just stuck in what seemd to be an infinite loop. There's a couple of things I picked up on the way to fixing this.
Rails test logs
Logs from the tests are saved to logs/test.log
. So tail -f logs/test.log
can give you a good hint on what is happening.
Also, this can help you getting a backtrace if a ruby process hangs without output.
Looking at the logs, I realized that the tests froze after a few database queries. So I decided to look at the database next.
Mysql Metadata locking
Mysql uses metadata locking to manage concurrent access to database objects (Docs).
You can get a full list of processes running using SHOW FULL PROCESSLIST;
.
show processlist
yields a cleaner view. In my case, there ware a dozen or so processes, all with the state Waiting for table metadata lock
. Killed all of them and tests were working again.
This StackOverflow answer goes into a lot more detail on this.
The RSS specification
After deciding that I want to read less social media and more blogposts, I started to fill up Reeder again. For the last week or so it has pretty much replaced all my social media consumption.
I took this chance to also look in the RSS Specification and build a small (and currently non-fucntional) RSS-Parser myself. The specification is a lot simpler then I thought.
Here's the basic markup:
<rss version="2.0">
<channel>
...
<item></item>
<item></item>
...
</channel>
</rss>
Both the <channel>
and the <item>
elements have a lot of child elements, however, only a handful of those are reuired.
Channel:
<title>
: The name of the channel<link>
: The URL to the html site<description>
: The, well, description
Item:
The item is a little more complex. It can have either the <description>
and the <link>
or only the <description>
if it contains the complete story. That means that all elements of the item are optional, but at least the title or the description must be present.
Random stuff
Articles
- It's not my job: As as senior leader, is everything your job?
- Why blog?: About the andvantages of blogging. Me reading that article and writing this one might have a correlation
- indieblog.page: On my quest to fill my RSS reader with enough things to make it more interesting than TikTok while I'm on the toilet, this was a huge help.
Podcasts
- The art of manliness #805: How to Get Your Anger Under Control: An interview with Dr. Chip Tafrate about anger. What it is, if it is good or bad and how to get it under control if it has a negative influence on your life.
Books
Currently reading A brief history of humankind. Learned that the Agrarian Revolution, often referred to as a milestone in human history, was actually a bad deal. Humans worked more, had less time and also less food (because more children were born) that was less healthy.