码迷,mamicode.com
首页 > 其他好文
Iptables 详解
Iptables中的4表5链四张表:filter表、nat表、mangle表、raw表五条链:INPUT OUTPUT FORWARD PREROUTING POSTROUTINGFilter表:访问控制、规则匹配Nat表:地址转发Iptables规则组成数据包访问控制:ACCEPT、DROP、RE...
分类:其他好文   时间:2015-07-19 13:17:22    阅读次数:99
折半查找
一、概念 折半查找(Binary Search)的查找过程是:先确定待查找记录所在的范围区间,然后逐步 缩小范围直到找到或找不到记录为止。该方法的局限性在于要排序的查找表必须有序,即 如若i#include #define N 20int BinarySearch(int a[], int n,.....
分类:其他好文   时间:2015-07-19 13:17:11    阅读次数:102
poj - 1170 - Shopping Offers(减少国家dp)
意甲冠军:b(0 >已有b种物品,再将每种优惠分别看成一种新物品,剩下就是全然背包问题了。。设dp[i]表示购买状态为 i 时的最少花费(关于购买状态:00032表示第0种物品买2个,第1种物品买3个)。则状态转移方程为:dp[i + product[j].nState] = min(dp[i + ...
分类:其他好文   时间:2015-07-19 13:17:47    阅读次数:110
POJ 3740 Easy Finding
#include#include#include#includeusing namespace std;const int R=20;const int C=305;int A[R][C];int n,m;int ff[R][R];int flag;int U[R];int cnt;int sum[...
分类:其他好文   时间:2015-07-19 13:16:04    阅读次数:75
BZOJ 4145: [AMPPZ2014]The Prices( 状压dp + 01背包 )
我自己只能想出O( n*3^m )的做法....肯定会TO( nm*2^m )做法:dp( x, s ) 表示考虑了前 x 个商店, 已买的东西的集合为s.考虑转移 : 先假设我们到第x个商店去, so初始时 dp( x, s) = dp( x-1, s ) + d[x]然后我们可以对第x个商店做0...
分类:其他好文   时间:2015-07-19 13:17:50    阅读次数:90
使用fastcgi_finish_request提高页面响应速度
PHP运行在FastCGI模式时,PHP FPM提供了一个名为fastcgi_finish_request的方法.按照文档上的说法,此方法可以提高请求的处理速度,如果有些处理可以在页面生成完后再进行,就可以使用这个方法.example:echo 'fastcgi_finish_request tes...
分类:其他好文   时间:2015-07-19 13:17:22    阅读次数:93
CF Gym 100187E Two Labyrinths
题意:问两个迷宫是否存在公共最短路。题解:两个反向bfs建立层次图,一遍正向bfs寻找公共最短路#include#include#includeusing namespace std;const int maxn = 500+1;int d1[maxn][maxn];int d2[maxn][max...
分类:其他好文   时间:2015-07-19 13:16:50    阅读次数:106
ZOJ 1003 Crashing Balloon
#include#include#include#includeusing namespace std;int n,m;int flag1,flag2;void dfs(int a,int b,int x){ if(b==1) { flag2=1; if(a=...
分类:其他好文   时间:2015-07-19 13:16:39    阅读次数:85
FFmpeg来源简单分析:结构会员管理系统-AVClass
=====================================================FFmpeg章列表:【架构图】FFmpeg源码结构图 - 解码FFmpeg源码结构图 - 编码【通用】FFmpeg 源码简单分析:av_register_all()FFmpeg 源码简单分析:a...
分类:其他好文   时间:2015-07-19 13:14:00    阅读次数:359
round(x[, n]) : 四舍五入
>>> round(12.3)12.0>>> round(12.5)13.0>>> round(12.36)12.0>>> 精确度只能精确到小数点后面一位。
分类:其他好文   时间:2015-07-19 13:15:24    阅读次数:88
bool([x]) 将x转换为Boolean类型
>>> a = 1>>> b = 0>>> c = "None">>> d = bool(a)>>> dTrue>>> bool(b)False>>> bool(c)True>>>
分类:其他好文   时间:2015-07-19 13:15:24    阅读次数:86
分别取商和余数:divmod(a, b)
使用函数:divmod(a, b)可以实现分别取商和余数的操作:>>> divmod(123,3)(41, 0)>>> divmod(200,6)(33, 2)>>>
分类:其他好文   时间:2015-07-19 13:15:03    阅读次数:90
poj 2586 Y2K Accounting Bug
Y2K Accounting BugTime Limit:1000MSMemory Limit:65536KTotal Submissions:10050Accepted:5007DescriptionAccounting for Computer Machinists (ACM) has suff...
分类:其他好文   时间:2015-07-19 13:13:46    阅读次数:72
BZOJ 4143: [AMPPZ2014]The Lawyer( sort )
水题...排序搞出每天的会议有哪些, 然后再按照会议的开始时间和结束时间排序, 最晚开始的和最早结束的会议不是同一场而且最晚开始的时间>最早结束的会议就有可能方案---------------------------------------------------------------------...
分类:其他好文   时间:2015-07-19 13:14:04    阅读次数:114
Palindrome Linked List
Palindrome Linked List问题:Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?思路: 先选择中间的....
分类:其他好文   时间:2015-07-19 13:15:11    阅读次数:96
【原创】解决鼠标经过子元素触发mouseout,mouseover事件的问题
关键词:父子元素关系 mouseout mouseover 事件 事件冒泡初期代码: 1 2 3 4 5 6 mouseover mouseout 7 27 28 29 30 31 32 33 34 35 36 37 38 56 57 View Code我想实现...
分类:其他好文   时间:2015-07-19 13:13:53    阅读次数:5184
表连接
多表连接:1.Natural join: --两表连接[自动匹配两个表中,列名和数据类型都相同的列(多列列名相同就匹配多列)][select_list中的col_name不能加前缀]– USING clause --只能join,不能写natural join; --using(两表中相同列列名)....
分类:其他好文   时间:2015-07-19 13:14:39    阅读次数:159
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!