This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import png | |
from random import random, sample | |
class Bitmap(): | |
def __init__(self, filename): | |
pic = png.Reader(filename) | |
w,h,pixel,meta = pic.asDirect() | |
self.w = w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
from random import shuffle | |
import networkx as nx | |
# pythons recursion limit is quite low | |
# increase it, the worst that can happen is a Stack overflow | |
sys.setrecursionlimit(20000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{standalone} | |
\usepackage{tikz} | |
\begin{document} | |
\begin{tikzpicture} | |
\newcommand*{\shear}{0.2} | |
\newcommand*{\height}{1.0} | |
\newcommand*{\radius}{0.1} | |
\newcommand*{\xspacing}{1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sha256: https://tools.ietf.org/html/rfc6234 | |
#include <stdint.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// Format string for output | |
#define FORMAT_SHA256 "%08x%08x%08x%08x%08x%08x%08x%08x" | |
// First 32 Bits of the fractional part of the cuberoots of the first 64 primes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(hashlib.sha256(b"Hallo Welt!").hexdigest()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from random import random, randint, sample | |
from math import exp | |
from copy import deepcopy | |
from time import time | |
class SimulatedSort(): | |
def __init__(self): | |
self.T = [300.0, 100.0, 70.0, 30.0, 10.0, 7.0, 3.0, 1.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ImpMarchTiny.c | |
* | |
* Created: 03.04.2011 21:06:57 | |
* Author: surt91 | |
*/ | |
#include <avr/io.h> | |
// "_delay_ms()" is only precise to 261/tact ms (4 ms) | |
void long_delay(int cs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import matplotlib as mpl | |
from mpl_toolkits.mplot3d import Axes3D | |
import numpy as np | |
import matplotlib.pyplot as plt | |
if __name__ == "__main__": | |
with open("lorenz.txt","r",encoding='utf-8') as f: | |
tmp=[i.split(" ") for i in f.readlines()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
from random import random | |
import networkx as nx | |
def updateAliveNeighbors(G, changedNodes, alive_neighbors): | |
for n in set(changedNodes): | |
alive_neighbors[n] = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ============================================================================ | |
// gzstream, C++ iostream classes wrapping the zlib compression library. | |
// Copyright (C) 2001 Deepak Bandyopadhyay, Lutz Kettner | |
// | |
// This library is free software; you can redistribute it and/or | |
// modify it under the terms of the GNU Lesser General Public | |
// License as published by the Free Software Foundation; either | |
// version 2.1 of the License, or (at your option) any later version. | |
// | |
// This library is distributed in the hope that it will be useful, |
OlderNewer