Skip to content

Instantly share code, notes, and snippets.

Avatar
😢
I don't know.

localhost paomian

😢
I don't know.
View GitHub Profile
View steam.clj
;;不得不说,这思想很牛,但是理解起来也很绕,不知道这种代码到底是好还是不好。。。
;;想想不用这种方法怎么来实现这个功能,应该是用一个额外的表记录下所有前面的素数,然后用 (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 [])
View deref.rs
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()"); } }
View sync.clj
(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]))
View async.clj
(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]
View watch_sms.rs
#[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;
View keybase.md

Keybase proof

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:

View Monad.clj
(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]
View gist:ff959197a481e6ba7c12
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;
View pv.java
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 {
View gist:938de20ee45ebe0bdd67
(require 'prelude-programming)
;;; Code:
(prelude-require-packages '(rust-mode
racer))
(require 'rust-mode)
(setq racer-rust-src-path "/Users/ipaomian/work/rust/rustc-1.1.0/src")
(setq racer-cmd "/Users/ipaomian/work/rust/racer/target/release/racer")