高山流水
msgbartop
动之则分,静之则合,无过不及,随曲就伸。
msgbarbottom

16 九 06 行行色色之一

Tags: , ,

14 九 06 如何在不接网线的情况下使网卡配置生效

How to reserve your network adapter
configration without connecting?

检索词:网卡配置、不接网线、拔掉网线、网卡生效

keywords:network adapter configration、link state、Media
Sensing、connecting
今天老大在笔记本上配置了个vmware,用来安装linux,为了方便,笔记本当然不是随时都插着网线的,但拔掉网线之后,windows
xp里面的网卡的网络配置全部失效了,怎样才能够保证在不接网线的情况下是网卡设置生效呢?
在网上查了些文档,不是很多,绝大部分的解决办法是做一个自连的水晶头,然后插上(如果是千兆网卡还需要将网卡的配置改为100M),这种做法比较无聊啦,哈哈。当然也有解决方法是增加一个虚拟网卡,这个没试过,应该也可以的吧。
最后还是在msdn上找到了答案,其实只需要改动一个注册表值,让系统不检查网络的连接状态即可,具体操作如下:

打开注册表(regedit),找到以下键值:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters
增加一个DWORD项,项名为:DisableDHCPMediaSense,键值设为1,然后重启服务器即可。

原文内容参考如下:

Windows contains the “Media Sensing” feature. You may use
this feature on a Windows-based computer using Transmission Control
Protocol/Internet Protocol (TCP/IP) to detect whether your network
media is in a “link state.” A “link state” is defined as the
physical media connecting or inserting itself on the network. For
example, assuming a 10bt or 100bt physical media, Ethernet network
adapters and hubs typically have a “link” light to indicate the
current connection status. This is the same condition in which
Windows can detect a link. Whenever Windows detects a “down” state
on the media, it removes the bound protocols from that adapter
until it is detected as “up” again. There may be situations where
you may not want your network adapter to detect this state, and you
can configure this by editing the registry.

To prevent your network adapter from detecting the link state,
follow these steps.

Note NetBEUI and IPX do not recognize Media Sense.

1. Use Registry Editor (Regedt32.exe) to view the
following key in the registry:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

Add the following registry value:

Value Name: DisableDHCPMediaSense

Data Type: REG_DWORD -Boolean

Value Data Range: 0, 1 (False, True) Default: 0 (False)

Description: This parameter controls DHCP Media Sense behavior. If
you set this value data to 1, DHCP, and even non-DHCP, clients
ignore Media Sense events from the interface. By default, Media
Sense events trigger the DHCP client to take an action, such as
attempting to obtain a lease (when a connect event occurs), or
invalidating the interface and routes (when a disconnect event
occurs).

2. Restart your computer.

Note In Windows Server 2003, the function which controls
Media Sense was added to the cluster system. Even if the
DisableDHCPMediaSense is not set or 0 (False) is set in the
registry, the cluster system is changing Media Sense into disabled.
Then, because of the system which wants to make Media Sense enable,
the DisableClusSvcMediaSense registry value was introduced in the
SP1. You can set ON/OFF of the control function of the cluster
system by using the following registry subkey:

- Key: HKEY_LOCAL_MACHINE\Cluster\Parameters

- Value Name: DisableClusSvcMediaSense

- Data Type: REG_DWORD -Boolean

- Data Range: 0, 1 (False, True) - Default: 0 (False).

The DisableClusSvcMediaSense is default 0 (False). Therefore, the
control function is ON and Media Sense is disabled. You can set the
DisableClusSvcMediaSense to 1 (True). Then, the control function is
OFF. After that, you can use the DisableDHCPMediaSense registry to
set enable/disable of Media Sense. This is similar to the cluster
environment of the Windows 2000 Server.

Note If you disable the “Media Sensing” feature, you may
experience problems. For example, if you have a computer that has
two network adapters and you disable the “Media Sensing” feature,
if one network adapter does not work, it is unbound. Additionally,
if a default gateway is configured, associated routes are removed
so that all traffic goes through the other network adapter.

In another example, if the “Media Sensing” feature is disabled when
you disconnect the network cable from the computer, the “Local Area
Connection” icon in the notification area displays a “Network cable
is unplugged” status message. Additionally, you receive a “Media
State …..: Cable Disconnected” message when you run the
ipconfig command. However, in this case, the network adapter
is bound to TCP/IP. To verify that the network adapter is bound to
TCP/IP, view the route table. To view the route table, use the
route print command. The route table shows the IP address of
the network adapter. You can also use the ping command to
ping the IP address of your network adaptor to verify that the
network adapter is bound to TCP/IP.

Tags: , ,

12 九 06 实现RSS订阅的两个简单方式

其实,RSS阅读器从服务器获取的就是一个XML文件,所以我们可以通过提供静态XML文件或封装了XML数据的HTTP流方式提供服务。
对于第一种,我想可能是大多数图书馆最方便实施的,只要更新一下原有的信息发布程序(例如新闻系统),在提交新数据的时候,同时更新相应的XML文件,即可实现订阅服务。
然后,这一种方式不适合实现一些更多需求的功能,比如,某读者定义了他只需要的一部分订阅服务,那么我们的推送应该根据该读者的预定义,只提供其感兴趣的内容,这时,就需要以第二种方式,当读者请求的时候,再从数据库中获取相关信息实时发送给他。
现在有很多相关的辅助工具或程序可以很好的利用,ROME是用JAVA写的开源程序,遵循Apache
Software License
,运行环境需要J2SE 1.4+和JDOM
1.0
,它能转换并解析当前的所有聚合格式,当前版本为0.8Beta。
下载 ,教程API文档

Tags: ,

10 九 06 今天是教师节

今天是教师节,周末,年轻人,似乎可以安排些活动,不过却没有。
做了午饭吃后,还是依然坐在办公室的电脑前,这里点点,那里敲敲,时间就这么一点一滴的过去。
办公室8个人,现在陪同我一起在办公室的,和我一样的年轻人,有3个。再想想,哪个周末不也一样这么读过?还有寒假暑假,就多睡会懒觉罢了。
说句实话,作为一名老师,是感到自豪的,但是职业的发展和压力,却也是要一个人耐得住寂寞受得了清苦的。社会太多的焦点,都聚集在了一些名家大师身上,他们有优越的社会地位和收入,但实际上绝大多数的教师,一辈子都默默无闻在自己的工作岗位上,日复一日,年复一年,为家庭,为爱人,为房子消耗着生命。我是绝大多数中的一员,很多时候都在计算着同一个数字,我要工作多少年之后,才有机会买房。
工作两年后,发现自己已经变得现实很多,梦想的空间一缩再缩,莫名其妙的,今天发牢骚了。
呵呵,其实过得蛮快乐,只要不要想太多。

Tags: ,

09 九 06 RSS 2.0 Specification 2:Sample files

<?xml version=”1.0″ ?>

<!– RSS 版本 –>

<rss version=”2.0″>

<channel>

<!–必须的频道节点:title,定义频道名称–>

<title>暨南大学图书馆新闻订阅</title>

<!–必须的频道节点:link,响应频道的网站URL–>

<link>http://lib.jnu.edu.cn/</link>

<!–必须的频道节点:description,频道的描述–>

<description>暨南大学图书馆新闻订阅.</description>

<!–必须频道节点结束–>

<!–以下为可选的频道节点–>

<!–语种:language–>

<language>zh-cn</language>

<!–版权声明:copyright–>

<copyright>Copyright 2006
暨南大学图书馆. All Rights Reserved.</copyright>

<!–负责人EMAIL:managingEditor–>

<managingEditor>jnuzyx@126.com</managingEditor>

<!–技术人员EMAIL:webMaster–>

<webMaster>jnuzyx@126.com</webMaster>

<!–发布时间:pubDate–>

<pubDate>Fri, 08 Sep 2006
18:00:00 GMT+8</pubDate>

<!–最后更新时间:lastBuildDate–>

<lastBuildDate>Fri, 08
Sep 2006 20:00:00 GMT+8</lastBuildDate>

<!–频道所属的分类:category,可多个,要遵循与ITEM级category元素相同的规则,所以一般在此不标注,而在ITEM级标注分类–>

<category>新闻</category>

<!–生成频道的程序名称:generator–>

<generator>JNULRSS
1.0(beta)</generator>

<!–指向RSS格式解释文档的URL:docs,用以向需要了解更多的人介绍RSS的格式情况–>

<docs>http://blogs.law.harvard.edu/tech/rss</docs>

<!–可以忽略的时段:skipHours,0-24–>

<skipHours>0</skipHours>

<!–可以忽略的天:skipDays,星期–>

<skipDays>Sunday</skipDays>

<!–cache生命周期:ttl,分–>

<ttl>60</ttl>

<!–频道的统计图片地址:rating,未用过–>

<rating></rating>

<!–指定rssCloud接口的WEB服务:cloud,rssCloud接口可以用HTTP-POST,XML-RPC或SOAP1.1实现,目的是允许通知注册为cloud的进程频道被更新,从而实现一个轻量级的发布订阅协议,这个还不是很明白:(–>

<cloud domain=”rpc.sys.com”
port=”80″ path=”/RPC2″ registerProcedure=”myCloud.rssPleaseNotify”
protocol=”xml-rpc” />

<!–频道LOGO:image,jpg,png,gif格式,3个必选子节点及3个可选子节点–>

<!–image节点开始–>

<image>

<!–image节点必选子节点–>

<!–LOGO文件的URL地址:url–>

<url>http://lib.jnu.edu.cn/rss/img/logo.jpg</url>

<!–LOGO标题:title,相当于alt属性,应与频道的title节点值相同–>

<title>暨南大学图书馆新闻订阅</title>

<!–LOGO的链接:link,应与频道的link节点值相同–>

<link>http://lib.jnu.edu.cn/</link>

<!–image节点可选子节点–>

<!–LOGO的宽度:width,默认为88,最大为144,单位为像素–>

<width>88</width>

<!–LOGO的高度:height,默认为31,最大为400,单位为像素–>

<height>31</height>

<!–LOGO描述:description,未用过–>

<description></description>

</image>

<!–image节点结束–>

<!–频道可嵌入的textInput表单,包含4个可选子节点,可以用它提供一个搜索引擎输入框,或让读者提供反馈信息,不常用。–>

<!–textInput节点开始–>

<textInput>

<!–表单的提交按钮的标签:title–>

<title>搜索</title>

<!–表单的文本输入区的描述:description–>

<description>百度一下</description>

<!–表单的文本输入区的名称:name–>

<name>关键词</name>

<!–表单提交的URL
:link–>

<link>http://www.baidu.com/s</link>

</textInput>

<!–textInput节点结束–>

<!–可选频道节点结束–>

<!–必须的,可重用的频道节点:item,频道的项目,一个条目可表示一条记录–>

<item>

<!–所有子节点都是可选的,但应该包含title,description子节点–>

<!–标题:title–>

<title>置顶新闻:9月14日学而优书店现场选书通知</title>

<!–记录的URL:link–>

<link>http://lib.jnu.edu.cn/show.jsp?ID=720</link>

<!–描述:description,可以通过使用CDATA部件,告诉解析器忽略描述内容中的HTML解释–>

<description><![CDATA[<a
href="http://lib.jnu.edu.cn/show.jsp?ID=720">查看详细报道</a>]]></description>

<!–作者的EMAIL:author–>

<author>ocat@jnu.edu.cn</author>

<!–分类:category,可以是一个或多个–>

<category>通知</category>

<!–评论地址:comments–>

<comments>http://lib.jnu.edu.cn/feedback/showfeedback.jsp?sysname=新闻系统&amp;itemid=720</comments>

<!–附加的媒体对象:enclosure,有三个必须属性,url属性,length指出它的字节大小,type属性指出它的标准MIME类型–>

<!–<enclosure
url=”http://lib.jnu.edu.cn/upfile/vpn.wmv
length=”6742080″ type=”audio/mpeg” />–>

<!–rss来源频道名称:source,从item的title衍生而来,有一个必须包含的属性url,链接到XML序列化源,作用是提高连接的声望–>

<source
url=”http://lib.jnu.edu.cn/rss/news.xml”>jnul
news</source>

<!–item发布时间:pubDate–>

<pubDate>Fri,
08 Sep 2006 20:00:00 GMT+8</pubDate>

<!–唯一确定item的字符串:guid–>

<guid>http://lib.jnu.edu.cn/show.jsp?ID=720</guid>

</item>

<item>

<title>好消息:西文全文电子期刊统一检索系统正式推出使用</title>

<description>西文电子期刊导航</description>

</item>

<!–item结束–>

</channel>

</rss>

Tags: ,