Skip to content

Instantly share code, notes, and snippets.

Thomas Kluyver takluyver

Block or report user

Report or block takluyver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:10509891
problem = 'A-sample'
fin = open(problem + '.in')
fout = open(problem + '.out')
def read_ints():
return [int(x) for x in fin.readline().strip().split()]
T = read_ints()
for caseno in range(T):
@takluyver
takluyver / expsuite.py
Created Apr 19, 2014
Python Experiment Suite on Python 3
View expsuite.py
#############################################################################
#
# PyExperimentSuite
#
# Derive your experiment from the PyExperimentSuite, fill in the reset() and
# iterate() methods, and define your defaults and experiments variables
# in a config file.
# PyExperimentSuite will create directories, run the experiments and store the
# logged data. An aborted experiment can be resumed at any time. If you want
# to resume it on iteration level (instead of repetition level) you need to
View ItemStatusChecker.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ItemStatusChecker.py
from twisted.internet import reactor
from scrapy.crawler import Crawler
from scrapy import log, signals
from site_scraper.spiders.scrape1 import MySpider
from scrapy.utils.project import get_project_settings
import wx
@takluyver
takluyver / kernelbase.diff
Created Jun 6, 2014
IPython kernel base class refactoring
View kernelbase.diff
--- ipkernel.py 2014-06-05 18:24:50.657690648 -0700
+++ kernelbase.py1 2014-06-05 18:08:47.899279566 -0700
@@ -1,14 +1,12 @@
-"""An interactive kernel that talks to frontends over 0MQ."""
+"""Base class for a kernel that talks to frontends over 0MQ."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
View GPL_EXCEPTION.txt
Riverbank GPL Exception version 1.1
===================================
Additional rights granted beyond the GPL (the "Exception").
As a special exception to the terms and conditions of version 2.0 of the GPL,
Riverbank hereby grants you the rights described below, provided you agree to
the terms and conditions in this Exception, including its obligations and
restrictions on use.
View gist:a8fbba58ecbd234e4d50
Not Critical
DNS Name: ssl6508.cloudflare.com
DNS Name: *.tax-i.co
DNS Name: *.e-tasawak.com
DNS Name: e-tasawak.com
DNS Name: *.tixbox.com
DNS Name: tableagent.com
DNS Name: *.shunga.com
DNS Name: *.therighthairstyles.com
DNS Name: *.tableagent.com
@takluyver
takluyver / __init__.py
Created Sep 25, 2014
osgeo/__init__.py modification
View __init__.py
# __init__ for osgeo package.
# making the osgeo package version the same as the gdal version:
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
@takluyver
takluyver / JS link alternate.ipynb
Created Oct 22, 2014
Alternate frontend linking using comms
View JS link alternate.ipynb
@takluyver
takluyver / write_nsi_template.py
Created Nov 16, 2014
Pynsist nsi template rewritten as Python
View write_nsi_template.py
from nsist.nsigen import *
Document([
Comment('Definitions will be added above'),
Instruction('SetCompressor', 'lzma'),
Instruction('RequestExecutionLevel', 'admin'),
'',
Comment("Modern UI installer stuff"),
CompilerCommand("include", "MUI2.nsh"),
define("MUI_ABORTWARNING"),
View nsigen.py
class Comment(object):
def __init__(self, content):
self.content = content
def generate(self, state=None):
yield "; " + self.content
def _should_quote(arg):
return (' ' in arg) or ('$' in arg)
You can’t perform that action at this time.