Skip to content

Instantly share code, notes, and snippets.

@shellac
shellac / mtr.out
Last active November 18, 2016 12:10
mtr output
> mtr -rw 72.14.191.203
Start: Fri Nov 18 12:09:15 2016
HOST: it061813 Loss% Snt Last Avg Best Wrst StDev
1.|-- ccr1-s34.nwgw.bris.ac.uk 0.0% 10 10.7 1.8 0.7 10.7 3.1
2.|-- br4-ccr1.nwpp.bris.ac.uk 0.0% 10 0.4 1.2 0.3 9.0 2.6
3.|-- br4-fr2-academic.nwpp.bris.ac.uk 0.0% 10 0.8 0.7 0.7 0.8 0.0
4.|-- gr2-fr2.nwpp.bris.ac.uk 0.0% 10 1.2 1.3 1.2 1.6 0.0
5.|-- xe-0-3-0.brisub-rbr1.ja.net 0.0% 10 1.0 1.1 1.0 1.5 0.0
6.|-- ae1.briswe-rbr1.ja.net 0.0% 10 1.3 1.3 1.2 1.7 0.0
7.|-- ae22.londpg-sbr2.ja.net 0.0% 10 4.0 4.1 3.7 5.3 0.3
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite failures="0" time="5.444" errors="2" skipped="0" tests="2" name="uk.ac.ox.it.ords.api.database.resources.DatabaseTest">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64"/>
<property name="java.vm.version" value="24.95-b01"/>
<property name="java.vm.vendor" value="Oracle Corporation"/>
<property name="java.vendor.url" value="http://java.oracle.com/"/>
<property name="path.separator" value=":"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
# On the pi
$ raspivid -t 999999 -o - | nc 192.168.1.87 5001
# On the mac
$ nc -l 5001 | mplayer -fps 31 -cache 1024 -vf halfpack -
@shellac
shellac / annotation.html
Last active December 26, 2015 03:19
Attempt to explain how to fix RDFa example
<!DOCTYPE html>
<html version="HTML+RDFa 1.1"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:aa="http://activearchives.org/terms/">
SELECT DISTINCT ?Sensor0 ?LeftBoundary1 ?RightBoundary2 ?TopBoundary3 ?BottomBoundary4
WHERE {
{
?PathRow5 <http://toto/#bottomBoundary> ?BottomBoundary4 .
?PathRow5 <http://toto/#topBoundary> ?TopBoundary3 .
?PathRow5 <http://toto/#leftBoundary> ?LeftBoundary1 .
?PathRow5 <http://toto/#rightBoundary> ?RightBoundary2 .
?PathRow5 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://toto/#PathRow> .
@shellac
shellac / Jsoup.java
Last active December 17, 2015 15:59
Issue with jsoup addClass -- leading empty class.
import java.util.Set;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
public class Jsoup {
public static void main(String... args) throws Exception {
Document html = Jsoup.parse("<html><body><p>Bye</p><p class=\"baz\">Hi</p></body></html>");
<div vocab="http://example.com/eg/elements/1.1/">
<h3 property="title">5 Centimeters Per Second</h3>
<h4 property="maker">Makoto Shinkai</h4>
</div>
@shellac
shellac / StAX2SAX.java
Created October 2, 2011 20:43
StAX -> SAX convert
package net.rootdev.arpstax;
import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.events.Attribute;
import javax.xml.stream.events.Characters;
@shellac
shellac / result.sh
Created July 5, 2012 09:38
Checking Larryzhao script on jruby master
$ jruby -v
jruby 1.7.0.preview2.dev (ruby-1.9.3-p203) (2012-07-03 a364a87) (OpenJDK 64-Bit Server VM 1.7.0_03) [linux-amd64-java]
$ jruby test.rb
==== Text in English ====
#<MatchData "@chichi dog dog" 1:"@" 2:"chichi" 3:" dog dog">
1. 11
2. 12
3. 18
==== Text in Chinese ====
#<MatchData "@chichi 狗狗" 1:"@" 2:"chichi" 3:" 狗狗">
@shellac
shellac / branch_predict.rb
Created June 28, 2012 17:24
Branch prediction is detectable on jruby
require 'benchmark'
array_size = 32768
data = Array.new(array_size)
array_size.times { |c| data[c] = rand(256)}
data_sorted = data.sort
def sum(array)