跳至主要内容

博文

目前显示的是 九月, 2014的博文

Some video

周末看的几个视频,第一个是大牛 Douglas Crockford 在 YUIConf 上所做的 Keynote,之后的是在他的 Slides 中提及的几个视频: + Douglas Crockford: Monads and Gonads (YUIConf Evening Keynote) [Youtube Video](https://www.youtube.com/watch?v=dkZFtimgAcM) + Carl Hewitt: The Actor Model (everything you wanted to know, but were afraid to ask) [Channel9 Video](http://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask) + Mark Millers: Secure Distributed Programming with Object-capabilities in JavaScript [Video 1](http://www.youtube.com/watch?v=w9hHHvhZ_HY), [Video 2](http://www.youtube.com/watch?v=oBqeDYETXME)

Paths in Linux

无意中找到的一个帖子,讲的是Linux系统中[几个 PATH 的区别](http://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux). 1. `/bin` (and `/sbin`) were intended for programs that needed to be on a small `/` partition before the larger `/usr`, etc. partitions were mounted. These days, it mostly serves as a standard location for key programs like `/bin/sh`, although the original intent may still be relevant for e.g. installations on small embedded devices. 2. `/sbin`, as distinct from `/bin`, is for system management programs (not normally used by ordinary users) needed before `/usr` is mounted. 3. `/usr/bin` is for distribution-managed normal user programs. 4. There is a `/usr/sbin` with the same relationship to `/usr/bin` as `/sbin` has to `/bin`. 5. `/usr/local/bin` is for normal user programs not managed by the distribution package manager, e.g. locally compiled packages. You should not install them into `/usr/bin` because future distribution upgrades may modify or delete them withou...

ImplDDD 阅读笔记 - Value Objects, Part 2

在比较 Value Objects 的时候,首先比较的是两个对象的类型,其次才是对象的 attributes。如果两个或多个 value objects 是相等的,那么使用其中任意一个赋值给 Entity 的 property 都不会改变该 Entity Object 的状态。 A method of an object can be designed as a _Side-Effect-Free Function_. A function is an operation of an object that produces output but without modifying its own state. Since no modification occurs when executing a specific operation, that operation is said to be side-effect free. Value Object 的方法都是 Side-Effect-Free 的,因为一旦被创建出来就无法再修改 Value Object 的状态了。这个特性实际上跟 immutability 有很强的关联,不过作者认为有必要将其独立出来,这样可以更容易把 Value Object 当做一个可用的对象而非简单的一组 attributes 来使用。 FullName name = new FullName("Vaughn", "Vernon"); // later ... name = name.withMiddleInitial("L"); 这里调用的 `withMiddleInitial` 就可以是(也必须是)一个 function,它基于原有的 Value Object 创建了一个新的 Value Object。 public FullName withMiddleInitial(String aMiddleNameOrInitial) { if (StringUtils.isBlank(aMiddleNameOrInitial == ...