[CS enhancement]ExtendedAttributes in Community Server

In this, the first of what I hope is a long line of articles based on customizing Community Server, I want to talk about a little know but very powerful property found in many places inside the CS API.

One thing people often need to do in Community Server, especially when customizing it, is to save custom data. Of course, if you’re feeling brave, you can always edit the database schema and related Data Providers as well as extending the relevant class (Weblog, Gallery, User etc.). Now this method is not without its merits, such as easier searching based on these new values, plus better performance where the values are to regularly accessed, and as ever, such factors should always be taken into account when extending Community Server.

What I want to talk about however, is the case where you want to simply store some extra information with an object. For example, one common request is to save extra contact information against a user. Currently, Community Server allows you to add IM addresses for MSN, AOL, Yahoo and ICQ contact details to a user’s profile, but you might want more! Another example might be that you wish a user to accept some specific terms/rules before you allow them to use your site (this came up on a recent client installation) so you need to record the date/time when they accepted.

By far the easiest way to achieve this is by using ExtendedAttributes. Most of the major classes in CS inherit from ExtendedAttributes such as User, Post & Section (in turn Weblog, Gallery, Forum etc inherit from Section as WeblogPost, GalleryPost etc. inherit from Post). All of these classes have two methods that you can use to set and retrieve this data and these are GetExtendedAttribute() & SetExtendedAttribute(). Under the hood, the ExtendedAttributes class uses a NameValueCollection object to store the data so naturally, SetExtendedAttribute()requires just two parameters; name and value.

So, to assign a users GoogleTalk address:

User user = CSContext.Current.User; // Get the logged on user.

user.SetExtendedAttribute("GoogleTalkAccount", "usersaccount"); // Set the new details.

Users.UpdateUser(user); // Save the changes.

And to retrieve that data:

string googleTalkAccount = user.GetExtendedAttribute("GoogleTalkAccount");

Or, to set the date that a user accepted the terms to your site;

User user = CSContext.Current.User; // Get the logged on user.

user.SetExtendedAttribute("TermsAccepted", DateTime.Now.ToString()); // Set the date.

Users.UpdateUser(user); // Save the changes.

And again, to retrieve this:

DateTime termsAccepted = Convert.ToDateTime(user.GetExtendedAttribute("TermsAccepted"));

Of course, normally, you’d need to check the above string before trying to cast it as a DateTime, but we’ll skip that for the purposes of this article. As a side note, if the ExtendedAttribute doesn’t exisit in the colletion, GetExtendedAttribute() will return an empty string.

发表于 作者 大兵 | 0 评论
相关主题:

Community Server资料收集

Community Server学习资料

uGoer 系列文章

Community Server专题一:概述Community Server
Community Server专题二:体系结构
Community Server专题:附件(DOC&PPT)--2005年10月10日更新
Community Server专题三:HttpModule
Community Server专题四:HttpHandler
Community Server专题五:IHttpHandlerFactory
Community Server专题:FAQ--2005年9月19日更新
Community Server专题六:Delegates & Events
Community Server专题七: Job & Timer
Community Server专题附录一: 什么是Threads & Processes
Community Server专题八:MemberRole之Membership
Community Server专题八:MemberRole之Membership深入篇
Community Server专题九:MemberRole之Profile
Community Server专题十:MemberRole之RoleManager
CommunityServer 2.0中Files 与 Reader 项目的授权机制
Community Server 2.0中如何调试项目?我告诉你!
Community Server2.0专注细节一 邮件提醒按钮实现(上)
Community Server2.0专注细节专题Doc下载(2006-3-9更新)

Felix 系列文章

 

Community Server系列之一:开篇简介

Community Server系列之二:页面之间的关系1[介绍]

Community Server系列之三:页面间关系2[介绍]

Community Server系列之四:Ajax在CS2.0中的应用1

Community Server系列之五:CS2中的Ajax原理

      写这篇帖子的目的在于介绍整个CS中的关键点,以我的经验来看着重应该了解的地方的一些罗列。这对初次接触CS的朋友来说我想是有帮助的。

       模块:在CS2中最主要的官方模块有(论坛Forums、博客Blogs、相册Galleries)现在只讨论主要的这三个模块,下面的文字也围绕着这三个模块进行讨论。这三个模块具有一定的共同点,CS把这三个模块抽象到一起了,这是CS的核心所在。

名称

说明

主要数据表

备注

Section

基本板块:论坛里表现为论坛的板块,博客里表现为每个人的博客,相册表现为每个人的相册。

cs_Sections主要保存模块数据包括模块的组别名称所有者等等。

 

CS中很重要的一个概念,几乎所有的逻辑都与此相关。

Group

组别,在CS中的几乎所有标准模块都依靠Group进行管理,论坛的Group表现为对论坛板块的分类,博客表现为博客的群组,相册也表现为群组,总之,这些模块都要依赖此进行管理

cs_Groups,主要保存分组信息

所有Section都依赖此进行组合,就算一个Section也需要一个默认Group

Settings

几乎每张表都有SettingsID的字段用来区分不同的应用,因为CS一个程序可以同时分成多个应用而互不干扰,每个存储过程,每张表都有相应的对Settings的筛选

cs_SiteSettings,站点的基本设置以XML的形式保存在此

cs_Sites站点信息,可设置多个站点

cs_SiteMappings站点和Settings的对应关系

这个概念同样重要,现在很多程序都设计成这样的模式,一句话,尽量灵活,CS的灵活性非常到位。

Thread

线程,这个感念比较抽象,但在CS中却是很重要的,这个意思可以简单的认为是一个主题,并包含这个主题所有的相关信息,比如回复数,得分等等

cs_Threads,保存每个主题信息,

cs_ThreadsRead,阅读者对每个主题的阅读情况

在每发表一篇主题(非回复)就在此表添加一条记录

Post

表示包括主题在内的所有用户发表的帖子,无论是回复还是投票或主题统统要在此记录

cs_Posts,保存Post的主要数据表其他与Post相关的表还有很多

最重要的用户数据表

Category

分类,帖子分类,此分类是针对Section进行的,每个Section都可以有自己的分类,在CS中又叫TAG,可以适当改造一下就变为时下流行的TAG功能

cs_Post_Categoriescs_Post_Categories_Parents保存每个Section的分类统计

cs_Posts_InCategories保存每篇帖子对应的分类

CS中只有对每个Section的分类管理,而缺少对整个网站的分类,我们可以按照Category模块进行扩展

Permission

授权,与Role角色挂钩,此针对各Section设置各种角色的对应权限,也就是权限矩阵

cs_ProductPermissions在此保存针对每种应用模块的默认权限。cs_SectionPermissions针对各种Section的个性权限

此处缺少对Group的默认权限,不过根据源代码扩充为支持Group默认权限的功能也很容易

Membership

建立在微软的Membership组件下的基于角色的用户管理系统,使用此功能对设置权限和对用户相关功能的扩充都非常方便

asp_net打头的数据表是Membership所需要的,另外cs中扩展了cs_Userscs_UserProfile等数据表

CS完全依靠Membership达键的用户基础管理系统,很多地方值得好好研究

Job

B/S程序需要定时处理的功能,在此称为Job,我们可以在communityserver.config文件中看到那些Job的配置,运行这些Job都是在单独的线程中执行,与用户交互无关

可以通过后台管理的Jobs Report查看Job的情况,也可通过查看Exception Report查看Jobs有无运行异常

熟悉这些关键词及模块对CS的掌握至关重要,希望通过此篇介绍能帮助你更快的了解CS的基础。

发表于 作者 大兵 | 0 评论
相关主题:

[转]Community Server用户注册过程

下面是Community Server用户的注册过程,是从sql serverprofiler跟踪来的,下文从数据库的角度分析一下用户的注册过程,我们的cs论坛已转换为标准的asp.net 2.0membership,经过对比cs的用户管理表和标准的asp.net 2.0的用户管理表结构一模一样,从aspnet_Applicationsaspnet_WebEvent_Events11个表。分析的目的就是为了下一步整合系统,作出自的会员注册系统。

Cs注册的过程大概分为:

(存储过程见附1:中间不重要的部分或写日志的部分不分析)

1、注册到标准的用户表中

2、注册到cs自定的用户表中。

3、给该用户增加Everyone角色

4、给该用户增加Registered角色

5、将用户的时区、昵称……的结构和数据添加到aspnet_Profile表中,cs初始值只有时区的值默认是8(东八区),其余的值都为空。

 

下面的存储过程好像是修改用户表中的数据。先走主线。

 

我们的程序员测试了用标准的asp.net 2.0的用户注册控件这册用户,顺利注册,但没有注册到aspnet_Profile中,曾经一直为这个表发愁,不知用什么算法读取这个表中的数据。查了些资料,发现这也是微软标准的字段,原来还以为是cs自己加上的呢?

 

参考了

http://www.microsoft.com/china/msdn/library/langtool/vbnet/VisualBasic2005chapter6.mspx?mfr=true

文章中的下面一段终于明白了profile的来龙去脉,其实道理挺简单的。

 

如果要加时区

 

1、先在web.config文件中申明(详细的看上面提到的文章)

<properties>

<add name = "timezone" type = "System.Double" defaultValue="0" />

</properties>

2、在程序里写:

Profile. timezone = txtLastName.Text

Profile.Save()

3、在程序里读:

 

txtLastName.Text = Profile. timezone

 

1:上文的节选

 

用户配置文件

ASP.NET 2.0 中的用户配置文件有时称为用户个性化或配置文件个性化,在 Web 站点的 web.config 文件中进行配置。可以在该配置文件中以声明性方式声明希望为每个用户存储的数据,然后在某个特殊的 Profile 对象中填充对应的属性。下面的 web.config 文件子集配置 Web 站点来存储每个用户的 FirstName LastName字符串值:

<?xml version="1.0”?>

<configuration>

<system.web>

<authentication mode="Forms”/>

<profile inherits="System.Web.Profile.HttpProfileBase, System.Web,

Version=2.0.3600.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a">

<properties>

<add name="FirstName”type="System.String”/>

<add name="LastName”type="System.String”/>

</properties>

</profile>

</system.web>

</configuration>

Visual Studio 2005 web.config 文件读取这些配置信息,并动态地创建从 HttpProfileBase 继承的专用类。该专用类包含 web.config 文件中定义的具有正确数据类型的所有属性。图 6-12 例举一个在 Intellisense 中可用的自定义配置文件属性。

6-12 Intellisense 中可用的强类型配置文件属性。

在运行时,ASP.NET 2.0 负责管理配置文件数据的持久性。作为程序员,您唯一的任务是读写这些数据。下面的代码说明如何设置 FirstName LastName属性,并将它们保存在配置文件数据存储中:

Profile.FirstName = txtFirstName.Text

Profile.LastName = txtLastName.Text

Profile.Save()

要从 Profile 对象读回数据,只需颠倒赋值语句即可:

txtFirstName.Text = Profile.FirstName

txtLastName.Text = Profile.LastName

默认情况下,这些配置文件属性只能为经过身份验证的用户设置(因此也只为他们存储)。但在有些情况下,当用户匿名浏览站点时,您需要捕获信息;而当该用户登录站点时,您需要维护数据。ASP.NET 用户配置文件本身支持这种情况。必须使用 web.config 中的 <anonymousIdentification>元素显式启用匿名配置处理。然后,希望支持匿名用户的任何属性都必须将 allowAnonymous属性设置为 true。下面来自 web.config XML 显示此应用程序的这些设置:

<anonymousIdentification enabled="true”/>

<profile inherits="System.Web.Profile.HttpProfileBase, System.Web,

Version=2.0.3600.0, Culture=neutral,

PublicKeyToken=b03f5f7f11d50a3a”>

<properties>

<add name="FirstName”type="System.String”/>

<add name="LastName”type="System.String”/>

<add name="FirstVisit”type="System.String”allowAnonymous="true”/>

</properties>

</profile>

 

 

 

 

2:存储过程分析

序号

存储过程

 

Exec dbo.aspnet_Membership_GetUserByName @ApplicationName=N'dev',@UserName=N'jgjgjg',@UpdateLastActivity=0,@CurrentTimeUtc=''2006-06-07 07:27:24:470''

 

 

1

declare @p12 uniqueidentifier

set @p12='0A9D95BF-CA10-4F28-B88F-F0D658443CCB'

exec dbo.aspnet_Membership_CreateUser

@ApplicationName=N'dev',@UserName=N'jgjgjg',@Password=N'VZTGpRbu/3W+zY2AudYnv8ISrBA=',@PasswordSalt=N'ckq4OIs24bYpdwxrIbqX4g==',@Email=N'abcc@123.com',@PasswordQuestion=NULL,@PasswordAnswer=NULL,@IsApproved=1,@UniqueEmail=1,@PasswordFormat=1,@CurrentTimeUtc=''2006-06-07

07:27:24:000'',@UserId=@p12 output

select @p12

 

 

 

exec dbo.aspnet_Profile_GetProperties @ApplicationName=N'dev',@UserName=N'jgjgjg',@CurrentTimeUtc=''2006-06-07 07:27:24:483''

 

 

 

 

2

declare @p2 int

set @p2=2149

exec dbo.cs_user_CreateUpdateDelete @Action=0,@cs_UserID=@p2

output,@UserID='0A9D95BF-CA10-4F28-B88F-F0D658443CCB',@UserAccountStatus=1,@IsAnonymous=0,@IsIgnored=0,@ForceLogin=0,@AppUserToken='',@PropertyNames=default,@PropertyValues=default,@TimeZone=0,@PostRank=default,@PostSortOrder=0,@IsAvatarApproved=1,@ModerationLevel=0,@EnableThreadTracking=0,@EnableAvatar=0,@EnableDisplayInMemberList=1,@EnablePrivateMessages=0,@EnableOnlineStatus=0,@EnableEmail=1,@EnableHtmlEmail=1,@FavoritesShared=0,@SettingsID=1000

select @p2

 

 

 

exec dbo.cs_EventLog_Add @EventType=0,@EventID=401,@SettingsID=1000,@Message=N'jgjgjg was added from the role Everyone by jgjgjg',@Category=N'Role

Update',@MachineName=N'KWKJ-FEFDN0OMQU'

 

 

3

exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'dev',@RoleNames=N'Everyone',@UserNames=N'jgjgjg',@CurrentTimeUtc=''2006-06-07 07:27:24:500''

 

 

 

exec dbo.cs_user_Get @UserName=N'jgjgjg',@UserID=0,@IsOnline=0,@LastAction=N'',@SettingsID=1000

 

 

 

exec dbo.cs_Roles_Get @UserID=2149,@SettingsID=1000

 

 

 

exec dbo.cs_EventLog_Add @EventType=0,@EventID=401,@SettingsID=1000,@Message=N'jgjgjg was added from the role Registered Users by jgjgjg',@Category=N'Role

Update',@MachineName=N'KWKJ-FEFDN0OMQU'

 

 

 

4

exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'dev',@RoleNames=N'Registered Users',@UserNames=N'jgjgjg',@CurrentTimeUtc=''2006-06-07

07:27:24:530''

 

 

 

exec dbo.cs_Roles_Get @UserID=2149,@SettingsID=1000

 

 

5

exec dbo.aspnet_Profile_SetProperties

@ApplicationName=N'dev',@UserName=N'jgjgjg',@PropertyNames=N'publicEmail:S:0:0:yahooIM:S:0:0:timezone:S:0:1:commonName:S:1:0:signatureFormatted:S:1:0:signature:S:1:0:webLog:S:1:0:location:S:1:0:bio:S:1:0:webAddress:S:1:0:interests:S:1:0:icqIM:S:1:0:aolIM:S:1:0:occupation:S:1:0:msnIM:S:1:0:',@PropertyValuesString=N'8',@PropertyValuesBinary=0x,@IsUserAnonymous=0,@CurrentTimeUtc=''2006-06-07

07:27:24:923''

 

 

6

exec dbo.aspnet_Membership_UpdateUser

@ApplicationName=N'dev',@UserName=N'jgjgjg',@Email=N'abcc@123.com',@Comment=NULL,@IsApproved=1,@LastLoginDate=''2006-06-07

07:27:24:000'',@LastActivityDate=''2006-06-07 07:27:24:000'',@UniqueEmail=1,@CurrentTimeUtc=''2006-06-07 07:27:24:937''

 

 

 

exec dbo.aspnet_Membership_GetUserByName @ApplicationName=N'dev',@UserName=N'jgjgjg',@UpdateLastActivity=0,@CurrentTimeUtc=''2006-06-07 07:27:24:937''

 

 

 

exec dbo.cs_user_CreateUpdateDelete

@Action=1,@cs_UserID=2149,@UserID='0A9D95BF-CA10-4F28-B88F-F0D658443CCB',@UserAccountStatus=1,@IsAnonymous=0,@IsIgnored=0,@ForceLogin=0,@AppUserToken='',@PropertyNames=default,@PropertyValues=default,@TimeZone=8,@PostRank=default,@PostSortOrder=0,@IsAvatarApproved=1,@ModerationLevel=0,@EnableThreadTracking=0,@EnableAvatar=0,@EnableDisplayInMemberList=1,@EnablePrivateMessages=0,@EnableOnlineStatus=0,@EnableEmail=1,@EnableHtmlEmail=1,@FavoritesShared=0,@SettingsID=1000

 

发表于 作者 大兵 | 0 评论
相关主题:

[服务器优化]IIS Compression in IIS6.0

Hold on to your hats folks. If you don't have compression installed on your web server, either IIS Compression or a 3rd party, and you have IIS6.0 and pay for bandwidth you're missing out on something good.

In the day of IIS5 and earlier the compression built into IIS had various issues and was really not worth implementing. To enable compression you would need to go with a 3rd party solution like www.port80software.com or www.xcompress.com. This has all changed in IIS6! At www.orcsweb.com we've been running IIS6.0 compression on some servers for a number of month with few issues, just huge performance and bandwidth benefits.  Expect upwards of 4 times the compression which directly translates to bandwidth savings.  This means faster loading of pages for the end user also.  The only time we had to disable it was for a custom audio application for one of our clients that didn't work with compression.  I'll mention at the end of this how to disable compression for an individual site.

First, for those unfamiliar with what IIS6.0 is and how to get it: IIS6.0, short for Internet Information Services 6.0, is the web software that comes with Windows Server 2003. So if you run IIS on W2K3 then you have IIS6.0. If you're wondering if you can get it apart from W2K3, sorry the answer is 'no'.

One of the issues still there today with compression in IIS is that there isn't a nice interface to manage it. It's not as straight forward as other features of IIS. No need to worry though, I'll explain the ins and outs below of how to implement this properly. I set out to implement IIS Compression a number of months ago and had a hard time finding good information about it. I did find one great post here: http://dotnetguy.techieswithcats.com/archives/003475.shtml. I've since jumped into this subject in more depth and have two things to add to Brad Wilson's article. One, an iisreset is required as I'll mention below but also there is another setting that is required for compression to be more practical for dynamic compression. The other link worth bookmarking is: http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/standard/ref_prog_iaorefcompschs.asp. (I won't make any promises that this link will always work, Microsoft seems to change their links to documents all the time)

To make it easier I'll include everything needed to properly enable IIS Compression below even though I'll repeat what Brad Wilson said.

First, before anything else, backup the metabase.  This is done by right-clicking on the server in the IIS snap-in and selecting All Tasks -> Backup/Restore Configuration.  The rest is straight forward.

Create Compression Folder (optional)

The first thing I do is create a folder on the D drive where the static file compression will be cached. I call it ASPNetCompressTemp but you can call it anything you want or leave the default of “%windir%\IIS Temporary Compressed Files” if that works for you. The IUSR_{machinename} will need write permission to the folder. If you use custom anonymous users, make sure to assign the proper user. IIS will still work even if the permissions are wrong but the compression won't work properly. Once running, it's worth double checking Event Viewer to see if any errors are occurring that keep IIS Compression from working.

Enable Compression in IIS

- From the IIS snap-in, right-click on the Web Sites node and click on Properties
- Select the Service tab - Enable Compress application files
- Enable Compress static files
- Change Temporary Directory to the folder that you created above, or leave it at it's default
- Set the max size of the temp folder to something that the hard drive can handle. i.e. 1000. 
- Save and close the Web Site Properties dialog

Note: The temporary compress directory is only used for static pages.  Dynamic pages aren't saved to disk and are recreated every time so there is some CPU overhead used on every page request for dynamic content.

Create a Web Service Extension (WSE)

IIS6.0 is much more proactive than IIS5 in regards to security and introduces a new feature called Web Service Extensions. This is great but means an extra step.

- In the IIS snap-in select Web Service Extensions
- Create a new web service extension
- Call it HTTP Compression
- Point it to c:\windows\system32\inetsrv\gzip.dll
- Check the Set status checkbox so that it is enabled (Allowed) Enable Direct Metabase Edit (optional) One of many large improvement with IIS 6 is that the metabase isn't in binary format anymore and can be edited directly using Notepad or any other tools that allows editing an XML file. Personally I prefer to enable Direct Metabase Edit so that I can edit it and the change takes affect immediately. If this isn't enabled, you will need to stop and start the web services for any changes to take affect. Of course, like editing the windows registry there is always the chance of something going wrong so be careful. Unlike the windows registry though, if you make a mistake and the metabase is saved and doesn't conform to the proper XML scheme, it won't take affect, so thanks to the IIS team it's quite difficult to completely mess up the metabase. To enable this, right-click on the server (top level) in the IIS snap-in. There is a single checkbox that needs to be checked. This part couldn't get easier.

Now for the metabase changes

Now we move away from the IIS snap-in GUI and have to get our hands dirty. (well, as dirty as they can get when dealing with computer software)

Here is where the IIS team either wanted to make things a bit difficult or they didn't get the changes done in time for the final release of IIS6. Actually it's the latter as I've heard rumor that they will be improving on the GUI over time.

Note: If you want to save yourself the hassle of understanding all of this, purchase ZipEnable from Port80 Software.  http://www.port80software.com/products/zipenable/.  This is a tool that gives you full control down to the folder and file level and embeds itself into the IIS MMC snap-in, making things much easier.  I haven't tried this out so I can't attest to it myself but Port80 Software is a company that Microsoft has recommended for years to use if you want HTTP Compression.

There are a couple ways to do this. One is to edit the metabase directly using Notepad and the other is using adsutil.vbs usually found in your C:\Inetpub\AdminScripts folder. I'll explain the direct edit method because I find it's easier to picture and understand what is happening then using a command-line tool.

- Open the metabase located at C:\Windows\system32\inetsrv\metabase.xml in Notepad
- Search for <IIsCompressionScheme 
- There should be two of them, one for deflate and one for gzip.  Basically they are two means of compression that IIS supports.
- First thing to do is add aspx,  asmx, php and any other extension that you need to the list extensions in HcScriptFileExtensions.  Make sure to follow the existing format carefully, an extra space will keep this from working correctly.  Do this for both deflate and gzip.
- Now for the other thing commonly missed.  HcDynamicCompressionLevel has a default value of 0.  Basically this means at if you did everything else right, the compression for dynamic contact is at the lowest level.  The valid range for this is from 0 to 10.  I had the opportunity of receiving an internal testing summary from Chris Adams from Microsoft regarding the compression level -vs- CPU usage which showed that the CPU needed for levels 0 - 9 is fairly low but for level 10 it hits the roof.  Yet the compression for level 9 is nearly as good as level 10.  I write all this to say that I recommend level 9 so make sure to change HcDynamicCompressionLevel to 9.  Do this for both deflate and gzip.

- Just one thing left.  There are two settings that required the World Wide Web Publishing Service (WWW service) be reset.  One was enabling compression and the other was HcDynamicCompressionLevel.  Even with its shortcomings I simply do an iisreset from the command prompt but you can reset the service whichever way you prefer.

That's it folks.  I didn't promise it would be easy but hopefully I was straight forward enough in my steps to keep this from being too difficult.

I should mention it is possible to disable or enable compression at the site or sub-folder level.  This time I'll be lazy and tell you the adsutil.vbs way to do this but it can be done directly using Notepad and editing the metabase directly if you prefer.  From the command prompt enter the following two commands and be sure to replace site# with the siteID that you are changing:

cscript C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/site#/root/DoStaticCompression False
cscript C:\Inetpub\AdminScripts\adsutil.vbs set w3svc/site#/root/DoDynamicCompression False

Follow-up blog: http://weblogs.asp.net/owscott/archive/2004/01/16/59594.aspx

posted on Monday, January 12, 2004 9:49 AM

原文地址:http://weblogs.asp.net/owscott/archive/2004/01/12/57916.aspx

发表于 作者 大兵 | 0 评论
相关主题:

新增在线聊天功能gabbly

大家试试看:)
就在首页面的右竖菜单栏。

发表于 作者 大兵 | 0 评论

达芬奇密码※天主事工会※郇山隐修会

      《达芬奇密码》,23日被连蒙带骗的拐去看了这部已经看过小说的大片。没想到不是首映日票还是卖的这么快,7点多到新东安电影院只买到10:30的晚场。好在两个半钟头的电影不太令我失望,和看小说的感觉一样,前半部分比较吸引人,后面当秘密不是秘密的时候我就兴趣乏乏了(特别是发现这个秘密对男人以及不信基督的人没什么关系的时候:)。电影基本忠于原小说,前半部分比较吸引人,当大家都明白隐修会的秘密原来就是保护耶稣后人,所谓的圣杯也只是耶稣的老婆之后,影片和小说的神秘感一下就没有了,情节也就平平淡淡,难怪我身旁一个帅哥呼呼大睡了起来。结尾汤姆·汉克斯跑去跪在卢浮宫玻璃金子塔上的情景有一点小小的震撼。(贝聿铭的设计为国人挣了不少面子:)

      出于好奇在网上找了找出现在《达芬奇密码》中的两个神秘组织:天主事工会和 郇山隐修会的信息。

      天主事工会Opus Dei,这个西文词组是拉丁文,意思是天主之事,是真正的天主教团体,受罗马教皇的认可,其创始人前两年刚被封为圣人。这个团体创立于1928年的马德里,追求在日常工作生活中成为圣徒,也就是不必入教,甚至不必真正加入这个团体。当然这个团体在全球范围内有85000来真正的会员,美国有3000来人(Time),在纽约有一座刚建成没几年的大楼。入会后有相当严格的戒律,比如禁欲,男女分开,苦修(在大腿上绑一个满是尖刺的苦修带,每天2小时),也有说法说他们死后要把财产捐给这个会。同时会员要求保持隐秘状态。它的发展对象是高层次人士,像大学生等,因此据说在某些上层有极大的影响力。

      郇山隐修会是书中提到另一个神秘组织,书中说他们有关于基督教起源的另外的说法,而天主事工会则是罗马的支持者,这就是他们之间的冲突。者据说有上千年历史,有包括牛顿、达芬奇和雨果在内的多位大师为领袖,该会英文名Priory of Zion,所以又叫锡安会(看过黑客帝国后应该对Zion有点印象,耶路撒冷的一个地方),于是又同几百年前的圣殿骑士团拉上了关系。实际上,历史上找不到任何这个组织的记录,而法国那里倒有这个组织的档案,它成立于1956年,目前已经没有什么活动,在它短暂的历史上也没有什么惊人之举(或者像电影中说的从事的活动太神秘,所以会外的人都不了解:)。

神秘的东西,了解一下

发表于 作者 大兵 | 1 评论

家园更新小计20060515


上周末完成了家园新版本的更新,比预计的五一期间整整晚了一个星期(PS:主要是自己太贪玩了,五一七天基本都北京附近的景点晃悠)
本次更新主要完成了CCS1.1至CS2.0程序的更换,因此在一些功能上有一些变化:

  1. 整站使用的编辑器(包括论坛中发贴的编辑器)
    新的编辑器不支持多附件功能,但整体功能更强大,其图片插入功能可以让你直接将家园中你拥有权限的图片嵌入帖子,即你可以发布在相册中的图片直接抓取过来放入博客或论坛的帖子。还有其他比较好的功能,大家自行试用即知。
  2. 论坛斑竹将不再向以前那样设置在论坛版块上了,而是按照家园有的功能模块来划分的,因此原来按论坛版块划分的斑竹将被取消,后续的更新也许会恢复论坛的斑竹功能。
  3. 新增下载模块和资讯模块,下载模块已经可以使用,资讯模块类似于一个在线的RSS Reader,因为CS开源版本的限制,只开放250个个人定制RSS功能,现在放在页面上的是公共的RSS新闻,用户不能根据自己的兴趣增删RSS Feed。那250个可定制的RSS Reader将在在线RSS Reader界面定制好以后,开放给论坛斑竹以及主要的管理员。至于250个用完以后,也许...可能自己作一个可定制的在线RSS功能。
  4. 亲亲版块直接放置在页顶菜单作为家园主打版块,同时也是司令原来荆程网站到亲亲自然网站到现在和蓝色家园合作的独立网站,主要是户外、旅行和摄影专用的论坛,这也是家园网站和亲亲网站主要开办的目的,分享户外知识、经验和漂亮的户外相片。现在其功能还主要局限在论坛版块功能,希望以后的更新能引入WIKI(维基)功能,以将亲亲版块做成类似户外百科全书类型的版块,为大家进行徒步和户外提供有用的指引和帮助。
  5. 博客、相册功能结合的更加紧密,用户可以无缝的使用自己在相册发布的图片,自己上传的文件以及家园中提供的公共资源。新版本CS中集成了componentART的SlideShow功能,在相册中现在可以用很漂亮的Flash幻灯方式查看图片(忘了在首页放置连接了),大家可以在相册里找到,也可以先在这里试用: 作为幻灯片查看
  6. 家园的目的和办站的方向,为家园网友提供一个自由的定制的家园系统,除了维护博客和相册之外,将逐步提供可定制的信息浏览功能,包括用户自行添加喜爱的网站连接、添加新闻RSS 
  7. 其他...家园的后续更新将根据网友的建议进行改进,以方便大家使用和提供更多信息。
发表于 作者 大兵 | 0 评论

计划追赶变化

计划确实永远赶不上变化,但是计划还是要做:)

因为工作的缘故要长期漂泊在外了,出来以后手头的工作也比较多。很多事情也因此而滞后,这里要给明明说声抱歉了。

家园的改版也说了很久,一是上月中官方版本才发布,二是新版本又有很多改变,三是升级新版需要进行数据库的转换,四是界面的开发也拖了很久,五是在外面要连上服务器好慢(真的好慢......在这里谴责一下电信和网通),最后归结来还是自己太懒了。不过家园和亲亲还是在改版中,新版本应该会给大家带来惊喜的:)

家园新版本功能预览:www.skyeach.com

发表于 作者 大兵 | 0 评论

Because your birthday is special

Because your birthday is special .

Set apart from other days .

Because it should be spent in all the very finest ways ,

This wish is for the joys you're fondest of .

Because you have a special way of sharing warmth and cheer ,

This wish is sent your way with world of love !

发表于 作者 大兵 | 1 评论

新的一年做好一件事

转眼我人生中的第二个本命年过去了,第一个本命年如何度过早已不记得了,当时还没有这种概念,也不在乎。

身边挺多朋友多是属鸡的朋友,去年年初大家讨论到本命年的问题,谈到本命年的忌讳和避邪的方法:)

现在回顾起来去年鸡儿们的命运确是坎坷,多少无辜的同类因禽流感而...

公历新年和农历新年先后到来,给忙碌了一整年的人们带来了两个修整和抖擞的新起点。

对过去的一年不太满意的,可以在公历新年就告诉自己旧的一年已经过去,新的一年有更多的机会和梦想需要完成

对过去的一年依依不舍的,则大可以继续享受这种满足,放松一下自己,到农历春节,在开始迎接新一年的开始...

新的一年,新开始,选择了一个起点,做好这一年中的一件事

没想到自己在06年的二天就要出差,到底要不要就此作为起点呢?伤脑筋。

发表于 作者 大兵 | 2 评论

按照自己的思路回答问题

今天看到了两道据说为微软面试题的问题,其一是海盗分金问题,已经发到论坛中了,推理的过程很有趣,大家有兴趣可以讨论一下;)

其二是:下水道的盖子为什么是圆的?

遇到这种问题我的第一反应是因为圆的覆盖的面积最大,另外圆的无论如何都不可能掉进下水道里,其他形状都有可能掉下去。

然后就没有了... ...看来脑筋已经明显僵化,失去创造力了:(

看看面试这位理查德·范曼的回答:

面试官:现在我们要问一个问题,看看你的创造性思维能力。不要想得太多,运用日常生活中的常识,描述一下你的想法。这个问题是,下水道的井盖为什么是圆的?

范曼:它们并不都是圆的,有些是方的,的确有些圆井盖,但我也看过方的,长方的。

面试官:不过我们只考虑圆形的井盖,他们为什么是圆的?

范曼:如果我们只考虑圆的,那么它们自然是圆的。 (考官:%#¥◎※……)

面试官:我的意思是,为什么会存在圆的井盖?把井盖设计成圆形的有什么特殊的意义吗?

范曼:是有特殊意义,当需要覆盖的洞是圆形时,通常盖子也是圆的。用一个圆形的盖子盖一个圆形的洞,这是最简单的办法。

面试官:你能想到一个圆形的井盖比方形的井盖有哪些优点吗?

范曼:在回答这个问题之前,我们先看看盖子下面是什么。盖子下面的洞是圆的,因为圆柱形最能承受周围土地的压力。而且,下水道出孔要留出足够一个人通过的空间,而一个顺着梯子爬下去的人的横截面基本是圆的,所以圆形自然而然地成为下水道出入孔的形状。圆形的井盖只是为了覆盖圆形的洞口。

面试官:你认为存在安全方面的考虑吗?我的意思是,方形的井盖会不会掉进去,因此造成人身伤害?

范曼:不大可能。有时在一些方形洞口上也会看到方形的盖子。这种盖子比入口大,周围有横挡,通常这种盖子是金属质地,非常重。我们可以想象一下,两英尺宽的方形洞口,1到1.5英寸宽的横挡。为了让井盖掉进去,需要抬起一端,然后旋转30度,这样它就不受横挡的妨碍了,然后再将井盖与地平线成45度角,这时转移的重心才足以让井盖掉下去。是的,方形的井盖的确存在掉下去的可能,但可能性很小,只要对负责开井盖的人稍加培训,他就不会犯这样的错误。从工程学来看,井盖的形状完全取决于它要覆盖的洞口的形状。

面试官:(面有难色)我要与管理层谈点事情。(离开了房间)

10分钟后,面试官回来了。

面试官:我们推荐你立刻去推销部工作。

(理查德·范曼:%#¥◎※,我面试的是管理岗…………)

发表于 作者 大兵 | 3 评论

Google成功的十大黄金准则

成功的公司总有类似的原因,失败的公司各有各的不同。在最新的Newsweek上Google的CEO和顾问提出了十大黄金准则(Google: Ten Golden Rules),收录如下:

  1. Hire by committee
  2. Cater to their every need (Their指的是程序员的)
  3. Pack them in (即共享的办公空间)
  4. Make coordination easy
  5. Eat your own dog food
  6. Encourage creaticity
  7. Strive to reach consensus (Manager的任务是聚合观点而不是断然做决定)
  8. Don't be evil
  9. Data driven decisions
  10. Communicate effectively.
发表于 作者 大兵 | 0 评论

终于解决了,临出差前松了一口气

好在解决了,好开心,可以安心睡觉去了:)

发表于 作者 大兵 | 2 评论

流入猎户座

工作已经将近完成。
晚饭后到直升机平台走走
虽然已经是深秋,在平台上都是穿着短袖活动的
海上的气温并不很低,水的比热容很大,白天天气好晚上的就不会太冷
天色已经很黑,满天的星星

猎户座在南偏东方向,在南油看到的猎户座基本在头顶上
要不是平台的灯光比较亮,星空应该跟漂亮
和身边的工友说着话,恰好看到一颗流星在猎户座上滑过

想起恩雅的这首曲子ORINOCO FLOW,也许也是这么找到创作灵感的吧
我猜...

发表于 作者 大兵 | 1 评论

感受风浪

近来海面上的风浪都比较大,从井口平台回来的时候坐了一次拖轮,一个多钟头的航程像过了大半天那么久。

后面实在晃得难受,昏沉沉的直接在餐厅的长椅上睡着了。

醒来的时候已经回到中心平台下了,晕乎乎的走到后面坐吊篮,一个浪头打来拖轮后面的甲板灌满了海水

穿好救生衣,依然头晕,心里只有一个念头,抱紧吊蓝......

晚上在海面上望上来,春晓中心平台流光四溢,还是挺漂亮的。

瞎想中吊蓝已经上到CEP甲板了

深秋东海海面晚上气温已经很低,就穿了件工衣,又饿又冷,赶紧往生活区里赶

好在餐厅还有饭,居然没有影响到食欲

事实证明,只要吃饱了,我还是不怕风浪的

还有晚上的一千米...

发表于 作者 大兵 | 2 评论
页面导航 下一页