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
from itertools import izip_longest | |
import re | |
import zlib | |
prefix = u"\u200a" | |
mapping = dict((unichr(0x2002 + x), str(x)) for x in range(8)) | |
known = dict(mapping) | |
known[prefix] = "prefix" | |
def _encode_spaces(byteinp, useprefix): |
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
// copy and paste from jquery.js (scroll down to see my code) | |
/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ | |
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function( |
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
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in | |
all copies or substantial portions of the Software. |
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
# first get the numeral 1 | |
_ = (()==()) | |
__ = _ + _ | |
_ = __ - _ | |
# now build our list of characters | |
# "False" | |
__ = `()==[]` | |
# + "True" |
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 random | |
import tempfile | |
import json | |
import sys | |
import os | |
from twisted.words.protocols import irc | |
from twisted.internet import reactor, protocol | |
# sentinels |
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
from collections import defaultdict | |
import random | |
import time | |
description = random.choice(["Him", "Her"]) | |
start = object() | |
end = object() | |
def generate(chain): | |
result = [start] |
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
03-13 05:37.28pm <lahwran> ideally the only axioms you'd need would be internal to yourself | |
03-13 05:37.38pm <lahwran> and the rest would follow from that | |
03-13 05:39.05pm <lahwran> so, I want to live a long life and enjoy it. loss of a consciousness is the "it could be me" danger, plus something else that I'm not sure yet how to translate into internal-perspective that amounts to "loss of a consciousness is horrifying" | |
03-13 05:39.19pm <lahwran> though maybe that *is* "it could be me" plus empathy | |
03-13 05:39.42pm <Otheruser> lahwran: Then, why would you save the wife? | |
03-13 05:39.47pm <lahwran> live a long life and enjoy it, more humans around me means more enjoyment; loss of any of them is a loss of a huge amount of very valuable data | |
03-13 05:40.58pm <lahwran> Otheruser: because I could have been in her place | |
03-13 05:41.11pm <lahwran> and because it would be a huge interaction loss | |
03-13 05:41.35pm <lahwran> she'll no longer be around to improve the world by being fun/awesome/whatever positive a |
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
"E128", # E128 is "under-indented" | |
"E127", # E127 is "visual indent mismatch" | |
"E126", # E126 is "over-indented" | |
"E124", # Closing bracket does not match visual indentation | |
"E202", # Whitespace before ) - used for Good Reason in test_time | |
"E241", # Too much whitespace after : or , | |
"E702", # Multiple statements on one line (get over yourself, I know when | |
# to use this, and it's rarely) | |
"E121", # stfu about continued comment on previous line in this file | |
"E201", # whitespace after ( in function call - used for vertical time |
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 find_intersection(p0, p1, p2, p3): | |
""" | |
copied from stackoverflow, reformatted; slightly tweaked to include ends of lines | |
(see "#tweaked" comments) | |
note that the changes were made somewhat blindly, guessing at what might work, and the | |
only reason I have any confidence that they were the right changes are the tests I wrote | |
""" | |
#print "start" | |
s10_x = p1[0] - p0[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
#!/usr/bin/env python | |
import itertools | |
import random | |
random = random.SystemRandom() | |
grid = """ |