流云轩
xkxjy · 共 22 篇文章
链表法页框的分配和去配
采用链表的方法模拟分页式存储空间的分配和去配, MemManager.h #pragma once #define MAX_MEM_LEN 512 class CMemManager { private: struct MemItem { struct MemItem* prior; struct MemItem* next; bool bFree; int nPos; int nLen; int nOwner; MemItem(MemItem* pri, MemItem* nxt, bool bfree, int nPosition, int nLength) { prior = pri;…
2011-01-22 21:01 · 杂谈 · 评论(0)
关于模态对话框
对话框一般有模态和非模态之分 一般通过DoModal出来的对话框就是模态对话框 通过Create的对话框时非模态的 原以为模态对话框会将其调用线程阻塞,现在发现不是这样 调用模态对话框的时候只是此处代码不再向下进行,直到关掉对话框才会继续下面的指令 在这个时候调出模态对话框的线程还能响应其他消息
2010-10-13 19:06 · 杂谈 · 评论(0)
makefile
使用:make (生成目标文件) make clean(清理中间文件) # target hello.exe OBJS = hello.o # a macro CC = g++ # the compiler DEBUG = -g CFLAG = -Wall -c $(DEBUG) # compile to .obj LFLAG = -Wall $(DEBUG) # link to .exe hello.exe : $(OBJS) $(CC) $(LFLAG) $(OBJS) -o hello.exe hello.o : hello.cpp $(CC) $(CFLAG) hello.cpp c…
2010-03-25 21:33 · C · 评论(0)
函数参数:可变参数
C/C++语言的函数可以定义可变参数,例子如下: #include <windows.h> #include <cstdio> #include <tchar.h> void DebugMsg(LPCTSTR pszFormat, ...); int main() { DebugMsg(_T("%s\n"), _T("hello")); return 0; } void DebugMsg(LPCTSTR pszFormat, ...) { TCHAR buf[1024] = {0}; va_list arglist; va_start(arglist, pszFormat); _vstpri…
2010-03-22 21:42 · C · 评论(0)
VS 静态库的编写
Visual Studio 下静态库的编写 使用VS建立 控制台--Static library(静态库) 项目 libTest.h 头文件 #ifndef GUARD_LIBTEST_H #define GUARD_LIBTEST_H #ifdef __cplusplus extern "C" { #endif int myadd(int a, int b); #ifdef __cplusplus } #endif #endif // end GUARD_LIBTEST_H libTest.cpp源文件 #include "libTest.h" int myadd(int a, int b…
2010-03-11 19:41 · 杂谈 · 评论(0)
python 使用
python操作mssql http://pymssql.sourceforge.net/index.php http://blog.csdn.net/ChumpKlutz/archive/2006/10/03/1319994.aspx
2010-03-10 19:27 · python · 评论(0)
sql 行专列 列转行 普通行列转换
/* 标题:普通行列转换(version 2.0) 作者:爱新觉罗.毓华 时间:2008-03-09 地点:广东深圳 说明:普通行列转换(version 1.0)仅针对sql server 2000提供静态和动态写法,version 2.0增加sql server 2005的有关写法。 问题:假设有张学生成绩表(tb)如下: 姓名 课程 分数 张三 语文 74 张三 数学 83 张三 物理 93 李四 语文 74 李四 数学 84 李四 物理 94 想变成(得到如下结果): 姓名 语文 数学 物理 ---- ---- ---- ---- 李四 74 84 94 张三 74 83 93 ---…
2010-02-24 20:34 · SQL · 评论(0)
网文收藏
Neat Stuff to Do in List Controls Using Custom Draw http://www.codeproject.com/KB/list/lvcustomdraw.aspx ado_database的专栏 http://blog.csdn.net/ado_database Catch All Bugs with BugTrap! http://www.codeproject.com/KB/applications/BugTrap.aspx?msg=1718479
2010-02-05 19:09 · 杂谈 · 评论(0)
铁路轨道边的扳道工
思考1:大局上面仍然有另一个大局 思考2:公平永远有不同角度的公平 思考3:这个游戏只有站在切换器旁边的人可以决定结果 有一群小朋友在外面玩,而那个地方有两条铁轨, 一条还在使用,一条已经停用 只有一个小朋友选择在停用的铁轨上玩 其它的小朋友全都在仍在使用的铁轨上玩 很不巧的,火车来了 (而且理所当然的往上面有很多小孩的,仍在使用的铁轨上行驶) 而你正站在铁轨的切换器旁,因此你能让火车转往停用的铁轨 这样的话你就可以救了大多数的小朋友;但是那名在停用铁轨上的小朋友将被牺牲 你会怎么办? 据说大多数人会选择救多一些的人,换句话说, 牺牲那名在停用铁轨上玩的小孩... 但是这又引出另一个问题 那…
2010-01-11 20:10 · 杂谈 · 评论(0)
C# xmlhttp
转自: http://www.cnblogs.com/shaofh/archive/2007/07/27/833462.html //引入com microsoft.xml.3.0 //using MSXML2; public void GetCon(String Url) { // string vs = ""; // try // { // ArrayList arr = new ArrayList(); // XMLHTTP XmlHttp = new MSXML2.XMLHTTPClass(); // XmlHttp.open("get", url,false, null, null…
2010-01-06 19:41 · C · 评论(0)
C++: split 字符串分割函数
源自ACPP的字符串分割函数 vector<string> split(const std::string &s) { vector<string> vec_ret; typedef string::size_type string_size; string_size i = 0; while (i != s.size()){ // ignore the space while (i != s.size() && isspace(s[i])) ++i; string_size j = i; // get all the char while (j != s.size() && !isspac…
2009-12-14 20:53 · C · 评论(0)
Accelerated C++ 第三章要点
Accelerated C++ 第三章要点 Local variables are default-initialized if they are defined without an explicit initializer. Default-initialization of a built-in type means that the value is undefined. Undefined values may be used only as the left-hand side of an assignment. 如果局部变量没有显示初始化,则踏实默认初始化的。内置类型的默认初始…
2009-11-10 18:38 · C · 评论(0)
C C++ 字符串去空格函数
----------------------------------------C--------------------------------------- #include <stdio.h> #include <string.h> #include <ctype.h> char * trim(char * ptr) { int start,end,i; if (ptr) { for(start=0; isspace(ptr[start]); start++) ; for(end=strlen(ptr)-1; isspace(ptr[end]); end--) ; for(i=star…
2009-11-09 19:26 · C · 评论(0)
程序员最好收藏的若干网站
程序员最好收藏的若干网站 收藏 http://www.gotapi.com/ 语言:英语 简介:HTML,CSS,XPATH,XSL,JAVASCRIPT等API的查询网站。 http://www.w3schools.com/ 语言:英语 简介:W3C制定的标准诸如XML,HTML,XSL等等的在线学习教程。 http://www.xml.org.cn/ 语言:中文 简介:可以说是XML的中国官方网吧。W3C标准的翻译组织与XML系列技术交流社区. http://www.connectionstrings.com/ 语言:英语 简介:这里几乎收集了所有的数据库连接字符(connections…
2009-10-28 20:09 · 杂谈 · 评论(0)
SQL Server 2008 一直要求重启的解决
前几天要安装SQL Server 2008,安装过程中总是要求重启,重启多次,总是没有结果 上网Google,在msdn找到了方法,于是记录之。 找到注册表的 "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager" 并将其下面的"PendingFileRenameOperations" 的值删掉即可
2009-10-27 20:11 · SQL · 评论(0)