自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(85)
  • 资源 (5)
  • 收藏
  • 关注

原创 微信小程序码获取-从频繁失败到成功率100%

早期实现方案方案实现通过微信的appSecret获取小程序accessToken并缓存微信小程序上很多操作都需要使用accessToken,比如用户授权手机号,当然也包括获取小程序码通过微信提供的api获取到对应的小程序码,由于http接口直接返回的是图片本身,所以考虑将图片上传七牛服务器并获取图片链接,最后使用图片的链接来展示或保存小程序码方案优点由于上传了小程序码,对于一...

2019-05-23 19:56:14 2125 1

转载 关于MQ的一些使用场景

消息队列(MQ)是一种不同应用程序之间(跨进程)的通信方法。应用程序通过写入和检索出入列队的数据(消息)来通信,而无需通过专用连接来链接它们。消息传递指的是程序之间通过在消息中发送数据进行通信,而不是通过直接调用彼此来通信,直接调用通常是用于诸如远程过程调用(Remote Procedure Call. RPC)的技术。排队指的是应用程序通过队列来通信。队列的使用除去了接收和发送应用程序同时执行的...

2018-06-15 17:35:25 2342

原创 关于cloud接口无法执行fallback问题

公司以前的项目都是只是springboot的,rpc调用全部是基于dubbo接口的调用,现在正慢慢地向springcloud转型,所以在添加配置的时候,经常会有一些配置被遗漏,导致出现问题。在老项目中添加了cloud组件,用feignClient调用cloud接口出错后没有按预期进入fallback方法,起初是怀疑fallback返回值有问题,导致程序下一步继续出错,排查后发现fallback...

2018-06-04 11:41:36 1707

原创 关于乐观锁的使用

关于乐观锁简单的来说,乐观锁就是在修改数据库数据的时候,验证数据库里的那条数据是不是可以修改的状态,即执行update 。。。where 【条件】。这个条件就是确保当前的那条记录时可以修改的,如果不可以修改,这句update语句就无法执行成功,这个方法在高并发状态下和类似于定量发放红包的场景下十分实用。使用方式1: 一条订单记录需要修改状态,假设目前这条订单处于刚刚下单状态,商家端可以对其...

2018-06-03 23:31:13 2923

原创 关于mybatis插件tk.mybatis生成的动态sql语句字段不加``的问题

问题描述今天在用tk.mybatis插件的时候,查询一个对象用mapper.selectByPrimaryKey(id)方法时出现错误,错误原因是mybatis在生成查询语句时对表名和列名没有加` `符号,正巧那张表的列明有一个字段为option,正好是mysql的关键字,不加` `符号肯定是会出错的。原因原因是由于用mybatis-generator时生成的model类上加的字...

2018-03-17 08:59:03 7737 2

原创 test

#include #include#include#include#include #include#include#include using namespace std;int abs(int n){ if(n>=0)return n; return -n;}int num[5000005];int main(){ int T; int n,a,b; int cas=0; int i,j; i

2018-01-22 09:12:44 223

原创 test001

#include #include #include #include #include using namespace std;char str[1000005];int count(int s){ int i,len,num=0; len=strlen(str); for(i=len;i str[i-1]='\0'; len=strlen(str); for(i=s;i if(str[i]=

2018-01-22 09:12:41 311

原创 将博客搬至CSDN

今天我的博客搬家啦,搬到csdn博客,欢迎大家访问!

2018-01-22 09:12:39 171

原创 hdu-5437 Alisha’s Party(优先队列)

MarkdownPad Document img { max-width: 100% } ;Alisha’s Party9/15/2015 10:20:23 PM url:http://http://acm.hdu.edu.cn/showproblem.php?pid=5437Time Limit: 3000/2000 MS (Java/Others) Memor

2018-01-22 09:12:35 285

原创 hdu1203I NEED A OFFER!(简单01背包)

I NEED A OFFER!Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20150    Accepted Submission(s): 8045Problem DescriptionSpeakless很早就想出国,现在他已经考完了所

2018-01-22 09:12:32 174

原创 hdu5375Gray code(dp)

Gray codeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 384    Accepted Submission(s): 216Problem DescriptionThe reflected binary code, also kn

2018-01-22 09:12:30 204

原创 hdu5358First One

First OneTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 949    Accepted Submission(s): 288Problem Descriptionsoda has an integer array a1,a2,

2018-01-22 09:12:26 236

原创 关于优先队列的方法

#include struct node{ int l,r,num;}soda[100005];bool operator if(a.r==b.r) return a.l>b.l; else return a.r>b.r;}priority_queueq;这种优先队列的定义方法只能重载 号,有点奇怪。还有一种定义法能重载 > 运算符,太麻烦就不写了,有这一个就够用了。另外,优先队列没有对对头的

2018-01-22 09:12:23 343

原创 hdu-5360Hiking(优先队列+贪心)

HikingTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 483    Accepted Submission(s): 259Special JudgeProblem DescriptionThere are n soda conve

2018-01-22 09:12:21 282

原创 poj2823Sliding Window(单调队列)

Sliding WindowTime Limit: 12000MSMemory Limit: 65536KTotal Submissions: 47092Accepted: 13603Case Time Limit: 5000MSDescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of siz

2018-01-22 09:12:18 211

原创 hdu1532Drainage Ditches(最大流模板题)

Drainage DitchesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12079    Accepted Submission(s): 5718Problem DescriptionEvery time it rains on F

2018-01-22 09:12:15 208

原创 hdu5351 MZL\'s Border(java写大数,斐波那契数列)

MZL's BorderTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 657    Accepted Submission(s): 203Problem DescriptionAs is known to all, MZL is an e

2018-01-22 09:12:12 233

原创 poj-3268 Silver Cow Party(SPFA)

Silver Cow PartyTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 15106Accepted: 6821DescriptionOne cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big

2018-01-22 09:12:08 183

原创 hdu5336 XYZ and Drops (关于十滴水游戏的模拟)

XYZ and DropsTime Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 714    Accepted Submission(s): 196Problem DescriptionXYZ is playing an interesting

2018-01-22 09:12:05 467

原创 hdu5323 Solve this interesting problem(DFS关于线段树中的一些性质和规律)

Solve this interesting problemTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1905    Accepted Submission(s): 573Problem DescriptionHave you lea

2018-01-22 09:12:02 249

原创 hdu-3449 Consumer(典型的依赖背包)

ConsumerTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/65536 K (Java/Others)Total Submission(s): 1498    Accepted Submission(s): 787Problem DescriptionFJ is going to do some shopping, a

2018-01-22 09:11:59 2429

原创 hdu-2546饭卡(01背包)

饭卡Time Limit: 5000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 15886    Accepted Submission(s): 5505Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个

2018-01-22 09:11:56 228

原创 hdu-2955 Robberies(思维需转变——01背包)

欢迎参加——BestCoder周年纪念赛(高质量题目+多重奖励)RobberiesTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16060    Accepted Submission(s): 5878Problem Descriptio

2018-01-22 09:11:53 203

原创 hdu-1009\tFatMouse\' Trade(简单贪心)

FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 53691    Accepted Submission(s): 17943Problem DescriptionFatMouse prepared M poun

2018-01-22 09:11:50 197

原创 poj-3548 Restoring the digits(DFS枚举)

Restoring the digitsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 591Accepted: 181Special JudgeDescriptionLet's consider arithmetic expressions (addition or subtraction) over non-negative d

2018-01-22 09:11:47 170

原创 poj-2054 Color a Tree

Color a TreeTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 7238Accepted: 2497DescriptionBob is very interested in the data structure of a tree. A tree is a directed graph in which a special

2018-01-22 09:11:44 700 1

原创 poj-3122 Pie(二分卡精度)

PieTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 12597Accepted: 4354Special JudgeDescriptionMy birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a number

2018-01-22 09:11:41 228

原创 CSU - 1655 文本计算器

1655: 文本计算器Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 95  Solved: 29[Submit][Status][Web Board]点我找原题DescriptionBob讨厌复杂的数学运算.看到练习册上的算术题,Bob很是头痛.为了完成作业,Bob想要你帮忙写一个文本版的四则运算计算器.这个计算器的功能需求十分简单,只要可以处

2018-01-22 09:11:38 196

原创 hdu-1429 胜利大逃亡(续) (BFS+状态压缩)

胜利大逃亡(续)点我找原题Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6132    Accepted Submission(s): 2124Problem DescriptionIgnatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜

2018-01-22 09:11:35 204

原创 hdu-1258 Sum It Up(简单深搜)

Sum It Up点我找原题Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4746    Accepted Submission(s): 2470Problem DescriptionGiven a specified total t a

2018-01-22 09:11:32 256

原创 hdu-1074 Doing Homework(状态压缩DP)

Doing Homework点我找原题Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6037    Accepted Submission(s): 2566Problem DescriptionIgnatius has just come

2018-01-22 09:11:29 317

原创 hdu-4597 Play Game(区间DP)

Play Game点我找原题Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 888    Accepted Submission(s): 519Problem DescriptionAlice and Bob are playing a g

2018-01-22 09:11:26 365

原创 hdu-1253胜利大逃亡(空间坐标下的BFS)

胜利大逃亡点我找原题Time Limit : 4000/2000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 61   Accepted Submission(s) : 24Font: Times New Roman | Verdana | GeorgiaFont Size: ← →P

2018-01-22 09:11:23 185

原创 hdu-1010 Tempter of the Bone(DFS之奇偶剪枝)

Tempter of the Bone点我找原题Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 95   Accepted Submission(s) : 35Font: Times New Roman | Verdana | GeorgiaF

2018-01-22 09:11:20 229

原创 三点坐标确定圆心坐标

struct Point{ double x,y; friend Point operator - (Point a,Point b) //重载友元运算符 { Point temp; temp.x = a.x - b.x; temp.y = a.y - b.y; return temp; }};Point get_pc

2018-01-22 09:11:17 13669

原创 ZOJ1091 Knight Moves(BFS)

Knight Moves点我找原题Time Limit: 2 Seconds      Memory Limit: 65536 KBA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves

2018-01-22 09:11:14 348

原创 ZOJ 1005 Jugs

Jugs点我找原题Time Limit: 2 Seconds      Memory Limit: 65536 KB      Special JudgeIn the movie "Die Hard 3", Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a

2018-01-22 09:11:11 148

原创 最长公共子序列(LCS)

#define M 500char str1[M],str2[M];int len1,len2;//分别为str1和str2的长度int dp[M][M];int LCS(){ int i,j; for(i=0;i { for(j=0;j { if(str1[i]==str2[j]) dp[i+1][j+1]=dp[i][j]+1; else dp[i+1][j+1]=max(dp[i

2018-01-22 09:11:08 135

原创 ZOJ 1453Surround the Trees(凸包)

Surround the Trees点我找原题Time Limit: 2 Seconds      Memory Limit: 65536 KBThere are a lot of trees in an area. A peasant wants to buy a rope to surround all these trees. So at first he must know the min

2018-01-22 09:11:05 221

原创 Area 2(求多边形面积)

Area 2点我找原题Time Limit: 2 Seconds      Memory Limit: 65536 KBBackgroundBeing well known for its highly innovative products, Merck would definitely be a good target for industrial espionage. To protect

2018-01-22 09:11:02 443

布谷鸟算法的改进及其应用研究

主要讲述关于布谷鸟算法的主要算法思路和改进方法,以及布谷鸟算法的应用

2015-12-08

PSO算法在动态优化中的应用

主要介绍了PSO算法的主要思想,以及在动态优化中的应用

2015-12-08

PSO算法的研究及应用

主要介绍了PSO算法的主要算法思路,PSO算法的进一步改进以及其应用方面的研究

2015-12-08

计算机网络实验指导

计算机网络实验指导手册,主要内容:网线制作,Cisco交换机的配置,路由器配置。

2015-12-04

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除