Skip to content

Instantly share code, notes, and snippets.

@bct
bct / gist:20877
Created October 30, 2008 01:58
sparqling soprano via dbus and ruby
=begin
nepomukserver --nofork
And then:
kcmshell4 kcm_nepouk
to set what files to scan.
If the environment variable DBUS_SESSION_BUS_ADDRESS is not set then you
Index: mimeparse.rb
===================================================================
--- mimeparse.rb (revision 10)
+++ mimeparse.rb (working copy)
@@ -117,6 +117,16 @@
quality_parsed(mime_type, parsed_ranges)
end
+def _best_match(supported, parsed_header, &comparator)
+ weighted_matches = supported.map do |mime_type|
It is written in the Book of Lugh:
After the Creation, the cruel god Moloch rebelled
against the authority of Marduk the Creator.
Moloch stole from Marduk the most powerful of all
the artifacts of the gods, the Amulet of Yendor,
and he hid it in the dark cavities of Gehennom, the
Under World, where he now lurks, and bides his time.
Your god Lugh seeks to possess the Amulet, and with it
/* input variable location definitions */
{{for type, name, dir, size, row, human_location in inputs}}
IEC_{{type}} beremiz{{name}};
IEC_{{type}}* {{name}} = &beremiz{{name}};
{{endfor}}
#0 soup_message_headers_remove (hdrs=0x1f39100, name=0x7f0dadcf059b "Cookie")
at soup-message-headers.c:239
#1 0x00007f0dac38e9b5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#2 0x00007f0dac39d5e5 in signal_emit_unlocked_R () from /usr/lib/libgobject-2.0.so.0
#3 0x00007f0dac39e860 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#4 0x00007f0dac39ea3b in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#5 0x00007f0dac38e9b5 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#6 0x00007f0dac39d5e5 in signal_emit_unlocked_R () from /usr/lib/libgobject-2.0.so.0
#7 0x00007f0dac39e860 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#8 0x00007f0dac39ea3b in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
/* from soup-cookie-jar.c in libsoup */
static void
request_started (SoupSessionFeature *feature, SoupSession *session,
SoupMessage *msg, SoupSocket *socket)
{
SoupCookieJar *jar = SOUP_COOKIE_JAR (feature);
char *cookies;
cookies = soup_cookie_jar_get_cookies (jar, soup_message_get_uri (msg), TRUE);
Note to self:
http://lab.arc90.com/experiments/readability/
This is the content of the bookmarklet:
javascript:(function(){
readStyle='style-newspaper';
readSize='size-medium';
readMargin='margin-medium';
# This is a stripped-down wxPython program with a custom wxPyGridCellEditor that
# crashes on my machine (wxPython 2.8.10.1 with Python 2.5 on Windows XP).
#
# I can make the program crash in two ways, I'm not sure they're related.
# Short way:
# 1. Edit the first row's "Class" field. You should get a drop-down with "Local"
# and "Temp".
# 2. Select a value from the drop-down. The program crashes.
#
# Long way:
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
require 'time'
get '/' do
haml <<END
%h1 test cookies.
open("/home/bct/.mozilla/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 11
access("/home/bct/.mozilla/plugins/libflashplayer.so", F_OK) = 0
open("/home/bct/.netscape/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/browser/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/mozilla/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/firefox/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib64/browser-plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/browser-plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/mozilla/plugins", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/local/netscape/plugins", O_RDONLY|O_NONBLO