相信积累的力量

摘要: YACC(1) User Commands YACC(1)NAME yacc - GNU Project parser generatorSYNOPSIS yacc [OPTION]... FILEDESCRIPTION Yacc (Yet Another Compiler Compiler) is a parser generator. This version is a simple wrapper around bison(1). It passes option -y, --yacc to activate the upwar... 阅读全文
posted @ 2013-08-06 17:42 ThreeF 阅读(201) 评论(0) 推荐(0) 编辑
摘要: FLEX(1) User Commands FLEX(1)NAME flex - the fast lexical analyser generatorSYNOPSIS flex [OPTIONS] [FILE]...DESCRIPTION Generates programs that perform pattern-matching on text. Table Compression: -Ca, --align trade off larger tables for better memory alignmen... 阅读全文
posted @ 2013-08-06 17:41 ThreeF 阅读(325) 评论(0) 推荐(0) 编辑
摘要: What are lex and yacc?Lex and yacc are two programs usually mentioned in the same breath that implement Look-Ahead-Left-Right (LALR -- i.e. not "recursive descent") parsing of non-ambiguous context-free (i.e. not "natural language") grammars. But if you haven't taken a class 阅读全文
posted @ 2013-08-05 20:33 ThreeF 阅读(826) 评论(0) 推荐(0) 编辑
摘要: GIT(1) Git Manual GIT(1)NAME git - the stupid content trackerSYNOPSIS git [--version] [--help] [-c =] [--exec-path[=]] [--html-path] [--man-path] [--info-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespac... 阅读全文
posted @ 2013-08-05 17:00 ThreeF 阅读(483) 评论(0) 推荐(0) 编辑
摘要: http://sei.pku.edu.cn/~yaoguo/ACT11/DragonBook-2v2.pdfIntroductionProgramming languages are notations for describing computations to people and to machines. The world as we know it depends on programming languages, because all the software running on all the computers was written in some programming 阅读全文
posted @ 2013-08-05 15:33 ThreeF 阅读(487) 评论(0) 推荐(0) 编辑
摘要: ...one of the most highly regarded and expertly designed C++ library projects in the world.—Herb SutterandAndrei Alexandrescu,C++ Coding StandardsGetting Started on WindowsA note toCygwinandMinGWusersIf you plan to use your tools from the Windows command prompt, you're in the right place. If you 阅读全文
posted @ 2013-08-03 14:49 ThreeF 阅读(341) 评论(0) 推荐(0) 编辑
摘要: http://vogella.com/articles/Git/ 1. Git 1.1. What is a version control system? A version control system allows you to track the history of a collectio 阅读全文
posted @ 2013-08-02 22:52 ThreeF 阅读(670) 评论(0) 推荐(0) 编辑
摘要: http://vim.wikia.com/wiki/Delete_all_lines_containing_a_patternThe ex commandgis very useful for acting on lines that match a pattern. You can use it with thedcommand, to delete all lines that contain a particular pattern, or all lines that do not contain a pattern.For example, to delete all lines c 阅读全文
posted @ 2013-08-01 13:36 ThreeF 阅读(790) 评论(0) 推荐(0) 编辑
摘要: http://www.boost.org/doc/libs/1_54_0/libs/serialization/doc/index.htmlRequirementsOther ImplementationsHere, we use the term"serialization"to mean the reversible deconstruction of an arbitrary set of C++ data structures to a sequence of bytes. Such a system can be used to reconstitute an e 阅读全文
posted @ 2013-07-30 10:06 ThreeF 阅读(389) 评论(0) 推荐(0) 编辑
摘要: When deciding to write a new game, there are 3 primary decisions that will drive forward your entire development process:1) Figure out what you want to do.First, you have to come up with a good game idea. This can be really difficult, or it can be really easy, depending on how creative you are and w 阅读全文
posted @ 2013-07-29 20:17 ThreeF 阅读(252) 评论(0) 推荐(0) 编辑
摘要: http://www.phpcompiler.org/articles/virtualinheritance.html#DoublePointersHome|Downloadphc|Documentation|Developers and Contributors|Mailing List|Memory Layout for Multiple and Virtual Inheritance(By Edsko de Vries, January 2006)Warning. This article is rather technical and assumes a good knowledge 阅读全文
posted @ 2013-07-29 20:11 ThreeF 阅读(372) 评论(0) 推荐(0) 编辑
摘要: http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/To implement virtual functions, C++ uses a special form of late binding known as the virtual table. Thevirtual tableis a lookup table of functions used to resolve function calls in a dynamic/late binding manner. The virtual table sometimes g 阅读全文
posted @ 2013-07-29 18:06 ThreeF 阅读(229) 评论(0) 推荐(0) 编辑
摘要: http://en.wikipedia.org/wiki/Tree_(computer_science)Incomputer science, atreeis a widely usedabstract data type(ADT) ordata structureimplementing this ADT that simulates a hierarchicaltree structure, with a root value and subtrees of children, represented as a set of linkednodes.A tree data structur 阅读全文
posted @ 2013-07-28 11:00 ThreeF 阅读(344) 评论(0) 推荐(0) 编辑
摘要: Day–Stout–Warren algorithmFrom Wikipedia, the free encyclopedia(Redirected fromDSW algorithm)TheDay–Stout–Warren (DSW) algorithmis a method for efficiently balancingbinary search trees— that is, decreasing their height toO(logn) nodes, wherenis the total number of nodes. Unlike aself-balancing binar 阅读全文
posted @ 2013-07-28 07:51 ThreeF 阅读(797) 评论(0) 推荐(0) 编辑
摘要: QEvent ClassThe QEvent class is the base class of all event classes. Event objects contain event parameters.More...#include Inherited by:QChildEvent,QDynamicPropertyChangeEvent, andQTimerEvent.List of all members, including inherited membersPublic TypesenumType{ None, ActionAdded, ActionChanged, Act 阅读全文
posted @ 2013-07-27 20:57 ThreeF 阅读(1050) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-07-27 16:50 ThreeF 阅读(1) 评论(0) 推荐(0) 编辑
摘要: http://en.wikipedia.org/wiki/Red-black_treeAred–black treeis a type ofself-balancing binary search tree, adata structureused incomputer science.The self-balancing is provided by painting each node with one of two colors (these are typically called 'red' and 'black', hence the name of 阅读全文
posted @ 2013-07-26 13:59 ThreeF 阅读(599) 评论(0) 推荐(0) 编辑
摘要: best AVL tree visualizationhttp://www.cs.umd.edu/class/spring2002/cmsc420-0401/demo/avltree/尼码:这个太强大了:http://www.qmatica.com/DataStructures/Trees/AVL/AVLTree.htmlhttp://en.wikipedia.org/wiki/AVL_treeAVL treeFrom Wikipedia, the free encyclopediaAVL treeTypeTreeInvented1962Invented byG.M.Adelson-Velsk 阅读全文
posted @ 2013-07-26 08:30 ThreeF 阅读(753) 评论(0) 推荐(0) 编辑
摘要: CHAPTER 1http://readanybooks.net/thrillers/TheDaVinciCode/28635.htmlRobert Langdon awoke slowly.A telephone was ringing in the darkness - a tinny, unfamiliar ring. He fumbled for the bedside lamp and turned it on. Squinting at his surroundings he saw a plush Renaissance bedroom with Louis XVI furni. 阅读全文
posted @ 2013-07-25 21:46 ThreeF 阅读(722) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-07-24 18:57 ThreeF 阅读(4) 评论(0) 推荐(0) 编辑
摘要: http://en.wikipedia.org/wiki/Fenwick_tree#ifndef TREE_ARR_H#define TREE_ARR_H// index [1, 1024]#define N 1025#define Type intType arr[N];// 核心lowbit函数int lowb(int t) { return t & (-t); }// 一个位置数值改变,由lowbit向后迭代void add(int i, Type v){ for (; i 0; s += arr[i], i -= lowb(i)); return s;}#endif //... 阅读全文
posted @ 2013-07-24 14:05 ThreeF 阅读(189) 评论(0) 推荐(0) 编辑
摘要: /*RMQ离线算法所谓RMQ即(Range Minimum/Maximum Query)区间最小/最大值查找,它可以用来解决多次查找区间内的最大值或最小值。算法需要O(nlogn)的初始化时间以及每次O(1)的查询时间,实在是非常的快啊。例如给定如下23个数,以数组val[23]形式给出(我随机生成的)41 67 34 0 69 24 78 58 62 64 5 45 81 27 61 91 95 42 27 36 91 4 2然后给了一大堆查询,比如查询第2个数到第5个数中的最大值。第7个数到第20个数中的最大值。核心思想是这样的,我们用一个二维数组rmq[i][j]表示从第i个数开始,长度 阅读全文
posted @ 2013-07-24 13:16 ThreeF 阅读(490) 评论(0) 推荐(0) 编辑
摘要: /***************************************************/// 测素数,根号阶bool is_prime(int u){ if(u == 0 || u == 1) return false; if(u == 2) return true; if(u%2 == 0) return false; for(int i=3; i 4, 6, 8, ... //3->9, 12, 15...// 5->25, 30, ... if(mark[i]) { fo... 阅读全文
posted @ 2013-07-24 13:14 ThreeF 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #ifndef GCD_H#define GCD_H#include #include #include /***************************************************/// 最大公约数_int GCD(int x, int y){ int t; while(y > 0) { t = x % y; x = y; y = t; } return x;}/***************************************************/// 快速gc... 阅读全文
posted @ 2013-07-24 13:08 ThreeF 阅读(3391) 评论(0) 推荐(0) 编辑
摘要: http://readanybooks.net/thrillers/TheDaVinciCode/Synopsis:While in Paris on business, Harvard symbologist Robert Langdon receives an urgent late-night phone call: the elderly curator of the Louvre has been murdered inside the museum. Near the body, police have found a baffling cipher. While working 阅读全文
posted @ 2013-07-24 10:49 ThreeF 阅读(283) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-07-23 23:03 ThreeF 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 思想:要查找 lca(u,v)dfs到两个结点入栈动作:建立自己的集合,代表元(祖先)为自己出栈动作:合并自己集合到父结点集合(祖先为父结点)注意到一个结点必先入栈,接着另一个结点入栈,设u先发现,v后发现则发现v后,u为黑结点(已经出栈)或灰结点(已经入栈,但未出栈)发现v时,栈中所有灰结点为v的祖先路径若此时u为灰,则lca(u,v)为u,等于u的代表元(因为u未出栈,集合没有向父结点合并)若此时u为黑,则此时u所在集合的代表元就是lca(u,v),且是此时栈中一个灰结点这个文章图文并茂一看就懂:http://scturtle.is-programmer.com/posts/30055ta 阅读全文
posted @ 2013-07-23 22:45 ThreeF 阅读(326) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-07-23 22:20 ThreeF 阅读(1) 评论(0) 推荐(0) 编辑
摘要: http://docs.python.org/release/1.5.1p1/tut/keywordArgs.html4.7.2 Keyword ArgumentsFunctions can also be called using keyword arguments of the form "keyword=value". For instance, the following function:def parrot(voltage, state='a stiff', action='voom', type='Norwegian B 阅读全文
posted @ 2013-07-23 19:57 ThreeF 阅读(1974) 评论(0) 推荐(0) 编辑
摘要: Detailed DescriptionThe QObject class is the base class of all Qt objects.QObject is the heart of the QtObject Model. The central feature in this model is a very powerful mechanism for seamless object communication calledsignals and slots. You can connect a signal to a slot withconnect() and destroy 阅读全文
posted @ 2013-07-23 12:24 ThreeF 阅读(1420) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-07-22 19:48 ThreeF 阅读(0) 评论(0) 推荐(0) 编辑
摘要: http://docs.python.org/2/library/re.html7.2.re— Regular expression operationsThis module provides regular expression matching operations similar to those found in Perl. Both patterns and strings to be searched can be Unicode strings as well as 8-bit strings.Regular expressions use the backslash char 阅读全文
posted @ 2013-07-22 12:34 ThreeF 阅读(1318) 评论(1) 推荐(0) 编辑
摘要: Built-in FunctionsThe Python interpreter has a number of functions built into it that are always available. They are listed here in alphabetical order.Built-in Functionsabs()divmod()input()open()staticmethod()all()enumerate()int()ord()str()any()eval()isinstance()pow()sum()basestring()execfile()issub 阅读全文
posted @ 2013-07-21 20:33 ThreeF 阅读(635) 评论(0) 推荐(0) 编辑
摘要: 炮姐v587:http://misakamm.com/blog/25有一个排列,我们可以轻易得到下一个排列:http://www.cnblogs.com/threef/p/3200507.html怎么枚举下一个组合呢:科普:x - 1 : 100 后缀反转m100 -> m011x&(x - 1)消除最后一个有效位x^(x - 1):100后缀掩码x + 1: 011 后缀反转m011 -> m100x&(x + 1)消除后缀连续连续有效位x^(x + 1):011后缀掩码-x: 求反加1x& -x: 得到最低有次位掩码(有木有想到树状数组)x + (x&a 阅读全文
posted @ 2013-07-20 14:34 ThreeF 阅读(566) 评论(0) 推荐(0) 编辑
摘要: #include void cls( HANDLE hConsole ){ COORD coordScreen = { 0, 0 }; // home for the cursor DWORD cCharsWritten; CONSOLE_SCREEN_BUFFER_INFO csbi; DWORD dwConSize;// Get the number of character cells in the current buffer. if( !GetConsoleScreenBufferInfo( hConsole, &csbi )) { re... 阅读全文
posted @ 2013-07-20 08:35 ThreeF 阅读(278) 评论(0) 推荐(0) 编辑
摘要: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682079(v=vs.85).aspxEach console has an input buffer that contains a queue of input event records. When a console's window has the keyboard focus, a console formats each input event (such as a single keystroke, a movement of the mouse, or 阅读全文
posted @ 2013-07-19 22:06 ThreeF 阅读(708) 评论(0) 推荐(0) 编辑
摘要: 1.表示成和的形式:第k位的权值应该等于 后面 k - 1位所能表示的最大的数 + 1这样 能成单射,满射(1): 利用 等比数列: N 进制a(k) = nka(k) - 1 = (n - 1) * ( 1 - n k)⁄1 - n如2进制:k k-1 k-2 ... 3 2 1 0 第k位 2k 2k-1 2k-2 23 22 21 20 权值[0, 1] ................................................................ 系数(2) 利用 阶乘公式:k k-1 ... 阅读全文
posted @ 2013-07-19 20:14 ThreeF 阅读(240) 评论(0) 推荐(0) 编辑
摘要: #include bool next_permutation(int *arr, int n){ if (n == 1 || n == 0) return false; int i; for (i = n - 2; i >= 0; --i) { if (arr[i] arr[i]) break; } int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } int low = i + 1; int high = n - 1; for... 阅读全文
posted @ 2013-07-19 14:33 ThreeF 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 今早起来写了个N皇后#include #define abs(i) ((i) < 0 ? -(i) : (i))const int N = 8;int board[N] = {-1};bool ok(int row){ if (row == 0) return true; for (int i = 0; i < row; ++i) { if (((row - i) == abs(board[row] - board[i])) || board[row] - board[i] == 0 ) return false; ... 阅读全文
posted @ 2013-07-19 08:00 ThreeF 阅读(296) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-07-18 22:54 ThreeF 阅读(1) 评论(0) 推荐(0) 编辑

相信积累的力量