Bist du selbstständig und suchst nach einer einfachen Möglichkeit, deine E-Rechnungen zu erstellen? Dann bist du bei meiner neuen Mac App SupaRechnung genau richtig!

💡 Jetzt kostenlos im App Store herunterladen

RxPY: How to use the buffer-operator

I created a github-repository with the two rxpy (version 3) examples from this and another previous blog-post. You can find it at rxpy3-examples on github.

When I was trying to understand and use the buffer operator of RxPy3, I noticed that there are not a lot of code samples out there. The few examples are usually for version 2 of RxPy, and that does not help if you are a complete RxPy3 n00b, like me.

[Read More]

RxPy - Reactive Python

I want to publish my daily blog-post, like every day in the last weeks, but I don’t have the time to write a concrete code example.

I have been tinkering with RxPy 3, which is the Python version of the Rx-library, an implementation of the Observer/Subscriber pattern, also sometimes called reactive programming. Using RxPy (or any of the Rx-flavors), forces you to view everything as a stream of events and/or data. While this can be hard to wrap your had around in the beginning, it also provides unique abilities. For example, if you need to process any kind of event stream or data stream, I would encourage you to have look at RxPy.

[Read More]

Using PostgreSQL as a task queue

Many applications need some form of reliable background processing, usually in form a persistent queue. Instead of using a full-blown task queue like the popular celery-framework for Python, I like to use something that most projects already use anyway: PosgreSQL.

PostgreSQL’s provides two facilities that make implementing a task queue feasible in the database: SKIP LOCKED and NOTIFY/LISTEN. Both libraries use these features in their implementation.

[Read More]

Automatically provisioning Grafana datasources and dashboards using docker

I have been experimenting with using Grafana to visualize time-series data recently, and it so far it has been quite a nice experience. One problem that I kept running in, was that I manually created and tweaked a dashboard in the Grafana UI, but when I destroyed and re-build the docker-container, the dashboard was gone. Of course, this was not unexpected, since I wasn’t persisting anything Grafana related outside off its docker-container. But until today I hadn’t taken the time to look into solving this issue.

[Read More]

Python progress bars and colors in a terminal

Text-based progress bars

If you ever need to create a progress bar in a Python script or terminal application there is nifty little library called progress. I especially like the wrapper around iterables:

1
2
3
4
5
from progress.bar import Bar

for item in Bar('Processing').iter(items):
  # Process the item
  your_processing_function(item)

which will show a nice, text-based progress bar:

[Read More]

More and more npm-packages are threatening your development-machine

There have been some pretty scary security issues recently in a number of popular npm-packages that will install malware (backdoors, rootkits, crypto miners) on your development-machine. I haven’t yet taken the time to set this up myself, but I plan on moving all my JavaScript development into docker-containers, so that any malware will only infect the container (until the malware learns how to escape the container…).

If you are using WebStorm, here are instructions how to use docker for frontend-development.

The six basic market condition types according to Van Tharp

On episode #24 of the Better System Trader podcast, Van Tharp describes six basic market condition types, along the two axis of trend and volatility:

  • trend: up, down, sideways
  • volatility: low, high

According to Van Tharp, a good trading strategy can perform well in more than one type of market, but probably not all types. Thus, one needs more than one trading strategy to achieve what he refers to as a “smooth equity curve”.

[Read More]

Using python to fetch crypto market data from the binance API

I have never actively traded crypto, but with the new all-time-highs of Bitcoin and Ehtereum, I am wondering if I should.

To get historical market data I am using this simple script. You need a Binance-account to create the necessary API key and secret. In this example I am reading those from the environment variables BINANCE_API_KEY and BINANCE_API_SECRET. You could also just paste them into the script, if you don’t care.

[Read More]

Blogging daily is getting difficult

Over the last few days I am struggling more and more to write my daily blog-post. I cannot say that anything in particular has changed, but I regularly feel that it’s really hard to find a decent topic to write about. Sometimes I think I have found something, but after a while I dismiss it again. The reason for dismissing a topic is usually either that I feel it will take too much effort to write even a very basic article about it, or that it is not really a topic but only an idea or opinion, and not an interesting one for that matter.

[Read More]

The 1.000 types of blog posts your blog needs today! (clickbait)

While I was thinking about today’s blog-post, this thought popped into my mind: What kind of blog-posts are there? How many types are there? How do they differ? A typical newspaper has news articles, opinion pieces, editorials, letters to the editor, reviews, obituaries, advertisements, and classified ads. When you search for “types of blog-posts”, some results suggest ridiculously large numbers. I guess the idea is, the higher the number, the better it will rank in the search results. Just like in the good old days. 😀

[Read More]