Skip to content

Instantly share code, notes, and snippets.

View 确认识递归.org
* 正确认识递归
** 可终止性证明
如果N传负数的话,就死循环了。
sum(0) ->
0.
sum(N) when N > 0->
N + sum(N-1).
这也是上次玩家经验为什么能吃掉16G内存的原因,递归没法终止。
View erl_mysql_tests.erl
-module(erl_mysql_tests).
-include_lib("eunit/include/eunit.hrl").
all_test_() ->
[insert(),
update(),
delete(),
select()].
View erl_mysql.erl
-module(erl_mysql).
%% 详细用法看测试代码
-export([insert/2,
update/2, update/3,
delete/1, delete/2, delete/3,
select/1, select/2, select/3, select/4, select/5]).
%% TODO: maybe Values need support exp?
insert(Table, FVList) when is_list(FVList) ->
@roowe
roowe / git-2.eclass
Created Oct 9, 2012
git wrap for portage
View git-2.eclass
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/git-2.eclass,v 1.29 2012/04/03 10:32:09 pacho Exp $
# @ECLASS: git-2.eclass
# @MAINTAINER:
# Michał Górny <mgorny@gentoo.org>
# Donnie Berkholz <dberkholz@gentoo.org>
# @BLURB: Eclass for fetching and unpacking git repositories.
# @DESCRIPTION:
@roowe
roowe / gist:2848998
Created Jun 1, 2012 — forked from zythum/gist:2848881
google收录的敏感词
View gist:2848998