故事发生在架空王朝"承朝",以明代中后期为原型。承朝立国约一百五十年,正处于由盛转衰的临界点。表面天下承平,实则内忧外患暗流涌动。
This file contains hidden or 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
| ;;不得不说,这思想很牛,但是理解起来也很绕,不知道这种代码到底是好还是不好。。。 | |
| ;;想想不用这种方法怎么来实现这个功能,应该是用一个额外的表记录下所有前面的素数,然后用 (map (fn [x] (some (fn [y] (not-zero?(mod x y))) [primes list])) strems) | |
| (defmacro my-delay [body] | |
| `(fn [] ~body)) | |
| (defn my-force [f] | |
| (f)) | |
| (def the-empty-stream []) |
This file contains hidden or 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
| struct X { val: i32 } | |
| impl std::ops::Deref for X { | |
| type Target = i32; | |
| fn deref(&self) -> &i32 { &self.val } | |
| } | |
| trait M { fn m(self); } | |
| impl M for i32 { fn m(self) { println!("i32::m()"); } } | |
| impl M for X { fn m(self) { println!("X::m()"); } } |
This file contains hidden or 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 benchmark.sync | |
| (:refer-clojure :exclude [sync]) | |
| (:import [com.mongodb.client MongoClients] | |
| [com.mongodb.client MongoClient] | |
| [com.mongodb.client MongoCollection] | |
| [com.mongodb.client MongoDatabase] | |
| [org.bson Document] | |
| [com.mongodb Block ConnectionString MongoClientSettings ServerAddress] | |
| [com.mongodb.connection ClusterSettings ConnectionPoolSettings] | |
| [java.util.concurrent CyclicBarrier CountDownLatch])) |
This file contains hidden or 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 benchmark.async | |
| (:import [clojure.lang IPersistentMap Named Keyword Ratio] | |
| [java.util List Map Date Set] | |
| [com.mongodb ConnectionString | |
| ServerAddress | |
| Block ReadPreference] | |
| [com.mongodb.async.client MongoClient | |
| MongoClients MongoClientSettings Observables | |
| MongoCollection MongoDatabase] | |
| [com.mongodb.connection ClusterSettings ConnectionPoolSettings] |
This file contains hidden or 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
| #[macro_use] extern crate hyper; | |
| extern crate rand; | |
| use std::io::{BufReader}; | |
| use std::io::prelude::*; | |
| use std::fs::OpenOptions; | |
| use std::collections::BTreeMap; | |
| use std::iter::Iterator; | |
| use hyper::client::Client; | |
| use hyper::header::Basic; |
I hereby claim:
- I am paomian on github.
- I am paomian (https://keybase.io/paomian) on keybase.
- I have a public key ASDuZCUs9SSAMks7aMaMlkHbQ2MyuXz9Xd71M_LIEybJ3wo
To claim this, I am signing this object:
This file contains hidden or 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
| (defrecord Merror [wrap]) | |
| (defmonad error-m | |
| [m-bind (fn m-bind-error | |
| [x f] | |
| (if (contains? (:wrap x) :error) | |
| x | |
| (f x))) | |
| m-result (fn m-result-error | |
| [x] |
This file contains hidden or 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
| use std::io::BufReader; | |
| use std::io::BufRead; | |
| use std::fs::File; | |
| use std::path::Path; | |
| use std::error::Error; | |
| use std::env; | |
| use std::collections::BTreeMap; | |
| fn get_data(s:&str,separator:char,n:usize) -> Option<usize> { | |
| let mut g = 0; |
This file contains hidden or 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
| import java.lang.Exception; | |
| import java.lang.Object; | |
| import java.lang.Runnable; | |
| import java.lang.System; | |
| import java.lang.Thread; | |
| import java.util.LinkedList; | |
| import java.util.concurrent.Semaphore; | |
| class MyQueue { |
NewerOlder