<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7276177846879793950</id><updated>2025-03-25T07:32:33.006+08:00</updated><category term="所有文章列表"/><category term="分享"/><category term="Computer Science"/><category term="Linux"/><category term="大學"/><category term="ubuntu Linux"/><category term="程式設計"/><category term="心語"/><category term="其他"/><category term="高興"/><category term="筆記"/><category term="隨筆"/><category term="國術"/><category term="第一次"/><category term="C++"/><category term="閒聊"/><category term="教學"/><category term="Python"/><category term="ACM"/><category term="Windows"/><category term="囧rz"/><category term="感情"/><category term="失落"/><category term="Vista"/><category term="電影"/><category term="Shell Script"/><category term="心靜"/><category term="沈澱"/><category term="爆笑"/><category term="C"/><category term="Firefox"/><category term="Hack"/><category term="畢業"/><category term="追尋"/><category term="MacOS"/><category term="Ruby"/><category term="中一中"/><category term="密碼文"/><category term="測驗"/><category term="Arch Linux"/><category term="Lyrics"/><category term="MongoDB"/><category term="NSIS"/><category term="Qt"/><category term="慘痛"/><category term="Blogger"/><category term="Conky"/><category term="DNS"/><category term="Data Mining"/><category term="Embedded Linux"/><category term="GIMP"/><category term="JSON"/><category term="MSN"/><category term="SQL"/><category term="VIM"/><category term="VPN"/><category term="Web"/><category term="WebDev"/><category term="git"/><category term="ufw"/><category term="打工"/><title type='text'>#include &amp;lt;strength&amp;gt;</title><subtitle type='html'>Sharing Feelings, Note, Linux...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.azhuang.me/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>200</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-1511020680381618720</id><published>2016-01-24T19:23:00.000+08:00</published><updated>2016-01-24T19:24:43.007+08:00</updated><title type='text'>Tips: PPTP client on Openwrt</title><summary type="text">Besides from following the openwrt wiki PPTP client page, there are some extra tips required for making PPTP client work on openwrt.

Just like on normal linux distribution, special netfilter modules are required:

nf_nat_pptp
nf_conntrack_pptp
nf_conntrack_proto_gre


On openwrt, you need to install &#39;kmod-nf-nathelper-extra&#39; to get theses modules;


opkg install&amp;nbsp;kmod-nf-nathelper-extra




</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/1511020680381618720/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/1511020680381618720?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/1511020680381618720'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/1511020680381618720'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2016/01/tips-pptp-client-on-openwrt.html' title='Tips: PPTP client on Openwrt'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-663389503141657495</id><published>2014-01-16T02:46:00.003+08:00</published><updated>2014-01-16T02:46:50.410+08:00</updated><title type='text'>嘸蝦米文翻譯機 網頁版</title><summary type="text">我很久以前寫了一個嘸蝦米文翻譯機，不過因為是桌面程式所以其實用起來比較不方便。所以今天突然心血來潮就寫了一個網頁版的，網址如下:

http://ovff.herokuapp.com/

使用方式很簡單，左邊輸入無蝦米文後按向右的鍵頭就可以翻成中文。
反之如果在右邊輸入中文按下向左的鍵，就可以翻成嘸蝦米文。</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/663389503141657495/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/663389503141657495?isPopup=true' title='21 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/663389503141657495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/663389503141657495'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2014/01/blog-post.html' title='嘸蝦米文翻譯機 網頁版'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-31985102963991724</id><published>2014-01-06T22:53:00.003+08:00</published><updated>2014-01-21T17:49:23.793+08:00</updated><title type='text'>PyTox: Python binding for Project-Tox the Skype Replacement</title><summary type="text">前些時候注意到了 Project-Tox 這個專案，看了一下覺得非常有趣。Project-Tox 是一個想要取代 Skype 的 IM 網路。他非常的安全，通訊完全P2P及加密，且使用類似 BitTorrent 的 DHT 來進行資訊交換。由其在 PRISM 事件後，大家都非常在意這點。因為 Project-Tox 只是一個 library，所以其每個人都可以實做不同的 Client，目前有的 Client 可以看這裡。



我為 libtoxcore 寫了一個 Python 的 binding: PyTox，所以可以很容易的利用 Python 來寫 Client 或是機器人。PyTox 目前已經支援99%的libtoxcore API，且全部通過自動化測式。後來我又寫了一個機器人來自動同步 Tox 群組聊天和 IRC channel 中的對話: tox-irc-sync&amp;nbsp;。</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/31985102963991724/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/31985102963991724?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/31985102963991724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/31985102963991724'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2014/01/pytox-python-binding-for-project-tox.html' title='PyTox: Python binding for Project-Tox the Skype Replacement'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-6821698204936046881</id><published>2013-10-11T02:52:00.005+08:00</published><updated>2013-10-14T13:41:32.497+08:00</updated><title type='text'>Quciksort in Python: Functional vs Non-functional</title><summary type="text">最近學了 SML 和 Racket 後，開始對 Functional Programming 很有興趣。 不過在學的過程中，一直有一個疑問: immutable 不會讓程式變很慢嗎？(因為為做很多copy?) 所以想拿個例子分別寫 Functional / Non-functional 的寫法來比較看看速度。就選用最好寫的 Quicksort 好了，程式碼如下:

#!/usr/bin/env python

from timeit import timeit
from random import randint

def quicksort_impl(v, start, end):
    if start + 1 &amp;gt;= end:
        return

    pv = v[end - 1]
    partition = start

    for i in </summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/6821698204936046881/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/6821698204936046881?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6821698204936046881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6821698204936046881'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/10/quciksort-in-python-functional-vs-non.html' title='Quciksort in Python: Functional vs Non-functional'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-6649049656392025270</id><published>2013-09-06T17:58:00.001+08:00</published><updated>2013-09-06T18:49:54.225+08:00</updated><title type='text'>嘸蝦米翻譯機 復活!</title><summary type="text">三年多前寫了一個 嘸蝦米翻譯機&amp;nbsp;後來因為忙碌一直未更新 Windows 安裝檔。最近因為在整理過去的作品，就翻出來順便整理一下XD

最新的 Windows 安裝檔下載: &amp;nbsp;gOVFF-2.1.0-Installer.exe
Github 頁面: govff @ github




Enjoy :)</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/6649049656392025270/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/6649049656392025270?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6649049656392025270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6649049656392025270'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/09/blog-post.html' title='嘸蝦米翻譯機 復活!'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-5423162259964871239</id><published>2013-06-12T00:21:00.000+08:00</published><updated>2013-06-12T00:22:49.813+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Hack"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><title type='text'>PhantomJS 擷圖 亂碼修正</title><summary type="text">使用PhantomJS拮取網站擷時，有時會因為網站Server的Content-Type沒有指定 charset 造成亂碼。Github 上有一個 issue&amp;nbsp;也是同樣的問題還沒解決。後來想到可以用 chardet 配上HTTP Proxy 來改寫Content-Type header。以上是一個簡單的script來解決這樣的問題:


from miproxy.proxy import RequestInterceptorPlugin, ResponseInterceptorPlugin, AsyncMitmProxy
from mimetools import Message
from StringIO import StringIO
import chardet

class DebugInterceptor(RequestInterceptorPlugin, </summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/5423162259964871239/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/5423162259964871239?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/5423162259964871239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/5423162259964871239'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/06/phantomjs.html' title='PhantomJS 擷圖 亂碼修正'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-7375397095280830162</id><published>2013-05-31T18:05:00.001+08:00</published><updated>2013-05-31T18:08:22.708+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><title type='text'>MongoDB as queue</title><summary type="text">想要把 MongoDB 裡的其中一個 collection 做為 queue, 讓多個 worker 存取來做事，可以利用 MongoDB 的 findAndModify。 findAndModify 是 atomic operation，執行的結果會回傳一個物件並且更新他的狀態。

例如現在有一個 collection 名為 keys, 裡面存著 {&quot;id&quot;: id, &quot;queued&quot;: false}

db.runCommand({&quot;findAndModify&quot;: &quot;keys&quot;, &quot;query&quot;: {&quot;queued&quot;: false}, &quot;update&quot;: {&quot;$set&quot;: {&quot;queued&quot;: true}}})



就會回傳一個 document, 且將其 &quot;queued&quot; 設為 ture。因為是 atomic operation, 故可以保證每 worker 不會拿到相同的 </summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/7375397095280830162/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/7375397095280830162?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7375397095280830162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7375397095280830162'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/05/mongodb-as-queue.html' title='MongoDB as queue'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-6285376942878436545</id><published>2013-05-22T23:38:00.000+08:00</published><updated>2013-05-31T18:08:22.694+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="VPN"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><title type='text'>使用 pppd 連接 VPN 時連線凍結</title><summary type="text">本來都是用學校的 Junos Pulse SSL VPN &amp;nbsp;連線到學校查論文，不過最近學校的SSL VPN一直壞掉，所以只好自己在 Lab 的電腦上裝 PPTPD。不過問題來了，用 Network Manager 連進去都可以，可是用 pppd 連線時確一直無法上網，不過倒是可以 ping 到 server。



比對了一下 routing table 發現是一樣的，而且我有在/etc/ppp/ip-up.d 底下加上了 01-route.sh，所以會把所有的 traffic route 到 ppp 去


#!/bin/bash

route del default wlan0
route add default $1

最後終於查到原來是MTU造成的，剛下完 pppd call 後 ppp0 的 MTU 竟然是 1496 這個其怪的數字，改成 1400 就可以了。所以加了</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/6285376942878436545/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/6285376942878436545?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6285376942878436545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6285376942878436545'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/05/pppd-vpn.html' title='使用 pppd 連接 VPN 時連線凍結'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-4993118931904118254</id><published>2013-05-22T00:59:00.002+08:00</published><updated>2013-05-31T18:08:22.690+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="DNS"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><title type='text'>azhuang.me 網域</title><summary type="text">買下了 azhuang.me 這個網域，所以 blogger 也一起轉過來了 :P
以後請使用 http://blog.azhuang.me 連到我的網誌。</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/4993118931904118254/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/4993118931904118254?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/4993118931904118254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/4993118931904118254'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/05/azhuangme.html' title='azhuang.me 網域'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-6568371649369316505</id><published>2013-05-21T16:41:00.001+08:00</published><updated>2013-05-31T18:08:22.696+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Data Mining"/><category scheme="http://www.blogger.com/atom/ns#" term="JSON"/><category scheme="http://www.blogger.com/atom/ns#" term="MongoDB"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>MongoDB 初體驗</title><summary type="text">因為 Web Mining final project 我們想做 twitter tweet 的 clustering 及 classification，所以需要從 twitter 下載大量的 Tweet 做為實驗用途。一開始我是把這些 tweet 存成 JSON 在文字檔裡，不過隨著 tweet 量越來越多，用文字檔實在很難處理。由於本來就是存成JSON的格式，所以就想到了 MongoDB。



之前只有玩過try MongoDB, 從來沒有好好用過他，這次剛好有這個機會就來用一下 :P



裝好MongoDB後就可以開始始用了。由於這次 project 是用 ruby 寫的(因為有方便的&amp;nbsp;Twitter Gem&amp;nbsp;可以用)，所以我用了 Mongo Gem&amp;nbsp; 。Mongo Gem 的用法跟 Mongo shell 裡的用法差不多，簡單的用法如下，更多的</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/6568371649369316505/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/6568371649369316505?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6568371649369316505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6568371649369316505'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/05/mongodb.html' title='MongoDB 初體驗'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-7213230333518428447</id><published>2013-01-14T18:08:00.003+08:00</published><updated>2013-01-14T18:11:30.666+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>ActiveRecord like API for Python</title><summary type="text">之前看到 ActiveRecord 有一個很方便的功能: find_by_COLUMN，而 COLUMN 是那個 Table 裡的 columns。這用 Ruby 的 define_method 很好實做，當然 Python 也可以做到。下面是一段 POC (Prove of Concept) code:


# -*- coding: utf-8 -*-

from functools import partial

class Table(object):
    # 假設 columns 已經在別的地方定義了，這裡只直接列在 list 裡
    columns = [ &#39;id&#39;, &#39;name&#39;, &#39;subject&#39; ]

    @classmethod
    def generate_find_by_methods(cls):
        def </summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/7213230333518428447/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/7213230333518428447?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7213230333518428447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7213230333518428447'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/01/activerecord-like-api-for-python.html' title='ActiveRecord like API for Python'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-7161354064818487166</id><published>2013-01-14T15:44:00.000+08:00</published><updated>2013-01-14T16:59:51.297+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>Monkey Patching: Python V.S. Ruby</title><summary type="text">之前在寫Rails的時候還不是很熟悉Ruby，所以很多Ruby的特性沒有去深究。最近剛考完期末考比較有時間了，所以好好來看了一下Ruby。目前覺得學Ruby的好處就是會讓我想去比較Python，因為我個人還是Python的愛好著，所以看Ruby可以做到的功能就想要看Python可不可以做到。拿Ruby最有名的名能之一來說好了: Monkey Patching，從Wikipedia:

A&amp;nbsp;monkey patch&amp;nbsp;is a way to extend or modify the&amp;nbsp;run-time&amp;nbsp;code&amp;nbsp;of dynamic languages without altering the original&amp;nbsp;source code.


Ruby 可以很容易的動在舊有的Class/Module中加入新的Class/Method，</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/7161354064818487166/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/7161354064818487166?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7161354064818487166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7161354064818487166'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2013/01/monkey-patching-python-vs-ruby.html' title='Monkey Patching: Python V.S. Ruby'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-4943654645510980791</id><published>2011-12-13T15:55:00.000+08:00</published><updated>2013-05-31T18:08:22.688+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Decompressing vmlinux from vmlinuz</title><summary type="text">Find the gzip signature:

# od -A d -t x1 vmlinuz | grep &#39;1f 8b 08&#39;
0018016 48 8d 83 e0 c7 2e 00 ff e0 1f 8b 08 00 00 00 00

Decompress data after that:

# dd if=vmlinuz bs=1 skip=18025 | zcat &amp;gt; vmlinux

Note that 18025 = 18016 + 9

Reference: http://www.codeguru.com/forum/showthread.php?t=415186</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/4943654645510980791/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/4943654645510980791?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/4943654645510980791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/4943654645510980791'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2011/12/decompressing-vmlinux-from-vmlinuz.html' title='Decompressing vmlinux from vmlinuz'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-7749663414905360339</id><published>2011-11-07T20:18:00.001+08:00</published><updated>2013-01-15T17:30:02.021+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Web"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>SQL Job Queue的寫法</title><summary type="text">
最近網站要Deploy到MySQL上才發現之前寫得很多都有問題或是效率不好。

之前對於Job Queue的寫法是這樣寫:

def pop():
    stamp = time()
    db.query(Table).update({&#39;stamp&#39;: stamp})
    return db.query(Table).filter_by(stamp=stamp).all()


後來發現原來MySQL有SELECT .. FOR UPDATE的用法(是不是該修一修Database了XD)
加上了FOR UPDATE後，目前被選到的row就會被Lock起來。而其他的Process如果選到了
同樣的row，就必需等到commit後才能繼續。
所以就可以寫成:

def pop():
    records = db.query(Table).with_lockmode(&#39;</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/7749663414905360339/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/7749663414905360339?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7749663414905360339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7749663414905360339'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2011/11/sql-job-queue.html' title='SQL Job Queue的寫法'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-77466603183467396</id><published>2011-07-28T16:30:00.006+08:00</published><updated>2011-07-28T16:48:38.674+08:00</updated><title type='text'>Script for notifying process termination</title><summary type="text">When I&#39;m working, I usually have a lot of terminal open with different tasks running in different terminal. When I run a process that takes a long time(e.g. compiling, file prcoessing), I usually switch to another terminal. The annoying thing is that I need to constantly switch back to the terminal to check the progress of the process. Because of this, I wrote a script that monitors processes </summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/77466603183467396/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/77466603183467396?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/77466603183467396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/77466603183467396'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2011/07/script-for-notifying-process.html' title='Script for notifying process termination'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGs5orC2zWKwVP0z4rv9OHuliW4js2EBNCxBFHbvoA9YuVn5udToMbAxPfcxHgqkHO9I2RvZywsqRpcFGoA74rFoZ3vS15fnmg0AbtjtEfZlpeCIA4rQpFSfms580AS2khoDMT2lMxQT8/s72-c/%25E6%2593%25B7%25E5%258F%2596%25E9%2581%25B8%25E5%258F%2596%25E5%258D%2580%25E5%259F%259F_001.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-898794317995176912</id><published>2011-07-16T01:47:00.008+08:00</published><updated>2013-01-14T16:17:04.548+08:00</updated><title type='text'>Show GIT status on bash prompt</title><summary type="text">It&#39;s been a while since I last post, so I&#39;m quite surprised by the new blogger interface. Guess it&#39;s all because of Google+ integration :p

I&#39;ve been using git for quite a while, and it&#39;s by far the best VCS I&#39;ve ever used. The thing is, when you have a lot of branches in you project,it&#39;s really hard to keep track of what branch you are on. It would be nice to have a indicator or something that </summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/898794317995176912/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/898794317995176912?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/898794317995176912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/898794317995176912'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2011/07/show-git-status-on-bash-prompt.html' title='Show GIT status on bash prompt'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9ZNSolgbqpBxIsoIb08CqEI57TdhUo6a8Ea8xRXUWsUuFnpqZW1NoYxelEpIDYAxdPJeEmR5PozbRR1MKAHuiu175nI2iStMXeyu3DSmWFB66-lOt1cmHpbp7m-2jM9bM1mcAXbNVFWo/s72-c/%25E6%2593%25B7%25E5%258F%2596%25E9%2581%25B8%25E5%258F%2596%25E5%258D%2580%25E5%259F%259F_002.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-3097121091462039040</id><published>2011-04-04T11:39:00.002+08:00</published><updated>2013-01-14T15:01:10.239+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arch Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Hack"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell Script"/><title type='text'>Turning off discrete graphics for Acer Aspire 4750G</title><summary type="text">OPTIMUS on Linux has always been a pain in the ass for Linux users. It drains your battery power but you can&#39;t use it! Here is a way to turn it off on Linux, enjoy.


Install acpi_call


From github

git clone https://github.com/mkottman/acpi_call.git
cd acpi_call
make
sudo cp acpi_call.ko /lib/modules/`uname -r`/kernel/drivers/acpi

From AUR
If you are using Arch Linux, it&#39;s available at here


</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/3097121091462039040/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/3097121091462039040?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/3097121091462039040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/3097121091462039040'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2011/04/turning-off-discrete-graphics-for-acer.html' title='Turning off discrete graphics for Acer Aspire 4750G'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-11226264660500685</id><published>2011-01-24T10:01:00.002+08:00</published><updated>2013-05-31T18:08:22.672+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Embedded Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>Embedded System Final Project</title><summary type="text">Embedded System Fianl Project, utilizing
1. Qt-Embedded
2. libchewing (big thanks to Jserv)
3. SQLite
4. QtWebkit
5. ibus-boshiamy

Sources can be found at github

Here&#39;s a video which I demonstrated on our final project meeting.
(Sorry for the bad quality)

</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/11226264660500685/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/11226264660500685?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/11226264660500685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/11226264660500685'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2011/01/embedded-system-final-project.html' title='Embedded System Final Project'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/4hQFT5UfO5A/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-7168612383203756048</id><published>2010-10-22T21:38:00.001+08:00</published><updated>2013-05-31T18:08:22.705+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Hack"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="分享"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>嵌入系統實驗PXA300 Lab3</title><summary type="text">Ubuntu on ARM Machine?



No way.

其實是嵌入實驗做的數位相框XD

不過Ubuntu是真的有ARM版的喔

其他圖


數位相框操作影片:



這實驗+Exercise做到7點多...

雖然Code只有一點點，不過因為沒有JTAG不能用gdb遠端debug
就只好用printf大法! 所以一個bug要de很久。

不過做出來真的很爽XD</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/7168612383203756048/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/7168612383203756048?isPopup=true' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7168612383203756048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7168612383203756048'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/10/pxa300-lab3.html' title='嵌入系統實驗PXA300 Lab3'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBfzYY7fw_PmptjwOF2l37KAdUdJrNPfrrXTVrJUsLeA_aPYW_jwRttpW3MNzZvDoMwXYSLCsEtHqzozd9K2J-ZE5S44aNdQyabWTSnLTCd9fOOFgC5B-qO1eun9Iej0Sh1Q6BCIUCMZU/s72-c/DSC02158.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-5668698266917446039</id><published>2010-10-20T20:31:00.000+08:00</published><updated>2013-05-31T18:08:22.692+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="心語"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>資結HW2</title><summary type="text">讓我想到我小時候在哈電族上寫的文字編輯器XD
那時候寫的是有多個Mode的編輯器，有Insert和Normal Mode
所以那時候也要寫像這次資結的東西，移動遊標啊，插入，刪除等...
還因為要輸入中文，所以要偵測雙位元字元...
真的好懷念啊XD


現在想起來，要不是媽媽的同事在我升國中的時候送我哈電族
我大概很久以後才會開始寫程式吧XD
還記得那時候每天的娛樂就是在小小的哈電族上寫程式
寫過好多好玩的程式，有文字編輯器、行星模擬程式、3D引擎，還有好多小程式XD
不過上大學後就開始寫電腦上的，所以以前的code都不知道丟哪了
想起來還真可惜啊。


今天去問語音弄懂了很多觀念，這樣專題就不會只是下指令而不知道在做什麼了
話說要感謝另一個強大的助教，我問了很多怪問題他都能回答XD</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/5668698266917446039/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/5668698266917446039?isPopup=true' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/5668698266917446039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/5668698266917446039'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/10/hw2.html' title='資結HW2'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-7319972248779478189</id><published>2010-10-12T13:25:00.003+08:00</published><updated>2013-05-31T18:08:22.706+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="分享"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>Reference counting</title><summary type="text">前幾天有人在板上問了個有關C++ class內部member的記憶體管理問題，我那時後就寫了一小段Code來玩玩，所以順便丟上來XDReference counting是一種物件對內內部記憶體管理的方式。主要的原理是:假設現在我有一個Class RefObj內部有一個char*的member用來存字串，那今天我把一個物件assign給另一個RefObj A(&quot;testing&quot;);RefObj B = A;因為這個動做會呼叫Copy constructor，傳統內部實做的方式就是先動態分配一段新的記憶體再把內容複製過去，不過如果這個字串很大的話，複製一次不僅費時又耗記憶體，而且複製後可能B就不會再被變更了。Reference counting的方法就是在物件內部維護一個Reference count，像今天B = A，那A的Reference count就+1。可是在B = A的過程中並不</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/7319972248779478189/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/7319972248779478189?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7319972248779478189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/7319972248779478189'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/10/reference-counting.html' title='Reference counting'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-3442366833637881035</id><published>2010-10-11T02:07:00.002+08:00</published><updated>2010-10-12T02:53:15.918+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="分享"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><category scheme="http://www.blogger.com/atom/ns#" term="電影"/><title type='text'>PttXP 更新至0.1.5</title><summary type="text">Version 0.1.5
* 終於修好了刪除標頭的功能
* 登入重試次數增加為5次
* 修正GUI Lag的問題
* 這次大大的修正了登入問題，幾乎不會再登入失敗了

詳細資訊請至: http://berelent.blogspot.com/p/pttxp-ptt.html</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/3442366833637881035/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/3442366833637881035?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/3442366833637881035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/3442366833637881035'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/10/pttxp-015.html' title='PttXP 更新至0.1.5'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-6902410875388405901</id><published>2010-09-22T12:36:00.001+08:00</published><updated>2013-05-31T18:08:22.699+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="分享"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><title type='text'>PttXP 更新至0.1.2</title><summary type="text">* 修正了容易登入失敗的問題* 修正了Windows下換行的錯誤* 新增功能: &#39;delete post header&#39; 刪除PTT文章的標頭(網宣常用)詳細資訊請至: http://berelent.blogspot.com/p/pttxp-ptt.html</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/6902410875388405901/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/6902410875388405901?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6902410875388405901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/6902410875388405901'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/09/pttxp-012.html' title='PttXP 更新至0.1.2'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-855669439357186056</id><published>2010-09-22T12:33:00.004+08:00</published><updated>2013-05-31T18:08:22.717+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="分享"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><title type='text'>Open Source, Open Mind.</title><summary type="text">Revolution OS (http://v.youku.com/v_show/id_XMTEwMDA4MjA=.html)這是一部有關開放源始碼社群的記錄片很久以前看過一次，前幾天在噗上又看到很多人在轉噗所以我就一邊coding一邊要看了一次XD想要瞭解什麼是Open Source, Linux的人可以看看這部。不過聽Bill Gates的news letter內容那段還滿火大的XD現在越想越覺得Stallman真是偉大啊!如果沒有FSF，大概連Linux都不一定會出現，更別說這麼多開源、免費的軟體了!雖然他的想法是有些極端，不過也要有這種人，才能創造出這種理念我也相信商業軟體絕對有他的必要性像是現在Open Source界就還沒出現能夠媲美商業界的遊戲XD所以我覺的稱乎Linux為GNU/Linux才算是對Stallman以及他的貢獻表示尊重想想GNOME, GIMP, glib,</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/855669439357186056/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/855669439357186056?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/855669439357186056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/855669439357186056'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/09/open-source-open-mind.html' title='Open Source, Open Mind.'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7276177846879793950.post-9109163629058828029</id><published>2010-08-20T22:55:00.003+08:00</published><updated>2013-05-31T18:08:22.720+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell Script"/><category scheme="http://www.blogger.com/atom/ns#" term="所有文章列表"/><category scheme="http://www.blogger.com/atom/ns#" term="教學"/><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'>Debian/Ubuntu套件打包</title><summary type="text">很久以前寫過利用dpkg-deb來打包套件，其實這個方法非常麻煩，我後來都改用dh_make了。利用dh_make加上CDBS(The Common Debian Build System)，可以很方便的建立出一個deb包，這也是標準的打包方式。CDBS演變到現在己經非常方便了，打包者幾乎不用作什麼事。CDBS可以處理非常多常見的build system包括GNU Autotools、Python的setup.py、Qt的qmake、make、cmake等等，支援的列表可以在CDBS的Documentation裡找到。打包的步驟大約如下：將套件壓縮成 套件名稱_版本.orig.tar.gz，並放在套件目錄的同層目錄在套件根目錄執行dh_make -s -b。-s表示包裝成single binary，-b表示使用CDBS編輯debian/control、debian/rules在套件根目錄</summary><link rel='replies' type='application/atom+xml' href='http://blog.azhuang.me/feeds/9109163629058828029/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/7276177846879793950/9109163629058828029?isPopup=true' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/9109163629058828029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7276177846879793950/posts/default/9109163629058828029'/><link rel='alternate' type='text/html' href='http://blog.azhuang.me/2010/08/debianubuntu.html' title='Debian/Ubuntu套件打包'/><author><name>AZ Huang</name><uri>http://www.blogger.com/profile/05164412344318795173</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>