• 2024-10-01python 包含有引号和花括号的字符串的格式化
    replace不起作用;update_per_seconds="30"uploadtime_per_seconds="30"imei_string="1234"###采用{0}format不行###下面replace不行msg="""{"rmtcmd":"set","dev":{"poll":{&
  • 2024-09-23为何生成静态页的时候或者上传附件过程中有报错:Maximum execution time of 30 seconds exceeded
    错误信息 Maximumexecutiontimeof30secondsexceeded 表明PHP脚本的执行时间超过了服务器设定的最大执行时间限制。这通常发生在生成静态页面或上传大文件等耗时较长的操作中。解决方案方法一:修改 php.ini 文件找到 php.ini 文件:通常 php.ini 文件位于服务
  • 2024-09-19Maximum execution time of 30 seconds exceeded
    遇到 Maximumexecutiontimeof30secondsexceeded 这个错误,通常是因为PHP脚本执行时间超过了设定的最大执行时间限制。这可能是由于脚本执行了耗时的操作,例如长时间的数据库查询或其他资源密集型任务。以下是一些解决步骤:1.增加最大执行时间限制可以在PHP配置文件(ph
  • 2024-09-18go 使用pprof 进行问题排查
    1.main代码中添加pprof引用(前提是web应用比如kartos这里服务起来的端口为8000)_"net/http/pprof"默认init里面有添加2.使用curl下载profile文件通过命令生产profile文件,方便从生产环境中导出profile文件/debug/pprof/profile?seconds=30curl-oprofil
  • 2024-09-16三、redis之strings类型
    strings是redis中使用最多的类型。redis官网中是这么描述strings的:Redisstringsstoresequencesofbytes,includingtext,serializedobjects,andbinaryarrays.可以看到Redisstrings保存的是sequencesofbytes,也就是字节序列。不仅可以保存字符串,而且还可以保存二
  • 2024-09-14Managed Debugging Assistant 'ContextSwitchDeadlock' : 'The CLR has been unable to tra
    ManagedDebuggingAssistant'ContextSwitchDeadlock':'TheCLRhasbeenunabletotransitionfromCOMcontext0x28ab560toCOMcontext0x28ab4a8for60seconds.Thethreadthatownsthedestinationcontext/apartmentismostlikelyeitherdo
  • 2024-09-11一文理解协程----还不明白请来砍我
    说在前头:本文话糙理不糙,用大白话说明协程的核心思想,协程,指的是单个线程里执行多个并发任务,一个协程对应一个任务,重点来了,!!!协程是用户空间的概念,也就是说不管你一个线程里有多少个协程,在操作系统看来,你就是一个单线程,只要你有一处代码阻塞了,那么os就会挂起整个线程,所以说这多
  • 2024-09-04异步任务组合神器CompletableFuture
    使用Demoimportjava.util.concurrent.*;importjava.util.concurrent.atomic.AtomicInteger;publicclassCompletableFutureDemo{privatestaticAtomicIntegercount=newAtomicInteger(2);publicstaticvoidmain(String[]args)throwsInterrupte
  • 2024-09-01Linux实时查看GPU (NVIDIA),CPU及内存使用情况
    GPU方法一:需要用到一个工具gpustatpipinstallgpustat#安装工具gpustat-cp#输出当前状态gpustat-cp-i1#持续监视方法二:使用nvidia-smi命令nvidia-smi-lsecondsnvidia-smi--loop=seconds上述两个命令都可以,要把seconds换成你想刷新的时间间隔。按
  • 2024-08-22Prometheus Micrometer jvm告警模版
    基础说明prometheus界面刚开始看起来非常让人疑惑,实际上它的语法非常强大;prometheus既可以读取即使数据(Table),也可以展示趋势图(Graph);Uselocaltime:选择是否已当前时间展示趋势图查询结构筛选内置命令{筛选条件1,筛选条件2}时间周期内总和(increase(内置命令[5m]))固定
  • 2024-08-08Swift asyns 封装思路
    Aynscs.swiftpublictypealiasTask=()->VoidpublicstructAynscs{//异步publicstaticfuncasyns(task:@escapingTask){_asyns(task:task)}//异步完成->同步publicstaticfuncasyns(task:@escapingTask,ma
  • 2024-07-23为何生成静态页的时候或者上传附件过程中有报错:Maximum execution time of 30 seconds exceeded
    错误记录:为何生成静态页的时候或者上传附件过程中有报错:Maximumexecutiontimeof30secondsexceeded 解决方案:由于上传或者生成静态页的时候执行时间太久,超过服务器超时时间限制所致:请到服务器里面PHP配置修改下超时时间即可解决(修改后需重启服务或者服务器)具体方法为:
  • 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); //可以使字作串为两位整数的值,不足位数前面补零