利用Ajax.Net读写Cookie

Ajax.Net是Michael Schwarz写的一个.Net的AJAX框架,使用非常方便。在ASP.Net AJAX出现以前,一直是.Net平台开发AJAX应用的首选。

这两天在用Ajax.Net开发一个小的Ajax应用,其中要在Ajax Method中读写Cookie。利用Request.Cookies[“xxx”]遇到了问题。

后来经过Google,找到解决方案,需要使用HttpContext.Current来读写Cookie。

比如读取:
string CookieName=”demo”;
HttpCookie Cookie =  HttpContext.Current.Request.Cookies[CookieName];

写:
string CookieName=”demo”;
string Value=”ok”
HttpCookie Cookie = new HttpCookie(CookieName, Value);
HttpContext.Current.Response.Cookies.Add(Cookie);

参考链接:cookie info within ajax method

无语

晚上9点多发现经典论坛的Logo变成红叉,于是登录经典论坛,发现公告说“服务器硬件出现问题”,心中有种不好的感觉。

洗了个澡,再浏览,发现公告内容变了。由于来自外部的不可抗力,经典论坛被服务器所在的机房封网了。

对中国的互联网越来越失望,希望经典论坛早日恢复!!!

Update:11月13日访问,公告说网站论坛会在最近二到三天内恢复,不过会有更加严格的制度和策略。

11月15日,经典论坛恢复正常。

Dojo 1.0 Beta released

2007年10月24日,Dojo 1.0 Beta 发布。

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

原始出处:http://dojotoolkit.org/2007/10/24/dojo-1-0-beta-released

Dojo released a beta of the 1.0 toolkit, and have made it available for download.

Using revision 11006 as the tag, and [as of this writing] currently at rev 11100, the release is still under heavy last minute love. Fixes, optimizations, enhancements, etc … Perhaps the release was not formally announced because many of the core devs will be in Boston this week, at the Ajax Experience. I suspect much quality code will come from bored hotel-hacking sessions and the fact so many dojo’ers will be floating about. There a lot of nitpicky things I am looking forward to having some time to delve into before the formal 1.0 release myself.

关于JavaScript中的数组排序

最近在处理与Array排序相关的工作,找到一些资料,如下:

  1. 数据排序谁最快(javascript中的Array.prototype.sort PK 快速排序)
  2. 快速排序的JavaScript版本
  3. CSDN对于汉字排序的讨论
  4. 面向对象的 Javascript 语言特性:引用
  5. How To: Making an independant copy of a JavaScript array
  6. select列表内容按字母倒序排序与按列表倒序排列

万事俱备,准备开工。

微软将开放.NET框架源代码

今天在网上看到消息,微软将开放.NET框架源代码。

来源:译言

微软今天早上宣布.NET 框架库源码将向全世界开放,以允许广大的.NET 框架开发者察看其核心代码,从而有助于他们开发自己的软件。

这很难说微软这一举动的动机是什么,或许是在开发者团队当中,.NET 使用者太少,微软有必要采取这一极端的措施。又或者是微软为了准备推出新一代的富 Web 应用程序(Rich Internet Applications)SilverLight而作的战略部署。到目前为止还是无人问津的Vista,他的核心同样是.NET 框架。

微软这份声明的意义仍然值得我们去思考;希望.NET开发者可以踊跃的讨论一下。

更新:果不其然, Mary Jo Foley的博客 All About Microsoft 已经很好的阐述了这份声明。更多的评论请参看:Techmeme.

来源:CNET科技资讯网

CNET科技资讯网 10月5日 国际报道:微软以往与开放源代码运动对抗的恶名昭彰,所以,今天微软宣布将把.NET架构开放源代码时,引起一片讶异之声,不难想见。

.NET源代码将依照微软的Reference License规定授权。换句话说,此源代码只供你用在应用程序的除错、维护或改良上。你不能为了其他目的而修改该源代码,或转而散布出去。由此可见,这似乎是微软目前为止,限制最严格的共享源代码授权许可。

这项宣布证实,.NET将成为共享源代码(shared source),但不可与开放源代码(open source)混为一谈。

除了释出.NET程序库(libraries)外,微软也将把.NET的除错支援整合到Visual Studio 2008里。根据微软的声明:‘你将能够把.NET架构的symbols设定成一次打包下载,或视需要时再手动撷取。’

即使.NET源代码未完全开放,这对微软而言,仍然是朝开放跨出一大步。即使许多.NET开发人员仍评批,这种事早该做了,但我确信,开发者社群仍会从中受益。这显然让微软朝开放源代码更迈进一步,而这种发展是令人耳目一新的。不过,微软将来会不会真的‘撩落去’,仍有待观察。(唐慧文/译)

不管怎样,这是个好消息。

Javascript编辑器-Spket

今天在网上看到有网友提到了一款Javascript编辑器:Spket。遂下载试用了一下,确实不错。

主页地址:http://www.spket.com

官方说明:

Spket IDE is powerful toolkit for JavaScript and XML development.

The powerful editor for JavaScript, XUL/XBL and Yahoo! Widget development. The JavaScript editor provides features like code completion, syntax highlighting and content outline that helps developers productively create efficient JavaScript code.

打开Prototype.js,从左下角的窗口可以罗列出这个文件中包含的类、函数、变量等信息。可以按出现顺序排序,也可按字母排序。

界面信息:

spket

下载地址:http://www.spket.com/download.html

安装要求:需要Java 1.4.2或更高, download form java.com

MediaWiki与Discuz整合方案

经过借鉴国外网友的整合代码,终于搞定MediaWiki与Discuz的整合。具体如下:

一、软件环境:
wiki: MediaWiki 1.9.3 (allwiki.com汉化版)
BBS: Discuz 5.5 utf-8 中文版

二、整合方法:
1.首先安装MediaWiki
2.修改localsettings.php,在尾部增加以下代码(其中设置请按自己的实际情况设置):

// Discuz User Database Plugin. (Requires MySQL Database)
require_once ‘./extensions/Auth_Discuz.php’;

$wgDiscuz_WikiGroupID = ‘9,10,11,12,13,14,15’; // GroupID of your Discuz group
$wgDiscuz_WikiGroupName = ”; // Name of your Discuz group
// users need to be a member
// of to use the wiki. (i.e. wiki)

$wgDiscuz_UseWikiGroup = true; // This tells the Plugin to require
// a user to be a member of the above
// Discuz group. (ie. wiki) Setting
// this to false will let any Discuz
// user edit the wiki.

$wgDiscuz_UseExtDatabase = true; // This tells the plugin that the Discuz tables
// are in a different database then the wiki.
// The default settings is false.

$wgDiscuz_Version = ‘6’; // This is what version of Discuz you are using.
// Current valid values are 5.5 and 6

/*-[NOTE: You only need the next four settings if you set $wgDiscuz_UseExtDatabase to true.]-*/
$wgDiscuz_MySQL_Host = ‘localhost’; // Discuz MySQL Host Name.
$wgDiscuz_MySQL_Username = ‘your username’; // Discuz MySQL Username.
$wgDiscuz_MySQL_Password = ‘your password’; // Discuz MySQL Password.
$wgDiscuz_MySQL_Database = ‘your database name’; // Discuz MySQL Database Name.

$wgDiscuz_Charset = ‘utf8’; // Discuz MySQL Database Name.
$wgDiscuz_UserTB = ‘bbs_members’; // Name of your Discuz user table. (i.e. bbs_members)
$wgDiscuz_UserFieldTB = ‘bbs_memberfields’; // Name of your SMF user table. (i.e. bbs_memberfields)
$wgDiscuz_GroupsTB = ‘bbs_usergroups’; // Name of your Discuz groups table. (i.e. bbs_usergroups)
$wgAuth = new Auth_Discuz(); // Auth_Discuz Plugin.

3.下载此文件保存在extensions目录下
Auth_Discuz.php

三、参考资源:
MediaWiki_SMF_Auth_v1.3

四、说明:
经过上面步骤修改后,请关闭MediaWiki的注册,将注册网址链接到论坛的注册页面,当用户在论坛注册后再登录Wiki时,系统会自动在Wiki数据库创建一个对应的用户。且支持非英文用户名。

Adobe公司的轻量级的AJAX框架Spry

今天有网友提到了spry,说是Dreamweaver cs3中的一个轻量级AJAX框架,Google了一下,才知Dreamweaver cs3相当于 Dreamweaver 9。

以下是一些有用的文章:
1.Spry框架初步入门
http://www.javaeye.com/topic/37180

2.官方在线Demo
http://labs.adobe.com/technologies/spry/demos/index.html

3.Dreamweaver CS3集成Spry效果试用
http://tech.163.com/07/0423/10/3CONR1KL0009158M.html

有空体验一下。