postman设置collection全局token

平时在postman调试接口多,如果过了一段时间后,token会失效,每个请求需要更换token,挺麻烦的,我们可以根据在postman配置collection下的全局token;
具体如下
1、打开Postman并创建一个新的Collection。
Collection
2、在Collection的”Authorization”选项卡中选择适当的授权方式(例如Bearer Token或OAuth 2.0)。
3、在”Token”字段中,使用双大括号({{}})将Token包裹起来,形成一个环境变量。例如:{{token}}。
token
4、点击右上角的“眼睛”按钮,以便在请求中查看环境变量的值。
环境变量
5、现在,您需要在Postman的环境中设置Token的值。在Postman左上角的”Manage Environments”(管理环境)按钮旁边,点击下拉菜单按钮,并选择”Add”(添加)。
6、输入环境名称,例如”Token Environment”,然后点击”Add”(添加)。
Add
7、在环境变量列表中,添加一个新的变量,键为”token”,值为您的Token值。
Add
8、点击”Save”(保存)以保存环境变量。
9、注意检查请求中Authorization是否为inherit auth from parent
inherit auth from parent

time is start, time is end, time is nothing

time can be done,
we come from mote,
burn, burn, burn,
come to the end,
ash,
air,
element,
from order to chaos,
hard to return origin,
sadness,
tears,
flow freely,
I am you,
you are me,
one day,
we will be together,
smile,
warm,
time is so long,
swear it,
Believe it,
accept it.
–ZhongYuan(MidYear) James.

记postgresql无法启动案例(could not flush dirty data: 结构需要清理)

1、问题:

could not flush dirty data

2、解释:

“结构需要清理”(structure needs cleaning)错误通常是由文件系统损坏引起的。

以下是一些可能导致文件系统损坏的原因:
不正常关机:如果你在文件系统写入数据时强制关机或系统崩溃,可能会导致文件系统损坏。
磁盘故障:磁盘故障,如坏道或故障扇区,可能会导致文件系统损坏。
硬件故障:硬件故障,如电源问题、主板故障等,可能会导致文件系统损坏。
病毒感染:某些病毒可能会破坏文件系统,导致文件系统损坏。
文件系统错误:如果文件系统本身出现错误,例如写入错误的分区表或分配表,也可能会导致文件系统损坏。

以上是导致文件系统损坏的一些可能原因。为了防止这种情况的发生,你可以遵循以下最佳实践:
正常关机:在关机之前,请确保保存并关闭所有打开的文件,并使用操作系统提供的关机选项正常关机。
定期备份:定期备份重要数据可以最大限度地减少数据丢失的风险。
使用稳定的硬件:使用质量可靠的硬件,并避免频繁更换或升级硬件,可以减少硬件故障的风险。
定期检查磁盘:定期检查磁盘的状态,并在检测到故障时立即更换磁盘,可以避免磁盘故障导致文件系统损坏。
使用防病毒软件:安装和使用防病毒软件可以防止病毒感染并保护文件系统的安全。

3、解决方式:

在/etc/postgresql/12/main/postgresql.conf 中最后追加:

1
2
fsync = off
data_sync_retry = true

野河·野鱼·野猫·wanderMan

wander_cat
盛夏无蝉鸣
芦苇摇他的叶子
野鸭匆忙于水草上
躁动的白条
一条条钩起过往
芦苇荡穿行而来花猫
悄无声息依偎桶边
蓝天烈日伞下依然焦灼
猫归野后或许学了流浪狗的习性
疯狂吞吐着红红的舌头散热
鼓鼓的肚子恰如河里的鱼带籽
这世间繁衍的节律
不断让时间继续推演
白条上来后
花猫嘤嘤几声对着叫
融化了这个夏天
遂递给她
囫囵两口就风卷残云
半晌午廿条进其肚
心满意足悄然离去
人猫都在回味
下一次
她还会来吗
是我焦急在等
等她带着一窝小猫蹒跚而来

hexo blog github ssh

1、生成新的pub

1
ssh-keygen -t rsa -C "your_email@example.com" -f ~/.ssh/id_rsa_github

2、打开ssh-agent

1
eval $(ssh-agent -s)

3、添加id_rsa_github

1
ssh-add ~/.ssh/id_rsa_github

4、粘贴id_rsa_github.pub中的内容至github ssh
5、增加config文件

1
touch ~/.ssh/config

6、添加以下内容

GitHub

1
2
3
4
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github

WebGL中的纹理

WebGL通过一种称作纹理单元(texture unit)的机制来同时使用多个纹理。每个纹理单元有一个单元编号来管理一张纹理图像。即使你的程序只需要一张纹理图像,也得为其指定一个纹理单元。系统支持的纹理单元个数取决于硬件和浏览器的WebGL实现,但是在默认情况下,web GL至少支持8个纹理单元,一些其他的系统支持的个数更多。内置的变量gl.TEXTURE0、gl.TEXTURE1、gl.TEXTURE2。。。。gl.TEXTURE7各表示一个纹理单元。

js的事件循环

这个是个人理解的总结,不同人可能都有自己独到的理解方式。

说到事件循环,我们一般闪现到一个滚滚向前的车轮
微任务、宏任务、执行栈
宏任务包括整个脚本scripts,ajax,rendering,setTimeout(),setInterval(),setImmediate(),
微任务包括我们常常写到的promise.then,process.nextTick(),async下的await等
首先进入执行栈的如console.log(),立即执行,
然后开始微任务,遵循先进先出原则执行逻辑;
本轮微任务全部执行完毕后,开始执行宏任务,同样遵循先进先出原则执行逻辑

顶点着色器与片元着色器通信

通常我们在顶点着色器中声明一个attribute变量a_Color用以接受颜色,然后再用varying(只能是float以及vec2,vec3,vec4,mat2,mat3和mat4)声明变量v_Color,该变量负责将颜色值传给着色器,

1
2
attribute vec4 a_Color;
varying vec4 v_Color;

那么片元着色器如何接收到这个变量呢,很简单,同样声明一个

1
varying vec4 v_Color;

这是因为在WebGL中,如果顶点着色器和片元着色器同时有类型和命名相同的varying变量,那么顶点着色器会自动地将该变量的值传入片元着色器。
varying变量传递

Cesium中的矩阵变换

上一篇学习了WebGL中的矩阵变换变换矩阵(Transformation-matrix)详解,我们推演出旋转、平移、缩放矩阵,并通过代码实现。而在Cesium中于此类似,并且提供了Cesium.Matrix2、Cesium.Matrix3、Cesium.Matrix4类及其属性方法。
这里,我们以Cesium.Matrix4为例
Cesium.Matrix4

正常情况下,我们可以通过tileset.root.transform获取模型本身的模型矩阵,这个即存在3DTile中的tileset.json文件中
tileset.json

那么在Cesium中具体如何操作使用变换矩阵呢?
以调整模型位置为例

一、Cesium中的平移

有两种调整方式
(1)矩阵点乘法

1
2
3
4
5
6
let modelMatrix = tileset.root.transform;
let modelPosition = Cesium.Cartesian3.fromDegrees(lon, lat, height);
const translationMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(6, 1, 8));
// 模型矩阵乘以平移矩阵 MxT
Cesium.Matrix4.multiply(modelMatrix, translationMatrix, modelMatrix);
tileset.root.transform = modelMatrix;

(2)直接设置

1
2
3
4
let modelMatrix = tileset.root.transform;
let modelPosition = Cesium.Cartesian3.fromDegrees(lon, lat, height);
Cesium.Matrix4.setTranslation(modelMatrix, modelPostion, modelMatrix);
tileset.root.transform = modelMatrix;

二、Cesium中的旋转

1
2
3
4
5
6
7
8
9
10
11
12
13
let modelMatrix = tileset.root.transform;
const preHRP={heading:0, roll:0, pitch:0};
const currentHRP = {heading:30, roll:10, pitch:-30};
let gapHRP = Ccesium.HeadingPitchRoll.fromDegrees(
currentHRP.heading - preHRP.heading,
currentHRP.pitch - preHRP.pitch,
currentHRP.roll - preHRP.roll
)
let rotateMatrix = Cesium.Matrix3.fromHeadingPitchRoll(gapHRP);
// 模型矩阵乘以旋转矩阵 MxR
Cesium.Matrix4.multiplyByMatrix3(modelMatrix, rotateMatrix, modelMatrix);
tileset.root.transform = modelMatrix;
preHRP = Cesium.clone(currentHRP, true);

三、Cesium中的缩放

1
2
3
4
const scale = 1.1;
let modelMatrix = tileset.root.transform;
Cesium.Matrix4.multiplyByUniformScale(modelMatrix, scale, modelMatrix);
tileset.root.transform = modelMatrix;

四、综述

Cesium中的平移缩放旋转MxTxSxR涉及到的矩阵变换如下;

1
2
3
4
5
6
// 平移
Cesium.Matrix4.multiply();
// 缩放
Cesium.Matrix4.multiplyByUniformScale();
// 旋转
Cesium.Matrix4.multiplyByMatrix3();