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 os, os.path, sys, time | |
if not len(sys.argv) in (2, 3): | |
print "Usage: %s dir_to_scan [num_tests]" % (sys.argv[0],) | |
sys.exit(1) | |
num_tests = 5 | |
if len(sys.argv) == 3: | |
try: | |
num_tests = int(sys.argv[2]) |
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 SomeClass: | |
def __init__(self, some_var=[]): | |
self.data = some_var | |
def append(self, var): | |
self.data.append(var) | |
a = SomeClass() | |
a.append(1) | |
a.append(2) |
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
# This file is part of the Minecraft Overviewer. | |
# | |
# Minecraft Overviewer is free software: you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License as published | |
# by the Free Software Foundation, either version 3 of the License, or (at | |
# your option) any later version. | |
# | |
# Minecraft Overviewer is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
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
(04/08/11 23:18:24) [core] error: error in <local.build.BuildPlugin object at 0x2d66710> | |
Traceback (most recent call last): | |
File "/home/agrif/devel/gitbot/hesperus/agent.py", line 73, in start | |
item[0](self, *item[1], **item[2]) | |
File "/home/agrif/devel/gitbot/hesperus/plugin.py", line 152, in handle_incoming | |
if func(self, chans, msg, direct, reply): | |
File "/home/agrif/devel/gitbot/hesperus/plugin.py", line 143, in sub_function | |
func(self, chans, match, direct, reply) | |
File "/home/agrif/devel/gitbot/local/build.py", line 70, in build_command | |
j = self.gm_client.submit_job(func, data, background=False, wait_until_complete=False) |
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 | |
usage = "python contrib/%prog [-v] [-f file] [-o output/]" | |
description = """ | |
Extracts the given MCR file into output/. If -o is not provided, it | |
will be derived from the input file name. | |
""" | |
from optparse import OptionParser |
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
$n = unpack("N", ...); | |
$res = 0.0; | |
for ($bit = 0; $bit < 32; $bit++) { | |
if ($n & (1 << $bit)) { | |
$res += pow(2, $bit); | |
} | |
} | |
echo $res; |
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
rendermode = ['lighting', 'subway-cave', 'subway-overlay'] | |
custom_rendermodes = { | |
'subway-cave' : {'parent' : 'cave', | |
'description' : 'a subway map, based on the cave rendermode', | |
'options' : { | |
'depth_tinting' : False, | |
'lighting' : True, | |
'only_lit' : True, | |
'min_depth' : 40, |
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
EAPI=2 | |
inherit git distutils | |
DESCRIPTION="Generates large resolution images of a Minecraft map." | |
HOMEPAGE="http://overviewer.org/" | |
EGIT_REPO_URI="git://github.com/brownan/Minecraft-Overviewer.git" | |
LICENSE="GPL-3" | |
SLOT="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
rendermode = ['lighting', 'dungeon'] | |
custom_rendermodes = { | |
'dungeon' : { | |
'parent' : 'mineral', | |
'description' : 'an overlay showing the location of dungeons', | |
'options' : { | |
'minerals' : [ | |
(52, (0, 0, 255)), | |
(48, (0, 255, 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
rendermode = ['my-custom-mode'] | |
custom_rendermodes = { | |
'my-custom-mode' : {'parent' : 'cave', | |
'description' : 'a custom mode that only renders certain depths', | |
'options' : { | |
#'depth_tinting' : False, | |
#'lighting' : True, | |
#'only_lit' : True, | |
'min_depth' : 40, |
OlderNewer