2011年3月24日 星期四

如何將Outlook2003變成Gmail風格?

As title,
上班時碰到一個問題,光是找信就找了半天,
即使有Google desktop,卻常常找到的是不知道回了幾百次的回信,
特別是客戶回信也很懶,常常用A問題的回信直接回信問B問題,
這個時候就很想念Gmail的排序方式,
以會話群組的方式將信排列顯示,
這樣一來一個Topic就一次列出來,不用再找信找半天了...

以下以Outlook 2003示範,Outlook 2007應該也適用,2010好像不需要這麼麻煩?

首先,我們需要將寄出的信自動複製到收件匣一份,透過設定規則的方式實現。
在Outlook的工作列,工具→規則與通知。

新增規則後,選擇"從空白規則開始",傳送郵件後進行檢查

條件,經指定帳號寄出的信件(這裡通常是Exchange Server)
如果不是為了Microsoft的Exchange server,那用Gmail不就好了=>=
動作,傳送郵件副本給"自己"
例外條件可以直接跳過,除非有什麼例外?XD

接著設定另外一個規則,將自己的信件標示為已讀取,
  1. 選取郵件應檢查的時機,當郵件送達時進行檢查
  2. 條件,寄件者為自己
  3. 動作,標示為已讀取
這個時候我們應該有兩個規則,如下圖...

傳送郵件時傳一個複本給自己
收到寄給自己的信時標示為已讀取
設定規則後請仔細對照規則描述是否跟我的一樣...
接著請手動把寄件備份複製或是移到收件匣請自行評估若使用舊PST檔(有2G限制)可能會導致資料夾檔案爆炸XDDDD

這個時候,我們的收件匣應該就會很豐富,除了原先的信件以外,還包含了一大堆我們寄出去的信件,接著設定檢視方式。

在Outlook工具列,選擇排列→自訂

群組依據請選擇交談主旨,遞增是第一封信在上面,遞減是最後一封信在上面
排序請設定為收到日期(遞減)

大功告成,這個時候顯示應該就跟Gmail的風格類似,以會話群組將信件分組,
會話群組的排序以最新的信件日期排序。

以上就是將Outlook 2003設定成以會話群組排列的說明,感謝各位:)

2011年3月18日 星期五

Blogger Search and Replace

Well, I've transfer my blog couple times,
so it's has some image link from other static web hosting,
but someday, I got a mail that told me the service has expired,
because my adsl account has expired long time ago.

So, I thought, maybe I can move all file to other web hosting,
and replace all string in blogger.
then I try to find a solution or any way to replace a string in all article,
but I can't after I google it.

So I try to wrote it.

refer to Blogger API Developer's Guide: Python

Source:
def ReciveAll(self):
# Request the feed.
query = gdata.blogger.client.Query(max_results=9999)
feed = self.client.get_posts(self.blog_id ,query=query)
return feed

def SearchAll(self,str):
result = []
feed = self.ReciveAll()

for entry in feed.entry:
if (string.find(entry.content.text, str) != -1):
result.append(entry)
return result

def UpdatePost(self, entry_to_update):
return self.client.update(entry_to_update)

def main():
global email
global password

"""The main function runs the BloggerExample application.
NOTE: It is recommended that you run this sample using a test account.
"""

email = easygui.enterbox('Email:','Login')
password = easygui.passwordbox('Password:','Login')
sample = BloggerExample()
while 1:
array = []
menu_array = ['Search','Exit','Search and replace']
menu_choice = easygui.choicebox('Main menu', 'Main menu', menu_array)
#select = raw_input("1:Search\n2:Search and replace\n3:exit\n")
if menu_choice == 'Search':
#user_input = raw_input("Search:").decode(sys.stdin.encoding)
user_input = easygui.enterbox('Search:','Search')

results = sample.SearchAll(user_input)
for entry in results:
array.append(entry.title.text.encode("utf8"))

entry_choice = easygui.choicebox("test","test",array)
while(entry_choice!= None):
re_split=re.compile("[<>]")
for entry in results:
if entry.title.text == entry_choice:
line_array = re_split.split(entry.content.text.encode("utf8"))
line_array_contain = []
for line in line_array:
if line.find(user_input.encode("utf8")) != -1:
line_array_contain.append(line)
easygui.choicebox("Search Result","Search",line_array_contain)
break
entry_choice = easygui.choicebox("test","test",array)

elif menu_choice == 'Search and replace':
#src = raw_input("Search:").decode(sys.stdin.encoding)
src = easygui.enterbox('Search:','Search and Replace')
#dest = raw_input("Replace:").decode(sys.stdin.encoding)
dest = easygui.enterbox('Replace:','Search and Replace')
if easygui.ccbox():
results = sample.SearchAll(src)
for entry in results:
entry.content.text = entry.content.text.replace(src,dest)
#print entry.content.text
sample.UpdatePost(entry)
#print entry.title.text + "-> done"
easygui.msgbox(entry.title.text + "-> done")

elif menu_choice == 'Exit':
break

if __name__ == '__main__':
main()

GUI Version:
Source: http://dl.dropbox.com/u/3357679/Blog/Src_Blogger_search_replace_gui.7z
Prebuilt binary: http://dl.dropbox.com/u/3357679/Blog/Blogger_search_replace_gui.7z

Console Version:
Source: http://dl.dropbox.com/u/3357679/Blog/Src_Blogger_search_replace.7z
Prebuilt binary: http://dl.dropbox.com/u/3357679/Blog/Blogger_search_replace.7z

because that's practice program(it's mean beta release, use it at your own risk!)
please backup or export the blog before.
I've try replace in English and Traditional Chinese,
it's work, so, it's should support multi language.

Finally, it's worked!
but I found that maybe I need modify article by manually,
because it's look like upload image to Picasa will be much better?

How to disable GUI on armbian (revert the Desktop to server)

Check which Display manager that you're using currently cat /etc/X11/default-display-manager nodm should be default if you're choose...