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
module Main where | |
-- input is 1.2MB | |
-- Tue Oct 13 08:14 2009 Time and Allocation Profiling Report (Final) | |
-- | |
-- parmd +RTS -p -RTS | |
-- | |
-- total time = 0.10 secs (5 ticks @ 20 ms) | |
-- total alloc = 491,900,336 bytes (excludes profiling overheads) | |
-- |
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/env io | |
List do ( | |
pivot := method(first) | |
upper := method(select(x, x < pivot)) | |
lower := method(select(x, x > pivot)) | |
qsort := method(if(size > 1, lower qsort append(pivot) appendSeq(upper qsort), clone)) | |
) | |
writeln("building list") |
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" | |
require "json" | |
# this should integrate to a real Q | |
DATA = %w(foo bar baz eta beta alfa romeo) | |
get "/q" do | |
JSON.generate(DATA).to_s | |
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
<html> | |
<head> | |
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> | |
<script type="text/javascript" src="js/jquery-ui-1/js/jquery-ui-1.7.2.custom.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() { | |
//load_q(); | |
$("#queue").sortable(); |
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
it "returns 400 on POST if request is missing X-Package-Name header" do | |
post '/', "FOO", "Content-MD5" => "cccccccccccccccccccccccccccccccc" | |
last_response.status.should == 400 | |
last_response.body.should == "Missing parameter: package_name" | |
end | |
# % spec sp.rb ~ | |
# nil | |
# {"Content-Type"=>"text/html"} |
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
% spec sp.rb ~ | |
...nil | |
{"Content-Type"=>"text/html"} | |
.Fnil | |
{"Content-Type"=>"text/html"} | |
Fnil | |
{"Content-Type"=>"text/html"} | |
. | |
1) |
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 'uuid' # gem install uuid if you havent already | |
# it sounds crazy but this is very sufficient for generating IDs with no central authority. | |
ugen = UUID.new | |
10.times { puts "info:fcla/#{ ugen.generate }" } |
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
-module (bencode). | |
-export ([encode/1, decode/1]). | |
%% Simple bencoding definition: | |
%% byte strings: <ascii number in base 10>:contents | |
%% integers: i<ascii number in base 10>e | |
%% lists: l<contents>e | |
%% dictionaries: d<contents>e, contents are string keyed in lexographic order | |
%% ============ |
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
#!/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
class PlayList < Array | |
attr_accessor :version | |
def PlayList.parse s | |
lines = s.lines.map { |l| l.chomp } | |
magic = lines.shift |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<mets xmlns="http://www.loc.gov/METS/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" OBJID="test:/3dccd630-fe28-012c-8021-001b63b4d6a3" xsi:schemaLocation="http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/mets.xsd http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd info:lc/xmlns/premis-v2 http://www.loc.gov/standards/premis/premis.xsd"> | |
<!-- DMD --> | |
<dmdSec ID="dmd-1"> | |
<mdWrap MDTYPE="PREMIS"> | |
<xmlData> | |
<mods xmlns="http://www.loc.gov/mods/v3"> | |
<titleInfo> | |
<title>heavyweight title</title> | |
</titleInfo> |