Skip to content

Instantly share code, notes, and snippets.

View lbjay's full-sized avatar

Jay Luker lbjay

View GitHub Profile
@lbjay
lbjay / gist:1113980
Created July 29, 2011 14:57
unittest_invenio.py output
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
# /usr/lib64/python2.4/site.pyc matches /usr/lib64/python2.4/site.py
import site # precompiled from /usr/lib64/python2.4/site.pyc
# /usr/lib64/python2.4/os.pyc matches /usr/lib64/python2.4/os.py
import os # precompiled from /usr/lib64/python2.4/os.pyc
import posix # builtin
# /usr/lib64/python2.4/posixpath.pyc matches /usr/lib64/python2.4/posixpath.py
import posixpath # precompiled from /usr/lib64/python2.4/posixpath.pyc
@lbjay
lbjay / gitd alias
Created July 22, 2011 13:39
list branches based on modtime
Have you wished you could see your branches listed by how recently you
worked on them? I often do. I get lazy and end up with a lot of things
called 'test1...N' or sometimes when I'm working with other people, I
lose track of which branch is their version of a thing and which is my
version.
This handy shell alias (stick it in your ~/.bashrc) can help. Thanks Jan!
{{{
alias gitd='git for-each-ref --format="%(committerdate:short):
@lbjay
lbjay / gist:970705
Created May 13, 2011 15:11
return items from a list 2-at-a-time as 2-item tuples
def group(iterator, count):
itr = iter(iterator)
while True:
yield tuple([itr.next() for i in range(count)])
\documentclass[%
reprint,
%superscriptaddress,
%groupedaddress,
%unsortedaddress,
%runinaddress,
%frontmatterverbose,
%preprint,
showpacs,preprintnumbers,
nofootinbib,
157.23412 = (MATCH) boost(+body_syn:anagular +body_syn:diamater +body_syn:deredshifted,sum(product(float(cite_read_boost),const(5.0)),const(1.0))), product of:
45.160004 = (MATCH) sum of:
4.0087123 = (MATCH) weight(body_syn:anagular in 392299), product of:
0.4573753 = queryWeight(body_syn:anagular), product of:
2.3424382 = idf(docFreq=163755, maxDocs=626918)
0.19525607 = queryNorm
8.764602 = (MATCH) fieldWeight(body_syn:anagular in 392299), product of:
3.7416575 = tf(termFreq(body_syn:anagular)=14)
2.3424382 = idf(docFreq=163755, maxDocs=626918)
1.0 = fieldNorm(field=body_syn, doc=392299)
@lbjay
lbjay / bitset_facet_query.py
Created February 1, 2011 19:01
script for testing facet queries using a compressed bitset
import sys
import urllib2
from invenio import intbitset
from optparse import OptionParser
import simplejson
import mimetools
if __name__ == '__main__':
op = OptionParser()
jluker@adsx:~> 12:32:49 5001 $ free -g
total used free shared buffers cached
Mem: 141 1 140 0 0 0
-/+ buffers/cache: 0 141
Swap: 195 0 195
@lbjay
lbjay / siege_urls.txt
Created January 26, 2011 20:48
timed fetching of compressed bitsets from solr
Lifting the server siege... done. Transactions: 1957 hits
Availability: 100.00 %
Elapsed time: 74.76 secs
Data transferred: 27.29 MB
Response time: 0.08 secs
Transaction rate: 26.18 trans/sec
Throughput: 0.37 MB/sec
Concurrency: 2.05
Successful transactions: 1957
Failed transactions: 0
@lbjay
lbjay / schema.xml
Created January 21, 2011 20:05
similarity factory config
<similarity class="org.ads.solr.CustomSimilarityFactory">
<lst name="body">
<int name="min">500</int>
<int name="max">10000</int>
<float name="steepness">0.5</float>
</lst>
<lst name="body_syn">
<int name="min">500</int>
<int name="max">20000</int>
<float name="steepness">0.5</float>
Dear Colleagues:
I am writing to address the coverage and comments in the news media and online surrounding NPG’s exhibition, “Hide/Seek: Difference and Desire in American Portraiture” which explores the role of gender identity in American portraiture. I toured it early on with curator David Ward and was impressed by the depth of the scholarship and thoughtfulness of the exhibition.
Most of the recent attention about the exhibition has focused on 11 seconds of a four-minute video clip, perceived by some to be anti-Christian and intentionally provocative. Neither description could be further from the truth. However, it was clear that this video was detracting from the entirety of the exhibition, so NPG removed the video.
That decision was not made lightly or in a vacuum. After consulting with NPG Director Marty Sullivan and others at the museum, and Richard Kurin, Under Secretary for History, Art and Culture, I made the final decision to take down the video.
I understand this move is being critici