摘要: Node-API 稳定性: 2 - 稳定 Node-API,以前叫 N-API,用于构建本机插件 Node-API 独立于 JS Runtime(如V8),并作为Node.js的一部分进行维护 Node-API 在 Node.js 将来的各个版本中都提供稳定的应用程序二进制接口(ABI,Applic 阅读全文
posted @ 2021-08-13 10:58 汪淼焱 阅读(763) 评论(0) 推荐(0)
摘要: # Node.js下常用的测试框架mocha、should和一些基本测试方法 ## 概念 1.单元测试 2.集成测试 3.系统测试 4.性能测试 5.benchmarking 6.行为驱动开发(BDD) ## 框架流程 1.测试框架Mocha 2.断言库should.js 3.Web测试库super 阅读全文
posted @ 2021-04-28 16:37 汪淼焱 阅读(84) 评论(0) 推荐(0)
摘要: 以node为例,需要建立/usr/bin下的软连接 sudo ln -s /home/data/node-v6.2.2-linux-x64/bin/node /usr/bin/node 阅读全文
posted @ 2021-04-26 19:36 汪淼焱 阅读(83) 评论(0) 推荐(0)
摘要: XOR,exclusive OR。 exclusive,专有的,更单纯的OR运算。 运算定律: 一个值与自身的运算,总为0,x^x=0 一个值与0的运算,总是等于其本身,x^0=x 可交换性,xy=yx 结合性,x^(yz)=(xy)^z 简化计算:abcab=c 交换值:x=xy,y=xy,x=x 阅读全文
posted @ 2021-04-25 10:10 汪淼焱 阅读(138) 评论(0) 推荐(0)
摘要: #include<iostream> #include<climits> #include<map> using namespace std; int main() { typedef string t_s; typedef long long int t_i; typedef map<t_s, t 阅读全文
posted @ 2021-04-15 19:56 汪淼焱 阅读(45) 评论(0) 推荐(0)
摘要: 目前收纳: apt镜像源 npm镜像源 Ubuntu apt更换镜像源 APT源定义文件地址:/etc/apt/source.list 先备份,再编辑,养成好习惯。 以下脚本可直接执行 14.04 sudo cp /etc/apt/sources.list /etc/apt/sources.list 阅读全文
posted @ 2021-03-12 15:20 汪淼焱 阅读(615) 评论(0) 推荐(1)
摘要: 原理:修改electron.AppImage中的许可证管理器.js的代码 工具准备: 打包工具 appimagetool-x86_64.AppImage 压缩工具 asar 目标软件 StarUML.AppImage $ wget https://github.com/AppImage/AppIma 阅读全文
posted @ 2021-03-03 12:08 汪淼焱 阅读(1180) 评论(0) 推荐(0)
摘要: appimage自身支持直接压缩和解压 --appimage-extract extracts the contents from the embedded filesystem image, then exits. This is useful if you are using an AppIma 阅读全文
posted @ 2021-02-25 11:54 汪淼焱 阅读(8131) 评论(0) 推荐(3)
摘要: 从默认仓库中安装的话将带给你的是旧版本 Thunderbird。 如果要安装最新版本的 Mozilla Thunderbird,可以使用 Mozilla 团队维护的 PPA。 $ sudo add-apt-repository ppa:ubuntu-mozilla-security/ppa $ su 阅读全文
posted @ 2021-02-25 11:43 汪淼焱 阅读(324) 评论(0) 推荐(0)
摘要: .desktop 文件基本上就是一个包含程序信息的纯文本文件,通常根据是自己可见还是所有用户可见的不同而放在 ~/.local/share/applications 或者 /usr/share/applications/ 目录中。 [Desktop Entry] Name=firefox-56 Ge 阅读全文
posted @ 2021-02-25 11:28 汪淼焱 阅读(259) 评论(0) 推荐(1)
摘要: 动态旋转与平滑恢复 需求:使用CSS+JavaScript实现以下Web效果: 三个DOM元素:一张图片,两个按钮 点击开始按钮,使图片开始不停旋转(rotate0 → rotate360) 点击停止按钮,图片停止旋转,并平滑恢复到初始状态 小结: 抽象了函数 getMatrixFromDegree 阅读全文
posted @ 2021-02-01 13:46 汪淼焱 阅读(155) 评论(0) 推荐(0)
摘要: # 在浏览器端如何进行文件签名的计算 现在有这样一个需求:我们需要对一个任意文件在浏览器端进行一个签名的计算,以供后一步的比对校验使用。 要求:签名算法包括但不限于MD5、SHA-1、SHA-256、SHA-384、SHA-512等算法。 经验:因为之前有简单调研过 [Web Cryptograph 阅读全文
posted @ 2021-01-21 16:13 汪淼焱 阅读(1350) 评论(0) 推荐(0)
摘要: 为了库升级方便,举例:有个so库叫libfoo.so.1,某客户程序使用该库,在连接生成二进制文件的客户程序时,正规做法是建立一个libfoo.so.1文件的符号链接,名字通常会叫做libfoo.so,于是客户程序的连接参数应该写成-lfoo,连接生成二进制文件后我们使用ldd命令可以看到客户程序依 阅读全文
posted @ 2021-01-08 15:38 汪淼焱 阅读(358) 评论(0) 推荐(0)
摘要: test.sh #!/bin/bash while((1));do echo `date '+%Y-%m-%d %H:%M:%S'` sleep 1 done 后台运行脚本 执行脚本 ./test.sh,中断脚本 ctrl + c, 切到后台并暂停 ctrl + z 后台暂停的脚本状态是 stopp 阅读全文
posted @ 2021-01-07 10:42 汪淼焱 阅读(407) 评论(0) 推荐(0)
摘要: 控制字符:0-31、127 00-20、7F 可显示字符:32-126 21-7E 关键点: 0 0x30 48 A 0x41 65 a 0x41 + 0x20 = 0x61 97 ! 0X21 33 @ 0x40 64 ` 0x60 96 其他: 0x20-0x2F: space,!,",#,$, 阅读全文
posted @ 2021-01-05 10:48 汪淼焱 阅读(1263) 评论(0) 推荐(0)
摘要: Phone 6s新增的Live Photos,可以拍摄1.5秒钟的动画“图片”,背后的原理: 一个iPhone的产品经理透露,利用6s的Live Photos功能储存的,并不是视频,只是基于JPEG的动画文件。 一般JPEG只有图不能做动画,但Live Photo使用的,是一段像GIF档的**Mot 阅读全文
posted @ 2021-01-04 14:54 汪淼焱 阅读(2220) 评论(0) 推荐(0)
摘要: FAAS概念,无服务器运算,功能即服务,function-as-a-service 初创企业~大型企业、民间组织~政府机构 >>>> 上云 云计算第三代技术 -- Serverless,2020年,元年,1ms的计费粒度 企业人员关注业务,云系统配置、运维交给云服务商 云计算有计算、存储、网络、数据 阅读全文
posted @ 2021-01-04 13:55 汪淼焱 阅读(173) 评论(0) 推荐(0)
摘要: const wasmCode = new Uint8Array([ 0, 97, 115, 109, 1, 0, 0, 0, 1, 133, 128, 128, 128, 0, 1, 96, 0, 1, 127, 3, 130, 128, 128, 128, 0, 1, 0, 4, 132, 128 阅读全文
posted @ 2021-01-04 11:16 汪淼焱 阅读(170) 评论(0) 推荐(0)
摘要: 不得以 sudo 模式修改文件、编译源码 README为所有人(开发、用户)必读文件,要能读懂、篇幅也需控制 Makefile 为项目到手必读文件,对主要构建步骤必须清楚 阅读全文
posted @ 2020-12-30 16:58 汪淼焱 阅读(86) 评论(0) 推荐(0)
摘要: 查找机器内字体 fc-list | grep uming HTML内显示字体字形:在innerHTML内编辑文本 '&#x[码点]', 如 &#x26fa:&#x26fa JS打印:console.log(String.fromCodePoint([码点])); CSS: content: "🍔" 阅读全文
posted @ 2020-12-30 15:56 汪淼焱 阅读(70) 评论(0) 推荐(0)
摘要: 以指定大小分割 split -b 100M [文件] [分割文件名头] 以行数分割 split -l 100 [文件] [分割文件名头] 合并 cat [分割文件名头*] > [文件] 阅读全文
posted @ 2020-12-30 11:38 汪淼焱 阅读(145) 评论(0) 推荐(0)
摘要: Git Flow工作流程 master主分支 伴随整个项目周期的分支 功能分支(feature branch) 从master切,顾名思义,开发每一个功能的分支,开发完的功能合并到release分支。 补丁分支(hotfix branch) 从master切,修复BUG分支,测试完直接合并到mast 阅读全文
posted @ 2020-12-21 14:24 汪淼焱 阅读(133) 评论(0) 推荐(0)
摘要: # 从苹果BigSur官网学点东西 ## Awsome配色 ![](https://img2020.cnblogs.com/blog/812656/202012/812656-20201219222930158-515860369.png) 这个 `蓝紫渐变大底` + 简洁的 `矩形状字块` + ` 阅读全文
posted @ 2020-12-19 22:32 汪淼焱 阅读(309) 评论(0) 推荐(1)
摘要: 解决方案 : 禁用git 自动 status命令 git config --add oh-my-zsh.hide-status 1 阅读全文
posted @ 2020-12-15 15:20 汪淼焱 阅读(476) 评论(0) 推荐(0)
摘要: 问题:调用动态库报 cannot open shared object file: No such file or directory 解决: ldd xxx查看依赖缺失 修改共享库配置文件 /etc/ld.so.conf 2.1 添加 include /etc/ld.so.conf.d/*.con 阅读全文
posted @ 2020-12-15 15:16 汪淼焱 阅读(240) 评论(0) 推荐(0)
摘要: 如何使用GCC生成动态库和静态库 根据链接时期的不同,库又有静态库和动态库之分。静态库是在链接阶段被链接的,所以生成的可执行文件就不受库的影响,即使库被删除,程序依然可以成功运行。而动态库是在程序执行的时候被链接的。程序执行完,库仍需保留在系统上,以供程序运行时调用。链接静态库从某种意义上来说是一种 阅读全文
posted @ 2020-12-12 17:32 汪淼焱 阅读(280) 评论(0) 推荐(0)
摘要: # Code Portability and Limitations 代码的可移植性和限制 Emscripten can be used to compile almost any portable C/C++ code to JavaScript. The topics in this secti 阅读全文
posted @ 2020-12-11 11:43 汪淼焱 阅读(474) 评论(0) 推荐(0)
摘要: # API Limitations API限制 The browser environment and JavaScript are different from the native environments that C and C++ typically run in. These diffe 阅读全文
posted @ 2020-12-11 11:42 汪淼焱 阅读(993) 评论(0) 推荐(0)
摘要: # Function Pointer Issues 函数指针问题 There are two main issues with function pointers: 函数指针存在两个主要问题: 1. Function pointer casts can cause function pointer 阅读全文
posted @ 2020-12-11 11:40 汪淼焱 阅读(886) 评论(0) 推荐(0)
摘要: # Portability Guidelines 可移植性准则 Emscripten can be used to compile almost any portable C++/C code to JavaScript. Emscripten可用于将几乎所有可移植的C++/C代码编译为JavaSc 阅读全文
posted @ 2020-12-11 11:39 汪淼焱 阅读(592) 评论(0) 推荐(0)
摘要: C++静态库与动态库 分类 编程技术 这次分享的宗旨是——让大家学会创建与使用静态库、动态库,知道静态库与动态库的区别,知道使用的时候如何选择。这里不深入介绍静态库、动态库的底层格式,内存布局等,有兴趣的同学,推荐一本书《程序员的自我修养——链接、装载与库》。 1.什么是库 库是写好的现有的,成熟的 阅读全文
posted @ 2020-12-04 14:29 汪淼焱 阅读(297) 评论(0) 推荐(0)
摘要: 运行arm文件xxx,报错 /lib/ld-linux-armhf.so.3: No such file or directory 安装 libc6-armhf-cross, sudo apt-get install libc6-armhf-cross, 成功后会有目录 /usr/arm-linux 阅读全文
posted @ 2020-12-04 10:33 汪淼焱 阅读(4866) 评论(0) 推荐(1)
摘要: 字节序,或字节顺序("Endian"、"endianness" 或 "byte-order"),描述了计算机如何组织字节,组成对应的数字。 每个内存存储位置都有一个索引或地址。每一 字节可以存储一个8位数字(即 介于0x00 和 0xff 之间),因此,你必须保留不止一个字节来储存一个更大的数字。现 阅读全文
posted @ 2020-12-03 01:47 汪淼焱 阅读(207) 评论(0) 推荐(0)
摘要: 来源:https://web.archive.org/web/20120229023146/http://m.alistapart.com/articles/readspec/ September 28, 2001 How to Read W3C Specs by J. David Eisenber 阅读全文
posted @ 2020-12-02 11:29 汪淼焱 阅读(212) 评论(0) 推荐(0)
摘要: 使用wget下载豆瓣一张电影海报原图,结果: $ wget https://img3.doubanio.com/view/photo/raw/public/p2177841410.jpg --2020-11-06 09:26:21-- https://img3.doubanio.com/view/p 阅读全文
posted @ 2020-11-06 09:31 汪淼焱 阅读(327) 评论(0) 推荐(0)
摘要: 仿照gaia-gzip的结构进行分析: gzip | gzip.js # gzip主线程引入部分 | gzip_worker.js # worker工作者线程 | gzip.min.js # gzip的js版本库 内容: gzip.js /* exported Gzip */ 'use strict 阅读全文
posted @ 2020-11-02 09:25 汪淼焱 阅读(556) 评论(0) 推荐(0)
摘要: ## docker环境配置 1. 更正时区时间 ```sh # 查看当前时间 $ date # 修改当前时间 $ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime echo 'Asia/Shanghai' > /etc/timezone ``` 阅读全文
posted @ 2020-05-24 20:57 汪淼焱 阅读(866) 评论(1) 推荐(0)
摘要: # Docker编译B2G源码 B2G OS构建指南(MDN官网): https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/B2G_OS_build_prerequisites 推荐使用Ubuntu 14.04 LTS,故以此版本为基础来进行 阅读全文
posted @ 2020-05-22 19:52 汪淼焱 阅读(332) 评论(0) 推荐(0)
摘要: 1. 查看所有镜像 ```sh $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE local v1.0 f9a2256f9bd5 4 weeks ago 1.11GB hello-world latest bf756fb1ae65 4 mont 阅读全文
posted @ 2020-05-22 19:43 汪淼焱 阅读(345) 评论(0) 推荐(0)
摘要: 问题:由于安装了错误的fastboot导致fastboot刷机时无法正常工作 debian源安装应选择android tools adb 和 android tools fastboot 不能直接装 fastboot 阅读全文
posted @ 2020-05-12 11:16 汪淼焱 阅读(626) 评论(0) 推荐(0)