HP Upline Service Suspended

upline logo前几天试用了HP的Upline Service,总体感觉是不够酷,普普通通,没啥特别的亮点。这倒好,昨天就收到一封该网站停止服务的邮件,幸亏没在上面存储重要的文件。
邮件全文如下:

Dear HP Upline Service subscriber,

On Thursday, April 17th, HP suspended operation of the HP Upline Service. We fully anticipate that suspension of the Upline Service will be temporary and short in duration, and will notify you when the Upline Service is operational again.

Please accept our sincere apology for this unanticipated interruption of your access to the Upline Service. We appreciate your patience as we launch this new service, and are working hard to minimize inconvenience caused by this service interruption.

If you are a resident of the United States, your subscription will remain in effect and you will be able to continue using the Upline Service for the duration of your subscription period once the Upline Service is operational again. Thank you for your patience, and we look forward to providing you with the HP Upline Service.

If you are not a resident of the United States, we regretfully must inform you that the initial launch of the HP Upline Service was intended for United States residents only. Unfortunately, our filtering tools did not adequately screen for subscribers residing outside of the United States. We thank you for your early adoption of the Upline Service, and look forward to being able to provide the HP Upline Service to you when we launch it in your country of residence. Since the HP Upline Service is presently offered for use within the United States only, we will be discontinuing your current subscription. After we notify you that the Upline Service is operational again, you will have a limited period of time to access and download files that you have uploaded onto the HP Upline Service servers. After that time period, you will no longer have access to your present HP Upline Service account. If you would like to be contacted by us when the HP Upline Service is made available in your country of residence, please send us an email at help@upline.com. We apologize for any inconvenience.

Sincerely,
The HP Upline Team

不给用就不给用憋,还整个地域歧视-_-!
>> 点击这里阅读全文

[ 分类: 动态 News ] 由 Pan 发表于 April 20, 2008 11:36 am  固定链接  评论( 0 )

页面优化参考的讨论

昨天(20080416)开了一个关于页面优化参考的讨论会。没有太多的准备,刚开始讲的时候有点紧张,因为大部分人都是美术设计部和总编室的同事,怕自己讲不明白,有点犹豫。还好最后完成了任务,也希望这次讨论会能促进后面的工作。

ppt下载地址:http://panweizeng.com/download/html_optimization_guide.ppt

[ 分类: 学习 Learning, 动态 News ] 由 Pan 发表于 April 17, 2008 10:03 am  固定链接  评论( 1 )

Sina的CMS模型

在代码层次上看,SinaCMS是使用C++编码的,模板取数据的时候则使用了perl脚本。SinaCMS里面频道、项目和模板是结合在一起的,他们三者的关系是:

1.一个频道就是一个项目,在数据库里面体现就是一个数据库,比如说新闻中心,对应一个名为news的数据库;
2.一个频道会有若干个模板,例如首页,新闻页,这些在数据库中体现为相关的表;
3.模板需要定义模板域,模板域有表单类型模板域(Form)和应用类型模板域(Application)两种类型,前者面向编辑的提供数据界面接口功能,后者面向技术支持人员提供高级的二次开发功能。模板域在数据库中就是模板表中相对应的数据扩展字段,例如Form::TextField对应的就是text字段,数据由编辑录入,Application::SQLResult
也是text字段,存储的则是执行Perl脚本执行后的结果。模板的内容存储在另外的字段中。

不难看出,SinaCMS具有极其强大的灵活性。因为它的数据库结构是项目建立以后构建模板的时候才确定的。各个频道,例如资讯频道、财经频道和汽车频道,可以拥有完全不同的数据库结构,不同频道的特殊需求也可以完全定制。另外可以看出SinaCMS里面的模板是最主要的模型,承担了确定数据表结构、文章发布和管理以及配置频道参数等等功能。

我们来看CMS系统中常见的新闻页,频道首页和列表页在SinaCMS中是怎么实现的。

编辑上文章时,先找到该频道的新闻页,然后在下面录入文章,录入完毕后点击发布,系统会根据模板的内容去获取相关的字段内容,根据模板的属性最后发布成相应的静态文件,其间如果和其他模板有相关关系(在新闻页模板域中定义Application::PostInPage),则会去触发相应的模板(例如首页和列表页)更新。

在首页模板的区块中,可以分为动态和静态两种。对于需要经常更新的静态区块,可以独立出来做成一个模板,静态区块就相当于该模板下的一篇(有且仅有一篇)文章,当然也可以在首页中新建一个Form::TextField的模板域。动态区块例如动态新闻列表,则可以在首页中新建一个Application::SQLResult的模板域,通过执行perl脚本获取内容填充,然后在首页模板内容引用该模板域,当然同样也可以新建一个只包含一个Application::SQLResult域的模板。

对于列表页,首先列表页的分页值可以存储在列表页的模板域中,也可以保存在某个模板中。分页在处理时,会通过perl脚本来执行分页算法。最终所有列表页都是列表页模板下的一个文档集。

在一个项目中,为了提高发布效率,还会存在若干的临时存储表和归档表(其实就是一些模板啦)。例如在首页的动态新闻列表,就有可能建一个临时存储数据的模板,这时如果频繁更新首页或者含有动态新闻列表的模板时,无疑将减轻数据库的压力。新闻单页的模板在处理时可以就保存最近一个月内的文章,尤其在文章数据增长较快的频道,这时就很有必要。那么以前的文章就需要转储到一个归档表中,作为查询和偶尔更新某篇文章使用。

SinaCMS中的频道路径path(例如资讯>大陆>正文)是通过模板处理的,在模板的模板域中会用perl来处理相关的逻辑。子频道和专题也是通过模板来实现的,它会通过新增一个模板来建立子频道和专题之间的关系。

至此,我们可以了解到SinaCMS中使用了非常多的冗余字段来存储本来需要多表联合查询的数据,这无疑提高了文章的发布效率。

在其他的CMS中,模板只是独立概念中的一个,而在SinaCMS中,万事万物皆模板

其实我理解也不是很透,所以以后有时间我会再对本文做一些更新。

[ 分类: 学习 Learning ] 由 Pan 发表于 April 15, 2008 12:38 am  固定链接  评论( 2 )

做自己喜欢做的事情

今天看两篇文章觉得挺有意思,一个是巴菲特的演讲记录稿视频地址),另一个是孙振耀的《关于工作与生活》,里面都讲到一些工作的道理。以前没了解过巴菲特,今天这么一看,觉得这个老头实在是太可爱了。这里摘录一段:

我碰到过一个28岁的哈佛毕业生,他一直以来都做得不错。我问他,下一步你打算做些什么?他说,可能读个MBA吧,然后去个管理资询的大公司,简历上看着漂亮点。我说,等一下,你才28岁,你做了这么多事情,你的简历比我看到过的最好的还要强十倍,现在你要再找一个你不喜欢的工作,你不觉得这就好像把你的性生活省下来到晚年的时候再用吗?是时候了,你就要去做的(不能老等着)。(这是一个比喻)但是我想我把我的立场告诉了他。你们走出去,都应该选择那些你热爱的工作,而不是让你的简历看上去风光。

什么是自己喜欢做的工作呢?我总结一下以上两位的看法,觉得这种工作应该是这样的:
1.早上你是蹦着起床的;
2.工作时感觉时间永远不够,想抓住时间但是却抓不住;
3.晚上回家一脸疲倦,但是又感觉今天做的事情有意义。

我想大体上这就是在做自己喜欢做的事情时的状态。

[ 分类: 学习 Learning, 动态 News ] 由 Pan 发表于 April 13, 2008 11:19 pm  固定链接  评论( 2 )

DataStructure.js

去年照着严蔚敏的《数据结构》写了这个脚本,用Javascript实现了栈、队列、链表、树和二叉树。后来在工作中没发现能派上什么用场,丢在一边很久也没理会。今天偶然翻了一下觉得有些写得还挺有意思的。
例如求树的所有叶子节点数。

  1. 递归解法:
  2. getLeafCount:function(){
  3.     var _count = 0;
  4.     for(var i in this.children){
  5.         if(this.children[i].hasChild()) 
  6.             _count += this.children[i].getLeafCount();
  7.         else 
  8.             _count++;
  9.     }
  10.     return _count;
  11. }
  12. 使用堆栈的非递归解法:
  13. getLeafCount:function()
  14. {
  15.     var _stack = new BX.DataStructure.Stack();
  16.     var _tree = this;
  17.     var _count = 0;
  18.     while(_tree != null)
  19.     {
  20.         for(var i = 0; i < _tree.children.length; i++)
  21.             {
  22.                 if(_tree.children[i].hasChild()) 
  23.                     _stack.push(_tree.children[i]);
  24.                 else 
  25.                     _count++;
  26.             }
  27.         _tree = _stack.pop();
  28.     }
  29.     return _count;
  30. }
  31. 使用队列的非递归解法:
  32. getLeafCount:function()
  33. {
  34.     var _queue = new BX.DataStructure.Queue();
  35.     var _tree = this;
  36.     var _count = 0;
  37.     while(_tree != null)
  38.     {
  39.         for(var i = 0; i < _tree.children.length; i++)
  40.         {
  41.             if(_tree.children[i].hasChild()) 
  42.                 _queue.enQueue(_tree.children[i]);
  43.             else 
  44.                 _count++;
  45.         }
  46.         _tree = _queue.deQueue();
  47.     }
  48.     return _count;
  49. }

又如求二叉树同一深度的所有子节点。

  1. 广度优先(Queue实现)
  2. getChildrenByDepth:function(depth)
  3. {
  4.     if(depth < 1) return null;
  5.     if(depth == 1) return new Array(this);
  6.     var _queue = new BX.DataStructure.Queue();
  7.     //同一层元素的个数队列,对头为同一层元素的个数
  8.     var _depthQueue = new BX.DataStructure.Queue();
  9.     var _children = [];
  10.     var _treeNode = null;
  11.     var _depth = 1;
  12.     var _count = 0;
  13.     _queue.enQueue(this);
  14.     while(!_queue.isEmpty())
  15.     {
  16.         if(_depth == depth) { _children = _queue.elements; break;}
  17.         else
  18.         {
  19.             _depthQueue.enQueue(_queue.getLength());
  20.             _treeNode = _queue.deQueue();
  21.             if(_treeNode.hasLeftChild()) _queue.enQueue(_treeNode.leftChild);
  22.             if(_treeNode.hasRightChild()) _queue.enQueue(_treeNode.rightChild);
  23.             _count++;
  24.             //当计数等于同一层元素个数的时候,_depthQueue置0,下一次循环时推入下一层的个数
  25.             if(_count == _depthQueue.getHead())
  26.             {
  27.                 _depth++;
  28.                 _count = 0;
  29.                 _depthQueue.clear();
  30.             }
  31.         }
  32.     }
  33.     return _children;
  34. }
  35.  
  36. 深度优先(Stack实现)
  37. getChildrenByDepth:function(depth)
  38. {
  39.     if(depth < 1) return null;
  40.     if(depth == 1) return new Array(this);
  41.     var _stack = new BX.DataStructure.Stack();
  42.     var _depthStack = new BX.DataStructure.Stack();
  43.     var _children = [];
  44.     var _treeNode = null;
  45.     var _currentDepth = 1;
  46.     var isMatched = false;
  47.     _stack.push(this);
  48.     _depthStack.push(_currentDepth);
  49.     while(!_stack.isEmpty())
  50.     {
  51.         //元素和该元素相应的深度同时出栈
  52.         _treeNode = _stack.pop();
  53.         _currentDepth = _depthStack.pop();
  54.        
  55.         if(_treeNode.hasLeftChild() || _treeNode.hasRightChild()) 
  56.             _currentDepth++;
  57.         //判断是否到达所求深度,如果是则添加到_children数组,否则当前深度和子元素都入栈
  58.         isMatched = _currentDepth == depth ? true : false;
  59.         if(_treeNode.hasLeftChild())
  60.         {
  61.             if(isMatched) _children.push(_treeNode.leftChild);
  62.             else
  63.             {
  64.                 _stack.push(_treeNode.leftChild);
  65.                 _depthStack.push(_currentDepth);
  66.             }
  67.         }
  68.         if(_treeNode.hasRightChild())
  69.         {
  70.             if(isMatched) _children.push(_treeNode.rightChild);
  71.             else
  72.             {
  73.                 _stack.push(_treeNode.rightChild);
  74.                 _depthStack.push(_currentDepth);
  75.             }
  76.         }
  77.     }
  78.     return _children;
  79. }

脚本在线地址:http://panweizeng.com/others/DataStructure.js

[ 分类: 学习 Learning ] 由 Pan 发表于 April 6, 2008 2:59 pm  固定链接  评论( 2 )