<?xml version="1.0" encoding="UTF-8" ?>
  <rss version="2.0">
    <channel>

<title>::SinRain:: Simple Dream Easy Go</title>
      <link>http://rainme.ycool.com/</link>
      <description><![CDATA[]]></description>
      <pubDate>Wed, 30 Jul 2008 16:07:04 GMT</pubDate>
      <lastBuildDate>Wed, 30 Jul 2008 16:07:04 GMT</lastBuildDate>
      <image>
        <url>http://sta.yculblog.com/images/logo/general-88x31.gif</url>
        <title>::SinRain:: Simple Dream Easy Go</title>
        <link>http://rainme.ycool.com/</link>
      </image>
<item>
        <title>[转贴] 流形学习简介</title>
        <link>http://rainme.ycool.com/post.1976607.html</link>
        <description><![CDATA[<div>
<h4>&nbsp;</h4>
<div><strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>是个很广泛的概念。这里我主要谈的是自从2000年以后形成的<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>概念和其主要代表方法。自从2000年以后，<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>被认为属于非线性降维的一个分支。众所周知，引导这一领域迅速发展的是2000年Science杂志上的两篇文章: Isomap and LLE (Locally Linear Embedding)。<br />
<br />
1. <strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>的基本概念<br />
<br />
那<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>是什莫呢？为了好懂，我尽可能应用少的数学概念来解释这个东西。所谓<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>（manifold）就是一般的几何对象的总称。比如人，有中国人、美国人等等；<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>就包括各种维数的曲线曲面等。和一般的降维分析一样，<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>把一组在高维空间中的数据在低维空间中重新表示。和以往方法不同的是，在<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中有一个假设，就是所处理的数据采样于一个潜在的<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上，或是说对于这组数据存在一个潜在的<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>。对于不同的方法，对于<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>性质的要求各不相同，这也就产生了在<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>假设下的各种不同性质的假设，比如在Laplacian Eigenmaps中要假设这个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>是紧致黎曼<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>等。对于描述<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的点，我们要用坐标，而<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上本身是没有坐标的，所以为了表示<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的点，必须把<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>放入外围空间（ambient space）中，那末<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的点就可以用外围空间的坐标来表示。比如R^3中的球面是个2维的曲面，因为球面上只有两个自由度，但是球面上的点一般是用外围R^3空间中的坐标表示的，所以我们看到的R^3中球面上的点有3个数来表示的。当然球面还有柱坐标球坐标等表示。对于R^3中的球面来说，那末<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>可以粗略的概括为给出R^3中的表示，在保持球面上点某些几何性质的条件下，找出找到一组对应的内蕴坐标（intrinsic coordinate）表示，显然这个表示应该是两维的，因为球面的维数是两维的。这个过程也叫参数化（parameterization）。直观上来说，就是把这个球面尽量好的展开在通过原点的平面上。在PAMI中，这样的低维表示也叫内蕴特征（intrinsic feature）。一般外围空间的维数也叫观察维数，其表示也叫自然坐标（外围空间是欧式空间）表示,在统计中一般叫observation。<br />
<br />
了解了<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>的这个基础，那末<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中的一些是非也就很自然了，这个下面穿插来说。由此，如果你想学好<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>里的方法，你至少要了解一些微分<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>和黎曼几何的基本知识。<br />
<br />
<br />
<br />
2. 代表方法<br />
<br />
a) Isomap。<br />
<br />
Josh Tenenbaum的Isomap开创了一个数据处理的新战场。在没有具体说Isomap之前，有必要先说说MDS（Multidimensional Scaling）这个方法。我们国内的很多人知道PCA，却很多人不知道MDS。PCA和MDS是相互对偶的两个方法。MDS就是理论上保持欧式距离的一个经典方法，MDS最早主要用于做数据的可视化。由于MDS得到的低维表示中心在原点，所以又可以说保持内积。也就是说，用低维空间中的内积近似高维空间中的距离。经典的MDS方法，高维空间中的距离一般用欧式距离。<br />
<br />
Isomap就是借窝生蛋。他的理论框架就是MDS，但是放在<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>的理论框架内，原始的距离换成了<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的测地线（geodesic）距离。其它一模一样。所谓的测地线，就是<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上加速度为零的曲线，等同于欧式空间中的直线。我们经常听到说测地线是<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上两点之间距离最短的线。其实这末说是不严谨的。<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上两点之间距离最短的线是测地线，但是反过来不一定对。另外，如果任意两个点之间都存在一个测地线，那末这个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>必须是连通的邻域都是凸的。Isomap就是把任意两点的测地线距离（准确地说是最短距离）作为<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>的几何描述，用MDS理论框架理论上保持这个点与点之间的最短距离。在Isomap中，测地线距离就是用两点之间图上的最短距离来近似的，这方面的算法是一般计算机系中用的图论中的经典算法。<br />
<br />
如果你曾细致地看过Isomap主页上的matlab代码，你就会发现那个代码的实现复杂度远超与实际论文中叙述的算法。在那个代码中，除了论文中写出的算法外，还包括了 outlier detection和embedding scaling。这两样东西，保证了运行他们的程序得到了结果一般来说相对比较理想。但是，这在他们的算法中并没有叙述。如果你直接按照他论文中的方法来实现，你可以体会一下这个结果和他们结果的差距。从此我们也可以看出，那几个作者做学问的严谨态度，这是值得我们好好<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>的。<br />
<br />
另外比较有趣的是，Tenenbaum根本不是做与数据处理有关算法的人，他是做计算认知科学（computational cognition science）的。在做这个方法的时候，他还在stanford，02年就去了MIT开创一派，成了CoCoSci 的掌门人，他的组成长十分迅速。但是有趣的是，在Isomap之后，他包括他在MIT带的学生就从来再也没有做过类似的工作。其原因我今年夏天有所耳闻。他在今年参加 UCLA Alan Yuille 组织的一个summer school上说，（不是原文，是大意）我们经常忘了做研究的原始出发点是什莫。他做Isomap就是为了找一个好的visual perception的方法，他还坚持了他的方向和信仰，computational cognition，他没有随波逐流。而由他引导起来的 manifold learning 却快速的发展成了一个新的方向。<br />
<br />
这是一个值得我们好好思考的问题。我们做一个东西，选择一个研究方向究竟是为了什莫。你考虑过吗？<br />
（当然，此问题也在问我自己）<br />
<br />
<br />
<br />
b) LLE (Locally linear Embedding)<br />
<br />
LLE 在作者写出的表达式看,是个具有十分对称美的方法. 这种看上去的对称对于启发人很重要。LLE的思想就是，一个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>在很小的局部邻域上可以近似看成欧式的，就是局部线性的。那末，在小的局部邻域上，一个点就可以用它周围的点在最小二乘意义下最优的线性表示。LLE把这个线性拟合的系数当成这个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>局部几何性质的刻画。那末一个好的低维表示，就应该也具有同样的局部几何，所以利用同样的线性表示的表达式，最终写成一个二次型的形式，十分自然优美。<br />
<br />
注意在LLE出现的两个加和优化的线性表达，第一个是求每一点的线性表示系数的。虽然原始公式中是写在一起的，但是求解时，是对每一个点分别来求得。第二个表示式，是已知所有点的线性表示系数，来求低维表示（或嵌入embedding）的，他是一个整体求解的过程。这两个表达式的转化正好中间转了个弯，使一些人困惑了，特别后面一个公式写成一个二次型的过程并不是那末直观，很多人往往在此卡住，而阻碍了全面的理解。我推荐大家去精读 Saul 在JMLR上的那篇LLE的长文。那篇文章无论在方法表达还是英文书写，我认为都是精品，值得好好玩味<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>。<br />
<br />
另外值得强调的是，对于每一点处拟合得到的系数归一化的操作特别重要，如果没有这一步，这个算法就没有效果。但是在原始论文中，他们是为了保持数据在平行移动下embedding不变。<br />
<br />
LLE的matlab代码写得简洁明了，是一个样板。<br />
<br />
在此有必要提提Lawrence Saul这个人。在Isomap和LLE的作者们中，Saul算是唯一一个以<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>（并不限于）为研究对象开创学派的人。Saul早年主要做参数模型有关的算法。自从LLE以后，坐阵UPen创造了一个个佳绩。主要成就在于他的两个出色学生，Kilian Weinberger和 Fei Sha，做的方法。拿了很多奖，在此不多说，可以到他主页上去看。Weinberger把<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>核矩阵引入到<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中来。他的这个方法在<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中影响到不是很显著，却是在 convex optimization 中人人得知。Fei Sha不用多说了，machine learning中一个闪亮的新星，中国留学生之骄傲。现在他们一个在Yahoo,一个在Jordan手下做PostDoc。<br />
<br />
<br />
<br />
c) Laplacian Eigenmaps<br />
<br />
要说哪一个方法被做的全面，那莫非LE莫属。如果只说LE这个方法本身，是不新的，许多年前在做mesh相关的领域就开始这莫用。但是放在黎曼几何的框架内，给出完整的几何分析的，应该是Belkin和Niyogi（LE作者）的功劳。<br />
<br />
LE的基本思想就是用一个无向有权图来描述一个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>，然后通过用图的嵌入（graph embedding）来找低维表示。说白了，就是保持图的局部邻接关系的情况把这个图从高维空间中重新画在一个低维空间中（graph drawing）。<br />
<br />
在至今为止的流行<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>的典型方法中，LE是速度最快、效果相对来说不怎莫样的。但是LE有一个其他方法没有的特点，就是如果出现outlier情况下，它的鲁棒性（robustness）特别好。<br />
<br />
后来Belkin和Niyogi又分析了LE的收敛性。大家不要忽视这个问题，很重要。鼓励有兴趣数学功底不错的人好好看看这篇文章。<br />
<br />
<br />
<br />
d) Hessian Eigenmaps<br />
<br />
如果你对黎曼几何不懂，基本上看不懂这个方法。又加作者表达的抽象，所以绝大多数人对这个方法了解不透彻。在此我就根据我自己的理解说说这个方法。<br />
<br />
这个方法有两个重点：（1）如果一个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>是局部等距（isometric）欧式空间中一个开子集的，那末它的Hessian矩阵具有d+1维的零空间。（2）在每一点处，Hessian系数的估计。<br />
首先作者是通过考察局部Hessian的二次型来得出结论的，如果一个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>局部等距于欧式空间中的一个开子集，那末由这个<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>patch到开子集到的映射函数是一个线性函数，线性函数的二次混合导数为零，所以局部上由Hessian系数构成的二次型也为零，这样把每一点都考虑到，过渡到全局的Hessian 矩阵就有d+1维的零空间，其中一维是常函数构成的，也就是1向量。其它的d维子空间构成等距坐标。这就是理论基础的大意，当然作者在介绍的时候，为了保持理论严谨，作了一个由切坐标到等距坐标的过渡。<br />
<br />
另外一个就是局部上Hessian系数的估计问题。我在此引用一段话：<br />
<br />
If you approximate a function f(x) by a quadratic expansion<br />
<br />
&nbsp; f(x) = f(0) + (grad f)^T x&nbsp; +&nbsp; x^T Hf x + rem<br />
<br />
then the hessian is what you get for the quadratic component.&nbsp; So simply over a given neighborhood, develop the operator that approximates a function by its projection on 1, x_1,...,x_k,&nbsp; x_1^2,...,x_k^2, x_1*x_2,... ,x_{k-1}*x_{k}.&nbsp; Extract the component of the operator that delivers the projection on&nbsp; x_1^2,...,x_k^2, x_1*x_2,... ,x_{k-1}*x_{k}.<br />
<br />
dave<br />
<br />
这段话是我在初学HE时候，写信问Dave Donoho，他给我的回信。希望大家领会。如果你了解了上述基本含义，再去细看两遍原始论文，也许会有更深的理解。由于HE牵扯到二阶导数的估计，所以对噪声很敏感。另外，HE的原始代码中在计算局部切坐标的时候，用的是奇异值分解(SVD)，所以如果想用他们的原始代码跑一下例如图像之类的真实数据，就特别的慢。其实把他们的代码改一下就可以了，利用一般PCA的快速计算方法，计算小尺寸矩阵的特征向量即可。还有，在原始代码中，他把Hessian系数归一化了，这也就是为什莫他们叫这个方法为 Hessian LLE 的原因之一。<br />
<br />
Dave Dohono是学术界公认的大牛，在<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>这一块，是他带着他的一个学生做的，Carrie Grimes。现在这个女性研究员在Google做 project leader，学术界女生同学的楷模 : )<br />
<br />
<br />
<br />
e) LTSA (Local tangent space alignment)<br />
<br />
很荣幸，这个是国内学者（浙江大学数学系的老师ZHANG Zhenyue）为第一作者做的一个在流行<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中最出色的方法。由于这个方法是由纯数学做数值分析出身的老师所做，所以原始论文看起来公式一大堆，好像很难似的。其实这个方法非常直观简单。<br />
<br />
象 Hessian Eigenmaps 一样，<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>的局部几何表达先用切坐标，也就是PCA的主子空间中的坐标。那末对于<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>一点处的切空间，它是线性子空间，所以可以和欧式空间中的一个开子集建立同构关系，最简单的就是线性变换。在微分<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>中，就叫做切映射 (tangential map)，是个很自然很基础的概念。把切坐标求出来，建立出切映射，剩下的就是数值计算了。最终这个算法划归为一个很简单的跌代加和形式。如果你已经明白了MDS，那末你就很容易明白，这个算法本质上就是MDS的从局部到整体的组合。<br />
<br />
<br />
这里主要想重点强调一下，那个论文中使用的一个从局部几何到整体性质过渡的alignment技术。在spectral method（特征分解的）中，这个alignment方法特别有用。只要在数据的局部邻域上你的方法可以写成一个二次项的形式，就可以用。<br />
其实LTSA最早的版本是在02年的DOCIS上。这个alignment方法在02年底Brand的 charting a manifold 中也出现，隐含在Hessian Eigenmaps中。在HE中，作者在从局部的Hessian矩阵过渡到全局的Hessian矩阵时，用了两层加号，其中就隐含了这个 alignment方法。后来国内一个叫 ZHAO Deli 的学生用这个方法重新写了LLE，发在Pattern Recognition上，一个短文。可以预见的是，这个方法还会被发扬光大。<br />
<br />
ZHA Hongyuan 后来专门作了一篇文章来分析 alignment matrix 的谱性质，有兴趣地可以找来看看。<br />
<br />
<br />
<br />
f) MVU (Maximum variance unfolding)<br />
<br />
这个方法刚发出来以后，名字叫做Semi-definite Embedding (SDE)。构建一个局部的稀疏欧式距离矩阵以后，作者通过一定约束条件（主要是保持距离）来<strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>到一个核矩阵，对这个核矩阵做PCA就得到保持距离的 embedding，就这莫简单。但是就是这个方法得了多少奖，自己可以去找找看。个人观点认为，这个方法之所以被如此受人赏识，无论在vision还是在learning，除了给<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>这一领域带来了一个新的解决问题的工具之外，还有两个重点，一是核方法（kernel），二是半正定规划（semi- definite programming），这两股风无论在哪个方向（learning and Vision）上都吹得正猛。<br />
<br />
<br />
g) S-Logmaps<br />
<br />
aa<br />
<br />
这个方法不太被人所知，但是我认为这个是<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>发展中的一个典型的方法（其实其他还有很多人也这莫认为）。就效果来说，这个方法不算好，说它是一个典型的方法，是因为这个方法应用了黎曼几何中一个很直观的性质。这个性质和法坐标(normal coordinate)、指数映射(exponential map)和距离函数(distance function)有关。<br />
<br />
如果你了解黎曼几何，你会知道，对于<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的一条测地线，如果给定初始点和初始点处测地线的切方向，那莫这个测地线就可以被唯一确定。这是因为在这些初始条件下，描述测地线的偏微分方程的解是唯一的。那末<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的一条测地线就可以和其起点处的切平面上的点建立一个对应关系。我们可以在这个切平面上找到一点，这个点的方向就是这个测地线在起点处的切方向，其长度等于这个测地线上的长。这样的一个对应关系在局部上是一一对应的。那末这个在切平面上的对应点在切平面中就有一个坐标表示，这个表示就叫做测地线上对应点的法坐标表示（有的也叫指数坐标）。那末反过来，我们可以把切平面上的点映射到<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上，这个映射过程就叫做指数映射（Logmap就倒过来）。如果<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上每一个点都可以这样在同一个切平面上表示出来，那末我们就可以得到保持测地线长度的低维表示。如果这样做得到，<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>必须可以被单坐标系统所覆盖。<br />
<br />
如果给定<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong>上的采样点，如果要找到法坐标，我们需要知道两个东西，一是测地线距离，二是每个测地线在起点处的切方向。第一个东西好弄，利用Isomap中的方法直接就可以解决，关键是第二个。第二个作者利用了距离函数的梯度，这个梯度和那个切方向是一个等价的关系，一般的黎曼几何书中都有叙述。作者利用一个局部切坐标的二次泰勒展开来近似距离函数，而距离是知道的，就是测地线距离，局部切坐标也知道，那末通过求一个简单的最小二乘问题就可以估计出梯度方向。<br />
<br />
如果明白这个方法的几何原理，你再去看那个方法的结果，你就会明白为什莫在距离中心点比较远的点的embedding都可以清楚地看到在一条条线上，效果不太好。<br />
<br />
<br />
bb<br />
<br />
最近这个思想被北大的一个年轻的老师 LIN Tong 发扬光大，就是ECCV&lsquo;06上的那篇，还有即将刊登出的TPAMI上的 Riemannian Manifold Learning，实为国内研究学者之荣幸。Lin的方法效果非常好，但是虽然取名叫Riemannian，没有应用到黎曼几何本身的性质，这样使他的方法更容易理解。<br />
<br />
Lin也是以一个切空间为基准找法坐标，这个出发点和思想和Brun（S-Logmaps）的是一样的。但是Lin全是在局部上操作的，在得出切空间原点处局部邻域的法坐标以后，Lin采用逐步向外扩展的方法找到其他点的法坐标，在某一点处，保持此点到它邻域点的欧式距离和夹角，然后转化成一个最小二乘问题求出此点的法坐标，这样未知的利用已知的逐步向外扩展。说白了就像缝网一样，从几个临近的已知点开始，逐渐向外扩散的缝。效果好是必然的。<br />
<br />
<br />
有人做了个好事情，做了个系统，把几个方法的matlab代码放在了一起 <a target="_blank" href="http://www.math.umn.edu/~wittman/mani/"><u><font color="#0066cc">http://www.math.umn.edu/~wittman/mani/</font></u></a><br />
<br />
以上提到方法论文，都可以用文中给出的关键词借助google.com找到。<br />
<br />
<br />
<br />
<br />
3. 基本问题和个人观点<br />
<br />
<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>现在还基本处于理论探讨阶段，在实际中难以施展拳脚，不过在图形学中除外。我就说说几个基本的问题。<br />
<br />
a. 谱方法对噪声十分敏感。希望大家自己做做实验体会一下，<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中谱方法的脆弱。<br />
b. 采样问题对结果的影响。<br />
c. 收敛性<br />
d. 一个最尴尬的事情莫过于，如果用来做识别，<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>线性化的方法比原来非线性的方法效果要好得多，如果用原始方法做识别，那个效果叫一个差。也正因为此，使很多人对流<strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>产生了怀疑。原因方方面面 : )<br />
<br />
e. 把偏微分几何方法引入到<strong style="COLOR: black; BACKGROUND-COLOR: #ffff66">流</strong><strong style="COLOR: black; BACKGROUND-COLOR: #a0ffff">形</strong><strong style="COLOR: black; BACKGROUND-COLOR: #99ff99">学习</strong>中来是一个很有希望的方向。这样的工作在最近一年已经有出现的迹象。<br />
<br />
f. 坦白说，我已不能见庐山真面目了，还是留给大家来说吧<br />
<br />
结尾写得有点草率，实在是精疲力尽了，不过还好主体部分写完。<br />
<br />
<br />
<br />
<br />
4. 结束语<br />
<br />
做学问的人有很多种，有的人学问做得很棒，但是独善其身者居多；有的人还谈不上做学问总想兼济天下。小弟不幸成了后一种人，总觉才学疏浅，力不从心，让各位见笑了。<br />
<br />
今天一位朋友（filestorm）给我分享《<a href="http://fifid.com/search/%E5%88%97%E5%AD%90%E5%BE%A1%E9%A3%8E?src=yb_qsal&utm_source=yb_qsal&utm_medium=link&utm_content=rsspost" target="_blank">列子御风</a>》的故事，很受教育。鄙人功力不及二层，心却念是非，口却言利害，实在惭愧。<br />
<br />
但又想主动尽自己绵薄之力为&ldquo;兼济天下&rdquo;做点事 : )，遂呈拙文于此（包括以前两篇人脸识别的），难免出现偏颇，无论好话坏话，还请各位尽管说来。</div>
</div>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1976607.html</guid>
        <pubDate>Wed, 30 Jul 2008 11:07:44 GMT</pubDate>

      </item>

      <item>
        <title>Computational Mechanism Design</title>
        <link>http://rainme.ycool.com/post.1964778.html</link>
        <description><![CDATA[<font face="Arial">CS286r: Computational Mechanism Design David C. Parkes, parkes@eecs.harvard.edu Syllabus, Spring 2002 ContentsClass Home Page Background papersIntroductory lecturesI: Optimal One-Shot Mechanism DesignII: Approximate One-Shot Mechanism DesignIII: Iterative Mechanism DesignIV: Network ImplementationV: Open ProblemsVI: Class ProjectsExtra Reading!Background Papers: Setting the Scene[Var95] pdf ps Varian, H. Mechanism Design for Computerized Agents In Proc. USENIX Workshop on Electronic Commerce, July 11-12, 1995, New York [Nis99] pdf ps Noam Nisan, Algorithms for Selfish AgentsIn Proc. 16th Annual Symposium on Theoretical Aspects of Computer Science (STACS'99), pp.1--15, 1999. [Pap01] pdf ps Papadimitriou, C. H. Algorithms, Games, and the Internet In Proc. 33rd Annual ACM Symp. on the Theory of Computing} (STOC'01), pp.749--753, 2001. [ATY00] pdf ps Andersson, A., M. Tenhunen, and F. Ygge. Integer Programming for Combinatorial Auction Winner Determination. In Proc. of the Fourth International Conference on Multiagent Systems (ICMAS-00), 2000. Introductory Lectures[1/31] Introduction. [Handouts] Syllabus ps pdf REVISED: ps pdf Survey ps Slides pdf ps [2/5] On Interesting Problems. Real world combinatorial auctions. [Lecture Notes]pdf ps[FCC Comb Auction]ppt Spectrum auction [McM94] pdf ps John McMillan, Selling Spectrum Rights, Journal of Econ. Perspectives, 8(3):145--162, 1994. [2/7] Game Theory Concept of Nash equilibrium; Strategies; Rationality. [Handout:] Drew Fudenberg and Jean Tirole, Game Theory, MIT Press, 1991, pp.3--44, 209--216, 241--242. [Lecture Notes:] pdf ps [Classics for the Curious] [Nas51] pdf psJohn F. Nash, Jr., Non-cooperative games, Annals of Mathematics, 54 (1951) 286-295. [Nas50] pdf ps John F. Nash, Jr., The bargaining problem. Econometrica 18: 155-162, 1950. [Homework 1] Distributed, due Thurs 2/14. pdf ps [2/12] Mechanism Design I Definition; Revelation Principle; Vickrey-Clarke-Groves. [Par01a] pdf ps Parkes, D.C. Mechanism Design. Chapter 2 in PhD dissertation, ``Iterative Combinatorial Auctions: Achieving Economic and Computational Efficiency'', May 2001 Department of Computer and Information Science, University of Pennsylvania [Jac00] pdf ps Jackson, M. Mechanism Theory. Forthcoming in Encyclopedia of Life Support Stystems. 2000 [Classics for the Curious][GL77] pdf ps Jerry R. Green and Jean-Jacques Laffont, Characterization of satisfactory mechanisms for the revelation of preferences for public goods. Econometrica 45:427--438, 1977. [Lecture Notes:] pdf ps [2/14] Mechanism Design II Different solution concepts; Impossibility and Possibility Results. [Lecture notes:] pdf ps [Homework 2] Distributed, now due in class 2/26. pdf ps [2/19] Mechanism Design III VCG; group-stratetgy proofness. [Lecture notes:] pdf ps Then, Auction Theory I Revenue equivalence; Definitions. [Handout:] [MM87] pdf ps R. Preston McAfee and John McMillan, Auctions and bidding, J. of Economics Literature, 25:699-738, 1987. [Classics for the Curious:] [V61] pdf psWilliam Vickrey, Counterspeculation, auctions, and competitive sealed tenders, Journal of Finance, 16:8--37, 1961. [2/21] Auction Theory II: Variations; Iterative vs. Sealed Bid; Real World examples. Then, Linear Progamming I: LP Duality, Solutions. [Lecture notes:] pdf ps [Handouts:] Vijay Vazirani, Approximation Algorithms, Springer-Verlag, 2001, pp.93--107. [Par01a] pdf ps Parkes, D.C. Iterative Combinatorial Auctions: Achieving Economic and Computational Efficiency, Ph.D. Dissertation, University of Pennsylvania, 2001, pp. 87--109. [Classic for the Curious:] [Handout] George B. Dantzig, Linear Programming and Extensions, RAND 1963. pp. [vii--x], 12--31, Preface and Origins and Influences. [Homework 3] Distributed, due in class 3/5 pdf ps. [2/26] Linear Programming II (&amp; MicroEcon) Competitive equilibrium, Welfare Theorems. [Lecture notes:] pdf ps [Handout:] Hal R. Varian, Microeconomic Analysis, W.W.Norton 1992, pp. 313--337. Then Integer Programming I:Formulations, Solutions. [Handout:] Laurence A. Wolsey, Integer Programming, John Wiley \&amp; Sons, 1998, pp.1--65. % [2/28] Integer Programming II Relaxtions. [Lecture notes:] pdf ps[Handout:] [Par01b] pdf ps Parkes, D.C. Mechanism Design. Chapter 3 in PhD dissertation, ``Iterative Combinatorial Auctions: Achieving Economic and Computational Efficiency'', May 2001 Department of Computer and Information Science, University of Pennsylvania [Homework 4]distributed; due in class, 3/12,pdf ps . I: Optimal One-Shot Mechanism Design[3/5] Algorithmic Mechanism Design: Shortest-Path [HS01] pdf ps Hershberger, J. and S. Suri, Vickrey Prices and Shortest Paths: What is an edge worth? In Proc. 42nd Annual Symposium on Foundations of Computer Science (FOCS'01), pp.129--140, 2001. [Low-Esparza Slides] ppt[Background motivations] [Nis99] pdf ps Noam Nisan, Algorithms for Selfish Agents, In Proc. 16th Annual Symposium on Theoretical Aspects of Computer Science (STACS'99), pp.1-15, 1999. [3/7] Combinatorial Auctions: Tractable Problems, Optimal Search. [VV00] pdf ps pp. 1-25, 44-66 only de Vries, S. and R. Vohra, Combinatorial Auctions: A Survey, Technial Report, MEDS, Kellogg School of Management, Northwestern, 2000 [ATY00] pdf ps Andersson, A., M. Tenhunen, and F. Ygge. Integer Programming for Combinatorial Auction Winner Determination. In Proc. of the Fourth International Conference on Multiagent Systems (ICMAS-00), 2000. [3/7]Combinatorial Auctions: Optimal Search Methods[SSGL01] pdfpsSandholm,&nbsp;&nbsp; T., S. Suri, A. Gilpin, and D.Levine, CABOB: A&nbsp;&nbsp;&nbsp; Fast Optimal Algorithm for Combinatorial Auctions,&nbsp; In Proc. International&nbsp;&nbsp;&nbsp; Joint Conference on Artificial Intelligence (IJCAI), Seattle,&nbsp;&nbsp;&nbsp; WA. 2001--&gt;II: Approximate One-Shot Mechanism Design[3/12] Algorithmic Mechanism Design. [pp. 1-21 only] [NR01] pdf ps Nisan, N and A. Ronen, Algorithmic mechanism design, Games and Economic Behavior, 35:166-196, 2001. [3/12]One Parameter Machine Scheduling[AT01] pdfpsAaron Archer and Eva Tardos, In Proceedings of the 42nd IEEE Symposium on Foundations ofComputer Science, 2001--&gt;[3/14] Combinatorial Auctions: Approximations I [pp. 1-16 only] [NR00] pdf ps Nisan, N. and A. Ronen, Computationally Efficient VCG Mechanisms, In Proc. 2nd. ACM Conf. on Electronic commerce (EC'00), 242--252, 2000. [3/19] Combinatorial Auctions: Approximations II [LCS01] pdf ps Lehmann, D., L. O'Callaghan and Y. Shoham, Truth Revelation in Rapid, Approximately Efficient Combinatorial Auctions. Shorter version, Proc. 1st ACM Conf. on E-commerce (EC'99), 96--102, 1999. [Not for discussion.] [KMT00-handout] Kfir-Dahav, N., E., D. Monderer, and M. Tennenholtz, Mechanism Design for Resource Bounded Agents, Proc. International Multiagent Systems Conference (ICMAS-00), p.309-315, 2000 [3/21] Combinatorial Auctions: Approximations III [HKMT01] pdf ps Holzman, R., N. Kfir-Dahav, D. Monderer and M. Tennenholtz, Bundling Equilibrium in Combinatorial Auctions, Working paper, Technion and Stanford, 2001 Spring BreakIII: Iterative Mechanism Design[4/2] Minimal Preference Elicitation pdfpsParkes, D.C., Minimal Preference Elicitation: An Equilibrium Approach,Working paper, Harvard University, 2002--&gt;[Par99] pdf ps Parkes, D.C., Optimal Auction Design for Agents with Hard Valuation Problems. In Proc. IJCAI'99 Workshop on Agent Mediated Electronic Commerce (AmEC-99). [4/4] Project Proposals Due (noon); to Arthur Cram, Maxwell-Dworkin 133. Note: I am out of town afternoon 4/2-- evening 4/4, and there is NO CLASS TPDAY. [4/9] Assignment Problem [DGS86] pdf ps Demange, G., D. Gale, and M.Sotomayor, Multi-Item Auctions, Journal of Political Economy, 94, pp 863-872, 1986 [DGS86] pdf ps Leonard, H.B., Elicitation of Honest Preferences for the Assignment of Individuals to Positions, Journal of Poltical Economy 91, pp 463-479, 1983 [4/11] Ascending-Price Combinatorial Auction [PU00] pdf ps Parkes, D. C. and L. H. Ungar, Iterative Combinatorial Auctions: Theory and Practice, In Proc. AAAI'00., 74--81, 2000 [Not for discussion] [Ber90-handout]Bertsekas, D.P., The auction algorithm for assignment and network flow problems: A tutorial. Interfaces, 20(4):133-149, 1990 [4/16] Ascending-Price Generalized Vickrey Auction [PU02] pdf Parkes, D. C. and L. H. Ungar, Ascending Price Generalized Vickrey Auctions, Working paper, Harvard University, 2002 [Not for discussion] [BVVS01] pdf ps Bikchandani, S., S. de Vries, R. Vohra, and J. Schummer, Linear Programming and Vickrey Auctions, Working paper, MEDS, Kellogg School of Management, Northwestern University, 2001 [4/18] Guest Lecture: Paul Milgrom [M02] ps pdf P. Milgrom, Putting Auction Theory to Work, MIT Press, 2002 (ch. 1) IV: Network Implementation[4/23] Distributed Algorithmic Mechanism Design [S01] pdf ps Scott Shenker, Open Problems in Distributed Mechanism Design, Presentation to DIMACS Workshop on Computational Issues in Game Theory and Mechanism Design, Oct. 31, 2001. [4/25] Multicast Cost Sharing [FPS01] pdf ps Feigenbaum, J., C. Papadimitriou and S. Shenker, Sharing the Cost of Multicast Transmissions, Journal of Computer and System Sciences 63 (2001), pp. 21-41. (Special issue on Internet Algorithms.) [Not for discussion.][JV01] pdf ps Jain, K. and V. Vazirani, Applications of approximation algorithms to cooperative games. In Proc. 33rd Annual ACM Symp. on Theory of Computing, (STOC'01) pp.364--372, 2001. [4/30] Network Protocol Friendly Methods [FPSS02] pdf ps Feigenbaum, J., C. Papadimitriou, R. Sami, and S. Shenker, Incentive-Compatible Interdomain Routing, Working paper, Yale University, 2002 V: Conclusions[5/2] Open Problems and Summary [Pap01] pdf ps Papadimitriou, C. H. Algorithms, Games, and the Internet In Proc. STOC 2001 A survey of algorithmic problems related to Game Theory and the Internet. VI: Class Projects[5/13] Project Presentations [5/15] Project Reports Due Additional Reading: Strictly Not For This Class![FKSS01-PDF] Feigenbaum, J., A. Krishnamurty, R. Sami, and S. Shenker, Approximation and Collusion in Multicast Cost Sharing, Submitted for publication. Abstract appears in Proceedings of the 3rd Conference on Electronic Commerce, ACM Press, 2001 [NR00-PDF]Nisan, N. and A. Ronen, Computationally Efficient VCG Mechanisms, In Proc. ACM E-commerce, 242--252, 2000, Section 4, discussion of ``appeal functions'' [Ron01]A. Ronen, Mechanism Design with Incomplete Languages, In Proc. ACM E-commerce, 105--114, 2001 [N01-PDF]Need to get the new citation Nisan, N., The Communication Complexity of Combinatorial Auctions, Working paper, Hebrew University, 2001 [N00-PDF]Nisan, N., Bidding and Allocation in Combinatorial Auctions, In Proc. ACM E-commerce, 2000[HB00-PS]Hoos, H. and C. Boutilier, Bidding Languages for Combinatorial Auctions, In IJCAI'01 [W93-PS]Wellman, M., A market-oriented programming environment and its application to distributed multicommodity flow problems. Journal of Artificial Intelligence Research, 1:1-23, 1993 [WWWMM00-PS]Wellman, M., W.E.Walsh, P.R.Wurman, J.K. MacKie-Mason, Auction protocols for decentralized scheduling, Games and Economic Behavior, 2001 [S93-PS]Sandholm, T., An Implementation of the Contract Net Protocol Based on Marginal Cost Calculations. In Proc. Eleventh National Conference on Artificial Intelligence (AAAI-93), Washington DC, pp. 256-262. [SSGL01]Sandholm, T., S. Suri, A. Gilpin, and D.Levine, CABOB: A Fast Optimal Algorithm for Combinatorial Auctions, In Proc. International Joint Conference on Artificial Intelligence (IJCAI), Seattle, WA. 2001 [Ron01]A. Ronen, Mechanism Design with Incomplete Languages, In Proc. ACM E-commerce, 105--114, 2001 [Rab01] Tal Rabin, DIMACS [LS01-PDF]Larson, K. and T.Sandholm, Costly Valuation Computation in Auctions: Deliberation Equilibrium. In Proc. Theoretical Aspects of Reasoning about Knowledge (TARK), pp. 169-182, Siena, Italy, July 8-10. [FLS99-PDF]Fujishjima, Leyton-Brown and Shoham, Taming the Computational Complexity of Combinatorial Auctions: Optimal and Approximate Approaches, In Proc. IJCAI'99 [ZN01-PDF]Zurel, E. and N. Nisan, An Efficient Approximate Allocation Algorithm for Combinatorial Auctions, In Proc. ACM Electronic Commerce Conf., Tampa FL, 2001 [HB00-PS]Hoos, H. and C. Boutilier, Solving Combinatorial Auctions using Stochastic Local Search, In. Proc. AAAI'00 [ORC01-PDF]Orlin, J., R. Ramaswamy and N. Chakravarty, Sensitivity Analysis for Shortest Path Problems and Maximum Capacity Path Problems in Undirected Graphs, Operations Research Center Working Paper. April 2001. [CS01] Conen, W. and T. Sandholm, Preference Elicitation in Combinatorial Auctions, In Proc. ACM Conf. on Electronic Commerce, 256--259, 2001 [Par01-PS]Parkes, D. C., Bounded-Rational Compatible Auctions and Myopic best-response. Chapter 8, Ph.D. Dissertation ``Iterative Combinatorial Auctions: Achieving Economic and Computational Efficiency'', May 2001. Department of Computer and Information Science, University of Pennsylvania. <br />
本文来自: 人大经济论坛(http://www.pinggu.org) 详细出处参考：http://www.pinggu.org/bbs/b8i2449.html</font>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1964778.html</guid>
        <pubDate>Thu, 10 Jul 2008 05:07:16 GMT</pubDate>

      </item>

      <item>
        <title>【！搬家通告！】sinrain.cn 上线了！！！！</title>
        <link>http://rainme.ycool.com/post.1928543.html</link>
        <description><![CDATA[<p>实在忍受不了Ycool的时常抽风。。</p>
<p>于是昨天花了点功夫把数据从ycool上迁移出来换了个地儿。</p>
<p>可惜以前的评论就没有咯。。。Pv也要从头算起了。。</p>
<p>&nbsp;并且申请了一个域名：&nbsp;<br />
<a href="http://sinrain.cn">http://sinrain.cn</a>&nbsp; 或者&nbsp;<br />
<a href="http://www.sinrain.cn">http://www.sinrain.cn</a><br />
</p>
<p>&nbsp;</p>
<p>这个域名会解析到新的blog上，这个域名将是稳定版本。以后都不变了。</p>
<p>&nbsp;</p>
<p>翻译成中文竟然是 罪恶的雨啊。。</p>
<p>&nbsp;</p>
<p>哈哈哈。。。。</p>
<p>&nbsp;</p>
<p>写blog的 如果需要交换链接什么的，麻烦去留个名儿，以前荣幸链接在 rainme.ycool.com 也更新下吧～～～那个不打算更新了。。</p>
<p>虽然有点可惜，毕竟写了那么多时间。。。 偶尔会回来看看滴。。</p>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1928543.html</guid>
        <pubDate>Sat, 10 May 2008 04:05:24 GMT</pubDate>
<category>搬家了！</category>

        <category>真搬家了！http://sinrain.cn</category>

        <category>http://www.sinrain.cn</category>
      </item>

      <item>
        <title>西湖 小夜不深</title>
        <link>http://rainme.ycool.com/post.1927576.html</link>
        <description><![CDATA[<p>起因是刚配了个车 光头胎的高速山地&nbsp;<br />
非常适合杭州的路况：大部分的地都是很平的，但是由于修路，很多大块的地面之间有小落差<br />
杭州的山道多是路况很好的 那种台阶的玩意儿一般的山地也弄不来，非得DH<br />
<br />
所以这个就成了上班车了 然后下班去刷西湖一圈回家洗澡上网睡觉<br />
太愉快和强大了<br />
<br />
西湖的夜色还是很美的<br />
且不说湖水在晚上显出干净和安静的波纹，也不说苏堤边上各色的灯花<br />
单单是没有人，就已经叫人欣喜无比了<br />
杭州的夜和南京是不怎的一样的&nbsp;<br />
南京的夜在PK是股蚊蚊的自习时光<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在鼓楼则是落了太阳的街道和行色匆匆的南大学生<br />
换作夫子庙 则是游人在便宜的小摊贩钱讨价还价<br />
<br />
杭州则是悠哉闲情的食客很多<br />
年轻人则躲在各式的游乐场所，反倒显得大街上很安静<br />
四路来游乐的旅人藏在酒店里 小孩们在家呆着<br />
哦 上帝赐予我一整个没有太多人的西湖！<br />
你若这么想 怎么能不是最幸福的人<br />
所以老头和老太在西湖边上相扶而行&nbsp;<br />
灯光不黯淡 但绝对不刺眼 和杭州这个城市一样<br />
<br />
然后就飘呀呼的思念下在这里在哪里的同志们<br />
如果YY到Ta在自习，我就更自在和悠闲了<br />
白天的工作在这两个小时里头，根本就不知道在哪里<br />
此刻我不关心人类 不关心数学 只想消耗掉卡路里 只想压过前面的路<br />
<br />
<br />
PS&nbsp;：<br />
<br />
报名参加了 奥运火炬杭州段的火炬护卫队，听起来很好玩的样子</p>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1927576.html</guid>
        <pubDate>Thu, 08 May 2008 09:05:58 GMT</pubDate>
<category>杭州</category>

        <category>西湖</category>

        <category>玩</category>

        <category>单车</category>
      </item>

      <item>
        <title>转战5L 拥抱变化</title>
        <link>http://rainme.ycool.com/post.1925716.html</link>
        <description><![CDATA[昨天回来之后，一早被安插到5L的YY（运营）团队去学习YY.&nbsp;向大师引路指点全局，费翼兄给了非常热情的介绍和指导。<br />
也才算对YY有了个新的认识：）<br />
<br />
所谓用户 如果变成了客户，中间是两个因素的作用：欲望+能力<br />
大方向来说，吸引更多的0级用户，培育0.5级用户，提升1级用户和N级用户的比例。<br />
<br />
怎么去区分用户：RFM模型是非常常用的一个方法&nbsp;
<p>　　根据美国数据库营销研究所Arthur Hughes的研究，客户数据库中有三个神奇的要素，这三个要素构成了数据分析最好的指标： </p>
<ul lastcheckbox="null">
 <li>最近一次消费(Recency) </li>
 <li>消费频率(Frenquency) </li>
 <li>消费金额(Monetary) </li>
</ul>
<p>RFM可以用来提高客户的交易次数。业界常用的<a title="DM" href="http://wiki.mbalib.com/wiki/DM">DM</a>(直接邮寄)，常常一次寄发成千上万封邮购清单，其实这是很浪费钱的。根据统计(以一般邮购日用品而言)，如果将所有R(Recency)的客户分为五级，最好的第五级回函率是第四级的三倍，因为这些客户刚完成交易不久，所以会更注意同一公司的产品信息。如果用M(Monetary)来把客户分为五级，最好与次好的平均回复率，几乎没有显著差异。 </p>
<p>　　有些人会用客户绝对贡献金额来分析客户是否流失，但是绝对金额有时会曲解客户行为。因为每个商品价格可能不同，对不同产品的促销有不同的折扣，所以采用相对的分级(例如R、F、M都各分为五级)来比较消费者在级别区间的变动，则更可以显现出相对行为。企业用R、F的变化，可以推测客户消费的异动状况，根据<a title="客户流失" href="http://wiki.mbalib.com/wiki/%E5%AE%A2%E6%88%B7%E6%B5%81%E5%A4%B1">客户流失</a>的可能性，列出客户，再从M（消费金额）的角度来分析，就可以把重点放在贡献度高且流失机会也高的客户上，重点拜访或联系，以最有效的方式挽回更多的商机。&nbsp;<br />
<br />
漏斗模型：<br />
是页面点击流数据仓库的一个重要的应用，类似漏斗过滤一样的，有效用户点击越来越少。<br />
用户在发生试图交易的时候，页面流程越长 流失率越大。<br />
如果某个页面的流失率超过一个伐值，可以判定这个页面的UE有严重的BUG需要修复。<br />
<br />
运维的最重要的KPI是活跃会员总数，所以监控其波动 和分析其变动原因是YY团队很重要的一个保障工作，但是核心的工作是提升KPI。引导客户使用新的应用场景是提升用户参与度的一个<br />
持续活跃率：指老用户在最近的一个统计周期内又活跃的比例，反应了用户粘滞度的大小。对老手最好的策略就是不用除了人文关怀之外的任何策略。<br />
<br />
DM要做的事情就是把YY的事情量化，DW要做的事情就是把量化的事情用合适合理的形式展现给内部用户。</p>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1925716.html</guid>
        <pubDate>Mon, 05 May 2008 01:05:32 GMT</pubDate>
<category>yy</category>

        <category>rfm</category>
      </item>

      <item>
        <title>珠江路糖果站！</title>
        <link>http://rainme.ycool.com/post.1924328.html</link>
        <description><![CDATA[今天在南京的地铁上到珠江路的时候报站非常的映像深刻：<br />
<strong>珠江路糖果站<br />
</strong>这让我非常的纳闷，难道周围又开了新的糖果中心？朋友的解释让我非常的开心。<br />
<br />
这可不仅仅是一个故事。 说&nbsp;<br />
有一天 一个妈妈带着小孩坐地铁<br />
小孩哇哇的就哭了，闹着不肯下车，年轻的妈妈也比较崩溃的时候 一个珠江路地铁的工作人员（估计是个MM）塞给小孩嘴里一颗糖，然后小孩就安静了。从此之后，珠江路的工作人员口袋里总塞着一个糖果。<br />
<br />
站台也被改成了 珠江路糖果站。<br />
<br />
<br />
------------------------<br />
<br />
我非常的喜欢这个故事！<br />
非常！<br />
<br />
<br />
考证后：<br />
这样的<br />
<br />
据珠江路站站长葛蔚介绍，糖果车站缘起一个真实的感人故事：一对夫妻带着患病的孩子到南京儿童医院治病后，乘地铁返回。在珠江路地铁站，患病的孩子哭着说想吃糖，囊中羞涩的父母很为难。一名地铁员工看到这一幕，从口袋中掏出为自己儿子准备的糖果，送到患病孩子的手中，并嘱咐孩子要听父母的话，早日健康。从那以后，珠江路地铁站的所有员工，都带着糖果上班。孩子们都亲切地把珠江路站叫做糖果车站...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1924328.html</guid>
        <pubDate>Fri, 02 May 2008 15:05:49 GMT</pubDate>
<category>南京</category>

        <category>地铁</category>

        <category>糖果</category>

        <category>珠江路</category>
      </item>

      <item>
        <title>在评估结束的南大宿舍打Dota和看书</title>
        <link>http://rainme.ycool.com/post.1921406.html</link>
        <description><![CDATA[评估使得房间变得很干净~! 回来还是打球+打Dota 还有去图书馆自习..<br />
南大的资源还是很多地~ 图书馆看书的时候 书多就算了, PP的女生也很多,非常的养眼 以及培养人的学习热情那!<br />
<br />
哈哈... 先熬过考试这一关再说, 今天看了3个小时就支持不住了... 老了!...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1921406.html</guid>
        <pubDate>Sun, 27 Apr 2008 13:04:19 GMT</pubDate>

      </item>

      <item>
        <title>Calculate the similarity of two strings</title>
        <link>http://rainme.ycool.com/post.1919152.html</link>
        <description><![CDATA[<p class="a"><font face="Courier New"><strong style="mso-bidi-font-weight: normal"><span lang="EN-US">Abstract</span></strong><span lang="EN-US"> Given two strings S of length m and string T of length n, the paper presents a new algorithm for calculating the similarity of the two strings. By the LCSubstr (longest common substring) algorithm we can find the maximal matching of the two given strings. Then eliminate the LCSubstr we will get two temp result strings. My algorithm will calculate the temp result strings iteratively until the two result strings&rsquo; common string is null. The similarity of the two strings will be measured by accumulating the non-linear mapping length of the maximal matched substring. The algorithm is always searching for the maximal continuous matching (MCM) in every step. In the end of the article I will introduce an application of this algorithm. </span></font></p>
<p class="a"><strong style="mso-bidi-font-weight: normal"><span lang="EN-US"><font face="Courier New">Keywords:</font></span></strong><span lang="EN-US"><font face="Courier New"> pattern matching, LCSubstr, non-linear mapping, string similarity, maximal continuous matching (MCM)<br />
<br />
&nbsp; </font></span></p>
<p class="MsoNormal"><font face="Courier New"><strong style="mso-bidi-font-weight: normal"><span lang="EN" style="mso-ansi-language: EN">Function</span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN">：</span></strong><span lang="EN" style="mso-ansi-language: EN">LCSubstr(S[1..m], T[1..n])<o:p></o:p></span></font></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>L := array(0..m, 0..n)<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>z := 0<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>ret := {}<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>for i := 1..m<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>for j := 1..n<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if S[i] = T[j]<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>L[i,j] := L[i-1,j-1] + 1<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if L[i,j] &gt; z<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-spacerun: yes">&nbsp;</span>z := L[i,j]<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ret := {}<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>if L[i,j] = z<o:p></o:p></font></span></p>
<p class="MsoNormal"><font face="Courier New"><span lang="EN" style="mso-ansi-language: EN"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ret := ret </span><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN">&cup;</span><span lang="EN" style="mso-ansi-language: EN"> {S[i-z+1..i]}<o:p></o:p></span></font></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>return ret<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New">This algorithm runs in O(mn) time. The variable z is used to count the longest common substring found so far. The set ret is used to hold the set of strings which are of length z<br />
<br />
&nbsp; </font></span></p>
<p class="MsoNormal"><font face="Courier New"><strong style="mso-bidi-font-weight: normal"><span lang="EN" style="mso-ansi-language: EN">Function</span></strong><strong style="mso-bidi-font-weight: normal"><span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-ansi-language: EN">：</span></strong><strong style="mso-bidi-font-weight: normal"><span lang="EN" style="mso-ansi-language: EN"><span style="mso-tab-count: 1">&nbsp; </span></span></strong><span lang="EN" style="mso-ansi-language: EN">MCM(S[1:m],T[1:n]<o:p></o:p></span></font></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tS=S<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tT=T<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>While(Length (LCSubstr(tS,tT))&gt;0):<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tLCS= LCSubstr(tS,tT)<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>result_Accumulater+=Length<sup>2</sup>(tLCS)<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tS=tS.remove(tLCS)<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>tT=tT.remove(tLCS)<o:p></o:p></font></span></p>
<p class="MsoNormal"><span lang="EN" style="mso-ansi-language: EN"><font face="Courier New"><span style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>return Similarity=result_Accumulater/Min<sup>2</sup>(m,n)</font></span></p>
<p class="MsoNormal"><span lang="EN-US"><font face="Courier New">Till now we have successfully calculated the similarity of the two strings S of length m and T of length n by MCM algorithm.</font></span></p>
<p class="MsoNormal"><br />
<br />
<font face="Courier New">&nbsp; </font></p>
<p class="MsoNormal"><span lang="EN-US"><font face="Courier New">The basic ideas of MCM are very natural:</font></span></p>
<p class="MsoNormal" style="MARGIN-LEFT: 57pt; TEXT-INDENT: -36pt; mso-list: l0 level1 lfo1"><font face="Courier New"><span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore">(I)<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span lang="EN-US">The continuous matching will contribute more to the similarity much more than the fragmentized matching. So the contribution should have a non-linear relationship with the longest common substring.</span></font></p>
<p class="MsoNormal" style="MARGIN-LEFT: 57pt; TEXT-INDENT: -36pt; mso-list: l0 level1 lfo1"><span lang="EN-US" style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font face="Courier New">(II)<span style="FONT: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></span></span><span lang="EN-US"><font face="Courier New">Not only the LCSubstr, but also all the common substring should have contribution to the similarity.<br />
</font></span></p>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1919152.html</guid>
        <pubDate>Wed, 23 Apr 2008 12:04:06 GMT</pubDate>
<category>mcm</category>

        <category>algorithm</category>
      </item>

      <item>
        <title>MyRss之三---从LCS到MCC去重复</title>
        <link>http://rainme.ycool.com/post.1918721.html</link>
        <description><![CDATA[<p>Toy程序中很重要的一个功能是去重：即<strong>去掉那种转载流</strong>的文字，转载扩赛了信息但是也造成了相当麻烦的信息冗余，我不想看的信息逼着我看了一遍又一遍。<br />
最牛逼的方法当然是能比较两个文章的全文，看全文的匹配度了，但是这个方法的时间代价太大。还有那种选取一部分Digest 出来比较的方法理论性远远大于使用性。最直接的方法就是看两个文章的<strong>标题的最长公共子串</strong>，亦即<strong>LCS</strong>( <em>longest common substring</em>).<br />
<br />
LCS的原理非常的简单：<br />
<table cellspacing="1" cellpadding="1" width="200" summary="" border="1">
 <tbody>
  <tr>
   <td>A串为：&nbsp;&nbsp; A1 A2 A3 .....&nbsp; An</td>
  </tr>
  <tr>
   <td>B串为： B1 B2 B3 .....&nbsp; Bm</td>
  </tr>
 </tbody>
</table>
<br />
只要反复的算下AB以各种位置叠在一起的最长连续字符个数就好了<br />
<br />
数学上来说：就是写成这样一个矩阵：<br />
match[n][m]=<br />
<table cellspacing="1" cellpadding="1" width="200" summary="" border="1">
 <tbody>
  <tr>
   <td>&nbsp;</td>
   <td>A1</td>
   <td>A2</td>
   <td>.....</td>
   <td>.....</td>
   <td>Am</td>
  </tr>
  <tr>
   <td>B1</td>
   <td>01</td>
   <td>01</td>
   <td>...</td>
   <td>...</td>
   <td>01</td>
  </tr>
  <tr>
   <td>B2</td>
   <td>01</td>
   <td>01</td>
   <td>...</td>
   <td>...</td>
   <td>01</td>
  </tr>
  <tr>
   <td>...</td>
   <td>...</td>
   <td>...</td>
   <td>...</td>
   <td>...</td>
   <td>...</td>
  </tr>
  <tr>
   <td>Bn</td>
   <td>01</td>
   <td>01</td>
   <td>...</td>
   <td>...</td>
   <td>01</td>
  </tr>
 </tbody>
</table>
<br />
中间的值match[i][j]都是0或者1 (match[i][j]=1 means Bi=Aj)，下面就在这个表中选出最长的连续对角线都是1的串，对应的子串就是AB的最大的匹配。<br />
<br />
举个例子吧：<br />
<br />
from:&nbsp; <font face="Arial"><a href="http://www.5do8.com/blog/doc/569/index.aspx">http://www.5do8.com/blog/doc/569/index.aspx</a><br />
</font></p>
<p>&nbsp; A= I MISS MY CODE HI</p>
<p>&nbsp; B= One Like MY&nbsp;Code</p>
<p>
<table style="BORDER-RIGHT: #f00 2px solid; BORDER-TOP: #f00 2px solid; BORDER-LEFT: #f00 2px solid; WIDTH: 360px; BORDER-BOTTOM: #f00 2px solid; BACKGROUND-COLOR: #a2a2a2" cellspacing="1" cellpadding="3" align="left" border="0">
 <tbody>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">&nbsp;</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">i</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">m</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">i</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">s</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">s</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">m</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">y</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">c</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">o</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">d</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">e</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">h</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">i</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">o</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">n</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">e</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">l</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">i</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">k</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">e</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">m</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">y</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">c</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">o</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">d</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
  <tr>
   <td style="BACKGROUND-COLOR: #fff" align="center">e</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center"><font color="#ff0000">1</font></td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
   <td style="BACKGROUND-COLOR: #fff" align="center">0</td>
  </tr>
 </tbody>
</table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
那个mycode就是最长匹配的串<br />
在具体计算的时候考虑到汉字字符的多变性和英文很不一样，我们可以直接计算一个对角线上的所有的1而不用考虑联系性。<br />
就变成了MCC(Max common characters)了，而这个MCC就是我们去判定重复的一个重要依据。<br />
如果<strong>len</strong>(MCC) / <strong>min</strong>( <strong>len</strong>(string_A) ,<strong>len</strong>(string_B))<strong>&gt;</strong><font face="Arial">valve_Value就判定为转载。<br />
-----------------------<br />
<br />
这里可以有一个<strong>非常重要的改进，认为连续匹配会有非线性加成</strong>，如match_degree=<strong>sigma</strong>( <strong>len</strong>(common_substring[i])<strong>^2</strong>)<br />
甚至我觉得可能某些搜索引擎就是这么干的。。【未验证】<br />
<br />
----------------------<br />
这样就实现了新闻的唯一性的保证，为了确保系统的效率不会被这个比较拖累的太多，可以只比较最近3个月的标题。<br />
<br />
晚上写一个实现，能配合现在已经有的模块实现标题的唯一性。<br />
-----------------------<br />
filter.py</font></p>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1918721.html</guid>
        <pubDate>Tue, 22 Apr 2008 12:04:13 GMT</pubDate>
<category>python</category>

        <category>mcc</category>

        <category>lcs</category>

        <category>最长公共子串</category>

        <category>最多公共字符集i</category>
      </item>

      <item>
        <title>MyRss之二---需求和必要性</title>
        <link>http://rainme.ycool.com/post.1918692.html</link>
        <description><![CDATA[<p>听从<a href="http://blog.solrex.cn">Solrex</a>的建议,在学习的时候直接看Python的tutorial和Lib，然后通过写一些简单的代码来逐步熟悉库：）<br />
Mock Bank的测试工作已经进行的差不多了，最近要集中精力来做这个&ldquo;可配置的Spider&rdquo;<br />
<br />
这个玩意的需求是具有普遍性的，我们有时候会去搜索引擎反复的搜索某个关键字，比如特别关注<strong>奥运</strong>的 可能每天都去搜索下和奥运有关的新闻。但是这么做的人倒没有想象的多，就是因为搜索引擎的重复结果太令人烦躁了。这个东西很讨厌，我举个例子就很清楚了：<br />
<br />
单击显示大图<br />
<img height="455" alt="Google" width="600" border="0" src="http://node1.foto.ycstatic.com/200801/23/1/14092033.jpg" /><br />
<br />
当然这个是<strong>冗余中的一种：由于转载引起的搜索结果冗余</strong><br />
另外一种我管他叫挖坟，什么叫挖坟：历史沉淀引起的结果冗余。<br />
Google下 <em>奥运火炬</em>就可以了。很多奥运火炬手选拔的网页由于SEO的作用很靠前，那么我最想看的<strong><em>敏感事件</em></strong>呢，基本是没有的。<br />
<br />
现在Google news已经做得很好了，但是出于学习的态度和扩展性的态度。还是试探性的写写吧：）<br />
-------------------------------------------<br />
<br />
&nbsp;需求有哪些：<br />
1 通过订阅Google news RSS的方式 可以最简单的获得主流媒体对订阅关键字的报道和相应。<br />
2 通过制定crawl的起始页面和爬行的深度 可以爬到某些特定相关网页上的内容。然后再过滤显示。<br />
3 对整理到的News整理入库，新入库的文章要去重复。<br />
4 可以对觉得好的News加标记，并且可以导出到XML文档里面。<br />
5 能自动运行，并且发现新的News能弹出notify.<br />
6 最好能有个友好的GUI<br />
<br />
--------------------------------------------<br />
<br />
目前已经做的：<br />
1 通过引入<font face="Arial">feedparser可以实现对指定rss的解析【Done】<br />
2 crawl的问题也能解决 难点在于如何把html中的信息再有效的提取出来，html实在太混乱了！实在不行就全部显示出来，去掉图片。【To be done】<br />
</font>3 调用db库可以方便的操作数据库【Done】<br />
4 重复的问题 使用马上要说的对标题最长模式匹配来做吧【Done】<br />
5 自动运行 弹出notify的东西就弹出一个dialogue，然后高亮新出来的玩意就好。<br />
6 GUI的东西wxPython in Python是个很简洁的书：<br />
&nbsp;&nbsp;&nbsp;&nbsp;<font face="Arial"><a href="http://www.pythontik.com/blog/article.asp?id=177">http://www.pythontik.com/blog/article.asp?id=177</a>&nbsp;有热心的pythoner翻译成CN了，赞一下。</font></p>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1918692.html</guid>
        <pubDate>Tue, 22 Apr 2008 11:04:06 GMT</pubDate>
<category>rss</category>

        <category>python</category>

        <category>se</category>

        <category>冗余</category>
      </item>

      <item>
        <title>最近的一些语录</title>
        <link>http://rainme.ycool.com/post.1916332.html</link>
        <description><![CDATA[<ul>
 <li>&ldquo;对于你们提出的这个<strong>测试系统上锁</strong>的问题，我的观点是&lsquo;成本太高了&rsquo;，不如<strong>人工上锁</strong>，什么是人工上锁？ 不知道？&rdquo;某知名测试人员站起来向四周大喊一句&ldquo;<strong>兄弟们听着！我要测试了，都他妈别用我的模块知道没</strong>？&rdquo;<br />
 四周稀稀拉拉应答之声，&ldquo;这就叫确认锁定。。。&rdquo;<img alt="" src="http://sta.yculblog.com/images/smiley/1/10.gif" /><br />
 </li>
 <li><span class="content">&ldquo;法国无法无国法，德国缺德缺国德。横批：美国不美&rdquo;。<br />
 针对ZD事件和火炬事件，我是用一种爱国<strong>情感</strong>去做判断而不是什么冷静的思考的。<strong>什么体制的问题，自由的问题，说到底都是权与利的问题</strong>。法国人从来的浪漫主义，自由精神在火炬事件中被放大成一种近乎弱智的表现而自取其辱。不过我个人不会因为这个抵制家乐福，说抵制家乐福的人都属于扯淡型人才。<strong>爱国精神被娱乐化</strong>了之后，海外游子变出现了个把让人很JP的人，类似雅阁女心态。<br />
 扯淡的人们，说到底就是喇嘛没权了想夺权，藏民很淳朴或者说没开化，少量极品的跟在喇嘛后面闹事。然后还有国际未名力量在挑拨，利用西方传统民众对媒介的依赖和盲目信任捅中国的漏子。<br />
 <strong>奥运政治化</strong>不是什么好事。A game is a game. 太多政治因素在里面法国佬不吃这一套<br />
 </span></li>
 <li><span class="content">房子真是个令人忧伤的愉悦。<br />
 </span></li>
 <li><span class="content">PM=P鞭+Money ：0</span></li>
</ul>...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1916332.html</guid>
        <pubDate>Fri, 18 Apr 2008 16:04:00 GMT</pubDate>

      </item>

      <item>
        <title>MockBank过半 新的玩意又来</title>
        <link>http://rainme.ycool.com/post.1914252.html</link>
        <description><![CDATA[我说，从来没这么感谢过伟大祖国的教学评估。<br />
不然今天就该传说中的《<a href="http://fifid.com/search/%E5%AE%9E%E5%8F%98%E5%87%BD%E6%95%B0%E4%B8%8E%E6%B3%9B%E5%87%BD%E5%88%86%E6%9E%90?src=yb_qsal&utm_source=yb_qsal&utm_medium=link&utm_content=rsspost" target="_blank">实变函数与泛函分析</a>》，坊间传闻是：实变函数学十遍，泛函分析心犯寒。<br />
可以小缓冲下到四月底来考，实在是太好了。来说说看近期的活动和安排：）<br />
<br />
看完了Python的tutorial，在艰难的看各种库。 那个《<a href="http://fifid.com/search/Python+in+a+nutshell?src=yb_qsal&utm_source=yb_qsal&utm_medium=link&utm_content=rsspost" target="_blank">Python in a nutshell</a>》是本蛮不错的书，实在看电子书看的太疲倦了就直接看这个吧。<br />
那个关于Java的安全包已经比较熟悉鸟，虽然估计以后都不会再用到。我们数据分析的在这个小项目里面感觉就是救场的，哪里人少就去充数，这两天被调到测试组去写test case 算半个SQA助理。然后最近两天的office time都在看测试的书。剩下的时间就看Python了。<br />
<br />
-------------------------------<br />
既然Test Case写完，下面就等着coding的人编码完了过来测试咯，测试平台好像也不归我管。Hoho，好轻松那要不是有考试在远处诡笑。<br />
<br />
下面的两周内要用Python去写一个&quot;可配置的Spider&quot;，哎呀终于做到我喜欢玩的东西了：）<br />
大体是 <strong><em>抓取页面，分析内容，删除重复，内容展现，数据存档<br />
</em></strong><br />
<table style="WIDTH: 427px; HEIGHT: 135px" cellspacing="1" cellpadding="1" width="427" summary="" border="1">
 <tbody>
  <tr>
   <td>
   <ul>
    <li>抓取就直接用urllib</li>
    <li>分析用from sgmllib import SGMLParser 再加上一些re的东西</li>
    <li>删除重复这块 <br />
    简单点的就直接匹配标题好了<br />
    复杂点的要去计算文档摘要</li>
    <li>内容展现就写成个XML文档出来就好了</li>
    <li>数据存档是可选的，可以连上一个MySQL的数据库，把元素拆开放进去</li>
   </ul>
   </td>
  </tr>
 </tbody>
</table>
<br />
<br />
<br />
思路是不难，但是对Python的不熟悉将是拖慢进度的最重要的原因:<br />
可以用的资源：<br />
<br />
<table style="WIDTH: 517px; HEIGHT: 76px" cellspacing="1" cellpadding="1" width="517" summary="" border="1">
 <tbody>
  <tr>
   <td>
   <ul>
    <li>PKU的那个搜索引擎原理</li>
    <li><font face="Arial">一个现成的Spider Demo<br />
    <a href="http://www.example-code.com/python/pythonspider.asp">http://www.example-code.com/python/pythonspider.asp</a></font></li>
    <li>搜狗实验室<br />
    <font face="Arial"><a href="http://www.sogou.com/labs/">http://www.sogou.com/labs/</a></font></li>
    <li>内网</li>
    <li>Python DBApi<br />
    <font face="Arial"><a href="http://www.kitebird.com/articles/pydbapi.html">http://www.kitebird.com/articles/pydbapi.html</a></font></li>
    <li>google code</li>
   </ul>
   </td>
  </tr>
 </tbody>
</table>
<br />
<br />
需求(1D)--&gt;系统分析(2D)--&gt;编码(4D)--&gt;测试(1D)--&gt;文档撰写<br />
完全非典型...
]]></description>
        <guid isPermaLink="true">http://rainme.ycool.com/post.1914252.html</guid>
        <pubDate>Tue, 15 Apr 2008 13:04:11 GMT</pubDate>
<category>fun</category>

        <category>spider</category>

        <category>python</category>
      </item>
    </channel>
  </rss>
