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
extern crate env_logger; | |
#[macro_use] extern crate log; | |
extern crate futures; | |
extern crate hyper; | |
use hyper::{Post, StatusCode}; | |
use hyper::header::ContentLength; | |
use hyper::server::{Http, Service, Request, Response}; | |
use futures::{future, Future, Stream}; |
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
extern crate futures; | |
extern crate hyper; | |
extern crate env_logger; | |
#[macro_use] extern crate log; | |
extern crate tokio_core; | |
extern crate futures_cpupool; | |
use hyper::{Post, StatusCode}; | |
use hyper::header::ContentLength; | |
use hyper::server::{Http, Service, Request, Response}; |
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
// https://github.com/hyperium/hyper/blob/master/examples/hello.rs | |
#![deny(warnings)] | |
extern crate hyper; | |
extern crate env_logger; | |
extern crate num_cpus; | |
use std::io::Write; | |
use hyper::{Decoder, Encoder, Next}; | |
use hyper::net::{HttpStream, HttpListener}; |
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
;;; lazy-seq based flow | |
(defn proc-a [id] | |
;; 処理A | |
url) | |
(defn proc-b [url] | |
;; 処理B | |
json | |
) | |
(defn proc-c [json] |
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 more-distributions.cauchy | |
(:require [incanter-contrib.distributions :as icd] | |
[incanter.charts :as c] | |
[incanter.core :as i] | |
[incanter.distributions :as d] | |
[incanter.stats :as s])) | |
(defn show-cauchy-distribution [] | |
(let [dist (icd/cauchy-distribution 0 1) | |
n 100000 |
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 various-distributions.gamma | |
(:require [incanter.charts :as c] | |
[incanter.core :as i] | |
[incanter.distributions :as d] | |
[incanter.stats :as s])) | |
;; https://github.com/incanter/incanter/issues/245 | |
(defn show-gamma-distribution [] | |
(let [dist (d/gamma-distribution 2 2) | |
n 100000 |
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 more-distributions.triangular | |
(:require [incanter-contrib.distributions :as icd] | |
[incanter.charts :as c] | |
[incanter.core :as i] | |
[incanter.distributions :as d] | |
[incanter.stats :as s])) | |
(defn show-gamma-distribution [] | |
(let [dist (icd/gamma-distribution 2 2) | |
n 100000 |
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 more-distributions.triangular | |
(:require [incanter-contrib.distributions :as icd] | |
[incanter.charts :as c] | |
[incanter.core :as i] | |
[incanter.distributions :as d] | |
[incanter.stats :as s])) | |
(defn show-triangular-distribution [] | |
(let [dist (icd/triangular-distribution 0.0 0.3 1.0) | |
n 100000 |
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 various-distributions.beta | |
(:require [incanter.charts :as c] | |
[incanter.core :as i] | |
[incanter.distributions :as d] | |
[incanter.stats :as s])) | |
(defn show-beta-distribution [] | |
(let [dist (d/beta-distribution 2 5) | |
n 100000 | |
x (repeatedly n #(d/draw dist)) |
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
(defproject various-distributions "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.6.0"] | |
[incanter/incanter-core "1.5.5"] | |
[incanter/incanter-charts "1.5.5"]] | |
;; :jvm-opts ^:replace [] | |
:main ^:skip-aot various-distributions.core |
NewerOlder