Skip to content

Instantly share code, notes, and snippets.

View capoferro's full-sized avatar

Josiah Kiehl capoferro

View GitHub Profile
default['maven']['settings']['mirrors']['0']['id'] = 'nexus'
default['maven']['settings']['mirrors']['0']['mirrorOf'] = '*'
default['maven']['settings']['mirrors']['0']['url'] = nil
default['maven']['settings']['profiles']['0']['id'] = 'nexus'
default['maven']['settings']['profiles']['0']['repositories']['0']['id'] = nil
default['maven']['settings']['profiles']['0']['repositories']['0']['url'] = nil
default['maven']['settings']['profiles']['0']['repositories']['0']['releases']['0']['enabled'] = true
# Y combinator with no unbound variables
hash = proc { |generator|
proc { |x|
proc { |*args|
generator.call(x.call(x)).call(*args)
}
}.call(proc { |x|
proc { |*args|
generator.call(x.call(x)).call(*args)
}
def f(a,l,x)
(a/2*l)*Math::E**(-x.abs/l)
end
A = 1.32
l = 1
1000.times do
# generate normally distributed random number
x = rand
nsamp <- 10000
x <- vector ( length = nsamp )
y <- vector ( length = nsamp )
z <- vector ( length = nsamp )
lambda = 1
A = 1.32
npass =0
# sample x from f(x)/A by using inverse function method
for(i in 1: nsamp )
{
rapier:Projects jkiehl$ gem install gecoder
Building native extensions. This could take a while...
ERROR: Error installing gecoder:
ERROR: Failed to build gem native extension.
/Users/jkiehl/.rbenv/versions/1.9.3-p125/bin/ruby extconf.rb
checking for main() in -lgecodesupport... yes
checking for main() in -lgecodekernel... yes
checking for main() in -lgecodeint... yes
checking for main() in -lgecodeset... yes
sudo /usr/libexec/locate.updatedb
jkiehl@JKIEHL-3 ~/Desktop/dep-selector (master)
$ gem i dep_selector -- --with-gecode-lib="$GECODEDIR"
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing dep_selector:
ERROR: Failed to build gem native extension.
c:/Ruby193/bin/ruby.exe extconf.rb --with-gecode-lib=C:\Program Files\Gecode\
checking for main() in -lgecodesearch... no
=========================================================================================
require 'pp'
module A
def self.a
['hi']
end
def self.included mod
pp "Included in #{mod}"
(define (cons x y)
(define (dispatch m)
(cond ((= m 0) x)
((= m 1) y)
(else (error "Argument not 0 or 1 -- CONS" m))))
dispatch)
(define (car z) (z 0))
(define (cdr z) (z 1))
# A sample Gemfile
source "http://rubygems.org"
platforms :ruby do
gem "knife_cookbook_dependencies"
end
platforms :mswin, :mingw do
gem "knife_cookbook_dependencies_over_http"
end