Archive for October, 2010

给教育募捐和抵制Dior

偷懒下,贴一封海外中国教育基金九月底寄出的募捐信。我近一段时间没给这个草根慈善组织做过什么。等十一月的生意做完了,我该给义工联系下,看能不能尽点力。

——

亲爱的季海东:

时值中秋,OCEF(海外中国教育基金会)祝大家阖家安好,工作顺利。在您的关注和支持下,OCEF已在过去的18年间资助中国乡村学童逾37,000人次。正是您的慷慨解囊,使得数以万计的中国乡村贫困学子得以在崎岖求学路上追逐他们的梦想。

今年9岁的李珍是他们中的一个。就读於中国山西省广灵县望狐九年制学校三年级,李珍生长在一个典型的中国乡村贫困家庭—单亲无外援丶长者顽疾缠身丶幼童无力耕作。在同一所学校,有81名有着和李珍类似困境的学童得到OCEF助学金项目的资助。

“有了OCEF的资助我才能上学”,今年夏天李珍对前来探访的OCEF代表这样说。或许对许多人而言,这是一句普通得难以引发情绪波动的话。但这句平淡如水的话背後,凝聚了一个孩子的梦想和严峻的现实。这句话轻轻地从孩子口中吐出,源於你我的不懈努力和OCEF的庄重承诺。

李珍所在的山西广灵县是OCEF最大的助学金资助点,就读於47所学校的304位学生分别接受OCEF助学金项目和奖学金项目资助。OCEF正筹划在类似拥有大批受助学生的地区推进综合资助项目。受助地区的学校和学生将不仅得到OCEF的经济资助,而且还会有相应的图书支援和杂志寄送。OCEF的目标不仅仅是减轻孩子们的经济困扰,OCEF更希望通过大家的努力,多方位帮助和引导孩子们健康成长。

在关注贫困学童的同时,OCEF意识到学童们的成长很大程度上依赖於教师的付出。早在2006年3月,OCEF就已开始资助默默付出的山村民办教师。王正龙老师是甘肃省古浪县新堡乡崖头小学的一名教师。妻子去世後,王老师每月人民币500元的工资是这个5口之家唯一的经济来源。OCEF教师资助项目向王老师及其他受助民办教师提供每人每学期人民币1,200元的生活资助。OCEF不但在经济上给予民办教师支援,而且向有需要的民办教师提供教学培训。请向这些为中国乡村教育做出不可磨灭贡献的民办教师致敬。教师的称号,你们当之无愧。我们不会忘记!

积极推进各个项目之时,OCEF在2009年遭遇到因全球经济衰退带来的严峻的募款困境。OCEF同仁深知泉断水竭之理,中断一时的资助可能会令许多孩子的人生梦想干涸。2009年,通过大力缩减行政支出(仅占全年支出的1.61%),OCEF支援中国乡村教育一如既往—这是我们的承诺与实践。

• 资助1-9年级学生4,855人(中小学助学金项目,占2009年支出的33.7%)

• 资助高中生1,068人,大学新生118人 (奖学金项目,占2009年支出的40.73%)

• 资助教师171人(教师资助项目,占2009年支出的7.77%)

• 筹建学校3所(建校项目,占2009年支出的11.1%)

• 资助和建立图书室30间 (图书项目,占2009年支出的0.67%)

• 编写并免费寄送《乡村少儿》杂志14000份(出版读物项目,占2009年支出的1.18%)

• 实地走访受助学生1,494名,图书室28间(监察项目,占2009年支出的1.04%)

圆月照山乡,天涯未相忘。您对中国乡村教育的关注是我们坚持的源泉。一点烛光能照亮茅屋,千万点烛光则可照亮夜空。善款有源,薪火相传,我们期待您继续支持OCEF2010秋季募捐,资助教育。

——

昨天从宋以郎的ESWN网站上看到了一个关于Dior的广告和评论的链接,非常气愤。狗日的Dior,太猖狂了:明目张胆地搞种族主义。Cha的评论写得很好:种族歧视和买办类的“艺术家”对自己所属族群的自我歧视。这种买办类的自我歧视不少见,我在美国就见过一些非裔和亚裔的人士的这个现象。奥巴马当总统前写的Dreams from my father也提到过非裔内部的歧视,当然这个妻侄羔子在我投他一票当上总统后没干过什么好事。这种自我歧视,表现在自狠、自卑和无自尊,是自我身份认同的一种危机:对自己的族群、国家、语言、历史等表现出厌恶和羞愧;对所羡慕的族群、国家、语言等表示敬仰和陪笑。结果弄得像《四世同堂》里的冠晓荷,幸福不了的。

但这也不仅仅是种族歧视的问题,因为这里也有性别歧视。像Dior,Channel等模特时尚产业,搞得女同胞很难做:人要瘦,皮肤要细嫩白皙,腋毛要剐,最近几年嘴唇要厚并且血淋淋。女人被当成物件和炫耀的资本,并且只能符合他们设置的标准才算美丽。还故意弄得很贵,不贵就没身份和派头。靠,有这些钱,我呼吁大家抵制Dior等公司的破烂,把这笔资金捐给海外中国教育基金这种无宗教和政治诉求的慈善组织,真正地为山西、宁夏、四川、西藏、甘肃、新疆等贫困地区的儿童做点实事儿。

Comments

List all database files in a SQL Server instance with Python and pyodbc

For SQL Server management from Linux, I’ve used pymssql on Linux before, but realized lately that it is hard to configure with the heterogeneous environment I am in. So I am giving pyodbc a try. The install on Windows is simple. Listed below is some code that I put together quickly for some testing. It lists all files used by a SQL Server instance. I will test pyodbc on Linux against a SQL Server database and will write my findings in a few days.

How to reproduce:
1. Install Python 2.7 on Windows. I am not bothering with 64-bit Python at the moment;
2. Download and install pyodbc 2.7 for Windows;
3. Add c:\Python27 to your PATH variable

""" The code below lists all files used by a SQL Server instance. Adjust instance and login credentials as necessary. ROWS means data file, LOG means log file """
import pyodbc
cn = pyodbc.connect('DRIVER={SQL Server};SERVER=MyInstance;DATABASE=master;Trusted_Connection=yes')
cursor = cn.cursor()
cursor.execute("select name from sys.databases")
rows = cursor.fetchall()
for row in rows:
	sql = ("select type_desc, physical_name from %s.sys.database_files" % row.name)
	cursor.execute(sql)
	l1rows = cursor.fetchall()
	print "Files for " + row.name + " :"
	for l1row in l1rows:
		print l1row.type_desc + " " + l1row.physical_name

Comments

20101022 on the way home

早上六点五十分左右,在云端之上,东方有曙光和朝霞,西方有一轮大大的圆月。并且刚飞进在云层的断裂带之间,看着下面的雾和一些灯火,听着汪峰的《勇敢的心》和《觉醒》,有点奇妙,不错。

前天晚上来到北小石城后,和客户还有他的太太一起去Pig ‘n Chik’s BBQ吃了晚餐。这个饭店是老店了,凝聚了本地的文化和历史。客户太太的南方阿肯色口音很重,但我听得懂。那位看起来五六十岁的女招待的话我没太听懂。女招待和我的共同处是我们都有里门齿儿,但她的好像比我的严重些。我小时候因为这个轻度里门齿儿现象,从初中到高中这一段时间,很自卑,不敢开口笑。我父亲曾模仿嘲弄我的捂嘴笑的做法,让我很受伤害。但有的时候时间会让人走过不同的坎儿。

那位女招待的T恤衫上印着美国内战时南方的旗帜,并印有Southern Pride。整体上讲,我本人对这个旗帜很反感,我不太相信大部分白人对此的借口:这是我们的历史、文化和生活方式等。我以为这玩意更多地代表了仇恨、悲情、种族歧视和白人至上主义。要克服这种东西,你要活出你的自信、幸福和尊严,并且去交流来消除人与人之间的偏见。人这个东西,复杂啊。

我说,这个Pig ‘n Chik是不是有点儿双关。这个饭店的主食是猪肉和鸡肉。但在英语俚语里小鸡(chick)指女人,和中文俚语里鸡可以指妓女(加上巴就变成男性生殖器的俗称)大不相同。同时也有Men are pigs这种说法,所以这个猪和鸡也可指男人和女人。客户和太太都笑了,ta们告诉我ta们没这么想过,但却说得通,不无道理。

我点了pulled pork和baked beans。Pulled pork可以被粗略地译作烂炖猪肉,小火把猪肉炖软烂了。他们用得什么调料,我就不得而知了。至于baked beans,我不知怎么翻译。总之非常好吃。一般来讲,从我个人的体会,吃豆子后容易产生臭屁,要小心。屁不臭的话,掰下腚帮子,或者坐在椅子上时让重心只落在一个腚帮子上,“刺溜”一下放个哑屁后会很爽,是生活中的一大乐趣之一。太臭的话,连哑屁也不好意思放了。那就基本上要到茅房或马桶里栽个屎橛子,才能解决这个问题。但屙完屎后人容易饿。

扯远了。哦,我还点了fried okra。这个无所谓。okra我小时候没吃过,我们那儿不种这个。

昨天中午和客户去了Whole Hog Cafe,又是一个好吃的地方。我要了个ribs,baked beans,potato salad。他们的地蛋好吃。我决定晚饭再去那儿,虽然要走一段路,因为我没有车,这个旅馆也不提供接送服务。这路单程2.1英里,3.38公里的样子。

小石城附近这几天很热,三十度都有。所以傍晚时分我从旅馆沿着公路走到了“整猪小店”,在路边的草地上我看到了很多蚱蜢(我们家乡话叫蚂zhen)。这些蚂zhen和我老家的蚂zhen差不多,我知道鸡最喜欢吃这样的小虫了。说不定这是阿肯色盛产鸡的原因。还看到了一些小沟渠里的小鱼儿。阿肯色看起来挺美的,很适合户外运动,客户家的后院就有鹿出没。晚饭我点了beef brisket,长薄的牛肉片儿,我估计是烟熏的,还是好吃。

现在已经到家了。在飞机上,想起了小时候俺庄大喇叭放的柳琴戏《喝面叶》:咱回家吧,回家吧,俺老婆在家还等着我喃啊哈呓!还是家里好。算了,不写了,也不改了,大家将就着看。天不早了,快该零晚饭了。想听那个正宗的《喝面叶》可以到这里。我觉得下面这个视频也挺不错的,场景和口音基本符合。

Comments

20101020 in the air

One of my college classmates live in Seattle now. The last time I saw him was also in Seattle. I was here attending a conference at the time. He just moved to Seattle then. That was the first time I saw him in more than 15 years after graduation. We both had trouble remembering if it was 2006 or 2007. I think I wrote about it here on this blog so I should be able to find that out when I land and get on the web. Update: it was 2006.

Last night we met in front of my client’s office. He drove me to his house, where I saw his wife, who has moved to Seattle, his not-yet-two-year-old son, and his parents. It was good to have some good Chinese cooking and I really appreciate his hospitality. The little one was a bit apprehensive initially, but I think I won him over by offering my half-empty (or is it half-full?) water bottle as a toy rolling on the floor.

I brought 3 small bottles of Rochefort Trappist beer, not knowing that his parents were here, otherwise I would have bought 5. The beer was good. My hand, as usual, trembled a bit initially while picking up dishes, a sign of my slight nervousness and shyness, which hampered my ability to enjoy the food fully. We talked a bit more after dinner, where I learned the latest generation of Kindle can display Chinese characters natively and properly. I played with his Kindle and read some Chinese text there, and was impressed. If/when I go to China, I will take a serious look at Bambook and other Chinese ebook readers. I welcome any comments on those ebook products.

Well, while I am at it, here is a rant for media publishers and distributors, so Apple, Amazon, Sony, and others, listen up: why don’t you allow people to buy music from other countries? Why do you put region code on DVD and Blu-ray discs so a disc bought in one continent cannot be played in another? Why don’t you distribute books in foreign languages and make them available as easily as possible?

Anyway, my buddy drove me back to the hotel where I immediately went to bed, woke up around 4 Seattle time, laying there for a hour or so before I dragged my lazy ass to the gym upstairs for a little exercise. I think I will try to experiment getting out of bed immediately after I am awake, oh wait, that may not be a good idea after all. I need time to rewind and to just be…

At any rate, the shower in my hotel room was broken, in that the little handle (?) wouldn’t stay on so nothing came out of the shower head. So I assumed the lotus position and washed myself by splashing water around, poking my head under the faucet directly, etcetera, before I decided I was clean enough. I forgot to tell the front desk yesterday, but did report it during checking out, so hopefully the next customer in the same room won’t suffer like me.

Stepping into the elevator, there were more than 10 ladies inside already, mostly in their 50s and 60s, here attending a conference. “Heh, just me and the ladies, I am feeling better already”, said I. I got a few laughs, and a few of us started a little talk during the ride from the 26th floor to the lobby, before I said “Enjoy your stay” and we parted ways.

Nice to take the Link Light Rail back to Seattle airport again. Good speed, clean, and efficient. I like the bike rack in the middle of the car, where I saw it being used Sunday coming to downtown. A colleague of mine told me that the Light Rail opened recently. The female voice announced stations in what I perceive as clear, nice, and distinct Northwestern US accent. Yay, go public transportation!

Little Rock, here I came! Update: went to Pig’n-Chik Barbeque House in North Little Rock for a good Southern dinner. I really enjoyed the ribs and beans.

Comments

20101017在西雅图

以前到阁楼里检查过,但昨天再次爬进去,拿手电看看到底有没有进水的痕迹。我们在考虑给房子换瓦的问题,已经向两个公司招标,可能还会问第三家公司。自己从屋顶下直接看看不错,心理有个数。瓦(shingle)没问题,也不漏,但可以看到瓦片往上翘,早治,防患于未然,有必要。

七月搬进来,我们很满意。老婆昨天种了些她买的花。我们也买了些蒜,我要在院子里种。上次给俺娘打电话,她好像在季庄老家的院子里种完蒜了。我这边不急,还没来秋季的大霜。等我这次出差回去,估计就差不多了。我还打算种点葱和辣椒。没葱花和蒜瓣儿,怎么炒菜!

---

在奥黑尔机场吃了个corned beef三明治,加了点儿酸白菜(sauerkraut,是腌制的那种园球样的白菜,我们家乡话叫刚白菜。和我们及朝鲜韩国的大白菜不一样),很好吃。我要了点黑啤,挺好。在机场同桌吃饭的美国同胞,那个大胖子男士,对自己的妻子爱理不理的。那妻子听话,什么事都征求老公的意见,跟在老公的屁股后边走,让我怀疑这一对是不是属于像车轮滚滚一样的邪教组织。

---

这次出差到西雅图,然后到小石城。今天从机场坐Link Light Rail到西雅图城里,就花了两快五,比好几十快的出租或大巴强多了。坐在light rail里,看到车厢中间有悬挂自行车的地方,很好。我觉得如能把公共交通和自行车有效地结合起来,是解决城市交通的良策。我要是骑车活动下,就觉得舒坦,有精神。

这是我第二次到西雅图。今天天气好,看到西雅图的蓝天和绿山,心旷神怡。这地方不错。美国真是地大物博呀!

---

在网上查了查,我初步打算星期三下饭店!到一家叫七星椒的西雅图中餐馆去过把瘾,辣馋。今天第一次用到中餐美食地图。 这网站看起来不错。

Comments (2)

Notes for mounting Amazon EBS block device

I needed a disk that is around 1 TB for testing on Windows 2008, and noticed that EC2 Extra Large Instance (API name m1.xlarge) satisfies that requirement. But after launching it via AWS Management Console and remote into the server, I noticed I only got 30 GB, far less than the 1690 GB that was promised. The ensuing search convinced me that I needed to use Amazon EC2 API Tools, which is a set of command line tools available for download. I’ve done that before but had to search again because it is a while ago. This time I got a bit smarter, I took some notes!

1. Download and setup the command line tools:

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?setting-up-your-tools.html

a. $PATH needs to have path to ec2 command line bin
b. Recreated my X.509 Certificate and private key pair. This is done via AWS Management Console -> Account (link in the middle of the top line) -> Security Credentials
c. Setup the certificate and private key pair environmental variables
d. Configure and setup $JAVA_HOME sine the tools need Java

2. Browse through AWS Management Console and copy down the AMI ID you are interested in
a. 3 things to filter: Image source and type, Operating System, ad-hoc string filtering. In my case, I did “All Images”, “Windows”, and “2008″. I am interested in ami-d9e40db0
b. Inside the AWS Management Console web interface, once the AMI is selected, a bottom pane will display some metadata. For disk size, pay attention to Block Devices. In my case, it says “Block Devices: /dev/sda1=snap-289c2740:30:true”. I’d like that 30 to be 1690, the size of “Extra Large Instance”. For that, you will have to do it via the command line.

Alternatively, we can get that infor via command line:

ec2-describe-images ami-d9e40db0

3. So I did:

ec2-run-instances ami-d9e40db0 --b "/dev/sda1=snap-289c2740:1690:true" -g ec2windows -k HaidongKey

and got the message below:

Client.InvalidParameterValue: The requested instance type's architecture (i386) does not match the architecture in the manifest for ami-d9e40db0 (x86_64)

Thanks to web search, it turns out I needed to specify the type m1.xlarge:

haidong@haidong-laptop ~ $ ec2-run-instances ami-d9e40db0 --b "/dev/sda1=snap-289c2740:1290:true" -g ec2windows -t m1.xlarge -k HaidongKey
RESERVATION	r-87856fed	436613090425	ec2windows
INSTANCE	i-30ae415d	ami-d9e40db0			pending		0		m1.xlarge	2010-10-09T04:36:37+0000	us-east-1a			windows	monitoring-disabled		ebs					hvm

But I was not out of the woods yet. See below:

haidong@haidong-laptop ~ $ ec2-describe-instances
RESERVATION	r-87856fed	436613090425	ec2windows
INSTANCE	i-30ae415d	ami-d9e40db0			terminated		0		m1.xlarge	2010-10-09T04:36:37+0000	us-east-1a			windows	monitoring-disabled					ebs					hvm

I tried various ways before I decided to ask on Amazon’s cloud computing forum, and got it answered in an hour or so. It turns out for the EBS volume the maximum is 1024.

So I tried this:

ec2-run-instances ami-d9e40db0 --b "/dev/sda1=snap-289c2740:1000:true" -g ec2windows -t m1.xlarge -k HaidongKey

And it worked:

haidong@haidong-laptop ~ $ ec2-describe-instances
RESERVATION	r-fd639397	436613090425	ec2windows
INSTANCE	i-bc23d2d1	ami-d9e40db0	ec2-184-72-199-184.compute-1.amazonaws.com	ip-10-122-87-151.ec2.internal	running	HaidongKey	0		m1.xlarge	2010-10-12T01:40:31+0000	us-east-1a			windows	monitoring-disabled	184.72.199.184	10.122.87.151			ebs					hvm
BLOCKDEVICE	/dev/sda1	vol-4a8d8923	2010-10-12T01:40:36.000Z

It takes a few minutes to get Administrator’s password. Unlike the message provided at AWA Management Console web interface, you get the message below before it is ready:

haidong@haidong-laptop ~ $ ec2-get-password i-bc23d2d1 -k HaidongKey_unix.pem
No <password> element was found for this instance.

After I got the password:

haidong@haidong-laptop ~ $ ec2-get-password i-bc23d2d1 -k HaidongKey_unix.pem
E)yX=nTX!D

and logged in, the disk still shows as 30 G. Got to go to disk manager in Windows to mount it.

Hope this helps somebody. I certainly will know what I need to do next time.

Comments (2)

一个瑞典女婿对一帮挪威老头子的诺贝尔奖的决定的评论

记下我对诺奖的评论,基于我在Mujun博客上的留言。抱歉Mujun,唠叨很多,占用了你的那么大的空间。

我不想搭理一帮白领小资在那里上纲上线的自恋狂似的叫嚣和抱怨。我要去给海外中国教育基金帮忙,我要给我居住的社区的无家可归和失业的美国同胞的场所去做义工,我要去政府投中期选举的票,虽然我对我们美国过去的十年左右民主实践的作为很失望。我很忙,没功夫应付评论,所以本篇评论关闭。编程和技术上的博客,我还是喜欢评论的。

我是七十年代生人,九十年代出国的那一批。我觉得我和你的看法非常接近的。我以为刘和各个国家的风头主义的政客差别不大,我很难判断他温和与否,我倾向于维舟的看法;我以为刘的刺激比韩寒的刺激差太远了,远到没法比的地步,一点深度都没有,摘抄贩卖民主自由原教旨主义的西方主流媒体的主旋律,努出个什么宪章,还停留在二十年前的那种幼稚的高喊口号的地步,就那水平,实在是知识分子的悲哀;我不完全认同劳苦大众生活在水深火热的状态的这种判断,因为我以为让那么多人脱贫的政绩很难被夸大;我对中国和非洲的交往持乐观态度。换句话说,我的思路不会跟西方媒体的主旋律走。或者也可以这样归纳这一段的中心思想:我这个七零后和你这个八零后的看法好像很接近。

我对刘的其他活动不了解,但构成其获奖原因的那个宪章,我以为宋以郎的评论最到家

我也喜欢他的这段评论,可以在这儿找到

This discussion can easily be extended to my view of modern China. Shall China pursue its modernization in accordance to western prescription (as the World Trade Organisation, International Monetary Fund, US Department of Treasury, Jeffrey Sachs, European Union, Nicholas Sarkozy, Angela Merkel, United Nations Human Rights Commission, Amnesty International, Reporters Without Borders, Heritage Foundation, Cato Institute, Rand Corporation, Tibetan Youth Congress, Richard Gere, Sharon Stone, Wang Dan, Grace Wang Qianyuan, BBC, New York Times, Washington Post, Apple Daily, Boxun, Epoch Times and you can add your own preferences here)? Or shall it try to look for its own path? I think that it is clear that China is pursuing its own path, and you can debate whether that is right or wrong (either overall or by parts). Once that is accepted, then there is no need for the kind of nationalistic defensiveness over China’s actions that is sometimes evident. When you have to counterattack your critics, it only shows that you are insecure. When you are self-confident and self-reassured, you don’t have to pander to anyone.

Of course, self-confidence and self-reassurance does not mean that you can dismiss all the problems that will inevitably arise in a rapidly changing society (such as the ‘mass incidents’). Rather, you are self-confident and self-reassured because you know that those problems can and shall be handled in your own way.

但我也很想对中国政府纠结和问责,比如:

1 我难以相信就为了那个肤浅的高论而让刘入狱;
2 我不知道伟大祖国的长城有任何的益处,虽然我不排除网络监管和保护国家安全的正当防范措施;
3 我不确定从整体来讲,我们走出了老冒这个罪人的阴影,能正视他的罪行,抚平伤痕和汲取教训向前进。因为于我来讲,在解放后,他是不可饶恕的罪人,虽然我不想也不能抹杀他建国前的领导和功勋;
4 我想对政府绩效和腐败问题问责。腐败这东西根除不了,但我要看你的行动,我还想知道哪个官员在搪塞遮掩,对那个/些搪塞遮掩的官员,我至少想要拿掉他/们的乌纱帽;
5 换句话说,我想要我的地方和中央政府越来越透明;
6 我担心贫富分化,我担心房地产泡沫,在防止官僚和扯皮的研究之后,我要政府在这方面有作为;
7 我看到充满垃圾的江河湖海和灰蒙蒙的天气。整治环境,现在就要开始并且永不停息。我要看你在这方面的行动和实效;
8 我还没想好,但如何正视5月35日是一个需要研究的问题;
9 双重国籍是大势所趋,希望政府与时俱进。

以上算是我海外华人份子的一个宪章吧。大家不要给我提名,那玩意儿麻烦。我觉得宋以郎更应当获诺贝尔和平奖。今年年初,我曾经研究过给他提名的问题,但发现我没资格。哪位有资格的读者麻烦帮个忙。美国的Glenn Greenwald也请你照顾下,这哥们我觉得也够格。

Comments

SQL Server 2008 R2 unattended installation via configuration file

I wrote about unattened install of SQL Server 2008 R2 here, where all parameters were entered on the command line directly.

Another way, perhaps a better way, of automation is to put all parameters in a configuration file. Here is a sample:

[SQLSERVER2008]
; Specifies a Setup work flow, like INSTALL, UNINSTALL, or UPGRADE. This is a required parameter.
ACTION="Install"
; Specifies features to install, uninstall, or upgrade. The list of top-level features include SQL, AS, RS, IS, and Tools. The SQL feature will install the database engine, replication, and full-text. The Tools feature will install Management Tools, Books online, Business Intelligence Development Studio, and other shared components.
FEATURES=SQL,Tools
INSTANCENAME=MSSQLSERVER
SQLSVCACCOUNT="NT AUTHORITY\SYSTEM"
SQLSYSADMINACCOUNTS=".\Administrator"
AGTSVCACCOUNT="NT AUTHORITY\Network Service"
;INSTANCEDIR=c:\SQLServer

Here is how to use it:

setup.exe /ConfigurationFile=SQL2008R2InstallConfig.txt /QS /IACCEPTSQLSERVERLICENSETERMS

One thing is worth of mentioning: installer creates a directory called MSSQL10_50.MSSQLSERVER under your INSTANCEDIR for the default instance. For a named instance, say Instance1, it will be MSSQL10_50.Instance1. The installer adds the MSSQL10_50. prefix and it does not look like it can be helped.

Comments

拿到回老家的签证

上周去中国芝加哥领事馆办签证。从我个人的经验和体会,我觉得领事馆人员的效率高,态度也很好。我拿号,填表,照相(因我没带照片,附近的一家药店的照相机坏了)。轮到我,也就一两分钟的样子,就告我今天去取。今天早上我再次骑自行车去城里,单程15公里多点有限,到领取窗口,交钱后拿护照,一分钟不到就搞定了。

领馆里的申请各种证件的人不少。上周去申请的时候,看到了一对夫妇,男的是黑人,女的是大陆来的(国籍就不知道了),住在上海,好像是给他们的孩子办旅行证。我和他们聊天。那位男士的中文很不错,因为我和他讲中文,也没特别放慢语速,他好像都听得懂。他们给我看了看他们的一岁多一点的孩子的照片,很可爱。

也见到了领馆的那位黑人保安。他给我拍了照片。我说,伙计你好,我每次来,都见到你。他笑了笑,说他已经在这儿干五年了。我说,你应当到我的中国看看。他笑着说,以后我会的。他和以前比,白发好像多了些。我看到他走到领馆工作人员的窗口后和工作人员交流,他们的脸上都有笑容,就觉得这真好,这个世界还有希望。

很可能十一月回去。先到东京和首尔做些培训方面的生意,然后到北京再做两天。可能逛逛书店,我在做电子书方面的调查,因为要是有本能在美国购买和阅读中文书的电子书,那就太爽了。之后就回家看看,再从北京飞回美国。这次就我一个人回去,灵活性大些,能多和爹娘啦呱,喝碗羊肉汤,吃点煎饼和烧饼,家乡菜如辣椒调咸菜等等。和儿子还有素食的孩娘一起回去,我吃不痛快,但那是没法子的事情。

Comments

Following High Performance MySQL’s hash index discussion

Mixing up some MySQL and SQL Server hacking activities can be fun. I’ve also noticed that when you work with different database platforms, it can bring additional clarity to certain concepts and techniques. One reason for that, I think, is that different terminologies and ways of explanations are used for people practicing on different platforms, and that tends to re-enforce or otherwise bring clarity to things that you may not have a good grasp to begin with.

Anyway, I am following Baron Schwartz et al’s High Performance MySQL book and thought the example of building your own hash index for URL lookup looks really useful and clever. On the topic of hash collison, the book discussed using words in /usr/share/dict/words as an example. By the way, High Performance MySQL 2nd Edition is a fantastic book, highly recommended!

I tried that myself. Here is the relavent code to play along, assuming you have the table and triggers set up:

mysql> load data infile '/usr/share/dict/words' into table pseudohash (url);
Query OK, 98569 rows affected (1.99 sec)
Records: 98569  Deleted: 0  Skipped: 0  Warnings: 0
mysql> select url_crc, count(*) from pseudohash group by url_crc having count(*) > 1;
+------------+----------+
| url_crc    | count(*) |
+------------+----------+
| 1774765869 |        2 |
+------------+----------+
1 row in set (0.37 sec)
mysql> select url, url_crc from pseudohash where url_crc = 1774765869;
+---------+------------+
| url     | url_crc    |
+---------+------------+
| codding | 1774765869 |
| gnu     | 1774765869 |
+---------+------------+
2 rows in set (0.10 sec)

I then went to SQL Server to see if there is a built-in function that does CRC32 hashing. I didn’t see it in Books Online. One of those days, when I find some free time, I will write a C# function and expose it as a UDF inside SQL Server. I will then run some benchmark logical reads with this hash index idea implemented in SQL Server and see how it affects things.

A side benefit of this exercise is I learned the meaning of “codding”, which I found somewhat amusing.

Comments

Page optimized by WP Minify WordPress Plugin