09 2018 档案
摘要:#include <iostream>#include <vector>#include <string> class Assoc { struct Pair { std::string name; double val; Pair(std::string n="", double v=0) :na
阅读全文
摘要:# awk.awk { if(data[$0]++ == 0) lines[++count] = $0} END { for (i=1;i<=count;i++) print lines[i]} 脚本用法如下: awk -f awk.awk text_to_process cat text_to_p
阅读全文
摘要:#include <iostream> class Singleton { static Singleton s; int i; Singleton(int x):i(x) {} Singleton& operator=(Singleton&); Singleton(const Singleton&
阅读全文
摘要:复制构造函数与复制赋值的区别如下: class Name { const char* s; //... }; class Table { Name* p; size_t sz; public: //... Table(const Table&); //复制构造函数 Table& operator=(
阅读全文
摘要:关联数组是用户定义类型中最常见的也是最有用的一类。关联数组也常被成为映射(map),有时被 成为字典(dictionary),其中保存的是值的对偶。给定了一个称为关键码的值,我们就能访问另一个 称为映射值的值。可以将关联数组想象为一个下标不必是整数的数组: template<class K, cla
阅读全文
摘要:#include <sys/stat.h> int stat(const char *restrict pathname, struct stat *restrict buf); struct stat { mode_t st_mode; /*file type & mode(permissions
阅读全文
摘要:Thus we see that there are very close similarities between this Bayesian viewpoint and the conventional one based on error function minimization and r
阅读全文
摘要:template <class T1, class T2> struct std::pair { typedef T1 first_type; typedef T2 second_type; T1 first; T2 second; pair() :first(T1()), second(T2())
阅读全文
摘要:Autobiography My name is Donggongdechen. I am ** years old. I was born in XuChang, HeNan province, the capital of Wei in three Kingdoms. And I have a
阅读全文
摘要:记得去上第一节课的时候,老师就问,你们知道什么是自适应吗?还举了个例子说,北方人来到了南方, 会觉得天气特别热,饮食也不太一样,这时他就开始去慢慢适应南方的环境,自适应就开始了。 The adaptive linear combiner, which is the simplest and most
阅读全文