Skip to content

Instantly share code, notes, and snippets.

View samwgoldman's full-sized avatar

Sam Goldman samwgoldman

View GitHub Profile
@samwgoldman
samwgoldman / gist:1579854
Created January 8, 2012 21:57
Theano nose tests results on was cg1.4xlarge. default config
root@master:~/Theano# nosetests
.E.................................E.......E...E..EEE...........................E....E................................................E..E.....EEEE..........................................E...........................................................SS..E..F........................................................................E...........E.......................................E...../usr/lib/python2.7/dist-packages/scipy/signal/signaltools.py:408: ComplexWarning: Casting complex values to real discards the imaginary part
return sigtools._convolve2d(in1,in2,1,val,bval,fillvalue)
.......................................EEEEEEEEEEE...........................EE...........................E.EE.........E..........................WARNING (theano.gof.cmodule): Cache leak due to unpickle-able key data set([(((3, (3,), (3,), (3,), (3,), (3,)), (10, '1.5.1'), (10, '1.5.1'), (10, '1.5.1'), (10, '1.5.1'), (10, '1.5.1'), (10, '1.5.1')), ('CLinker.cmodule_key', ('-O3', '-Wno-write-strings',
@samwgoldman
samwgoldman / gist:1580228
Created January 9, 2012 00:15
Theano test results on cg1.4xlarge using ami-12b6477b
[root@master Theano]# python2.6 setup.py develop
running develop
install_dir /usr/lib/python2.6/site-packages/
running egg_info
creating Theano.egg-info
writing requirements to Theano.egg-info/requires.txt
writing Theano.egg-info/PKG-INFO
writing top-level names to Theano.egg-info/top_level.txt
writing dependency_links to Theano.egg-info/dependency_links.txt
writing requirements to Theano.egg-info/requires.txt
@samwgoldman
samwgoldman / gist:1714534
Created February 1, 2012 02:07
first stab at a webmachine-ruby resource def'n
require 'evaluation'
class EvaluationsResource < Webmachine::Resource
class << self
alias_method :let, :define_method
end
let(:allowed_methods) { ["GET", "POST"] }
let(:content_types_provided) { [["application/json", :to_json]] }
let(:content_types_accepted) { [["application/json", :from_json]] }
class Tests
extend Process
def self.passing?
fork do
begin
require "rspec/autorun"
Dir["spec/**/*_spec.rb"].each do |spec|
require_relative spec
end
@samwgoldman
samwgoldman / $stdout
Created February 18, 2012 09:29
activerecord bug?
active record
role built from a context
context
should eq #<Context id: 1, type: nil>
role built from a role through context
context
should eq #<Context id: 2, type: nil> (FAILED - 1)
student built from a program
program
should eq #<Program id: 3, type: "Program">
@samwgoldman
samwgoldman / test.rb
Created April 27, 2012 21:13
webmachine-ruby chunked response with rack adapter streaming
require "webmachine"
require "webmachine/adapters/rack"
class TestResource < Webmachine::Resource
def to_html
parts = %w{Hello, World!}
Fiber.new do
parts.each do |part|
Fiber.yield part
sleep 0.5
@samwgoldman
samwgoldman / html_builder_example.rb
Created May 23, 2012 17:38
Using smartlogic/html_builder
require "html"
require "html/list"
require "html/map"
module HTML
class Article < Struct.new(:article)
def to_html
HTML.build(article) do |article|
tag(:article, tag(:h2, article.title) + map(:section, article.sections), id: article.id)
end
@samwgoldman
samwgoldman / facebook_test_user.rb
Created June 20, 2012 13:38
Easily create test users for facebook
require "httparty"
class FacebookTestUser
include HTTParty
base_uri "graph.facebook.com:443"
attr_reader :email, :password
def initialize(options)
@email = options["email"]
@samwgoldman
samwgoldman / capybara_reset_spec.rb
Created June 27, 2012 18:09
Capybara session reset issue
require "rack"
require "capybara/rspec"
App = Rack::Builder.new do
map "/" do
run proc { |env|
request = Rack::Request.new(env)
response = Rack::Response.new
if request.cookies["logged_in"]
response.write "Logged in!"
@samwgoldman
samwgoldman / backtrace.txt
Created September 14, 2012 21:58
IO.popen on jruby issue?
1) HTTPSpec::Clients::CGI issues requests to the app
69 Failure/Error: Unable to find matching line from backtrace
70 Java::JavaLang::NullPointerException:
71 # org.jruby.util.ShellLauncher.getCurrentEnv(ShellLauncher.java:235)
72 # org.jruby.util.ShellLauncher.popenShared(ShellLauncher.java:712)
73 # org.jruby.util.ShellLauncher.popenShared(ShellLauncher.java:689)
74 # org.jruby.util.ShellLauncher.popen(ShellLauncher.java:673)
75 # org.jruby.RubyIO.popen19(RubyIO.java:3722)
76 # org.jruby.RubyIO$s$0$1$popen19.call(RubyIO$s$0$1$popen19.gen:65535)
77 # org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:219)