以手為半徑是我的世界範圍! 在這個世界裡頭沒有爭吵,沒有公司派的勾心鬥角,當然也沒有那種跟你搏軟然後在背後捅你一百多刀的恐怖smile! 所以這是屬於我的半徑! 閒人勿進,因為結界的關西。 半徑內的咖啡、半徑內的電波、半徑變成了一個獨立的單位在這個獨立的世界與國家中。 而我的半徑中我是完全自由的非固體! 因為我是法系人物!
2011年9月2日
人才招募:SEO Engineer
Responsibilities
1. 製定SEO計劃並執行,包括制定關鍵指標與測量優化的方式。
2. 執行內部網站的追蹤/報告規劃
3. 提供對網頁搜索引擎優化的建議與相關技術規劃與設計(例如:標題,URL結構,內部鏈接,內容..等等)。
4. 定期提供SEO的報告與測試結果
5. 持續的研究SEO與流量分析的知識與技術
Requirements:
1. 熟悉SEO 技術,並有一年以上相關經驗
2. 熟悉網頁技術開發 CSS, HTML, Javascript
3. 有使用分析工具經驗,如:Omniture, Google Analytics, Webtrends, Hitwise, ComScore
4. 擁有優化國際搜尋引擎與本地化搜尋引擎經驗,例如: Google, Yahoo, Yahoo Kimo, 百度
5. 了解搜尋排名的因素 : site maps, robots files, URL structures, crawler issues, indexing problems, algorithm changes, metadata use, SEO copywriting, link research, link building, back-link analysis, anchor link analysis, broken links, cross linking, 301 redirects, etc.
6. 良好的溝通技巧
7. 良好的資料分析能力,能分析並提出改善建議
8. 熟悉Microsoft Office
2011年8月17日
記錄文章:一次向svn中增加所有新增文件 svn add all new files
以下摘自:《卓有成效的程序員》之自動化我經常會一次往Subversion裡添加一批文件。在使用命令行做這件事時,你必須指定所有想要添加的文件名。如果文件不多的話這還不算太糟糕,但如果 你要添加20個文件,那就費事了。當然你也可以用通配符,但這樣一來就可能匹配到已經在版本控制之下的文件(這不會有什麼損害,只不過會輸出一堆錯誤信 息,可能會跟別的錯誤信息混淆)。為瞭解決這個問題,我寫了一行簡單的bash命令:
svn st | grep '^\?' | tr '^\?' ' ' | sed 's/[ ]*//' | sed 's/[ ]/\\ /g' | xargs svn add
表4.3詳細解釋了這一行命令。
我大概花了15分鐘寫出這條命令,然後用了它成百上千次。
****************************************************
這個自動化過程已經很完美了,一個「簡單」的shell腳本,這是一個權威編寫並使用了百上千次的腳本。
然後我在一個博客中看到這樣一個腳本:
svn st|awk '{print $2}'|xargs svn add。
乍看之下覺得更加精煉,仔細看下就會發現這個腳本沒有區分文件狀態。所以完善了以下這個腳本:
- svn st | awk '{if ( $1 == "?") { print $2}}' | xargs svn add
這樣,以後我可能使用這個腳本成百上千次。(當然這個腳本也沒有考慮過濾掉不要添加的文件)
當你第三次做一件事情的時候,就應該考慮將其工具化,自動化!
2011年5月3日
(轉載紀錄)让 iPhone App 以 https 方式连接网络
http://www.cocoachina.com/iphonedev/sdk/2010/1112/2339.html
让 iPhone App 以 https 方式连接网络
时间: 2010-11-12 17:20
问题 你是否也想让自己的 iPhone 应用程序连接 https 服务器呢?下面我就介绍一下其使用方法。 通常使用 Objective-C 的 NSURLConnection 连接有证明书的 https 服务器时会出现验证错误,我们可
问题
你是否也想让自己的 iPhone 应用程序连接 https 服务器呢?下面我就介绍一下其使用方法。
通常使用 Objective-C 的 NSURLConnection 连接有证明书的 https 服务器时会出现验证错误,我们可以使用私有API — setAllowsAnyHTTPSCertificate:forHost 来解决这个问题。如果是 Cocoa 的应用程序应该是没有什么问题,但是用在 iPhone 上,很可能过不了 App Store 的审查。
所以这里我们使用 libcurl 来完成在 iphone 上连接 https 服务器。
准备
编译 openssl
连接 https 的前提是要有 OpenSSL。你可以参考 这里 来为 iPhone 编译 OpenSSL 静态库。最终得到下面两个静态库文件。
libcrypto.a
libssl.a
libssl.a
编译 libcurl
接下来我们下载/编译 libcurl。下载展开后,按照下面配置(根据实际情况更改你的SDK目录,版本)。
./configure --prefix=$HOME/tmp/iphonelib/curl \
--host=arm-apple-darwin --disable-shared --with-random=/dev/urandom \
CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
CFLAGS="-arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk -I$HOME/tmp/iphonelib/openssl/include -L$HOME/tmp/iphonelib/openssl/lib" \
CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp \
AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
--host=arm-apple-darwin --disable-shared --with-random=/dev/urandom \
CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
CFLAGS="-arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk -I$HOME/tmp/iphonelib/openssl/include -L$HOME/tmp/iphonelib/openssl/lib" \
CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp \
AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
如果最后输出下面的内容,说明可以编译支持 https 的 libcurl 了。
SSL support: enabled (OpenSSL)
接下来
make
make install
make install
编译结果输出到 ~/tmp/iphonelib/curl/lib 下的 libcurl.a。
使用
添加到工程中
如下图所示,将编译好的静态库拖到你的工程中:
另外,由于 openssl 中使用了 zlib,所以还需要在工程中加入链接开关。(该库被包含在iPhone中,不需要重新编译)
如下图所示,在连接中追加 -lz。
最后,如下图添加编译所需的头文件路径。
比如,编译 libcurl 时的头文件的路径 ~/tmp/iphonelib/curl/include 。
代码例子
下来,让我们看看在程序中使用 libcurl 的例子。下面的例子在 AppDelegate.m 中实现。
#import "AppDelegate.h"
#include
@implementation AppDelegate
-(void)applicationDidFinishLaunching:(UIApplication *)application {
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch
[window makeKeyAndVisible];
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://twitter.com/");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
res = curl_easy_perform(curl);
if (0 != res) {
fprintf(stderr, "curl error: %d\n", res);
}
curl_easy_cleanup(curl);
}
}
-(void)dealloc {
[window release];
[super dealloc];
}
@end
#include
@implementation AppDelegate
-(void)applicationDidFinishLaunching:(UIApplication *)application {
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch
[window makeKeyAndVisible];
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if (curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://twitter.com/");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
res = curl_easy_perform(curl);
if (0 != res) {
fprintf(stderr, "curl error: %d\n", res);
}
curl_easy_cleanup(curl);
}
}
-(void)dealloc {
[window release];
[super dealloc];
}
@end
编译运行,可以用调试工具得到取得的html,如下图。
在模拟器中使用 libcurl
上面介绍的都是在设备上运行的例子,如果要在模拟器上使用,由于处理器结构不一样,需要重新编译 openssl 和 curl 静态库。编译的时候,只要将 SDK 的路径由 iPhoneOS.platform ⇒ iPhoneSimulator.platform,编译开关 -arch armv6 ⇒ -arch i386 就可以了。只是编译的文件名最好和iphone上用的区别开来,如下所示:
libcrypto_simulator.a
libssl_simulator.a
libcurl_simulator.a
libssl_simulator.a
libcurl_simulator.a
又或者不改变库的名称,而是增加新的编译目标。
訂閱:
文章 (Atom)