This file contains 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 | |
# | |
# I deliberately didn't DRY /usr/local references into a variable as this | |
# script will not "just work" if you change the destination directory. However | |
# please feel free to fork it and make that possible. | |
# | |
# If you do fork, please ensure you add a comment here that explains what the | |
# changes are intended to do and how well you tested them. | |
# | |
# 30th March 2010: |
This file contains 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
(defn __findIntegerTriaglesWithIntRatio [p a bseq output] | |
(if (empty? bseq) | |
output | |
((def a (findArea p a (first bseq))) | |
(if (integerRatio? a p) | |
(recur p a (rest bseq) (conj output a)) | |
(recur p a (rest bseq) output))))) |
This file contains 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 test.core | |
(:use cascalog.api) | |
(:require [cascalog [vars :as v]]) | |
(:gen-class)) | |
(def sample_data | |
[{:path nil, :javadoc? :not_present, :bundle_docurl nil, :bundle_symname nil, :bundle_name nil, :bundle_exportsrv nil, :prefix nil, :lastmodified 1127001651000, :bundle_importpkg nil, :groupid "xfire", :bundle_description nil, :version "1.0-20050917.231235", :size 21774, :packaging "jar", :remoteurl nil, :classnames nil, :signature? :not_present, :bundle_license nil, :source? :not_present, :sha1 "eed564da25682c728f7ad3da557656f0766376de", :repository nil, :bundle_exportpkg nil, :bundle_version nil, :fname nil, :description nil, :artifiactid "xfire-plexus", :md5 nil, :fextension "jar"} | |
{:path nil, :javadoc? :not_present, :bundle_docurl nil, :bundle_symname nil, :bundle_name nil, :bundle_exportsrv nil, :prefix nil, :lastmodified 1162775407000, :bundle_importpkg nil, :groupid "xfire", :bundle_description nil, :version "1.0-20050917.231219", :size -1, :packaging nil, :remoteurl nil, :classnames nil, :s |
This file contains 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
;; this one outputs to stdout until it dies due to 'Exceeded max jobconf' | |
(defn format-package-repo-for-cassandra | |
[source-type base-attributes sink repo] | |
(cio/with-fs-tmp [_ tmp] | |
(let [packages (package-seq repo)] | |
(if-not (empty? packages) | |
(let [lazy-tap (ops/lazy-generator tmp packages)] | |
(?<- (stdout) | |
[?row-key ?col ?val] |
This file contains 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
(defbolt build-package-hash-bolt ["package"] | |
[tuple collector] | |
(emit-bolt! collector [(build-package-hash (:message tuple))] :anchor tuple) | |
(ack! collector tuple)) | |
(defbolt json-deser-bolt ["message"] | |
[tuple collector] | |
(try | |
(emit-bolt! collector [(json/parse-string (:message tuple))] :anchor tuple) | |
(ack! collector tuple) |
This file contains 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
(defn load-npm-callback | |
[err npm] | |
(.ls (. npm -commands) [] true print-deps)) |
This file contains 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 courier.test.storm.ruby | |
(:use [backtype.storm clojure] | |
[backtype.storm bootstrap testing] | |
clojure.test | |
midje.sweet) | |
(:require [courier.db :as db] | |
[courier.util :as util] | |
[courier.lib.ruby.core :as ruby] | |
[courier.storm.ruby :as sruby] | |
[courier.models.package :as pkg] |
This file contains 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
cljsc src '{:optimizations :simple :pretty-print true :target :nodejs}' > lib/sample.js |
This file contains 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
╰─$ lein immutant undeploy && lein immutant deploy && lein immutant run | |
Undeployed courier from /Users/mstump/.lein/immutant/current/jboss/standalone/deployments | |
Deployed courier to /Users/mstump/.lein/immutant/current/jboss/standalone/deployments/courier.clj | |
Starting Immutant: /Users/mstump/.lein/immutant/current/jboss/bin/standalone.sh | |
========================================================================= | |
JBoss Bootstrap Environment | |
JBOSS_HOME: /Users/mstump/.lein/immutant/current/jboss |
This file contains 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
#include <stdint.h> | |
#include <iostream> | |
#include <boost/lexical_cast.hpp> | |
#ifndef ffsll | |
#ifdef _WIN32 | |
inline char | |
ffsll(uint64_t x) | |
{ | |
char index = 0x00; |
OlderNewer