kk Blog —— 通用基础


date [-d @int|str] [+%s|"+%F %T"]
netstat -ltunp
sar -n DEV 1

Ubuntu安装vulkan

https://blog.csdn.net/luolinll1212/article/details/113261022

安装

2.1 方式一

1
2
3
sudo apt-get install cmake git gcc g++ mesa-* libwayland-dev libxrandr-dev
sudo apt-get install libvulkan1 mesa-vulkan-drivers vulkan-utils
vulkaninfo

2.2 方式二 (推荐)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
sudo apt-get install cmake git gcc g++ mesa-* libwayland-dev libxrandr-dev 
sudo apt-get install libvulkan1 mesa-vulkan-drivers vulkan-utils libxcb-keysyms1-dev
sudo apt-get install libxcb1-dev libx11-dev
wget https://sdk.lunarg.com/sdk/download/1.2.162.1/linux/vulkansdk-linux-x86_64-1.2.162.1.tar.gz
mkdir vulkan 
mv vulkansdk-linux-x86_64-1.2.162.1.tar.gz vulkan
cd vulkan
tar xf vulkansdk-linux-x86_64-1.2.162.1.tar.gz
# 下载github
cd 1.2.162.1/source/shaderc
python update_shaderc_sources.py 
# 编译
cd 1.2.162.1
bash vulkansdk  # 编译vulkan
source setup-env.sh # vulkan -> 系统环境变量
./x86_64/bin/vulkaninfo

2.3 方式三

1
2
3
4
5
6
7
git clone https://github.com/SaschaWillems/Vulkan.git
git submodule sync
git submodule update --init --recursive
mkdir build
cd build
cmake ..
make

使用jSignature.js实现电子签名

https://blog.csdn.net/weixin_45740068/article/details/129163913

https://www.mianshigee.com/project/brinley-jSignature/

https://www.erlangyun.com/p?id=164








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

  <script src="/javascripts/jquery.min.js"></script>
  <script src="/javascripts/jSignature.min.js"></script>

  <div class="container">
      <div id="signatureparent">
          <!--画布-->
          <div id="signature"></div>
      </div>
      <br>
      <div class="footer-btn">
          <button type="button" class="btn btn-default btn-block" id="clear">清除</button>
          <button type="button" class="btn btn-primary btn-block" id="save">预览</button>
      </div>
  </div>

  <br><br>
  <!--预览-->
  <div class="autograph">
      <img src="" href="img" style='background:white;' />
  </div>
  <br><br>

  <style type='text/css'>
  .whitee {
      background-color: 'red';
  }
  </style>

  <script>
      var param= {
          'background-color': 'aliceblue',
          width: '80%',   //签名区域的宽
          height: '50%',  //签名区域的高
          cssclass: 'whitee', //画布的类 可以写自定义的样式
          UndoButton:false,   //撤销按钮的状态 这个按钮的样式修改要去jSignature.js文件中去找
          signatureLine: false,   //去除默认画布上那条横线
          lineWidth: '2'  //画笔的大小
      };
      $("#signature").jSignature(param); //初始化、可设置画板参数

      //清除
      $('#clear').click(function () {
          $("#signature").jSignature("reset");
          $("[href=img]")[0].src = ''
      });

      //保存 
      $('#save').click(function () {
          // 判断是否签名
          if ( $("#signature").jSignature('getData', 'native').length === 0) {
              return alert("请先进行签名");
          }

          // 将签名的画布保存为base64编码字符串 默认是png的
          var datapair = $("#signature").jSignature("getData", "image");
          var i = new Image();
          i.src = "data:" + datapair[0] + "," + datapair[1];
          $("[href=img]")[0].src = i.src
      })
  </script>

SQL中case的使用方法

https://blog.csdn.net/m0_53222768/article/details/120101414

1
2
3
4
5
6
7
8
9
10
11
SELECT CASE WHEN salary <= 500 THEN '1'
	WHEN salary > 500 AND salary <= 600  THEN '2'
	WHEN salary > 600 AND salary <= 800  THEN '3'
	WHEN salary > 800 AND salary <= 1000 THEN '4'
ELSE NULL END
salary_class,  COUNT(*)  FROM    Table_A
GROUP BY CASE WHEN salary <= 500 THEN '1'
	WHEN salary > 500 AND salary <= 600  THEN '2'
	WHEN salary > 600 AND salary <= 800  THEN '3'
	WHEN salary > 800 AND salary <= 1000 THEN '4'
ELSE NULL END;