- golang 实现文件上传下载
wangwei830
go
Gin框架上传下载上传(支持批量上传)httpRouter.POST("/upload",func(ctx*gin.Context){forms,err:=ctx.MultipartForm()iferr!=nil{fmt.Println("error",err)}files:=forms.File["fileName"]for_,v:=rangefiles{iferr:=ctx.SaveUplo
- python编写直方图和饼图
2301_80421078
python开发语言
1.直方图#直方图的绘制#语法格式:plt.hist(x,bins),其中x:数据集;bins:统计数据的分布区间importmatplotlib.pyplotaspltimportpandasaspd#导入文件excel=pd.read_excel('成绩.xlsx')#print(excel)#避免乱码plt.rcParams['font.sans-serif']=['SimHei']x=ex
- 打开C语言常用内存函数的大门(一) —— memcpy()函数 (内含讲解用法和模拟实现)
埋头编程~
C语言c语言开发语言visualstudio算法
文章目录1.前言2.memcpy函数2.1memcpy函数的原型2.2memcpy函数的形参和返回值详解3.memcpy函数的演示4.memcpy函数的模拟实现5.总结1.前言在之前写的文章中,我介绍了几个比较常用的字符串函数strlen、strcmp、strcpy。它们作用的对象只能是形如字符串类型的数据。那这难免会引起我们心中一泡浓厚的求知欲——C语言有没有给我们提供一些类似于字符串函数的功能
- Error - cannot open input file /postproc/nlscfg.inf 错误解决
技术无疆
WindowsCEinputfilecommandwindows
执行makeimg命令的时候出现一下错误:makeimg:Creatingnlscfg.outbecausenlscfg.infdoesn'texist.makeimg:runcommand:fmerge-nlsnlscfg.outnlscfg.infError-cannotopeninputfile/postproc/nlscfg.inffmergeforWindowsCE(Release)(B
- 猿创征文|【FreeSwitch开发实践】使用sipp对FreeSwitch进行压力测试
一马途追
FreeSwitch开发实践sipp压力测试FreeSwitch压测
✨博客主页:小小马车夫的主页✨所属专栏:FreeSwitch开发实践✨专栏介绍:主要介绍博主在实际项目中使用FreeSwitch开发外呼类项目的一些经验心得,主要涉及FreeSwitch的基本安装编译、基本配置、ESL、WSS、录音、自定义模块、mediabug、语音播放、MRCP及对接AI机器人等内容。内容在持续更新中,如果感兴趣可以对专栏进行订阅~文章目录前言1、sipp编译安装2、sipp命
- ROS yaml参数文件的使用
Sun Shiteng
ROS
举个例子,若在params.yaml文件中定义如下参数LidarImageFusion:points_src:"/hilbert_h/deskew/cloud_info"image_src:"/usb_cam0/image_raw"camera_info_src:"/home/hdj/fusion_slam/Color_SLAM_ws/src/hilbert_h/config/firefly_8s
- WPF中图片的宫格显示
Vae_Mars
WPF-AI对话wpf
1.解释说明-使用ScrollViewer控件来达到滑动的效果-使用WrapPanel的自动换行特性,保证图片在占满横向空间后自动往下排布-使用foreach的方法来游历所有的图片url2.xaml代码示例3.cs代码示例//加载url转换成BitmapImageprivateasyncTaskLoadImageFromUrl(stringurl){try{using(HttpClientclie
- pdf转换jpg(Python版本3.10)
大头安
pythonpythonpdf数学建模
importosimportrefromPILimportImagefrompdf2imageimportconvert_from_path,exceptionsfromconcurrent.futuresimportProcessPoolExecutorimporttempfile#解除Pillow的像素限制Image.MAX_IMAGE_PIXELS=Nonechunk_size=10#每个块
- TypeError: __init__() got an unexpected keyword argument ‘name‘
PinkAir
debugpythonleetcode
WhenIwroteacustomclassofKeras,Imetthiserror.Solution:changefromthesnippetbelowclasscustconv2d(keras.layers.Layer):def__init__(self):super(custconv2d,self).__init__()self.k=self.add_weight(shape=(1,),i
- 维护视图事件存储操作日志过程
LiamHacker
关于ZGJTFI_RCPZ表通过维护视图存储操作日志过程。以修改的状态进入到表维护生成器,再环境》修改》事件进入事件的界面后,选择修改,新增条目,选中下图红框的按钮,可查看系统提供的事件相关信息填入子例程名称,点击编辑器栏的按钮,创建子例程,也可以手工创建。然后编写代码其中gs_zgjtfi_rcpz、gt_zgjtfi_rcpz为FM全局变量,在FM中找到包含文件带有TOP字样的文件定义即可,也
- .gitattributes
道真人
开源
.gitattributes是一个Git配置文件,用于控制Git在特定文件或文件类型上的行为。它可以定义文件在不同操作系统上的行结尾格式、指定文件的合并策略、设置文件的差异显示方式,甚至可以用来锁定某些文件不允许合并。此外,它还能与GitLFS(LargeFileStorage)结合使用来管理大型文件。常见用途行结尾(EOL)转换.gitattributes文件可以控制行结尾的处理方式。不同的操作
- QT chart案例
quaer
QTqtswift开发语言
examples-zoomlinechart.qdocZoomLineExample|QtCharts5.15.2Qt5.15QtChartsZoomLineExampleQtCharts|CommercialorGPLv3ContentsRunningtheExampleCustomizingZoomingEffectsZoomLineExample$$$zoomlinechart-briefT
- [tkinter美化] 脱离系统样式的窗口(三系统通用)
THZrry
代码分享python
文章目录前言代码效果使用事项总结前言很多人都说tkinter不行,这没有,那没有,其中就包括窗口样式自定义。其实这些都可以用代码自己解决,为了方便其他使用tkinter的人,我将我之前写的代码贴出来代码Toplvel.py#本代码基于MIT协议开源importtkinterastktry:importmssfromPILimportImagefromPILimportImageTkgraber=m
- 【教程】如何使用 MYScrcpy,一行Python代码获取Android设备 屏幕/摄像头 H264/H265 原始视频流
Me2sY
MYScrcpypythonandroid开发语言智能手机扩展屏应用开发开源测试工具
MYScrcpy1.5.8Github/Gitee1.5.8版本新增获取原始视频流(H264/H265)方法,供小伙伴们在需要原生H264/H265串流时使用要求MYScrcpy>1.5.8pipinstall-Umysc安卓设备开启调试模式,安卓版本>5(摄像头需>11)H265需安卓设备支持H265编码步骤MYScrcpy从设计之初,就是想为小伙伴们打造一款好用易上手的工具包,所以使用起来也非
- Vue3.0中常用的通信方式
CV__工程师
javascript前端vue.js
1.父传子(Props):父组件通过props向子组件传递数据。父组件:importChildComponentfrom'./ChildComponent.vue';exportdefault{data(){return{messageFromParent:'HellofromParent',};},components:{ChildComponent,},};子组件:{{message}}exp
- BUUCTF 2021-10-4 Pwn
Ch1lkat
BUUCTFPwnlinuxpwn
文章目录保持手感echo分析EXPPwnme1分析EXPwdb_2018_1st_babyheap分析EXPFSOPhouseoforange_hitcon_2016分析前置知识House_of_orangeFSOPEXPzctf_2016_note3分析EXPgyctf_2020_document分析EXP动态调试复现护网杯_gettingstart分析EXPpicoctf_2018_buffe
- python爬虫处理滑块验证_python selenium爬虫滑块验证
用户6731453637
python爬虫处理滑块验证
importrandomimporttimefromPILimportImagefromioimportBytesIOimportrequestsasrqfrombs4importBeautifulSoupasbsfromseleniumimportwebdriverfromselenium.webdriverimportActionChainsfromselenium.webdriverimpo
- 9.4日常记录
冰榫
算法
一、索英笔试1.实现strcpy1.charsrc[]="Hello,World!";:这里定义了一个字符数组。这个字符串"Hello,World!"的内容被直接存储在这个数组中,数组的大小由字符串的长度加上一个额外的位置用于存储字符串结束符'\0'自动确定。例如,这个数组的大小为13(12个字符加上一个结束符)。可以修改这个数组中的内容,因为它是在栈上分配的可修改的内存区域。2.char*src
- 华为云端畅玩《黑神话:悟空》
单车~
算法数据结构华为云服务器运维
在华为云端畅玩《黑神话:悟空》,其电脑配置最低要求如下28:操作系统:需要64位处理器和操作系统,如Windows1064-bit。处理器:IntelCorei5-8400/AMDRyzen51600。内存:16GBRAM。显卡:NVIDIAGeForceGTX10606GB/AMDRadeonRX5808GB。DirectX版本:11。存储空间:需要130GB可用空间,推荐使用固态硬盘(SSD)
- 蒙特卡罗方法——布丰投针实验近似计算圆周率python代码实现
潮汐退涨月冷风霜
python开发语言蒙特卡罗
布丰实验数学原理python代码importrandomasrdimportnumpyasnpimportmathimportmatplotlib.pyplotaspltimportmatplotlibmatplotlib.rcParams['font.family']='SimHei'#或者'MicrosoftYaHei'matplotlib.rcParams['axes.unicode_min
- Proto3:File Location - 文件位置
Upping8
Prefernottoput.protofilesinthesamedirectoryasotherlanguagesources.Considercreatingasubpackageprotofor.protofiles,undertherootpackageforyourproject.如果不喜欢将.proto文件和其他语言资源放在同一个目录中。考虑在工程根包下为.proto文件创建一个子包
- 如何在Web浏览器存储中存储数据-解释了localStorage和sessionStorage
cumian9828
javapython数据库mysqlphp
Inordertomanagedatahandledbyyourwebapplication,youdonotnecessarilyneedadatabase.TherespectiveBrowserStoragefeaturesaresupportedbyChrome(version4andhigher),MozillaFirefox(version3.5andhigher)andInterne
- GIT的commit会自动合并一些文件
No.5吴吴
git
今天工作合并冲突的时候遇到一个问题:当我合并分支处理冲突后发现存在一些重复的代码.先说原因:git的commit会自动合并一些认为无意义的文件.导致出现了重复.解决办法:在合并文件的时候加上--no-commit选项可以防止Git自动创建一个合并提交。这让你有机会在实际提交之前审查和修改合并的结果。gitmergefeature-branch--no-commit--no-ff当然还有其他解决办法
- ipc共享内存
flowesy
笔记
今天才发现ipc用户态直接传数据是shm开头的那几个函数,看视频想到jvm都有不通过系统调用进行ipc通信的方式,linux应该也有啊,我也不知道之前总是记成mmap,感觉好像是上大学的时候被误导了,产生了错记。当然其实mmap也是很重要的,基本上可执行文件和动态链接库加载时都是通过这个函数映射到虚地址的。最近在b站上看os相关的课程,感觉发生pagefault时可以像tcp一样直接置换出去1/2
- VBA核对数据
猛犸象和剑齿虎
OptionExplicitSub分机床产量()DimrngAsRange,rng1AsRangeForEachrngInWorksheets("产量表").Range("c2:c85")ForEachrng1InRange("c2:c81")Ifrng1.Value=rng.ValueThenIfApplication.WorksheetFunction.CountIf(Range("c2:c8
- c 实现linux命令wc,C写的实现wc和ls函数
多特姚
c实现linux命令wc
#include//用lstat函数获取文件的类型intget_mode(char*file){structstatbuf;char*ptr;if(lstat(file,&buf)pw_name);strcpy(name2,getpwuid(buf.st_gid)->pw_name);printf("%s%s",name1,name2);return0;}//浏览文件夹的内容structdiren
- Vicky的ScalersTalk第六轮新概念朗读持续力训练Day50 20210319
Vicky_b9de
练习材料:AlostshipPart-1一艘沉船Thesalvageoperationhadbeenacompletefailure.Thesmallship,Elkor,whichhadbeensearchingtheBarentsSeaforweeks,wasonitswayhome.Aradiomessagefromthemainlandhadbeenreceivedbytheship'sc
- Docker in Docker 实践 on mac
solinger
dockerdockerdind
在尝试tekton构建cipipeline是,需要在k8pod里buildimage,于是研究了如何dockerindocker。1.编写自己的dinddockerimageFROMdocker:20.10.16-dindENVDOCKER_HOSTunix:///var/run/docker.sock2.dockerbuild自己的dinddockerimage并push到repo上docker
- 黑猴子的家: Eclipse 启动报 org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
黑猴子的家
1、log!SESSION2014-10-2410:24:10.240eclipse.buildId=4.3.2.M20140221-1700java.version=1.8.0_144java.vendor=OracleCorporationBootLoaderconstants:OS=linux,ARCH=x86,WS=gtk,NL=zh_CNFrameworkarguments:-produ
- selenium+pytest:Web自动化测试用例及conftest文件(五)
Monica_ll
Seleniumselenium前端自动化
文章目录前言一、测试页面二、conftest配置文件总结前言提示:以下是本篇文章正文内容,下面案例可供参考一、测试页面测试页面均继承OperationPageFunction类,在页面上的步骤抽象成方法从而实现自动化操作importlogging.configfromcongfig.pub.FilePathimportLOG_PATH_CONfrombase.OperationPageElemen
- windows下源码安装golang
616050468
golang安装golang环境windows
系统: 64位win7, 开发环境:sublime text 2, go版本: 1.4.1
1. 安装前准备(gcc, gdb, git)
golang在64位系
- redis批量删除带空格的key
bylijinnan
redis
redis批量删除的通常做法:
redis-cli keys "blacklist*" | xargs redis-cli del
上面的命令在key的前后没有空格时是可以的,但有空格就不行了:
$redis-cli keys "blacklist*"
1) "blacklist:12:
[email protected]
- oracle正则表达式的用法
0624chenhong
oracle正则表达式
方括号表达示
方括号表达式
描述
[[:alnum:]]
字母和数字混合的字符
[[:alpha:]]
字母字符
[[:cntrl:]]
控制字符
[[:digit:]]
数字字符
[[:graph:]]
图像字符
[[:lower:]]
小写字母字符
[[:print:]]
打印字符
[[:punct:]]
标点符号字符
[[:space:]]
- 2048源码(核心算法有,缺少几个anctionbar,以后补上)
不懂事的小屁孩
2048
2048游戏基本上有四部分组成,
1:主activity,包含游戏块的16个方格,上面统计分数的模块
2:底下的gridview,监听上下左右的滑动,进行事件处理,
3:每一个卡片,里面的内容很简单,只有一个text,记录显示的数字
4:Actionbar,是游戏用重新开始,设置等功能(这个在底下可以下载的代码里面还没有实现)
写代码的流程
1:设计游戏的布局,基本是两块,上面是分
- jquery内部链式调用机理
换个号韩国红果果
JavaScriptjquery
只需要在调用该对象合适(比如下列的setStyles)的方法后让该方法返回该对象(通过this 因为一旦一个函数称为一个对象方法的话那么在这个方法内部this(结合下面的setStyles)指向这个对象)
function create(type){
var element=document.createElement(type);
//this=element;
- 你订酒店时的每一次点击 背后都是NoSQL和云计算
蓝儿唯美
NoSQL
全球最大的在线旅游公司Expedia旗下的酒店预订公司,它运营着89个网站,跨越68个国家,三年前开始实验公有云,以求让客户在预订网站上查询假期酒店时得到更快的信息获取体验。
云端本身是用于驱动网站的部分小功能的,如搜索框的自动推荐功能,还能保证处理Hotels.com服务的季节性需求高峰整体储能。
Hotels.com的首席技术官Thierry Bedos上个月在伦敦参加“2015 Clou
- java笔记1
a-john
java
1,面向对象程序设计(Object-oriented Propramming,OOP):java就是一种面向对象程序设计。
2,对象:我们将问题空间中的元素及其在解空间中的表示称为“对象”。简单来说,对象是某个类型的实例。比如狗是一个类型,哈士奇可以是狗的一个实例,也就是对象。
3,面向对象程序设计方式的特性:
3.1 万物皆为对象。
- C语言 sizeof和strlen之间的那些事 C/C++软件开发求职面试题 必备考点(一)
aijuans
C/C++求职面试必备考点
找工作在即,以后决定每天至少写一个知识点,主要是记录,逼迫自己动手、总结加深印象。当然如果能有一言半语让他人收益,后学幸运之至也。如有错误,还希望大家帮忙指出来。感激不尽。
后学保证每个写出来的结果都是自己在电脑上亲自跑过的,咱人笨,以前学的也半吊子。很多时候只能靠运行出来的结果再反过来
- 程序员写代码时就不要管需求了吗?
asia007
程序员不能一味跟需求走
编程也有2年了,刚开始不懂的什么都跟需求走,需求是怎样就用代码实现就行,也不管这个需求是否合理,是否为较好的用户体验。当然刚开始编程都会这样,但是如果有了2年以上的工作经验的程序员只知道一味写代码,而不在写的过程中思考一下这个需求是否合理,那么,我想这个程序员就只能一辈写敲敲代码了。
我的技术不是很好,但是就不代
- Activity的四种启动模式
百合不是茶
android栈模式启动Activity的标准模式启动栈顶模式启动单例模式启动
android界面的操作就是很多个activity之间的切换,启动模式决定启动的activity的生命周期 ;
启动模式xml中配置
<activity android:name=".MainActivity" android:launchMode="standard&quo
- Spring中@Autowired标签与@Resource标签的区别
bijian1013
javaspring@Resource@Autowired@Qualifier
Spring不但支持自己定义的@Autowired注解,还支持由JSR-250规范定义的几个注解,如:@Resource、 @PostConstruct及@PreDestroy。
1. @Autowired @Autowired是Spring 提供的,需导入 Package:org.springframewo
- Changes Between SOAP 1.1 and SOAP 1.2
sunjing
ChangesEnableSOAP 1.1SOAP 1.2
JAX-WS
SOAP Version 1.2 Part 0: Primer (Second Edition)
SOAP Version 1.2 Part 1: Messaging Framework (Second Edition)
SOAP Version 1.2 Part 2: Adjuncts (Second Edition)
Which style of WSDL
- 【Hadoop二】Hadoop常用命令
bit1129
hadoop
以Hadoop运行Hadoop自带的wordcount为例,
hadoop脚本位于/home/hadoop/hadoop-2.5.2/bin/hadoop,需要说明的是,这些命令的使用必须在Hadoop已经运行的情况下才能执行
Hadoop HDFS相关命令
hadoop fs -ls
列出HDFS文件系统的第一级文件和第一级
- java异常处理(初级)
白糖_
javaDAOspring虚拟机Ajax
从学习到现在从事java开发一年多了,个人觉得对java只了解皮毛,很多东西都是用到再去慢慢学习,编程真的是一项艺术,要完成一段好的代码,需要懂得很多。
最近项目经理让我负责一个组件开发,框架都由自己搭建,最让我头疼的是异常处理,我看了一些网上的源码,发现他们对异常的处理不是很重视,研究了很久都没有找到很好的解决方案。后来有幸看到一个200W美元的项目部分源码,通过他们对异常处理的解决方案,我终
- 记录整理-工作问题
braveCS
工作
1)那位同学还是CSV文件默认Excel打开看不到全部结果。以为是没写进去。同学甲说文件应该不分大小。后来log一下原来是有写进去。只是Excel有行数限制。那位同学进步好快啊。
2)今天同学说写文件的时候提示jvm的内存溢出。我马上反应说那就改一下jvm的内存大小。同学说改用分批处理了。果然想问题还是有局限性。改jvm内存大小只能暂时地解决问题,以后要是写更大的文件还是得改内存。想问题要长远啊
- org.apache.tools.zip实现文件的压缩和解压,支持中文
bylijinnan
apache
刚开始用java.util.Zip,发现不支持中文(网上有修改的方法,但比较麻烦)
后改用org.apache.tools.zip
org.apache.tools.zip的使用网上有更简单的例子
下面的程序根据实际需求,实现了压缩指定目录下指定文件的方法
import java.io.BufferedReader;
import java.io.BufferedWrit
- 读书笔记-4
chengxuyuancsdn
读书笔记
1、JSTL 核心标签库标签
2、避免SQL注入
3、字符串逆转方法
4、字符串比较compareTo
5、字符串替换replace
6、分拆字符串
1、JSTL 核心标签库标签共有13个,
学习资料:http://www.cnblogs.com/lihuiyy/archive/2012/02/24/2366806.html
功能上分为4类:
(1)表达式控制标签:out
- [物理与电子]半导体教材的一个小问题
comsci
问题
各种模拟电子和数字电子教材中都有这个词汇-空穴
书中对这个词汇的解释是; 当电子脱离共价键的束缚成为自由电子之后,共价键中就留下一个空位,这个空位叫做空穴
我现在回过头翻大学时候的教材,觉得这个
- Flashback Database --闪回数据库
daizj
oracle闪回数据库
Flashback 技术是以Undo segment中的内容为基础的, 因此受限于UNDO_RETENTON参数。要使用flashback 的特性,必须启用自动撤销管理表空间。
在Oracle 10g中, Flash back家族分为以下成员: Flashback Database, Flashback Drop,Flashback Query(分Flashback Query,Flashbac
- 简单排序:插入排序
dieslrae
插入排序
public void insertSort(int[] array){
int temp;
for(int i=1;i<array.length;i++){
temp = array[i];
for(int k=i-1;k>=0;k--)
- C语言学习六指针小示例、一维数组名含义,定义一个函数输出数组的内容
dcj3sjt126com
c
# include <stdio.h>
int main(void)
{
int * p; //等价于 int *p 也等价于 int* p;
int i = 5;
char ch = 'A';
//p = 5; //error
//p = &ch; //error
//p = ch; //error
p = &i; //
- centos下php redis扩展的安装配置3种方法
dcj3sjt126com
redis
方法一
1.下载php redis扩展包 代码如下 复制代码
#wget http://redis.googlecode.com/files/redis-2.4.4.tar.gz
2 tar -zxvf 解压压缩包,cd /扩展包 (进入扩展包然后 运行phpize 一下是我环境中phpize的目录,/usr/local/php/bin/phpize (一定要
- 线程池(Executors)
shuizhaosi888
线程池
在java类库中,任务执行的主要抽象不是Thread,而是Executor,将任务的提交过程和执行过程解耦
public interface Executor {
void execute(Runnable command);
}
public class RunMain implements Executor{
@Override
pub
- openstack 快速安装笔记
haoningabc
openstack
前提是要配置好yum源
版本icehouse,操作系统redhat6.5
最简化安装,不要cinder和swift
三个节点
172 control节点keystone glance horizon
173 compute节点nova
173 network节点neutron
control
/etc/sysctl.conf
net.ipv4.ip_forward =
- 从c面向对象的实现理解c++的对象(二)
jimmee
C++面向对象虚函数
1. 类就可以看作一个struct,类的方法,可以理解为通过函数指针的方式实现的,类对象分配内存时,只分配成员变量的,函数指针并不需要分配额外的内存保存地址。
2. c++中类的构造函数,就是进行内存分配(malloc),调用构造函数
3. c++中类的析构函数,就时回收内存(free)
4. c++是基于栈和全局数据分配内存的,如果是一个方法内创建的对象,就直接在栈上分配内存了。
专门在
- 如何让那个一个div可以拖动
lingfeng520240
html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml
- 第10章 高级事件(中)
onestopweb
事件
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/
- 计算两个经纬度之间的距离
roadrunners
计算纬度LBS经度距离
要解决这个问题的时候,到网上查了很多方案,最后计算出来的都与百度计算出来的有出入。下面这个公式计算出来的距离和百度计算出来的距离是一致的。
/**
*
* @param longitudeA
* 经度A点
* @param latitudeA
* 纬度A点
* @param longitudeB
*
- 最具争议的10个Java话题
tomcat_oracle
java
1、Java8已经到来。什么!? Java8 支持lambda。哇哦,RIP Scala! 随着Java8 的发布,出现很多关于新发布的Java8是否有潜力干掉Scala的争论,最终的结论是远远没有那么简单。Java8可能已经在Scala的lambda的包围中突围,但Java并非是函数式编程王位的真正觊觎者。
2、Java 9 即将到来
Oracle早在8月份就发布
- zoj 3826 Hierarchical Notation(模拟)
阿尔萨斯
rar
题目链接:zoj 3826 Hierarchical Notation
题目大意:给定一些结构体,结构体有value值和key值,Q次询问,输出每个key值对应的value值。
解题思路:思路很简单,写个类词法的递归函数,每次将key值映射成一个hash值,用map映射每个key的value起始终止位置,预处理完了查询就很简单了。 这题是最后10分钟出的,因为没有考虑value为{}的情