Skip to content

Instantly share code, notes, and snippets.

View karlbeecken's full-sized avatar
🏠

Karl Beecken karlbeecken

🏠
View GitHub Profile
fn main() {
const N: i32 = 8;
let mut loesung = [0; N as usize];
let mut anzahl = 0;
fn passt_dame(zeile: i32, spalte: i32, loesung: &mut [i32]) -> bool {
for row in 0..zeile {
// check vertical, horizontal and diagonal
if loesung[row as usize] == spalte {

A stupid ffmpeg call to win a bet

you need the font "Inter" in the weight medium saved as font.ttf in your folder

Preview

output.png

for (int i = 0; i < wunschliste.length; i++) {
Pizza pizza = wunschliste[i];
if (pizza == null) continue;
System.out.print(i + " ");
System.out.print(pizza.getNamen());
System.out.print(", Preis (in Cent): ");
System.out.println(pizza.getPreis());
}
@karlbeecken
karlbeecken / vigenere.py
Created December 10, 2020 07:32
de and encrypt vigenere chiffre
def caesar(klartext, schluessel):
klartext = klartext.upper()
geheimtext = ""
for i in range(0, len(klartext)):
buchstabe = klartext[i]
ascii = ord(buchstabe)
code = ascii + schluessel
while (code > 90):
code = code - 26
geheimbuchstabe = chr(code)
@karlbeecken
karlbeecken / map-mobi.py
Last active November 7, 2019 19:27
map generation for the mobimaterial of FFF Berlin
import requests
import pandas as pd
from geopy.geocoders import Nominatim
geolocator = Nominatim(user_agent="FridaysforFuture.de Streikkarte")
pd.set_option('display.max_colwidth', -1)
url = 'https://fridaysforfuture.berlin/mobi-material/'
html = requests.get(url).content
df_list = pd.read_html(html)
function heron_sqrt(num) {
let a = num / 3
let b = num / a
let i = 0
while (i < 20) {
function round(num) {
return +(Math.round(num + "e+10") + "e-10");
}
function heron_sqrt(num) {
let a = num / 3
let b = num / a
import datetime
import logging
import urllib2
# Constants
timespan_threshhold = 3
# Globals
lastpress = datetime.datetime(1970,1,1)
<span id="unwelt_smiley"> </span> <!-- put wherever you want -->
<script>
function random_smiley()
{
let set = ["💚","🐣","🌱","🌿","🌳","🌻","🌞","☀","🥦","🌏","🌍","🌈"]
let smiley = set[Math.floor(Math.random()*set.length)];
document.getElementById("unwelt_smiley").innerHTML = smiley;
}
function shortSysName(name) {
var arr = name.split(" ");
var out;
if (arr[0] === "Microsoft") {
if (arr[2] === "Server") {
out = arr[1] + " " + arr[2] + " " + arr[3];
} else {
out = arr[1] + " " + arr[2];
}
} else {