相信积累的力量

07 2013 档案

摘要: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 阅读(393) 评论(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 阅读(291) 评论(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 阅读(392) 评论(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 阅读(251) 评论(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 阅读(358) 评论(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 阅读(834) 评论(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 阅读(1061) 评论(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 阅读(628) 评论(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 阅读(763) 评论(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 阅读(825) 评论(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 阅读(195) 评论(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 阅读(501) 评论(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 阅读(219) 评论(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 阅读(3406) 评论(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 阅读(296) 评论(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 阅读(332) 评论(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 阅读(2010) 评论(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 阅读(1451) 评论(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 阅读(1339) 评论(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 阅读(669) 评论(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 阅读(592) 评论(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 阅读(286) 评论(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 阅读(726) 评论(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 阅读(252) 评论(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 阅读(324) 评论(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 阅读(303) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-18 22:54 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-18 20:37 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 23:36 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 20:39 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 17:25 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 17:09 ThreeF 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 15:59 ThreeF 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 15:43 ThreeF 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-17 12:39 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-16 12:53 ThreeF 阅读(2) 评论(0) 推荐(0)
摘要:http://wiki.python.org/moin/GeneratorsGenerators functions allow you to declare a function that behaves like an iterator, i.e. it can be used in a for loop.Simplified CodeThe simplification of code is a result of generator function and generator expression support provided by Python.To illustrate th 阅读全文
posted @ 2013-07-16 09:16 ThreeF 阅读(1166) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-15 22:47 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-15 22:19 ThreeF 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-15 21:50 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-15 20:56 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-15 09:31 ThreeF 阅读(4) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-14 17:35 ThreeF 阅读(4) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-13 16:09 ThreeF 阅读(6) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-12 22:21 ThreeF 阅读(4) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-12 11:44 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-12 10:22 ThreeF 阅读(3) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-10 22:09 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-06 09:49 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-05 23:13 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-05 23:04 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-04 21:41 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-04 15:45 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-04 15:23 ThreeF 阅读(2) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-04 09:46 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-04 08:58 ThreeF 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-03 21:38 ThreeF 阅读(3) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-03 20:38 ThreeF 阅读(3) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-02 18:33 ThreeF 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-02 16:25 ThreeF 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2013-07-02 12:15 ThreeF 阅读(2) 评论(0) 推荐(0)

相信积累的力量