普世

梅玺阁闲话 013
普世
  普世是个很吓人的词,universal value,有了这个词,我们才知道有些事我们做错了,我们才知
道有些事国家做错了。
  没有这个词,就没有错了。
  一个人做错了,叫刚愎;一个国家做错了,叫独裁。

My dotemacs file

由于网站的设置问题,引号会变掉,我也懒得调整,这里是原始文件
—————————————-
(defun other-window-backward () ; this is a function to combine on M-up keyset, to active
“Back one window”
(interactive)
(other-window -1))

(defun line-to-top ()
“Move cursor to top”
(interactive)
(recenter 0)
)

(global-set-key “M-c” ‘clipboard-kill-ring-save)
(global-set-key “M-‘” ‘line-to-top)
(global-set-key [M-left] ‘previous-buffer)
(global-set-key [M-right] ‘next-buffer)
(global-set-key [M-up] ‘other-window-backward)
(global-set-key [M-down] ‘other-window)
(global-set-key [M-kp-add] ‘enlarge-window)
(global-set-key “M-]” ‘enlarge-window)
(global-set-key [M-kp-subtract] ‘shrink-window)
(global-set-key “M-[” ‘shrink-window)
(global-set-key “M-s” ‘save-buffer)
(global-set-key “M-a” ‘mark-whole-buffer)
(global-set-key [f8] ‘menu-bar-mode)

(tool-bar-mode nil)
(menu-bar-mode nil)
(scroll-bar-mode nil)

(setq-default cursor-type ‘bar)
(blink-cursor-mode 1)

(auto-image-file-mode t)

(setq browse-url-generic-program (executable-find “google-chrome”))
(setq browse-url-browser-function ‘browse-url-generic)

(setq frame-title-format “yuleshow@%b”)

;; ========= Set colours ==========

;; Set cursor and mouse-pointer colours
(set-cursor-color “green1”)
(set-mouse-color “goldenrod”)

;; Set region background colour
(set-face-background ‘region “white”)

;; Set emacs background colour
; (set-background-color “black”)
(set-background-color “#000000002B2B”)
(set-foreground-color “green1″)

; (setq default-frame-alist
; (append default-frame-alist
; ‘((foreground-color.”green1″)
; (background-color.”black”)
; (cursor-color.”green1″)
;)

(add-to-list ‘load-path “~/.emacs.d/site-lisp/wubi”)
(require ‘wubi)
(wubi-load-local-phrases) ; add user’s Wubi phrases
(register-input-method
“chinese-wubi” “Chinese-GB” ‘quail-use-package
“WuBi” “WuBi”
“wubi”)
(setq default-input-method “chinese-wubi”)

(add-to-list ‘load-path “/usr/share/emacs/site-lisp/w3m”)
(require ‘w3m-load)
;; (require ‘w3m-e21)
;; (provide ‘w3m-e23)
(setq w3m-use-favicon nil)
(setq w3m-command-arguments ‘(“-cookie” “-F”))
(setq w3m-use-cookies t)
(setq w3m-home-page “http://www.yuleshow.com”)
(setq w3m-display-inline-image t)

;; (add-to-list ‘load-path “~/.emacs.d/site-lisp”)
;; (require ‘cygwin-mount)
;; (cygwin-mount-activate)
(setq evernote-enml-formatter-command ‘(“w3m” “-dump” “-I” “UTF8” “-O” “UTF8”)) ; option
(add-to-list ‘load-path “~/.emacs.d/site-lisp”)
(add-to-list ‘load-path “~/.emacs.d/site-lisp/emacs-evernote”)
(require ‘evernote-mode)
(global-set-key “C-cec” ‘evernote-create-note)
(global-set-key “C-ceo” ‘evernote-open-note)
(global-set-key “C-ces” ‘evernote-search-notes)
(global-set-key “C-ceS” ‘evernote-do-saved-search)
(global-set-key “C-cew” ‘evernote-write-note)
(global-set-key “C-cep” ‘evernote-post-region)
(global-set-key “C-ceb” ‘evernote-browser)

(require ‘jabber-autoloads)

(setq jabber-account-list ‘(
(“yuleshow@gmail.com”
;; (:password.”*************”)
(:network-server . “talk.google.com”)
(:port . 443)
(:connection-type . ssl))
))

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won’t work right.
‘(font-use-system-font t)
‘(tool-bar-mode nil)
‘(weblogger-config-alist (quote ((“default” “http://www.yuleshow.com/wordpress/xmlrpc.php” “Yule Show” “” “1”)))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won’t work right.
‘(default ((t (:inherit nil :stipple nil :background “black” :foreground “green1” :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight light :height 143 :width normal :foundry “unknown” :family “Ubuntu”)))))

(require ‘weblogger)

;; Twittering mode
;; Download https://raw.github.com/xwl/twittering-mode/f5c3ace6925f9f69340d9cbfccce08a7689cfe46/twittering-mode.el
(add-to-list ‘load-path “~/.emacs.d/site-lisp/twittering-mode”)
(require ‘twittering-mode)

(setq twittering-use-ssl nil
twittering-oauth-use-ssl nil)
(setq twittering-icon-mode 1)
(setq twittering-enabled-services ‘(sina))
(setq twittering-accounts ‘((sina (username “yuleshow@mac.com”)
(auth oauth))))

;; edit-server mode
;; Download https://github.com/stsquad/emacs_chrome/blob/master/servers/edit-server.el
(require ‘edit-server)
(edit-server-start)

A quick note for new ubuntu install and emacs configuration

1.Create the USB bootable disk by official tool PENDRIVE under windows, don’t use Startup Disk Creator under Ubuntu.
2. Boot into.
3. Create a user, and give the administrator’s rights, use terminal and sudo passwd to give the password to the new created user, once it has the password, the account will be enabled.
4. Log out and use the new user to log into the system, reboot won’t help.
5. Connect network, enable wireless, and etc.
6. Install launchy, chrome through web/downloading
7. terminal
sudo apt-get install ibus-table-wubi
sudo apt-get install cvs
sudo apt-get install autoconf
sudo apt-get install subversion
sudo apt-get install ruby
sudo apt-get install emacs23
sudo apt-get update
sudo apt-get upgrade
8. Install wubi mode for emacs
http://www.yuleshow.com/files/20111205_emacs-wubi.tar.gz
Unpack to ~/.emacs.d/site-lisp/wubi
9. Install w3m mode for emacs
terminal
sudo apt-get install w3m
cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m
cd emacs-w3m
autoconf
./configure
make
sudo make install
10. Install evernote mode for emacs
terminal
cd ~/.emacs.d/site-lisp
svn checkout http://emacs-evernote-mode.googlecode.com/svn/trunk/ emacs-evernote-mode-read-only
mv emacs-evernote-mode-read-only emacs-evernote
cd emacs-evernote/ruby
sudo ruby setub.rb
11. Install jabber for emacs
https://sourceforge.net/projects/emacs-jabber/files/emacs-jabber%20beta%20versions/0.8.90/
terminal
tar -zxvf emacs-jabber—–.tar.gz
cd emacs-jabbar-0.8.90
~/.configure
make
make install
sudo make install
12. Install weblogger mode for emacs
http://www.emacswiki.org/emacs/xml-rpc.el
save to ~./emacs.d/site-lisp
https://launchpad.net/weblogger-el
save to ~./emacs.d/site-lisp
13. Install twittering mode for emacs
https://github.com/xwl/twittering-mode/raw/f5c3ace6925f9f69340d9cbfccce08a7689cfe46/twittering-mode.el
14. Install edit-server.el mode for emacs
https://github.com/stsquad/emacs_chrome/blob/master/servers/edit-server.el
save to ~./emacs.d/site-lisp

跳槽

梅玺阁闲话 012
跳槽
  “我又勿是寻弗着生活,人家开个工资好好叫要多来。”
  “人家公司诺,帮我一样个岗位,做个事体比我少,赚得要比我多交关来!”
  “伊拉请之我好几趟来,工钿翻一倍,还有奖金,我勿高兴去伐啦!”
  这些都是极普通的上海人,这些话也是我们每天都能听到的。如果哪个不识货的老板,认为这些员工是公司的不稳定因素,那么就是大错特错了。这些人不会真正跳槽的,他们只是说说而已,他们愿意继续留下来,要么上下班路近,要么上下班时间巧正好可以接送小孩,反正总是有着这样那样对公司留恋的原因。
  那些真正要跳槽的,就是公司大会上发表我爱公司演讲的人,那些人早已把公司的数据保存在了U盘上,早已用公司的打印机打出了精美的简历,早已在上班时间偷偷地溜出去面试好多回了。这些人之所以还没有离开,那是因为还没有找到好的下家,但他们绝对不会在公司里说任何抱怨。
  大家仔细地想一想,是不是这个道理?
  其实我们许多人整天骂政府,也是这个道理。

emacs Evernote

You never know where is the key point.  At the very beginning, I thought the most difficult part will be the configuration for Evernote mode and w3m will be the easiest.  Guess what?  The w3m mode cost me around entire week including installed a brand new ubuntu.  I only spent 3 minutes on evernote mode, so i said you know how much time you need just only for a tiny problem.   Please treat any programmer/administrator well.

The official website for the evernote mode project is at:  http://www.evernote.com/about/developer/projects.php
The reference document at: http://emacser.com/evernote-mode.htm

Windows 7

—————————-

  1. Install w3m and configure all the thing well (check my other articles)
  2. Run cygwin terminal (assuming cygwin is already installed)
  3. Enter ~/.emacs.d/site-lisp
  4. svn checkout http://emacs-evernote-mode.googlecode.com/svn/trunk/ emacs-evernote-mode-read-only
  5. Change the folder name emacs-evernote-mode-read-only to emacs-evernote, you can leave it as is without modification.  I do this only for my personally consistence requirement.
  6. Enter emacs-evernote/ruby
  7. ruby setup.rb
  8. Get cygwin-mount.el (http://www.emacswiki.org/cgi-bin/wiki/cygwin-mount.el)
  9. .emacs
    (add-to-list ‘load-path “~/.emacs.d/site-lisp”)
    (require ‘cygwin-mount)
    (cygwin-mount-activate)
    (setq evernote-enml-formatter-command ‘(“w3m” “-dump” “-I” “UTF8” “-O” “UTF8”)) ; option
    (add-to-list ‘load-path “~/.emacs.d/site-lisp/emacs-evernote”)
    (require ‘evernote-mode)
    (global-set-key “C-cec” ‘evernote-create-note)
    (global-set-key “C-ceo” ‘evernote-open-note)
    (global-set-key “C-ces” ‘evernote-search-notes)
    (global-set-key “C-ceS” ‘evernote-do-saved-search)
    (global-set-key “C-cew” ‘evernote-write-note)
    (global-set-key “C-cep” ‘evernote-post-region)
    (global-set-key “C-ceb” ‘evernote-browser)

That it, enjoy!

emacs 23 with w3m

OK, the story is little complicated here.  Firstly, I found there is a mode designed for Evernote.  I do really like it, so I tried to run the mode on my Windows 7/Emacs 23 environment.  But unfortunately, it require w3m loaded first.  Then the nightmare starts.  After several days deep studying, now I know the way for Windows and Ubuntu now.  Will check on Mac later.

For ubuntu 10.10

  1. Install ubuntu 10.10 with default options
  2. Install the following packages
    • emacs 23
    • w3m
    • cvs
    • autoconf
  3. Get emacs-w3m mode by
    cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m
  4. Enter the folder then:
    autoconf
    ./configure
    make
    sudo make install
  5. Then add the following to the .emacs
    (add-to-list ‘load-path “/usr/hsare/emacs/site-lisp/w3m”)
    (require ‘w3m-load)
    (require ‘w3m-e21)
    (provide ‘w3m-e23)
    (setq w3m-use-favicon nil)
    (setq w3m-command-arguments ‘(“-cookie” “-F”))
    (setq w3m-use-cookies t)
    (setq w3m-home-page http://www.yuleshow.com)
    (setq w3m-display-inline-image t)

 

For Windows 7

  1. Have Windows first
  2. Get patched emacs can be found here:
    http://ourcomments.org/cgi-bin/emacsw32-dl-latest.pl
    select the patched version
    Which I downloaded is http://ourcomments.org/Emacs/DL/EmacsW32/EmacsCVS/ptch/Emacs-23-CvsP091103-EmacsW32-1.58.exe
  3. Install emacs and add emacs.exe location to the environment PATH
  4. Install cygwin and add bin location to the environment PATH
    Caution: cvs and w3m are optional, need manually checked
  5. cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m
  6. Put downloaded emacs-w3m folder into site-lisp folder
  7. Run
    emacs -batch -q -no-site-file -l w3mhack.el NONE -f w3mhack-nonunix-install
  8. .emacs
    (add-to-list ‘load-path “~/.emacs.d/site-lisp/emacs-w3m”)
    (require ‘w3m-load)
    (setq w3m-use-favicon nil)
    (setq w3m-command-arguments ‘(“-cookie” “-F”))
    (setq w3m-use-cookies t)
    (setq w3m-home-page “http://www.yuleshow.com”)

References:

http://hi.baidu.com/muen2008/blog/category/Emacs
http://bbs.ctex.org/viewthread.php?tid=44404

靠右

梅玺阁闲话 012

靠右

  经常在媒体上看到呼吁,让大家在地铁站里乘自动扶梯的时候靠右站立,以便让有急事的人可以从左边行走。

  据说这样的呼吁,是为了和国际接轨,因为外国的地铁里的自动扶梯,人们都是靠右站着的,留出道来给别人行走。

  听上去很有道理吧,其实不然。在一个奉左为上的地方要大家靠右,简直其心可诛。

  外国为什么可以?

  那是因为外国的地铁有很多是没有楼梯的!

  全上海所有的地铁,都有楼梯,楼梯的数量要比自动扶梯还多,谁要有急事,就走楼梯嘛!而且高峰时段,自动扶梯站两排人,总比一排的运量大吧?别和我扯什么高峰时候楼梯走不快,高峰时候自动扶梯也走不快。

  谁要有急事,自己快步走楼梯,还有比这更天经地义的事吗?

  有的,让领导先走。

New Wubi IME for emacs

This is just a modified Wubi IME for emacs, it’s under GPL. Originally, it’s from http://daiyuwen.freeshell.org/gb/wubi/wubi.html I modified wubi-rules.el file and added 51,473 words to it.

Also, I added a full-width, Quanjiao, space  by pressing “=”.

This IME can use M-x wubi-toggle-quanjiao-banjiao to toggle Quanjiao and Banjiao, also can use M-x wubi-add to add personal word phase.

The package can be download here, you can load Wubi by adding the following code into .emacs

(add-to-list 'load-path "<destination>/wubi")
(require 'wubi)
(wubi-load-local-phrases) ; add user's Wubi phrases
(register-input-method
 "chinese-wubi" "Chinese-GB" 'quail-use-package
 "WuBi" "WuBi"
 "wubi")
(setq default-input-method "chinese-wubi")