Skip navigation.

Linux的用户

OS就应该是自己可以定制的。

Emacs配置备份

;; Gentoo
(require 'site-gentoo)
;; ECB
;;(require 'ecb)

;; Initialize Pymacs(included in gentoo)
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)

;; ????????
(set-default-font "Monospace-7")
;; Activate highlight in search and replace
(setq search-highlight t)
(setq query-replace-highlight t)

;; Browser
(setq browse-url-generic-program "chromium-bin")

;; ????????
(prefer-coding-system 'utf-8)
;; no create backupd
(setq make-backup-files nil)
;; save histroy
(setq savehist-file "~/.emacs.d/.savehist")
(savehist-mode 1)
;; scroll line by line
(setq scroll-step 1)
;; TODO/FIXME/DEBUG highlight
(add-hook 'c-mode-common-hook
(lambda ()
(font-lock-add-keywords nil
'(("\\<\\(FIXME\\|TODO\\|DEBUG\\)[\s:]" 1 font-lock-warning-face t)))))

;; load emacs script
(let ((default-directory "~/.emacs.d/"))
(add-to-list 'load-path default-directory)
(normal-top-level-add-subdirs-to-load-path))

;; YAML mode
(add-to-list 'auto-mode-alist '("\\.ya?ml$" . yaml-mode))
(autoload 'yaml-mode "yaml" nil t)

;; Javascript mode
;;(add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
;;(autoload 'javascript-mode "javascript" nil t)
(autoload 'js2-mode "js2" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))

;; CSS mode
(add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
(autoload 'css-mode "css" nil t)

;; Python mode
(autoload 'python-mode "python-mode" "Python Mode." t)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))

;; Auto complete
(require 'auto-complete)

;; Yet Another Snippet extension
(require 'yasnippet)
(yas/initialize)
(yas/load-directory "~/.emacs.d/site-lisp/yasnippet/snippets")

;; AUCTex
(add-hook 'LaTeX-mode-hook (lambda()
(add-to-list 'TeX-command-list '("XeLaTeX" "%`xelatex%(mode)%' %t" TeX-run-TeX nil t))
(setq TeX-command-default "XeLaTeX")
(setq TeX-save-query nil)
(setq TeX-show-compilation t)
))

;; SCIM Bridge
;;(require 'scim-bridge)
;; ????????????
;;(add-hook 'after-init-hook 'scim-mode-on)
;; ????????????
;;(add-hook 'after-make-frame-functions
;; (lambda (frame)
;; (with-selected-frame frame
;; (when window-system
;; (scim-mode-on)
;:wink:)))
;; ??????Emacs????"C-\"
;;(scim-define-common-key (kbd "C-\\") t)
;;(setq scim-cursor-color '("green" "blue" "limegreen"))

; Add cmake listfile names to the mode list.
(setq auto-mode-alist
(append
'(("CMakeLists\\.txt\\'" . cmake-mode))
'(("\\.cmake\\'" . cmake-mode))
auto-mode-alist))

(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.
'(cua-mode t nil (cua-base))
'(ecb-options-version "2.40")
'(js2-highlight-external-variables t)
'(js2-highlight-level 3))

(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.
)














PythonChallenge Level 2

如果不看答案,我是肯定做不出来这个题目。
原因竟然是因为 复制张贴
要玩PythonChallenge还是在自然的Python命令行下,不要使用IPython.

Only play pythonchallenge in nature python shell.
in ipython shell will output some spam in mess data!

fix google.com cache link[inside GWF]

, ,

modify your hosts (linux /etc/hosts) file:

append next content:
# Google Cache Server LIST
64.233.161.104  cache.google.com
64.233.167.104  cache.google.com
64.233.189.104  cache.google.com
66.102.7.104    cache.google.com
66.249.81.99    cache.google.com
216.239.39.99   cache.google.com
216.239.57.99   cache.google.com
216.239.63.99   cache.google.com


touch a userjs file:
EX: OPERA_PROFILE_FOLDER/userjs/google.cache.js
content like next:
// ==UserScript==
// @email supercys at hotmail dot com
// @modify SCys
// @include http://*google.com/search*
// ==/UserScript==

// google cache fix
window.opera.addEventListener('BeforeEvent.click',function(e) { // only opera magic event lisnter?
  var target = e.event.target;
  if(target instanceof HTMLAnchorElement && target.innerHTML=="Cached") {
    target.href = target.href
      .replace('search?q=cache:','search?~=cache.google.com&q=cache:') // fix link args
      .replace(/\/[0-9\.]*\/search\?/, '\/cache.google.com\/search?'); // fix server alias

    alert(target.href);
  }
},false);

[兴趣]关于纹身

纹身是很有趣的事物.
可以增加自己的特殊魅力.它是有一定的催眠效果.
不过一下一个文章可能会让你想清楚,才纹身:

关于纹身之后会不会后悔

Gentoo Crossdev Mingw32 USE "openmp" FIX

, ,

gentoo中的crossdev i686-mingw32总是无法使用"openmp".
今天心情原来就不好,所以上网查阅资料消灭它:-)
---
其实出错原因在/usr/portage/eclass/toolchain.eclass这个文件,详细作用没有探究.不过其中:
判断条件中"if is_crosscompile ; then"内,全文件1315行:
if [[ ${GCCMAJOR}.${GCCMINOR} > 4.1 ]] ; then
  confgcc="${confgcc} --disable-bootstrap --disable-libgomp"
if


查阅Gentoo BUG LIST:#234841虽然是修正4.3.1-r1的本机GCC编译器问题(好像并没有添加到,不过同样受用.拿来主义:-)修改如下:

if [[ ${GCCMAJOR}.${GCCMINOR} > 4.1 ]] && [[ ${GCCMAJOR}.${GCCMINOR} < 4.2 ]] ; then
  confgcc="${confgcc} --disable-bootstrap --disable-libgomp"
elif tc_version_is_at_least "4.2" ; then
  confgcc="${confgcc} --disable-bootstrap $(use_enable openmp libgomp)"
fi


4.2以后可以支持openmp.但是其他平台的编译器就不得知道是否支持了.
4.3支持omp 2.5spec而svn中的gcc支持omp 3spec

外部链接:
Gentoo BUG LIST:#234841