会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小葱饼子
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2023年5月
tool_watch_file
摘要: import os import shutil import time watched_path = '/data/tmp/' #watched_path = '/tmp/' target_dir = '/tmp/guyu/' watched_file = 'index-d-' watched_fi
阅读全文
posted @ 2023-05-30 15:50 小葱饼子
阅读(12)
评论(0)
推荐(0)
2022年3月
COMMON_FUNC_SPLIT_STRING
摘要: void SplitString(const std::string& s, std::vector<std::string>& v, const std::string& c) { std::string::size_type pos1, pos2; pos2 = s.find(c); pos1
阅读全文
posted @ 2022-03-31 10:09 小葱饼子
阅读(33)
评论(0)
推荐(0)
杂:pthread_cond_timedwait导致死锁
摘要: 地球人都知道1:pthread_cond_timedwait使用时,需要对【条件】加锁。【条件】也是一种线程共享资源。 地球人都知道2:1个互斥锁不应该管理2类及以上的多线程共享资源 1+2=下面这样应该会导致死锁, pthread_mutex_lock(mutex) Queue.pp() pthr
阅读全文
posted @ 2022-03-29 17:21 小葱饼子
阅读(522)
评论(0)
推荐(0)
makefile
摘要: https://blog.csdn.net/weixin_38391755/article/details/80380786 基本语法:1,目标文件:顶格冒号前面,代号$@ 2,依赖文件:冒号后面,代号$<(第一个依赖) $^(全部依赖)等等 3,命令:一个Tab后面,像 gcc -o target
阅读全文
posted @ 2022-03-18 19:18 小葱饼子
阅读(21)
评论(0)
推荐(0)
book
摘要: C++17 https://changkun.de/modern-cpp/ Rust https://kaisery.github.io/trpl-zh-cn/title-page.html
阅读全文
posted @ 2022-03-09 16:32 小葱饼子
阅读(14)
评论(0)
推荐(0)
2022年2月
pj_time_swap
摘要: #!/usr/bin/python# -*- coding: UTF-8 -*- import timeimport refrom datetime import datetime, timezone, timedeltaimport pytz date_time = r'([0-9]{4})[/-
阅读全文
posted @ 2022-02-18 16:33 小葱饼子
阅读(33)
评论(0)
推荐(0)
excel_tip
摘要: 两列比较,行不同的选中。Ctrl+G
阅读全文
posted @ 2022-02-09 15:15 小葱饼子
阅读(23)
评论(0)
推荐(0)
update_base_x.txt
摘要: update g_temp.test_baseset field_date = '20210101'::datewhere field_int = 6
阅读全文
posted @ 2022-02-08 16:26 小葱饼子
阅读(14)
评论(0)
推荐(0)
insert_base_x.txt
摘要: insert into g_temp.test_basevalues('20220202'::date, 1, 'apple'),('20220203'::date, 5, 'banana'),('20220204'::date, 1, 'apple'),('20220205'::date, 5,
阅读全文
posted @ 2022-02-08 16:25 小葱饼子
阅读(25)
评论(0)
推荐(0)
syntax_lead_x.txt
摘要: select lead( t1.field_date-1, 1, null ) over(partition by t1.field_str order by t1.field_str),*from g_temp.test_base t1 -- 分组排序后,lead取组内的下1个(中间那个参数表示下
阅读全文
posted @ 2022-02-08 16:25 小葱饼子
阅读(33)
评论(0)
推荐(0)
create_base_x.txt
摘要: create table g_temp.test_base( field_date date, field_str varchar(100) , field_int integer ) drop table g_temp.test_base
阅读全文
posted @ 2022-02-08 16:24 小葱饼子
阅读(29)
评论(0)
推荐(0)
SQL_TIP_JOIN_x
摘要: 没有条件的JOIN会导致数据数量变为两表的数据量的乘积结果。 用ON来在这些结果里进行筛选 on T1.A = T2.A的时候,如果T1的A是不重复的,则实际上是在对T2现有数据做筛选,结果数据量<T2
阅读全文
posted @ 2022-02-08 11:12 小葱饼子
阅读(29)
评论(0)
推荐(0)
2022年1月
杂:python_windows标准输出带颜色
摘要: import ctypes handle = ctypes.windll.kernel32.GetStdHandle(-11) # -11 for output -10 for input -12 for error ctypes.windll.kernel32.SetConsoleTextAttr
阅读全文
posted @ 2022-01-30 13:18 小葱饼子
阅读(57)
评论(0)
推荐(0)
lib_0001_file_manager.py
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- import os import pathlib import shutil import sys class file_manager(): cls_working_folder = 'c:\\' @classme
阅读全文
posted @ 2022-01-25 17:19 小葱饼子
阅读(35)
评论(0)
推荐(0)
vba_pj_0001_auto_date
摘要: Const init_info As String = "InitInfo"Const end_row_op As Integer = 100 'tmpConst end_row_holiday As Integer = 100 'tmpConst sheet_name_op As String =
阅读全文
posted @ 2022-01-23 23:43 小葱饼子
阅读(66)
评论(0)
推荐(0)
class_man
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- class Man(): def __init__(self, name="", good_at=[]): self._name = name self._good_at = good_at def _test():
阅读全文
posted @ 2022-01-21 17:47 小葱饼子
阅读(54)
评论(0)
推荐(0)
class_schedule
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- class Schedule(object): def __init__(self, name=""): self._name = name def _test(): pass if __name__ == '__m
阅读全文
posted @ 2022-01-21 17:47 小葱饼子
阅读(62)
评论(0)
推荐(0)
class_task
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- class Task(): _cls_name = "cls name" def __init__(self, name='', cost=0, pre_task=None, task_list=[] ): self
阅读全文
posted @ 2022-01-21 17:40 小葱饼子
阅读(33)
评论(0)
推荐(0)
pj_0002_wbs_manager
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- import env_config from class_task import Task from lib.lib_x_0002_decorator_log_funcname import decorator_lo
阅读全文
posted @ 2022-01-21 17:28 小葱饼子
阅读(27)
评论(0)
推荐(0)
env_config
摘要: import sys import os root_path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) + '\\' data_path = root_path + 'data\\'
阅读全文
posted @ 2022-01-21 16:42 小葱饼子
阅读(103)
评论(0)
推荐(0)
pj_0004_time_swap
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- import time def _get_strftime_( t ): return time.strftime("%Y%m%d %H:%M:%S", time.localtime(t)) def _get_mkt
阅读全文
posted @ 2022-01-21 13:48 小葱饼子
阅读(51)
评论(0)
推荐(0)
pj_0001_compare_col_csv
摘要: #!/usr/bin/python# -*- coding: UTF-8 -*- import pathlibimport pandas as pd print("please input the 1stfile to compare")csv_from = input() print("pleas
阅读全文
posted @ 2022-01-14 15:57 小葱饼子
阅读(50)
评论(0)
推荐(0)
python_test_5001_Moudle_pandas
摘要: import pandas as pd import numpy as np from lib_001_decorator_log_funcname import decorator_log_funcname from env_config import * csv_a = data_path +
阅读全文
posted @ 2022-01-12 17:31 小葱饼子
阅读(34)
评论(0)
推荐(0)
python_lib_x_1000_file_csv.py
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- from lib_config import * from lib.lib_x_0002_decorator_log_funcname import decorator_log_funcname import pan
阅读全文
posted @ 2022-01-11 17:49 小葱饼子
阅读(36)
评论(0)
推荐(0)
python_test_0001_base_string_swap
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- import time from lib_001_decorator_log_funcname import decorator_log_funcname d1 = 10 + 2 s1 = "456" @decora
阅读全文
posted @ 2022-01-10 15:07 小葱饼子
阅读(23)
评论(0)
推荐(0)
python_lib_0001_decorator_print_log
摘要: def decorator_log_funcname( func ): def wrapper(*arg, **kw): print("") print("-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-") print( "run",
阅读全文
posted @ 2022-01-10 15:05 小葱饼子
阅读(26)
评论(0)
推荐(0)
python_test_0001_base_string
摘要: #!/usr/bin/python # -*- coding: UTF-8 -*- from lib_001_decorator_log_funcname import decorator_log_funcname s1 = 'hello s1' s2 = "hello s2" s3 = ''' g
阅读全文
posted @ 2022-01-10 15:04 小葱饼子
阅读(34)
评论(0)
推荐(0)
杂:使用Shell判断文件换行符(LF/CRLF)
摘要: 前提:文件最后一行有换行符 第一步:以二进制方式取得文件最后两个byte。last2=`tail -c 2 <your_file> | od -x -A n` 第二步:判断最后两个byte是否是'CRLF'if [ $last2 = 0a0d -o $last2 = 0d0a ]then # Che
阅读全文
posted @ 2022-01-04 17:11 小葱饼子
阅读(2270)
评论(0)
推荐(0)
2021年12月
Linux_CMD_FOR_FILE&FOLDER
摘要: 0,删除文件夹和子文件夹:rm -rf /xxx/xxx 0,拷贝整个文件夹:cp -r /xxx/xxx /ddd/ 0,改文件名:mv oldName newName 0,新建文件:touch file 0,新建文件夹:mkdir folder 0,编辑文件:vim file 0,文件保存退出:
阅读全文
posted @ 2021-12-29 13:22 小葱饼子
阅读(81)
评论(0)
推荐(0)
Linux_CMD_FOR_OS_INFO
摘要: 1,系统版本 : lsb_release -a 2,系统信息(86/64): uname -a 3,键盘信息:localectl status 4,系统支持的键盘:localectl list-keymaps | grep -i search_term localectl list-keymaps
阅读全文
posted @ 2021-12-23 17:23 小葱饼子
阅读(70)
评论(0)
推荐(0)
1
2
下一页
公告