Skip to content

Instantly share code, notes, and snippets.

View njh's full-sized avatar

Nicholas Humfrey njh

View GitHub Profile
@njh
njh / rasqal_world_get_query_language_description.patch
Created February 3, 2011 14:49
Patch to add rasqal_world_get_query_language_description() function to rasqal
diff --git a/src/rasqal.h.in b/src/rasqal.h.in
index 52657ad..8df1027 100644
--- a/src/rasqal.h.in
+++ b/src/rasqal.h.in
@@ -1041,7 +1041,11 @@ rasqal_feature rasqal_feature_from_uri(rasqal_world* world, raptor_uri *uri);
RASQAL_API
int rasqal_feature_value_type(const rasqal_feature feature);
+
; SVR records for Jabber
jabber CNAME hadrian.aelius.com.
_jabber._tcp SRV 5 0 5269 jabber.aelius.com.
_xmpp-server._tcp SRV 5 0 5269 jabber.aelius.com.
_xmpp-client._tcp SRV 5 0 5222 jabber.aelius.com.
; Other SRV records
_http._tcp SRV 0 100 80 www.aelius.com.
// gcc -o float_test float_test.c && ./float_test
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
float f = 0.9;
int i = f * 10.0;
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:owl = "http://www.w3.org/2002/07/owl#"
xmlns:foaf = "http://xmlns.com/foaf/0.1/"
xmlns:sioc = "http://rdfs.org/sioc/ns#"
xmlns:po = "http://purl.org/ontology/po/"
xmlns:pod = "http://purl.org/ontology/pod/"
xmlns:mo = "http://purl.org/ontology/mo/"
xmlns:skos = "http://www.w3.org/2008/05/skos#"
{ "programme" : { "display_titles" : { "subtitle" : "Series 5, Wales Main",
"title" : "Great British Menu"
},
"duration" : 1800,
"formats" : [ { "id" : "PT008",
"inScheme" : "formats",
"key" : "gamesandquizzes",
"label" : "Games & Quizzes",
"prefLabel" : "Games & Quizzes",
"title" : "Games & Quizzes",
<?php
public function getFeedMapping()
{
$type = Zend_Uri::factory('http://purl.org/ontology/po/Programme');
$image_uri = Zend_Uri::factory($this->image->getUrl(512, 288));
if ($this->display_buzz) {
$hash_tags = $this->hash_tags;
$articles = $this->articles;
$discussions = $this->discussions;
} else {
#!/bin/sh
if [ -e Makefile ]; then
make maintainer-clean
fi
# This is in maintainer/debug mode
./autogen.sh
make
make distdir
@njh
njh / bbc_episodes_for_brand.rb
Created May 3, 2011 15:47
Ruby code to get all the episode PIDs for a BBC Brand
#!/usr/bin/env ruby
require 'rubygems'
require 'rdf'
require 'rdf/rdfxml'
PROGRAMMES_URL = 'http://www.bbc.co.uk/programmes'
PO = RDF::Vocabulary.new("http://purl.org/ontology/po/")
brand_pid = 'b0081dq5'
Host Loss% Snt Last Avg Best Wrst StDev
1. router-sis0.aelius.co.uk 0.0% 171 1.6 1.6 1.3 6.4 0.6
2. b.gormless.thn.aaisp.net.uk 0.0% 171 38.7 39.5 36.2 66.9 2.8
3. 2001:7f8:4::50e8:1 0.6% 171 42.3 39.8 36.2 92.4 4.4
4. linx-gw1.ja.net 45.0% 170 38.5 43.5 36.5 108.8 12.7
5. ae1.lond-sbr4.ja.net 45.6% 170 41.4 44.9 36.3 147.3 18.2
6. 2001:630:0:10::101 45.0% 170 40.2 45.8 36.6 166.8 20.7
7. lense.lond-sbr1.ja.net 45.0% 170 42.4 43.5 40.4 80.0 3.9
8. 2001:630:c1:18::b 45.0% 170 43.0 43.5 40.4 53.9 2.1
9. 2001:630:c1:100::2 45.0% 170 53.4 47.0 40.3 245.4 21.1
ip-60.aelius.co.uk (::) Tue May 17 18:22:47 2011
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. router-sis0.aelius.co.uk 0.0% 68 1.5 1.7 1.3 6.1 0.8
2. b.gormless.thn.aaisp.net.uk 0.0% 67 38.3 39.1 36.7 42.4 0.9
3. 2001:7f8:17::50e8:1 1.5% 67 39.6 39.6 38.0 45.9 1.3
4. 2001:7f8:17::8a61:2 54.5% 67 38.0 43.7 37.5 141.0 18.4
5. gi4-10.cr01.man.bytemark.co.uk 53.0% 67 172.3 59.7 43.7 194.6 37.8
6. lapwing.bytemark.co.uk 43.3% 67 45.4 46.5 43.7 50.5 1.7