John Robbins 上课时讲的趣事

15 篇文章 0 订阅
8 篇文章 0 订阅

John Robbins 上课时讲的趣事

我在 2010 年 6 月有幸在微软听了 Wintellect 公司的 John Robbins 大侠的 Windows Debugging 课程。John Robbins 先生何方人士也?乃是 MSDN Magazine 中一度的砍虫大侠——Bugslayer专栏的作者之一。本人久仰其大名,今得见时,激动万分。故而认真听讲,一刻不愿开小差哉。

本文当然不会把整个上课的内容照搬上来,否则,John 大侠要是知道了他课程生意不好是因为我的这篇文章的话我也不好意思解释 :-P。主要讲几件趣事。

一则是上课时,John 看到我等年龄都是二十多,他开玩笑说:他干这一行做程序调试和除错已经做了二十年了——嗯,我开始干这行的时候,你们还没出生呢,肯定是这样!:-D(当然 John 老师看上去挺年轻,也就四十出头吧!)

二则是有关他的创业。当年他赚钱不多,和我们一样都是工薪一族的时候,有一次机会在一个酒吧晚会上他见到了比尔·盖茨。他于是就和比尔聊了起来。聊天过程中他探了探比尔的口气:你有没有可能给我一个工作做做?比尔一听,一口回绝:你要是有本事,自已想办法赚大钱!向别人讨职位是没面子的事。于是,John 慢慢地发奋图强,现在坐飞机都能坐头等舱了,微软都经常要请他来讲课。

三则是有关纸牌的趣事。纸牌游戏(Solitaire,有点像扑克牌接龙)是 Windows内置的游戏之一。他说当年有一个微软员工,在上班时间里,老板(经理)过来看他在干什么。一看,他在电脑上做一个游戏,花花绿绿的扑克牌。老板说:你这个游戏不错嘛!拿来放在下一版的 Windows 里一起发布吧!员工说:不要啊,那个是我练习 Windows编程做的游戏!老板说:你是在公司的电脑上写的,所以就是公司的!(微软公司是有这么一条规定)员工说:不要啊……然后老板得意洋洋地拿着软盘把程序拷走了,哈哈!

据说,纸牌游戏给美国带来了每年三亿元的经济损失。有一次,John坐在头等舱,在用他的笔记本电脑。他偶尔想看看坐在前面的那个人在用笔记本电脑做什么。结果一看:在玩纸牌游戏!……倒是有人跟他聊天。他对我们说,跟坐头等舱的人聊天时不能让他们知道你是做调试和除错的,否则他们一定会说:哦我用的一个程序老是崩溃,你帮我看看怎么解决这个问题吧!

有一个技术话题还是有点意思的。说到 C++ 的异常,他的建议是只在局部代码中使用,并遵循一定规范,否则,终有一天你会看到 catch dot dot dot(catch (...))出来,到时候就郁闷了(因为 VC++ 的异常处理中 ...是任意异常对象,并且在程序中无法将此对象的信息读出来;调试器能读出来但是还是不知道是从哪里抛出来的)。这可是他二十年来的经验之谈哦。所以,C++里面使用异常还真得小心啊!

还有一个话题也有点意思,就是多线程的编程。John 说,多线程的编程一定要非常小心,因为一旦出现同步问题很难通过调试的手段来重现和解决;他建议多线程的程序必须经过三方会审,就是三个不同的小组进行代码审阅。这样才保险。

他谈到微软的最新版 Visual Studio 2010 里的 VC++,新的 /GS编译开关对于缓冲区溢出有了更完善的防护。其实我觉得 VS 2008/VC++ 中的条件断点已经功能相当多了。VS 2010 的 C#听说可以做“时光倒流”调试,就像放录像一样,把程序的执行记录下来以后可以往前也可以往后。虽说微软的产品不可能样样都完美吧,但是某些技术的确是相当的牛叉。

Wintellect 公司是什么公司呢?公司不大,却是微软有力的合作伙伴之一。Wintellect公司还有一位有名的高手:Jeffrey Richter。他当年写的 Windows 95编程书内容非常深入,把窗口句柄、类句柄、窗口类、子类化、消息分派等讲到十分详细,一般人都不会用到他书里讲的那些非常深入的东西,但是,只有有了这样的工夫,才能把 Windows 做出来啊。

其实,John 之前还工作于另一个专门编写调试器的公司:NuMega。稍微老一点的黑客肯定知道 SoftICE 吧,它们就是 NuMega 公司的杰作。Matt Pietrek(《Windows 95 系统编程揭秘》的作者)在 NuMega 公司时做过 John 的同事。著名的微软技术专家 Mark Russinovich 也曾经在这家公司干过。


附:John 的一篇有趣的博客:http://www.wintellect.com/cs/blogs/jrobbins/archive/2008/02/25/the-travel-day-from-hell.aspx
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
The Robbins-Monro setting is a mathematical framework used to study stochastic approximation and optimization problems. It is named after Herbert Robbins and Sutton Monro, who introduced this framework in the 1950s. In the Robbins-Monro setting, we consider a sequence of random variables (Xn, Yn) where Xn is a sequence of random variables taking values in a measurable space and Yn is a sequence of random variables taking values in the real line. The goal is to find a sequence of real numbers (θn) that converges to a solution of the optimization problem minimize f(θ) where f is an unknown function that we want to minimize. The key assumption in the Robbins-Monro setting is that the function f is not known, but we can evaluate it at any point θ. Moreover, we assume that the random variables (Xn, Yn) are independent and identically distributed, and that the conditional distribution of Yn given Xn and θn is a probability distribution that depends on θn. The Robbins-Monro algorithm is a way to solve the optimization problem in this setting. It is an iterative algorithm that updates the estimate θn based on the observed value of Yn: θn+1 = θn - an(Xn, θn)(Yn - f(θn)) where an(Xn, θn) is a sequence of positive numbers that satisfies certain conditions. The idea behind this update rule is to move θn in the direction that reduces the expected value of the objective function f. The Robbins-Monro algorithm has been widely used in statistics, machine learning, and control theory to solve various optimization and estimation problems. It is a powerful tool for dealing with complex and noisy data, and it can be used to find the optimal solution even when the objective function is non-convex or non-smooth.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值