Archive for November, 2006

奇文共欣赏

关于家庭教育:
李开复致中国家长的信:培养快乐感性的孩子
中国父母常犯的十大错误

我很佩服和感激李开复。他是一位难得的中西贯通的人才。最近读了他的一些主要给青年学生的信件,感觉他写得很有道理。其字里行间,情真意切,充满了对年轻人的包容和关心。李开复的父亲是四川人,他本人生于台湾,在美国读高中和大学。 他能在美国事业有成之时回中国报效故土,这该是何等的情怀!我个人感觉国内的企业界和年轻人有他这样的引导,是件很幸运的事情。

史铁生的《我与地坛》
我是从周燕--我母校厦门大学的一位老师--的博客上知道了这篇文章。读了之后,掩卷三思,深感它的震撼。该文写于1990年左右,而我现在才读到,不免汗颜于我的孤陋寡闻。感觉现在读的大部分书都是网上博客提到过的或朋友介绍的,很少按职业书评的推荐。以后一定要搞些史铁生的书读一读。顺便说一句,大力推荐周燕的文章

艾青的《大堰河——我的保姆》
这是我在网上搜集教孩子中文材料时碰到的。这首诗以前读过。但感觉好东西值得多读。

Comments (2)

Some pictures at PASS Seattle 2006

I enjoyed the time I had in Seattle last week while attending PASS 2006 Sql Server conference. My schedule was full so I didn’t have time to walk around and check out the city. My extremely limited impression of Seattle is positive. For whatever reason, I always have the impression that the Northwest and Northeast areas are more progressive than the rest of the country. Again, based on my very limited experience, nothing I encountered here contradicted to that impression. The pace is probably slower here than New York, Chicago, or LA.

Here are some pictures:

The convention center at night:

PASS Seattle 2006

Space needle from room 1208 of Roosevelt Hotel:

PASS Seattle 2006

Little Haier fridge in my hotel room. Haier is a Chinese company. It used to be a joint venture between a Chinese company and a German company. (It may still is.) It hails from Qingdao city, Shandong province, my home province. I’ve seen Haier air-conditioners sold in stores here in Chicago area. Way to go Haier! Another famous product from Qingdao is the Tsingtao beer. Tsingtao is the old way of spelling Qingdao, before Pinyin is adapted.

PASS Seattle 2006

My Xiamen University buddy and I had a great meal at Szechuan Chef. I am not sure which town the restaurant is at, but it is great. Thanks again Mingfeng for the dinner and great conversation!

PASS Seattle 2006

The famous fish market at the end of Pike street. I didn’t get a chance to visit it during day time. I figured I would come back to Seattle again someday.

PASS Seattle 2006

A group of friends in front of the first Starbucks store. I don’t think I have ever bought anything from a Starbucks store, which is a record I try to keep. I have to admit that I have consumed bottled Starbucks Mocha before, bought at a gas station, to keep me alert while driving. To people in this picture, I will email you ways to get the rest of the pictures tomorrow.

PASS Seattle 2006

Comments (2)

PASS Reports 20061116

It is good to be at PASS Sql Server conference in Seattle. Most people here have this kindred Sql Server spirit. Since we all have this in common, it is easy to start a conversation with pretty much anybody. All you need to do is to smile, greet each other warmly, and share your own stories that a lot of other people can relate to. Most people are very nice, friendly, and helpful.

A couple of things to comment on:

1. Unlike last year’s conference in Dallas, the session rooms and labs are fairly close to each other. That makes it easier for people to find and go to the locations they want to;

2. PASS decided to stop printing PowerPoint slides. Instead, most slides can be downloaded before a session starts. I found this really helpful. I like to skim through files to determine if I am interested in a particular topic. The green backpack is a nice touch, since we are going “green” (paperless) this year;

3. Microsoft interactive lounge is very helpful, both to attendees and Microsoft, I hope. I talked to some senior testers from the full text search team, and got one of my issues resolved. You know, when you talk to an expert, you can get the gist of stuff without the noise in a short time. I will post some of the code snippets I got regarding full text search in a future post;

4. Steve Ballmer’s keynote is ok. He is a good presenter and very energetic. The Vista UI looks nice. At the end, the last question to him was if he would do a dance for us, like he did during a developer conference. He responded well, saying there is no music, and yelled “Go DBAs Baby” or something to that effect before leaving stage;

5. Steve Ballmer also commented on the alliance with Novell, and Microsoft’s legal trouble at the EU. I thought his responses were quite disingenuous. Regarding Novell and Linux, he indicated that Linux has infringed on Microsoft’s intellectual property and the agreement with Novell would cover SUSE Linux in case of lawsuit. The intellectual property infringement argument may or may not be true. But the table can be turned too. Can Microsoft guarantee that it does not infringe other’s, including Linux community’s, intellectual property? Initially I felt pretty positive about the alliance between Microsoft and Novell. After hearing Ballmer’s comments, I am not so sure now. It may not be worth worrying, after all. Just look at the thing Microsoft did with Sun. Now Java and Solaris are all open-source.

Regarding the EU legal issue, he responded that Microsoft is already pretty open. He went on to argue that since so many applications and device drivers are written for Windows platform, Microsoft can not be accused of not being open. That is quite disingenuous. I do agree that Microsoft has changed a lot and is definitely more open now, but Steve’s thinking is not in the right place. I also agree with Joel Spolsky and others. I think Microsoft would benefit without Steve as the CEO.

Comments

At PASS conference in Seattle

After 2 hours of flight delay, I’ve made it to Seattle. I am attending PASS Sql Server conference here.

PASS

No, not the P.A.S.S. above. (I got that picture from a place not too far from where I work in Chicago area.) The PASS I am talking about here is Professional Association for Sql Server.

I met some friends and made some new ones tonight at dinner.

If you read this and are present at the conference, please don’t hesitate to stop me and say hi.

Comments

Getting Started with PowerShell and SMO

Microsoft will introduce a new shell with the forthcoming release of Vista. It was code-named Monad initially. Later on it was referred to as MSH (Microsoft Shell). In April, it was officially named as PowerShell. In fact, PowerShell RC2 (Release Candidate 2) is available for download now.

I’ve downloaded and played with RC2 and was pretty impressed so far. PowerShell borrowed heavily from the *nix world, such as tab completion, aliasing, variable naming, output piping. Some of the aliases are actually named just like *nix commands, such as cat, ps, ls, etc., with very similar functionalities.

PowerShell’s syntax and keywords seem to be pretty clean, with a very limited verbs used in the entire shell (get, set, invoke, out, new, and so on).

Since it will come with Vista, naturally it has tight integration with the .Net Framework (Did I tell you that I absolutely hate this .Net lingo Microsoft marketing invented?). So it can load .Net assemblies and use the rich objects and methods within them. In fact, that is where my current interest is: combining PowerShell with SMO to do some nifty stuff.

Today, let me show off something I just figured out earlier tonight: scripting database objects out. It is pretty rudimentary, but I think it is something I can build on.

Two assumptions:
1. Assume you have Sql Server 2005 installed with a database called test and table called t1;
2. Assume you have PowerShell RC2 on this machine.

1. Open PowerShell;
2. [reflection.assembly]::LoadWithPartialName(“Microsoft.SqlServer.Smo”)
3. $MyServer = new-object (‘Microsoft.SqlServer.Management.Smo.Server’) “MyDatabaseServer”
4. $MyScripter = new-object (‘Microsoft.SqlServer.Management.Smo.Scripter’)
5. $MyScripter.Server=$MyServer
6. $MyScripter.Script($MyServer.Databases["test"].tables)

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE TABLE [dbo].[t1](
[c1] [int] NULL
) ON [PRIMARY]

Comments

绕口令

这几天和儿子练以下两个绕口令。他练得挺带劲,可能主要是觉得有意思。这两个他都会自己认读,也会写(不确定他会不会写“是”):

四是四,十是十。十四是十四,四十是四十。

三是三,山是山。三十三是三十三,不是山山山。

我打算趁着这股热乎劲儿把以下几个也教给他。妈妈骂马挺不错,四声和轻声都有了:

妈妈骂马

  妈妈种麻,
  我去放马,
  马吃了麻,
  妈妈骂马。

小三登山

  三月三,小三去登山;
  上山又下山,下山又上山;
  登了三次山,跑了三里三;
  出了一身汗,湿了三件衫;
  小三山上大声喊,离天只有三尺三。

南边来个老爷子,手里拿碟子,碟子里装茄子,一下碰上了橛子。打了碟子,洒了茄子,摔坏了老爷子。

分果果
  多多和哥哥,
  坐下分果果。
  哥哥让多多,
  多多让哥哥。
  都说要小个,
  外婆乐呵呵。

鸟和猫
  树上一只鸟,
  地上一只猫。
  地上的猫想咬树上的鸟,
  树上的鸟想啄猫的毛。

数青蛙

一只青蛙一张嘴,
两只眼睛四条腿,
扑通一声跳下水。

两只青蛙两张嘴,
四只眼睛八条腿,
扑通扑通两声跳下水。

三只青蛙三张嘴,
六只眼睛十二条腿,
扑通扑通扑通三声跳下水。

四只青蛙四张嘴,
八只眼睛十六条腿,
扑通扑通扑通扑通四声跳下水。…

Comments (1)

Service broker and database mail

A couple of weeks ago, I set up database mail on one server, and verified that it worked. A few days ago, my friend called because the mail was not working for him.

This is the message I got when ran sp_send_dbmail stored procedure:

Msg 14650, Level 16, State 1, Procedure sp_send_dbmail, Line 68
Service Broker message delivery is not enabled in this database.
Use the ALTER DATABASE statement to enable Service Broker message delivery.

I then tried to go through Database Mail Configuration Wizard from Sql Server Management Studio, and picked Manage Database Mail accounts and profiles. This is the message I got:

Database Mail depends on Service Broker. Service Broker is not active in msdb.
Do you want to activate Service Broker in msdb? If you do not activate Service Broker,
Database Mail will queue e-mail messages, but will not be able to deliver the messages.
------------------------------
BUTTONS:
Yes
No
------------------------------

I clicked Yes, but nothing happened and the process was hung.

So I decided to run the script directly instead:

ALTER DATABASE msdb SET ENABLE_BROKER

Once again, it is hung.

It turns out that enabling Service Broker in any database requires a database lock. So I killed all connections to msdb and was able to run the script successfully. Database mail started working afterwards.

You may wonder what caused it to fail in the first place. After talking to developers, I learned that they restored msdb from a dev box. They did that because it is easier for them to move jobs and SSIS packages. As a result, Service Broker was disabled somehow. I certainly don’t recommend that approach, because msdb is a system database. As such, it has a lot of system meta data in it. Restoring it from some other server is just not a good idea.

Comments (10)

Page optimized by WP Minify WordPress Plugin