ANYWEI : CODING

积累点滴,成就梦想

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年9月9日

摘要: 直接上代码 1 #ifndef TREE_H 2 #define TREE_H 3 4 #include <iostream> 5 #include <malloc.h> 6 7 typedef int ElemType; 8 9 typedef struct Bintree10 {11 ElemType key;12 struct Bintree* left;13 struct Bintree* right;14 }Bintree,*pBintree;15 16 17 pBintree BT_Insert(ElemType target,pBintree* pp... 阅读全文
posted @ 2012-09-09 20:54 anywei 阅读(606) 评论(0) 推荐(0) 编辑

2012年4月10日

摘要: 关联容器和顺序容器的本质区别在于: 关联容器通过键(KEY)存储和读取元素, 而顺序容器则通过元素在容器中的位置存储和访问元素 阅读全文
posted @ 2012-04-10 10:42 anywei 阅读(932) 评论(0) 推荐(1) 编辑

2012年3月30日

摘要: On some platforms GHC supports building Haskell code into shared libraries. Shared libraries are also sometimes known as dynamic libraries, in particular on Windows they are referred to as dynamic link libraries (DLLs).Shared libraries allow a single instance of some pre-compiled code to be shared b 阅读全文
posted @ 2012-03-30 15:33 anywei 阅读(195) 评论(0) 推荐(0) 编辑

2012年3月9日

摘要: 可以用 localtime 函数分别获取年月日时分秒的数值。 Linux下获得系统时间的C语言的实现方法: 1. 可以用 localtime 函数分别获取年月日时分秒的数值。 #include<time.h> //C语言的头文件 #include<stdio.h> //C语言的I/O void main() { time_t now; //实例化time_t结构 struct tm *timenow; //实例化tm结构指针 time(&now); //time函数读取现在的时间(国际标准时间非北京时间),然后传值给now timenow = local... 阅读全文
posted @ 2012-03-09 20:21 anywei 阅读(2508) 评论(0) 推荐(2) 编辑

2011年12月12日

摘要: MySQL索引通常是被用于提高WHERE条件的数据行匹配或者执行联结操作时匹配其它表的数据行的搜索速度。MySQL也能利用索引来快速地执行ORDER BY和GROUP BY语句的排序和分组操作。通过索引优化来实现MySQL的ORDER BY语句优化:1、ORDER BY的索引优化。如果一个SQL语句形如:SELECT [column1],[column2],…. FROM [TABLE] ORDER BY [sort];在[sort]这个栏位上建立索引就可以实现利用索引进行order by 优化。2、WHERE + ORDER BY的索引优化,形如:SELECT [column1],[colu 阅读全文
posted @ 2011-12-12 14:30 anywei 阅读(34546) 评论(5) 推荐(2) 编辑

2011年12月1日

摘要: ##将hash %domains 按照值的大小 输出my @keysd = sort { $domains{$b} <=> $domains{$a} } keys %domains; #sort the hash;for (@keysd){ print "#$_ => $domains{$_}\n";} 阅读全文
posted @ 2011-12-01 10:44 anywei 阅读(1882) 评论(0) 推荐(0) 编辑

2011年11月28日

摘要: #include<stdio.h>//forprintf()#include<unistd.h>//forpause()#include<signal.h>//forsignal()#include<string.h>//formemset()#include<sys/time.h>//structitimeral.setitimer()voidprintMsg(int); intmain(){ //Getsystemcallresulttodeterminesuccessfulorfailedintres=0; //Register 阅读全文
posted @ 2011-11-28 15:24 anywei 阅读(3126) 评论(0) 推荐(1) 编辑

2011年11月23日

摘要: eval函数可以看作是Perl虚拟机,它的参数就是一段Perl代码。利用’perldoc –f eval’可以获取eval函数使用帮助,其中介绍了它的两种使用方式:1、eval EXPR:eval"print $a";eval'print $a'.', $b';eval1+3;eval'print '.'$a + $b, "\n"';eval$command;#$command = ‘print “hello Perl”’eval$ARGV[0];在执行时,Perl解释器会首先解析表达式的值 阅读全文
posted @ 2011-11-23 10:32 anywei 阅读(2212) 评论(0) 推荐(0) 编辑

2011年11月12日

摘要: 命令行在编写新程序时,首先遇到的障碍之一就是如何处理控制其行为的命令行参数。这包括从命令行传递给您程序的 main() 函数的一个整数计数(通常名为 argc)和一个指向字符串的指针数组(通常名为 argv).可以采用两种实质一样的方式声明标注 main() 函数,如清单 1 中所示。清单 1. 声明 main() 函数的两种方式 int main( int argc, char *argv[] );int main( int argc, char **argv );第一种方式使用的是指向 char 指针数组,现在似乎很流行这种方式,比第二种方式(其指针指向多个指向 char 的指针)... 阅读全文
posted @ 2011-11-12 18:03 anywei 阅读(1918) 评论(0) 推荐(1) 编辑

摘要: VS2008IDE:编译时出现问题:error C2471: 无法更新程序数据库“d:\my documents\visual studio 2008\projects\mdib\mdib\debug\vc90.pdb”error C1083: 无法打开程序数据库文件:“d:\my documents\visual studio 2008\projects\mdib\mdib\debug\vc90.pdb”: No such file or directory修改设置:C\C++ | General | Debug Information format | C7 Compatible (/Z7 阅读全文
posted @ 2011-11-12 13:46 anywei 阅读(895) 评论(0) 推荐(0) 编辑