Hanjie's Blog

一只有理想的羊驼

首先安装支持库1

1
npm install hexo-diagram --save

可能会出现问题:

1
npm WARN deprecated phantom@0.7.2: v1 is no longer maintained, please upgrade to v2.0+ as soon possible.

导致运行时出现问题:

1
2
3
4
5
hexo s
Hexo Diagram Filter
{ diagramFolder: '/Users/luohanjie/Documents/Dropbox/Blogs/source/diagrams' }
Generate: [flow]Robotics/SCARA型机械臂工作区域边界计算方法-diagram-0.png
phantomjs-node: You don't have 'phantomjs' installed

解决方向: 安装最新版phantomjs

1
npm install phantomjs -g

但是运行时可能会出网络问题:

1
phantom stdout: NETWORK_ERR: XMLHttpRequest Exception 101: A network error occurred in synchronous requests.

可以通过关闭web-security解决2。将node_modules/hexo-diagram/generators/factory/phantom.js部分代码修改为:

1
2
3
4
options = { 'web-security': 'no' };

return function (type, code, output, callback) {
phantom.create({parameters: options}, function (ph) {

问题解决。


  1. https://www.npmjs.com/package/hexo-diagram↩︎

  2. https://github.com/amir20/phantomjs-node/issues/345↩︎

在使用apt-get安装shadowsocks-qt5时1,由于源的版本太老,很多新的协议都不支持。为了支持新的协议,需要自己编译。本文主要参考了这篇文章2

  • 系统:Ubuntu 16.04.4 LTS
  • 内核:4.13.0-36-generic

编译Botan2.3.0

1
2
3
4
5
6
7
wget https://botan.randombit.net/releases/Botan-2.3.0.tgz
tar xvf Botan-2.3.0.tgz
cd Botan-2.3.0
./configure.py
make -j4
sudo make install
sudo ldconfig

编译libqtshadowsocks3

Dependencies
  • Qt >= 5.5
  • Botan-2 >= 2.3.0
  • Or Botan-1.10 (Not recommended)
  • CMake >= 3.1
  • A C++ Compiler that supports C++14 features (i.e. GCC >= 4.9)
Building
1
2
3
4
5
6
git clone https://github.com/shadowsocks/libQtShadowsocks
cd libQtShadowsocks
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j8
sudo make install

编译shadowsocks-qt54

Dependencies
  • cmake >= 3.1.0
  • qt5-qtbase-gui >= 5.2 (qtbase5 in Debian/Ubuntu)
  • qrencode (libqrencode in Debian/Ubuntu)
  • libQtShadowsocks >= 1.10.0 (libqtshadowsocks in Debian/Ubuntu. DON'T use the trunk code)
  • zbar (libzbar0 or libzbar in Debian/Ubuntu)
  • libappindicator (libappindicator1 in Debian/Ubuntu)
Building
1
2
3
4
5
6
7
8
sudo apt-get install cmake qtbase5-dev libqrencode-dev libzbar0 libappindicator1 libzbar-dev

git clone https://github.com/shadowsocks/shadowsocks-qt5
cd shadowsocks-qt5
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make -j8
sudo make install

然后就可以在Ubuntu下找到编译好的shadowsocks-qt5了。

ubuntu_shadowsocket

  1. http://luohanjie.com/2017-06-07/using-shadowsocks-qt5-to-implement-global-proxy-under-ubuntu.html↩︎

  2. https://www.shangyexin.com/2018/04/20/shadowsocks-qt5↩︎

  3. https://github.com/shadowsocks/libQtShadowsocks/wiki/Compiling↩︎

  4. https://github.com/shadowsocks/shadowsocks-qt5/wiki↩︎

cuda

Slide

References:

并行编程入门: https://cn.udacity.com/course/intro-to-parallel-programming–cs344

CUDA代码优化-张也冬: https://www.bilibili.com/video/av6060299/

CUDA C Programming Guide: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html

CUDA C Best Practices Guide: http://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html

0%