Tips in Aggregate

都是些很零碎的tips,涉及到linux, wordpress, css, php, English … 选择性阅读吧!

Douban and PHP

按照之前QQ签名秀的原理把豆瓣的个人广播系统也给提取出来了,效果请见此test页面

使用方法是把以下代码添加到你的页面里:

<script type="text/javascript" src="http://punkid.org/glade/douban/request.php?userid=<strong>username</strong>&numbers=5"></script>

其中userid后面跟的是你的豆瓣用户名,numbers后面是显示条目数(最多10条)。至于怎么polish这个douban的miniblog纯粹是你的CSS活。对了,输出编码是UTF-8。

PHP tips: 用addslashes这个函数可以对字符串进行转义。
Read More

大家都来学数学

Mathematics

1. 网上看到的两个号称The World’s Hardest Easy Geometry Problem (史上最难的初等几何题),我已经拿这两题折磨了不少人了,有兴趣的朋友一起来做做看!请先看清题目要求: 不能用三角函数求解,只能用最基本的证全等,作平行线之类的初中几何知识。

我花了一晚上时间加上一下午上课时间已经搞定了,至于结果…其实无所谓,我大可告诉大家,最重要的是过程!Procedure is the KEY POINT! 如果实在做不出来的话可以留言填写正确的e-mail地址,我把答案发给大家参考下。

提醒下:做不出来别泪崩…我承认第一题我看了网上某高手的参考答案的,不过我觉得他的步骤太复杂了,根据他的思路简化了过程。

2. 对数学感兴趣的朋友还可以看这道题,其实是道很经典的C语言题目了,不会编程不要紧,重要的是数学思路,题目很简单:

请问1000!(1000的阶乘, 1x2x3…x1000 … 这个括弧够冷的_-|||) 的后面有多少个0?

同样,算不出结果不要紧,这个确实需要靠程序语言来算,我需要知道的是你的算法思路。
Read More

VIM Tips

曾经很长一段时间都是在用Quanta Plus/Kwrite来写代码,Quanta Plus好在自动补充和标签页,而Kwrite好在轻便而有功能齐全。后来因为要对代码做批处理,于是慢慢转移到vim这款*nix下最强大的编辑器下来了,以至于现在几乎100%的时间都是用vim来写代码,包括在blogbus里给blogbus hack写日志。总结了一些我在用g?Vim过程中的tips:

自动识别各种中文编码

.vimrc文件里加入这句,基本上所有中文编码都没问题了,包括繁体中文

set fileencodings=ucs-bom,utf8,GB18030,Big5,latin1

粘贴文本格式乱了?

写代码时经常要从网页上或其他地方粘贴点代码过来用,但是一贴进vim里格式就乱了怎么办?.vimrc里加入这两句:

set nopaste 
set pastetoggle=<F10>

以上代码的作用是当你需要粘贴代码时先按下F10进入切换到paste,这时再粘贴进去就不会有问题了。为什么不直接设置set paste呢? 因为set paste在gVIM下可能会导致工具栏里的粘贴键失效。
Read More

Mr.Norton, My Mem Ram is Running Out

Even though I’m a linux daily-user, I still need Windows to do some PS, cyberbank things. A robust firewall is defly needed to me for system security and privacy protection. Symantec’s Norton Series have been my No.1 choice for almost 7 yrs (I used it from 2001 to 2007), it provides remarkable protection for my Windows XP+SP2 (never run Windows Update).

But after a few updates from Symantec recently, my system encountered serious Memory Leaks prob. I have a 50G+ partition which contains gigs of Mp3s, and lots of movies and videos. The NIS almost uses up both of my virtual and physical memory when doing the scanning on that Big partition, and it stops responding before finishing the scan. So I have to kill it manually, and my system becomes huge slow, which is barely tolerable.

I am never an antivirus software fan, basically i’d rather remove the virus by myself, I use Symantec’s NIS just becuz of their robust firewall. But they dont provide standalone firewall software, but packed with their Norton Antivirus into Norton Internet Security. The antivirus software takes too much memory, and it is just not the reason why i use NIS. So finally I decided to remove the whole NIS thing.

Now I’m using a free firewall named Comodo, which provides many advanced features and by far meets my need. What’s more, it’s quite SLIM! Look at my tasklist now. It only takes up 12MB memory.
Read More

电影常用英语

最近实在没心情写啥技术文章了,有篇关于CSS3的技巧文章技术继续往后拖。我还是写点学术性的东西好了 :D 一来比较受用,二来也还算有点意思,老少皆宜。

继上次带来的《PUNKID教你混英文论坛》,这次继续聊英语话题,谈谈与电影有关的常用英语,好歹我也算阅片无数 (A片属于我的盲区 -_-|||)。

我曾经在blogbus写日志时就把电影归类为flick,flick其实是movie,film的俚语说法。不过基本上这个俚语并不常用,绝大多数人还是习惯说film或者movie,也难怪…黑人们都忙着搞说唱了,没这雅兴看电影。

常见英语单词

  • Cinema : Cinema就是泛指电影,不是电影院! 你说咱们教科书教错了? 至少老外更愿意成电影院为Theater,我还没见过谁说Cinema的。Tom Hanks曾经就在Cannes Film Festival (嘎纳电影界) 上对媒体说了句很美国的话: I love cinema.
  • Box Office : 票房的意思
  • Blockbuster : 指卖座电影,在美国,以票房上亿级为blockbuster
  • Sleeper Hit : 指那些本来被人忽视的电影却获得了巨大的成功,像Edward Norton的The Illusionist (魔术师) 就是在参加美国Sundance Film Festival后大获成功。
  • Bomb : 票房毒药,就是票房上惨败的电影,例如…Olive Stone花巨资拍摄的The Alexander King (亚力山大大帝)…反正N多这类电影
  • Plot/Synopsis : 剧情大纲
  • Cast : 演员,也就是香港人喜欢说的卡司
  • Goofs : 穿帮镜头,还记得Jack船长帽沿上的ADIDAS标志吧 ^_^
  • Easter Egg : 彩蛋,西方流行复活节然后弄个啥复活蛋之类的,电影里也有,就是很多暗藏的有意思的或恶搞的东西,例如Fight Club里就有很多啊!
  • Read More

You Might Know

This site is powered by WordPress CMS & hosted by Dreamhustle Dreamhost.

And the theme is inspired by WP Typo and completely crafted under Gentoo Linux with VIM editor.

Sponsors

Monthly Archives

Search