Monad Explained in One Picture

摘要: The point of Monad is composability. In the green category, T -> Monad and U -> Monad阅读全文
posted @ 2017-05-05 13:00 Todd Wei 阅读(103) 评论(0) 编辑

Stateful Future Transformation

摘要: A general function to transform the future of an initial state to the future of its final state.阅读全文
posted @ 2017-03-13 03:11 Todd Wei 阅读(158) 评论(0) 编辑

Function Composition vs Object Composition

摘要: Functions are born in a harmonious ecosystem. Whenever you write a function, you automatically enjoy compose, functors, monads, monad transformers...阅读全文
posted @ 2017-02-06 14:55 Todd Wei 阅读(248) 评论(0) 编辑

Distributed MVCC based cross-row transaction

摘要: The algorithm for supporting distributed MVCC based multi-row transactions on top of a distributed key-value database with single-row transaction support.阅读全文
posted @ 2016-11-28 15:30 Todd Wei 阅读(137) 评论(0) 编辑

A Beginner's Guide to Paxos

摘要: The code ideas of Paxos protocol: 1) Optimistic concurrency control (variant 2). Hold a "preemptible lock" first, try updating, restart on denial; 2) Quorum as a logical unit of acceptor for choose operation. A value is chosen iff it's accepted by a quorum, which implies from the proposer's perspective the choose operation is atomic, it's all or nothing, it's either accepted by a quorum or it isn't.阅读全文
posted @ 2016-07-07 14:33 Todd Wei 阅读(461) 评论(1) 编辑

Functional Programming without Lambda - Part 2 Lifting, Functor, Monad

摘要: fmap :: (T -> R) -> Functor<T> -> Functor<R> lifts a function of type T -> R into a function of type Functor<T> -> Functor<R>; flatMap :: (T -> Monad<R>) -> Monad<T> -> Monad<R> lifts a function of type T -> Monad<R> into a function of type Monad<T> -> Monad<R>.阅读全文
posted @ 2015-05-30 12:47 Todd Wei 阅读(1201) 评论(0) 编辑

Functional Programming without Lambda - Part 1 Functional Composition

摘要: Functional programming doesn't necessarily depend on Lambda, it's more about the unique way of composing a bunch a small functions into a larger one.阅读全文
posted @ 2015-05-25 13:35 Todd Wei 阅读(1323) 评论(0) 编辑


摘要: 本文介绍了自己总结的Java异常处理的原理和原则,包括:1.Exception和Error的区别;2.声明异常和未声明异常的区别;3.什么情况下应抛出未声明异常;4.如何捕获和处理其他方法抛出的异常;5.自定义异常应继承Exception还是RuntimeException。阅读全文
posted @ 2014-11-02 09:46 Todd Wei 阅读(6044) 评论(11) 编辑


摘要: 本文提出了一种观点:从应用的角度,我们可以把线性代数视为一门领域特定语言(DSL)。线性代数在初等数学基础上建立了向量模型,定义了一套语法和语义,符合程序语言的语言契约。向量模型具有坐标系无关性的优点,可以用来表达线性关系。它是整个线性代数的核心,是解决线性空间问题的最佳模型。阅读全文
posted @ 2014-05-21 22:07 Todd Wei 阅读(12771) 评论(18) 编辑


摘要: 本文介绍了Linux系统I/O重定向的原理和实现方式,原理方法最重要的是理解文件描述符和文件描述符表的概念,以及标准I/O所对应的特殊FD;实现方面主要是了解dup2()系统调用的功能和用法。阅读全文
posted @ 2014-03-01 13:20 Todd Wei 阅读(7073) 评论(2) 编辑



  • 随笔 - 61
  • 文章 - 43
  • 评论 - 1149