自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(80)
  • 资源 (3)
  • 收藏
  • 关注

原创 MoveWindow和setwindowpos的区别

要区分MoveWindow和setwindowpos的区别,我们先从msdn上入手:1、MoveWindowThis function changes the position and dimensions of the specified window. For a

2011-09-07 19:46:55 24271

原创 枯黄的世界

枯黄的灯光撒落在枯黄的落叶上,枯黄的落叶散布在枯黄的大地上,枯黄的大地上没有一滴绿!  ——整理

2011-06-27 19:49:00 869

转载 vmware 虚拟机的快捷键

<br />Ctrl-B               开机<br />Ctrl-E               关机<br />Ctrl-R               重启<br />Ctrl-Z               挂起<br />Ctrl-N               新建一个虚拟机<br />Ctrl-O               打开一个虚拟机<br />Ctrl-F4              关闭所选择虚拟机的概要或者控制视图。如果虚拟机开着,一个确认对话框将出现。<br />Ct

2011-05-16 12:45:00 6612

原创 模板-继承-具现化

<br />今天在学习effective c++中的第49个条款时,遇到一个模板继承的方法,让我打开眼界,感慨万千啊!<br />具体的代码如下:<br />class NewHandlerHolder{public: explicit NewHandlerHolder(new_handler nh) : handler(nh) {} ~NewHandlerHolder() { set_new_handler(handler); }private: new_han

2011-05-07 17:35:00 2988 3

转载 人生感悟之至理名言(转帖)

1、走的桥多,不一定走的路就多。吃的盐多,不一定吃的饭就多。走路的时候有伴就不觉得路远,吃饭的时候有伴就吃得香。(幸运52李咏说的) <br />2、都说人往高处走,可是高处不胜寒。水往低处流,谁知低处纳百川!(艺术人生朱军说的) <br />3、Love means you don't have to say sorry,ever. <br />4、如果我爱你,我就会理解你,通过你的眼睛去看世界。我能理解你是因为我能在你身上看到我自己,在我身上也看到了你。 <br />5、如果人生是一段旅途,快乐与悲伤就

2011-05-07 09:06:00 1523

转载 linux学习资料(转帖收藏)

http://www.embedworld.com/http://c-faq.com/Cross-Referencing Linux(基于lxr的linux源码阅读,emacs的etags不好使的时候用它)http://lxr.linux.no/source/优龙科技http://www.ucdragon.com/华恒公司的主页,里面有很多的相关资料,有待大家去发现http://www.hhcn.com/chinese/embedlinux-res.htmlAT91RM9200补丁下载网站http://ma

2011-05-06 09:08:00 6146

原创 生活的节拍

      现在是信息大爆炸的年代,随着互联网的高速发展,人们所接触到的信息也越来越多。面对这些数量巨大而且种类繁多的信息,人们开始浮躁起来,每天都活着快节奏的生活里,不仅精疲力尽,而且蓦然回首时,发现自己一无所获、一无所有!只是在信息浪潮的推搡下,向着海市蜃楼死命奔跑,到头来才发现一切皆是“浮云”!      古人云:“静以修身,俭以养德”,人只有静下心来,才能去除眼前浮躁的幕布,看清大千世界,看清事物的本质!生活本来就是用心来体会的,而不是眼!当你真正以“静”的心态感受身边的花草树木、鸟语花香、风声哗香

2011-05-01 21:57:00 1088 1

原创 cout的二进制输出

今天,看到一个帖子,是用cout进行二进制输出的问题,示例代码如下: class A{public: A(int v): x(v) {} void outbin() { cout大家可以看出什么问题吗?cout并么有bin成员,所以以上代码是编译不过的!如果要输出二进制应该怎么办呢?其实,cout并不支持输出二进制,只支持八、十、十六进制三种方式,那该怎么办呢?大家是否会想起stl中扩展的容器bitset!对了,就是用bits

2011-04-30 10:58:00 32637 3

原创 纯虚函数也可定义!

<br />今天,我读到《effective c++》的第34条款,里面竟然提到纯虚函数也是可以定义的,大吃一惊,赶快打开vs2005,自己编写了一段代码,编译运行,发现竟然真的可以!<br />俺的代码:<br />class A{public: virtual void pureVirtualFunc() = 0;};void A::pureVirtualFunc(){ cout<<"I'am pureVirtualFunc"<<endl;}class B :

2011-04-28 14:45:00 8328 3

原创 违约的艰辛

<br />华为是我所收到的第一个offer,来的其实也不易,当时接到offer后的没几天就被通知要进行签约。当时的我希望能留在武汉,毕竟在武汉这么多年了!所以在签约的时候和hr交流能否留在武汉,答案是NO,我有点犹豫了,但是hr催得很急,说快些签,还有后几批在等着呢!我当时就想,先签了吧,到时不行在“违”!当时真的很没经验,也不懂违约到底自己要承担什么样的责任,懵懂的概念就是换个工作再签一份三方!真是大错特错了!<br />后来,因为我女朋友的原因,我换了个工作,这样的后果是要和全国最为严格贯彻国家政策的

2011-04-28 10:49:00 1106 2

原创 指针类型的幻觉

<br />关于指针,我最初的想法就是,所有类型的指针都是一样的,都是4个字节长度。这句话是对的,但是往往会给我们带来“幻觉”,从而误导我们的判断!就像“幻城”中的幻术师所施展的幻术,真假难辨!<br /> <br />首先,先让我们看看以下情况:<br />问题:<br /><br />C/C++ code<br />int a[]={1,2,3,4,5,6,7,8,9};<br /><br />short *p=(short*)(a+2);<br />short *q=(short*)a;<br /><

2011-04-28 10:25:00 934 2

原创 模板友元函数的声明

刚才在论坛上看到一篇帖子,很有意思,是关于模板友元函数的声明的,在vs2005上可以运行的代码,在vs2008中就会编译错误,同样vc6的也不相同。首先,让我们看看vc6上的代码:#includeusing namespace std;template class AA;template class BB;template int park(const AA & , const BB & );template class AA{public:

2011-04-23 13:10:00 1267 5

原创 探讨struct对齐

<br />毕业前找工作的经历让我发现,很多公司的笔试、面试题中都涉及到了struct的对齐的问题!今天我们就深入探索其中的奥秘!<br />首先,让我们分析下面的代码:<br />struct AT<br />{<br />    char a;<br />    char b;<br />    int  c;<br />    char d;<br />};<br />int main(void)<br />{<br />    AT at;<br />    cout<<sizeof(at)<<en

2011-04-23 11:21:00 3405 2

原创 无符号整型赋值陷阱

有没有人尝试过将负数赋给一个无符号整型变量?知不知道这样做会发生什么?还没有尝试的就让我们来探索下无符号整型隐藏的秘密。先来看看下面代码:int main(){      unsigned int val = -1;      cout      retu

2011-04-22 23:49:00 18804 4

原创 malloc-free和new-delete的思考

<br />    今天我想讨论下malloc-free和new-delete之间的区别与不同,深入探讨其内部实现的机制。如果你对此不屑一顾,请先不要那么自信,先来回答下面几个问题:<br />1、malloc和new、free和delete之间有什么区别?<br />2、为什么malloc时输入了所申请内存的大小size,但是free时怎么不用输入要释放内存的大小,而只要输入指向该内存的指针就可以了?其内部隐藏了什么处理机制?<br />3、同样new时需要输入要创建对象的个数,为什么delete释放时不

2011-04-19 11:42:00 2191 1

原创 会议期刊之我见

    最近,又有好对所谓的国际会议的邀请函发到我的邮箱里,看着这些莫名激增的会议,心里感慨万千啊!曾几何时,因为许多大学要求研究生毕业前必须发表一篇论文,要求至少是国际会议的,无数莘莘学子挤破脑袋,冒着抄袭的危险,做着空洞冒水的论文;曾几何时,大学教授评定职称,评的是几篇EI几篇核心。正是在如此腐朽的政策下,学术造假日益严重,学术腐败之风盛行!浮躁的社会奉承着浮躁的人们!为了满足这些浮躁之心,各个有名的没名的大学都搞起了“国际会议”,所谓会议,就是收的不你的论文,不是你的创意,你的学术,收的你的钱,它不管

2011-04-18 10:24:00 971 3

原创 虚函数表获取的函数地址和函数实际地址一样吗?

 最近,看帖发现不少人对虚函数表很迷惑,说虚函数表中函数的地址怎么和用函数指针获取的地址不一致?示例代码如下:#include#includeusing namespace std;class Base { public: virtual void f() { cout

2011-04-17 23:27:00 6062 2

原创 不要让你的左脑负担太重

<br />     有一个问题:“你平时是习惯用左脑,还是右脑?还是两者兼顾?”,我相信会有一大部分人回答:“当然是左脑了,俺可是理科出身!”。呵呵,正因为当前社会中需要大量的理科人才,所以导致了当前的教育体系中理科受教人数大大大于文科。还记得我上高中时,十个班有九个是理科班,哈哈,震撼了吧!soso理性思维占了主流,当然我不是说用左脑思考问题不好,只是想告诉大家,不要让你的左脑太累,右脑太清闲!转过你不屑的脸,首先来回答以下几个问题:<br /> <br />1.是否感觉自己唱歌总跑调,练习很久也没有改

2011-04-17 11:15:00 1385

原创 printf带来的思考

最近闲来没事,在论坛逛游了几圈,发现很对人对printf按浮点格式输出产生了迷惑,比如: void main ( ){ int d = 100; printf("%f/n", d); printf("%d/n", d);}这段代码为啥第一个输出是0.000000,而另一个输出是正确的100。其实这个问题涉及到了c语言标准库里的变长参数的技术。肯定有人会问啥是变长参数?好,我们慢慢来,馒头要一口一口吃的!1. 什么是变参数?大家可以先看看printf的定义:int __cdecl

2011-04-16 15:27:00 1338 2

原创 Monkey and Banana

Time Limit: 1 Second      Memory Limit: 32768 KB <br />A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the mon

2011-02-24 13:19:00 815

原创 Gene Assembly

Time Limit: 1 Second      Memory Limit: 32768 KB <br />Statement of the Problem <br />With the large amount of genomic DNA sequence data being made available, it is becoming more important to find genes (parts of the genomic DNA which are responsible for

2011-02-23 15:17:00 1087

原创 Human Gene Functions

<br /> <br /> Time Limit: 1 Second      Memory Limit: 32768 KB <br />It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been intere

2011-02-23 13:24:00 681

原创 Gridland

Time Limit: 1 Second      Memory Limit: 32768 KB BackgroundFor years, computer scientists have been trying to find efficient solutions to different computing problems. For some of them efficient algorithms are already available, these are the "easy" prob

2011-02-23 09:21:00 2100

原创 最大堆的建立和堆排序

堆是一种优先级队列的数据结构,对以完全二叉树的形式展现。以下是示例代码#include using namespace std;void initMaxHeap(int a [], int size){ for (int i = size/2; i > 0; --i) { int m = a[i-1]; int c = 2*i; while (c = a[c-1]) break; a[c/2-1] = a[c-1]; c *= 2;

2011-02-15 15:02:00 1939

原创 Game Prediction

<br />Time limit: 1 Seconds   Memory limit: 32768K  <br />Total Submit: 149   Accepted Submit: 112  <br />Suppose there are M people, including you, playing a special card game. At the beginning, each player receives N cards. The pip of a card is a positiv

2011-02-15 09:31:00 683

原创 The Drunk Jailer

Time Limit: 1 Second      Memory Limit: 32768 KB <br />A certain prison contains a long hall of n cells, each right next to each other. Each cell has a prisoner in it, and each cell is locked. <br />One night, the jailer gets bored and decides to play a

2011-02-13 12:51:00 738

原创 Pi

Time Limit: 1 Second      Memory Limit: 32768 KB <br />Professor Robert A. J. Matthews of the Applied Mathematics and Computer Science Department at the University of Aston in Birmingham, England has recently described how the positions of stars across t

2011-02-13 10:23:00 708

原创 Basically Speaking

<br /> The Really Neato Calculator Company, Inc. has recently hired your team to help design their Super Neato Model I calculator. As a computer scientist you suggested to the company that it would be neato if this new calculator could convert among number

2011-02-13 09:57:00 1390

原创 Flip and Shift

<br />This puzzle consists of a random sequence of m black disks and n white disks on an oval-shaped track, with a turnstile capable of flipping (i.e., reversing) three consecutive disks. In Figure 1, there are 8 black disks and 10 white disks on the track

2011-02-11 17:09:00 663

原创 I Think I Need a Houseboat

<br /><br />Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinking by 50 square miles each year, due to erosion caused by th

2011-02-10 18:17:00 498

原创 HangOver

<br />How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two cards you can make the top card overha

2011-02-10 17:18:00 825

原创 Numerical Summation of a Series

Produce a table of the values of the series Equation 1for the 2001 values of x, x= 0.000, 0.001, 0.002, ..., 2.000. All entries of the table must have an absolute error less than 0.5e-12 (12 digits of precision). This problem is based on a problem from H

2011-02-10 15:26:00 1903

原创 Eight八位数问题2

通过程序的多次运行计算,发现此题可能有多个解!例如:2 3 4 1 5 x 7 6 8发现有以下三个解都符合要求:ullddrurdllurrdlurddlurullddrurdllurdrullddrurdllurdruldr所以大家在做的时候要注意,不一定是你的代码有问题,而是问题描述时没有说清楚!好了,上一文章中重点介绍了该题目基于双广的解决方法,在这里我将继续介绍基于A*算法,即最优启发性算法的解法!首先,介绍下A*算法的基本知识。(以下蓝色字是来源于:http://dev.gameres.com/

2010-12-13 19:23:00 771

原创 Eight八位数问题

Problem DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed with 15 sliding tiles, each with a number from 1 to 15 on it, and all packed into a 4 by 4 frame with one tile mi

2010-12-12 09:44:00 2844 2

原创 笨笨的我

<br />呵呵,今天才发现csdn能够插入代码显示!O(∩_∩)O~笨笨的我,傻傻的我!

2010-12-10 23:33:00 522

原创 Computer Transformation

Problem DescriptionA sequence consisting of one digit, the number 1 is initially written into a computer. At each successive time step, the computer simultaneously tranforms each digit 0 into the sequence 1 0 and each digit 1 into the sequence 0 1. So, aft

2010-12-10 23:32:00 997

原创 N!

Problem DescriptionGiven an integer N(0 ≤ N ≤ 10000), your task is to calculate N! InputOne N in one line, process to the end of file. OutputFor each N, output N! in one line. Sample Input123  Sample Output126  AuthorJGShining(极光炫影)分析: 要注意时间限制,特别当位

2010-12-10 13:37:00 511

原创 As Easy As A+B

Problem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.Give you some integers, your task is to sort these number ascend

2010-12-09 21:43:00 3357

原创 Easier Done Than Said?

Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard ti

2010-12-09 21:20:00 840

原创 Biker's Trip Odometer

Problem DescriptionMost bicycle speedometers work by using a Hall Effect sensor fastened to the front fork of the bicycle. A magnet is attached to one of the spokes on the front wheel so that it will line up with the Hall Effect switch once per revolution

2010-12-09 20:41:00 1523

Effective C++ 3rd Edition 中文版

c++开发学习中的经典之作,c++程序员必读之书!是有大师侯杰翻译!

2011-04-24

数据结构(严蔚敏C语言版)

数据结构的经典之作!是由严蔚敏编写的,详细描述了数据结构的各个内容!是数据结构学习的最佳之选!

2011-04-24

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除