Erlang 安装使用rfc4627

环境: Ubuntu 14.04

编译

git clone git://github.com/tonyg/erlang-rfc4627.git

cd erlang-rfc4627/

make all

获取erlang library路径

jerry@iZ28ktvewfwZ:~$ erl
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [kernel-poll:false]

Eshell V5.10.4 (abort with ^G)
1> code:get_path().
[“.”,”/usr/lib/erlang/lib/kernel-2.16.4/ebin”,
“/usr/lib/erlang/lib/stdlib-1.19.4/ebin”,
“/usr/lib/erlang/lib/xmerl-1.3.5/ebin”,
“/usr/lib/erlang/lib/wx-1.1.1”,
[…]|…]
2>

将文件夹拷贝到相应目录下

sudo cp -R erlang-rfc4627/ /usr/lib/erlang/lib/

 
测试使用

jerry@iZ28ktvewfwZ:~$ erl
Erlang R16B03 (erts-5.10.4) [source] [64-bit] [async-threads:10] [kernel-poll:false]

Eshell V5.10.4 (abort with ^G)
1> O = rfc4627:encode({obj, [{name, hideto}, {age, 23}]}).
“{\”name\”:\”hideto\”,\”age\”:23}”
2>

红米4A ROOT步骤

 

1. 下载开发版,刷入这个版本
http://www.miui.com/download-325.html
http://www.miui.com/shuaji-329.html

使用命令行
adb push miui_HM4A_7.4.27_e52ef2df2a_6.0.zip /sdcard/
或者在这图形界面上拷贝

2.申请解锁权限
注册小米帐号后进入申请解锁http://www.miui.com/unlock/

3.按音量下+电源键进入Fastboot模式

4.http://www.miui.com/unlock/done.html下载解锁工具(miflash_unlock)解锁并重启手机

5.进入安全中心-》授权管理-》开启root

6.重启完就好了

 

 

链接:

http://www.miui.com/thread-3852678-1-1.html

http://www.miui.com/thread-6297807-1-1.html

Mac 拷贝出错

在mac上使用外置硬盘拷贝数据时出现”One or more items in… can’t be changed because they are in use”

解决如下:

xattr -d com.apple.FinderInfo <filename>

编程感想

07年大学毕业,到现在快10年了。一直做数据相关的开发工作,感觉对一个系统的评估越来越集中在两条上。

1. 是否是分布式系统

可以避免种异常情况,提供可靠性和高扩展性

2. 自动化程度如何

减小人力的介入

python调用tensorflow出错

jerry@ubuntu:~/serving$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import tensorflow
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py”, line 23, in <module>
from tensorflow.python import *
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py”, line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py”, line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File “/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py”, line 24, in swig_import_helper
_mod = imp.load_module(‘_pywrap_tensorflow’, fp, pathname, description)
ImportError: numpy.core.multiarray failed to import

 

升级numpy至最新版本

sudo pip install numpy –upgrade

sudo mv  /usr/lib/python2.7/dist-packages/numpy /usr/lib/python2.7/dist-packages/numpy_old

 

查看新的numpy路径

import numpy

numpy.__path__

pip安装包太慢

最近使用pip安装包发现非常之慢,估计是gfw搞的鬼。没办法只好使用国内的镜像。

vi ~/.pip/pip.conf

[global]
index-url = http://pypi.douban.com/simple

或者

[global]
trusted-host = mirrors.aliyun.com
index-url = http://mirrors.aliyun.com/pypi/simple