Skip to content

Instantly share code, notes, and snippets.

# this class will have to parse strings like "Data=B/P^122/82^^^^^^^" to get back a blood pressure of 122 over 82
class VitalSign
attr_accessor :kind, :value
def initialize(kind, value)
@kind, @value = kind, value
end
def self.create_vital_sign_from_vista_string(vista_string)
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/local/lib/libjtokyocabinet.1.1.0.dylib: no suitable image found. Did find: /usr/local/lib/libjtokyocabinet.1.1.0.dylib: mach-o, but wrong architecture /usr/local/lib/libjtokyocabinet.1.1.0.dylib: mach-o, but wrong architecture
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1881)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1798)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1047)
at tokyocabinet.Loader.load(Loader.java:41)
at tokyocabinet.HDB.<clinit>(HDB.java:37)
at Blah$.main(Blah.scala:6)
at Blah.main(Blah.scala)
./configure CFLAGS='-arch x86_64'
CFLAGS = -std=c99 -Wall -fPIC -fsigned-char -O2 -arch x86_64
context "when receiving a POST" do
should "not allow an incomplete request" do
post '/', {:type => 'extension'}
assert_equal 400, last_response.status
end
should "allow the registration of a new extension" do
post '/', {:type => 'extension',
:typeId =>
'http://projecthdata.org/hdata/schemas/2009/06/allergy',
class Extension
include DataMapper::Resource
property :id, Serial
property :type_id, String, :length => 200
property :requirement, String
validates_is_unique :type_id,
:message =>
"Extension with that type id already exists"
post '/' do
check_params
handle_extension if params[:type].eql?('extension')
handle_section if params[:type].eql?('section')
end
def check_params
unless ['extension', 'section'].include? params[:type]
halt 400,
"Your request must specify a type of section or extension"
Gwibber Dispatcher: DEBUG <twitter:receive> Performing operation
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/gwibber/microblog/network.py", line 32, in __init__
self.curl.perform()
error: (6, 'name lookup timed out')
Gwibber Dispatcher: ERROR Failed to communicate with http://api.flickr.com/services/rest?username=eedrummer&api_key=36f660117e6555a9cbda4309cfaf72d0&nojsoncallback=1&method=flickr.people.findByUsername&format=json
Gwibber Dispatcher: ERROR Failed to parse the response, error was: No JSON object could be decoded
Gwibber Dispatcher: ERROR <flickr:images> Operation failed
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/gwibber/microblog/network.py", line 32, in __init__
@eedrummer
eedrummer / gist:638892
Created October 21, 2010 17:19
How to run JavaScript in Ruby via the Ruby Racer
# Install the gem, then
require 'v8'
cxt = V8::Context.new
cxt["effectiveTime"] = Time.gm(2010, 9, 19).to_i
cxt.eval("effectiveTime - (365 * 24 * 60 * 60)") #=> 1253318400
@eedrummer
eedrummer / gist:741573
Created December 15, 2010 03:10
Using Underscore.js with MongoDB
require 'mongo'
require 'ap'
include Mongo
# Create a connection to a local MongdDB Instance
db = Connection.new.db('underscore-demo')
# Read and eval Underscore.js
underscore = File.read('underscore-min.js')