This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <curl/curl.h> | |
#include <yajl/yajl_tree.h> | |
#include <yajl/yajl_common.h> | |
#define LOC_NUM 7 | |
#define JSON_ERR_MSG_LEN 1024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from itertools import combinations | |
import json | |
import requests | |
locations = { | |
'长江南路站', | |
'浦东机场', | |
'起点单车世纪公园店', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
/usr/local/share/npm/bin/splocal -c /Users/013231/code/xwall/ShadowSPDY/config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xwall.plist: | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>xwall</string> | |
<key>RunAtLoad</key> | |
<true /> | |
<key>Program</key> | |
<string>/Users/013231/code/tools/xwall.sh</string> | |
</dict> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==> Downloading https://github.com/b4winckler/macvim/archive/snapshot-66.tar.gz | |
Already downloaded: /Library/Caches/Homebrew/macvim-7.3-66.tar.gz | |
tar xf /Library/Caches/Homebrew/macvim-7.3-66.tar.gz | |
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --with-ruby-command=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --with-tlib=ncurses --with-compiledby=Homebrew --with-local-dir=/usr/local --enable-cscope --enable-pythoninterp=yes | |
./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --enable-tclinterp --with-ruby-command=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby --with-tlib=ncurses --with-compiledby=Homebrew --with-local-dir=/usr/local --enable-cscope --enable-pythoninterp=yes | |
checking whether make sets $(MAKE)... yes | |
checking for gcc... clang | |
checking whether the C compiler works... yes | |
checking for C compiler defaul |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CPU: Intel i5 2550K 散片 850 | |
主板: 华擎(Asrock)Z77 Pro4-M 600 | |
顯卡: 华硕(ASUS)HD7770-DC-1GD5-V2 880 | |
內存: 三星(SAMSUNG) DDR3 1600 8G(4G×2条) 320 | |
硬盤: 美光(Crucial)M4系列 128G 700 | |
電源: 安钛克(Antec)Neo ECO 400 330 | |
散熱器: Intel盒裝i5的散熱器 50 | |
機箱: 酷冷至尊(CoolerMaster)开拓者U3 330 | |
總計 4060 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
your_json = json.dumps(your_dict, ensure_ascii=False) #ensure_ascii參數阻止轉義, 並將返回值變成unicode | |
file_obj.write(your_json.encode('utf-8')) #unicode不能直接寫入文件, 需編碼成str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def startsWith1(x): | |
return x in lst | |
startsWith1.lst = set(10 ** i for i in range(20)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
上次詢問DIY NAS主板的帖子: http://www.v2ex.com/t/51629 | |
經過一番搜尋, 現在我擬定了如下硬件配置: | |
部件 型號 選擇理由 備註 | |
CPU: Intel Core i3-3225 1, 2, 5 | |
主板: 技嘉 GA-H77N-WIFI 1 主要是考慮黑蘋果兼容性. | |
機箱: 聯力 Q25 3, 7 | |
電源: 海韻 X-560(SS-560KM) 4, 5, 6 模塊化設計, 理線比較方便. | |
內存: 這個無所謂吧, 隨便插兩根8G的好了 |
NewerOlder