Skip to main content

Posts

Showing posts from 2010

Install couchdb for lisp on Debian

// every time you meet PGP signature, skip the checking // other wise, try to accept the condition, treat it like it is successfully installed (for the example*.lisp, which sounds reasonable to skip) // I install the package in the system-wide directory // install debian package: couchdb, lisp package: clouchdb, cl-couchdb sudo apt-get install cl-asdf sudo apt-get install couchdb sudo apt-get install erlang (not sure if it is needed) sudo sbcl (require ‘asdf) (require ‘asdf-install) (asdf-install:install ‘cl-couchdb) error: cl-couchdb-test component missing sudo apt-get install cl-cclan (not sure if it is needed) (asdf-install:install ‘cl-couchdb) (asdf-install:install ‘clouchdb) debugger invoked on a SB-INT:STREAM-DECODING-ERROR in thread #<THREAD “initial thread” RUNNING {1002CA6DD1}>: decoding error on stream #<SB-SYS:FD-STREAM for “file /usr/lib/sbcl/site/clouchdb_0.0.11/examples.lisp” {1005FE5DB1}> (:EXTERNAL-FORMAT :ASCII): the octet sequence (195) canno

MarsEdit, Blogo, MacJournal trial

MarsEdit 沒有辦法所見及所得嗎? 感覺好像要在 HTML  中打,怎麼可能啊???? Blogo 可以所見及所得編輯,但 Preview 有特殊格式,看起來是舒服,不過不是直接重現Blog 該有的樣子,而且沒辦法把之前的文章 copy and paste。 MacJournal 也可以所見及所得,但是要 update contents 好像不是很直覺,但是他的確可以 copy and paste, 目前感覺這個最適用。

Setup xampp for mod_python

1. install flex (parser): sudo apt-get install flex 2. install xampp developer package 3. sudo  ./configure --with-apxs=/opt/lampp/bin/apxs if you get  "apxs:Error: Command failed with rc=65536..." => download the package: https://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk 4. After "sudo make", "sudo make install" in http.conf, add following lines: LoadModule python_module modules/mod_python.so <Directory /some/directory/htdocs/test>     AddHandler mod_python .py     PythonHandler mptest     PythonDebug On </Directory> 5. Write test python script "mptest.py": from mod_python import apache def handler(req):     req.content_type = 'text/plain'     req.write("Hello World!")     return apache.OK

Get attribute name and value of XML using minidom module in Python

#! /usr/bin/python # -*- coding: utf-8 -*- import xml.dom.minidom # your xml string xmlContent = "..." # dom parser dom = xml.dom.minidom.parseString(xmlContent) # get element with tag "photo"        photoList = dom.getElementsByTagName("photo") # get attribute id's value of each 'photo' element        for photo in photoList:     print photo.attributes['id'].value

Install python-mysqldb with lampp on Ubuntu

I try to download python-mysqldb from " http://sourceforge.net/projects/mysql-python/" and run the build/install command: python setup.py build I receive this message: EnvironmentError: mysql_config not found I set mysql_config to "/opt/lampp/bin/mysql_config" (I use lampp) and encounter this error message: cc1: error: unrecognized command line option "-mpentiumpro" cc1: warning: command line option "-felide-constructors" is valid for C++/ObjC++ but not for C cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C error: command 'gcc' failed with exit status 1 so I type sudo apt-get install python-mysqldb and find that I can finally import MySQLdb in python

screen command on linux

ctrl-a-c: create a new screen ctrl-a-n: switch to next screen ctrl-a-p: switch to previous screen ctrl-a-d: detach ctrl-a A: set title screen -ls: look up how many screens you open screen -r number(process_id?): switch to that screen

Procedure to install wordnet on Ubuntu (Linux)

// get tcl, tk before install wordnet sudo apt-get install tcl8.4-dev tk8.4-dev // in the WordNet-3.0 folder (Where your download and extract the package) // depends on where the above commend install tcl, tk ./configure --with-tk=/usr/share/tcltk/tk8.4 --with-tcl=/usr/share/tcltk/tcl8.4 make sudo make install // Now, wordnet will be in "/usr/local/WordNet-3.0"

Some Notes about Installing ConceptNet API & Divinsi on Windows

If you got this error: ValueError: numpy.dtype does not appear to be the correct type object, try to installing Numpy 1.3. After you install Divisi (ex. on Windows), copy the content under C:\Python25\Lib\site-packages\conceptnet-4.0rc2-py2.5.egg  to  C:\Python25\Lib\site-packages\csc. Otherwise, you might get error message like “module csc does not exist.”

線上筆記本、便利貼整理 Online Note Taking Service (Especially Sticky Note) List

Some of the note taking service I have tried! Sticky Note lino it Comment: 精美、除了沒有辦法 download as file + print  之外,應該是這個  list  中的  best choice 中文資料儲存沒有問題,不會變亂碼 無法 double click create note, 但是可以用拖拉方式產生 可以 share, send link, embed, rss, 可用 email post, 無法存檔 無法 double click to edit,但是跳出視窗的速度還 OK、可直接 drag & drop 有 public(group) vs. private 的設定 不能 print(應該說 print 的時候內容不會出現) 有 Task 功能 無法download as file (應該沒有可以的) squareleaf Comment: 比較不  fancy  ,但是簡單可愛 中文資料儲存沒有問題,不會變亂碼 可用 browser print, 但是排版沒有很好 可直接點選編輯(不用等跳出小視窗後再 input) 無法在空白地方 double click 產生新 Note 無法 share, 無法download as file postica Comment: 精簡,稍微制式 中文資料儲存沒有問題,不會變亂碼 點選編輯的時候很慢,反應遲鈍 可以 Print, 但是中文編碼要選 UTF-8 可以 drag & drop 無法 download as file, 無法 share wall wisher Comment: 精美 中文儲存有問題 雙擊 create note, 可以拖拉 每個 note 有 160 character 的限制 文字沒有 Format,無法調整大小, 顏色 可 share, send link, rss feed 無法download as file l