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
import qualified Data.ByteString.Lazy as BSL | |
import Control.Monad | |
import Control.Monad.Trans | |
import Control.Monad.Trans.Resource | |
import Control.Concurrent | |
import Control.Concurrent.Chan | |
import qualified Network.HTTP.Conduit as C | |
import Network.HTTP.Types (Status(..)) |
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
class Proc | |
def _(*args) | |
CurriedProc.new(args, &self) | |
end | |
end | |
class CurriedProc < Proc | |
def initialize(args, &block) | |
msg = "Curried arguments is greater than block arity (#{args.size} > #{block.arity})" | |
raise ArgumentError, msg if args.size > block.arity |
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 'formula' | |
class Opendetex < Formula | |
homepage 'https://code.google.com/p/opendetex/' | |
url 'https://opendetex.googlecode.com/files/opendetex-2.8.1.tar.bz2' | |
sha1 'a811635519dc6573735ca9d406f7032eccacd7e0' | |
version "2.8.1" | |
depends_on 'flex' => :build |
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
import Control.Monad | |
import Prelude hiding (catch) | |
import Control.Exception | |
import Control.Concurrent.ParallelIO | |
import qualified Control.Concurrent.ParallelIO.Local as Local | |
import Network.HTTP | |
import Network.Stream (ConnError(..), Result) | |
import System.IO | |
import Data.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
#! /usr/bin/env bash | |
if [[ "" == "$DATASET_OUTPUT" ]]; then | |
export DATASET_OUTPUT="../results.json/part-00000" | |
fi | |
if [ -a import.log ]; then | |
rm import.log | |
fi |
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
(ns cascalog-tutorial.core | |
(:use cascalog.api | |
cascalog.playground | |
[clojure.string :only [split]] | |
[cheshire.core :only [parse-string generate-string]])) | |
(def input-tap | |
(hfs-tap (cascading.scheme.hadoop.TextLine.) | |
(str (System/getProperty "user.dir") | |
"/all.json"))) |
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
import qualified Data.Map as DM | |
data Product = Product String Float deriving (Show) | |
type ProductMap = DM.Map String [Product] | |
type DiscountTimes = (ProductMap -> Int) | |
data Discount = Discount Float DiscountTimes | |
products :: [Product] | |
products = milk ++ marsBars | |
where milk = replicate 7 $ Product "milk" 1.30 |
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 'yaml' | |
require 'json' | |
require 'logger' | |
# Some useful, and often overlooked features of Rake, Ruby's build tool. | |
directory "logs" | |
desc "Log tasks execution to a file" | |
task "log" => ['logs'] do | |
MyLogger.instance |
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 'rubygems' | |
require 'sparql/client' | |
ENDPOINT_URL = "http://localhost:3030/data/query" | |
query = | |
SPARQL::Client.new(ENDPOINT_URL, :method => 'post') | |
.select(:person, :count => {:other_person => :count} ) | |
.where([:person, RDF::FOAF.knows, :other_person]) | |
.group(:person) |
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
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+) | |
DEPRECATION WARNING: Rake tasks in vendor/plugins/action_mailer_cache_delivery/tasks, vendor/plugins/broccoli/tasks, vendor/plugins/browser_utils/tasks, vendor/plugins/engines/tasks, vendor/plugins/friendly_identifier/tasks, vendor/plugins/hoptoad_notifier/tasks, vendor/plugins/nature_support/tasks, vendor/plugins/restful_authentication/tasks, vendor/plugins/textile_editor_helper/tasks, and vendor/plugins/yaml_db/tasks are deprecated. Use lib/tasks instead. (called from /home/andrea/.rvm/gems/ree-1.8.7-2012.02@events/gems/rails-2.3.11/lib/tasks/rails.rb:10) | |
** Invoke db:migrate (first_time) | |
** Invoke environment (first_time) | |
** Execute environment | |
rake aborted! | |
private method `gsub' called for nil:NilClass | |
/home/andrea/.rvm/gems/ree-1.8.7-2012.02@events/gems/activesupport-2.3.11/lib/active_support/whiny_nil.rb:52:in `method_missing' | |
/home/andrea/.rvm/gems/ree-1.8.7-2012.02@global/gems/bundler-1.1.4/lib/bundler/runtime.rb:77:in `require' | |
/hom |