跳至主要内容

博文

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

关于SSD的那些事

刚刚看完一篇很长的技术贴,确切的说是硬件评测贴。这是一篇写于2009年的文章,5年的时间跨度对于计算机硬件发展而言是好几个世代,不过作者在评测中介绍到的很多东西是与存储系统紧密相关的,例如传统硬盘的工作原理,SSD的TRIM指令由来等。非常值得一读,毫不夸张的说,这是积累攒机知识所必须的…… 文章的地址在这里—— The SSD Anthology

ImplDDD 阅读笔记 - Entity Identity

DDD 中实体类型的设计往往被错误的导向了与数据库有关的 Scheme Design。 > Because of the prevailing approaches to software development that place > importance on the database, instead of designing domain concepts with rich > behaviors, developers might think primarily about the attributes (columns) > and associations (foreign keys) of the data. 这种以数据库范式为导向的设计思路导致 domain models 中几乎每一个概念都以 entity 的方式被编码为仅有 `getter` 和 `setter` 的类型,可是显然 Domain driven design 所追求的 entities 不应该仅仅具有 property accessors。 > An entity is a unique thing and is capable of being changed continuously over > a long period of time. Changes may be so extensive that the object might seem > much different from what it once was. And yes, it is the same object by identity. 常见的 *Anemia model (贫血的模型)* 很多时候就是来自于这样的设计。例如,书中第一章所给出的 Customer 的例子就是很【贫血】的: private void saveCustomer( String customerId, String customerFirstName, String customerLastName, String ...

Mac OSX 10.9 更新 port 症结

自从 MacBook Pro 升级到 Mavericks 之后,还没有用过 port 来更新软件。今天刚好需要安装 tmux 所以执行了 sudo port upgrade outdated 来更新所有已经过期的软件包,却发现居然报错: --->  Configuring expat Error: Failed to configure expat, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work/expat-2.1.0/config.log Error: org.macports.configure for port expat returned: configure failure: command execution failed Please see the log file for port expat for details:     /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log Error: Unable to upgrade port: 1 To report a bug, follow the instructions in the guide:     http://guide.macports.org/#project.tickets 谷歌了之后看到有人说需要 用 XCode 安装 developer library ,于是照做了一下,貌似没什么用,病症还是在升级到了 OSX 10.9 之后遇到了问题,我仔细查看了日志后发现是与 C 编译器有关的: error: C compiler cannot create executables 貌似强大的 clang 无法找到 stdio.h ,...