https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode
作者原文:https://medium.com/swift-programming/swift-build-time-optimizations-part-2-37b0a7514cbe
https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode
作者原文:https://medium.com/swift-programming/swift-build-time-optimizations-part-2-37b0a7514cbe
1、安装依赖的库
1 2 3 |
sudo apt-get install g++ flex bison gperf ruby perl \ libsqlite3-dev libfontconfig1-dev libicu-dev libfreetype6 libssl-dev \ libpng-dev libjpeg-dev |
2、下载、编译
1 2 3 |
wget https://bbuseruploads.s3.amazonaws.com/ariya/phantomjs/downloads/phantomjs-2.0.0-source.zip unzip phantomjs-2.0.0-source.zip ./build.sh |
然后就是等待了,一般要1个小时以上。
3、通过python调用
最新的selenium (2.45)已经支持了PhantomJS,调用非常简单:
1 2 3 4 5 6 7 |
from selenium import webdriver driver = webdriver.PhantomJS() driver.get('http://you url') for tr in driver.find_elements_by_xpath(u'your xpath'): print tr driver.quit() |
1、依赖的库
经过试验,发现目前0.9.0依赖如下的库:
1 2 3 4 5 6 7 8 9 |
# Boost sudo apt-get install libboost-dev # Java 和 ant sudo apt-get install sudo apt-get install ant # OpenSSL sudo apt-get install libssl-dev # Python-dev sudo apt-get install python-dev |
2、配置
这里我只需要使用Java、C++、Python的。
1 |
./configure --with-cpp --with-python --with-boost --with-java --without-csharp --without-erlang --without-perl --without-php --without-php_extension --without-ruby --without-haskell --without-go |
3、编译
1 |
make |
如果中途出现maven-ant-tasks-2.1.3.jar无法下载,可以从这个地址下载并拷贝到thrift-0.9.0/lib/java/bui[……]
实验室的Ubuntu 10.04上apt只能安装MySQL 5.1,忍不了,手动编译5.5。
折腾了一下午,5.5之后的源码安装各种坑爹啊,感谢这篇文章,《Ubuntu 10.04.2上编译安装MySQL 5.5.11》
1、下载
1 |
wget -O mysql-5.5.23.tar.gz http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.23.tar.gz/from/http://mysql.saudi.net.sa/ |
2、编译
1 |
cmake . -DCMAKE_INSTALL_PREFIX=/usr/mysql -DMYSQL_DATADIR=/usr/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DWITH_DEBUG=0 -DWITH_INNOBASE_STORAGE_ENGINE=1 |
上述的参数:默认安装在/usr/mysql下,数据在/usr/mysql/data下。
cmake后[……]
今天下午将Thrift定义的格式生成Java,折腾了3个小时,在依赖包齐全的前提下,死活出一堆编译错误。
最后开始翻代码,终于发现了原因:index是Java接口内部保留字,请不要用它做任何函数名、结构体、变量名……