Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ex="http://example.org/stuff/1.0/">
<rdf:Description rdf:about="http://example.org/basket">
<ex:hasFruit rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.org/banana"/>
<rdf:Description rdf:about="http://example.org/apple"/>
<rdf:Description rdf:about="http://example.org/pear"/>
</ex:hasFruit>
</rdf:Description>
$ java arq.qparse --opt --print=op 'select* { ?s ?p ?o . filter (?s = <urn:x-foo:bar>) }'
(base <file:///home/pldms/Downloads/>
(filter (= ?s <urn:x-foo:bar>)
(bgp (triple ?s ?p ?o))))
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(base <file:///home/pldms/Downloads/>
(assign ((?s <urn:x-foo:bar>))
(bgp (triple <urn:x-foo:bar> ?p ?o))))
public class FieldTest {
public String f = "hi";
public static void main(String[] args) throws Exception {
boolean a = FieldTest.class.getDeclaredField("f").isAccessible();
System.out.println("Got: " + a);
}
}
require 'java'
class Auth < java.net.Authenticator
def getPasswordAuthentication
if (requesting_host = "www.bbc.co.uk")
return make_auth("libby","bunny")
else
return nil
end
end
require 'java'
Dir.glob("TDB-0.8.4/lib/*.jar") { |jar| require jar }
java_import "com.hp.hpl.jena.tdb.TDB"
java_import "com.hp.hpl.jena.tdb.TDBFactory"
java_import "com.hp.hpl.jena.util.FileManager"
java_import "com.hp.hpl.jena.query.QueryExecutionFactory"
java_import "com.hp.hpl.jena.query.ResultSetFormatter"
require 'java'
class Java::JavaLang::Object
def inspect()
fs = self.java_class.declared_fields
val = "#<#{self.class}: "
fs.each { |f| f.accessible=true; val += "@#{f.name} = #{f.value(self)}, " }
val += ">"
val
end
$ make
make -f inc/Makefile-rules.mk CONF=unix SUBPROJECTS= .build-conf
make[1]: Entering directory `/tmp/jruby-launcher'
make -f inc/Makefile-rules.mk jruby
make[2]: Entering directory `/tmp/jruby-launcher'
mkdir -p build/unix/Linux
rm -f build/unix/Linux/argparser.o.d
g++ -O2 -Wall -c argparser.cpp -MMD -MP -MF build/unix/Linux/argparser.o.d -o build/unix/Linux/argparser.o
argparser.cpp: In member function ‘bool ArgParser::initPlatformDir()’:
argparser.cpp:156: warning: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result
$ make
make -f inc/Makefile-rules.mk CONF=unix SUBPROJECTS= .build-conf
make[1]: Entering directory `/tmp/jruby-launcher'
make -f inc/Makefile-rules.mk jruby
make[2]: Entering directory `/tmp/jruby-launcher'
mkdir -p build/unix/Linux
rm -f build/unix/Linux/argparser.o.d
g++ -O2 -Wall -c argparser.cpp -MMD -MP -MF build/unix/Linux/argparser.o.d -o build/unix/Linux/argparser.o
argparser.cpp: In member function ‘bool ArgParser::initPlatformDir()’:
argparser.cpp:156: warning: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result
$ make
make -f inc/Makefile-rules.mk CONF=unix SUBPROJECTS= .build-conf
make[1]: Entering directory `/tmp/jruby-launcher'
make -f inc/Makefile-rules.mk jruby
make[2]: Entering directory `/tmp/jruby-launcher'
mkdir -p build/unix/Linux
rm -f build/unix/Linux/argparser.o.d
g++ -O2 -Wall -c argparser.cpp -MMD -MP -MF build/unix/Linux/argparser.o.d -o build/unix/Linux/argparser.o
argparser.cpp: In member function ‘bool ArgParser::initPlatformDir()’:
argparser.cpp:155: warning: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result
$ ./GET-rdfa 'http://localhost:8080/resources/bookmark'
Content-type: text/html
<h1>Software error:</h1>
<pre>HTTP response code was not 200 OK. (Set $opts{ignore_http_response_code} to ignore this error.) at ./GET-rdfa line 24
</pre>
<p>
For help, please send mail to this site's webmaster, giving this error message
and the time and date of the error.