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
def get_orders(x=0, y=0): | |
DIRECTIONS = ((1, 0, ), (0, 1, ), (-1, 0, ), (0, -1, ), ) | |
c = 2 | |
while True: | |
d = DIRECTIONS[c % 4] | |
for n in range(c / 2): | |
yield x, y | |
x, y = x + d[0], y + d[1] | |
c += 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
import android.database.Cursor; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
public class CursorI implements Iterable<Cursor> { | |
Cursor cursor; | |
class IteratorI implements Iterator<Cursor> { | |
Cursor cursor; | |
IteratorI(Cursor cursor) { | |
this.cursor = cursor; |
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 re import compile as re_compile | |
from select import select | |
from sys import stdin | |
from time import time | |
from os.path import exists | |
from os import listdir, makedirs | |
from PIL.Image import frombytes, open as fromfile, eval as image_eval, merge as image_merge | |
from PIL.ImageTk import PhotoImage | |
from PIL.ImageOps import invert, autocontrast, grayscale, equalize, solarize |
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 tkinter import * | |
''' | |
Fullscreen test program using tkinter. Enter 'f' or F11 to make the current | |
window fullscreen. Enter 'o' to open a second window in fullscreen. | |
''' | |
class MainWindow(object): | |
def __init__(self): | |
self.state = False |
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 python | |
from matplotlib import animation | |
from time import time | |
from random import randint | |
import matplotlib.pyplot as plt | |
import numpy as np | |
class LiveCounter(object): | |
def init(self): | |
plt.ylim((0, self.maxy)) |
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 | |
DEBUG = True | |
def debug(ip, program, dp, tape, stack): | |
global DEBUG | |
if DEBUG: | |
print(program) | |
print('{}{}{}'.format(' ' * ip, '^', ip)) | |
for n, d in enumerate(tape): | |
if n == dp: |
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 | |
# | |
# This is regren, a regular expression renamer. It allows to rename files by | |
# regular expressions given on the command line, but instead of actually doing | |
# that job it spits out the commands for a shell to do so. You just start | |
# preparing your command line and check the result and if you are happy with it | |
# you add a `| sh` to commit the change to the filesystem. | |
# | |
# The first argument is the regex to search in the filename, if no match is | |
# found not rename is issued. |
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
package de.emdete.roberta; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import de.fhg.iais.roberta.connection.IRobot; | |
import de.fhg.iais.roberta.connection.IConnector; | |
import de.fhg.iais.roberta.connection.wired.arduino.Arduino; |
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 | |
__copyright__ = "Copyright (c) 2008-2021 M. Dietrich <mdt@emdete.de>" | |
__license__ = "GPLv3" | |
from math import modf | |
from datetime import datetime | |
from curses import wrapper | |
from os import system | |
from logging import getLogger, StreamHandler |