如何在不同的线程使用bufferevent_read和bufferevent_write呢? 首先,我们需要在建立base之前加上evthread_use_pthreads(); evthread_use_pthreads(); struct event_base* base = event_bas ...
                            
                            
                                分类:
其他好文   时间:
2020-07-21 23:17:44   
                                阅读次数:
84
                             
                         
                    
                        
                            
                            
                                    #include<iostream> #include<string> using namespace std; struct student{ string name; string number; int score; }; int main(){ int n; cin>>n; student  ...
                            
                            
                                分类:
其他好文   时间:
2020-07-21 23:01:26   
                                阅读次数:
73
                             
                         
                    
                        
                            
                            
                                    一、反射的概述 JAVA反射机制是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法;对于任意一个对象,都能够调用它的任意一个方法和属性;这种动态获取的信息以及动态调用对象的方法的功能称为java语言的反射机制。要想解剖一个类,必须先要获取到该类的字节码文件对象。而解剖使用的就是Clas ...
                            
                            
                                分类:
编程语言   时间:
2020-07-21 21:52:55   
                                阅读次数:
65
                             
                         
                    
                        
                            
                            
                                    字典树 字典树比较普通字符串比较而言,字符的可操作性更强 const int maxn=5e5+5; //maxn为总结点个数,不是总深度 struct trie{ int nex[maxn][26],cnt=0; bool exist[maxn]; void insert(string s){ i ...
                            
                            
                                分类:
其他好文   时间:
2020-07-21 14:19:54   
                                阅读次数:
64
                             
                         
                    
                        
                            
                            
                                    日志里打印: 10:39:48.962 [Druid-ConnectionPool-Create-1315749361] [] [] ERROR c.alibaba.druid.pool.DruidDataSource - create connection error com.mysql.jdbc ...
                            
                            
                                分类:
数据库   时间:
2020-07-21 14:14:30   
                                阅读次数:
177
                             
                         
                    
                        
                            
                            
                                    回文自动机,据说是解决回文问题的利器。感觉板子还是非常简洁的,容易记忆。 ...
                            
                            
                                分类:
其他好文   时间:
2020-07-20 22:49:47   
                                阅读次数:
66
                             
                         
                    
                        
                            
                            
                                    Johnson 将源点设为$0$,将$0$向每个点连一条边权为$0$的边 先跑一边$SPFA$ 再将$u->v$的一条边的边权增加$dis[u]-dis[v]$ 从每个点开始跑$dijkstra$,求出最短路径,对于一条$s->t$的边,最短路径减去$dis[s]-dis[t]$,就求出了最短路 C ...
                            
                            
                                分类:
其他好文   时间:
2020-07-20 20:31:03   
                                阅读次数:
89
                             
                         
                    
                        
                            
                            
                                    1、首先需要了解哪些占位符分别代表什么 这些是死知识,把常用的记住,不常用的直接查表就行了 golang 的fmt 包实现了格式化I/O函数,类似于C的 printf 和 scanf。 定义示例类型和变量 type Human struct { Name string } var people =  ...
                            
                            
                                分类:
编程语言   时间:
2020-07-20 15:24:23   
                                阅读次数:
75
                             
                         
                    
                        
                            
                            
                                    package main import ( "golang.org/x/tour/pic" "image/color" "image" ) type Image struct{} func (i Image) ColorModel() color.Model { return color.RGBAM ...
                            
                            
                                分类:
其他好文   时间:
2020-07-20 13:17:01   
                                阅读次数:
57
                             
                         
                    
                        
                            
                            
                                    参考资料:https://github.com/koding/multiconfig 测试代码: package main import ( "fmt" "github.com/koding/multiconfig" ) type Server struct { Demo DemoConfig }  ...
                            
                            
                                分类:
其他好文   时间:
2020-07-20 13:14:30   
                                阅读次数:
59