自由學習的風

幽夢影 張潮 少年讀書,如隙中窺月;中年讀書,如庭中望月;老年讀書,如臺上玩月。皆以閱歷之淺深,為所得之淺深耳。

Ubuntu 12.04 LTS 發佈時程表

2012年3月29日 星期四

 

  • 2011.12.01 Alpha 1
  • 2012.02.02 Alpha 2
  • 2012.03.01 Beta 1
  • 2012.03.22 Beta 2
  • 2012.03.29 Beta 2
  • 2012.04.19 Candidate(預覽版)
  • 2012.04.26 Final (最終版 - 正式版)

Stack Overflow 上網友對於 python gui 技術的比較

2012年3月24日 星期六

python - Pygtk VS Pyqt VS WxPython VS Tkinter - Stack Overflow

I can't really say which one is the most used, but here are some feature comparisons:

Tkinter:

  • Built in to Python
  • Not native-looking GUIs by default before Python 2.7
  • Simple, easy to learn
  • In Python 2.7, ttk support was added (themed widgets)
  • Some GUI designers, but they aren't really as functional as those for other toolkits (but the simplicity of Tkinter alleviates this)

PyGTK:

  • Focused on Linux, works on Windows but can be a pain (thanks to detly for pointing this out)
  • Has a GUI designer, Glade
  • More functionality/weight than Tkinter
  • LGPL

PyGObject (GTK3, will replace PyGTK):

 

  • Still focused on Linux
  • Basically the same, but access is done through GObject
  • Relatively new, but will replace PyGTK

     

    New users wising to develop Python applications using GTK are recommended to use the GObject-Introspection features available in PyGObject. Existing authors of PyGtk applications are also recommended to port their applications to PyGObject if they wish to take advantage of new features appearing in GTK-3 and beyond.

-- http://article.gmane.org/gmane.comp.gnome.gtk%2B.python/15449

 

wxPython:

  • Cross-platform
  • Native widgets on each platform
  • More functionality/weight than Tkinter
  • GUI designers like wxGlade and others
  • wxWindows license (similar to LGPL)

PyQt:

  • Cross-platform
  • Native (or at least native-looking) widgets on each platform, styleable with CSS
  • More functionality/weight than Tkinter (probably the most here: JavaScript, QML...)
  • GPL licensed (commercial licenses available)
  • QtDesigner (made by Nokia) and utilities to convert to Python

PySide:

  • Python Qt binding (like PyQT) but LGPL
  • Cross-platform
  • API is almost the same as PyQT, but it only supports the "new-style" PyQT API.

PyQt, wxWidgets, and PyGTK all support OpenGL.

All three have Webkit bindings, though PyQt's/PySide's seem to be the easiest to use (it is integrated, after all).

Tkinter is the simplest, but least feature-complete. wxPython and PyQt are probably the most powerful in terms of what's built in (as far as I know), but PyGTK is also good, especially if you're targeting Linux. New apps using GTK should use GObject rather than the old PyGTK interface.

All are cross-platform. (PySide also supports MeeGo.)

All support Python 3, except for PySide and wxPython, whose support is forthcoming (0,1).

Some links: Developing user interface in Python - TkInter Vs PyQt

link|edit

[網韻無障礙] 公告送出後會出現錯誤訊息

2012年3月23日 星期五

這個學期開始,學校首頁改成網韻無障礙系統,安裝後看起來正常,但是新增【最新消息】後,都會出現一個錯誤訊息的畫面。

但是回到首頁又看得到剛剛公告的內容,所以進去主機裡檢查,發現 Apache Tomcat 並沒有執行,手動執行也沒有用,開啟 log 檔,裡頭的訊息是:

 

[2012-03-23 10:41:44] [174  javajni.c] [error] 找不到指定的模組。

[2012-03-23 10:41:44] [986  prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_05\bin\client\jvm.dll

[2012-03-23 10:41:44] [1260 prunsrv.c] [error] ServiceStart returned 1

看訊息,似乎是找不到 jre,進入路徑後,發現可以之前有安裝舊的版本又把它移除,該路徑內已找不到「jvm.dll」檔案了。

所以我把設定檔的路徑改成「C:\Program Files\Java\jre6\bin\client\jvm.dll」(這是另一個版本的 JRE)

結果似乎還是無法執行,後來在網路上找到資料,將 JRE 安裝路徑中的「./bin/msvcr71.dll」複製到「C:\Windows\System32」裡,再啟動 Tomcat,就可以順利執行了!

 

感恩網路啊!

[Ubuntu] 命令列下掛載網芳分享的作法

2012年3月21日 星期三

1. 不需密碼

# mount -t cifs //winserver/myshare /mnt

2. 需要帳號密碼

# mount -t cifs //winserver/myshare -o username=<username>,password=<password> /mnt

Ubuntu 12.04 Server beta1 開機後 resolv.conf 會重設?

2012年3月14日 星期三

最近安裝了一台 Ubuntu Server 12.04 beta 來試用,準備一切就緒後把 10.04 這個 LTS 版本升級到 12.04。

不過,今天連線更新時,重新開機後,居然無法對外連線,檢查了 /etc/resolv.conf 之後,發現裡面沒有任何 dns 的設定,所以,我就開心的寫下

nameserver 163.20.174.1
nameserver 168.95.192.1

 結果重新開機後,剛剛在 resolv.conf 裡的設定通通不見了,仔細一看,它在開頭的地方寫著:

 

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

 

看起來的意思是說,resolvconf 這支程式會動態產生 nameserver 的資料,所以不要直接修改 /etc/resolv.conf。

利用 「man resolvconf」看了一下說明,原來,nameserver 的設定都移到 /etc/network/interface 這個檔案裡了,直接在設定 ip 的時候,指定 dns 的資訊,簡單的用法如下:

dns-nameservers 203.27.153.5  168.95.192.1

dns-search slps.ntpc.edu.tw

 

介紹:Google Apps 管理介面 - Google Apps Manager

2012年3月13日 星期二

在練習 Google API 的時候發現這支程式,剛好蠻符合我的需求,可以用來管理 Google Apps 內的帳號。它可以用來

1.新增/刪除 帳號

2.停用/啟用 帳號

3.重設密碼

4.強迫登入後變更密碼

5.使用者清單/排序

下載位址:http://code.google.com/p/gappsmmc/downloads/list

操作步驟:

1. 安裝 gappsmmc 。

2. 執行「mmc」,開啟一個空的主控台。

3.點選「檔案/新增移除嵌入式管理單元」。














虛擬機器更新時,ESXi主機掛點

2012年3月12日 星期一

今天發生的慘事,做為圖館系統的 Ubuntu 虛擬子機在更新安裝時,ESXi 主機突然掛點,結果利用「 sudo apt-get -f install」後,就出現下列的訊息,然後沒法正常開機了。

裡頭的 mysql 有目前圖書資料及學生借還書的記錄,不見的話實在非常麻煩,好在已經虛擬化,Ubuntu 的Live模式又做得很不錯,就下載 Ubuntu 12.04 Beta Desktop 版本的 ISO 檔案,直接開機,將mysql 的資料移至另一台上,先讓它能夠作業。再來試試能不能修復!

PHP 5.3.X下 不支援 ereg()

2012年3月2日 星期五

PHP 從 5.3 開始不支援 ereg() 這個函數,不過,可以利用 preg_match() 來取代。

所以如果原本程式是

ereg("^[1-9]{1}[0-9]{4,5}$", $BookNO)

就改成

preg_match('/^[1-9]{1}[0-9]{4,5}$/', $BookNO)

就行了!

網路廣播-Web收聽版

網路廣播列表-Web收聽版

網路廣播-Web收聽版