# 引用正则来三等分字符串 import re # 转换成二进制数 bi = "{0:b}".format(18223104) # 补齐32位 bi = "0"*(32-len(bi))+bi # 8个一组算出每8个数字的十进制,然后再加“,”分隔 ret_ip_string = '.'.join( ...
分类:
编程语言 时间:
2020-05-22 00:08:03
阅读次数:
107
@GetMapping @ResponseBodypublic Object findAll(@RequestParam(value = "page", required = false, defaultValue = "0") Integer page, @RequestParam(value = ...
分类:
其他好文 时间:
2020-05-16 16:37:11
阅读次数:
90
Mybatis 多表查询之一对多 本次案例主要以最为简单的用户和账户的模型来分析Mybatis多表关系。用户为User 表,账户为Account 表。一个用户(User)可以有多个账户(Account)。具体关 一对一查询(多对一) 需求 : 查询所有账户信息,关联查询下单用户信息。 注意: 因为一 ...
分类:
其他好文 时间:
2020-05-11 14:54:40
阅读次数:
72
匹配多个条件:re.findall(r'sellerId=\d{5,20}|tpId\":\"\d{5,20}|tp_id=\d{5,20}', response) 匹配单个条件:re.findall(r'shop_id\":\"(\d*)', response) 这里需要注意两点:1、匹配单个条件 ...
分类:
编程语言 时间:
2020-05-11 13:28:21
阅读次数:
467
关于re模块中search()、match()、findall()的区别 首先看search()跟match()的区别 import re a = 'python Python CDpython CDPython' re1 = re.search(r'(p|P)ython',a) print(re1 ...
分类:
其他好文 时间:
2020-05-11 13:27:07
阅读次数:
50
使用Spring Data ElasticSearch+Jsoup操作集群数据存储 1、使用Jsoup爬取京东商城的商品数据 1)获取商品名称、价格以及商品地址,并封装为一个Product对象,代码截图: 2)创建Product实体类,完成对索引、类型、映射以及文档的配置,代码截图: 3)将爬取到的 ...
分类:
编程语言 时间:
2020-05-04 23:06:28
阅读次数:
113
步骤 1 : 可运行项目 基于 "Restful 风格的 springboot" 进行修改。 毕竟 Restful 风格的 springboot 直接转换为 json,很方便的啦 首先下载一个简单的可运行项目作为演示: "网盘链接" :https://newryan.lanzous.com/ic3z ...
分类:
编程语言 时间:
2020-05-02 11:41:48
阅读次数:
58
s = pd.Series(['Tom', 'William Rick', 'John', 'Alber@t', np.nan, '1234','SteveMinsu']) s.str#不能对series对象使用str处理函数,必须转换成pandas.core.strings.StringMetho ...
分类:
其他好文 时间:
2020-05-01 11:07:00
阅读次数:
86
render: 界面跳转(url不变)、向网页输出数据(接口都用这个) render 之后,程序会继续执行,但是 后面不能使用 redirect 、respond 例如: def test() { def json = new JSON(School.findAll().first()) json. ...
分类:
其他好文 时间:
2020-04-28 16:54:32
阅读次数:
68
# dict1 = {}# import json,re# res = re.findall('\n(.*?)\n',str1)# for i in res:# aaa = i.split(':')# print(aaa)# if len(aaa) ==2 :# dict1[aaa[0].strip ...
分类:
编程语言 时间:
2020-04-27 22:59:15
阅读次数:
121