Leeroy
Leeroy
关注数: 0
粉丝数: 39
发帖数: 4,699
关注贴吧数: 3
Intel遭遇CPU级RootKit,目前无药可医 相关攻击可以在目前大部分IntelCPU的主板上从Ring0提权至SMM。此漏洞目前无法从软件层面解决,因为任何操作系统都无法控制或读取SMM。 具体报告将于19日在此发布: http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Ftheinvisiblethings.blogspot.com%2F2009%2F03%2Findependent-attack-discoveries.html&urlrefer=21fc6a04d795af369e9662e605839850
关于共享资源贴的整改公告 QQ群/论坛等交流平台归入QQ群及论坛分享贴,此贴内的回贴存活期一个月(过期的将被手动清除)。 电子书及其他资料的共享归入电子书/资料共享贴,禁止要求他人留自己的邮箱等联系方式,发布者需自行留下联系方式。电子书/资料共享贴存活期3个月。超过6个月的此类共享贴出现在第一页即删除。要长期共享的发布者请自行更新。 禁止一切伪装置顶/精华贴。 本条自发贴时起有效,不在第一页的贴无需处理。
电子书/资料共享贴 以下回贴存活期3个月。
申请吧主 我来申请吧主啦~
期末果然来了 RT
几道Contest题,适合初学者 这几道题难度不高,初学者经过一些思考和努力应该是能做出来的。(swgr看到别吃了我- -)老规矩一楼送给百度
最近人气好像不高啊 如题
一道神奇的智力题 有A、B、C3个人,1个什么都知道且只说真话,1个什么都知道且只说假话,1个随机回答。 他们只会说“啊”和“哦”来回答你的问题(不会不回答),代表“是”和“否”,但你不知道“啊”是“是”还是“哦”是“是”。 你可以问3个问题,每个问题都只能问其中1个人。 请问,如何通过3个问题来知道3个人的身份呢?嗯……我会放答案的……
勇敢的少年啊,快去创造奇迹! 你点开这个帖子,发现里面什么都没有
搬块沙发看戏 RT
愚人节快到了,教个大家最强的整人方法 就是找个论坛,发个贴,标题就是“愚人节快到了,教个大家最强的整人方法”阿弥陀佛
闲着无聊发几个排序的代码 2楼插入排序3楼归并排序4楼堆排5楼快速排序除了插入之外都是O(nlgn)的算法
【公告】关于广告贴 发广告请放到置顶的资源共享中发在这里的砍掉在资源共享中发无关内容的亦砍以上
【水】 http://tieba.baidu.com/f?kz=213040745。。。。。。。。。。。。。。。。。。
小妹党再现江湖 RT每年都有那么几次
每年都有那么几天 RT!
Finding The Fibonacci Number(logn) #include int buf[1000] = {0, 1, 1};typedef struct{ int a; int b;}intPair;intPair devideIndex(int index){ intPair temp; if (index & 1) { temp.a = index / 2; temp.b = index / 2 + 1; return temp; } else { temp.a = index / 2; temp.b = index / 2; return temp; }}int Fibonacci(int n){ intPair p; if (buf[n]) return buf[n]; p = devideIndex(n); return buf[n] = Fibonacci(p.a) * Fibonacci(p.b - 1) + Fibonacci(p.a + 1) * Fibonacci(p.b);}int main(){ int i; for (i = 1; i <= 20; ++i) printf("%d\n", Fibonacci(i)); system("pause"); return 0;}以上
Virus Spreading Alarm and Deadly Pig Disease in China - New Yo Picture By Ryan Pyle for The New York Times Liu Minghong, a 38-year-old farmer, said, "Most of my pigs got hit in June and July — 70 of them died." By DAVID BARBOZAPublished: August 16, 2007
纯水 11岁男孩猛追卡车 认定是变形金刚16日上午9时许,烟台地区一名小男孩骑自行车猛追一辆满载货物的大型半挂货车,当他在国道206高速公路蓬莱收费站被收费员拦住时,小男孩竟一口咬定他追的是变形金刚,令人哭笑不得。 经了解,这名小男孩11岁,家住收费站附近的大辛店镇上,暑假期间,他刚刚看了电影《变形金刚》,就迷恋上了大货车,总以为货车就是变形金刚。 刚才他在路上看到一辆酷似电影中“擎天柱”的货车后,就在后面狂追,在追到蓬莱收费站入口时,被当班收费员拦了下来。收费员对男孩进行了耐心教育,并将其劝离
[拜神]和谐世界 看图吧
河蟹的由来 http://www.zqwx.com/about/index.html中国青少年网络协会第一届领导机构.....副会长(38名):.....陈天桥 上海盛大网络发展有限公司董事长.....
洪水警报(Red) 期末将至以上
中英文术语不完全对照(摘自Effective C++第三版,侯捷译) abstract 抽象的abstraction 抽象性access 访问access level 访问级别adapter 适配器address 地址address-of operator 取地址操作符aggregation 聚合algorithm 算法allocate 分配allocator 分配器application 应用程序architecture 体系结构argument 实参array 数组arrow operator 箭头操作符assembly language 汇编语言assert(-ion) 断言assign(-ment) 赋值assignment operator 赋值操作符base class 基类base type 基类型binary search 二分查找binary tree 二叉树binary operator 二元操作符binding 绑定bit 位bitwise 以位为单位逐一OOXX(OOXX中填上对应的动作)block 区块boolean 布尔值breakpoint 断点build 建置build-in 内置bus 总线byte 字节cache 高速缓存call 调用callback 回调call operator call操作符(这是啥)character 字符child class 子类class 类class template 类模板client 客户code 代码compatible 兼容compile time 编译期compiler 编译器component 组件composition 复合concrete 具象的concurrent 并发configuration 配置connection 连接constraint 约束(条件)construct 构件container 容器(这个能算术语么)const C/C++关键字,constant)constant 常量constructor 构造函数copy(v.) 拷贝(虽然我更习惯叫复制)copy(n.) 复件、副本create 创建custom 定制data 数据database 数据库data member 成员变量data structure 数据结构debug 调试debugger 调试器declaration 声明式default 缺省definition 定义式delegate 委托dereference 提领(解参考)(其实我更愿意叫做解引用)derived class 派生类design pattern 设计模式destroy 销毁(这个也叫术语?)destructor 析构函数directive 指示符document 文档dynamic binding 动态绑定entity 物体encapsulation 封装enum(-eration) 枚举equality 相等equivalence 等价evalute 核定、核算exception 异常explicit 显式expression 表达式file 文件framework 框架full specialization 全特化function 函数function object 函数对象function template 函数模板generic 泛型、泛化、一般化getter(相对于setter) 取值函数global 全局的handle 句柄handler 处理函数hash table 哈希表、散列表hader(file) 头文件heap 堆hierarchy 继承体系(层次结构)identifier 标识符implement(-ion) 实现implicit 隐喻的、暗自的、隐式information 信息inheritance 继承inline 内联initialization list 初值列initialization 初始化instance 实体instantiate 具体化、实现化interface 接口Internet (这条我拒绝提供解释)interpreter 解释器invariants 恒常性invoke 调用iterator 迭代器library 程序库linker 连接器literal 字面常量list 链表load 装载local 局部的lock 机锁loop 循环lvalue 左值macro 宏member 成员member function 成员函数memory 内存memory leak 内存泄漏meta- 元-meta-programming 元编程modeling 塑模module 模块modifier 修饰符multi-tasking 多任务namespace 命名空间native 固有的nested 嵌套object 对象object based 基于对象的object model 对象模型object oriented 面向对象operand 操作数operating system 操作系统operator 操作符overflow 溢出overhead 额外开销overload 重载override 覆写package 包parallel 并行parameter 参数、形参parent class 父类parse 解析partial specialization 偏特化pass by reverence 按址传递(C中也作pass by pointer)pass by value 按值传递pattern 模式placement delete (某种特殊形式的delete operator)placement new (某种特殊形式的new operator)pointer 指针polymorphism 多态preprocessor 预处理器print 打印printer 打印机process 进程program 程序programmer 程序员programming 编程project 项目pseudo code 伪码quality 质量queue 队列raw 原始的、未经处理的recursive 递归refer to 指涉、指称、指向reverence 引用regular expression 正则表达式resolve 解析return 返回return type 返回类型return value 返回值runtime 运行期rvalue 右值save 存储schedule 调度scheduler 调度器scope 作用域search 查找semantics 语义setter(相对于getter) 设值函数signature 签名(式)smart pointer 智能指针specialization 特化source 源码stack 栈standard library 标准程序库statement 语句static 静态的string 字符串subtype 子类型support 支持template 模板temporary object 临时对象text 文本thread 线程thread safe 多线程安全throw 抛、掷token 语汇单元(这又是啥)type 类型unary function 单参函数underflow 下溢unqualified 未经资格修饰(???)user 用户user interface 用户界面value 值、数值variable 变量vector 矢量virtual function 虚函数virtual machine 虚拟机
[求助]关于几个operator语义的实现 有没有办法实现operator||和operator&&的短路语义?有没有办法实现operator,自左向右计算的语义?
囧一把 More Effective C++Item 6: Distinguish between prefix and postfix forms of increment and decrement operators. 这让我说啥好
注意,这不是演习! http://hi.baidu.com/leeroyjenkins/blog这年头不标题党的话贴子会消失……不定期更新,几个月没更新也属正常现象……
How Important Are Algorithms? 题目是我加的You might wonder whether algorithms are truly that important on contemporary computers in light of other advanced technologies, such as. hardware with high clock rates, pipelining, and superscalar architectures,. easy-to-use, intuitive GUIs,. object-oriented systems, and. local-area and wide-area networking.The answer is yes. Although there are some applications that do not explicitly require algorithmic content at the application level (e.g., some simple web-based applications), most also require a degree of algorithmic content on their own. For example, consider a web-based service that determines how to travel from one location to another. (Several such services existed at the time of this writing.) Its implementation would rely on fast hardware, a GUI, wide-area networking, and also possibly on object orientation. However, it would also require algorithms for certain operations, such as finding routes (probably using a shortest-path algorithm), rendering maps, and interpolating addresses.Moreover, even an application that does not require algorithmic content at the application level relies heavily upon algorithms. Does the application rely on fast hardware? The hardware design used algorithms. Does the application rely on GUIs? The design of any GUI relies on algorithms. Does the application rely on networking? Routing in networks relies heavily on algorithms. Was the application written in a language other than machine code? Then it was processed by a compiler, interpreter, or assembler, all of which make extensive use of algorithms. Algorithms are at the core of most technologies used in contemporary computers.
【珍爱生命,远离TC】 RT!
Fabonacci数列的秘密 无聊和标题党真可怕谁有兴趣把它变成一个O(1)算法的……PS:不知道有没有算错=。=
[踢馆]关于placement new class T{};int main(){ T t; new(&t) T(t); return 0;}这个程序究竟会做什么?
[研究]如何对付作业乞丐 期末到了,作业乞丐也特别多,大家有什么好的对付的它们的方法么?我的办法是,要么不写,要么就写得很难懂,iterators/containers/function objects/adapters一起上,再加上各种乱七八糟的晦涩语法让他们看不懂,更不用说答辩了大家有什么想法都提出来吧
[计划]STL入门教程 好吧,这只是个计划……支持的顶一下吧,我看看是否值得花这个时间写……
[一个C++问题]这个语句会有什么作用
[搞笑]避免自身赋值 T& T::operator=(const T &other){ if (this != &other) //要讨论的 { /*...*/ }}也就是说,如果*this和other实际上是同一个对象时,赋值是没必要的。这样做确实可以提高效率。上面只是一个引子,让我们再来看这么个函数:T::T(const T &other){ if (this != &other) { /*...*/ }}/*你第一次读就抓住要害了吗?*/唔,也许有些聪明的人已经看出来了……还没看出来的请看下面这段代码:T t;new (&t) T(t);如果谁还是没看懂就跟帖吧……如果没看懂的很多那我就把答案说清楚点……
VC6对STL容器支持度不佳 我们先来看一段简单的:#include int main(){ int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; //这里有一个数组 std::deque y(a, a + 10); //用这个数组的前10个(其实也就是全部)元素来初始化一个deque return 0;}对于这个完全不应该有问题的代码,VC给出了一个错误:D:\bugtest.cpp(6) : error C2664: '__thiscall std::deque >::std::deque >(unsigned int,const int &,const class std::allocator &)' : cannot convert parameter 1 from 'int [10]' to 'unsigned int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast
期末快到了,你准备好了吗? 好吧,我承认我是标题党……期末要到了,求课程设计的人越来越多,都快把吧挤爆了有啥解决的方法么?说说你对求题的看法吧,还有怎么解决
如何解释? #include #include #include #include using namespace std;int main(){ string file_name[2]; cin >> file_name[0] >> file_name[1]; ifstream fin(file_name[0].c_str()); ofstream fout(file_name[1].c_str()); char tmp; istreambuf_iterator data_in(fin); while (tmp = *data_in++) { if (tmp == EOF) return 0; fout << (tmp ^= -1); } return -1;}这确实是一个加密程序,虽然它很无聊但是奇怪的是,我对一个7744字节的文件进行加密后它居然变成了7156字节,而且再对它解密后又变回了7744字节……这种现象要如何解释?PS:输入文件仅包含ASCII字符,不包含Unicode字符
minispacer for 百度 还在为特殊字符不能发在百度上而痛苦吗?minispacer可以解决你的问题!代码如下:#include #include #include #include #include using namespace std;int main(){ string file_name[2]; cin >> file_name[0] >> file_name[1]; ifstream fin(file_name[0].c_str()); ofstream fout(file_name[1].c_str()); char tmp; istreambuf_iterator data_in(fin); while (tmp = *data_in++) { switch(tmp) { case EOF: return 0; case ' ': fout << " "; break; case '\t': fout << " "; break; case '(': fout << "("; break; case '&': fout << "&"; break; case ';': fout << ";"; break; default: fout << tmp; } } return -1;}友情提示:编译时间长……
学会处理编译器的错误 #include #include using namespace std;int main(){ typedef map Map; Map a; a.insert(pair ("Big Cheese", "something")); a.insert(pair ("Nothing", "Also:p")); Map::iterator b = a.find("Big Cheese"); return 0;}对于这么一个简单的程序,DEV-C++成功的编译了,而VC6呢?它给出了一大堆错误……我附在下面
[求助]如何在输入数字时判断是否到达行尾? 例如,输入n行数字,并输出每行的平均值
C++学习中的一些忠告 Here is a set of "rules" you might consider while learning C++. As you get more proficient you can evolve them into something suitable for your kind of applications and your style of programming. They are deliberately very simple, so they lack detail. Don't take them too literally. To write a good program takes intelligence, taste, and patience. You are not going to get it right the first time. Experiment!这里是一组在你学习C++的过程中或许应该考虑的“规则”。随着你变得更加熟练,你将能把它转化为某种更适合你的那类应用系统或者你自己的程序设计的东西。它们有意被写得很简单,因此都缺乏细节。请不要太拘泥于他们的字面意义。要写出一个好程序需要智慧、品味和耐性。你不会第一次就能把它搞好的。试验![1]When you program, you create a concrete representation of the ideas in your solution to some problem. Let the structure of the program reflect those ideas as directly as possible.在编程序时,你是在为你针对某个问题的解决方案中的思想建立起一种具体表示。让程序的结构尽可能地直接反映这些思想。 [a]If you can think of “it” as a separate idea, make it a class.如果你能把“它”看成一个独立的概念,就把它做成一个类。 [b]If you can think of “it” as a separate entity, make it an object of some class.如果你能把“它”看成一个独立的实体,就把它做成某个类的一个对象。 [c]If two classes have a common interface, make that interface an abstract class.如果两个类有共同的接口,将这些接口做成一个抽象类。 [d]If the implementations of two classes have something significant in common, make that commonality a base class.如果两个类的实现有某些显著的共同东西,将这些共性做成一个基类。 [e]If a class is a container of objects, make it a template.如果一个类是一种对象的容器,将它做成一个模板。 [f]If a function implements an algorithm for a container, make it a template function implementing the algorithm for a family of containers.如果一个函数实现对某容器的一个算法,将它做成对一族容器可用的模板函数。 [g]If a set of classes, templates, etc., are logically related, place them in a common namespace.如果一组类、模板等相互之间有逻辑联系,将它们放进一个名字空间里。[2]When you define either a class that does not implement a mathematical entity like a matrix or a complex number or a low-level type such as a linked list:当你定义一个并不是实现像某个矩阵或复数这样的数学对象的类时,或者定义一个低层的类型如链表的时候: [a]Don’t use global data (use members).不要使用全局数据(使用成员)。 [b]Don’t use global functions.不要使用全局函数。 [c]Don’t use public data members.不要使用公有数据成员。 [d]Don’t use friends, except to avoid [a] or [c].不要使用友元,除非是为了避免[a]或[c]。 [e]Don’t put a “type field” in a class; use virtual functions.不要在一个类里面放“类型域”①;采用虚函数。 [f]Don’t use inline functions, except as a significant optimization.不要使用内联函数,除非对效率有显著的优化。①指那种为了说明一个类所存储数据的情况而放置的标志域
在吧里无法使用空格的解决方案 百度的自动缩进确实很麻烦,写好的代码一发上来就乱掉了,在此提供一个解决方法代码写完之后放到记事本里面,把所有的空格替换成 (注意分号)。如果是用制表符(TAB)对齐的话,就把它替换成4个 (分号不能丢)另外还有一些问题,比如(c)会被自动替换成(c),怎么办呢?解决的办法是:把(替换成(实际上,可以用&#(ASCII码);的方式来对付百度自作聪明的自动替换。比如空格是 ,&是&,0是0等等……
当心C++编译器最烦人的分析机制 #include //cin和cout#include //STL中的vector容器#include //copy和sort函数由此提供#include //istream_iterator和ostream_iteratorusing namespace std;int main(){ vector a(istream_iterator (cin), istream_iterator ()); //调用vector的构造函数,把cin中的数传入vector中,以非数字字符结束 sort(a.begin(), a.end()); //STL中的排序算法 copy(a.begin(), a.end(), ostream_iterator (cout, " ")); //使用copy函数输出 return 0;}上面那段代码看上去很正常,但是实际上,第9行是错误的。实际上它不会创建vector,因为它根本就没有声明一个vector,也没有调用构造函数。它所的是……噢,它所做的事情很奇怪。有人知道是怎么回事么?大胆说出自己的想法……
大家来找碴 #include //cin和cout#include //STL中的vector容器#include //copy函数由此提供#include //istream_iterator和ostream_iteratorusing namespace std;int main(){ vector a(istream_iterator (cin), istream_iterator ()); //调用vector的构造函数,把 sort(a.begin(), a.end()); //STL中的排序算法 copy(a.begin(), a.end(), ostream_iterator (cout, " ")); //使用copy函数输出 return 0;}上面是一段将输入的数字排序后输出的程序,但是有一个很“有趣”的错误……试着把它找出来?确实很“有趣”……PS:我们从这个例子中能学到什么?仔细体会
[无聊]一些让大家玩的题目 【级数求和】问题描述:已知:Sn=1+1/2+1/3+….+1/n。显然,当n非常大的时候,Sn可大于任何一个整数K。现给出一个整数K(1≤K≤15),要求计算出一个最小的n,使得Sn>K。输入: k输出: n测试数据:输入:1输出:2 输入:3输出:11输入:7输出:616输入:14输出:675214输入:10输出:12367输入:12输出:91380【编码问题】问题描述:设有一个数组A:ARRAY[0..N-1] OF INTEGER;数组中存储的元素为0-N-1之间的整数,且A[I]≠A[J] (当I≠J)时。例如:N=6时,有:(4,3,0,5,1,2)。此时,数组A的编码定义如下: A[0]的编码为0; A[I]的编码为:在A[0],A[1],……A[I-1]中比A[I]的值小的元素的个数(I=1,2,……N-1) 所以上面数组A的编码为:B=(0,0,0,3,1,2)程序要求: ①给出数组A后,求出其编码; ②给出数组A的编码后,求出A的原数据【构造子串】问题描述:生成长度为n的字串,其字符从26个英文字母的前p(p≤26)个字母中选取,使得没有相邻的子序列相等。例如p=3,n=5时: abcba 满足条件 abcbc 不满足条件输入:n p输出:所有满足条件的字串及总数测试数据:输入:1 1输出:a1 输入:1 2输出:ab2 输入:3 2输出:ababab2 输入:3 5输出:abaabc...edcede80 输入:5 4输出:abacaabacbabacdabadaabadbabadcabcababcac...dcdaddcdbadcdbcdcdbd264 输入:7 10输出: ... 【字符近似查找】问题描述:设有n个单词的字典表(1<=n<=100)。计算某单词在字典表中的4种匹配情况(字典表中的单词和待匹配单词的长度上限为255): i: 该单词在字典表中的序号; Ei:在字典表中仅有一个字符不匹配的单词序号; Fi:在字典表中多或少一个字符(其余字符匹配)的单词序号; N:其他情况; 当查找时有多个单词符合条件,仅要求第一个单词的序号即可。 输入: n 字典表的单词数 n行 每行一个单词 待匹配单词 输出: i Ei Fi 其中i为字典表中符合条件的单词序号(1<=i<=n),若字典表不存在符合条件的单词,则对应的i=0。若上述3种情况不存在,则输出N。 测试数据:输入: 5 abcde abc asdfasfd abcd aacd abcd 输出: 4 E5 F1输入: 1 a b输出: 0 E0 F0 N输入: 10 ljlkj kljalkfja abook bbookklj ajflaj difaja;lfj book boak jajflkja jdskajfla book输出: 7 E8 F3输入: 8 vczvczvczvczvcz kljalkfja vczvczvvczvczvczvczvczvczx bbookklj dislkkk sfcvzvcxv afdaaaaaaaaaaaafdfdfdfd disklll disk输出: 0 E0 F0 N【选数】问题描述:已知n个整数 x1,x2,…,xn,以及一个整数k (k
高二被陈艳昌教到的进来签到 真倒霉,又被那衰人教到……各位进来交流一下经验感想
求助高精度 在C++中如何通过动态分配内存来实现高精度运算?要用什么类?如何输入?
[怀旧帖]黑上求组(看我ID)
来者必读 此贴吧专门用来讨论关于陈艳昌同志的光荣事迹.......咳咳............语录帖是专门用来收集语录的,请不要在里面发非语录内容有意见者在下面跟帖
[醒目]陈艳昌语录 哎呀~那个急啊~痛苦啊~~
1
下一页