Skip to content

Instantly share code, notes, and snippets.

View jonkhler's full-sized avatar
🎯
Focusing

Jonas Köhler jonkhler

🎯
Focusing
View GitHub Profile
one_digit_numbers = ["null", "eins", "zwei", "drei", "vier", "fünf", "sechs", "sieben", "acht", "neun"]
two_digit_numbers = ["zehn", "zwanzig", "dreißig", "vierzig", "fünfzig", "sechzig", "siebzig", "achtzig", "neunzig"]
def int_to_german(n: int, prefix: str = "", suffix: bool = False):
if n < 10:
if suffix and n == 0:
return ""
if prefix == "non-female" and n == 1:
return "ein"
if prefix == "female" and n == 1:
# coding=utf-8
from splinter import Browser
from subprocess import call
from time import time, sleep
limit = 20
url = 'https://service.berlin.de/terminvereinbarung/termin/tag.php?termin=1&anliegen[]=120686&dienstleisterlist=122210,327316,122217,122219,327312,327314,122227,327346,327423,327348,122252,327338,122260,327340,122262,122254,327278,327274,327276,327294,327290,327292,122291,327270,122285,327266,122286,327264,122296,327268,150230,327282,327286,327284,122312,122314,122304,327330,122311,327334,122309,327332,317869,324433,325341,324434,327352,324414,122283,327354,122276,327324,122274,327326,122267,327328,122246,327318,122251,327320,122257,327322,122208,327298,122226,327300'
import random
def find_vacant(n, grid):
vacant = []
for i in range(n):
for pos in [i, n*(n-1)+i, n*i, n*i+(n-1)]:
if grid[pos] == 0:
vacant.append(pos)
if len(vacant) > 0:
return random.choice(vacant)
means_test = np.mean(np.mean(test_accuracies, axis=-2), axis=1)
stds_test = np.mean(test_accuracies, axis=-2).std(axis=1)
means_train = np.mean(np.mean(train_accuracies, axis=-2), axis=1)
stds_train = np.mean(train_accuracies, axis=-2).std(axis=1)
font = {'family' : 'normal',
'weight' : 'normal',
'size' : 16}
plt.rc('font', **font)
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class TextGenerationModel(object):
<?php
// base url with a %u which is a sprintf placeholder
// for an unsigned int
$BASE_URL = "http://backup-festival.de/2017/wp-json/wp/v2/film?page=%u&per_page=100";
// start at page 1
$page = 1;
// aggregated pages (json list)
public double getSteer(SensorModel sensors) {
double maxDistance = 0;
double angle = sensors.getAngleToTrackAxis();
int minSensor = (int) Math.max(0, Math.ceil(-angle / Math.PI * 18));
int maxSensor = (int) Math.min(18, Math.ceil((1-angle / Math.PI) * 18));
int maxIndex = Math.max(minSensor, 0);
for(int i=minSensor; i<=maxSensor; i++) {
double distance = sensors.getTrackEdgeSensors()[i];
if (maxDistance < distance) {
maxIndex = i;
if show_graph:
gg = gv.Digraph(format="pdf")
for n in tg.nodes():
gg.node(str(n))
for e in tg.edges():
gg.edge(str(e[0]), str(e[1]))
gg.render('img/plot')
import webbrowser
new = 2