一、前言 Redis 提供了5种数据类型:String(字符串)、Hash(哈希)、List(列表)、Set(集合)、Zset(有序集合),理解每种数据类型的特点对于redis的开发和运维非常重要。 ![Redis五种数据类型][2] Redis 中的 list 是我们经常使用到的一种数据类型,根据 ...
分类:
其他好文 时间:
2020-04-02 17:29:28
阅读次数:
81
json 提取器各字段说明: Variable names:保存的变量名,后面使用${Variable names}引用 JSON Path expressions:调试通过的json path表达式 Match Numbers:匹配数字(0代表随机提取,1代表提取第一个,-1代表提取所有) Def ...
分类:
Web程序 时间:
2020-04-02 16:05:49
阅读次数:
331
可变参数(可以不传该参数) #参数numbers接收到的是一个tuple def calc(*numbers): sum = 0 for n in numbers: sum = sum + n * n return sum 关键字参数 def person(name, age, **kw): pri ...
分类:
其他好文 时间:
2020-04-02 11:52:40
阅读次数:
120
第一做容斥原理,开始真的不太好理解 题意:给出a,b<=1e19 n<=1e9 ,问[a,b]中与n互质的个数 考虑[a,b]中与n不互质的个数,对n唯一分解定理,与n不互质的个数即为n/p,但是考虑到会有重复,且若数字个数是奇数则要+,偶数减去,因此借助二进制遍历每一种情况(极其神奇的思想) 代码 ...
分类:
其他好文 时间:
2020-04-01 21:02:50
阅读次数:
69
Problem : Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of ...
分类:
其他好文 时间:
2020-04-01 01:01:58
阅读次数:
55
在Java多线程中,可以使用synchronized关键字实现线程之间的同步互斥,在jdk1.5后新增的ReentrantLock类同样可达到此效果,且在使用上比synchronized更加灵活。观察ReentrantLock类可以发现其实现了Lock接口public class Reentrant ...
分类:
其他好文 时间:
2020-03-31 21:15:26
阅读次数:
99
国际互联网的管理机构--ICANN 当从RIR中拿到ASN和IP段之后,就可以通过BGP协议将此段IP地址广播到网通、电信等ISP,为什么通过BGP能广播IP到ISP?因为能做BGP的最起码是IDC机房才行。由于AS和BGP都关系,一个IP可能被广播或者隧道到别的地方 中国的运营商主要负责电话通讯, ...
分类:
其他好文 时间:
2020-03-31 14:19:07
阅读次数:
351
# 题意 给定两个整数l,r,求在[l,r]区间内距离最近的一对相邻质数,和距离最远的一对相邻质数 l,r ∈ [1 , 231-1] 其中r-l <= 1e6 # 题解 l,r的范围很大,大约是2e9 线性算法也无法求出[1,r]的所有质数,但是r-l的范围小, 任何一个合数必定会包含一个不超过 ...
分类:
其他好文 时间:
2020-03-30 23:26:05
阅读次数:
70
People on Mars count their numbers with base 13: Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, m ...
分类:
其他好文 时间:
2020-03-30 15:49:03
阅读次数:
81
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi ...
分类:
其他好文 时间:
2020-03-30 12:40:30
阅读次数:
66