-- mode: markdown --
TODO!
lip? mouth? backtalk? guff? sauce?
Leading contender: sauce
git push heroku master | xclip -selection clipboard | |
Counting objects: 70, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (53/53), done. | |
Writing objects: 100% (57/57), 6.97 KiB, done. | |
Total 57 (delta 29), reused 0 (delta 0) | |
-----> Heroku receiving push | |
-----> Clojure app detected | |
-----> Installing Leiningen |
(ns repro.core | |
(:use [clojure.contrib.io :only [reader]]) | |
(:gen-class)) | |
(defn -main [& args] | |
(println (line-seq (reader (first args))))) |
(defn nfe-test [] | |
(try | |
(let [nums (map #(Integer/parseInt %) ["1" "2" "1234123412341234"])] | |
(when (every? #(< 3 %) nums) | |
nums)) | |
(catch NumberFormatException nfe nil))) | |
(nfe-test) ;; throws NumberFormatException, but I would expect it to | |
;; return nil |
(defn cartes5 | |
[a b & [c & ds :as more]] | |
(let [so-far | |
(for [x a y b] | |
[x y])] | |
(if more | |
(recur so-far c ds) | |
(map flatten so-far)))) |
(ns com.wangdera.slideshow | |
(:use [clojure.contrib.test-is]) | |
(:import (java.io File) | |
(javax.imageio ImageIO) | |
(javax.swing JFrame JPanel Timer) | |
(java.awt Dimension Frame Color) | |
(java.awt.event ActionListener WindowAdapter))) | |
(def imagelist (atom [])) | |
(def current-image (atom nil)) |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using System.Runtime.InteropServices; | |
using System.Drawing; | |
using System.Threading; | |
using Timer = System.Windows.Forms.Timer; | |
using System.IO; |
(defn dir-descendants | |
"Creates a lazy sequence of files by recursively walking | |
a directory tree and returning all the files it finds." | |
[dir] | |
(let [children (.listFiles (File. dir))] | |
(lazy-cat | |
(map (memfn getPath) (filter (memfn isFile) children)) | |
(mapcat dir-descendants | |
(map (memfn getPath) (filter (memfn isDirectory) children)))))) |