All posts tagged Share

天与弗取 反受其咎

天与弗取,反受其咎;时至不行,反受其殃

—— 《史记》

时不我待,终流于庸俗,鄙人也终干上了之前一直所为之不屑的放广告的勾当,这当然算不上什么出卖灵魂的事情,况且违心的事情我几乎每天都在干 i,就是一大俗人,没有必要也装不了清高;生活就像被强奸,反抗不得还不如闭眼好好享受吧;

广告永远是需要包装的,聪明的你也许已经发现,上篇文章 内容空泛,言不着意,却为了隐藏那一个 hyperlink 煞费苦心;标题曾特地包含的AD两字最终亦被要求remove,估计人家还想嘲笑我难道你连AD从来不说自己是AD这样简单的道理都不懂?

……

anyway,我已经开始享受了……

[Footnotes]
  1. 汗一把…… []

StarCraft II配不在高可玩就行

山不在高,有仙则名
水不在深,有龙则灵

—— 唐·刘禹锡《陋室铭》

鄙人以及鄙人的爱机(在他们看来则是陋机)已经被到处各种无数次的鄙视过了,但是…… but…… 阿Q就是这么诞生的:

参照这里优化,除了模型和影片,其它都比较无限趋向于杯具(一个极限函数);

但是…… but……

南阳诸葛庐,西蜀子云亭;
孔子云,何陋之有?

Python NameError: name ‘readline’ is not defined

Python 2.6.×已经装了有一定时日了,已经完全不知道python的世界都更新到什么境界了;标题这个issue在我更新到Lion之前就已经存在了,所以这不能算是Lion里才introduce的issue,这个还是得有一句说一句;

之前我在Snow Leopard一直没有找到fix的办法,当然主要的原因还在于我也没有那么急切的想fix它,至少对于一个几个月都基本不碰python的家伙而言,它的急迫性显然没有解决starcraft2破解版一联机就自动更新不能玩这个issue来的高,xd:)

BTW, 我只玩战役模式,Blizzard及其各路partner已经完全将starcraft2的对战模式变成网游,虽然我很想支持暴雪买正版,但是网游的各种消耗对我来说是无法容忍的.

貌似又有跑题的趋势…… anyway……

这个issue就是下面这样的,注意倒数第二行:

~ ➔ python
Python 2.6.6 (r266:84292, Sep 13 2010, 20:53:06)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Module readline not available.
Traceback (most recent call last):
  File "/Users/samson/.pythonrc", line 22, in <module>
    readline.read_history_file(historyPath)
NameError: name 'readline' is not defined
>>>

Continue reading →

OpenExplorer Eclipse Plugin 1.5.0

Thanks to jdkcn, Open Explorer now supports multiple file managers (not only nautilus) in Linux, it will detect your system file manager and use that by default i. I also added a preferences page for this, so you can customize it if the default doesn’t make you happy.

To upgrade, simply replace the plugin jar file, you can always download the latest versionii from here.

[Footnotes]
  1. dolphin (KDE), nautilus (Gnome), thunar (xfce), pcmanfm (lxde), rox, xdg-open, etc []
  2. 1.5.0.v201108051513 []

OpenExplorer Eclipse Plugin 1.4.0

Alright, this time I will let all the screenshots speak, as they’re inherently international.

So, what’s new?

anything else? Yeah!


Continue reading →

OpenExplorer Eclipse Plugin 1.3.0

Essentially, this is just a bug-fixing and maintaining release. In this release, we addressed an issue on linux platform (with nautilus installed, currently seems all bugs are reported from ubuntu), similar to this one.

I’ve thoroughly tested it in Eclipse Galileo (3.5), Helios (3.6), Indigo (3.7) on Mac OS X 10.6.8, Linux (Ubuntu 11.04) and Windows XP. While I try my best to maintain the plugin compatibility with the latest Eclipse version and latest OS release, it does may have some backward compatible issue. If you encounter any problems, please consider upgrading your eclipse and OS to the latest version and try again. If this doesn’t solve the problem, please do not hesitate to report defects here or simply leave comments below.

This project is hosting on github and the latest release can be downloaded here:
https://github.com/samsonw/OpenExplorer/downloads

To upgrade the plugin, just replace the jar package in your $ECLIPSE_HOME/plugins or $ECLIPSE_HOME/dropins directory.

Last but not least, thanks for all the support and feedback so far. I hope you enjoy it.

google.com please

访问google.com的时候被redirect? Here is how to solve this problem in any browser, not only in google chrome .

截图于opera,但obviously,在各种浏览器里面都work.

不支持multiple playlists的player不是好player

标题纯属瞎扯,其实非也;标题党?额好吧……

刚才给移植过来的 music player 又加了一个支持多播放列表的功能,原因并不是为了支持multiple而multiple,而是如果一个list下面的track太多会影响页面美观(列表太长了),所以完全处于对UI的考虑而加了多playlists的支持,这不是mvc这可是vmc……

另外提一下一直还没有把source放到github的原因,主要原因有二,之一是因为人家原创作者都没有放到github上去,我先跑去抢了名字似乎有点喧宾夺主,我一直觉得这些改动作为这个plugin在github上的一个fork存在是最ideal的形式;之二则是我开发的时候不小心或者说是无所谓的将mp3和ogg等格式文件加到了git里面…… 整个project本身就不小,加之git存储的东西一下子翻了一番,印象中github有个project大小的限制,我感觉我是超了,当然workaround就是把这些二进制都移除git,但是由于原因一我目前也懒得动了。

另外考虑音乐文件普遍流量恐怖,所以放到了号称××××都unlimited的hostmonster上去,而不去折腾我那流量有蛋疼限制且超流量有如坐飞机行李超重般惩罚严厉的小vps了;所以最后域名是samsonw.info而不是crash4.us,所以也可以说 everything happens for a reason.

好了anyway,enjoy!

喝coffee写coffeescript

好吧,这回中文,亚历山大……

其实英文有英文的好处,比如英文会使本人比较focus,因为没兴趣也没能力瞎扯,于是主题明确而不拖泥带水;中文的坏处便是我会常常迷失主题,跑题千里后蓦然回首,那人竟然还在灯火阑珊处……

anyway……

前几天看到sunng的take my coffee,一看title以为必是coffeescript,结果竟偏是如此纯结(纯是纯净水的纯),看来还是哥多虑了…… 想来最近的blog title里面随便带个coffee都会让人浮想联翩,coffee script的“火”冒三丈也就可见一斑。

标题起源于上周想到一个idea,便是让live fortune定时publish到新浪微博或是twitter,目前新浪的publisher已经实现,并顺便refactor了一下code,让之后twitter publisher的加入变的十分简单(在plan中);实现的过程中再次发现了sina clone的迹象,因为其oauth实现竟然连url抄的都一模一样,倒是方便了实现,因为twitter oauth的sample code基本上改个site base url后就能完全照搬,暂且认为这是新浪有意而为之的吧,目的便是方便第三方开发人员……

本来这篇文章一直draft着,再加上周末一直不available,所以拖到现在,为了应景,还特地决定一大早先跑去喝杯咖啡后再来奋笔疾书,无奈公司咖啡机几近坏掉,我修了半天搞的满身都是最后还是勉强喝到了一点味道有稍许异样的不知道还能不能叫做coffee的”coffee”,看来杯具如我辈是永远达不到sunng那种小资情调的呵呵;

吃葡萄不吐葡萄皮,不吃葡萄倒吐葡萄皮. i

[Footnotes]
  1. 喝coffee不写coffeescript,不喝coffee倒写coffeescript []

Deploying Live Fortune (Node.js) with Nginx and Monit

Here we will use Nginx to serve static resources and reverse proxy dynamic requests to the Node server. We will also use Monit to monitor the Node server and restart it automatically in case it crash. This is also the deployment I did at fortune.crash4.us.

[Nginx: Static Resources]
livefortunes use express.static to server static resources, but for better performance we will use nginx to do the job that it’s designed and built to do.

Config nginx to server all the static resources which located under /public :

server {
    listen       80;
    server_name  fortune.crash4.us;
    root         /path/to/livefortunes/public;
    index        index.html;

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
         root   html;
    }
}

Continue reading →