↓ 跳过正文
  1. Categories/

工程

2018

linux 下 .o 文件,.a 文件,.so 文件

·198 字·1 分钟
发现我对工程一无所知 QAQ。 参考资料: Library Archives: Static and Dynamic 简单地说,.a 文件是静态库,而 .so 文件是共享对象(动态库),作用类似 Windows 下的 DLL。 .o 文件则相当于 Windows 下的 .obj 文件。编译器通常先把各个源文件编译为目标文件,再将它们链接成最终的可执行文件。

CUDA C Best Practices Guide 阅读笔记(1) 并行计算方法论(APOD)

·759 字·2 分钟
APOD指的是Assess, Parallelize, Optimize, Deploy 如图所示,APOD过程是一个循环的过程,每次只进行一部分,从A到P到O到D,然后再进行下一轮的APOD Assess # 对于一个项目,第一步要做的是接触(Assess)项目,得到项目代码中每部分的执行时间。有了这部分内容,开发者就可以找到并行优化的瓶颈所在,并开始尝试用GPU加速。

cuda error checking 学习笔记

·283 字·1 分钟
由于发现cuda c++ 的 debug方式和c++ 差别很大,因此打算再开一篇,专门记录一些和error checking 以及debug有关的内容. Error checks in CUDA code can help catch CUDA errors at their source. There are 2 sources of errors in CUDA source code:

cuda 学习笔记

·2297 字·5 分钟
update:有毒吧,kernel 中出问题原来不会报错。 请教了组里的 hust 学长 orz.. 学到了 cuda-memcheck 命令和 cudaGetLastError 来查看问题,可以参考What is the canonical way to check for errors using the CUDA runtime API? 先放一波资料。 An Even Easier Introduction to CUDA CUDA C/C++ Basics nvidia-thrust 官方文档 how-access-global-memory-efficiently-cuda-c-kernels efficient-matrix-transpose-cuda-cc 很强大的warp内shuffle cuda-GDB官方文档 cuda-c-best-practices-guide cuda 提出的目的是能够让程序员透明地使用GPU来高效地进行并行运算。

2017

unicode 汉字表示不唯一的问题 (cjk字符集)

·181 字·1 分钟
update: 遇到的汉字: 丹:63838 李:63969 昨天写的正则发现死活识别不了 “年"字… 放到unicode编码转化公式 查了下发现竟然是不同的字orz.. 其实猜想到也许是日文的"年”…结果查询了下发现是韩文的锅?

正则匹配中文及常用正则表达式 (转载)

·1078 字·3 分钟
先放一个同事安利给我的网站:regex101 查询匹配的中文字符unicode编码 正则表达式用于字符串处理、表单验证、日志数据分析等场合,实用高效。现将自己走网上搜索并总结的常用方法收集了一下: 匹配中文字符的正则表达式: [\u4e00-\u9fa5] 注:匹配中文还真是个头疼的事,有了这个表达式就好办了

基础 Haskell 学习笔记

·1463 字·3 分钟
出于对函数式编程语言这一技能点的缺失…以及退役之后闲得蛋疼 打算浅尝辄止地学一下 haskell 这篇笔记不会写成文档那样详尽..毕竟函数式编程语言也是编程语言,有很多和其他编程语言(命令式?)相似的地方。

在wordpress 中输入数学公式

·302 字·1 分钟
查了一些资料。。发现不是要装各种插件(还不一定能用,比如和crayon冲突。。就是讲得很不清楚orz。。 又下一个win下的公式编辑器之类的软件是什么鬼啊? 干脆记录一下必要步骤。只有一步。

MPI 学习笔记

·592 字·2 分钟
参考资料: 消息传递接口(MPI)维基百科 MPI_TUTORIAL MPI 在大规模机器学习领域的前景如何? 因为要和平台组对接工作以及写我们自己的BN同步…所以来了解一下MPI相关…感谢平台组@gyz 菊苣提供指导。

python只获取当前目录下的文件夹及文件名

·237 字·1 分钟
list = os.listdir(rootdir)#列出目录下的所有文件和目录 1for line in list: 2 filepath = os.path.join(rootdir,line) 3 if os.path.isdir(filepath):#如果filepath是目录 4 print "dir:" + filepath 5 else: 6 print "file:" + filepath 如果需要遍历文件夹下的所以文件,可以使用os.walk()方法。

manjaro(archlinux) 安装 YouCompleteMe

·285 字·1 分钟
来来回回折腾了好多次,aur直接安装或者手动编译,安装后都无法补全 ycm的log文件是在/tmp目录下的。 发现问题是缺少libtinfo.so.5 12017-07-28 17:02:12,667 - ERROR - Error occurred while loading global extra conf /home/coder/.ycm_extra_conf.py 2Traceback (most recent call last): 3 File "/home/coder/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 94, in _CallGlobalExtraConfMethod 4 module = Load( global_ycm_extra_conf, force = True ) 5 File "/home/coder/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/extra_conf_store.py", line 173, in Load 6 module = LoadPythonSource( _RandomName(), module_file ) 7 File "/home/coder/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/../ycmd/utils.py", line 400, in LoadPythonSource 8 return imp.load_source( name, pathname ) 9 File "/home/coder/.ycm_extra_conf.py", line 32, in <module> 10 import ycm_core 11ImportError: libtinfo.so.5: cannot open shared object file: No such file or directory 122017-07-28 17:02:12,667 - ERROR - libtinfo.so.5: cannot open shared object file: No such file or directory 13Traceback (most recent call last): 14 File "/home/coder/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/server_utils.py", line 96, in CompatibleWithCurrentCore 15 ycm_core = ImportCore() 16 File "/home/coder/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd/server_utils.py", line 88, in ImportCore 17 import ycm_core as ycm_core 18ImportError: libtinfo.so.5: cannot open shared object file: No such file or directory 解决办法:

python numpy 用法 简明手册

·8276 字·17 分钟
原文链接 感谢stanford,感谢原作者的翻译,我调整了一下代码格式,可以当做手册来用了,毕竟之前没怎么写过py 23333 译者注:本文智能单元首发,翻译自斯坦福CS231n课程笔记Python Numpy Tutorial,由课程教师Andrej Karpathy授权进行翻译。本篇教程由杜客翻译完成,Flood Sung、SunisDown、巩子嘉和一位不愿透露ID的知友对本翻译亦有贡献。

archlinux/manjaro 下 安装 qq/tim

·580 字·2 分钟
参考资料:install qq/tim on linux with wine wine运行qq不能输入账号 This tutorial introduces how to install QQ/TIM in Linux with Wine, which had been tested on ArchLinux with Wine 2.4. Prerequisites # Before start, you need to get the latest Wine. I’m not sure whether QQ/TIM can run on lower version of Wine. In ArchLinux, you can easily get the latest Wine using following command:

libgfortran.so.4 missing under archlinux

·919 字·2 分钟
。。。哭了哦,终于解决了这个 bug 参考资料: libgfortran broken? libgfortran=3.0 should not be install with numpy <= 1.9 [SOLVED] libgfortran.so.3:cannot open shared object file: No such file [Replacing gcc-libs-libs with gcc-multilib arch conflict with gcc-libs and gcc-libs-multilib on latest update 一开始以为是 anaconda 相关,搞了半天。 然后又按照第一个资料里说的,试图把 libgfortran 用 libgcc 替代。

manjaro installation guide

·2918 字·6 分钟
20180214 update: 第一个版本已经比较久了,于是更新一下,顺便写了个脚本orz 1pacman-mirrors -c China 2echo " [archlinuxcn] " >> /etc/pacman.conf 3echo " SigLevel = Optional TrustedOnly " >> /etc/pacman.conf 4echo " Server = https://mirrors.ustc.edu.cn/archlinuxcn/\$arch" >> /etc/pacman.conf 5 6 7echo "[arch4edu]" >> /etc/pacman.conf 8echo "SigLevel = Never" >> /etc/pacman.conf 9echo "Server = http://mirrors.tuna.tsinghua.edu.cn/arch4edu/\$arch " >> /etc/pacman.conf 10pacman -Syyu 11pacman -S archlinuxcn-keyring 12 13pacman -S yakuake fish gvim 14pacman -S google-chrome chromium 15pacman -S wget aria2 remarkable netease-cloud-music 16pacman -S fcitx fcitx-configtool fcitx-sogoupinyin fcitx-im kcm-fcitx 17pacman -S shadowsocks-qt5 18pacman -S wqy-microhei wqy-microhei-lite wqy-bitmapfont wqy-zenhei ttf-arphic-ukai ttf-arphic-uming adobe-source-han-sans-cn-fonts 19 20cat >> ~/.xprofile <<EOF 21export GTK_IM_MODULE=fcitx 22export QT_IM_MODULE=fcitx 23export XMODIFIERS="@im=fcitx" 24EOF 出于目前对manjaro的依赖,以及没有找到很简单易行的备份系统的方案的原因,决定详细记录一下系统安装的过程,以防哪天系统挂掉了,可以快速恢复。

conda升级anaconda ValueError的解决办法

·121 字·1 分钟
conda update anaconda 后提示 1ValueError: unsupported format character ')' (0x29) at index 49 查到了这个:anaconda update issue I have narrowed this down to the following packages: package build psutil-1.2.1 py27_0 hard-link pycparser-2.10 py27_0 hard-link pykit-0.1.0 np18py27_2 hard-link pyparsing-2.0.1 py27_0 hard-link by calling "conda install anaconda" and then successfully installing everything else one at a time. These four packages consistently exhibit the described behaviour. (note: pykit depends on pycparser so may itself be ok - can't tell) 我先把psutil卸载掉,重新update了一下,成功。