一、概述 Range在ruby中表示区间。表示方法“..”和“…”。前者表示闭合区间: Range中的元素可以是数字、字符串和自定义的区间对象 (1..10).each{|i| puts i } #1 2 3 4 5 6 7 8 9 10 (1…10).each{|i| puts i} #1 2 3 4 5 6 7 8 9 1.1常用方法...
分类:
其他好文 时间:
2015-01-11 17:52:09
阅读次数:
157
Codeforces gym Hello 2015 Div1 C and Div2 E
Codeforces gym 100570 problem C
Codeforces gym 100571 problem
E
Problem
给一个N行M列的矩阵Ma,进行Q次(Q查询,每次给定一个K,问有多少子矩阵,满足最大值max
- 最小值min
Limits
...
分类:
其他好文 时间:
2015-01-11 09:39:35
阅读次数:
204
New Document
function showValue(newValue)
{
document.getElementById("range").innerHTML=newValue;
}
Your Email address
Year Of Crime
Your Web address
Search the site......
分类:
Web程序 时间:
2015-01-10 22:24:25
阅读次数:
222
我的Linux服务器的Python版本是2.*,在将中文encode(UTF-8)的时候出现了UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)的问题。而在3.*中没有问题。
解决方法:
在代码前端加入
import sys
reload(s...
分类:
编程语言 时间:
2015-01-09 15:41:10
阅读次数:
286
Circular primesp = (lambda n,s=set():{'2'}|{str(i) for i in range(3,n,2) if ([j for j in range(i*3,n,i*2) if s.add(j)] or i not in s)})(int(1e6))print...
分类:
其他好文 时间:
2015-01-09 06:58:19
阅读次数:
172
1.python获取mac,ip地址2.range实现倒序列表未完待续。。。。。。。。
分类:
编程语言 时间:
2015-01-08 15:44:54
阅读次数:
203
import random
#warning: x and y confusing
sx = 10
sy = 10
dfs = [[0 for col in range(sx)] for row in range(sy)]
maze = [[' ' for col in range(2*sx+1)] for row in range(2*sy+1)]
#1:up 2:down 3:left 4...
分类:
编程语言 时间:
2015-01-08 15:24:22
阅读次数:
158
有关于查找基本的库函数有find(),find_if,binary_search(),lower_bound(),upper_bound(),equal_range()另外bind1st(greater,15),bind2nd(greater,15),greater(15,x),count_if()...
分类:
其他好文 时间:
2015-01-08 14:43:06
阅读次数:
156
上线一个服务,尤其是在上千上万台机器上部署,如果需要使用一个端口,就需要考虑端口被占用情况。原来都是用nmap扫描,找一个未被占用的其实可以这样做:修改文件/etc/sysctl.conf键入如下语句:net.ipv4.ip_local_port_range = 1024 65535默认是这样,如果...
分类:
其他好文 时间:
2015-01-08 12:56:39
阅读次数:
124
由于Lucene4.9.1的QueryParser支持类似Solr的范围检索( FL:[ 111 TO 222] ) 但是实际中会出现不准确的现象。这是由于QueryParser 把范围查询当做String类型。而无论索引时使用LongField 和 TextField 都会出现不准确问题。解决办法...
分类:
Web程序 时间:
2015-01-08 10:56:43
阅读次数:
226