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
<link rel="import" href="../code-mirror/code-mirror.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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
I1212 22:03:27.103919 4515 fetcher.cpp:76] Fetching URI 'http://10.88.236.8:9000/proxy' | |
I1212 22:03:27.104070 4515 fetcher.cpp:126] Downloading 'http://10.88.236.8:9000/proxy' to '/tmp/mesos/slaves/20141212-210553-149706762-5050-2275-S5/frameworks/20141212-210553-149706762-5050-2275-0002/executors/KubeleteExecutorID/runs/f300609d-cb59-4851-a22f-7e57c183590f/proxy' | |
I1212 22:03:27.389055 4515 fetcher.cpp:76] Fetching URI 'http://10.88.236.8:9000/kubernetes-executor' | |
I1212 22:03:27.389119 4515 fetcher.cpp:126] Downloading 'http://10.88.236.8:9000/kubernetes-executor' to '/tmp/mesos/slaves/20141212-210553-149706762-5050-2275-S5/frameworks/20141212-210553-149706762-5050-2275-0002/executors/KubeleteExecutorID/runs/f300609d-cb59-4851-a22f-7e57c183590f/kubernetes-executor' | |
sh: 1: ./kubernetes-executor: Permission denied |
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
(deftask snake [] | |
(letfn [(copy-uri-to-file [uri file] | |
(with-open [in (clojure.java.io/input-stream uri) | |
out (clojure.java.io/output-stream file)] | |
(clojure.java.io/copy in out)))] | |
(let [snake-mp3 (java.io.File/createTempFile "snake" ".mp3")] | |
(copy-uri-to-file "http://movie-sounds.org/quotes/toys2/VOlCE-BOX-Theres-a-snake-in-my-boot.mp3" snake-mp3) | |
(speak :success (.getPath snake-mp3))))) |
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
;; One example of why one might want to generate platform specific feature macros | |
;; I'm not saying this is a good DSL, just possible with https://github.com/feature-macros/clojurescript/tree/feature-macros/feature-macros-demo | |
(deftype-unified Foo [bar] | |
unified/Counted [(count [_] {:cljs (-count bar) | |
:clj (.count bar)})] | |
BazProtocol | |
(fizz [_] :buzz)) | |
;; where unified/Counted [...] expands to clojure.lang.Counted/count on :clj and ICounted/-count on :cljs |
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 define-node-repl-launcher [] | |
(fn [handler] | |
(fn [fileset] | |
(defn node-repl [] | |
(require 'cemerick.piggieback 'cljs.repl.node) | |
((resolve 'cemerick.piggieback/cljs-repl) | |
:repl-env ((resolve 'cljs.repl.node/repl-env)) | |
:output-dir ".noderepl" | |
:optimizations :none | |
:cache-analysis true |
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 euler14 | |
(:use [clojure.repl])) | |
(defn max-euler14 [count-fn upper-bound] | |
(->> (range 1 (inc upper-bound)) | |
(map (juxt identity count-fn)) | |
(reduce (partial max-key second)))) | |
; idiomatic | |
(defn euler14-terms [n] |
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 euler14 | |
(:use [clojure.repl])) | |
(defn max-euler14 [count-fn upper-bound] | |
(->> (range 1 (inc upper-bound)) | |
(map (juxt identity count-fn)) | |
(reduce (partial max-key second)))) | |
; idiomatic | |
(defn euler14-terms [n] |
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
BEGIN{S="BEGIN{S=\"%s\";s=S;gsub(/\\\\/,\"\\\\\\\\\",s);gsub(/\\\"/,\"\\\\\\\"\",s);printf(S,s)}";s=S;gsub(/\\/,"\\\\",s);gsub(/\"/,"\\\"",s);printf(S,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
;; :dependencies [[org.apache.mahout/mahout-core "0.5"]] | |
;; :dev-dependencies [[slamhound "1.2.0"]] | |
(ns mia.mahout | |
(:import | |
(java.io File) | |
(org.apache.mahout.cf.taste.eval RecommenderBuilder) | |
(org.apache.mahout.cf.taste.impl.eval | |
AverageAbsoluteDifferenceRecommenderEvaluator | |
GenericRecommenderIRStatsEvaluator) | |
(org.apache.mahout.cf.taste.impl.model.file FileDataModel) |
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
;; Y-combinator | |
(defn Y [f] ((fn [x] (f (fn [y] ((x x) y)))) | |
(fn [x] (f (fn [y] ((x x) y)))))) | |
;; Y-combinator memoized | |
(defn Y [f] | |
(let [c (atom {}) | |
fp-gen (fn [x] (f (fn [y] | |
(or (@c y) |
OlderNewer