| Y.B.'s profilewavewaving's 爬痕PhotosBlogLists | Help |
|
wavewaving's 爬痕我们是寄生虫,在网络上爬过... 9/7/2009 用鼠标手势实现firefox的Paste and Search在小众软件上看到 Paste and Go 的FireGestures 脚本(http://www.appinn.com/gestures-firefox-paste-and-go/ ),看着ms挺简单,不过却是很有趣。文章末尾,作者说要是有个 搜索剪贴板内容的功能 就好了。想想ms这功能也蛮有意思。于是搜索了下,执行搜索框的firefox函数。虽然不懂,不过依样画葫芦,居然成功实现了功能。呵呵,脚本非常简单,如下图:
文本如下:
var str = readFromClipboard();
if (!str) return; BrowserSearch.loadSearch(str, true); 名称和动作全是山寨的。:).
在firefox窗口里,按鼠标右键,向右,向上,再向左,即逆时针半圈 (R U L),就能打开一个页面并搜索剪切板里的内容了。
下边是个高级的多功能版本,参考http://www.xuldev.org/firegestures//feedback.php上的一些例子:
其功能是,如果当前点是链接,那么在新窗口页打开链接,如果是选择文本,(如果未选择,即文本为空,则取剪贴板内内容),若该文本是链接,则在新窗口页打开链接,如果是普通文本,则当作搜索内容进行搜索。不过这里,判断文本链接的正则非常初级,需要改进。
//Open link & Go /Selected & Go or Search/Paste & Go or Search
// (1) If you started gesture from a link, do 'Open Link in New Tab'
var srcNode = FireGestures.sourceNode; var linkURL = FireGestures.getLinkURL(srcNode); if (linkURL) { gBrowser.loadOneTab(linkURL, null, null, null, true, false); return; } // (2) Else if you select nothing, do 'Search for clipboard text'
var sel = FireGestures.getSelectedText(); if (sel == "") { sel = readFromClipboard(); if (!sel) return; } // (3) Else if you select text, do 'Search for Selection' if (sel){ if (sel.match(/^www.|^http:|html?$/)) // rough version, need further improvement {var taa = gBrowser.loadOneTab(sel, null, null, null, true, false); gBrowser.moveTabTo(taa, ++gBrowser.mCurrentTab._tPos);} else {BrowserSearch.loadSearch(sel, true); return;} } 9/5/2009 Tips for CAMFR installation with Python2.6to memorize the past day.
System info:
Ubuntu 9.10 alpha4
$ cat /proc/version
Linux version 2.6.31-5-generic (buildd@crested) (gcc version 4.4.1 (Ubuntu 4.4.1-1ubuntu1) ) #24-Ubuntu SMP Sat Aug 1 12:47:58 UTC 2009 $ python --version
Python 2.6.2+ CAMFR release version: camfr20070717
1, Insert one decaration line to CAMFR_20070717/camfr/defs.h due to some problem related to new GCC compiler.
#include <cstdlib>
or it will lead to some errors like:
...
camfr/primitives/section/../../util/vectorutil.h:66: error: call of overloaded abs(long int) is ambiguous
/usr/include/c++/4.4/cmath:102: note: candidates are: long double std::abs(long double) /usr/include/c++/4.4/cmath:98: note: float std::abs(float) ...
The declaration for std::abd(long int) is in 'cstdlib'
2, Using apt-get to install the softwares indicated in the guidance from INSTALL.
3, using the following file "machine_cfg.py" for setup. Chang it to fit your system.
#-----------------------------------------------
# This Python script contains all the machine dependent settings
# needed during the build process. # Compilers to be used.
cc = "gcc"
cxx = "g++" f77 = "gfortran -fPIC" # using gfortran compiler link = cxx
link_flags = "" # Compiler flags.
# # Note: for the Fortran name definition you can define one of the following # preprocessor macros: # # FORTRAN_SYMBOLS_WITHOUT_TRAILING_UNDERSCORES # FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE # FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES # For 32bit cpu, may use FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE
base_flags = "-DFORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES -DNDEBUG "
flags_noopt = base_flags
# -march=core2 is for current cpu, set others if different
flags = base_flags + "-O3 -march=core2 -g -funroll-loops "
fflags = flags + "-fPIC "
# Include directories. # special setting for python2.6
include_dirs = ["/usr/include/python2.6", "/usr/lib/python2.6/dist-packages"]
# Library directories. # I use intel mkl mathmatical library. Leave it blank if not.
library_dirs = ["/opt/intel/mkl/10.2.1.017/lib/em64t"]
# library_dirs = []
# Library names. # use the library related to your system
libs = ["boost_python-mt", "blitz", "mkl_lapack", "mkl_core", "gfortran"]
# Command to strip library of excess symbols:
dllsuffix = ".so"
strip_command = "strip --strip-unneeded camfr/_camfr" + dllsuffix strip_command = "" # Extra files to copy into installation directory.
extra_files = [("doc", ["docs/camfr.pdf"])]
#------------------------------------------
For python 2.6, it seems that "site-packages" is replaced by "dist-packages". 5/9/2009 今天是他,明天可能就是你5月7日晚上8点,一个灵魂飘走了。一辆逆向飞驰而至的红色跑车没给他机会,别说躲开,哼哈一声的机会都没给!
警察说车速是70码,行人说“100码?150码都有了吧?”好吧,就算70码,这一秒,它在20米外,下一秒,你就完蛋!
地点是文二西路西城广场东侧 紫桂花园和德加公寓两个小区门之间的斑马线,多么熟悉的地方!我想我肯定走过很多遍,以后也肯定还要经过。
你是否也曾在那儿来来往往,以后也还得来来往往?
“面对路人的指责,黑衣女士打圆场说:"他年纪还小,你们手下留情...." ”
!!! 给他留情?谁给我们留情!!今天是谭卓,明天就是你,就是我!
我不愿说“死者安息”这样的鬼话!我想如果真有灵,他也没法安息!
我想说,让生者安心,严惩凶手!!(我没法把它当作是起事故,这跟死于校园枪手下的人们有啥差别??)
发信人: yecha (夜叉·浪起何时?津在何方?), 板面: ZJUOnline
标 题: youku相关视频,大家都去顶一下 发信站: 飘渺水云间 (Fri May 8 23:22:27 2009), 转信 3/23/2009 “塔”林归来爱沙尼亚,波罗的海三国之一。以前最深的印象就是,苏联解体时,那几个小国是最早嚷嚷着散伙并实际行动的。最近的消息是,经金融危机折腾,这哥几个都走在破产的边缘。我们在船上打牌时,美女没勾引到,帅哥,酒鬼,壮男,赌徒倒是一个接一个地要求入伙。其中的帅哥就来自塔林tallinn。他去stockholm玩了一天,搭船回家。不过就这一天,就让他准备背井离乡了。在他嘴里,似乎在stockholm做条狗也比在爱沙尼亚幸福。这小哥的心理是被压力彻底整坏了,他自称三个月后估计就要失业!stockholm的街上行人的悠哉给了他莫大的刺激。lmy安慰他说,你应该去中国转几天。至少,这一点可以折射出爱沙尼亚目前的困境。
不过我们是游客,除了"爱"国的币值汇率和美女质量,我们不care!
出发前做功课,一个天气预报网站说tallin是上午小雪,下午阴偶有阳光。想想上次helsiki的阴沉,有点失望。不过到达后,大出意外,塔林的天气却是出奇的好。虽然这破网站给了我们一个惊喜,不过它还是呆到黑名单里,更能体现它的价值。网上说塔林真的是"塔"林, 但是这真字是有水分的。依稀地可以看到些尖顶,或是教堂,或城墙的堡垒,但离林似乎还有点距离。
有个朋友说去欧洲一趟,就不想去第二趟了,理由是,都太像了。虽然我只去了北欧几个地方,但也开始有点审美疲劳。每到一个地方,无非就是蓝天,碧海,+教堂。而数码时代,出游,与其说是旅游,不如说是hiking+外拍。在紧促的时间内,走马观花地从一个教堂奔到另一个教堂,然后找角度,构图,拍照,然后闪人。
我们到此一游,有图为证,仅此而已!
|
||||
|
|