This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; i confirmed it by doing kill-word in M-x (it worked) | |
;; and i did it in eval (kill-word) and it failed as below | |
;;-- | |
Debugger entered--Lisp error: (wrong-number-of-arguments #[(arg) "惁ࠀ瘀蠀怀尀∀蜀∀ 嬀愀爀最 欀椀氀氀ⴀ爀攀最椀漀渀崀 ㌀ 㤀㠀㌀㜀㈀㈀ ∀瀀∀崀 ⤀ഀ 欀椀氀氀ⴀ眀漀爀搀⠀⤀ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Nibble a = Nibble a a a a deriving (Show, Eq) | |
op2 :: (a -> a -> a) -> Nibble a -> Nibble a -> Nibble a | |
op2 f (Nibble a b c d) (Nibble a' b' c' d') = Nibble (f a a') (f b b') (f c c') (f d d') | |
op1 :: (a -> a) -> Nibble a -> Nibble a | |
op1 f (Nibble a b c d) = Nibble (f a) (f b) (f c) (f d) | |
ror :: Nibble a -> Nibble a | |
ror (Nibble a b c d) = Nibble d a b c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Boolean XOR (NOT is defined in the system) | |
xor :: Bool -> Bool -> Bool | |
xor False False = False | |
xor False True = True | |
xor True False = True | |
xor True True = False | |
-- a 4-bit Boolean (that can be printed and tested for equality automagically) | |
data Nibble a = Nibble a a a a deriving (Show, Eq) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'app' # <-- your sinatra app | |
require 'spec' | |
require 'spec/interop/test' | |
require 'sinatra/test' | |
require 'cgi' | |
set :environment, :test | |
describe 'PiM validation' do | |
include Sinatra::Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'describe' | |
require 'fileutils' | |
require 'spec' | |
require 'sinatra/test' | |
require 'spec/interop/test' | |
set :environment, :test | |
describe 'Describe Service' do | |
include Sinatra::Test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'open-uri' | |
doc = Nokogiri::HTML(open('http://www.cise.ufl.edu/class/cop5555su09/class.notes.html')) | |
puts doc | |
puts '--' | |
doc.css('a').each do |l| | |
puts l.content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
LOG_DIR = "/var/log/daitss/ingest" || ENV['DAITSS_INGEST_LOG_DIR'] | |
Dir.chdir LOG_DIR do | |
last_file = `ls -tr #{LOG_DIR} | tail -n 1`.chomp | |
open last_file do |io_potential| | |
loop do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
class Blog < Sinatra::Default | |
get '/' do | |
.. | |
end | |
end | |
if __FILE__ == $0 | |
Blog.run! | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rack-test', '~>0.3.0' | |
require 'rack/test' | |
gem 'webrat', '~>0.4.2' | |
require 'webrat/sinatra' | |
# path to schematron | |
$:.unshift File.join(File.dirname(__FILE__), '../../../schematron/lib') | |
$:.unshift File.dirname(__FILE__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expected the following element's content to include "document is ill-formed": | |
document is well-formeddocument is valid (Spec::Expectations::ExpectationNotMetError) | |
./features/step_definitions/wellformedness_steps.rb:34:in `__instance_exec0' | |
./features/step_definitions/wellformedness_steps.rb:33:in `/^it should contain (no|some) formedness errors$/' | |
features/wellformedness.feature:8:in `And it should contain <quantity> formedness errors' |