Skip to content

Instantly share code, notes, and snippets.

View jtauber's full-sized avatar

James Tauber jtauber

View GitHub Profile
@jtauber
jtauber / AKALABETH
Last active September 18, 2015 04:45
Akalabeth Files, detokenized from disk images in Asimov Apple ][ Archive using https://github.com/jtauber/a2disk
0 ONERR GOTO 4
1 REM
4 PR # 0: IN # 0
5 HIMEM: 49151
7 CLEAR : GOSUB 60000
8 ZZ = RND ( - ABS (LN))
9 LEVEL = 0
10 TEXT : HOME : NORMAL : VTAB (12): PRINT " WELCOME TO AKALABETH, WORLD OF DOOM!"
20 DIM DN%(10,10),TE%(20,20),XX%(10),YY%(10),PER%(10,3),LD%(10,5),CD%(10,3),FT%(10,5),LAD%(10,3)
30 FOR X = 0 TO 20:TE%(X,0) = 1:TE%(0,X) = 1:TE%(X,20) = 1:TE%(20,X) = 1: NEXT
The Ugly Duckling.
A duck made her nest under some leaves.
She sat on the eggs to keep them warm.
At last the eggs broke, one after the other. Little ducks came out.
Only one egg was left. It was a very large one.
At last it broke, and out came a big, ugly duckling.
"What a big duckling!" said the old duck. "He does not look like us. Can he be a turkey?--We will see. If he does not like the water, he is not a duck."
The next day the mother duck took her ducklings to the pond.
@jtauber
jtauber / gist:6331304
Created August 25, 2013 01:16
Difference between MorphGNT SBLGNT (but with numbers changed to `NU --------` to avoid a major class of systematic differences) and the Asia Bible Society syntax analysis (converted to a MorphGNT-like format for comparison purposes)
Matthew
5997c5997
< 40011026003 N- ----VSM- πατήρ, πατήρ
---
> 40011026003 N- ----NSM- πατήρ, πατήρ
10483c10483
< 40018012006 RI ----DSM- τινι τις
---

Differences between Syntax Tree and MorphGNT

Text

  • there are additional sections of text in John, 2 Timothy and James and one extra word in Acts (these could be the result of multiple analyses but I haven't confirmed that yet)

Lemmatization

  • Syntax Tree has θεμέλιον for θεμέλιος
def struct_hash(structure):
if isinstance(structure, list):
r = "list:" + repr([struct_hash(item) for item in structure])
elif isinstance(structure, dict):
r = "dict:" + repr([(struct_hash(key), struct_hash(value)) for (key, value) in sorted(structure.items())])
elif isinstance(structure, str):
r = "unicode:" + repr(unicode(structure))
elif isinstance(structure, unicode):
r = "unicode:" + repr(structure)
elif isinstance(structure, int):
NEWTON is riding his bicycle in Lincolnshire when he comes across
SOCRATES on the road.
SOCRATES: For what purpose do you return to Woolsthorpe my dear sir?
NEWTON: Cambridge has been closed due to the plague.
SOCRATES: By Zeus! Closed?
NEWTON: Indeed.
SOCRATES: And so what are you doing with your time here? Surely not
farming.
@jtauber
jtauber / gist:3140197
Created July 19, 2012 01:37
Blogging, Twitter and something in between
I don't want to get too deep into the psychology of why I stopped blogging other than to suggest that when you don't blog for a while, it raises the bar of what you break your blogging drought with. There was one time I didn't blog for a couple of months and the next time I blogged, a friend said "I've waited months for a blog post and you post THAT!".
So to get back to putting more content on my site, I need to give myself permission to do shorter, less well-thought-out posts and not feel that every post has to be an epic article. Looking at the taxonomy above, it's clear that in the past I have made blog posts considerably shorter than informational articles.
I think there is value in distinguishing short-form and long-term posts and making enough of a separation that there is less pressure to always do long-term posts. But as well as the dimension of length, I think it also makes a lot of sense to distinguish posts which are ephemeral (or at least quite specific to the time in which they were made) from
def bitstruct(structure, value):
result = []
index = 8
for part in structure:
result.append((value & ((2 ** index - 1) - (2 ** (index - part) - 1))) >> (index - part))
index -= part
return tuple(result)
if __name__ == "__main__":
assert bitstruct((8, ), 42) == (42, )
@jtauber
jtauber / trim_zip.py
Created February 27, 2012 20:48
trim extra data off end of zipfile
import struct
ECD_SIG = "\x50\x4B\x05\x06"
ECD_LEN = 22
def trim_zip(filename_in, filename_out):
"""
trims the zipfile give by filename `filename_in`, removing any bytes
after the end of central directory record and writing the result to
a file with filename `filename_out`.
import colorsys
VALUE = 0.8
def to_hex(h, s, v):
return "#%02X%02X%02X" % tuple(int(255 * i) for i in colorsys.hsv_to_rgb(h, s, v))
def generate_colour():
a = 1
while True: