(learn&think)

不浮躁,不自傲,学习,思考,总结

浅谈设计模式

| Comments

读完 GOF 的Design Patterns: Elements of Reusable Object-Oriented Software和图文并茂的Head First Design Patterns,一时并不是那么快消化和理解,所以试着用自己的语言总结一下。

《Design Patterns》在 Introduction 章中”如何选一种模式设计”一节中给出了一张表格,5 个创建模式(Abstract Factory; Builder; Factory Method; Prototype; Singleton),7 个结构模式(Adapter; Bridge; Compose; Decorator; Facade; Flyweight; Proxy)和 11 个行为模式(Chain of Responsibility; Command; Interpreter; Iterator; Mediator; Memento; Observer; State; Strategy; Template Method; Visitor)。

Octopress中使用Latex写数学公式

| Comments

Octopress 默认不支持 LaTex 写数学公式,这里修改 Octopress 使其支持。

测试

整段 LaTex 公式

1
2
3
4
5
6
7
$$
\begin{align}
\mbox{Union: } & A\cup B = \{x\mid x\in A \mbox{ or } x\in B\} \\
\mbox{Concatenation: } & A\circ B  = \{xy\mid x\in A \mbox{ and } y\in B\} \\
\mbox{Star: } & A^\star  = \{x_1x_2\ldots x_k \mid  k\geq 0 \mbox{ and each } x_i\in A\} \\
\end{align}
$$

内嵌 LaTex 公式

1
2
If $a^2=b$ and $b=2$, then the solution must be
either $a=+\sqrt{2}$ or $a=-\sqrt{2}$.

If $a^2=b$ and $b=2$, then the solution must be either $a=+\sqrt{2}$ or $a=-\sqrt{2}$.

Gflags 简明使用

| Comments

简介

Google 的 gflags 是一套命令行参数处理的开源库。比 getopt 更方便,更功能强大,从 C++的库更好的支持 C++(如 C++的 string 类型)。包括 C++的版本python 的版本。 这里只针对 C++版本,python 版本的使用类似。主要内容参考与翻译自官方文档:http://gflags.googlecode.com/svn/trunk/doc/gflags.html

你能从这里下载本文章的源代码工程。

Mac Pro Install Ubuntu 12.04

| Comments

1 Determine your hardware revision1

  1. OS X

    click in OS X on the Apple on the top left, then “About this Mac” – “More Info…”, see the generation in the “Model Identifier” row; or …

  2. ubuntu
    sudo dmidecode -s system-product-name
    

First Post

| Comments

Every Generation Has A Legend. Every Journey Has A First Step. Every Saga Has A Beginning.

The Phantom Menace Trailer Star Wars Episode I

Keep learning, thinking and summarizing.

All I want to do is just sit here
And write it all down and rest for a while