- 博客(178)
- 资源 (3)
- 收藏
- 关注
原创 spring cloud eureka server 配置
根据个人实战经验,写篇博客用的时候回来看一眼。 部署eureka注册中心: 基本配置: peer1配置:spring.application.name=eureka-servereureka.instance.hostname=peer1eureka.client.service-url.defaultZone=http://peer2:1112/eureka/peer2配置:spring.
2017-09-20 13:07:15
1110
原创 json和对象的相互转化
使用com.fasterxml.jackson.databind.ObjectMapper转化对象和json字符串Bean对象到json字符串private static String toJson(Object obj){ ObjectMapper objectMapper = new ObjectMapper(); objectMapper.configure(Deserial
2016-07-19 15:57:48
582
原创 DNS服务器配置
配置DNS服务器要用到的3个基础文件:主配置文件name.conf正向解析文件方向解析文件1.options{ //配置解析文件所在目录directory "/var/named/";};zone "linux.com"{ //正向解析文件type master;file "linux.com.zone";};zone "10.10.10.in-addr.arp
2014-12-25 11:18:06
1034
原创 Sequence II
Sequence IITime Limit: 5000/2500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 410 Accepted Submission(s): 182Problem DescriptionLong long ago, there is a
2014-12-23 20:38:37
829
原创 samba配置实战
配置samba服务器,建立2个组,3个用户。group1下有user1,user2两个用户,group2下有user3一个用户。同时共享一个文件夹。user1可以访问共享文件夹,并能在共享文件夹下新建文件。user2可以访问共享文件夹,但不能在共享文件夹下新建文件。user3不能访问共享文件夹。1.安装samba软件。2.配置smb.conf文件 [share]
2014-12-21 16:53:20
889
原创 最优最小权匹配
Going HomeTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3041 Accepted Submission(s): 1541Problem DescriptionOn a grid map ther
2014-12-17 19:08:38
1612
转载 图论500题,默默奋斗
转载出处:http://blog.youkuaiyun.com/qwe20060514/article/details/8112550=============================以下是最小生成树+并查集======================================【HDU】1213 How Many Tables 基础并查集★1272 小希的迷宫 基础并查
2014-12-17 10:38:12
879
原创 奔小康赚大钱 hdu 2255
奔小康赚大钱Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4211 Accepted Submission(s): 1825Problem Description传说在遥远的地方有一个非常富裕的村落,有一天,
2014-12-17 10:29:34
977
原创 vsftpd配置实战
首先检查是否安装了db软件,rpm -qa|grep db4如果没有安装,则安装,这里就不介绍了,有很多。安装完db4数据库软件,正式进入vsftpd服务器。1.添加虚拟用户vdearadduser -d /home/vdear -s /sbin/nologin vdear2.添加3个文件夹,mkdir up down all3.改变文件夹所属用户
2014-12-13 16:49:49
965
原创 幂取模
求a^b%c的结果,方法一: a*b%c = ((a%c)*b)%c;代码如下:int work(int a, int b, int c){ int res = 1; for (int i = 0; i < b; i ++) { res = res * a % c; } return res;}但是这种方法复杂度太高,不
2014-12-11 23:03:39
905
原创 new 和 delete
new 和 delete能够动态的创建数组,删除数组。char *a = new char;delete a;char *a = new char[12] //创建一个12个字节的字符数组delete [] a;int *a = new int[12];
2014-12-10 19:22:06
812
原创 类的浅度复制和深度复制
现在我们定义一个类//name.hclass name{ private: char *str; int len; static in num_name; //全局变量,不能在声明中初始化。(因为声明描述了如何分配内存,但不分配内存)。 public: name(); name(c
2014-12-09 11:14:49
1013
原创 判断一个无向图是不是二分图
判断一个无向图是不是二分图,使用染色法.对每个顶点的相邻顶点染与顶点不同的颜色。如果染过色且与顶点颜色相同,则不是二分图。#include #include #include #include #include using namespace std;const int maxn = 202;vectormp[maxn];int color[maxn];bool bfs(i
2014-12-06 14:54:12
5087
原创 ftp匿名用户配置
配置匿名用户需要两级认证,一个是/etc/vsftpd/vsftpd.conf,另一个是修改虚拟用户的主目录权限为其他用户“读写”1.在/etc/vsftpd/vsftpd.conf的文件中修改:anonymous_enable=YES //匿名用户可以访问ftp,默认为YESanon_upload_e
2014-12-04 10:34:14
5054
原创 配置FTP虚拟用户访问
直接使用本地用户(Linux系统的用户账户)来访问vsftpd服务器可能带来安全问题,变通的方法是使用虚拟用户(virtual user)来作为专门的FTP账户。FTP虚拟用户并不是操作系统的用户账户,不能登入系统,只能访问FTP服务器,对操作系统的影响更小。虚拟用户主要用来访问提供给非信任用户,但又不适合公开的内容。 PAM(Pluggable Authentication Modu
2014-12-03 15:37:24
1279
原创 客户端主机限制
vsftpd也具备控制特定IP地址或主机名的客户端访问的功能,这需要借助tcp_wrappers来实现。tcp_wrappers又称为TCP包装器,可通过读取/etc/hosts.allow和/etc/hosts.deny文件中的规则来控制客户端对特定服务的访问。tcp_wiappers按照一下顺序来检查和应用访问规则。1.读取/etc/hosts.allow,如果明确允许访问,则允许访问且不
2014-12-03 10:21:50
894
原创 c++友元函数定义
定义个Point类class Point{private: double x; double y;public: Point operator*(const Point& b); Point operator*(double m);}定义Point对象a, c;c = a*3.1;这样是正确的,可调用第二个重载函数c = 3.1*a;
2014-12-02 16:49:01
1624
原创 STL中sort函数用法
sort()头文件是:#include sort()函数用法有很多种,重载运算符,定义比较函数。我们重载>和也可以定义比较函数。Point.h#ifndef POINT_H#define POINT_Hclass Point{ private: double x; double y; public: Po
2014-12-02 15:30:48
927
原创 启用userlist保障账号安全,控制用户登录
vsftpd保障用户账户安全 vsftpd保障用户账号安全,启用userlist,使禁用的用户,不给出输入口令提示。这样就保障了用户的密码安全。启用userlist设置:userlist_enable=YES userlist_file=/etc/vsftpd/user_listuserlist_deny=YES userlist_enable=YES启用use
2014-12-02 10:50:04
1327
原创 dijkstra+dfs
A Walk Through the ForestTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5923 Accepted Submission(s): 2178Problem DescriptionJimm
2014-11-11 15:18:33
873
原创 dijkstra+限制最短路
Invade the MarsTime Limit: 5000/2000 MS (Java/Others) Memory Limit: 365768/165536 K (Java/Others)Total Submission(s): 1464 Accepted Submission(s): 408Problem DescriptionIt's now the
2014-11-10 11:12:07
735
转载 python问题:IndentationError:expected an indented block错误解决
Python语言是一款对缩进非常敏感的语言,给很多初学者带来了困惑,即便是很有经验的Python程序员,也可能陷入陷阱当中。最常见的情况是tab和空格的混用会导致错误,或者缩进不对,而这是用肉眼无法分别的。在编译时会出现这样的错IndentationError:expected an indented block说明此处需要缩进,你只要在出现错误的那一行,按空格或Tab(但不能混用)键缩进
2014-11-01 11:17:04
635
原创 最小树形图
NEW~ 关于举办计算机学院大学生程序设计竞赛(2014'11)的报名通知Transfer waterTime Limit: 5000/3000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3893 Accepted Submission(s
2014-10-25 16:50:58
586
转载 并查集+向量偏移
poj 1182 食物链(并查集+向量偏移)分类: ACM之并查集2012-01-18 10:53 157人阅读 评论(0) 收藏 举报joinc这道食物链实在让我纠结了好久。。。1182 食物链(并查集+向量偏移)" title="poj 1182 食物链(并查集+向量偏移)" style="border:0px; max-width:100%; margin
2014-10-15 19:36:59
891
原创 Network
NetworkTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9464 Accepted: 4452DescriptionA Telephone Line Company (TLC) is establishing a new telephone cabl
2014-09-17 18:10:44
603
原创 http://poj.org/problem?id=2472
106 miles to ChicagoTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 4064 Accepted: 1876 Special JudgeDescriptionIn the movie "Blues Brothers", the o
2014-08-25 18:06:44
802
原创 http://poj.org/problem?id=1135
Domino EffectTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8882 Accepted: 2221DescriptionDid you know that you can use domino bones for other things b
2014-08-25 17:26:27
701
原创 http://acm.hdu.edu.cn/showproblem.php?pid=1385
Minimum Transport CostTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7550 Accepted Submission(s): 1941Problem DescriptionThese are N c
2014-08-24 10:10:02
866
原创 http://poj.org/problem?id=2253
FroggerTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 26038 Accepted: 8461DescriptionFreddy Frog is sitting on a stone in the middle of a lake. Suddenl
2014-08-23 14:11:46
803
原创 http://poj.org/problem?id=2488
A Knight's JourneyTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 30733 Accepted: 10528DescriptionBackground The knight is getting bored of seeing the
2014-08-21 10:01:56
850
原创 求强连通分支 tarjan算法
#include #include #include using namespace std;const int maxn = 10;int tree[maxn];int dfn[maxn];vectorg[maxn];int n, m;int temp[maxn];int top;int sta[maxn];void init() { for (int i = 1;
2014-08-20 22:33:40
810
原创 http://poj.org/problem?id=2251
Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16658 Accepted: 6478DescriptionYou are trapped in a 3D dungeon and need to find the quicke
2014-08-20 20:47:25
674
原创 http://poj.org/problem?id=2935
Basic Wall MazeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 2868 Accepted: 1296 Special JudgeDescriptionIn this problem you have to solve a very
2014-08-20 15:28:24
741
原创 http://poj.org/problem?id=1094
Sorting It All OutTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 27774 Accepted: 9616DescriptionAn ascending sorted sequence of distinct values is one
2014-08-18 09:02:44
815
原创 http://poj.org/problem?id=3126
Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11460 Accepted: 6498DescriptionThe ministers of the cabinet were quite upset by the message fr
2014-08-15 08:28:16
700
原创 http://poj.org/problem?id=2255
Tree RecoveryTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11380 Accepted: 7141DescriptionLittle Valentine liked playing with binary trees very much.
2014-08-10 16:55:16
669
原创 http://poj.org/problem?id=1909
Marbles on a treeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1473 Accepted: 735Descriptionn boxes are placed on the vertices of a rooted tree, which
2014-08-10 10:08:31
953
原创 http://poj.org/problem?id=1634
Who's the boss?Time Limit: 5000MS Memory Limit: 30000KTotal Submissions: 2626 Accepted: 1078DescriptionSeveral surveys indicate that the taller you are, the highe
2014-08-09 10:25:20
1429
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人