Skip to content

Instantly share code, notes, and snippets.

View irjudson's full-sized avatar

Ivan R. Judson irjudson

View GitHub Profile
# @return [Integer]
# The number of records that were actually saved into the
# data-store
#
# @api semipublic
def create(resources)
created = 0
resources.each do |resource|
if resource.cn.nil? || resource.cn.empty?
resource.cn = "test_#{rand(9999)}"
# Allow the metal piece to run in isolation
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails)
class Datastore
def self.call(env)
if env['PATH_INFO'] =~ /^\/datastore(.*)/
puts "PATH: -#{$1.inspect}-"
# if $1.nil? || $1.empty?
# env['PATH_INFO'] = '/'
#!/usr/bin/env ruby
require 'rubygems'
require 'snmp'
module SNMP
class MIB
def get_name(oid)
# @names = @by_name.invert
# @names[oid]
# Dev/Apps Capistrano Deployment Script
# Copyright (c) 2009 Montana State University
#
# Version: 0.2
#
# FILE: deploy.mysql.rb
# This deployment file will allow a user to deploy their application
# code to dev.msu.montana.edu
#
# PREREQUISITES
class Archive
include DataMapper::Resource
property :archive_id, Serial
property :archive_name, String, :nullable => false
property :archive_info, String, :nullable => false
property :archive_url, String, :nullable => false
def self.default_repository_name
:legacy
development: &defaults
:adapter: sqlite3
:database: db/yogo_development.db
test:
<<: *defaults
:database: db/yogo_test.db
production:
<<: *defaults
dm-tpcc (ORM/DM implementation of TPC-C)
-----------------------------------------------------------------------------
DataMapper
-----------------------------------------------------------------------------
DataObjects Adapter
-----------------------------------------------------------------------------
SQLtoJSONQuery Translator | mysql | sqlserver | sqllite | oracle | postgres |
-----------------------------------------------------------------------------
Persevere|
-----------------------------------------------------------------------------
require 'ruby-debug'
module DataMapper
module TPCC
#
# This creates all the necessary data in the database tables to execute the TPC-C benchmark.
# This requires a set of data that is scaled by the number of warehouses in the database.
# The scaling factors are taken from the specification of TPC-C, section 1.2.1.
#
def self.load(num_warehouses = 1)
require 'yaml'
require 'pp'
module Yogo
class SQLParser
attr_accessor :script
def initialize
@script = "perl -e 'use SQL::Parser; use SQL::Statement; use YAML; use YAML::Dumper; $parser = SQL::Parser->new(); $parser->{RaiseError}=1; $dumper = YAML::Dumper->new; $dumper->indent_width(4); $stmt = SQL::Statement->new(\"%s\", $parser); delete $stmt->{\"opts\"}; print $dumper->dump($stmt);'"
end
Dec 7, 2009 10:17:19 PM org.persvr.remote.PersevereFilter$DefaultHandler call
WARNING: java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to org.mozilla.javascript.Function
Dec 7, 2009 10:17:19 PM org.persvr.remote.PersevereFilter$DefaultHandler call
WARNING:
java.lang.ClassCastException: org.mozilla.javascript.UniqueTag cannot be cast to org.mozilla.javascript.Function
at org.persvr.data.JsonPath.doJsonPath(JsonPath.java:122)
at org.persvr.data.JsonPath.doJsonPath(JsonPath.java:88)
at org.persvr.data.JsonPath.getTarget(JsonPath.java:79)
at org.persvr.remote.PersevereFilter$DefaultHandler.objectExistsForId(PersevereFilter.java:414)
at org.persvr.remote.PersevereFilter$DefaultHandler.call(PersevereFilter.java:516)