Categories
Data Science

SARS-CoV-2, a.k.a “Corona Virus”, pseudo “data science” and Twitter

Some terminology (taken from – who would have thought it – t-online.de) and background information: SARS-CoV-2 is the correct name of the virus. Everybody calls him “the Corona Virus” though, which is technically incorrect, cause there’s only the family of corona viruses – it’s a group, not a single one. COVID-19 is the name of […]

Categories
Snippets

Configure Python on Windows

All right, I have a Windows machine. It’s a PITA, but it’s here. And for some reason I started doing some Python testing on it. So this is how I managed to do it: Preparation: Install python with choco (choco install -y python) Run PowerShell as Administrator Execute Set-ExecutionPolicy -ExecutionPolicy Unrestricted (we’ll see why in […]

Categories
Uncategorized

Misc Django I – forms

Custom form errors If you want to validate something in the view, and return with a custom error message in the same form, you can use the “Form.add_error(fieldname, errorstring)” method. And then, of course, return to the previous template. class MyView(View): def get(self, request): data = form.cleaned_data if len(res) > 0: form.add_error( ‘login’, “Diese Personalnummer […]

Categories
Development

Python & Visual Studio code

The official python plugin claims that the interpreters of Pipenv are automatically found. They are not. At least not on my machine. Here’s how you set them.

Categories
Snippets

JIRA and Python

I really came to hating JIRA with a passion. And now I have to create about 350 tickets. Naturally I don’t do this by hand. But using the JIRA API is kind of … hard, there is a Python library, but usage is rather sparsely documented, and this whole thing is just annoying as hell. […]

Categories
Snippets

PyCharm, Arch linux & Python 3.6

Love Python. Love PyCharm. Love Arch Linux. Unfortunately Arch sneakily updated Python to 3.6. Cool, new version … but hey, why don’t my debug runs in PyCharm work any more?? ImportError: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory Yup, pretty confusing. It seems unable to find shared python 3.5 library. Well. […]

Categories
Uncategorized

Really annoying thread properties

This sucks monkey ass, mainly because I didn’t think of that before. And that’s just one example why multi-threaded (soon to be -processing, probably) applications are hard. Result is:

Categories
Snippets

OpenStack floating IP convenience

Problem: I am working in a tenant which has a couple of hosts with floating IPs assigned. I always have to look them up either manually using the command line clients (and dealing with all those UUIDs), or manually in the web GUI. Didn’t like. Solution: Python script, which outputs FLOATING_IP -> HOST_NAME. Here it […]