原创 git gerrit 實踐經驗

用git一段時間,體驗還是比較好。 尤其沒次改一批文件,文件列表非常清晰。 和gerrit結合,diff, review 都非常方便,尤其你不需要自己手動提交到服務器 有些缺點 庫太大,做android 開發,要下載幾十G的東西 如果多

原创 編程練習:Biorhythms

http://poj.org/problem?id=1006 Description Some people believe that there are three cycles in a person's life that s

原创 Android Looper(cpp)用法舉例

在使用loop 前,我是直接使用 epoll 的,後來發現 loop 封裝了 epoll, 使用起來還要更方便一點。 static int event_handle(int fd, int events, void* data){ p

原创 SDL 在 MingGW 中不支持 joystick

實驗 SDL 了一個小程序,在linux 正常 而後在 MingGW 編譯通過 gcc  -I/local/include -L/local/lib -w -Wl,-subsystem,windows -lmingw32 -lSDL2ma

原创 fltk(Fast Light Toolkit) hello world

fltk 很像一個小 qt系統,提供 小UI構件和事件循環(邏輯都在 Fl.cxx中). 下面只是一個類似 hello world 的程序 ========= main.c ========= #include <FL/Fl.H> #in

原创 使用 icsp 燒程序

使用ICSP 就是不依靠 bootloader才燒程序 http://www.arduino.cc/en/Tutorial/ArduinoISP   6pin 的 isp 應該如下: 下面的文章談到了如何upload http:

原创 編程練習:Spell checker

http://poj.org/problem?id=1035 Description You, as a member of a development team for a new spell checking program, ar

原创 試用 Arduino Due

以前都玩328P, 現在玩玩arm的板子 關於板子參見:http://www.arduino.cc/en/Main/ArduinoBoardDue 1)下載 arduino-1.6.2-windows, 2)安裝driver 其driv

原创 整理源文件技巧:批量替換

批量改舊文件就是麻煩呀,我寫了腳本來幫忙 1)找到所有非 binary 的源文件  find -type f -exec grep -Il . {} \; 〉tochange.list grep 參數  -l 不輸出內容,而輸出文件名

原创 raspberry pi 的 C 程序編寫

linux 都帶了 gcc, 簡單程序可以在樹莓派中,直接編譯 複雜的程序,可以用 bcm (因爲芯片是 broadcom 的) 的 toolchain 來編譯 先下載工具包 git clone git://github.com/ra

原创 ubuntu 運行 usb camera

用軟件Cheese 1) 插上 usb camera 2)  軟件中心 找 cheese 運行 ref: http://www.ehow.com/how_5610857_mount-usb-camera-ubuntu.html 通過

原创 編程練習:False coin

http://poj.org/problem?id=1029 The "Gold Bar"bank received information from reliable sources that in their last group

原创 MPU6050 6DOF 數據讀取

MPU6050 三軸加速度陀螺儀模塊 1)如何根據讀出的值計算重力加速度 官方給的文檔如下: 如果設置 1 (AFS_SEL=1)  量程式 +/- 2g (不是克,是重力加速度)  那麼當你把MPU6050水平放置的時候,Z軸的A

原创 Android SystemUI中HOME key的處理

在Android系統的nav bar 中點擊home按鈕,就回到HOME,他是如何實現的 在view的xml描述文件,指明瞭key_code frameworks/base/packages/SystemUI/res/layout/na

原创 MingGW 內外中編寫程序進行udp 通信

首先用python 編寫一個server import socket address = ('127.0.0.1', 21567) s = socket.socket(socket.AF_INET, socket.SOCK_