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
g = [locals().__setitem__('_x', (yield locals().get('_x', x)) or locals().get('_x', x)) for x in range(10)] | |
# >>> next(g) | |
# 0 | |
# >>> next(g) | |
# 0 | |
# >>> g.send(3) | |
# 3 | |
# >>> next(g) | |
# 3 | |
# >>> next(g) |
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 pygame | |
import thread # _thread in Python 3 | |
class FakeSound: | |
def play(self, *args, **kw): | |
pass | |
class SoundStore: |
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
>>> lines = c.split('\n') | |
>>> S1 = set() | |
>>> S2 = set() | |
>>> for line in lines: | |
... S1.add(line.split()[0]) | |
... if '->' in line: | |
... for stacked in line.split('->')[-1].split(','): | |
... S2.add(stacked.strip()) | |
... | |
>>> S1 - S2 |
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 | |
print (lambda names, used, assigned: [((lambda n=n: (n, assigned.add(n))[0])(), (lambda p: (p, used.add(p))[0])(next(x for x in (random.choice(list(names - used - {n})) for i in xrange(10**9)) if 1 or len(names - used - {x}) != 1 or (used | {x} != assigned | {n})))) for n in names])(set(raw_input().split(',')), set(), set()) |
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 | |
''' | |
Impress your friends and become the next | |
2pac using rapgod.py, a state-of-the-art | |
rhymez and raps assistance tool. | |
dsc@dev4 $ rapgod en python | |
brighten brighton frighten icahn | |
icon ikon lightning lightson | |
ptyon pythons tighten titan |
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
# i3status configuration file. | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! | |
general { | |
colors = 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
#0 0x00000000004dbb40 in putIntoReg_ZsUE1JVxG9cRVXlAiTkBa3Q () | |
#1 0x00000000004e62ed in evalMacroCall_NNZcYiEoPcdLz5gpQBCUgQ () | |
#2 0x0000000000487c69 in semMacroExpr_woULc1D9b2DCEYOx5yRZXRg () | |
#3 0x000000000047a11c in semIndirectOp_tayBCUAEli3HMPwxdS9aMbg_18 () | |
#4 0x000000000047afc6 in semExpr_tayBCUAEli3HMPwxdS9aMbg_2.part.63 () | |
#5 0x0000000000476cab in semExprWithType_tayBCUAEli3HMPwxdS9aMbg () | |
#6 0x000000000048415f in semAsgn_41mPO3XBCUDPZnbaNrwpNw () | |
#7 0x000000000047aa67 in semExpr_tayBCUAEli3HMPwxdS9aMbg_2.part.63 () | |
#8 0x000000000048c13b in semStmtList_tayBCUAEli3HMPwxdS9aMbg_25 () | |
#9 0x000000000047a945 in semExpr_tayBCUAEli3HMPwxdS9aMbg_2.part.63 () |
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 VizStats(NTPStats): | |
percs = {} # dictionary of percentages | |
unit = 's' # display units: s, ppm, etc. | |
multiplier = 1 | |
percentile_map = {p: 0 for p in (99, 95, 50, 5, 1)} | |
range_map = {r: 0 for r in [(99, 1), (95, 5)] | |
mu = 0 # arithmetic mean | |
pstd = 0 # population standard distribution, one sigma |
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/perl -w | |
use strict; | |
use Irssi 20010120.0250 (); | |
use vars qw($VERSION %IRSSI); | |
$VERSION = "0.2"; | |
%IRSSI = ( | |
authors => 'Daniel Foerster', | |
contact => 'pydsigner@gmail.com', | |
name => 'messagelog', |
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
; Requires a comparison expression→comparison function post-processor | |
npcs.script("The Doctor", 184, "009-2", 110, 44) { | |
func(`main) { | |
if(player.level < 25) { | |
npc.message("Hmm, it's very interesting, very ... (mumbling).") | |
} | |
elif(player.qvars.episode = nil) { | |
introduction() | |
} |
NewerOlder