Skip to content

Instantly share code, notes, and snippets.

View pinae's full-sized avatar

Pina Merkert pinae

  • Heise Medien GmbH
  • Hannover, Germany
View GitHub Profile
@pinae
pinae / fibonacci-single.py
Created April 26, 2023 09:00
Calculate single numbers from a Fibonacci sequence
import sys
def fibonacci(n):
if n > 1:
return fibonacci(n-1) + fibonacci(n-2)
else:
return n
if __name__=="__main__":
print(fibonacci(int(sys.argv[1])))
@pinae
pinae / ChatWithGPT.md
Created April 21, 2023 14:15
Complete chat protocol between Pina Merkert and ChatGPT regarding a new change feature for AssetStorm

Pina

I am developing an asset management system with the Python web framework Django. The goal of AssetStorm is to model structured document like magazine articles in a verifyable structure without having to specify the structure itself in the code. AssetStorm achieves this goal with objects of the type AssetType. They store the information how an asset may be structured as JSON with the IDs of other AssetType as references. The JSON structure contains named keys and lists with only one ID which means that this AssetType may be repeated as often as needed. The data itself is stored as objects of type Asset which also contain JSON. This JSON stores the actual primary keys of other assets. This allows any tree structure of assets with typed branches. The structure can be verified using the information from the corresponding AssetType. This software already works great. However I want to improve it by allowing versioned updates of the content. I want the software to be usable as a collaborative e

@pinae
pinae / full_test.py
Created June 18, 2020 14:37
Test program for GPIO (IN/OUT/PWM) on the Raspberry Pi
import time
import RPi.GPIO as GPIO
from threading import Thread
def setup():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(2, GPIO.OUT,
initial=GPIO.LOW)
GPIO.setup(22, GPIO.IN)
@pinae
pinae / tf22-raspi.sh
Created June 3, 2020 12:37
​ Mit den TensorFlow-Binarys von GitHub-Nutzer PINTO0309 (siehe https://github.com/PINTO0309/Tensorflow-bin) lässt sich ein aktuelles 64-Bit-TensorFlow (Version 2.2) auf dem Raspi installieren. ​Damit das klappt, muss man allerdings eine Menge Abhängigkeiten installieren und sich das Python-Wheel per Skript von Google Drive laden:
sudo apt-get install -y libhdf5-dev \
libc-ares-dev libeigen3-dev gcc \
gfortran python-dev libgfortran5 \
libatlas3-base libatlas-base-dev \
libopenblas-dev libopenblas-base \
libblas-dev liblapack-dev cython \
libatlas-base-dev openmpi-bin \
libopenmpi-dev python3-dev
sudo pip3 install keras_applications==1.0.8 --no-deps
sudo pip3 install keras_preprocessing==1.1.0 --no-deps