Skip to content

Instantly share code, notes, and snippets.

View lbjay's full-sized avatar

Jay Luker lbjay

View GitHub Profile
junit-sequential:
[junit] WARNING: multiple versions of ant detected in path for junit
[junit] jar:file:/usr/share/java/ant.jar!/org/apache/tools/ant/Project.class
[junit] and jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
[junit] Testsuite: invenio.montysolr.TestMontySolrBasicOperations
[junit] Warning: we add the default folder to sys.path:
[junit] /home/jluker/workspace/montysolr/build/dist
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.6 sec
[junit]
[junit] ERROR:root:Unknown target; message_id=*:unknown_call
@lbjay
lbjay / gist:1535822
Created December 29, 2011 19:36
pdf-extract extract --sections
<?xml version="1.0"?>
<pdf>
<section line_height="9.96" font="KAAPYP+CMR10" letter_ratio="0.02" year_ratio="0.0" cap_ratio="0.0" name_ratio="0.2767857142857143"
word_count="112" lateness="0.06666666666666667" reference_score="4.6">
<line x_offset="0.0" y_offset="117.01" spacing="0.5">Abstract.</line>
<line x_offset="57.0" y_offset="116.52" spacing="-9.47">Theory is presented for the distributions of local process intensity
and</line>
<line x_offset="0.0" y_offset="103.56" spacing="3.0">local average pore dimensions in random fibrous materials. For complete
partitioning</line>
<line x_offset="0.0" y_offset="90.6" spacing="3.0">of the network into contiguous square zones, the variance of local process
pdf-extract extract --sections 2259.pdf --trace
/home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-reader-1.0.0.rc1/lib/pdf/reader/object_hash.rb:73:in `[]': undefined method `to_i' for {:BaseFont=>:"Times-Roman", :Type=>:Font, :Subtype=>:Type1}:Hash (NoMethodError)
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/model/characters.rb:132:in `block in build_fonts'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/model/characters.rb:131:in `each'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/model/characters.rb:131:in `build_fonts'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/model/characters.rb:163:in `block (2 levels) in include_in'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf.rb:81:in `call'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf.rb:81:in `block (2 levels) in expand_listeners_to_callback_methods'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/p
pdf-extract mark --headers --footers --bodies 2259.pdf --trace
/home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf.rb:169:in `invoke_calls': undefined method `pages' for #<PDF::Reader:0x000000027cd880> (NoMethodError)
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf-extract.rb:43:in `block in parse'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf-extract.rb:39:in `each'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf-extract.rb:39:in `parse'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/lib/pdf-extract.rb:54:in `view'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/bin/pdf-extract:116:in `block (4 levels) in <top (required)>'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/bin/pdf-extract:113:in `each'
from /home/jluker/.rvm/gems/ruby-1.9.2-p290/gems/pdf-extract-0.0.9/bin/pdf-extract:113:in `block (3 levels) in <top (required)>'
from /home/jluker/
public static void regexQuery(String pattern) throws Exception {
Directory dir = FSDirectory.open(new File(SOLR_HOME + "/fulltext-build/data/index/"));
IndexReader reader = IndexReader.open(dir, true);
IndexSearcher searcher = new IndexSearcher(reader);
Term t = new Term("body", pattern);
Query q = new RegexQuery(t);
System.out.println("query object: " + q);
System.out.println("stats: " + reader.numDocs());
TopDocs docs = searcher.search(q, 10);
FastVectorHighlighter fvh = new FastVectorHighlighter(false, true);
@lbjay
lbjay / gist:1368067
Created November 15, 2011 19:30
node wikipulse.js error
[email protected]:~/projects/wikipulse> 14:29:46 5059 $ node wikipulse.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function.<anonymous> (module.js:376:11)
at Object.<anonymous> (/home/lbjay/projects/wikipulse/node_modules/irc-js/lib/irc.js:15:8)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
@lbjay
lbjay / gist:1365195
Created November 14, 2011 21:16
montysolr compile errors
compile:
[javac] /home/jluker/workspace/montysolr/build.xml:249: warning: 'includeantruntime' was not set, defaulting to bu
ild.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 72 source files to /home/jluker/workspace/montysolr/bin
[javac] /home/jluker/workspace/montysolr/src/java/org/apache/lucene/queryParser/aqp/processors/AqpQProcessor.java:
14: warning: sun.reflect.generics.reflectiveObjects.NotImplementedException is Sun proprietary API and may be removed
in a future release
[javac] import sun.reflect.generics.reflectiveObjects.NotImplementedException;
[javac] ^
[javac] /home/jluker/workspace/montysolr/src/java/org/apache/solr/search/InvenioQParserPlugin.java:15: cannot find
import urllib2
from invenio import intbitset
import simplejson
import mimetools
def get_facets(bitset, solr_url):
facet_query_url = "%s/invenio_facets" % solr_url
# now use the bitset to fetch the facet data
@lbjay
lbjay / gist:1320843
Created October 27, 2011 20:56
fails
import junit.framework.TestCase;
public class TestSanity extends TestCase {
public void testMatch() {
assertTrue("FOOBAR".matches("FOO"));
}
}
INFO 2011-10-27T12:53:03 supybot horatio called by "anarchivist!~anarchivi@unaffiliated/anarchivist".
ERROR 2011-10-27T12:53:03 supybot Uncaught exception in ['horatio'].
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/supybot/callbacks.py", line 1180, in _callCommand
self.callCommand(command, irc, msg, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/supybot/utils/python.py", line 86, in g
f(self, *args, **kwargs)
File "/usr/lib/pymodules/python2.6/supybot/callbacks.py", line 1166, in callCommand
method(irc, msg, *args, **kwargs)
File "/home/zoia/supybot/supybot-plugins/plugins/Translators/plugin.py", line 312, in horatio