0%

工作需要把 Mud makes my mom mad. 这句话带有m的加上颜色,或者把某些单词加上颜色
临时写了个脚本处理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import re
import sys


# replace letter
#find = "m"
#str = "Mud makes my mom mad."

#replace key words
#find = "Mud|makes|mad"
#str = "Mud makes my mom mad."

# how to use
# python b.py "m" "Mud makes my mom mad."
# python b.py "mud|mess|mop|make|the|help" "Mud makes my mom mad."


find = sys.argv[1]
str = sys.argv[2]


result = re.sub(r'('+find+')', r'<color:#ff0000>\1</color>', str, 0, re.IGNORECASE)
print result

执行命令安装vim 注意要加上--with-override-system-vi

1
brew install vim --with-override-system-vi

安装过程中如果出现 ruby.h找不到

执行下面的命令

1
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby
1
sudo ln -s ../universal-darwin15/ruby/config.h ./config.h

注意不要复制上面的, 对应自己的sdk版本,ruby版本,darwin版本

阅读全文 »

配置文件和快速设置

  1. PlugClean
  2. PlugInstall
  3. 去到YCM里执行
    1
    ./install.py --clang-completer --gocode-completer

安装插件管理器

1
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

安装插件

1
2
3
4
5
6
7
8
9
10
call plug#begin()
Plug 'fatih/vim-go' "go
Plug 'tomasr/molokai' "主题
Plug 'SirVer/ultisnips' "tab补全
Plug 'ctrlpvim/ctrlp.vim' "快速查文件
Plug 'Shougo/neocomplete.vim' "实时提示
Plug 'majutsushi/tagbar' "tagbar
Plug 'scrooloose/nerdtree' "导航
Plug 'vim-airline/vim-airline' "下面
call plug#end()
阅读全文 »

自己写的一个简单去除html标签(xml)的脚本

1
2
3
4
5
6
7
8
9
10
11
12
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<text font="Palatino Linotype">
<p>
<s end_audio="262" start_audio="13">
<w end_audio="94" id="0" start_audio="13" variants="mud">Mud</w>
<w end_audio="122" id="1" start_audio="95">makes</w>
<w end_audio="140" id="2" start_audio="123">my</w>
<w end_audio="215" id="3" start_audio="141">mom</w>
<w end_audio="262" id="4" start_audio="216" variants="mad">mad.</w>
</s>
</p>
</text>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import re
import sys

# how to use
# pythone a.py C6M01B1-001.xml

file = sys.argv[1]
f = open(file, 'r')

res = ""
for line in f.readlines():
#str = re.sub(r'</?\w+[^>]*>','',line)
str = re.sub(r'<(/|\?)?\w+[^>]*>','',line)
if str != '\r\n':
res = res + str
res = re.sub('\r\n',' ',res)
print res
#print "len =",len(res)

This is a blockquote.

This is the second paragraph in the blockquote.

This is an H2 in a blockquote

Some of these words are emphasized.

Use two asterisks for strong emphasis.

阅读全文 »

1
2
3
LOCAL_SRC_FILES := hellocpp/main.cpp \  
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp

换成

1
2
3
FILE_LIST := hellocpp/main.cpp    
FILE_LIST += $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp)
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

阅读全文 »

命令行:

gitbook pdf Effective-Modern-Cpp-Zh myname.pdf

如果无法生成 需要安装 calibre

安装后还要执行命令
ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/local/bin

我的第一篇博客,写点什么好呢?
希望以后能坚持写下去把.