Posts by Tag

Book

Digest of Advanced R (亟待更新)

150 分钟阅读

P.S. It was 2015 when the 1st edition of this book came out and I wrote this post. Now Hadley Wickham is working on the 2nd edition where a lot contents chan...

Digest of Test Driven Development

少于 1 分钟阅读

这本书 的副标题是 “By Example”,所以整书适合一口气读完,也不用每个例子都敲一遍,顺着作者思路走完一遍就可以了。

返回顶部 ↑

Math-Statistics

Alias Sampling

少于 1 分钟阅读

Two brilliant posts on this sampling technique:

Parametric vs. non-parametric models

少于 1 分钟阅读

在查 non-parametric tests 时,Wikipedia 上提到了 Non-parametric models,于是干脆就记录一下。参考 Wikipedia: Parametric model。

McNemar Test

7 分钟阅读

看 wikipedia 什么的都不好使,还是得看书 Handbook of Parametric and Nonparametric Statistical Procedures,写得非常清楚。

Conditional Probability

4 分钟阅读

总结自 Coursera lecture Statistical Inference section 03 Conditional probability。

Probability

4 分钟阅读

总结自 Coursera lecture Statistical Inference section 02 Probability。

返回顶部 ↑

C++11

C++: noexcept

1 分钟阅读

整理自 C++ Primer, 5th Edition

C++: override

少于 1 分钟阅读

基本就是 java @Override 的作用:

C++: final

少于 1 分钟阅读

整理自 C++ Primer, 5th Edition

C++: Null Pointer

少于 1 分钟阅读

整理自 C++ Primer, 5th Edition

C++: enum

1 分钟阅读

整理自 Thinking in C++。没啥特别好说的。

返回顶部 ↑

Experience

Locate Bugs by Replaying

少于 1 分钟阅读

线上机的 exception log 可能被吞(日志量很大的时候,exception log 根本就打不出来),此时可以用测试机 debug。如果测试机没问题,说明是线上环境问题(网络不好、依赖的外部接口挂了之类的)。如果测试机一样挂,那么直接在测试机上找问题就好了

a weird problem caused by encoding

少于 1 分钟阅读

copy 一段代码到 jsp,tomcat 的 catalina.err 总说:org.apache.jasper.JasperException: /WEB-INF/jsp/admin/lottery/add.jsp(425,32) equal symbol expected。

有关设计的一些事后诸葛亮

少于 1 分钟阅读

交互稿没画边界情况的话后患无穷,态度一定要强硬,直接拒收! 至少在部署前要询问是否有统计需求,产品不会提醒你加统计日志的,都是事后才说。 中途换技术方案是很坑爹的。涉及第三方或自己不可控的控件,提前考虑是否有压力隐患,压力测试越早做越好(越早做越先发现问题,修改的成本越小,如:Magick,lp 项...

关于表字段数量与对象字段数量的思考

少于 1 分钟阅读

mc_lottery 是一个大表(28个字段),对应 Lottery 也是个大对象。如果一个页面只用展示 Lottery 对象的3个字段,那么,SQL 层的传输就很浪费。 如果把 mc_lottery 拆成多个小表,Lottery 对象也要拆成多个小对象的话,你就需要处理事务问题,也很烦。 由于小表...

2 most important questions when an old project is assigned to you

少于 1 分钟阅读

最简单也最容易忽视的一点:最终的操作是什么?要输出什么?要写什么值?是写 DB 还是写 UD 还是写 MD?输入往往很清楚,但输出有时候很恍惚(比如:aupg 项目) 搞清楚:接口给谁用?(比如:aupg 项目,两个接口给用户,一个接口给 SA)

返回顶部 ↑

const

C++: Const Pointer

3 分钟阅读

在 2010-09-26 原作基础上修改。日期改到 2015-03-26 使本文进入 C++ 文章群落,方便查阅。

返回顶部 ↑

Math-Algebra

PCA: my interpretation

2 分钟阅读

合着按着我自己的思路才是最好理解的。PCA 的整个过程其实就是:寻找一个基变换 (change of basis),使得新坐标系内的 axes 的功效可以量化。这个量化的意思是,如果新坐标系内有 x’-axis 和 y’-axis,我可以明确地写出 $\frac{\operatorname{effect}(\te...

Divergence / Gradient / Laplace Operator

2 分钟阅读

注意这里反复使用了 ,但要注意的是, 并不是一个有统一定义的 operator,它只是一个符号而已,在不同的高阶 operator 定义中有不同的解读和记法。具体可以参见 Wikipedia: Del

Gradient Field

2 分钟阅读

Gradient Field: a better way to interpret

Gradient and Directional Derivative

2 分钟阅读

Original post is The Gradient and Directional Derivative from Mathematics School, Oregon State University. Here I thank the author(s) sincerely.

Derivative and Partial Derivative

1 分钟阅读

感谢 良田围 网友在 偏导数有什么用 问题上的精彩回复,以下全文摘抄,仅加音标并稍微排版。

返回顶部 ↑

copy-constructor

返回顶部 ↑

Java-InnerClass

Java: 对内部类的继承

1 分钟阅读

首先我们明确下 “enclose” 这个单词的逻辑关系:OuterClass encloses InnerClass,所以外部类就是 enclosing class,内部类是 enclosed class。

Java: 局部内部类 (local inner class)

少于 1 分钟阅读

如果把 {...} 这么一段称为 “域”,那么方法 body 明显是一个域,方法 body 中的 if {} 或是 for {} 之类的也是域。在方法 body 或是方法 body 中其他域里定义的类就是局部内部类。

Java: 匿名内部类 (anonymous inner class):简化形式及自动向上转型

少于 1 分钟阅读

内部类的一个重要作用是隐藏继承或是对接口的实现,典型的形式是:内部类来继承或是实现接口,由外部类提供代理 constructor 方法。这些代理 constructor 方法一般都利用的向上转型,即不返回内部类对象,而是返回内部类继承的父类对象或是实现的接口对象。如:

返回顶部 ↑

Java-DesignPattern

Middleman Patterns: Adapter / Proxy / Decorator

1 分钟阅读

我觉得用 Java 学 design pattern 有个问题就是:总是要有 interface / abstract class 介入,搞得整个 class hierarchy 非常复杂。其实我用 duck typing 的思路来看,Adapter、Proxy、Decorator 这三个模式的基本结构是一样的,...

Visitor Pattern Revisited

2 分钟阅读

我们在 PPP 里其实有讲 visitor pattern,但最近在读的 Crafting Interpreters 提供了一个绝妙的解读,虽然只能适用于 vanilla 的 visitor pattern,但还是值得记录下。

Service Locator Pattern

少于 1 分钟阅读

Martin Fowler 的 Inversion of Control Containers and the Dependency Injection pattern 中提到的。

返回顶部 ↑

Java-Exception

Java: throw 的屏蔽作用

少于 1 分钟阅读

在其所在的块内 (如方法 body、if () {...} 等),throw 语句可以屏蔽其后的语句,即在块内,该 throw 语句后面不能再写其他语句;但在块之外,还是可以写其他的语句的。如:

Java: 涉及继承的异常声明及捕捉

2 分钟阅读

当有继承发生时,会伴随着重载、覆写 (包括接口方法的实现)、构造器的重写等行为。此时,如果基类或是接口的方法存在异常声明,那么导出类或是接口的实现类的对应方法该如何声明异常?同时对这些方法的调用该如何捕捉异常?下面就这 2 个问题进行探讨,你会看到,针对覆写和构造器的重写是 2 种完全不同的处理方式 (针对重载则...

Java: first catch

少于 1 分钟阅读

try 块里有异常抛出时,程序会进入 第一个 异常类型匹配的 catch 块执行,其他的 catch 块不执行。

返回顶部 ↑

Java-Concurrency

Java 多线程:synchronized

1 分钟阅读

首先明确一点,同步方法本质上也是一个同步控制块(仅针对于锁定 this 的情况,如果同步控制块锁定的不是 this,那么它是不能直接改写为同步方法的),区别在于同步方法的粒度是整个方法,而同步控制块的粒度可以是方法的一部分。

Java 多线程:终止线程的方法

1 分钟阅读

虽说 Thread 类提供了 stop() 和 suspend() 方法,但这两种方法过于粗暴,如果线程占用了一些资源(如打开了一个文件,建立了一个数据库连接什么的),直接 stop() 或是 suspend() 是会产生问题的。

返回顶部 ↑

SVM

WD kernel with shifts

4 分钟阅读

原文 RASE: recognition of alternatively spliced exons in C.elegans.

Lagrange duality

6 分钟阅读

总结自 section note 5: Convex Optimization Overview, Part II

返回顶部 ↑

pointer

C++: Null Pointer

少于 1 分钟阅读

整理自 C++ Primer, 5th Edition

C++: Const Pointer

3 分钟阅读

在 2010-09-26 原作基础上修改。日期改到 2015-03-26 使本文进入 C++ 文章群落,方便查阅。

返回顶部 ↑

Java-AOP

Spring AOP 学习(四):简单 XML 配置

少于 1 分钟阅读

紧接着 Spring AOP 学习(三):例子与基本概念 中的例子。其实 Spring AOP 注解的概念理解了后,看 XML 配置就是件很简单的事情了。

Spring AOP 学习(二):动态代理

1 分钟阅读

如果系统中有 500 个类,每个类都要添加日志功能,此时无论是直接修改源代码、继承还是组合,都是十分巨大的工作量。此时 AOP 可以帮我们解决这个问题。

Java: the proxy parameter of the invoke() method

1 分钟阅读

关于动态代理,一般的代码结构为:一个业务接口、一个业务接口的实现、一个自定义的 InvocationHandler 实现和 main 类,如下:

返回顶部 ↑

Paper

The MEME algorithm

2 分钟阅读

接上一篇 EM method for identifying motifs in unaligned biopolymer sequences,我们接着介绍 Unsupervised Learning of Multiple Motifs in Biopolymers Using Expectation Maxi...

Expectation-Maximization Algorithm

6 分钟阅读

原文 A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models。

WD kernel with shifts

4 分钟阅读

原文 RASE: recognition of alternatively spliced exons in C.elegans.

返回顶部 ↑

Proxy

Spring AOP 学习(二):动态代理

1 分钟阅读

如果系统中有 500 个类,每个类都要添加日志功能,此时无论是直接修改源代码、继承还是组合,都是十分巨大的工作量。此时 AOP 可以帮我们解决这个问题。

Java: the proxy parameter of the invoke() method

1 分钟阅读

关于动态代理,一般的代码结构为:一个业务接口、一个业务接口的实现、一个自定义的 InvocationHandler 实现和 main 类,如下:

返回顶部 ↑

PCA

PCA: my interpretation

2 分钟阅读

合着按着我自己的思路才是最好理解的。PCA 的整个过程其实就是:寻找一个基变换 (change of basis),使得新坐标系内的 axes 的功效可以量化。这个量化的意思是,如果新坐标系内有 x’-axis 和 y’-axis,我可以明确地写出 $\frac{\operatorname{effect}(\te...

返回顶部 ↑

template

C++: Template Trait

少于 1 分钟阅读

具体见 Traits: a new and useful template technique。这里只说下感想:

返回顶部 ↑

Rcpp

Digest of Advanced R (亟待更新)

150 分钟阅读

P.S. It was 2015 when the 1st edition of this book came out and I wrote this post. Now Hadley Wickham is working on the 2nd edition where a lot contents chan...

返回顶部 ↑

JVM

Java Class Loading: an example

1 分钟阅读

class loading 是一个比较复杂的过程。一般说来,类是在其 static member 被访问时被加载的。在加载时会做的一件事是:初始化 static member 和 static 代码段 (static block, i.e. static {......}),当然,static 是只会被执行 on...

返回顶部 ↑

动态代理

Spring AOP 学习(二):动态代理

1 分钟阅读

如果系统中有 500 个类,每个类都要添加日志功能,此时无论是直接修改源代码、继承还是组合,都是十分巨大的工作量。此时 AOP 可以帮我们解决这个问题。

Java: the proxy parameter of the invoke() method

1 分钟阅读

关于动态代理,一般的代码结构为:一个业务接口、一个业务接口的实现、一个自定义的 InvocationHandler 实现和 main 类,如下:

返回顶部 ↑

Article

Service Locator Pattern

少于 1 分钟阅读

Martin Fowler 的 Inversion of Control Containers and the Dependency Injection pattern 中提到的。

返回顶部 ↑

escape

Python: play with backslashes

3 分钟阅读

最近研究 regular expression 顺便补了下 escape 的课 (参 Escape Character / Control Character / Python Raw Strings / Python Bytes Literals),然后我今天就发现了 python 光一个 escape cha...

返回顶部 ↑

MathJax

MathJax 血泪史

1 分钟阅读

Github Pages 升级到了 Jekyll 3.0,而且将使用 kramdown 解析引擎。我紧跟大部队,local build 环境也升级了,但是发现了 MathJax 有超级多的问题,特来写下血泪史……

返回顶部 ↑

RTTI

LLVM’s RTTI Replacement

1 分钟阅读

LLVM 禁止使用 C++ native RTTI,主要是嫌弃 native RTTI 的 performance,并不是说 LLVM 不需要 RTTI 这个 feature。我们可以说 LLVM 自己实现了一套新的 RTTI (以下称 LLVM-style RTTI),它有:

C++: typeid

1 分钟阅读

整理自:Thinking in C++, Volume 2

返回顶部 ↑

entropy

Cross Entropy vs Cross Entropy Loss

少于 1 分钟阅读

这俩是有区别的,我一直没有注意直到我发现公式上的区别。我没有注意的原因应该是 regression 没有显式使用 cross entropy loss,而 classification 的 cross entropy loss 是对原生 cross entropy 的扩展。

返回顶部 ↑

Topology

返回顶部 ↑

Delegate

Java: a simple delegation example

少于 1 分钟阅读

public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { doGet(req, resp); }

返回顶部 ↑

Post Formats

Post: Link Permalink

少于 1 分钟阅读

This theme supports link posts, made famous by John Gruber. To use, just add link: http://url-you-want-linked to the post’s YAML front matter and you’re done.

Post: Notice

1 分钟阅读

A notice displays information that explains nearby content. Often used to call attention to a particular detail.

返回顶部 ↑

Servlet

返回顶部 ↑

IE

never fake a <input type=file>

少于 1 分钟阅读

不管这篇 自定义input type=”file”的样式以及引出的相关技术问题 描绘得有多么好,永远不要妄想用 <span> 来代替 <input type="file"> (即自定义样式的 file 控件),浏览器兼容性问题 is watching you! 我们可是连 IE6 都要测的...

返回顶部 ↑

Java-TDD

Digest of Test Driven Development

少于 1 分钟阅读

这本书 的副标题是 “By Example”,所以整书适合一口气读完,也不用每个例子都敲一遍,顺着作者思路走完一遍就可以了。

返回顶部 ↑

JSON

Is JSON a string?

少于 1 分钟阅读

我写这篇的起因来自于这个灵魂拷问 Is JSON a string? 我觉得这又是个老外瞎用词导致的误解。

JSON conversion

少于 1 分钟阅读

1. Java Object <-> JSONObject

返回顶部 ↑

Closure

返回顶部 ↑

Java-DistributedSystem

返回顶部 ↑

LDA

ISL: Classification

16 分钟阅读

总结自 Chapter 4, An Introduction to Statistical Learning.

返回顶部 ↑

Bootstrap

ISL: Resampling Methods

9 分钟阅读

总结自 Chapter 5, An Introduction to Statistical Learning.

返回顶部 ↑

Bayes

Naive Bayes classifier

1 分钟阅读

首先感谢 张洋 先生的这篇 算法杂货铺——分类算法之朴素贝叶斯分类(Naive Bayesian classification),写的非常清楚明白。本文以此为基础做些总结。

返回顶部 ↑

Bagging

返回顶部 ↑

Boosting

返回顶部 ↑

EM

Expectation-Maximization Algorithm

6 分钟阅读

原文 A Gentle Tutorial of the EM Algorithm and its Application to Parameter Estimation for Gaussian Mixture and Hidden Markov Models。

返回顶部 ↑

Graph

返回顶部 ↑

ggplot

返回顶部 ↑

cross-validation

返回顶部 ↑

ROC

返回顶部 ↑

PRC

返回顶部 ↑

socket

Python: Socket Programming 101

5 分钟阅读

参考 Socket Programming in Python (Guide) 的前半部分,代码有改动。另外我觉得这个例子用两个 ipython 来玩更方便理解。

返回顶部 ↑

port

返回顶部 ↑

regexp

MySQL REGEXP

少于 1 分钟阅读

  参考 Regular Expressions - User Guide

返回顶部 ↑

notice

Post: Notice

1 分钟阅读

A notice displays information that explains nearby content. Often used to call attention to a particular detail.

返回顶部 ↑

utf8

返回顶部 ↑

UML

返回顶部 ↑

ajax

返回顶部 ↑

JavaDoc

返回顶部 ↑

XSS

返回顶部 ↑

CSRF

返回顶部 ↑

SOA

返回顶部 ↑

Java-Collection

返回顶部 ↑

Spline

返回顶部 ↑

GAM

返回顶部 ↑

Cluster

返回顶部 ↑

NLP

返回顶部 ↑

Math-Geometry

Simplex

少于 1 分钟阅读

概念挺简单,主要是生单词太多了,mark 一下。

返回顶部 ↑

HMM

返回顶部 ↑

RTII

返回顶部 ↑

pandas

返回顶部 ↑

numpy

返回顶部 ↑

MySQL-client

返回顶部 ↑

Markov

返回顶部 ↑

Entropy

返回顶部 ↑

CPU

CPU bound vs IO bound

少于 1 分钟阅读

From stackoverflow: What do the terms “CPU bound” and “I/O bound” mean?:

返回顶部 ↑

IO

CPU bound vs IO bound

少于 1 分钟阅读

From stackoverflow: What do the terms “CPU bound” and “I/O bound” mean?:

返回顶部 ↑

Bioconductor

返回顶部 ↑

apply

返回顶部 ↑

Autocommit

返回顶部 ↑

np.unique

返回顶部 ↑

pdist

scipy: pdist indexing

1 分钟阅读

scipy.spatial.distance.pdist(X) gives the pair-wise distances of X, dist(X[i],X[i]) not included. The distances are stored in a dense matri...

返回顶部 ↑

dense-matrix

scipy: pdist indexing

1 分钟阅读

scipy.spatial.distance.pdist(X) gives the pair-wise distances of X, dist(X[i],X[i]) not included. The distances are stored in a dense matri...

返回顶部 ↑

pip

返回顶部 ↑

sudo

返回顶部 ↑

virtualenv

返回顶部 ↑

generative

Generative Models

3 分钟阅读

参考自 Introduction to Semi-Supervised Learning。

返回顶部 ↑

convex

返回顶部 ↑

SNAP

返回顶部 ↑

node2vec

返回顶部 ↑

Pivot

返回顶部 ↑

context-free

What does context-free mean in CFLs?

少于 1 分钟阅读

这真的是困扰了我很多年的问题,而且我发现这还不是中文教材的锅,老外的很多教材也是上来就 CFL,也不告诉你这个 context 到底是啥 context,这个 free 是怎么个 free 法。我就纳闷了,多讲这么几句怎么就这么难呢……

返回顶部 ↑

Chomsky

What does context-free mean in CFLs?

少于 1 分钟阅读

这真的是困扰了我很多年的问题,而且我发现这还不是中文教材的锅,老外的很多教材也是上来就 CFL,也不告诉你这个 context 到底是啥 context,这个 free 是怎么个 free 法。我就纳闷了,多讲这么几句怎么就这么难呢……

返回顶部 ↑

URL

返回顶部 ↑

LLVM

LLVM’s RTTI Replacement

1 分钟阅读

LLVM 禁止使用 C++ native RTTI,主要是嫌弃 native RTTI 的 performance,并不是说 LLVM 不需要 RTTI 这个 feature。我们可以说 LLVM 自己实现了一套新的 RTTI (以下称 LLVM-style RTTI),它有:

返回顶部 ↑