20:51 鱼咬羊的对联 » 妮妮
下午在静之湖开会,开得一点不静。每季度的管理会数字说话,业绩和排名一摆出来,一点不给各方诸侯留面子。

百无聊赖时收到爸爸的短信:今天去医院的路上路过喜园,看见求的对联已经挂上了。你认为如何?告之以博一笑。

喜园是贵阳的一家酒店,就在我家附近,群众基础颇高,啥时候去人都挺多,我初中三年上下学都会路经此地,只是那时候还不叫喜园罢了。这里和我们也颇为有缘,05年我和小宝结婚时父母的认亲酒就在这里办的,所以每次回去但凡路过这里,就觉很亲切。

上次回家时,喜园已经改为店名为“鱼咬羊”了。鱼咬羊是安徽名菜,由于淮北地区民俗喜食羊肉,原为羊肉汤中煨鲫鱼成奶汤菜。后改良用了桂鱼,桂鱼膛较大,由口中绞出内脏,灌入羊肉,小火红烧,菜做好后鱼体完整,腹中有羊肉,鱼不腥,羊不膻,鲜美无比。

新店一开,鱼咬羊就在店内外招贴告示:出一上联,向各方征集下联,对出者奖励500元。爸爸说这段时间照顾你妈太忙,等闲下来再好好给他们对一个。

爸爸没闲下来,人家下联已经挂出来了:

上联为:桌桌有鱼鱼羊为鲜;

下联为:人人尽兴兴言成誉;

横批:鱼咬羊

我给爸回短信:对得不错。席席有羊羊大为美,如何?取其鲜美之意。

会议还在继续,激烈依旧。随着爸爸的短信神游回来不由感叹,生活在中小城市,才更能真正体会生活之美。

16:05 广告越大点击率越高?[贴图] » laolu's blog: Blog

图片来自:MarketingSherpa
11:18 基于Google Analytics的点出统计 » 车东[Blog^2]

大部分web引用统计系统都实现了基于站内的点击行为分析,但是对于点出到其他网站的链接,由于点出链接地址不一定都部署了相通的统计。那么这些点击行为就要在链接所在的页面在点击的时候触发统计了。传统的是中间转向页面,但这样的链接机制非常不利于SEO,给蜘蛛带来了大量的麻烦用于识别真正的目标地址;之前介绍过一些基于鼠标触发机制的页面点出统计方法: 一般是通过在点击的时候触发在当前页面插入一个 img bean,然后统计相应的img 请求实现,现在连这样的点击触发器在Google Analytics统计中也可以自定义实现了: 以下例子在页面点击的时候,会触发Google Analytics生成一个对clickto/TAGET_URL 一个自定义的地址(clickto实际上不存在的)请求访问;


<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write("\<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'>\<\/script>" );
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-69476-1");
pageTracker._addOrganic("baidu","word");
pageTracker._addOrganic("soso","q");
pageTracker._addOrganic("vnet","kw");
pageTracker._addOrganic("yodao","q");
pageTracker._initData();
pageTracker._trackPageview();

document.onclick = function(e) {
e = e || event;
var el = e.target || e.srcElement;
if ( el.tagName=='A' ) {
pageTracker._trackPageview("\/clickto/" + window.location.href.replace("http:\/\/www.chedong.com/", "") +
el.href.replace("http:\/\/", "\/"));
}
}
</script>


在统计报表中看到的效果就是这样的:
clickto_stats.png
通过在所有访问url中过滤出clickto即可;

感谢XD同学,这个点出统计例子从very.cd上学到的;
一个好的例子胜过长篇大论,可以看到very.cd通过对onclick的触发机制,结合站内的cookie等还实现了客户回访率统计等;

09:51 摘录一段结尾的字幕:人们不会简单地把反对自己政府的政策作为自己的任务 (评论: War Made Easy: How Presidents and Pundits Keep Spinning Us to Death) » 车东@豆瓣 的最新评论
车东@豆瓣评论: War Made Easy: How Presidents and Pundits Keep Spinning Us to Death
评价: 推荐

(马丁·路德金)
当时刻来到寂静被打破
而这一时刻已经为我们降临
即使是来自你内心深处的要求
人们不会简单地把反对自己
政府的政策作为自己的任务
特别是在战争时期

我知道我再也不能呐喊
对抗灾犹太区被压迫的暴力
没有能和如今世界上最伟大的
暴力传承者
我自己的政府说清楚
当我们用自己最新的武器
在他们身上试验时 他们在想什么
正如德国纳粹...
00:38 A common problem when optimizing COUNT() » MySQL Performance Blog

When optimizing queries for customers, the first thing I do with a slow query is figure out what it's trying to do. You can't fully optimize a query unless you know how to consider alternative ways to write it, and you can't do that unless you know what the query "means." I frequently run into a situation where I'm forced to stop and ask the developers what they were trying to do with COUNT(). This is database-agnostic, not related to MySQL.

The problem is when the COUNT() contains a column name, like this:

SQL:
  1. SELECT count(col1) FROM TABLE;

If you know your SQL well, you know COUNT() has two meanings. 1) count the number of rows 2) count the number of values. Sometimes, but not always, these are the same thing. COUNT(*) always counts the number of rows in the result. If you write COUNT(col1) it counts the number of times col1 is not null. If it's never null, the result is the same as the number of rows.

The problem with that is that you don't know by looking at the query whether the developer wanted to count rows or values -- or, quite possibly, the number of distinct values in that column. You see, there's another form for COUNT():

SQL:
  1. SELECT count(DISTINCT col1) FROM TABLE;

So when I see a query that just does COUNT(col1) I am left with these guesses:

  1. You meant to count the number of rows. You should have written COUNT(*) to convey that meaning accurately. If the column is nullable, there's a bug in your query -- it won't do what you think it does.
  2. You meant to count the number of distinct values, but you left out the DISTINCT keyword. That's also a bug in your query.
  3. You meant to count the number of times the column's value is not null. This in my experience is pretty unlikely -- people rarely do this.

It is impossible to read the developer's mind in these cases, so I always end up getting stalled waiting for them to reply and tell me what the query means so I can optimize it.

A good coding standard can help here -- you can quickly write a tool to grep your source code and search for instances of such constructs, and flag them as errors unless some magic comment is embedded in the code next to them:

SQL:
  1. SELECT count(col1) FROM TABLE; -- COUNT_COL_OK

Alas, there is a lot of misinformation on the web about COUNT(), so it is not a good place to learn about what it does. 90% of what you can find online is just wrong. So I would advise a good book on the topic, except I can't think of one -- maybe Joe Celko's books address this topic clearly? What's your recommendation?


Entry posted by Baron Schwartz | 7 comments

Add to: delicious | digg | reddit | netscape | Google Bookmarks


^==Back Home: www.chedong.com

^==Back Digest Home: www.chedong.com/digest/

<== 2008-09-20
  九月 2008  
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
==> 2008-09-22