客户关系之咖啡文化

早就知道西方国家的人们喜欢喝咖啡和饮酒,这是一种休闲娱乐方式,就像成都人爱喝茶打麻将一样。之前没有想过这种看似很平常的日常生活中的小小活动会有那么重要,但这次出差让我深刻的认识到“入乡随俗”这句话的重要性,即使是一杯小小的咖啡有时也会成为沟通的良好桥梁。

引起我深思的故事是这样的:

某个工作日下午快3点左右,很困,就想找同行出差的另外两个中国同事去买杯咖啡喝。虽然之前也喝点咖啡,但属于那种频率很低,基本用于临时提神。跟我pair的客户同事S,另外一个客户同事J跟其中一个中国同事pair。我们也热情的要求他们一起去,他们没有推辞,很热情的推荐什么咖啡好喝,随后我们一起下楼。刚到楼下,S童鞋突然说他要去ATM取钱,没有现金了。我说,我请你喝。他执意不肯,让我们先走,他随后跑步跟上。等到了咖啡店,我们三个中国同事都点完了,看看S跟J童鞋没有点的意思。后来回来的路上我就问J,你们不买咖啡喝下来干涉么呢?他说,出来走走,跟大家聊聊。

当时我并没有注意。可是后来发现,每天早上站会结束老外同事们都要去买咖啡,回来的时候每个人或大或小都端着一杯咖啡。但是下午基本没有人去买过咖啡。而且他们去买咖啡的时候,客户同事都问我们要不要去买咖啡,我们三个基本都没去过。后来我就想,为什么大家都早上喝咖啡呢?下午也没有人去买啊。我实在忍不住就问S童鞋,说上次那天下午为什么要跟我们去买咖啡啊,你们基本都是早上喝呢。他后来认真的说,陪你们走走,这也是一种社交活动嘛!哦,我当时幡然醒悟。

看来小小的咖啡,并不是为了提神,跟客户在一起就得融入他们的圈子。走在路上一起聊聊轻松的话题增进关系,关系融洽了什么事情都好办。不难理解,就像中国酒席上的敬酒文化,其实也是一种社交方式。

所以后来我逐渐改变自己的方式,跟他们一起去买咖啡,或者哪天下班一起去酒吧喝一杯,因为“Let’s have a drink(喝一杯吧)”也是他们的口头禅。聊聊中国文化、当地的啤酒、好吃的饭馆什么的,也挺惬意。逐渐发现虽然语言还是有一点点障碍,毕竟生活中的词汇我掌握的还不够。但是交谈中伴随着比划,其乐融融。

除此之外,还发现一点,老外们很少随意接受礼物或者馈赠,比如那天我说请S童鞋喝一杯都被他宛然拒绝。看来还需慢慢的了解他们的文化,尊重他们的文化才能更好的融入,做好客户关系。

[ReadingNotes]《精益思想——消灭浪费,创造财富》——精益企业,发挥企业自身的影响力

最近开始阅读詹姆斯·P·沃麦克精益思想——消灭浪费,创造财富》一书,对其中提到的精益原则结合我现在所在项目有了一些更深入的理解,记录于此。


精益思想的关键出发点是价值。价值是只能由最终用户确定;而价值也只有由具有特定价格、能在特定时间内满足用户需求的特定产品(商品或服务,而经常是既是商品又是服务的产品)来表达时才有意义。确定价值是精益思想关键性的第一步。而接下来就是要确定价值流。在这里就提到了“精益企业”这概念。

在介绍精益企业这概念时,作者举的一个航空工业中存在巨大浪费的例子给我思考很多。这个例子说,世界上最大的飞机喷气发动机制造商——普拉特惠特尼公司,在为它的喷气发动机产品族制作价值流图时发现:他们的原材料供应商为生产超纯金属所做的的各种活动的成本,由于下游企业而成倍增大了。原因在于下游的锻造企业浪费了超过90%的原材料来生产一件铸件成品,同时还使用很高的成本准备了好几个尺寸相似的铸件。这些铸件对于普拉特公司各种不同型号的发动机以及其他公司的发动机来说尺寸差别都不大。可见其中存在很大浪费,有很多活动可以去除从而节约成本。

在尖端的航空工业存在如此大的浪费也有其特殊原因:
属于喷气发动机价值流的四个企业——铸造、锻造、机加工和总装——都没有像其他企业介绍自己的生产活动。部分原因是保密,另外的原因是他们根本没关注过。

由此,精益思想必须超出企业这个世界上公认的划分单位的标准,去查看创造和生产一个特定产品所必须的全部活动:从概念经过细节设计到实际可以用的产品,从开始销售经过接收订单、计划生产到送货,以及从远方生产的原材料到将产品交到用户手中的全部活动。把完成所有这些事情的组织机构叫做精益企业

从这个角度出发,精益企业不是一个真正的物理上的企业,它只是一个虚拟的概念。我的第一感觉是,谁应该站在这样一个角度去操控这样一个“虚拟”企业从而使用精益思想去管理它所囊括的这些企业们,毕竟他们物理上是独立的,有各自追求的利益,各自独立的管理者和创办企业的指导思想。唯一可能就是这些企业们自组织去追求精益思想,或者说没有这个概念,但是它们追求消除浪费,创造财富。

当我接着阅读时发现,我不是第一个有这样疑惑的人,书中解释了如何运作。作者认为,在企业外购项目逐渐增加而自制项目逐渐减少的年代里,真正需要的是有共同利益的各方都自愿组成联合,一起查看被割裂开来的价值流。这种联合要检验每个创造价值的步骤,而且要持续到产品的最后。需要用新的方法来思考企业与企业间的关系,需要一些简单原则来规范企业间的行为,以及沿着价值流的所有步骤的透明度。

读到这里,我还没有想到什么样的简单规则来规范,合同、行业游戏规则、道德亦或是追求利润的驱动力。倒是联想到我现在所在的项目所做的一些实践,似乎说明了与此相关的道理。

我们生产的是一个软件产品,从提出概念、设计、开发、上线到最终用户使用这个流程下来至少包含了三个企业:开发公司(TW),客户公司(CWP),运营公司(TCS)。简单关系为,CWP出钱让TW开发产品,由TCS负责上线运营,产品最终用户是CWP的终端客户。我们(TW)在整个精益企业概念下作的努力:

对内(TW):

  1. 强调最终用户的商业价值,体现在业务分析和开发过程中,与客户交流收集最终用户体验,体现最终用户的需求
  2. 用敏捷方式管理团队,体现价值流动,拉动,持续交付
  3. 开发过程中强调代码质量,简单设计,清理冗余无用代码,尽善尽美
  4. 强调自动化(automate everything),节约一切可以节约的时间,减少等待时间
  5. 注重知识交流和分享,所有人都理解我们要实现的价值,开发人员尽量都能了解每一个功能,降低项目风险
  6. 回顾,不断总结,发现并消除项目运营中的muda,自我改善提高

对外(TW->CWP)

  1. 加深客户沟通交流,明确最终用户需求,获得产品价值
  2. 用敏捷的思想培训客户,帮助分析工作流,节省成本
  3. 培养客户使用敏捷的工作方式,提高响应效率

对外(TW->TCS):

  1. 用敏捷的思想培训运营人员,帮助自动化部署,选择合适的部署工具,缩短部署时间,节约宕机时间
  2. 自动化运营诊断工具,准确定位系统问题
  3. 培养运营人员分析业务系统问题,帮助提高解决业务问题能力,缩短因为时差问题带来的等待浪费

就当前理解,在精益企业这个大圈子里,目标都是一致的,即消除浪费,创造更大的价值。企业自身首先要尽力去除内部muda,然后不断地去影响和改善上下游企业从而消除整个价值流上的muda,达到互利共赢,做到“大家好,才是真的好!”,这还有很多路要走。

这只是肤浅的认识,仅仅从精益的角度重新认识的了一下敏捷的思想和实践,其实这两者之间有着紧密联系。随着阅读的深入,更加深刻的理解我们过去的一些行为方式,知其所以然,善哉,乐哉!

Tags: ,

[Page Performance] HTTP Expires Response Header.

SCENARIO

As we’re doing the performance test for our project. While for the page performance, we used YSlow to check the grade for typical pages, such as calendar, questionnaire, file cabinet etc. The result for PROD calendar page shows F grade for YSlow rule “Add Expires headers”. As we didn’t set far-future expiration date for calendar static content.

WHY

Why we need to set the expiration date in response header? As we know, one principle to improve the page performance is to reduce number of HTTP requests for a page.

Web pages are becoming increasingly complex with more scripts, style sheets, images, and Flash on them. A first-time visit to a page may require several HTTP requests to load all the components. By using Expires headers these components become cacheable, which avoids unnecessary HTTP requests on subsequent page views. Expires headers are most often associated with images, but they can and should be used on all page components including scripts, style sheets, and Flash.

 

HOW

In IIS7, according to Microsoft document, there are 4 ways to config. We can use the GUI method to config in IIS manager.

Please refer to the following page to do the config: Configure the HTTP Expires Response Header (IIS 7)

After setting expiration date, except for the first request, the requests afterwards for the static contents will return with HTTP code 304(not modified) which means, the content of the request will not be transferred back from server side, it will use the client cached version. We can confirm with firebug or chrome developers tool.

 

Tags:

Difference between IIS7 & IIS7.5

IIS 7 is the version in Windows Vista and Windows Server 2008. IIS 7.5 is in Windows 7 and Server 2008 R2. There are very few differences in them beyond the addition of software that didn’t exist when Vista/Server 2008 was released (FTP 7 for example) and those changes needed to accomodate the different security in the newer OS. The major difference seen by most users is that the Network Service account is no longer the default app pool account and instead IIS 7.5 uses the App Pool Identity to further enhance security.

Tags:

Url mapping issue with last parameter has dot in middle.

PROBLEM

When I setup local env on my laptop to run account service ut, I encountered an odd issue with url mapping. I got errors for test cases which had string with dot in middle as last url parameter. For example:

http://localhost/iasaccount/globalusername/username/old.name

The url couldn’t be mapped which means the request won’t go into GlobalUserNameController, Username action.

REASON

Because the IIS just treats the “name”  in “old.name” as a file name extension and it can’t find any files, then it returns 404 Not Found.

SOLUTION

We need to use System.Web.Handlers.TransferRequestHandler to map the request path.

Open IIS -> Default Web Site -> Handler Mappings -> ExtensionlessUrl-Integrated-4.0, Change the “Request path” from “*.” to ”*”.

See the image attached.

Tags:

HttpContextBase.Server.GetLastError() is only supported in Windows Server 2008 R2 with SP1 or later.

ONE PROD DEFECT

We got a defect in our project on production that there was no exception content in the log file. The odd thing is we can’t reproduce it locally on our dev machine.

The exception content of a request in the log is empty.

ANALYSIS

I traced back in code and found we used the following method to fetch the exception content in CS component:

HttpContextBase.Server.GetLastError()

Meantime, another AS component and this CS component are deployed on the same server, while AS can succussfully get the exception content in log.

And in account service we used the following propertiy to get the requestion exception content:

HttpContext.Error

Originally we just assumed there was something related with web.config. After we downloaded the web.config and overwrite it locally, we still couldn’t reproduce the defect.

SOLUTION

I searched on Internet and found in Microsoft document, the HttpContextBase.Server.GetLastError() only suppported in Windows Server 2008 R2 (Server Core supported with SP1 or later).

Then we checked on prodution and found the CS server did not have SP1 installed.

While the HttpContext.Error doesn’t have this limitation.

Tags:

How to Change the ‘sa’ password in SQL Server.

If you happen to forget your SQL Server password for ‘sa’ account, then here’s a simple query to help you reset it:
GO
ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
GO
USE [master]
GO
ALTER LOGIN [sa] WITH PASSWORD=N’MyNewPassword’ MUST_CHANGE
GO

In Case you remember your Old Password and want to change the ‘sa’ password, use this query:

ALTER LOGIN [sa] WITH PASSWORD = N’MyNewPassword’ OLD_PASSWORD = ‘MyOldPassword’;
GO

 


Tags:

关于刻意练习 《哪来的天才——练习中的平凡与伟大》

读 [美]杰夫·科尔文的《哪来的天才——练习中的平凡与伟大》笔记。

刻意练习和我们大多数人平常做的练习有两点区别。其一,要在学习区选择合理高强度的活动。其二,重复的数量。反馈也不可或缺,因为它是我们刻意练习的一大输入。

刻意练习不是去做那些自己得心应手的事情,而是去寻找那些我们不擅长的事情。

常见的误区是对已经掌握的知识或者技能重复学习或者训练。比如高中的时候,我常常抱怨为什么学习成绩上不去,一门课程的成绩总是在固定的分数周围徘徊,基本是因为复习、看书都是在重复已经会的知识。不会的题目,觉得有难度,即使强迫自己去解决,大部分都半途而废了。所以在已经会的知识和技能上重复是毫无意义的。

除了要选择自己不会、不擅长的事情去可以锻炼,还需要集中精神,持续专注。刘未鹏在《暗时间》里面也提到了有效学习的两个条件,专注和持续专注。

对于我自己,tasking和deadline是训练专注的有效方式。tasking,对于要做的事情,无论是工作还是生活中,都列出来,然后排好优先级,一个一个的去解决,可以训练在解决一个问题的时候不受其他问题干扰。deadline是给每个task制定必须完成时间,这样迫使自己在一定的时间内完成。同时根据这两个因素可以合理的安排自己的行动计划,保证按时、无遗漏的完成所有事情。

有些时候很容易被外界打断,要适当的学会说不。我经常遇到其他人来找我办事情,大部分比较紧急,但是很容易打断思维,导致手头上的事情做得不好。之后一般遇到类似的情况,我会先问这个问寻求帮助的人和自己,这个问题重要且紧急吗?如果不是这样,我就会告诉请求帮助的人,我会在什么时候做这件事情,而不是立即投入进去。

刻意练习的时候反馈尤为重要,要不然练习的方向就可能错了。联想到我打羽毛球了,最近一直进步不大,步伐跟接球技巧都不行,即使看了视频可以去练还是进步不大,原因在于对自己的锻炼没有一个有效的反馈。还是得找有经验的人指导同时多跟一起打球的朋友切磋才能进步。

 

 

Tags:

Installs and removes roles, role services and features by Windows powershell.

We can Install and remove roles, role services and features by powershell, which is faster and convenient. The original requirement is we want to install MSMQ feature on Windows Server 2008 by script.

Microsoft suggests to user PowerShell Cmdlets: Add-WindowsFeature, Remove-WindowsFeature, etc

Take install and remove MSMQ as example:

# Install MSMQ
Import-Module servermanager
Add-WindowsFeature “MSMQ-Services”

# Remove MSMQ
Import-Module servermanager
Remove-WindowsFeature “MSMQ-Services”

The original command ”ServerManagerCmd.exe” is deprecated, although it also can do the same thing. But it is not guaranteed to be supported in future releases of Windows.

You also can refer to the blog post from Windows PowerShell Team, titled “Managing Server Features with PowerShell Cmdlets on Windows 2008 Server R2 Beta“。

Tags:

Message Queue应用总结

概念及应用场景

在讲Message Queue之前,先谈谈它的概念及应用场景。

定义如下: Message Queue是进程之间通信的一种方式。它通过在进程之间传递消息来达到通信的目的。这些消息保存在一个队列内,各个进程可以发送和接收消息。

应用场景:简单说来,需要进程之间异步通信的时候即可使用。一般可以用于分布式协作。一种典型的方式就是实现Pub/Sub模式,即发布与订阅可以异步进行。

我们项目中的一个应用场景:应用程序服务器需要产生多个Job,然后将Job放入数据库,然后由一个Worker在后台执行这些Job,问题在于Worker执行一个Job很耗时,导致大量Job堆积。需求是让大量Job能够在短时间内执行完。很容易想到的解决方案是让多个Woker并发运行,这就需要一个分发机制,那么Message Queue就是一个很好的平台,应用程序进程为Pub,Worker进程为Sub,他们之间通过Message很方便的通信,同时支持多个Sub并发运行,以缩短所有Job的执行时间。

流行的Message Queue比较

当先流行的Message Queue有很多,比如微软的MSMQ(Microsoft Message Queuing)Apache ActiveMQ以及RabbitMQ等,同时基于这些基本的Queue还有很多扩展,在基本Queue之上提供一些典型的应用模式以及对安全性,事务等做扩展。比如NServiceBus,它基于MSMQ,MassTransit是基于MSMQ, RabbitMQ等。我分两部分对其做比较,基本Message Queue以及对于它们的扩展:

基本Message Queue比较(从如下维度比较,最大区别在于Deployment):

Queue扩展比较:

MSMQ与NServiceBus之间的比较:

Security and Transaction NServiceBus leveraged same mechanism as MSMQ
Performance Since the NServiceBus is based on MSMQ, there’s no difference on the performance about sending and receiving message. While NServiceBus does optimize something like serializing the message. But for the end to end performance, the bottle neck is hanlding the message, like generating the pdf. So we think it’s valuable feature of NServiceBus, but not a very important factor in our scenario.
Auditing NServiceBus has a nice built-in feature that forwarding all messages to a specified queue. MSMQ has a journal queue support as well. But for any advanced auditing other than copying all historical messages, we have to do something by ourselves for both solutions.
Monitoring Since the NServiceBus is based on MSMQ, all existing monitoring tools could be used on both. NServiceBus provides an extra performance counter to monitor the waiting time of a message in a queue, which is very useful, since it indicates the bottleneck. For monitoring requeirement from the business perspective, like whose report has been generated, failed, or still waiting, and the related information like goid, cqs information, we have to provide a homemade web page by ourselves.
Scalability From scaling the consumer (job worker) perspective, they both have scalability built in. From scaling the queue perspective, they both have not mentioned it. The scalability for queue should be resolved by infrastructure like load balancer or Windows Cluster.
Reliability (Failover) MSMQ has same position as SQL Server on Windows Server 2008 cluster. The Windows Server 2008 R2 support configuring the MSMQ as an active/active cluster mode. The message storage could use RAID as well, still same as SQL Server.

参考资料

1. MSMQ的具体概念以及在.Net环境下编写简单的Message Queue程序:http://www.cnblogs.com/rickie/archive/2004/11/16/64345.aspx
2. 企业级应用MSMQ的9个秘诀:http://www.devx.com/enterprise/Article/22314
3. Message Queue设计指南,性能监控,安全考虑等: http://technet.microsoft.com/en-us/library/cc753070(WS.10).aspx

Tags: