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

python日期操作

 

from datetime import datetime,date

dayOfWeek = datetime.now().weekday()
print dayOfWeek

******************************************************************

import time
import datetime

dtime = datetime.datetime.now()
ans_time = time.mktime(dtime.timetuple())
unix_ts = 1439111214.0
time = datetime.datetime.fromtimestamp(unix_ts)