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/python2 | |
#! coding: utf-8 | |
class QuadTree(object): | |
"""An implementation of a quad-tree. | |
This QuadTree started life as a version of [1] but found a life of its own | |
when I realised it wasn't doing what I needed. It is intended for static | |
geometry, ie, items such as the landscape that don't move. | |
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 | |
# | |
# Copyright 2008-2014 Jose Fonseca | |
# | |
# This program 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 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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/python | |
import matplotlib as mpl | |
from mpl_toolkits.mplot3d import Axes3D | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import sys | |
mpl.rcParams['legend.fontsize'] = 10 | |
fig = plt.figure() |
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
possible = {1 : [2,4,5,6,8], | |
2 : [1,3,4,5,6,7,9], | |
3 : [2,4,5,6,8], | |
4 : [1,2,3,5,7,8,9], | |
5 : [1,2,3,4,6,7,8,9], | |
6 : [1,2,3,5,7,8,9], | |
7 : [2,4,5,6,8], | |
8 : [1,3,4,5,6,7,9], | |
9 : [2,4,5,6,8]} |
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
Theme = transparent-background | |
ReadTags = no | |
Keymap = keymap | |
Autonext = yes | |
AlsaMixer1 = Master | |
AlsaMixer2 = PCM | |
PlaylistFullPaths = no |
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
#include <stdio.h> | |
//assumes little endian | |
void printBits(size_t const size, void const * const ptr) | |
{ | |
unsigned char *b = (unsigned char*) ptr; | |
unsigned char byte; | |
int i, j; | |
for (i=size-1;i>=0;i--) | |
{ |
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
!--------------------------- | |
!Xft | |
!--------------------------- | |
Xft.dpi: 96 | |
Xft.antialias: true | |
Xft.hinting: true | |
Xft.hintstyle: hintfull | |
!--------------------------- | |
!URxvt |
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
TARGET = result.pdf | |
PDF_VIEWER = okular | |
.PHONY: all clean distclean | |
all: $(TARGET) | |
%.pdf: %.tex | |
rubber -f --pdf -m xelatex $< | |
rubber-info --check $< |
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 python2 | |
from random import randint, uniform, choice | |
directions = [[1, 1, 1, -1], [-1, 1]] | |
filelist = open('newlist', 'w') | |
filelist.write(str(110)+'\n') | |
for i in range(10): | |
x_direction = [] | |
y_direction = [] | |
coin = choice([0, 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
#include "bitmap.h" | |
void set_bitmap(bitmap_t b, int i) | |
{ | |
b[i/8] |= 1 << (i & 7); | |
} | |
void unset_bitmap(bitmap_t b, int i) | |
{ | |
b[i/8] &= ~(1 << (i & 7)); |