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
Dutch lights on sticks | |
Flashing aspects indicated by * | |
R: Red | |
Y: Yellow | |
G: Green | |
Main signals may or may not be fitted with a number display. | |
Main signals without numbers: |
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
states = [ | |
'Normal', | |
'Inbound', | |
'Unlocked', | |
] | |
transitions = [ | |
('Normal', 'Inbound', 'B_enter & correct'), | |
('Inbound', 'Unlocked', 'timeout'), | |
('Unlocked', 'Normal', 'B_arrived'), |
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 math | |
import pickle | |
import random | |
import tqdm | |
known_adjacent = set() | |
known_non_adjacent = set() | |
try: | |
with open('/tmp/adjacencies.pkl', 'rb') as f: |
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
""" | |
RLE extractor for EV Nova resource files. | |
Usage information available through python3 parserle.py --help | |
Requires both `pillow` and `rsrcfork` from PyPI. Alas this is unlikely to | |
work on non-Darwin platforms. | |
""" | |
import os.path |
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
diff --git a/Engine/Graphics/ImageLoader.cpp b/Engine/Graphics/ImageLoader.cpp | |
index bc08c22..8aa9b8b 100644 | |
--- a/Engine/Graphics/ImageLoader.cpp | |
+++ b/Engine/Graphics/ImageLoader.cpp | |
@@ -24,15 +24,17 @@ GLuint CreateTexture ( SDL_Surface* surface, bool autofree, bool rectangle ) | |
glBindTexture(target, texID); | |
if (surface->format->BytesPerPixel == 3) | |
{ | |
+ GLenum format = (surface->format->Rmask) != 0xFF ? GL_RGB : GL_BGR_EXT; | |
glTexImage2D(target, 0, GL_RGB, |
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
function drive() { | |
var getSquare = function(i, j) { | |
return $('#' + i + '_' + j); | |
} | |
// detect extents | |
var W, H; | |
for (var i = 1; i <= 100; ++i) { | |
if (getSquare(i, 1).length == 0) { | |
W = i - 2; | |
break; |
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
try: | |
from collections.abc import Iterable | |
except ImportError: | |
from collections import Iterable | |
import heapq | |
class AStar(Iterable): | |
def __init__(self, transition, heuristic, start, zero_score=0, pure_heuristic=False): | |
self.transition = transition | |
self.heuristic = heuristic |
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
class TraceIO(object): | |
def __init__(self, stream, log=print): | |
self.stream = stream | |
self.log = log | |
def __enter__(self): | |
return self.stream.__enter__() | |
def __exit__(self, *args): |
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
#!/bin/bash | |
# Usage: review-ws (gerrit change number) when in an srweb clone | |
SSH_HOST=badger | |
set -e | |
REF=$(ssh $SSH_HOST gerrit query --current-patch-set $1 | grep '^ ref: ' | cut -d' ' -f6) | |
git fetch https://www.studentrobotics.org/gerrit/srweb $REF | |
git checkout FETCH_HEAD | |
FILES=$(git diff --name-only HEAD~1 HEAD | grep '^content/en') | |
for FILE in $FILES | |
do |
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
formats = {} | |
formats['vanilla'] = {'player_join': '(?P<name>[A-Za-z0-9_]{1,16}) has joined the game\.'} | |
formats['bukkit'] = {'plugin_loading': '\[(?P<plugin_name>.+\] plugin loaded\.'} | |
formats['ping_1.6'] = {...} | |
# Select which combinations to use, taking right-to-left precedence | |
options = ['ping_1.6', 'vanilla'] | |
messages = dict(itertools.chain.from_iterable(formats[x].items() for x in options)) |
NewerOlder