-- 查找重复记录select names,num from test where rowid != 
(select max(rowid) from test b where b.names = test.names and b.num = 
test.num)或者使用select names,n.....
                            
                            
                                分类:
数据库   时间:
2014-05-16 18:51:53   
                                阅读次数:
278
                             
                    
                        
                            
                            
                                题目: Givennpoints on a 2D plane, find the maximum 
number of points that lie on the same straight line.解题思路: 
第一反应:枚举两个点组成的直线,然后看其他的点在不在这条直线上,在此过程中统计最大.....
                            
                            
                                分类:
其他好文   时间:
2014-05-16 05:54:57   
                                阅读次数:
193
                             
                    
                        
                            
                            
                                1 #include 2 #include 3 using namespace std; 4 
5 int main() 6 { 7 string str=""; 8 string str2=""; 9 char max;10 while 
(getline(ci...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 16:20:41   
                                阅读次数:
258
                             
                    
                        
                            
                            
                                http_load学习心得:测试网站每秒所能承受的平均访问量(吞吐量)http_load 
-parallel 5 -fetches 
1000urls.txt这段命令行是同时使用5个进程,随机访问urls.txt中的网址列表,总共访问1000次。运行之后的结果:1000 fetches, 5 
max ...
                            
                            
                                分类:
Web程序   时间:
2014-05-15 16:13:33   
                                阅读次数:
407
                             
                    
                        
                            
                            
                                初始为一个数对(a,b),每回合从a到b或者从b到a转移min(a,b),最后如果b为零,获胜
求能进行的回合数的期望和获胜的概率
For both these valueserrors less than 10e-5will be ignored...
                            
                            
                                分类:
其他好文   时间:
2014-05-15 03:24:55   
                                阅读次数:
184
                             
                    
                        
                            
                            
                                /proc/sys/net/ipv4/tcp_max_tw_buckets 
默认的太小了net.ipv4.tcp_syncookies = 0这个参数是怎么得来的?其实是通过ab 简单的压力测试,/var/log/message 
里面会有内核的报错信息。
                            
                            
                                分类:
其他好文   时间:
2014-05-14 22:56:49   
                                阅读次数:
349
                             
                    
                        
                            
                            
                                题意:最大连续子序列和,在一个数组中找到和最大的连续子数组
思路:dp, 对于第i个数,有两种选择:把它加入在子数组里,不加入子数组(子数组到此结束)
加不加入子数组,要比较它加入前后子数组的总和是变大了还是变小了,如果变大则加入,变小则不加入
所以,我们需要记录以i-1结尾的子数组的总和,最后的结果在这些总和中取最大的那个
f[i] = max(f[i-1]+a[i],f[i-1]);
max({f[i]})
实现时用两个变量,一个保存f[i-1],一个保存目前为止最大的f[i]
复杂度:时间O(n),空...
                            
                            
                                分类:
其他好文   时间:
2014-05-14 21:53:14   
                                阅读次数:
250
                             
                    
                        
                            
                            
                                mysql5.6.14配置my.cnf多实例,mysql_install_db初始化不读取my.cnf配置文件
 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a differentsize 768 pages (rounded down to MB) than specified in the .cnf file: initial65536 pages, max 0 (relevant if non-zero) pages!
2014-0...
                            
                            
                                分类:
数据库   时间:
2014-05-14 14:20:48   
                                阅读次数:
412
                             
                    
                        
                            
                            
                                观察可以发现,0,1,2,……,n结尾的分组中,maxsum a[0] = a[0]maxsum 
a[1] = max( a[0] + a[1] ,a[1]) = max( maxsum a[0] + a[1] ,a[1])maxsum a[2] = 
max( max ( a[0] + a[1] +...
                            
                            
                                分类:
其他好文   时间:
2014-05-14 08:38:58   
                                阅读次数:
323
                             
                    
                        
                            
                            
                                定义一个存储过程,用到游标,从一个表中取值,插入到另外一个表中。drop procedure 
if exists search_test;create procedure search_test(in id int,out out_min_id 
varchar(200))begindeclare f...
                            
                            
                                分类:
数据库   时间:
2014-05-14 07:41:31   
                                阅读次数:
361