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/env perl | |
use strict; | |
use warnings FATAL => 'all'; | |
my ( $key, @values ) = next_record(); | |
while ( defined $key ) { | |
my ( $next_key, @next_values ) = next_record(); | |
if ( defined $next_key and $next_key eq $key ) { |
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 is a suggested improvement for processing SNP data, in response | |
;; to Jan Aerts' blog post <http://saaientist.blogspot.com/2010/06/encounter-with-incanter-about-clojure.html>. | |
;; Note that this example is for Clojure 1.1.0; if you're using Clojure 1.2, change the ns definition | |
;; to use clojure.contrib.io instead of duck-streams. | |
(ns ray1729.clojure.bio.snps | |
(:use [clojure.contrib.duck-streams :only (read-lines)])) | |
(defn parse-line | |
[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
(ns hornetq-test.core | |
(:require [immutant.messaging :as msg] | |
[immutant.util]) | |
(:gen-class)) | |
(def running? (atom true)) | |
(def uniq (rand-int 1000000)) | |
(defn do-stuff [] |
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
(def xs (sort (repeatedly 30 #(rand-int 20)))) | |
(def ys (sort (repeatedly 25 #(rand-int 20)))) | |
(defn merge-sorted-seqs | |
[xs ys] | |
(lazy-seq (cond | |
(empty? xs) (seq ys) | |
(empty? ys) (seq xs) | |
:else (let [x (first xs) y (first ys)] |
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 titanium-demo.core | |
(:require [clojure.java.io :as io] | |
[clojurewerkz.titanium.graph :as tg] | |
[clojurewerkz.titanium.schema :as scm] | |
[clojurewerkz.titanium.vertices :as tv])) | |
(defn generate-config | |
"Generate a configuration map to use BerkeleyDB and Lucene | |
with data stored in the given directory." | |
[dir] |
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 playground.explode | |
(:require [clojure.math.combinatorics :refer [cartesian-product]] | |
[clojure.string :as str])) | |
(def ambiguous-chars [#{\O \0} #{\I \L \1}]) | |
(defn ambiguate | |
[c] | |
(or (first (filter #(contains? % c) ambiguous-chars)) | |
[c])) |
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 rollup.core | |
(:require [clojure.core.async :refer [go chan <! put! timeout alt! alts!]])) | |
(def ch (chan)) | |
(go | |
(loop [stash []] | |
(let [[v c] (alts! [ch (timeout 3000)])] | |
(if (= c ch) |
NewerOlder