— 英超球队紧缩式防守对于148个欧战进球的巴萨,很像宇宙间的负物质,无所不在,却又无处可寻。
— 曼联在板凳的深度可以深到地核
— 我觉得世界上最无聊的就是企图把足球玩成数据库,如果那样还不如去玩足球经理游戏,或者像经济学家从用电量和废钢铁回收量就看出经济复苏一样,宣布曼联已在罗马获胜了,比赛不用打了。
— 肯定让你觉得肾上腺倒灌到脚底心,让您受精,你就若宠吧。
A game developer, a music lover, and a partisan fan of F.C. Barcelona
— 英超球队紧缩式防守对于148个欧战进球的巴萨,很像宇宙间的负物质,无所不在,却又无处可寻。
— 曼联在板凳的深度可以深到地核
— 我觉得世界上最无聊的就是企图把足球玩成数据库,如果那样还不如去玩足球经理游戏,或者像经济学家从用电量和废钢铁回收量就看出经济复苏一样,宣布曼联已在罗马获胜了,比赛不用打了。
— 肯定让你觉得肾上腺倒灌到脚底心,让您受精,你就若宠吧。
昨天的IT英语考试试卷,翻译题中遇到一短语,rule of thumb,这啥?拇指规则?
今天在看课件时,又遇到了rule of thumb,立即警觉起来,于是“词霸+google+wiki”了一下这个短语。
原来在中文里也有“拇指规则”这种说法,意思就是——凭感觉的方法; 单凭经验的方法。
wiki对它有详细的解释,包括它的由来。
The earliest citation comes from Sir William Hope’s The Compleat Fencing-Master, second edition, 1692, page 157: “What he doth, he doth by rule of thumb, and not by art.” The term is thought to originate with wood workers who used the length of their thumbs rather than rulers for measuring things, cementing its modern use as an imprecise yet reliable and convenient standard.
大概意思就是说,木工工人测量物体时,依据的是他们拇指的长度,而不是尺子什么的。这就是一种经验,不一定非常准确,但是却可靠而方便。
昨天下午狠狠的踢了3个小时球,导致今天有点虚脱了,于是在家宅了一天。
宅的生活基本上是等于混乱的生活,至少对我来说是如此。下午4点才吃的午饭——附近某饭馆的饺子,4两吃的我有些胃直倒腾,然后晚上9点,又是泡面+1个鸡蛋,一堆毫无营养的东西倒进胃里。似乎自从我丢了学校饭卡后,我已经一个星期没吃过一顿健康的饭了。
今天完结了一件伟大的事情——《越狱》,终于看到了大结局。我算不上一个越狱的追捧者,也根本不“粉”米勒,只不过它是我一直追着看的第一部也是唯一一部美剧。“追”电视剧这种事实在是太累了,我估计我再也不想去追任何一部了,怕了。所以尽管很多人向我推荐一些据说更好看的美剧,我都还是弃了。我承认美剧确实好看,只不过我没那么多时间和精力来追着走,陷进去就很难拔出来,偶不是TV Show发烧友。
再说越狱,4个季,走过了4年,终于寿终正寝。大家对它的评价基本上是“一季比一季差”,第1季堪称完美,第2季还说的过去,到了第3季就开始有点扯蛋了,第4季就几乎有点瞎编了。不过我对于美剧这玩意,就图个好玩,看的时候过个瘾就行了,干嘛去太追求那些细节或者什么情节漏洞之类的。它又不是什么艺术品,多少年之后还能给你带来震撼,让你看的时候图个爽就行了。那些瑕疵啥的就别牢骚了,再说我们也是直接下载的盗版,也没资格去指责。
越狱的结局,有些意外,甚至还让人小感动了一下,这几乎是我看了4季从未有过的,毕竟以前麦克儿和莎拉那么假的煽情怎么也不可能让人感动的起来。
越狱的结局,Michale的坟墓,来的有点突然,本以为搞垮了种种恶势力之后,会是一切和谐团圆的景象,一个完美的Happy Ending,但大家极其热爱的米帅哥最终却挂掉了。编剧没有具体交代Michale是怎么上的天堂,但是可以猜得出来还是被那“流鼻血”的疾病带走的(估计Company给他做脑手术的时候留了一手)。与其说最后是给Michale立了个坟墓,不如说是越狱给自己立了个坟墓,彻底宣布的越狱的完结。
不过这样的结局还是好的,比Happy Ending好多了,至少给人留下了些可以回味的东西。

Barça has won the Spanish League championship for the 19th time in the club’s history after Madrid’s defeat this Saturday at El Madrigal.
马德里周六在情歌球场败北之后,巴萨赢得了俱乐部历史上的第19座联赛冠军。
Four days after lifting the King’s Cup, Barcelona have won their 19th League title to complete the double. That means this season has already been a resounding success and there is still the Champions League final in Rome to come.
在举起国王杯的四天后,巴萨赢得了第19座联赛冠军,同时也完成了双冠的伟业。这个赛季对于巴萨来说,已经是一个巨大的成功,并且还有在罗马的冠军联赛决赛等待着他们去创造更加伟大的辉煌。

copa del rey title
热烈庆祝我萨夺得第25座西班牙国王杯,历史性的三冠伟业迈出坚实一步!
如今在我萨的三冠王之路上,只剩下了最后一道屏障,一道最凶恶的屏障——曼联。
前进,巴萨!Go Towards Trophy Treble!
Barcelona Storm To Silverware After Thrashing Athletic
巴萨大败毕尔巴鄂竞技,袭取奖杯(国王杯)
thrash作为动词,主要意思是:(用棍或鞭)打或抽。
这个词其实最令我印象深刻的其实是thrash metal,鞭击金属,或者叫激流金属,重金属音乐的一种。我有个朋友玩乐队的,他玩的就是这种,非常的猛,如果你知道Metallica,肯定就知道这种音乐有多重。
thrash在体育中表示“彻底击败”,就像用鞭子抽的对方毫无反抗的能力。
比如最近的国家德比,就可以这么说。
Brilliant Barca thrash Real 6-2 to move closer to title.
辉煌的巴萨以6-2痛击皇马,接近冠军!Ole~ 🙂
Pep Guardiola has decided to take all the available 18 players to the Cup Final in Valencia, with just the injured Iniesta, Henry, Márquez, Milito and Jorquera and the suspended Abidal missing out.
瓜迪奥拉决定带上所有能出战的18位球员奔赴巴伦西亚参加国王杯决赛,只有受伤的伊涅斯塔、亨利、马科斯、米利托和霍尔克拉,以及停赛的阿比达尔缺席。
毕尔巴鄂是一支令人尊敬的球队,他们有着鲜明的足球哲学——他们只使用巴斯克地区的球员。但对于这场加泰罗尼亚和巴斯克之间的国王杯决赛(用拉波尔塔充满政治的话说,加泰罗尼亚country对决巴斯克country),我们的目标只有——冠军,向着三冠王的伟业迈进!
前进,巴萨!梅斯塔利亚球场,我们来了!
今天下午闲着无聊,复习了一下“二叉查找树”,并用代码温习了一下。
对于二叉查找树,一般支持的操作有:查找关键字,最大值,最小值,前驱和后继等等的查询,对于高度为h的树,它们都可以在O(h)时间内完成。
BinaryTree.h
#ifndef __BINARY_TREE_H__
#define __BINARY_TREE_H__
template < typename Key, typename Data > class BinaryTree;
/*! 树的节点 */
template < typename Key, typename Data >
class TreeNode
{
public:
//! 默认构造函数
TreeNode()
: m_pParent( NULL ),
m_pLChild( NULL ),
m_pRChild( NULL )
{
}
//! 构造函数
TreeNode( Key k, const Data & d )
: m_pParent( NULL ),
m_pLChild( NULL ),
m_pRChild( NULL ),
m_key( k ),
m_data( d )
{
}
//! 拷贝构造函数
TreeNode( const TreeNode< Key, Data > & node )
: m_pParent( NULL ),
m_pLChild( NULL ),
m_pRChild( NULL ),
m_key( node.m_key ),
m_data( node.m_data )
{
}
//! 赋值函数
TreeNode< Key, Data > & operator=( const TreeNode< Key, Data > & rhs )
{
m_key = rhs.m_key;
m_data = rhs.m_data;
return *this;
}
//! 获取键值
Key GetKey() const { return m_key; }
//! 获取数据
Data GetData() const { return m_data; }
//! 设置数据
void SetData( const Data & d ) { m_data = d; }
private:
Key m_key; //!< 关键字
Data m_data; //!< 数据
TreeNode *m_pParent; //!< 父节点
TreeNode *m_pLChild; //!< 左子节点
TreeNode *m_pRChild; //!< 右子节点
friend class BinaryTree< Key, Data >;
};
/*! 二叉查找树 */
template < typename Key, typename Data >
class BinaryTree
{
public:
BinaryTree()
:m_pRoot( NULL )
{
}
~BinaryTree()
{
while ( m_pRoot != NULL )
{
DeleteNode( m_pRoot );
}
}
typedef TreeNode< Key, Data > _TreeNode;
//! 查找
_TreeNode * Search( const Key & destK ) const;
//! 最小值
_TreeNode * Minimum( _TreeNode * pNode ) const;
//! 最大值
_TreeNode * Maximum( _TreeNode * pNode ) const;
//! 后继
_TreeNode * Successor( _TreeNode * pNode ) const;
//! 前任
_TreeNode * Predecessor( _TreeNode * pNode ) const;
//! 添加节点
void AddNode( const _TreeNode * pNode );
//! 删除节点
void DeleteNode( _TreeNode * pNode );
//! 获取根节点
_TreeNode * GetRootNode() const { return m_pRoot; }
private:
_TreeNode *m_pRoot; //! 根节点
};
template < typename Key, typename Data >
void BinaryTree< Key, Data >::AddNode( const _TreeNode * pNode )
{
assert( NULL != pNode &&
"pNode cannot be NULL" );
_TreeNode *newNode = new _TreeNode( *pNode );
_TreeNode *n1 = m_pRoot;
_TreeNode *n2 = NULL;
while ( NULL != n1 )
{
n2 = n1;
if ( newNode->m_key < n2->m_key )
{
n1 = n2->m_pLChild;
}
else
{
n1 = n2->m_pRChild;
}
}
if ( NULL == m_pRoot )
{
m_pRoot = newNode;
}
else
{
if ( newNode->m_key < n2->m_key )
{
n2->m_pLChild = newNode;
}
else
{
n2->m_pRChild = newNode;
}
newNode->m_pParent = n2;
}
}
template < typename Key, typename Data >
void BinaryTree< Key, Data >::DeleteNode( _TreeNode * pNode )
{
assert( NULL != pNode &&
"pNode cannot be NULL" );
_TreeNode * n1 = NULL;
_TreeNode * n2 = NULL;
//! n1是要删除的节点
if ( NULL == pNode->m_pLChild || NULL == pNode->m_pRChild )
{
//! 没有或者只有1个子节点,删除的节点时pNode
n1 = pNode;
}
else
{
//! 左右子节点都有,先删除pNode的后继结点
n1 = Successor( pNode ); // 该后继一定没有左节点
}
//! n2是n1唯一的一个子节点
if ( NULL != n1->m_pLChild )
{
n2 = n1->m_pLChild;
}
else
{
n2 = n1->m_pRChild;
}
//! 为删除n1所作的指针修改
if ( NULL != n2 )
{
n2->m_pParent = n1->m_pParent;
}
if ( NULL == n1->m_pParent )
{
// Root是唯一的一个父节点为空的节点
m_pRoot = n2;
}
else
{
if ( n1 == n1->m_pParent->m_pLChild )
{
n1->m_pParent->m_pLChild = n2;
}
else
{
n1->m_pParent->m_pRChild = n2;
}
}
if ( n1 != pNode )
{
//! pNode左右子节点都有的情况,
//! 用pNode的后继结点的关键字和附加数据替换掉pNode的关键字和附加数据
pNode->m_key = n1->m_key;
pNode->m_data = n1->m_data;
}
delete n1;
}
template < typename Key, typename Data >
TreeNode< Key, Data > * BinaryTree< Key, Data >::Search( const Key & destK ) const
{
_TreeNode *n = m_pRoot;
while ( NULL != n && destK != n->m_key )
{
if ( destK < n->m_key )
{
n = n->m_pLChild;
}
else
{
n = n->m_pRChild;
}
}
return n;
}
template < typename Key, typename Data >
TreeNode< Key, Data > * BinaryTree< Key, Data >::Minimum( _TreeNode * pNode ) const
{
assert( NULL != pNode &&
"pNode cannot be NULL" );
while ( NULL != pNode->m_pLChild )
{
pNode = pNode->m_pLChild;
}
return pNode;
}
template < typename Key, typename Data >
TreeNode< Key, Data > * BinaryTree< Key, Data >::Maximum( _TreeNode * pNode ) const
{
assert( NULL != pNode &&
"pNode cannot be NULL" );
while ( NULL != pNode->m_pRChild )
{
pNode = pNode->m_pRChild;
}
return pNode;
}
template < typename Key, typename Data >
TreeNode< Key, Data > * BinaryTree< Key, Data >::Successor( _TreeNode * pNode ) const
{
assert( NULL != pNode &&
"pNode cannot be NULL" );
//! 2 cases
if ( NULL == pNode->m_pRChild )
{
//! 1: 右子树为空
//! 向上查找直到遇到某个是其父节点的左儿子的节点时为止
while ( NULL != pNode->m_pParent && pNode->m_pParent->m_pLChild != pNode )
{
pNode = pNode->m_pParent;
}
return pNode->m_pParent;
}
else
{
//! 2: 右子树不为空,后继即为右子树中的最左节点
return Minimum( pNode->m_pRChild );
}
}
template < typename Key, typename Data >
TreeNode< Key, Data > * BinaryTree< Key, Data >::Predecessor( _TreeNode * pNode ) const
{
assert( NULL != pNode &&
"pNode cannot be NULL" );
//! 2 cases
if ( NULL == pNode->m_pRChild )
{
//! 1: 左子树为空
//! 向上查找直到遇到某个是其父节点的右儿子的节点时为止
while ( NULL != pNode->m_pParent && pNode->m_pParent->m_pRChild != pNode )
{
pNode = pNode->m_pParent;
}
return pNode->m_pParent;
}
else
{
//! 2: 左子树不为空,前任即为左子树中的最右节点
return Maximum( pNode->m_pLChild );
}
}
#endif
测试BST
#include "BinaryTree.h"
int num[11] = { 15, 6, 18, 3, 2, 4, 7, 13, 9, 17, 20 };
int _tmain(int argc, _TCHAR* argv[])
{
BinaryTree< int, int > myTree;
typedef TreeNode< int, int > Node;
for ( int i = 0; i < 11; i ++ )
{
int x = num[i];
Node n( x, 0 );
myTree.AddNode( n );
}
Node *pRoot = myTree.GetRootNode();
Node *min = myTree.Minimum( pRoot );
Node *max = myTree.Maximum( pRoot );
Node *someNode = myTree.Search( 17 );
Node *pre = myTree.Predecessor( someNode );
Node *suc = myTree.Successor( someNode );
myTree.DeleteNode( suc );
return 0;
}
参考资料:算法导论P151-P158
fit,再熟悉不过的单词了,不过最常见的用法是作“合适的;适宜的”的意思,今儿学习一种我没怎么见过的用法——“健康的”。
Andres Iniesta will be fit in time to play in the Champions League final for Barcelona against Manchester United after tests revealed that his injury is not as serious as first thought.
伊涅斯塔将会以健康的身体赶上巴萨跟曼联的欧冠决赛,经过检查后表明他的伤并不是有当初所想的那么严重。
这真是一条令人欣慰的新闻。Yes, he’ll be fit!

barca-villarreal
Barcelona came within seconds of winning La Liga but a late, late Villarreal goal forced them to put the champagne on ice…
只需要再等待几十秒,巴萨就可以提前3轮夺得联赛冠军,但潜水艇在最后时刻的绝杀让我们的香槟还得再冰上一阵子了…
哎,这个夜晚只能用尴尬来形容,比利亚雷尔着实给迫不及待庆祝夺冠的加泰罗尼亚人浇了盆冷水,好大的一盆!
更糟糕的事情是,Iniesta又再次拉伤,不过稍微好点的消息是不会影响到在罗马的欧冠决赛,但愿如此吧,祈祷……
Recent Comments