Jan'uary » 2008年 » 3月
save and save!
Jan 发表于 2008-03-29 21:41:01
Is it true?
Partly, only when u don't use locks. If you have a lock_version column in table, rails will enable lock automatically and in this case, ActiveRecord#save may throw StaleObjectError.
class AddLockToUser < ActiveRecord:Migration
def self.up
add_column :users, :lock_version, :integer, :default => 0
end
#......
end
# somewhere in your controller
user1 = User.find 1
user2 = User.find 2
user1.boss = 'Bill Gates'
user2.boss = 'Rex'
user1.save
user2.save # here a StaleObjectError will be throw
Sitting in my brand new office now
Jan 发表于 2008-03-28 13:21:39
给banshee lyric插件加上了中文歌词
Jan 发表于 2008-03-25 23:43:03
这个插件距离我期望的差距还挺大,一是用python写的,二是显示歌词也忒简单了点,一没timestamp二没滚动,原始社会的吧。用空了自己写一个新的
Don Estridge - from Wikipedia
Jan 发表于 2008-03-23 22:55:25
Philip Donald Estridge (June 23, 1937 - August 2, 1985), known as Don Estridge, led development of the original IBM Personal Computer (PC), and thus is known as "father of the IBM PC". His decisions dramatically changed the computer industry, resulting in a vast increase in the number of personal computers sold and bought, and creating an entire industry of hardware manufacturers of IBM PCs.
Estridge was born in Jacksonville, Florida. His father was a professional photographer. He graduated from Bishop Kenny High School in 1955, and from the University of Florida in 1959. He married Mary Ann Hellier in September, 1958. Three children would eventually be born from his marriage: Patricia Ann, Mary Evelyn and Sandra Marie.
He completed a BS in electrical engineering at the University of Florida, and worked at the Army, designing a radar system using computers, IBM and finally NASA's Goddard Space Flight Center until he moved to Boca Raton, Florida in 1969.
It was after this that he led the team which developed the IBM PC, and was responsible for choosing an open architecture and to buy parts and software outside of IBM. His choice of an open architecture and off-the-shelf components resulted in the IBM PC architecture becoming ubiquitous. His efforts began in at IBM Main Site in Boca Raton, Florida around 1980 with a team of just 14 people and a revenue base of zero. By the time he gave up leading IBM's PC division (known then as Entry Level Systems) in 1985, the division had 10,000 employees and annual revenue of .5 billion.
Don and Mary Estridge perished in the crash of Delta Air Lines Flight 191 at Dallas-Ft. Worth, Texas airport on August 2, 1985 along with several other IBM executives. He was 48 years old. The Estridges were survived by their three daughters.
Estridge has been honored many times. In 1999 he was identified in CIO magazine as one of the people who "invented the enterprise". The Don Estridge High-Tech Middle School--formerly IBM Facility Building 051--in Boca Raton, Florida, is named after him.
Tibet WAS,IS,and ALWAYS WILL BE a part of China
Jan 发表于 2008-03-23 00:23:03
Riot in Tibet: True face of western media
Jan 发表于 2008-03-23 00:21:09
ARE YOU LIVING IN A COMPUTER SIMULATION?
Jan 发表于 2008-03-22 21:10:38
gotcha in rails paginating_find plugin
Jan 发表于 2008-03-20 13:24:34
ps = Product.find :all, :page => {:size => 10, :current => 2}
Then the result of 2nd page will be returned. However, the ps.size won't return the true size of the result set of 2nd page, it will return the 'Total size' of products! You can't get the real size unless you write your own 'size'.
Really bad, use will_paginate instead. (I use this only for compatible reason)
13个旅游黑洞
Jan 发表于 2008-03-19 11:56:38
1、西双版纳: “洞房”陷阱
在西双版纳有许多所谓的民俗风情村。比如西双版纳原始森林公园
主婚人会说,爱伲姑娘给你戴幸运符的时候,如果你接受了
2、九寨沟:牛肉卖出天价钱
九寨沟的门票是明码标价地贵。正规的九寨沟门票为220元
总之,你很不小心就慷慨掏钱了。但很快你就会后悔不已
3、峨眉山:烧香就是烧钱
还在去峨眉山的路上,游客就会被导游上一堂课:在座各位都是有缘人
你瞪大眼睛看,最便宜的也要80元一尊,还没小拇指盖大
4、布达拉宫:门票飙涨
涨价就像一场瘟疫。在2006年7月1日青藏铁路全线开通之前
布达拉宫的游客绝大多数都来自西藏以外,作为汉藏两族人民友好的象
但将门票价格由100元增加到300元,每天2300人的参观人数
5、崂山:道士的麻衣诓术
崂山在人们的印象中,是和蓬莱仙境连在一起的:山上的道士个个道行
道长会带你进入旁边一间 “办公室”,先掏出他的证件给你看,告诉你他是多少多少代传人
6、吐鲁番葡萄沟:葡萄变味了
“吐鲁番的葡萄哈密的瓜,库尔勒的香梨人人夸”。吐鲁番葡萄沟内绿
葡萄沟的农家大都有葡萄可买,可这里最便宜的,也要50元一斤
7、西安:假古董乱真
到了西安,你可得当心。西安的一些地方,往往只能动眼,不能动手
在西安路边摊点购物时,更要千万小心。一些不良小贩专门把货物摆成
8、大理: “老乡”的
云南以产玉出名,又靠近玉石王国缅甸。来丽江的游客
“老板”还会坦诚地自报家丑,自报珠宝业经营内幕
9、阳朔:温情背后的狰狞
阳朔是驴子的天堂,但有不少驴子就栽在天堂的 “花架”下。阳朔的娱乐城不少,最是吸引寻求艳遇的游客
“特饮” 其实就是雪碧和可乐等饮料互相调在一起,几毛钱的一杯成本
10、坝上:骑马容易下马难
蓝天白云,乌兰公河清澈如镜,一碧万顷的草原,漫山遍野的野花散发
骑马是坝上最吸引游客的项目,收费当然不低。红山第三军马场附近的
11、泰山:山上山下“好汉” 多
泰山五岳独尊,自然景色威严、壮观,人文历史厚重
稍有辩解或不满,便是对泰山的不敬 ,轻则招来责骂威胁,重则招来泰山人群体的 “拳脚礼遇”,游客被打伤的事件不断发生。本人的感受是泰山下供游
12、三亚:无赖的天堂
三亚的无赖因互联网而 “臭名远扬”。小商小贩强买强卖,群殴游客的事件被互联网曝光
但深层问题不是管理问题,而是理念问题,干部素质问题
13、少林寺:烧香等同打劫
少林寺大雄宝殿前面的香龛里,最细的一柱香比胳膊粗
少林寺大雄宝殿前面的香龛旁边,端坐三个穿袈裟的和尚
签完名,和尚告诉你,凡签了名的香客,释永信法师都会亲自诵经念佛
那时候,你后悔都来不及了,名字已经签上去不说,香都拿到手里
香龛里面的高香,最便宜的六百,最贵的六千,那个游客选择的是最粗
看完这一幕,我转身走开,六千块钱一柱香,别说我烧不起
但他们没有,三个和尚坐在那里,干得勾当无异于骗人
于是钱点了一柱香,爬下磕了三个头,还没有爬起来
于是跟着和尚到他的木鱼前面,他拿出一个香袋,有六句诗
