Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xml:lang="en">
<head>
<title>Quick and Dirty Product Search</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
</head>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:opds="http://opds-spec.org/2010/catalog"
xml:lang="en">
<title>New Releases</title>
<updated>2010-05-13T20:54:25.377108+00:00</updated>
<author>
<name>O'Reilly Media</name>
</author>
<id>http://apps.oreilly.com/opds/new</id>
<rdf:RDF
xmlns:perms='http://purl.oreilly.com/permission/'
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
xmlns:dc='http://purl.org/dc/terms/'
>
<perms:Permission rdf:about="http://members.oreilly.com/permission/2010-05-25T21:59:11.258595?grantee=http%3A%2F%2Fopenid.localhost.local%3A5000%2Fc5589322-65ca-460e-a451-c5066546e15c&amp;accessTo=urn%3Ax-domain%3Aoreilly.com%3Aproduct%3A9780596802189.EBOOK">
<perms:grantor rdf:resource="http://openid.localhost.local:5000/c5589322-65ca-460e-a451-c5066546e15c"/>
<perms:grantee rdf:resource="http://openid.localhost.local:5000/c5589322-65ca-460e-a451-c5066546e15c"/>
<dc:creator rdf:resource="http://openid.localhost.local:5000/c5589322-65ca-460e-a451-c5066546e15c"/>
<dc:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2010-05-25T21:59:11.258595</dc:issued>
"""Provides common classes and functions for modelling an RDF graph using
Python objects."""
__all__ = ['parse_curie', 'to_curie','MetaSubject', 'Subject', 'PredicateProperty',
'ScalarPredicateProperty', 'ResourcePredicateProperty',
'ScalarResourcePredicateProperty', 'ResourceReversePredicateProperty',
'SelfReferentialPredicateProperty', 'ScalarSelfReferentialPredicateProperty',
'RDFClassMismatchError',]
import os.path
@gcarothers
gcarothers / __init__.py
Created October 28, 2010 16:07
Template Packages
"""Functions for doing things with template packages.
Template packages are collections of templates and code that they use for
support when rendering."""
import os.path
import os
import urlparse
import sys
Index: src/com/hp/hpl/jena/sdb/compiler/QueryCompilerMain.java
===================================================================
--- src/com/hp/hpl/jena/sdb/compiler/QueryCompilerMain.java (revision 8170)
+++ src/com/hp/hpl/jena/sdb/compiler/QueryCompilerMain.java (working copy)
@@ -80,6 +80,8 @@
// Some changes can still be made now w have the whole SQL expression.
Op op3 = postProcessSQL(op2) ;
+ // Find all OpSQL nodes and put a bridge round them. ... again
+ OpWalker.walk(op3, new SqlNodesFinisher(patternIsOneSQLStatement)) ;
@gcarothers
gcarothers / html5-utf-8.py
Created December 7, 2011 23:02
Example HTML5 UTF-8 string with errors
html_example = "41 98 BA 42 E2 98 43 E2 98 BA E2 98"
bytes_in_hex = html_example.split(" ")
html_example_bytes = ''.join((chr(int(x,16)) for x in bytes_in_hex))
# html_example_bytes.decode('utf-8') #Throws error
replaced_unicode = html_example_bytes.decode('utf-8', 'replace')
assert(u'A\ufffd\ufffdB\ufffdC\u263a\ufffd' == replaced_unicode)
@gcarothers
gcarothers / Results
Created December 13, 2011 21:41
NFSv4
postgres@lex5:/mnt/wal_archive/test$ touch something
touch: cannot touch `something': Permission denied
postgres@lex5:/mnt/wal_archive/test$ ls -la
total 8
drwxr-xr-x 2 postgres postgres 4096 2011-12-13 13:21 .
drwxr-xr-x 3 postgres postgres 4096 2011-12-13 13:21 ..
------
postgres@lex6:/export/wal_archive/test$ ls -la
@gcarothers
gcarothers / gist:1506664
Created December 21, 2011 16:30
Not a Dataset
Abstract:
{ ( {<a> <b> <c> , mailto:ivan@w3.org ), ( {}, mailto:ivan@w3.org ) }
TriG:
<mailto:ivan@w3.org> {
<a> <b> <c> .
}
@gcarothers
gcarothers / endorsement.md
Created January 17, 2012 20:23
Endorsement, a graph naming use case

Exploring Use Cases

Endorsement (3rd Use Case from Sandro)

A system wants to convey to another system in RDF that some person agrees with or disagrees with certain RDF triples.

Concrete Example

Alice wants to say that she agrees that Bob is named Bob.