• 2024-07-03testptp
    TestthePTPPhysicalHardwareClockfunctionalityusingthe"phc_ctl"(apartof"linuxptp").Thetestcontainsthreesub-tests:*"settime"test*"adjtime"test*"adjfreq"test"settime&qu
  • 2024-07-01嵌入式Linux系统编程 — 5.5 sleep、usleep和nanosleep系统休眠函数
    目录1为什么需要休眠2 sleep、usleep和nanosleep函数2.1sleep函数2.2 usleep函数2.3 nanosleep函数3示例程序1为什么需要休眠有时需要将进程暂停或休眠一段时间,进入休眠状态之后,程序将暂停运行,直到休眠结束。以下是一些常见的休眠场景和作用:避免过载:在高
  • 2024-06-23Python实现语音转文字功能
    importosimportrequestsimporturllibimportcalendarimporttimeimportdatetimefrommoviepy.editorimportAudioFileClipfrompydubimportAudioSegmentfromaipimportAipSpeechclassDouYin:def__init__(self):self._headers={
  • 2024-06-18C++数据格式化3 - 格式化时间区间(使用时长)
    1.关键词2.strfmt.h3.strfmt.cpp4.测试代码5.运行结果6.源码地址1.关键词关键字:C++数据格式化字符串处理std::string时间区间跨平台应用场景:想对一个时间区间(如用时:2000s)进行格式化,转化成人类易读的时分秒的格式。2.strfmt.h#pragmaonce#include
  • 2024-05-26时间戳与yyyy-mm-dd hh:mm:ss格式之间的互相转换
    将时间戳转化为yyyy-mm-ddhh:mm:ssfunctionbackTime(value){//value必须是一个毫秒级的时间戳哈;//如果出现的不是一个毫秒级的时间戳,将会出现转化为1970开始letdate=newDate(value);//获取年份、月份和日期letyear=date.getFullYear();//
  • 2024-05-21CATALYST 9800 CONFIG RECOMM
    Letmeupdatethisthreadwithsomenotesfrommylatestinvestigationswithclientdisconnections(Windows).TheproblemfromaWLANengineer'sperspectiveisthatnormallythispartisnottakenintoaccount,asitisontheWinTelteamsideandit
  • 2024-05-20flutter 定时器
    Timer?_timer;varperiodicTime="".obs;initTimer({requiredintcreateTime,requiredintduration})async{_timer=Timer.periodic(constDuration(seconds:1),(timer)async{DateTimecurrentTime=DateTime.now();varnow=(currentT
  • 2024-05-16python计算时间
       importtimeimportdatetimedefcompare_time(startTime,endTime):#now=datetime.datetime.now()d_start=datetime.datetime.strptime(startTime,'%Y-%m-%d%H:%M:%S')d_end=datetime.datetime.strptime(endTime,'%Y-%m-%
  • 2024-04-20python从时间上裁切视频(定义一个开始截取的时间,最后截取时间是总时长+1秒)
    代码:importsubprocessfromdatetimeimporttimedeltadefparse_time(time_str):"""将时间字符串解析为秒"""#如果输入是浮点数,直接返回这个数值ifisinstance(time_str,float):returntime_str#将时间字符串分割为小时、分钟和秒hour
  • 2024-04-11MySQL binlog超过binlog_expire_logs_seconds阈值没有删除案例
    生产环境有一套3个节点的MySQLInnoDBCluster,MySQL的版本为Serverversion:8.0.35MySQLCommunityServer-GPL,早上突然收到Zabbix的告警,其中一个节点出现空间告警:"/data:Diskspaceislow(used>80%)"检查分析后发现是因为MySQL的binlog没有清理导致空间报警,如下所示(b
  • 2024-04-07Database Timeout
    1.遇到的错误Microsoft.EntityFrameworkCore.DbUpdateException:Anerroroccurredwhileupdatingtheentries.Seetheinnerexceptionfordetails.--->Microsoft.Data.SqlClient.SqlException(0x80131904):ExecutionTimeoutExpired.Thetimeoutperiodelapse
  • 2024-04-02MySQL主从同步延迟Seconds_Behind_Master很大
    1.mysql> showslavestatus\G  查看延迟6天多,也是很神奇了2.查看 Master_Log_File和Relay_Master_Log_File对比,可以说明中继日志差100多位置,所有定位是中继日志问题 3.查看中继日志文件,密密麻麻的relay-bin文件 4.查看优化配置mysql>showvariableslike'%
  • 2024-03-29unity 数字格式化
    stringstrNeed=string.Format("{0}{1}",str1,str2); //可以拼接成各种字符串stringstrNeed=string.Format("{0:F2}",2.3634f);//可以使字符串为保留两位小数的浮点数值stringstrNeed=string.Format("{0:D2}",5); //可以使字作串为两位整数的值,不足位数前面补零
  • 2024-03-22将秒转换成天时分秒格式
    deftimestamp_difference_to_dhms(timestamp1,timestamp2):#将时间戳转换为datetime对象##13位时间戳会报错iflen(str(timestamp1))==13:timestamp1=timestamp1/1000iflen(str(timestamp2))==13:timestamp2=timestamp2
  • 2024-03-21插件-js实现动态时钟效果
    <divid="updatetime"></div>constupdateTime=()=>{varnow=newDate();varyear=now.getFullYear();varmonth=now.getMonth()+1;//getMonth()返回0-11varday=now.getDate();varhours=now.getHour
  • 2024-03-11Prometheus四种指标及PromQL实例
    Prometheus四种主要的指标类型包括Counter、Gauge、Histogram和Summary,以及相应的PromQL实例如下:Counter(计数器)作用:只增不减的计数器,常用于记录请求次数、任务完成数、错误发生次数等。重启进程后,计数会被重置。PromQL实例:假设我们有一个HTTP请求次数的Counter类型指标http_
  • 2024-02-28racial traits in wow classic
    humanDiplomacy—Gaina10%bonustoanyfactionpointgains.MaceSpecialization—Increasesyourskillwithone-handandtwo-handMacesby5.Perception—Thisincreasesstealthdetectionfor20seconds,withacooldownof3minutes.SwordSpecializati
  • 2024-02-27关于输出的一些测试
    各种输出方式的比较代码1:#include<bits/stdc++.h>#definerep(i,a,b)for(inti=a;i<=b;++i)usingnamespacestd;signedmain(){ freopen("1.out","w",stdout); rep(i,1,2000000)printf("%d\n",i); return0;}开O2运行时间:3.379secon
  • 2024-02-27A DATETIME or TIMESTAMP value can include a trailing fractional seconds part in up to microseconds (
    MySQL::MySQL8.0ReferenceManual::13.2.2TheDATE,DATETIME,andTIMESTAMPTypeshttps://dev.mysql.com/doc/refman/8.0/en/datetime.html13.2.2 TheDATE,DATETIME,andTIMESTAMPTypesThe DATE, DATETIME,and TIMESTAMP typesarerelated.Thisse
  • 2024-02-24几种线程池特点
    普通线程池发生异常,会自动创建新的线程填补异常毁掉的线程ScheduledExecutorService按照固定频率、按照固定延迟发生异常,就会waiting住,导致无法继续执行,所以需要catch异常,不能抛出异常按照固定频率执行,如果任务执行时间超过频率时间,那么会连续执行,而按照固定延迟执行,无论执行多
  • 2024-02-20fastDFS:优化参数配置,让dfs集群更灵敏
    【storage.conf】配置文件#connecttimeoutinseconds#defaultvalueis30#Note:intheintranetnetwork(LAN),2secondsisenough.connect_timeout=2#networktimeoutinsecondsforsendandrecv#defaultvalueis30network_timeout=60#theheartbeati
  • 2024-02-18python 倒计时功能
    importtime#导入时间模块deftimer(seconds):start_time=time.time()#获取当前时间end_time=start_time+seconds#当前时间+要倒数的秒数whiletime.time()<end_time:#当前时间小于结束时间执行remaining_time=int(end_time-time.time())#转
  • 2024-01-3112.分组并发压测实战
    1.压测计划制定压测策略不同的并发数10,50,100,200,……持续时间30s记录结果测试期望结果验证能够支撑多大并发数,峰值数验证错误率,定义可接受范围,<=0.1%or<=0.5%ormust=0%2.压测策略通过对比并发数与流量还有错误率的关系,找到一个最合理的系统可支撑最
  • 2024-01-23mysqlslap压测
    mysqlslap是MySQL自带的压测工具:time./mysqlslap--no-defaults-usa-pcc.123-P18601--create-schema=test-S/tmp/mysql_sandbox18601.sock--number-of-queries=1000000--concurrency=10--query="select*fromtbwherea='1';" 上面: mysqlslap压测
  • 2024-01-22使用promise实现延迟与回调。以及为什么使用promise实现延迟
    简单延迟几秒functiondelay(seconds){returnnewPromise(resolve=>setTimeout(resolve,seconds*1000));}//使用这个函数来延迟1秒delay(1).then(()=>{console.log('1秒已经过去了!');});简化版functiondelay(seconds){returnnewP