Thu 25 October, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlWed 24 October, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
Fred Thompson has just released his Border Security and Immigration Reform Plan. It's great. He understands what needs to happen to stop the flow of illegal aliens into this country, and how to deal with those illegals who are already here. Oh, if only we could actually get this plan implemented!
For those who don't want to take the time to read it, here are the main points.
- No Amnesty — Do not provide legal status to illegal aliens.
- Attrition Through Enforcement — Reduce the number of illegal aliens through increased enforcement against unauthorized alien workers and their employers.
- Enforce Existing Federal Laws — Enforce the laws Congress has already enacted to prevent illegal aliens from unlawfully benefiting from their presence in the country.
- Reduce the Jobs Incentive — Ensure employee verification by requiring that all U.S. employers use the Department of Homeland Security's electronic database (the E-Verify system) to confirm that a prospective employee is authorized to work in the U.S.
- Bolster Border Security — Finish building the 854-mile wall along the border by 2010 as required by 8 USC 1103.
- Increased Prosecution — Deploy the additional assets outlined above to prosecute alien smugglers ("coyotes"), alien gang members, previously deported felons, and aliens who have repeatedly violated our immigration laws much more vigorously.
- Rigorous Entry/Exit Tracking — Complete the implementation of a system to track visa entrants and exits, as has been required by federal law for more than ten years, and connect it to the FBI's National Crime Information Center (NCIC), in order to curb visa overstays and permit more effective enforcement.
- Maximize Program Efficiency — Reduce the backlogs and streamline the process for immigrants and employers who seek to follow the law.
- Enhanced Reporting — Improve reporting to the government by businesses that rely on temporary workers so that the government can track whether the visa holder remains employed.
- Modernize Immigration Law/Policy — Change the nature of our legal immigration system to welcome immigrants who can be economic contributors to our country, are willing to learn the English language, and want to assimilate.
- English As Official Language — Make English the official language of the United States to promote assimilation and legal immigrants' success, and require English proficiency in order for any foreign person to be granted lawful permanent resident status.
- Freedom from Political Oppression — Preserve U.S. laws and policies to ensure that the United States remains a beacon and a haven for persons fleeing political oppression, while assuring appropriate admission standards are maintained.
- Service to Country — Place those foreign persons who are lawfully present in the country and who serve honorably in the Armed Forces of the United States on a faster, surer track to U.S. citizenship.
Go Fred!
add to del.icio.us. look up in del.icio.us.
add to furlTue 23 October, 2007
Mon 22 October, 2007

2. Logic (of a proposition) necessarily true or logically certain.
add to del.icio.us. look up in del.icio.us.
add to furl
有好长一段时间,这个列表没再更新过,中间虽然我也读了很多书,也学到了很多东西,但却没有哪本书如这几本书一样给我带来巨大触动。新近加入我这个列表的书是《修改代码的艺术》,英文名是《Working Effectively with Legacy Code》。
对于很多软件开发人员来说,加入一个公司,通常意味要面对一大堆之前留下的代码。而面对沉重的负担,大多数人的感觉都是无可奈何。让无奈成为往事,也就是这本书的价值所在。
在我看来,这是一本讲解如何编写测试的书。之所以遗留代码让人头痛,除了复杂的逻辑,改动会带来怎样的后果是一件让人心里没底的事,而测试的存在可以大幅度降低这种恐惧。但是,许多代码在开发时并不考虑测试,这样做的结果就是让测试几乎成为一件不可能完成的任务,一个常见的例子就是代码中访问数据库。即便写出测试代码,漫长的测试过程也会让它失去一部分应有的作用,我们希望得到的是快速的反馈。所以,对于
无测试而言,知道编写测试是一种境界的提升,写好单元测试则是一种更高的境界。如果能够让测试驱动开发,从开发之初便考虑测试,并懂得如何写好测试,开发者应该不会陷自己于一种难为的境地,这也应该成为专业程序员应该具备的基本技能。
至于这本书的具体内容,我的评价是实用。具体的手法,很难在这里一一列举,但是,以我的开发经验来看,
许多似曾相识的代码不断的出现在书中,而作者举重若轻的处理手法,正是让我有拍案惊奇的地方。实际上,回味起来,每个手法都不是什么很高超的技法,但正是因为见识过类似的代码,才能体会到这种手法的价值所在。所以,相对于程序新人,它更适合有经验的人。
之所以说这本书更适合有经验的人还因为,这本书中谈及的内容涵盖设计、测试、重构等诸多方面:通过重构,解开代码内的耦合,让其可测。这恰恰是前面提到的那三本书所讲的内容。也只有懂得了这些基本内容才能体会到那些具体手法的价值所在。依然记得当年读《重构》时,在提取和内联之间迷茫了好久,直到后来经过了许多开发实践才体会到这些做法的真正含义。
如果说不足,那么,这本书缺乏一个列表,就像Martin Fowler为《重构》所做的那样,出什么样的问题,应该采用怎样的手法进行处理。
关于中译本,总的来说,翻译得很流畅,读起来比较舒服。不过,制作上还是有一些不太让人满意的地方。
* 译注太多,而且有些是低估读者智商的译注。
* 页边标有页码,似乎是为了与英文版对照,但文中的参考页码又是以中文版为准,显得有些乱。
* 书的装订不是特别令人满意,我一直担心从中间断开。
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
2. Intended to cause delay, gain time, or defer decision.
3. Using cautious slow strategy to wear down opposition; avoiding direct confrontation.
add to del.icio.us. look up in del.icio.us.
add to furl
Splat function arguments in JavaScript with Prototype 1.6.0
Object.extend(Function.prototype, (function() {
function splat(args, index) {
var result = new Array(index);
for (var i = 0; i < index; i++)
result[i] = args.shift();
return result.concat([args]);
}
return {
splatterize: function() {
var names = this.argumentNames();
if (names.last() != "$args") return this;
return this.wrap(function() {
var a = $A(arguments), orig = a.shift();
return orig.apply(null,
splat(a, names.length - 1));
});
}
};
})());
var x = (function(a, b, $args) {
return { a: a, b: b, $args: $args };
}).splatterize();
// x(1) => { a: 1, $args: [] }
// x(1, 2) => { a: 1, b: 2, $args: [] }
// x(1, 2, 3) => { a: 1, b: 2, $args: [3] }
// x(1, 2, 3, 4) => { a: 1, b: 2, $args: [3, 4] }
add to del.icio.us. look up in del.icio.us.
add to furlSun 21 October, 2007

数据库MySQL技术:在导入导出过程中发生中文乱码
- 导出系统环境:
Debian Woody 3.0
mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i386) - 导入系统环境:
Debian Sarge 3.1
mysql Ver 14.7 Distrib 4.1.11, for pc-linux-gnu (i386) - 方法一
- 使用导出导入命令
mysqldump -u usename -ppassword --default-character-set=utf8 export_database_name > database_daten_latin1.sql
mysql -u usename -ppassword import_database_name < database_daten_latin1.sql - 导入效果图

- 使用导出导入命令
- 方法二
- 使用导出导入命令
mysqldump -u usename -ppassword --default-character-set=latin1 export_database_name > database_daten_latin1.sql
vi database_daten_latin1.sql
【修改】
/*!40101 SET NAMES latin1 */;
【成为】
/*!40101 SET NAMES utf8 */;
mysql -u usename -ppassword import_database_name < database_daten_latin1.sql - 导入效果图

- 使用导出导入命令
- 方法三(可行方案)
- 使用导出导入命令
mysqldump -u usename -ppassword --default-character-set=latin1 export_database_name > database_daten_latin1.sql
mysql -u usename -ppassword import_database_name < database_daten_latin1.sql - 导入效果图

- 使用导出导入命令
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlSat 20 October, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
Ruby语言:错误信息to_date说明
- 系统环境:
Debian Sarge(3.1)
Ruby 1.8.6 - 错误信息:
NoMethodError (private method `to_date' called for...) - 使用Rails框架应用软件:
Mehisto - 解决方案:在Rails框架软件配置文件your environment.rb最前面增加如下代码:
class Time; public :to_date ;end #use the ruby-1.8.6 version - 参考资料:
http://groups.google.de/group/ruby-talk-google/browse_thread/thread/7fba3bd6c9f07a51
add to del.icio.us. look up in del.icio.us.
add to furl
Harry Reid, Democrat, Senate Majority Leader, is a complete and total ass. He tried to use the power of his office to bully Rush Limbaugh over comments Rush allegedly made. He wrote a letter to ClearChannel to try to silence Rush. 41 other worthless Democrats signed that letter.
Last week, Rush put the letter up for auction on eBay. It sold today for over 2.1 million dollars. Rush is matching that amount and the entire 4 million is going to the Marine Corps-Law Enforcement Foundation.
So Reid, with egg on his face, took to the floor of the Senate today to try to spin this as something he supports. Reid is an ass. Rush has completely made him and his worthless colleagues look like the jerks they are, and now he's trying to save face by "encouraging" his colleagues to bid on it. Ass. I swear, every day Democrats like Reid give me more and more reason to hate them.
add to del.icio.us. look up in del.icio.us.
add to furl
2. Measured or determined by means of the apparent daily motion of the stars: sidereal time.
add to del.icio.us. look up in del.icio.us.
add to furl
Tip Potus & Flotus
Since the Johnson administration, the president and first lady have been referred to internally as Potus and Flotus, for “President of the United States” and “First Lady of the United States”.
add to del.icio.us. look up in del.icio.us.
add to furlFri 19 October, 2007

add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
Rails core
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furlThu 18 October, 2007

Speaking of fuck, researchers find it to boost morale at work:
Regular swearing at work can help boost team spirit among staff, allowing them to express better their feelings as well as develop social relationships, according to a study by researchers.
"We hope that this study will serve not only to acknowledge the part that swearing plays in our work and our lives, but also to indicate that leaders sometimes need to 'think differently' and be open to intriguing ideas."
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
add to del.icio.us. look up in del.icio.us.
add to furl
IntelliJ IDEA has long been regarded as one of the best IDEs for Java development. With the 7.0 release they’ve followed Netbeans and Eclipse by offering significant support for Ruby on Rails alongside the Java tooling. They have a neat video tutorial showing off the Rails features.
add to del.icio.us. look up in del.icio.us.
add to furlWed 17 October, 2007

I got sick of the page being so slow, so I this morning I made some fairly destructive slash-and-burn style changes under the hood. Things should be mostly working again, with the following exceptions:
- Themes: They're busted until I get a chance to patch them up. I have no idea what will happen if you try and use them, but probably nothing good (for you, not me).
- New Accounts: You can wait a day or so to harass me about my latest inflammatory post. Or send an email instead.
- Screenshots: Yeah my desktop from 1998 has a lower resolution than your cell phone. So what?
There may also be other stuff broken, too. I've tried to keep URLs for articles and whatnot the same, but your mileage mamy vary. Today is the first of several iterations away from the almost decade-old code this site is running.
add to del.icio.us. look up in del.icio.us.
add to furl