- 博客(61)
- 资源 (6)
- 收藏
- 关注
原创 [linux,kernel,rbtree] rb_node 结构体分析
本文主要介绍的是分析 linux 内核中红黑树 rbtree 中的 rb_node 的实现技巧
2014-12-23 10:28:23
3501
1
原创 [cpp,algorithm] FpTree_2_首次扫描数据库抽取项集_并根据支持度剪枝
接上一次的实验,1_从文件中读取数据集并将其解析 在实验1中,将数据从数据文件中导入到程序的事务数据库(transaction_database) 数据结构对象中, 本次实验目的是对数据库进行扫描,从中选出数据库中的所有项集(item)组成项集集合(itemset ).
2014-11-30 18:44:22
973
原创 [c++,kernel] 获取当前进程内存占用量
实验目的: 通过系统调用实现获取当前正在运行的进程占用系统中的内存资源的最大值, 由于涉及到系统库中的API 所以将其归类为kernel方向。
2014-11-30 10:50:42
4857
原创 [cpp,algorithm,fpTree] FPTree_1_从文件中读取数据集并将其解析
实现 fp-tree 的第一步,将数据从文件读入到程序中,其中数据文件格式: "item1":"apple,banana,beaf"(回车换行符) "item2":"bread,coke,beer,coffee"(回车换行符) ... "itemi":"food1,food2...foodk"(无回车) 设计的数据结构类型 item : string ; transaction : vector<string> ; transaction_database : vector< vector<st
2014-11-30 00:27:48
1035
原创 [postgreSQL,c++] PostgreSQL源码分析_StringInfo_primary_2
而这篇文章主要是分析stringinfo.c ,即头文件中所声明的方法的具体实现过程。 其中多数方法并不难分析,只要仔细阅读API文档和根据方法的命名规范进行推测,即可得知该方法的功能。 不过仍旧有功能上比较复杂,并值得读者仔细分析与揣摩的两个函数: 1. appendStringInfoVA 函数原型: bool appendStringInfoVA(StringInfo str, const char *fmt, va_list args) 2.enlargeStringInfo 函数原型:
2014-11-26 18:46:27
1601
原创 [c++,linux] 接收可变参数并将其格式化输出的方法实现
学习并掌握 vsnprintf ,vsprintf, va_list 系列方法的使用通过 C 语言中的库函数的调用, 即其中的宏va_list 等定义来实现读取方法中所传入的可变参数。
2014-11-25 21:04:01
1668
原创 [postgreSQL,c++] PostgreSQL源码分析_StringInfo_primary
这篇文章主要是结合 PostgreSQL 中的内存方向的源代码的学习与使用, 这一系列文章被分类为源代码阅读方向,每一篇中主要阅读、注释一段经典的PostgreSQL内核中的源代码, 每一章主要分为两个部分,第一部分是初级篇 primary 主要介绍的是该段源代码中的语法规则以及所使用到的 unix 中相应的API 调用传参规则, 第二部分是高级篇 advanced 主要内容是,
2014-11-24 20:54:25
1070
原创 [algorithm,c++] 基于c++的二维k-means代码实现
利用上课期间打的草稿,这里仅仅实现的是数据输入, 后续的 k-means #include #include #include #include using namespace std ; struct obj { float _x ; float _y ; obj ( float x , float y ):_x(x) , _y(y) {} obj () {}
2014-11-17 18:09:51
1056
原创 [linux,c++] 基于mutex 的互斥访问队列实现
实验目的: 练习使用mutex 来保护需要互斥访问对象,同时练习在linux下面使用autotools 来创建Makefile.am 文件编写。 练习将STL 中的 queue 与 linux 中的加锁解锁操作相互结合使用。 为后续的学习网络编程实现多个客户端同时向服务器端发送请求消息做铺垫,本实验中实现的互斥访问队列, 可以用作服务器端为了接受来自多个客户端的请求而开辟的缓冲区,即缓冲消
2014-11-08 21:13:14
3870
原创 [linux,c++]使用指针函数实现多个函数调用_Advanced
#include #include #include #include #include #ifndef FUNCENTRY_HPP__ #define FUNCENTRY_HPP__ enum MSG_TYPE { MSG_COMMAND = 0 , MSG_DATA, UNKNOWN_MSG_TYPE } ; enum PROCESS_TYPE { TCPLI
2014-10-28 20:09:17
993
原创 [linux,c++] 使用指针函数实现多个函数调用
#include #include #include #ifndef FUNCENTRY_HPP__ #define FUNCENTRY_HPP__ enum LEVEL_TYPE { LEVEL_SYSTEM = 0 , LEVEL_PROGRAMMER , LEVEL_ORDINARY } ; typedef int (*funcEntryPoint) ( char *) ;
2014-10-27 20:55:29
759
转载 不要害怕重复
一个人所知道的东西,与他的实际做法之间存在着一条非常巨大的鸿沟。 每天,我们接收到太多的信息,尤其从互联网上。我们听到、读到太多的“道理”与“经验”。然而,付诸行动的却很少, 能坚持到有成效的就更少。所以,生活继续,一切照旧。 在一本叫做《知道做到》的书中,作者提出造成知道做到之间巨大鸿沟的原因有三条: 信息超载。在生活中, 获取新知识要比复习旧知识有趣得多。学习新知识
2014-08-08 01:43:54
1068
原创 pat1051
1051. Pop Sequence (25) 时间限制 10 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a stack which can keep M numbers at most. Push N numbers
2014-08-01 14:44:45
646
原创 pat1074_备份
1074. Reversing Linked List (25) 时间限制 300 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a constant K and a singly linked list L, you ar
2014-08-01 01:11:55
554
原创 pat1078 错题备份
1078. Hashing (25) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The task of this problem is simple: insert a sequence of distinct positi
2014-07-31 23:32:13
612
原创 pat1052
1052. Linked List Sorting (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A linked list consists of a series of structures, which
2014-07-31 21:27:34
627
原创 pat1015_错题备份
1015. Reversible Primes (20) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A reversible prime in any number system is a prime whose "reverse" in that number
2014-07-30 21:17:39
493
原创 pat1050
1050. String Subtraction (20) 时间限制 10 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given two strings S1 and S2, S = S1 - S2 is defined to be the remaining strin
2014-07-30 21:07:53
480
原创 pat1012
1012. The Best Rank (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue To evaluate the performance of our first year CS majored stud
2014-07-23 12:27:51
602
原创 pat1011
#include #include double map[3][5] ; int list[3] ; char c[] = {'W','T','L'} ; void inPut() { for ( int i = 0 ; i < 3 ; i++ ) { double max = -100 ; int loc = 0 ; for (int j = 0 ; j < 3 ; j
2014-07-22 19:27:12
584
原创 pat1004
1004. Counting Leaves (30) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue A family hierarchy is usually presented by a pedigree tree.
2014-07-22 11:19:32
606
原创 pat1010
#include #include #include #define a 10 #define MAXN 15 using namespace std ; char num1[MAXN], num2[MAXN]; char temp[MAXN] ; char tempX [MAXN] ; int radix , tag ; int num_10 = 0 ; int getPow (
2014-07-17 17:56:01
539
原创 pat1009
1009. Product of Polynomials (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue This time, you are supposed to find A*B where A and B
2014-07-17 15:27:25
577
原创 pat_练习题_2-06
2-06. 数列求和(20) 时间限制 100 ms 内存限制 32000 kB 代码长度限制 8000 B 判题程序 Standard 给定某数字A(1 求数列之和S = A + AA + AAA + … + AA…A(N个A)。例如A=1, N=3时,S = 1 + 11 + 111 = 123。
2014-07-16 10:58:47
920
原创 pat1003
1003. Emergency (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue As an emergency rescue team leader of a city, yo
2014-07-15 23:44:28
610
原创 pat1073
#include #include using namespace std ; int pow ( int i ) { int n ; int result = 1 ; for ( n = 0 ; n < i ; n++ ) result *= 10 ; return result ; } int getBase (char base[] ) { int
2014-07-14 10:20:39
693
hadoop权威指南
2013-02-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅