Posted in  杂七杂八 

前言

想要实现一个功能:类似在路由器的界面中配置参数数据。


下位机操作系统是linux,http服务的方案选的是轻量级的boa+cgi。很后悔选这个方案,低估了学习c语言的难度,遇到了不少坑。如果选nginx+.net应该会快很多。



操作流程大致如下:

Read more →
Posted in  杂七杂八 

一、CRC分析

1.1 数据校验

  数据在传输过程(比如通过网线在两台计算机间传文件)中,由于传输信道的原因,可能会有误码现象(比如说发送数字5但接收方收到的却是6),如何发现误码呢?方法是发送额外的数据让接收方校验是否正确,这就是数据校验。

  最容易想到的校验方法是和校验,就是将传送的数据(按字节方式)加起来计算出数据的总和,并将总和传给接收方,接收方收到数据后也计算总和,并与收到的总和比较看是否相同。如果传输中出现误码,那么总和一般不会相同,从而知道有误码产生,可以让发送方再发送一遍数据。

Read more →
Posted in  杂七杂八 

公司一个项目用到了阿里云的短信验证码,语言是php。sms sdk需要用composer安装,但是不同php版本的sdk是不通用的。目前项目是部署在测试机,正式服务器的运行环境(操作系统、php版本)不确定。所以迁移起来比较麻烦,也可能忘记下载sdk。

Read more →
Posted in  杂七杂八 

Here is a working solution:

//  main.js
    ipcMain.on('open-file',(event,data)=>{
        dialog.showOpenDialog(null, data).then(filePaths => {
            event.sender.send('open-file-paths', filePaths);
        });
    });

//  pager.js (render)
    ipcRenderer.send('open-file',{
        title: 'Title',
        defaultPath: localStorage.getItem('defaultPath')
    });
    ipcRenderer.on('open-file-paths',(event,data)=>{
        console.log(`Canceled? ${data.canceled}`);
        console.log(`File Paths: ${data.filePaths.join(';')`);
    });

From: https://stackoverflow.com/questions/70331707/how-do-i-use-showopendialog-withe-electron-s-ipc

Posted in  杂七杂八 

团队任务管理系统泳道图

打算用2个月晚上的空闲时间(21:00-23:30)做一个上面泳道图所示流程的任务管理系统,不带客户管理、不带审批流程、不带订单管理,只是单纯的任务管理。

Read more →
Posted in  杂七杂八 

直播服务普遍采用了RTMP作为流媒体协议,FLV作为封装格式,H.264作为视频编码格式,AAC作为音频编码格式。FLV是RTMP使用的封装格式,H.264是当今实际应用中编码效率最高的视频编码标准,AAC则是当今实际应用中编码效率最高的音频编码标准。

RTSP无法直接在web端播放,需要转成RTMP。用到的摄像头为海康威视球形摄像头,型号DS-IPC-T11-1:

Read more →
Posted in  杂七杂八 

新增的忽略文件没有生效,是因为git是有缓存的,而之前的文件在缓存中,并不会清除掉,还会继续提交,所以更新.gitignore文件,要清除缓存文件

git rm -r --cached .
git add .
git commit -m 'update .gitignore'
Posted in  杂七杂八 

报错信息:

Error: Failure while executing; 'git clone https://github.com/Homebrew/homebrew-cask /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask' exited with 128.

替换homebrew源

cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

替换homebrew-core源

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

brew update

如果还没解决,参考:https://blog.csdn.net/DuXiaoYu1111/article/details/114663146

Posted in  杂七杂八 

Microsoft Visual C++ 14.0 is required

Python安装支持库的过程中经常会遇到“Microsoft Visual C++ 14.0 is required”或者“unable to find vcvarsall.bat”的问题,安装vc++ 运行库无效,此时就需要安装Visual C++ build tools生成工具,下载链接。但该安装包为在线安装包,安装过程需要连接网络下载完整安装包,在没有网络连接的环境下无法使用。

Read more →
Posted in  杂七杂八 

Want to delete Microsoft AutoUpdate from a Mac? Perhaps you uninstalled Microsoft Office or some other Microsoft applications from the Mac and thus have no further need for Microsoft applications to automatically update themselves. In any case, you can remove the Microsoft AutoUpdate application from Mac OS.

Read more →