Archive

Archive for June, 2011

缅怀家驹

打开CRI, 耳边响起了那首熟悉的<<喜欢你>>,节目是音乐无人驾驶. 只需要听着歌, 不需要多余的言语. 已经不记得具体是什么时候喜欢上beyond的歌了, 但是可以确定是很久之前, 初中吧. beyond的哥陪伴了我整个高中.

记得在高中毕业的同学录中最喜欢的歌手, 我填上了beyond. 关于那么多最喜欢的各种项目, 大部分的项目是一时头脑发填上的, 多年以后再填或许已经是南辕北辙, 但到现在还不变的是beyond.

又响起了<<灰色轨迹>>,  这首歌是我听的家驹的第一首歌, 是在一人一首成名曲的VCD上, 演唱会版本. 促使走入他们音乐的人是张守吉, 我的小学同学. 没有摇滚, 只有beyond, 那时他说的一句话. 那时不懂什么是摇滚, 或许他们的哥只能算是比较硬朗情歌吧.

已经是第18个年头了. 家驹, 你在天堂可好? 天堂里有摇滚吗?

曾经有多少人因为beyond乐队才拿起的吉他, 但我不是, 拿起吉他的原因我已记不清楚, 但我清楚的记得重新拿起它的原因.

忽然觉得很难表达我的感情, 写这篇文章安了无数的空格.

NJ终于说话了, 讲解<<光辉岁月>>的背景, 曼德拉. 自信可改变未来.

S**t, 怎么一首<<发如雪>>插进来了, 真煞风景.

本想开打我那古老的yahoo帐号, 找找以前放在里面相册中的家驹的资料, 不想却在09年的时候已经关闭了此服务.

“””009年10月30日,中国雅虎关闭了雅虎空间服务,取消相册功能,但因为有许多用户没能及时备份照片,引发不满,并有网友向消委会举报,欲上诉。中国雅虎回应相册用户照片丢失事件,认为事先已公告用户备份,雅虎有权关闭服务器,自己没有责任。”””

已往为了自我挣扎, 从不知她的痛苦.

She be do
She be do
She be do

感谢你陪我唱了这些歌.

恰好今天是毕业典礼, 想想时间过的真快, 一年就这样过去了.  想起来去年的这个时候, 不停的送走一拨又一拨, 期间躺在窄窄的小床上, 觉得那是理所当然, 总觉得这只是一个假期, 过两个月, 大家又会回来. 但当最后我收拾完最后的东西, 拿走伟哥的饭盆, 转头的时候, 空荡但又凌乱的宿舍提醒我这是真的, 大学结束了.

email不论在个人生活学习还是工作中都占有举足轻重的地位, 很久之前我也不知道回复全部是什么意思, 我庆幸我在在它上面犯错之前明白了它的用法, 也没有因为它犯过错误, 对于发送的动作也倍加小心. 希望某些同志注意这个按钮后果的严重性.

原文地址 http://bogglish.com/index.php/career/810-reply-all-the-button-everyone-loves-to-hate

I answered my phone recently to hear a friend shrieking in my ear. “Check your inbox for the email I just sent you,” he wailed. “And please, please tell me I didn’t hit Reply All.”

What happens when we hit

“reply all” by mistake? The result can be very embarrassing to say the least. Elizabeth Bernstein offers some tips on how to avoid making such a potentially costly mistake.

You know that feeling: You hit Send—and your heart nearly stops.

This shouldn’t still be happening. After almost two decades of constant, grinding email use, we should all be too tech-savvy to keep making the same mortifying mistake, too careful to keep putting our relationships and careers on the line because of sloppiness.

Sadly, we are not, as Bill Cochran, a 44-year-old advertising creative director, can attest. Last summer, as the Dallas agency where he works, the Richards Group, was gearing up to produce Super Bowl spots for a major client, Bridgestone Corp., his boss sent an email to about 200 employees with a schedule of meetings where creative teams would present work, competing in rounds until the agency selected ads to present to the client for review.

 Lars Leetaru

Mr. Cochran seized the moment to rally his writing partner. He drafted an email reply critiquing the in-house competition, noting which colleagues he thought would give his team a run for their money—and which wouldn’t. “It was written in locker-room talk,” Mr. Cochran says. “I listed the people I thought were ‘gonna bring it.’ “

You can guess what happened next. Minutes after hitting Send, he got an email. “Oh God…Bill,” a co-worker, Wendy Mayes, wrote. “You just hit REPLY ALL!”

Mr. Cochran felt the blood drain from his head. He reread his email several times, telling himself it could have been worse. Then he sent out a second Reply All message: “Sorry about that. I am going to go climb in a hole now.”

“We all say these things,” Mr. Cochran says, looking back. “But most people aren’t stupid enough to put it in an email.”

Used intentionally, Reply All has its benefits. It’s convenient. And it can be polite, especially in a work situation.

“If you were in a face-to-face meeting and someone made a comment or asked a question, you would be considered rude if you whispered your reply in just that person’s ear so no one else could hear it,” says Patricia Wallace, a psychologist and author of “The Internet in the Workplace.”

But Reply All is dangerous. It makes us feel in the loop. And it can be a way to toot our own horns. Never mind that we hate how group emails multiply like rabbits in our inboxes. “Many people lean toward covering their rears by overinforming their bosses and colleagues,” Dr. Wallace says. “They can then say, ‘Well, I cc’d you on all that debate last month…Didn’t you read it?’ “

Why don’t email programs have a “dummy button” that pops up when we hit Reply All and asks, “Are you sure?” There are applications for that, such as Sperry Software’s Reply to All Monitor.

“It’s a tricky technical problem to solve without getting in the way, because there’s a certain velocity at which people are using these applications,” says Bill Wetherell, director of design for AOL Inc.’s AOL Mail. “There will always be the person who lacks boundaries and will say things that he shouldn’t say. We can’t prevent that.”

To make email more like in-person communication, AOL is considering ways to show faces, rather than just names, in the To field in a new email product coming out in the next six months. “I wonder if the Reply All problem would occur if you saw 100 faces in the email,” Mr. Wetherell says.

Microsoft Corp.’s Outlook offers a standard template that users can elect to get a warning if they try to email to more than 50 people.Google offers an Undo Send button in Gmail, which works for Reply All emails, too. You enable it by setting a delay in your out-bound emails, from five to 30 seconds. If you don’t realize your mistake in time, you’re out of luck.

email storm

email storm

Helen Georgaklis wishes there had been a warning for one of her colleagues at a financial firm where she used to work. She was helping prospective clients, a couple from her church, refinance their home, and she introduced them to the colleague via email. His Reply All response? She recalls it was something like, “Thank you sexy Helen. I’m sure that all your male clients love working with you because you are so hot.”

Right away, the husband replied to say he was uncomfortable with the content of the email. The colleague apologized profusely to her and her clients. They continued with the mortgage refinancing, but after it was done, the clients shunned Ms. Georgaklis at church. Her working relationship with her colleague chilled.

“The damage was done,” says Ms. Georgaklis, 44, who lives in Montreal and founded a self-help book series.

There’s an even bigger Reply All mishap: the email storm. It starts with an email sent accidentally to the wrong distribution list. Then everyone starts furiously replying to all.

Some email storms have lasted so long—overloading servers with hundreds of thousands of emails—that at least one company, TV-ratings provider Nielsen Co., has disconnected the “Reply to All” button from its system.

In 1997, Microsoft weathered a storm involving an estimated 15 million emails. A 2007 email storm at the U.S Department of Homeland Security clogged the system with millions of emails.

Mr. Cochran, the advertising creative director, couldn’t sleep the night after his Reply All disaster. His “apology tour” began the next day. On the phone and in person, he said he was sorry to each colleague he named.

“A lot of people just laughed, and a few said they felt sorry for me that I had to endure the finger-pointing,” he says. “I think a lot of people felt, ‘Man, I am glad I didn’t do that, because that’s a lot of crow to eat,’ ” says Christopher Smith, 38, another creative director at the agency.

The ribbing went on for weeks. Mr. Cochran’s email went viral inside the agency minutes after it was sent. Co-workers sent their own Reply All retorts. Some called Mr. Cochran an idiot, some pretended to insult others and then asked, “Uh-oh, did I send that to all?”

“His name became synonymous with idiotic behavior, such as ‘Don’t pull a Cochran,’ ” says Ms. Mayes, 35, the copywriter who alerted him to his gaffe.

Mr. Cochran had to face his colleagues in the weekly creative meetings. One of his early ad ideas was to have a young girl who tries to stop people from reading an email where she lists the boys she thinks are cute.

In an ad that Bridgestone eventually chose to run during the 2011 Super Bowl—a spot Mr. Cochran and his creative partner called “Reply All”—a man frantically drives around town, running into offices and ripping out computers and snatching Blackberrys from people’s hands to keep them from reading his email.

Mr. Cochran had lots of time to reflect on ways to avoid repeating his mistake. “I felt awkward right up to the final presentation, where I had to tell the people at Bridgestone that this was based on a true story,” he recalls. “Everyone who was named in that email was in the room with me.”

His advice: Move your Reply All button as far from the Reply button as possible. “And now I certainly gut-check what I want to say about someone before I put it in an email.”

 

 

 

Categories: Computers and Internet Tags:

[译]避免在Joins中出现OR

避免在Joins中出现OR

为什么要避免在joins中出现OR条件,一个优化例子

OR条件和join语句—这两样东西不适合放在一起.类似于or能大大影响带有子查询的查询,他们能给joins语带带来非常坏的影响.

举个例子, 看下面的查询(也许不太符合实际). 这里假设一个数字型表(numbers)已经创建好了 (详见使用笛卡尔积查询方式生成的数据). 假设现在的表里有10,000行记录.

SELECT n1.num, n2.num, n3.num FROM numbers n1
INNER JOIN numbers n2 ON ( (n1.num = n2.num - 400) OR (n1.num = n2.num + 400))
INNER JOIN numbers n3 ON n2.num = n3.num - 300
ORDER BY n1.num, n2.num, n3.num

这个查询看起来非常简单. 然而即使源表只有10,000行记录以及选出的结果只有区区18,900行记录, 却花费了5秒(译者PS:我承认我的机器很差劲, 用了20秒), 而且Management Studio(其实是我的整个机器)在执行的时候失去响应. 这个查询使CPU的使用率飙升到100%. 这个不是个好现象—joins和OR条件根本就不能放在一起(至少是在sql server中是这样).

我遇到这个情况是在BPS(基础程序设计支持).我们有一个学校完成的DTS包用来把学生数据转移到另外一个数据库(采用不同的构架). 其中的一部花费了20分钟, 我只是用它跑了几次. 但因为我最好找更好的方法, 我决定研究一下其中的步骤. 在20分的运行过程中, I fully expected to see some highly complex tangled web of SQL with 30 joins and 150 lines.我不能再犯错误了, 毕竟这只是一个简单的查询(带有or条件的join). 在五分钟内, 我把这条查询拆分成独立的两块, 这样以前需要20分钟的现在只需要2秒.

在上面的查询中, 这只是一中解决方案(使用union)来拆分OR条件. 肯定好友其他实现的方式, 我希望你们在评论中提出其他的解决方案来处理OR条件.

SELECT n1.num, n2.num, n3.num FROM numbers n1
INNER JOIN numbers n2 ON n1.num = n2.num - 400
INNER JOIN numbers n3 ON n2.num = n3.num - 300
UNION
SELECT n1.num, n2.num, n3.num FROM numbers n1
INNER JOIN numbers n2 ON n1.num = n2.num + 400
INNER JOIN numbers n3 ON n2.num = n3.num - 300
ORDER BY n1.num, n2.num, n3.num

使用上面的10,000行记录的表, 这个查询在瞬间完成. 处理800,000行数据的表只需要8秒. 如果我使用第一种查询查询处理那个大的表, 我想的机器不得不重启了.

声明

这篇文章, 包括其中的任何相关的源码和文件,都在Code Project Open License (CPOL) 的许可一下.

原文地址 codeproject

http://www.codeproject.com/Articles/206408/Avoiding-OR-Conditions-with-Joins

 

译者补充: 次日上午, 根据分析, 如果在num加上索引, 速度会提升很多, 果不其然, 完成也是做瞬间.

CREATE CLUSTERED INDEX [_dta_index_numbers_c_9_2041058307__K1] ON [dbo].[numbers] 
(
	[num] ASC
)

原文


Avoiding OR Conditions with Joins

Why OR conditions in join statements should be avoided and an example fix

OR conditions and join statements – some things just don’t go well together. Similar to how OR conditions can significantly impair queries having subqueries, they can wreak havoc on joins as well.

Take, for example, the following [admittedly unrealistic] query. This assumes a numbers table [numbers] has been set up. [See myCartesian join postfor a query to set up a numbers
table.] Assume the numbers table only has 10,000 records.

Collapse

SELECT n1.num, n2.num, n3.num FROM numbers n1
INNER JOIN numbers n2 ON ( (n1.num = n2.num - 400) OR (n1.num = n2.num + 400))
INNER JOIN numbers n3 ON n2.num = n3.num - 300
ORDER BY n1.num, n2.num, n3.num

This query looks simple enough. However, even though the source table only has 10,000 rows and the result only has 18,900 records, it takes 5 seconds to complete, and Management Studio [and
frankly my entire computer] freezes while it is running. This query spiked CPU usage to 100%. That’s not good – joins and OR conditions simply do not mix [at
least on SQL Server].

I encountered this exact type of scenario at BPS. We have a DTS package for bringing over student data from the source location to another database [with a different schema] where the school assignments are done. One of the steps took 20 minutes, and I simply lived with it the first few times it ran. But because it’s best to ask if there’s a better way, I decided to investigate the step. With a 20 minute runtime, I fully expected to see some highly complex tangled web of SQL with 30 joins and 150 lines. I couldn’t have been more wrong – it was a simple query resembling the one above [with an OR
condition in the join]. In under 5 minutes, I’d broken apart the query into two separate steps and what previously took 20 minutes to run only took 2 seconds.

For the query above, here’s one solution [using aUNION] for breaking apart the OR. There are likely other ways and I invite comments for other approaches to removing the OR condition.

Collapse

SELECT n1.num, n2.num, n3.num FROM numbers n1
INNER JOIN numbers n2 ON n1.num = n2.num - 400
INNER JOIN numbers n3 ON n2.num = n3.num - 300
UNION
SELECT n1.num, n2.num, n3.num FROM numbers n1
INNER JOIN numbers n2 ON n1.num = n2.num + 400
INNER JOIN numbers n3 ON n2.num = n3.num - 300
ORDER BY n1.num, n2.num, n3.num

This query runs instantly with a numbers table having 10,000 rows. It finishes in 8 seconds for a table having 800,000 rows. If I had used the larger table with the first query, I’d probably have to reboot.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Categories: database Tags:

关于数学

不算近的一段时间之前, 在工作中遇到了因为数值的频繁运算而引起的结果微小的差异. 这个是在所难免的, 对于非严格环境下的运算, 精度的缩减是可以容许的. 今晚看一本的书的时候巧合看到了一算关于用分数表示小数的方法, 主要是针对那些无限循环的小数. 这个只是个算式而已, 还没到实际的计算机数据结构的程度. 看了一下忍不住动手自己划拉了一下. 真的是生疏了. 合上书这么小小的一页算式却推算不出来.

又要感慨, 工作这么长时间也没有感觉用到那些学到的基础课, 不免又开始质疑自己工作工作价值. 整天面对着那些重复的增删改查\Proc, Trigger, 以及无穷的猜测和实验, 还有付出超人的忍耐力, 工作俨然真的变成了工作.

抛开这段把东西讲迈向工广阔的时间段, 查询文档\调用方法\展示处理数据. 什么字典哈希表排序查找, 现成类库直接调用. 已经很久很久没有很数学有过亲密接触.

这段上下文写了删, 删了写, 意会就行, 不一定要明说.

还有, 用好法律要学好离散数学.

这段时间一直公干在外, 眼看这学弟学妹就要毕业离开了, 也没有机会见他们在学校的最后一面. 同学们, 不知何年何月才能再次相见, 珍重. 很多事情距离是一个巨大的隔阂, 亲人\爱人\朋友间. 虽然已称”地球村”, 但是离我们一般人还是很遥远.

Categories: Code, Sentiment, Work Tags:

debug trigger

June 22, 2011 Comments off

Step one. create a new stored procedure using the code which will trigger the trigger.

Step two. debug the procedure.

Step three. Step through the trigger code using the F11 key or the Step Into button at the statement which could trigger the trigger, such as UPDATE, DELETE or UPDATE.

Step through the trigger until you exit back to the stored procedure, and continue to the end.

PS:  Suppose you can debug a procedure in sql server. 

reference: http://msdn.microsoft.com/en-us/library/ms165046(VS.80).aspx

Categories: database Tags:

NULL

[tag 恍惚]
NULL

Categories: Sentiment