Python Package parameterized

DISCLAIMER! – This package seems to be no longer maintained. (Last release in March 2023) Stackoverflowing around I found this nice package https://github.com/wolever/parameterized Parameterized testing in Python sucks. parameterized fixes that. For everything. Parameterized testing for nose, parameterized testing for py.test, parameterized testing for unittest. Reading this description I had very high expectations 🙂 So…

PyConDE Berlin 2019

I’ve always wanted to go to a conference and with PyConDE I’ve found one that suited me well: The price point of 300 bucks for 3 days of conference, 2 days of workshops and the opportunity to go to Berlin and visit my friend Thomas was fascinating! The Venue Kosmos Day 1 Algo.rules – How…

My first iPhone app – Part 3

Waveform of Audio File Installing I’ve tried a component FDWaveformView. It uses CocoaPods, a dependecy management tool like Python’s pip or Rust’s cargo. sudo gem install cocoapods To add CocoaPods support to an existing project you must add a Podfile cd XcodeProjects/PlayalongTrainer touch Podfile The content of the Podfile is pretty straght forward: target ‘PlayalongTrainer’…

Android Alerts

Toast Toasts are simple message dialogs val text = “Hello toast!” val duration = Toast.LENGTH_SHORT val toast = Toast.makeText(applicationContext, text, duration) toast.show() Toast.makeText(this@MainActivity, “Hello Toast!”, Toast.LENGTH_SHORT).show() Alerts val builder = AlertDialog.Builder(this) builder.setTitle(“SocketTimeoutException”) builder.setMessage(“The server is not responding – Try again later”) builder.setPositiveButton(android.R.string.yes) { dialog, which -> Toast.makeText(applicationContext, android.R.string.yes, Toast.LENGTH_SHORT).show() } builder.setNegativeButton(android.R.string.no) { dialog, which ->…

Calculator for Resistor Values

Calculator for 4 rings 1. Ring 2. Ring 3. Ring 4. Ring Value Tolerance brownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegoldsilver brownredgreenbluepurplegoldsilver 0Ω 0% Calculator for 5 rings 1. Ring 2. Ring 3. Ring 4. Ring 5. Ring Value Tolerance brownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegreywhite blackbrownredorangeyellowgreenbluepurplegoldsilver brownredgreenbluepurplegoldsilver 0Ω 0%

Minimal REST API with Flask

From the flask release notes: Returning a dict from a view function will produce a JSON response. This makes it even easier to get started building an API. To get a minimal REST-Api all you have to do is: from flask import Flask app = Flask(__name__) @app.route(‘/return_dict’, methods=[‘GET’]) def return_dict(): return {“x”: “1”} if __name__…

Overcoming PyInstaller Pitfalls

When using PyInstaller to package an application to a self-containing bundle you might run into some pitfalls: Pitfall 1: PyInstaller overwrites spec file The first time you run pyinstaller you run it with pyi-makespec my_module.py instead of pyinstaller my_module.py pyi-makespec will generate a my_module.spec which you can alter. Afterwards you just ran pyinstaller my_module.spec to…