Skip to content

Instantly share code, notes, and snippets.

View terrycojones's full-sized avatar

Terry Jones terrycojones

View GitHub Profile
ii ca-certificates-java 20100406ubuntu1 Common CA certificates (JKS keystore)
ii java-common 0.34 Base of all Java packages
ii libaccess-bridge-java 1.26.2-3 Java Access Bridge for GNOME
ii libaccess-bridge-java-jni 1.26.2-3 Java Access Bridge for GNOME (jni bindings)
ii libantlr-java 2.7.7-15ubuntu1 language tool for constructing recognizers,
ii libbackport-util-concurrent-java 3.1-2ubuntu2 backport of java.util.concurrent to Java 1.4
ii libcommons-beanutils-java 1.8.2-1 utility for manipulating JavaBeans
ii libcommons-codec-java 1.4-2 encoder and decoders such as Base64 and hexa
ii l
@terrycojones
terrycojones / gist:1991029
Created March 7, 2012 05:02
Smallest natural number with no English wikipedia page
import itertools, requests
for i in itertools.count():
r = requests.get('http://en.wikipedia.org/wiki/%d' % i)
if r.status_code == 404:
print i
break
[2012-03-24 01:28] <terrycojones> exarkun: thanks for fielding the question in stackoverflow related to txRDQ. i'm trying to figure out what's going wrong.
[2012-03-24 01:30] <terrycojones> exarkun: i've been putting in print stmts for about 30 mins and everything seems fine, but trial for some reason is printing [ERROR].
[2012-03-24 01:32] <idnar> terrycojones: the usual cause of an [ERROR] when there's apparently no exception being raised is that an exception was *logged* and not flushed
[2012-03-24 01:32] <idnar> (at least, in my experience)
[2012-03-24 01:32] <idnar> (I have absolutely no context here though, so that's just a wild guess)
[2012-03-24 01:33] <terrycojones> idnar: that sounds plausible / in line with exarkun's ticket suggestion, thanks. you just caused me to go read what exarkun wrote a bit more closely :-)
[2012-03-24 01:54] <terrycojones> idnar: well, i still don't see what the error is. idnar context is at http://stackoverflow.com/questions/9728781/testing-a-failing-job-in-resizabledisp
# In the following line, url = http://api.tumblr.com/v2/user/info/
req = oauth.Request(method='POST', url=url, parameters=params)
## Sign the request.
signature_method = oauth.SignatureMethod_HMAC_SHA1()
req.sign_request(signature_method, self.consumer, self.token)
resp, content = self.client.request(req.to_url(), 'POST', headers=self.headers)
from json import loads
from oauth2 import Client, Consumer, Token
from urllib import urlencode
class TumblrError(Exception):
"""Hold information about an error from the Tumblr API.
@param url: The C{str} URL that the API call used.
@param status: The C{int} HTTP status returned in the error.
Start-Date: 2012-04-17 16:44:19
Install: s3cmd (0.9.9.91-1)
End-Date: 2012-04-17 16:44:23
Start-Date: 2012-04-17 16:44:27
Install: haproxy (1.3.22-1)
End-Date: 2012-04-17 16:44:33
Start-Date: 2012-04-17 16:44:48
Install: python-django (1.1.1-2ubuntu1.4)
[Tuesday 17 April 2012] [16:43:03] <terrycojones> esteve: trying with https://gist.github.com/d7a502481c5e37385044 (committed)
[Tuesday 17 April 2012] [16:43:18] <esteve> terrycojones: cool
[Tuesday 17 April 2012] [16:50:22] <terrycojones> esteve: trying to get you a paste of the output.
[Tuesday 17 April 2012] [16:50:29] <esteve> terrycojones: ok
[Tuesday 17 April 2012] [16:50:33] <terrycojones> esteve: it didn't fail. quite a few warnings etc.
[Tuesday 17 April 2012] [16:50:45] <terrycojones> but my browser is showing all pages as blank :-(
(if (and
(boundp 'i-use-js2-mode)
i-use-js2-mode)
(progn
(require 'js-comint)
(setq-default js2-basic-offset 4)
(setq
js2-enter-indents-newline t
js2-consistent-level-indent-inner-bracket-p t
js2-pretty-multiline-decl-indentation-p t
282 buffers open, in 26 distinct modes
120 python ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
50 dired ++++++++++++++++++++++++++++++++++++++++++++++++++
31 fundamental +++++++++++++++++++++++++++++++
31 js2 +++++++++++++++++++++++++++++++
10 html ++++++++++
6 dcl ++++++
4 help ++++
4 text ++++
{
"description": "Welcome to Findings Browse and share fascinating writing from anywhere. Sign in with Twitter to start your collection!",
"provider_name": "Findings",
"provider_url": "http://labs.findings.com",
"thumbnail_height": 500,
"thumbnail_url": "http://a0.twimg.com/profile_images/1769514792/image1327099968.png",
"thumbnail_width": 400,
"title": "Findings (beta)",
"type": "link",
"url": "http://labs.findings.com",