一、Redis简介 Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库、缓存和消息中间件。 它支持多种类型的数据结构,如 字符串(strings), 散列(hashes), 列表(lists), 集合(sets), 有序集合(sorted sets) 与范围查询, b ...
分类:
其他好文 时间:
2016-10-18 18:36:59
阅读次数:
198
Redis基本数据类型 1、String 字符串 1、概念 1、String 是redis最基本的类型,value 不仅可以是 String,也可以是数字;使用 Strings 类型,可以完全实现目前 Memcached 的功能,并且效率更高。还可以享受 Redis 的定时持久化(可以选择 RDB ...
分类:
其他好文 时间:
2016-10-17 09:14:13
阅读次数:
136
Format strings contain “replacement fields” surrounded by curly braces {} ...
分类:
其他好文 时间:
2016-10-16 14:15:07
阅读次数:
300
Python的open的写入方式有: write(str):将str写入文件 writelines(sequence of strings):写多行到文件,参数为可迭代对象 首先来看下writelines()这个方法: 运行上面结果之后,可以看到blogCblog.txt文件有123456内容,这里 ...
分类:
编程语言 时间:
2016-10-12 22:02:49
阅读次数:
234
Spinner Spinner是一个下拉列表,通常用于选择一系列可选择的列表项,它可以使用适配器,也可以直接设置数组源。 1、直接设置数组源 在res/values/strings.xml中设置数组源 然后在MainActivity找到spinner,然后设置默认选择项 这里的setSelectio ...
分类:
移动开发 时间:
2016-10-12 14:09:36
阅读次数:
254
题目: Write a function to find the longest common prefix string amongst an array of strings. 官方难度: Easy 翻译: 写一个函数,用来寻找一个字符串数组中的最长公共前缀。 思路: 1. 长度为0的数组直接退 ...
分类:
其他好文 时间:
2016-10-12 10:51:29
阅读次数:
122
1.题目大意 求一个长度不超过80的字符串的最小周期. 2.思路 非常简单,基本就是根据周期的定义做出来的,几乎不需要过脑. 3.应该注意的地方 (1) 最后输出的方式要注意,不然很容易就PE了.不过个人认为,其实这题Sample Output给的不好 (2) 注意输出的要求是最小周期 4.代码 参 ...
分类:
其他好文 时间:
2016-10-12 00:15:06
阅读次数:
162
产生随机密码总结方式一:cat/dev/urandom|sed‘s/[^a-zA-Z0-9]//g‘|strings-nC|head-nL其中C表示字符串的字符数,L表示要生成多少行字符例子:[root@lnmp~]#cat/dev/urandom|sed‘s/[^a-zA-Z0-9]//g‘|strings-n5|head-n1tJxJp方式二:[root@lnmp~]#cat/dev/urandom|head-1|md5su..
分类:
其他好文 时间:
2016-10-11 22:15:25
阅读次数:
245
Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. The ...
分类:
其他好文 时间:
2016-10-11 18:56:05
阅读次数:
161
publicstaticCharacterFindFirstKChar(Stringstr,intk){
Strings=str.replaceAll("","");
Map<Character,Integer>charCountMap=newHashMap<Character,Integer>();
Characterch=null;
for(inti=0;i<s.length();i++){
if(charCountMap.containsKey(s.charAt(i))..
分类:
其他好文 时间:
2016-10-11 00:41:20
阅读次数:
744