Lisp

无言独上西楼,月如勾。

Lisp Books

SBCL

1
To quit SBCL, type (quit)

Quicklisp

1
2
$ curl -o /tmp/ql.lisp http://beta.quicklisp.org/quicklisp.lisp
$ sbcl --no-sysinit --no-userinit --load /tmp/ql.lisp --eval '(quicklisp-quickstart:install :path ".quicklisp")' --quit

Sublime

1
2
3
4
5
6
7
8
9
先安装Common lisp 解释器:
brew install sbcl
然后在sublime text添加一个
build system
{
"shell_cmd": "/usr/local/bin/sbcl --disable-debugger --load $file",
"working_dir": "$file_path"
}

try lisp on browser

code

hello world

1
2
3
(defun sayHello()
(format t "Hello, world!"))
(sayHello)

References

Factorial in Programs

Factorial in Lua

1
2
3
4
5
6
7
8
9
10
11
function factorial(n)
if (n == 0) then
return 1
else
return n * factorial(n - 1)
end
end
for n = 0, 16 do
io.write(n, "! = ", factorial(n), "\n")
end

output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
0! = 1
1! = 1
2! = 2
3! = 6
4! = 24
5! = 120
6! = 720
7! = 5040
8! = 40320
9! = 362880
10! = 3628800
11! = 39916800
12! = 479001600
13! = 6227020800
14! = 87178291200
15! = 1307674368000
16! = 20922789888000
阅读全文 »

API接口测试工具

常用API接口测试工具

httpstat 终端里测试

阅读全文 »

Torch

doc

application

阅读全文 »

Activator

Activator

doc

阅读全文 »

HTTP2

###learning

SPDY是谷歌研制的提升HTTP速度的协议,是HTTP/2.0的基础.HTTP/2 基于 SPDY 而建,性能和特性较 HTTP/1.1 有了极大的提升.

HTTP2 VS SPDY

阅读全文 »

iOS developer tips

documents

中文版 Apple 官方 Swift 教程

Start Developing iOS Apps Today

Start Developing iOS Apps Today: Setup

Hacking with Swift

Teaching App Development with Swift

Teaching App Development with Swift - Swift Education

阅读全文 »

EPWING2TEXT

epwing转text主要有3种方法:

  • 1.用ebdump(用ebdump提取epwing词典的文本图片等),不过这样提取出来格式不好分离出来,词条不好定位。
  • 2.PDIC,可以将epwing格式的词典转换为pdic格式,再从pdict格式中获取文本,转换过程中外字也可以替换掉,不过用PDIC提取,会有部分内容没有提取出来。方法见:link
  • 3.DDWIN 2.30 ,这里要介绍的方法,参考自:http://diamondsky.org/other/japanese/pdic.php

工具:

主要步骤:

  • 1.用DDWIN获取文本,得到的文本格式每个词条以空行分开。
  • 2.将外字.map文件转换为.tsv格式
1
2
3
4
on [hA121] @@u2019
on [hA122] @@u0192
on [hA123] @@u201E
on [hA124] @@u2020

间隔为tab,@@本来为\,不过批量替换时会被EmEditor过滤掉,所以用@@代替,最后再替换为\

  • 3.用EmEditor导入.tsv文件,批量将外字替换为通用字符(\u123)格式。
  • 4.将通用字符替换为Unicode。

效果:

大部分的外字都可以替换掉,剩下少部分的是外字.map里没有收入的,可以手动替换掉。

详细转换过程见视频:

http://pan.baidu.com/s/1i3GjjRv

Lua

about

Lua(英语发音:/ˈluːə/)程序设计语言是一个简洁、轻量、可扩展的脚本语言,是葡萄牙语中“Lua”(月亮)的意思。类似语言Julia,R。

install

  • make macosx test make install
  • brew install lua
1
2
3
4
5
[Errno 2] No such file or directory: 'lua'
[cmd: ['lua', '/Users/qunwang6/Desktop/hello.lua']]
[dir: /Users/qunwang6/Desktop]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]

因为 lua默认安装在usr/local/bin里面,而不是usr/bin里面;可以创建一个usr/bin的外链;
也可以通过安装fix mac path的包来解决。

doc

plugs

  • sublilme3 Lua dev
  • sublilme3 Lua Love

语言学习利器:Readlang

以前学习笔记是这么做的

现在可以这样

不过网站是不保存笔记数据的,若要保存,可借助evernote.

详细用法:

几个比较赞的功能:

  • 生词本,划线取词后的单词以及单词所在的例句自动加入到生词本中,不同语言,有各自的生词本。
  • 用户可上传自定义文本,支持.txt,.epub格式。
  • 卡片记忆,记忆数据可视化。
  • 没有被墙

高级用法:

Readlang 更改介面字典、影片同步、單字複習功能

1
2
3
http://www.wordreference.com/enzh/{{query}}
http://www.vocabulary.com/dictionary/{{query}}
http://www.oxfordlearnersdictionaries.com/us/definition/english/{{query}}