上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: 今天在运维那里学习了下如何删除mysql一个日志大表数据(2000w+) 基本流程: 创建同结构空表暂停写表业务交换表名 如何交换表名?假设存在表t1,t1_new,不存在t_tmp rename table t1 to t_tmp,t1_new to t1,t_tmp to t1_new; 删除原 阅读全文
posted @ 2022-05-11 11:33 cnlovefish 阅读(76) 评论(0) 推荐(0)
摘要: <?php namespace Demo; use Think\core; class Hello{ } echo '<pre>'; print_r(get_declared_classes()); /** array( [0]=> stdClass ... [143] => Redis [144] 阅读全文
posted @ 2022-04-22 18:47 cnlovefish 阅读(184) 评论(0) 推荐(0)
摘要: <?php # 字符串转16进制 $string = "LockDataV"; $arr1 = str_split($string, 1); foreach ($arr1 as $akey => $aval) { $arr1[$akey] = "\x" . bin2hex($aval); } ech 阅读全文
posted @ 2022-04-19 18:05 cnlovefish 阅读(664) 评论(0) 推荐(0)
摘要: 参考https://www.cnblogs.com/cute/p/9186208.html 命名分组命名分组就是给具有默认分组编号的组另外再给一个别名。命名分组的语法格式如下: (?P<name>正则表达式)#name是一个合法的标识符 如:提取字符串中的ip地址 import re s = "ip 阅读全文
posted @ 2022-04-01 19:48 cnlovefish 阅读(218) 评论(0) 推荐(0)
摘要: function getobjallmethods($obj) { $class = new ReflectionClass($obj); foreach ($class->getMethods() as $key => $methodType) { if ($methodType->isPriva 阅读全文
posted @ 2022-03-28 16:03 cnlovefish 阅读(73) 评论(0) 推荐(0)
摘要: 比如:git stash show -p stash@{1}是查看倒数第二最近stash的变化。 git stash show -p stash@{10}是查看倒数第十一最近stash的变化 阅读全文
posted @ 2022-03-07 14:57 cnlovefish 阅读(1336) 评论(0) 推荐(0)
摘要: # 一个去除字典列表的重复元素的方法list_users = [{'a': 1}, {'b': 2}, {'a': 1}] list_users = [dict(t) for t in set([tuple(d.items()) for d in list_users])] # 结果: [{'b': 阅读全文
posted @ 2022-03-02 20:10 cnlovefish 阅读(327) 评论(0) 推荐(0)
摘要: php、python、golang这三种语言的异同点 1 默认空值:python里的None等价于php里的null,在 Go 中,任何类型在未初始化时都对应一个零值:布尔类型是 false ,整型是 0 ,字符串是 "" ,而指针,函数,interface,slice,channel和map的零值 阅读全文
posted @ 2021-12-04 16:40 cnlovefish 阅读(562) 评论(0) 推荐(0)
摘要: import random from random import shuffle from biplist import * import plistlib def random_dic(dicts): dict_key_ls = list(dicts.keys()) random.shuffle( 阅读全文
posted @ 2021-11-10 20:52 cnlovefish 阅读(667) 评论(0) 推荐(0)
摘要: import copy ''' 直接赋值:其实就是对象的引用(别名)。 copy 模块的 copy 方法,拷贝父对象,不会拷贝对象的内部的子对象。 copy 模块的 deepcopy 方法,完全拷贝了父对象及其子对象。 ''' origin = [1, 2, [3, 4]] cop1 = copy. 阅读全文
posted @ 2021-11-03 14:32 cnlovefish 阅读(201) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页