关于hopesoft

互联网从业者,从电子商务到IT门户、财经门户,再回归电子商务;从北京再到杭州,在路上。

渐行渐远

上周五离职了。

一天之内办完了离职手续,周五下午坐上了回家的火车。

在家里呆了几天,感觉每天比较匆忙,比较累。

还没缓过神儿来,又踏上了返京的列车。中秋夜,和LP在火车上度过。车上人很少,也是,中秋月圆时,大家应该都在团圆吧。

Mediawiki与Discuz整合中

正在尝试整合Mediawiki与Discuz,目前初步整合成功,但遇到了一个问题,就是当Discuz用户名不符合mediawiki中有非法字符时,无法登录Mediawiki。

目前用到的方法是增加一个Mediawiki的扩展,新编写一个类,继承Mediawiki的AuthPlugin类,重写相关方法。

以下是找到的一些资料,先收藏下:

(1)论坛 (SMF) 与文件计画 (MediaWiki) 的帐号已经整合了
http://forum.lifetype.org.cn/index.php?PHPSESSID=461dd621d6eb2b3505c94be8e65c9140&topic=2.0;prev_next=prev

(2)整合 phpBB2:http://www.ogre3d.org/phpBB2/viewtopic.php?t=11316&postdays=0&postorder=asc&start=0

(3)整合 SMF:http://www.simplemachines.org/community/index.php?topic=28576.msg332375#msg332375

(4)MediaWiki, bbPress,以及WordPress的整合
http://www.ooso.net/du/?p=9

(5)AuthBBPress.php
http://codex.wordpress.org/User:RobLa/bbPress_Auth_for_MediaWiki

以上方法都是通过mediawiki登录,和蓝色老大沟通了下,可能得转换思路,即不使用mediawiki的用户库,以discuz用户为主,回头再试下。

这段时间搞mediawiki有些头大,希望早些告一段落!!!

解决javascript读取中文cookie时的乱码问题

原来的javascript函数如下:

//cookie操作函数
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+”=”);
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(“;”,len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
expires = expires * 60*60*24*1000;
var today = new Date();
var expires_date = new Date( today.getTime() + (expires) );
var cookieString = name + “=” +escape(value) +
( (expires) ? “;expires=” + expires_date.toGMTString() : “”) +
( (path) ? “;path=” + path : “”) +
( (domain) ? “;domain=” + domain : “”) +
( (secure) ? “;secure” : “”);
document.cookie = cookieString;
}

当cookies中保存有中文信息时,会发生乱码,这样修改下就会解决问题


//cookie操作函数
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+”=”);
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(“;”,len);
if (end == -1) end = document.cookie.length;
return decodeURI(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
expires = expires * 60*60*24*1000;
var today = new Date();
var expires_date = new Date( today.getTime() + (expires) );
var cookieString = name + “=” +escape(value) +
( (expires) ? “;expires=” + expires_date.toGMTString() : “”) +
( (path) ? “;path=” + path : “”) +
( (domain) ? “;domain=” + domain : “”) +
( (secure) ? “;secure” : “”);
document.cookie = cookieString;
}

主要是把unescape改成了decodeURI。

参照:http://www.csask.com/blog/?p=26

在《JavaScript: The Definitive Guide, 4th Edition》中写到:

In client-side JavaScript, a common use of escape( ) is to encode cookie values, which have restrictions on the punctuation characters they may contain.
在客户端脚本程序中,escape( )函数可以被用作对具有不规范标点的cookie进行编码。(就像我们函数中所用到的一样)

Although the escape( ) function was standardized in the first version of ECMAScript, it has been deprecated and removed from the standard by ECMAScript v3. Implementations of ECMAScript are likely to implement this function, but they are not required to. In JavaScript 1.5 and JScript 5.5 and later, you should use encodeURI( ) and encodeURIComponent( ) instead of escape( ).
虽然escape( ) 已经在ECMAScript中被标准化,但是在ECMAScript v3中,escape( ) 被剔出,如果需要在JavaScript 1.5 和JScript 5.5以后的版本中使用这个函数,建议使用encodeURI( )和encodeURIComponent( )。

Mediawiki相关资料

搜索了一些Mediawiki的资料,先收藏下,备查:

(1)MediaWiki 1.8 汉化包
http://www.chingli.cn/?p=28

(2)請問 mediawiki 的正體中文化
http://moto.debian.org.tw/viewtopic.php?p=26312

(3)MediaWiki 1.8
http://www.allwiki.com/wiki/Mediawiki_1.8

九月

再有2周左右的时间就要重新开始了。有种说不出的感觉。。。

目前正在交接,预计十一前后可以交接完毕。十月份也许会有一个新的开始。

——————————————————–

今晚在处理mediawiki与discuz的整合,已经初步搞定论坛用户登录wiki的问题,还有些细节需要处理,这周应该能搞定所有问题,到时wiki频道将开放。

有空仔细研究下mediawiki,感觉不错。

——————————————————–

现在最缺的就是时间,已经有N本书没能细读了,现在已经不敢买了,没时间读。琐事太多。

十一长假在即,希望所有杂事在十一前搞定,十一好好休息一下,累了。

Dojo 0.9最终版发布

下载地址:
http://download.dojotoolkit.org/release-0.9.0/

Alex says it best:

After a complete re-think about the purpose and value of Dojo, and after
months of grueling ground-up work on the part of the entire Dojo team,
I’m happy, proud, and excited to announce that Dojo 0.9.0 is available and AOL is already hosting 0.9 in their CDN.

For those porting Dojo applications from previous version of the
toolkit, you can refer to the Porting Guide for help on where APIs landed in the shuffle

In may cases, you’ll need less code overall to get the same thing done
(or done better), and Bill Keese (Dijit Project Lead) has put together
a great overview of what’s new and awesome.

The quick rundown of 0.9 features:

Dijit

  • unified look and feel for all widgets
  • ambitious a11y and i18n features in every Dijit widget
  • a mature CSS-driven theme system with multiple, high-quality themes
  • huge improvements in system performance
  • data-bound widgets
  • Declarations for lightweight widget writing
  • a new page parser that allows instances of any class, not just widgets
  • no magic

Core

  • reduced API surface area (easier to remember and use)
  • dojo.query() always available, returns real arrays
  • from-scratch high-performance DnD system
  • Base (dojo.js) is 25K on the wire (gzipped)
  • dojo.data APIs finalized
  • new build system
  • new test harness for both CLI and browser use
  • dojo.behavior now marked stable and based on dojo.query
  • excellent animation APIs with Color animations in Base (always available)
  • all the features you’ve come to count on from Dojo (RPC, JSON-P, JSON, i18n, formatting utilities, etc.)

DojoX

  • high quality implementations of previously experimental features: gfx (portable 2D drawing), data wires, offline, storage, cometd, etc.
  • dojox.gfx now includes Sliverlight support
  • many more features and improvements than there’s room for here.

硬盘罢工,恢复数据中

硬盘昨天罢工了,先前已经有一块罢工,一直没腾出手处理,结果昨天第二块也光荣下岗。

今天入手160G希捷SATA硬盘,又加了块双头显卡,这样家里的17LCD与17纯平就能都用上了,主要是为了让LP看电视 🙂

还在恢复数据中,硬盘坏了事小,数据丢了事大。

推荐一个数据恢复软件:EasyRecovery Profession,以前用过FinalData Enterprise,但感觉从速度及恢复的准确性上,EasyRecovery要胜出一筹。PS:中关村的恢复数据,一般也是用这两个软件来恢复,要价黑的很:)

还有N多的软件需要安装,N多的密码需要找回。。。

看来以后数据还是网络化比较安全,最起码重要的数据要在本机外备份一份。

这次好好打理一下,重新开始。。。

生日Blog

今天是我的生日,又大了一岁。

晚上吃饭时许了愿,希望可以实现。

最近会比较忙,也会比较累,也许是上天考验我吧,就象那句话:不经历风雨,怎么见彩虹,没有人能随随便便成功!

加油!为了理想,为了家人!

dojo 0.9 beta版发布

2007年7月3日,dojo发布了0.9 beta版,详情请看dojo官方介绍:Dojo 0.9 lands softly

dojo 0.4到dojo 0.9beta变化比较大,可以参考:Dojo Porting Guide: 0.4.x to 0.9

dojo 0.9beta在向更小体积,更快速度的目标发展,确实,dojo的框架不错,就是太大了。对于普通web应用的ajax框架,都是够用就好,大了反而是缺点。

新特性:
1.SPEED:
速度是关键
2.Accessibility:
3.Theming:
这个貌似不错,可以看看下面这些demo,都可以定制我们自己的样式:
a.日历
b.取色器
c.编辑器
4.Documentation:
http://dojotoolkit.org/book/dojo-book-0-9-0

下载地址:dojo 0.9 beta