﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-Avlee's Blog</title><link>http://www.cnblogs.com/avlee/</link><description>爱的对立面不是恨，而是漠不关心。</description><language>zh-cn</language><lastBuildDate>Thu, 28 Aug 2008 06:10:43 GMT</lastBuildDate><pubDate>Thu, 28 Aug 2008 06:10:43 GMT</pubDate><ttl>60</ttl><item><title>ArcGIS Server Manager 登录失败的解决方法</title><link>http://www.cnblogs.com/avlee/archive/2008/08/07/ArcGISServer_Login_Error.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Thu, 07 Aug 2008 02:40:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2008/08/07/ArcGISServer_Login_Error.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/1262633.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2008/08/07/ArcGISServer_Login_Error.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/1262633.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/1262633.html</trackback:ping><description><![CDATA[<p>最近又装起了ArcGIS Server，使用的是9.2的原始版本。记得很早以前安装的时候，也碰到过登录失败的问题，可是怎么也想不起来当时是怎么解决的，折腾很久终于解决了，貌似是ArcGIS Server的一个Bug，还被很多论坛上的解决方案误导了很长时间。所以还是把它记录下来比较好，免得以后再浪费时间，也可以给大家一个参考。</p>
<p>&nbsp;</p>
<p>如果在http://localhost/ArcGIS/Manager/Login.aspx页面登录提示无法登陆的时候，多半是你输入的用户名不属于agsadmin和agsusers用户组，添加进来即可。</p>
<p>这个时候要注意用户的格式应该是：计算机名\用户名。</p>
<p>&nbsp;</p>
<p>但是此时我还是不能使用安装ArcGIS Server时创建的默认用户ArcGISWebServices登录，只能用我原来登录Windows系统的帐户登录。<br />
</p>
<p>&nbsp;</p>
<p>关键是后面，登录后提示一个&#8220;<em>未将对象</em>引用设置到对象的实例&#8221;的Server Error。</p>
<p>&nbsp;</p>
<p>解决这个问题要注意两个地方：</p>
<p>1、不能使用你原来登录windows系统的帐户登录ArcGIS Server Manager，即使你将它添加到agsadmin和agsusers用户组也不行。</p>
<p>2、要使用在安装的时候为ArcGIS Server Manager创建的帐户登录，默认为ArcGISWebServices，该账户在安装的时候默认被添加到agsadmin和agsusers用户组了，但是你还必须将该账户添加到Administrators用户组。 </p><img src ="http://www.cnblogs.com/avlee/aggbug/1262633.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41931/" target="_blank">[新闻]GC2008：星际争霸2进程报告 微调进程延续</a>]]></description></item><item><title>利用ArcSDE C API读取ArcSDE Raster数据</title><link>http://www.cnblogs.com/avlee/archive/2007/08/27/arcsderaster.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Mon, 27 Aug 2007 07:24:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2007/08/27/arcsderaster.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/840233.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2007/08/27/arcsderaster.html#Feedback</comments><slash:comments>40</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/840233.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/840233.html</trackback:ping><description><![CDATA[摘要: 最近由于项目需求，在我们的WebGIS平台中增加对ArcSDE Raster数据的访问功能，本来早就想写点这方面的文章，但由于忙于新产品开发，所以只列出了代码片断。得到了合金枪头的指点，在此表示感谢。&nbsp;&nbsp;<a href='http://www.cnblogs.com/avlee/archive/2007/08/27/arcsderaster.html'>阅读全文</a><img src ="http://www.cnblogs.com/avlee/aggbug/840233.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41930/" target="_blank">[新闻]科学家在世界最大对撞机中观察到首批粒子</a>]]></description></item><item><title>倡议以赞助的形式成立一个博客园的开发团队（博客园商业化尚早）</title><link>http://www.cnblogs.com/avlee/archive/2007/07/11/813893.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Wed, 11 Jul 2007 04:40:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2007/07/11/813893.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/813893.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2007/07/11/813893.html#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/813893.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/813893.html</trackback:ping><description><![CDATA[摘要: 博客园商业化尚早，建议大家以后多讨论一下成立博客园开发团队所面临的问题以及解决办法&nbsp;&nbsp;<a href='http://www.cnblogs.com/avlee/archive/2007/07/11/813893.html'>阅读全文</a><img src ="http://www.cnblogs.com/avlee/aggbug/813893.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41929/" target="_blank">[新闻]阿里巴巴利润增1.36倍</a>]]></description></item><item><title>在WebGIS中试用Microsoft Silverlight有感</title><link>http://www.cnblogs.com/avlee/archive/2007/05/18/751236.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Fri, 18 May 2007 03:12:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2007/05/18/751236.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/751236.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2007/05/18/751236.html#Feedback</comments><slash:comments>10</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/751236.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/751236.html</trackback:ping><description><![CDATA[经过一段时间的测试对比，想要用<a href="http://www.silverlight.net/">Silverlight</a>来代替原来的SVG应用还有很多难以克服的困难。<br><br>显然Silverlight是微软以自己的方式（xaml）来重新定义SVG1.2已经定义过的功能，虽然很讨厌微软经常干这样的事情，但是总算在IE上有个弥补SVG不被Adobe支持后的解决方案了。<br><br>不过第一次采用微软的试用产品，还真是感觉痛不欲生啊。其文档简单不说，连个roadmap都没有，很多功能只能期待。<br>虽然Silverlight目前还很不完善，但是Silverlight和.Net结合起来后，相信会走的很远。<br><br><br><br><img src ="http://www.cnblogs.com/avlee/aggbug/751236.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41928/" target="_blank">[新闻]Google Gears覆盖四大浏览器 Safari版推出</a>]]></description></item><item><title>The MSVC project of the cairo library(version 1.4.6)</title><link>http://www.cnblogs.com/avlee/archive/2007/05/02/cairo-msvc.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Wed, 02 May 2007 14:17:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2007/05/02/cairo-msvc.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/734729.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2007/05/02/cairo-msvc.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/734729.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/734729.html</trackback:ping><description><![CDATA[This is the VS2003.net solution for the cairo library.<br><br>You can use this solution to build the win32 dlls of the cairo library.<br>Features included are:<br>
<ul>
    <li>image surface(PNG, need the <a href="http://www.libpng.org/pub/png/libpng.html">libpng</a> library.)</li>
</ul>
<ul>
    <li>win32 surface</li>
</ul>
<ul>
    <li>win32 fonts</li>
</ul>
<ul>
    <li>SVG surface</li>
</ul>
<ul>
    <li>PDF surface</li>
</ul>
<ul>
    <li>PS surface</li>
</ul>
<br>Only the project files you can download from here, please get the origin source code of the cairo library from the site <a href="http://www.cairographics.org/">http://www.cairographics.org</a>.<br><br>The current solution is build with cairo 1.4.6, this is a stable version since 1.2.4.<br>Download the current version for the cairo 1.4.6 from here:&nbsp; <a href="http://www.cnblogs.com/Files/avlee/cairo-1.4.6-win32-msvc.zip">cairo-1.4.6-win32-msvc.zip</a> .<br><br>Usage: <br>
<ol>
    <li>Copy the "msvc" folder into the root the cairo library folder;</li>
    <li>Copy the "cairo-features.h" file into the "src" folder;</li>
    <li>Open the project file to build.</li>
</ol>
<br><br><img src ="http://www.cnblogs.com/avlee/aggbug/734729.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41927/" target="_blank">[新闻]Internet Explorer 8 Beta 2 发布</a>]]></description></item><item><title>WebGIS团队启用二级域名</title><link>http://www.cnblogs.com/avlee/archive/2007/04/22/723197.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Sun, 22 Apr 2007 14:53:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2007/04/22/723197.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/723197.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2007/04/22/723197.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/723197.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/723197.html</trackback:ping><description><![CDATA[最进发现使用一些聚合工具（如Google reader）无法正确获取WebGIS团队的内容。<br><br>和博客园管理团队联系后，WebGIS团队将启用新的二级域名，以后大家可以直接通过<a href="http://webgis.cnblogs.com/">http://webgis.cnblogs.com</a>来访问WebGIS团队。<br><br>使用聚合工具请更新地址为<a href="http://webgis.cnblogs.com/rss.aspx">http://webgis.cnblogs.com/rss.aspx</a><br><br>感谢博客园的大力工作！<br><br><img src ="http://www.cnblogs.com/avlee/aggbug/723197.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41924/" target="_blank">[新闻]中国软件协会：SAP羞辱国产软件是不正当竞争</a>]]></description></item><item><title>Building the cairo graphic library using msvc</title><link>http://www.cnblogs.com/avlee/archive/2007/03/07/cairo-win32.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Wed, 07 Mar 2007 05:22:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2007/03/07/cairo-win32.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/666568.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2007/03/07/cairo-win32.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/666568.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/666568.html</trackback:ping><description><![CDATA[Cairo图形库1.4版终于release了，性能和稳定性都大大地增强了，特在此记录此消息来祝贺1.4版的发布。<br><br>关于Cairo图形库的介绍，可以参见<a title="http://www.cairographics.org/" href="http://www.cairographics.org/">http://www.cairographics.org/</a>。<br><br>Firefox2的SVG实现和Firefox3的图形引擎就是基于Cairo的，Cairo具有比较友好的版权限制，有兴趣的朋友可以体验一下其丰富的2D矢量图形绘制功能。<br><br>对于大多使用msvc的人来说，Cairo目前没有一个快捷的编译方式，我在这里提供一个编译win32版本的Cairo库的一个工程文件。<a title="Cairo1.4 win32 project" href="http://www.cnblogs.com/Files/avlee/libcairo.rar"></a><br><br>该工程不支持FreeType字库，因为Cairo使用FreeType字库时需要FontConfig的支持，我没有在win32下使用FontConfig的经验，所以为了简单起见，直接使用win32字库。<br><br>使用该win32工程编译的Cairo支持的输出格式包括：<br>
<ul>
    <li>Image surface(PNG) 输出为PNG格式的图像；</li>
    <li>PDF surface 输出为PDF文件；</li>
    <li>PS surface 输出为用于打印的Postscript文件；</li>
    <li>SVG surface 输出为SVG格式文件。</li>
</ul>
更新至1.4.6版本，该版本是自1.2.4版本以来最稳定的版本，该版本也修复了关于使用MSVC编译的问题，所以以后只提供工程文件下载。<br>更新页面转至：<a href="http://www.cnblogs.com/avlee/archive/2007/05/02/cairo-msvc.html">http://www.cnblogs.com/avlee/archive/2007/05/02/cairo-msvc.html</a>。<br><br><br><img src ="http://www.cnblogs.com/avlee/aggbug/666568.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41923/" target="_blank">[新闻]福布斯：Facebook网站十大最火爆游戏</a>]]></description></item><item><title>Adobe 将停止对Adobe SVG Viewer的支持！</title><link>http://www.cnblogs.com/avlee/archive/2006/10/10/svgeol.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Tue, 10 Oct 2006 04:56:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2006/10/10/svgeol.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/524505.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2006/10/10/svgeol.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/524505.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/524505.html</trackback:ping><description><![CDATA[Adobe近日宣布将于2008年1月1日停止对Adobe SVG Viewer的支持，可以查看原文：<a title="http://www.adobe.com/svg/eol.html" href="http://www.adobe.com/svg/eol.html">http://www.adobe.com/svg/eol.html</a><br>这个不好的消息终于还是发布了，虽然现在很多浏览器都开始内部支持SVG，但是无疑Adobe SVG Viewer还是目前最好的SVG浏览器。<br><br>不过还好，现在Firefox和Opera都开始提供了对SVG的本地支持，遗憾的是IE7并没有提供对SVG的支持。不过从一些小道消息听说IE开发组已经有一个可以很好的支持SVG的Engine，可能会在下一个版本中加入对SVG的支持，或许是IE7.2，也或许是8...<br><br><br><br><img src ="http://www.cnblogs.com/avlee/aggbug/524505.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41922/" target="_blank">[新闻]谷歌允许用户评论搜索结果调整顺序</a>]]></description></item><item><title>SVG Authoring Guidelines[转]</title><link>http://www.cnblogs.com/avlee/archive/2006/02/14/SVGAuthoring.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Tue, 14 Feb 2006 05:17:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2006/02/14/SVGAuthoring.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/330392.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2006/02/14/SVGAuthoring.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/330392.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/330392.html</trackback:ping><description><![CDATA[转自：<a target="_blank" title="SVG Authoring Guidelines" href="http://jwatt.org/svg/authoring/">SVG Authoring Guidelines</a><br><br>在这篇文章里，作者列出了出现在很多SVG作品中的坏习惯，这些都可能会造成一些兼容的问题，只是Adobe的SVG Viewer忽略了这些错误（非标准的东西）。现在SVG还在发展初期，希望大家不要像在写HTML的时候被IE养成坏习惯一样给Adobe SVG Viewer养成坏习惯。<br>目前Adobe对SVG的支持还是未知数，如果大家希望自己的基于SVG的作品能有继续在其他SVG的实现上运行，如Mozilla, Batik，那么请看看我转载的这篇文章。<br><p class="important">This is a work in progress. Please <a href="mailto:jwatt@jwatt.org">send me your feedback and suggestions</a>!</p>

    <p>
There are a lot of mistakes in the SVG documents currently found on the
Web. Because Adobe's SVG Viewer ignores many of these errors, the
maintainers of these documents usually don't realise when they're doing
something wrong. Unfortunately, the result is that far too often SVG on
the Web doesn't work in Mozilla, Batik or one of the other SVG
implementations. It is important that these problems are addressed as
soon as possible to prevent them from propagating into authoring tools
and the SVG documents that people will write in the future. </p>

    <p> This document highlights some of the most common
mistakes made in SVG content, and explains what SVG maintainers can do
to fix them. The hope is that the SVG community will read this
document, and that individual members of the community will do what
they can to make sure that SVG on the Web is as portable as possible.
Please spread the word. If you see others making any of the mistakes
described here, please let them know so that they can correct them.
Even more important, <b>if you know of SVG authoring tools that make these mistakes please contact the vendor and let me know</b>. Feel free to link to this document, and please send me your feedback. My email address is <a href="mailto:jwatt@jwatt.org">jwatt@jwatt.org</a>.
    </p>


    <h2>Contents</h2>

    <ul><li><a href="http://jwatt.org/svg/authoring/#server-configuration">Configure your server for SVG</a></li><li><a href="http://jwatt.org/svg/authoring/#doctype-declaration">Don't include a DOCTYPE declaration</a></li><li><a href="http://jwatt.org/svg/authoring/#namespace-binding">Bind the required namespaces</a></li><li><a href="http://jwatt.org/svg/authoring/#the-style-attribute">Avoid the 'style' attribute where possible</a></li><li><a href="http://jwatt.org/svg/authoring/#specifying-units">Specify units when assigning lengths to properties</a></li><li><a href="http://jwatt.org/svg/authoring/#namespace-aware-methods">Use namespace aware DOM methods</a></li><li><a href="http://jwatt.org/svg/authoring/#asv-getters-and-setters">Don't use Adobe's getter and setter extensions</a></li></ul>

<!--

http://svg.jibbering.com/svg/2005-08-10.html#T13-27-27

<sbp> jwatt: it'd be nice if you threw in a link to http://www.w3.org/TR/SVG-access/

<heycam> include all required attributes on elements
<heycam> asv may not mind a width attribute left off a rect, but batik will throw a hissy fit

<darobin> jwatt: you might want to say something about using <switch>
<darobin> for version fallbacks

<heycam> i thought they were there because that's how the mozilla javascript engine mapped JS attributes into get/set methods in the host objects
<heycam> at least, that's the reason for their existence in batik
<darobin> heycam: it was N4, not moz

-->

    <h2 id="server-configuration">Configure your server for SVG</h2>

    <p>
This isn't really an issue with SVG content itself, but nevertheless,
server misconfiguration is a very common reason for SVG failing to
load. For security and correctness reasons, some browsers decides how
to handle files by looking at the HTTP headers the server sends with
them. If your server isn't configured to send the correct headers with
the SVG files it serves, then a browser like Mozilla won't treat those
files as SVG. Instead it will most likely show the markup of the files
as text or encoded garbage, or even ask the viewer to choose an
application to open them. For normal SVG files, servers should send the
HTTP header: </p>

    <pre>Content-Type: image/svg+xml<br></pre>

    <p>
      For gzipped SVG files, servers should send the HTTP headers:
    </p>

    <pre>Content-Type: image/svg+xml<br>Content-Encoding: gzip<br></pre>

    <p>
      You can check that your server is sending the correct HTTP headers with
      your SVG files by using a site such as <a href="http://web-sniffer.net/">web-sniffer.net</a>. Submit the URL of one
      of your SVG files and look at the HTTP <b>response</b> headers. If you
      find that your server is not sending the headers with the values given
      above, then you should contact your Web host. If you have problems
      convincing them to correctly configure their servers for SVG, there may
      be ways to do it yourself. See the <a href="http://svg-whiz.com/wiki/index.php?title=Server_Configuration">server
      configuration page</a> on the SVG wiki for a range of simple solutions.
    </p>

<!--
    <p>
      Note that just because Internet Explorer treats the SVG files on your
      server as SVG doesn't mean that your server is correctly configured.
      Internet Explorer decides how to treat files based on their file name
      extension, not the HTTP headers sent with them. If the extension is
      ".svg" or ".svgz" it will treat the file as SVG. Mozilla does not do this
      because it has resulted in security holes in Internet Explorer.
    </p>
-->

<!--
    <p>
      For more information on how Mozilla handles content see the <a
      href="http://www.mozilla.org/docs/web-developer/mimetypes.html">MIME type
      document on mozilla.org</a>.
    </p>
-->

    <h2 id="doctype-declaration">Don't include a DOCTYPE declaration</h2>

    <p>
      XML Document Type Definitions, or DTDs for short, are a feature of XML
      used to validate the contents of a document. A DTD is associated with a
      document by placing a DOCTYPE declaration in the document. The following
      line is an example of an SVG DOCTYPE declaration.
    </p>

    <pre>&lt;!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"<br>    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"&gt;<br></pre>

    <p>
      Unfortunately the SVG DTDs are a source of so many issues that the SVG
      WG has decided not to write one for the upcoming SVG 1.2 standard. In
      fact SVG WG members are even <a href="http://groups.yahoo.com/group/svg-developers/message/48562">telling people not to use a DOCTYPE declaration</a> in SVG 1.0 and 1.1
      documents. Instead always include the '<a href="http://www.w3.org/TR/SVG/struct.html#SVGElementVersionAttribute">version</a>' and '<a href="http://www.w3.org/TR/SVG/struct.html#SVGElementBaseProfileAttribute">baseProfile</a>' attributes on the root <code>&lt;svg&gt;</code> tag,
      and assign them appropriate values as in the following example.
    </p>

    <pre>&lt;svg version="1.1"<br>     baseProfile="full"<br>     xmlns="http://www.w3.org/2000/svg"<br>     xmlns:xlink="http://www.w3.org/1999/xlink"<br>     xmlns:ev="http://www.w3.org/2001/xml-events"&gt;<br></pre>

    <p>
      If for some reason you want to use the inline features of DOCTYPE
      declarations (to create entities, etc.), simply omit the public and
      system identifiers. Your DOCTYPE declaration should then look like this.
    </p>

    <pre>&lt;!DOCTYPE svg [<br>  &lt;!-- entities etc. here --&gt;<br>]&gt;<br></pre>

    <h2 id="namespace-binding">Bind the required namespaces</h2>

    <p>
SVG is a namespaced XML dialect, and as a consequence all the XML
dialects used in your SVG documents must be bound to their namespace as
specified in the <a href="http://www.w3.org/TR/xml-names11/">Namespaces in XML</a>
recommendation. It is sensible to bind the SVG and XLink namespaces at
a minimum, and possibly also the XML Events namespace. Even if you
don't use XLink or XML Events in the current incarnations of some of
your SVG documents, including the bindings will prevent annoying errors
if you decide to use them later and forget to add the bindings. This
simply requires you to include the following three attributes on the
root &lt;svg&gt; tag in your SVG documents. </p>

    <pre>&lt;svg xmlns="http://www.w3.org/2000/svg"<br>     xmlns:xlink="http://www.w3.org/1999/xlink"<br>     xmlns:ev="http://www.w3.org/2001/xml-events"&gt;<br></pre>

    <p>
      Be careful not to type <code>xmlns:svg</code> instead of just <code>xmlns</code>
when you bind the SVG namespace. This is an easy mistake to make, but
one that can break everything. Instead of making SVG the default
namespace, it binds it to the namespace prefix 'svg', and this is
almost certainly not what you want to do in an SVG file. A standards
compliant browser will then fail to recognise any tags and attributes
that don't have an explicit namespace prefix (probably most if not all
of them) and fail to render your document as SVG. </p>

<!-- strike-through 
    <pre>
&lt;svg xmlns:svg="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
</pre>
-->

    <a name="avoid-css"><!-- legacy anchor -->
    <h2 id="the-style-attribute">Avoid the 'style' attribute where possible</h2>
    </a>

    <p>
      It is quite common to see the <code>style</code> attribute used to specify properties in SVG. For example, you may see source code that specifies the <code>fill</code> and <code>stroke</code> properties as follows:
    </p>

    <pre>&lt;circle style="fill:red; stroke:blue;" ... /&gt;<br></pre>

    <p>
      Usually this is simply gratuitous use of the <code>style</code> attribute, and something that should be avoided. Contrary to popular belief the <code>style</code> attribute (note, that's <em>attribute</em>, not <em>element</em>)
doesn't separate content from presentation, and unless you need to
override properties set by a CSS selector, it is best to use the SVG
formatting attributes instead. In other words it would be better to
rewrite the previous code snippet as: </p>

    <pre>&lt;circle fill="red" stroke="blue" ... /&gt;<br></pre>

    <p> Using the formatting attributes avoids the pitfalls
that can be encountered when using CSS in SVG (see the following
section, for example) and is generally considered to be better style.
Unlike CSS and the <code>style</code>
attribute, the formatting attributes are also supported in SVG Tiny, if
that matters to you. Unfortunately many SVG authoring tools and human
authors still make unnecessary use of the <code>style</code> attribute.
    </p>

    <!--h2 id="avoid-css">Avoid using CSS where it isn't required</h2>

    <p>
      The SVG specification doesn't support CSS in SVG Tiny, so CSS isn't supported in some SVG user agents. Unless you really need to use CSS, it is best to avoid it. Especially avoid the 'style' attribute. In other words, try not to write code like this:
    </p>

    <pre>
&lt;circle style="fill:red; stroke:blue;" ... /&gt;
</pre>

    <p>
      Instead use the SVG formatting attributes like this:
    </p>

    <pre>
&lt;circle fill="red" stroke="blue" ... /&gt;
</pre>

    <p>
      CSS can have its uses in SVG, but unfortunately many SVG authoring tools (and human authors) still make unnecessary use of CSS.
    </p--><!-- darobin: unfortunately people are used to "separating content from presentation" as they do in HTML -->



    <a name="css-and-units"><!-- legacy anchor -->
    <h2 id="specifying-units">Specify units when assigning lengths to properties</h2>
    </a>

    <p>
      SVG uses styling properties to describe many of its document parameters such as <code>fill</code> and <code>stroke-width</code>.
These properties can be set by CSS declarations or by presentation
attributes (XML attributes that share the same name as the property and
map to their corresponding CSS properties if the implementation
supports CSS). For example, the <code>display</code> property is set on a circle by both:
    </p>

    <pre>&lt;circle style="display:none;" ...&gt;<br></pre>

    <p>
      and:
    </p>

    <pre>&lt;circle display="none" ...&gt;<br></pre>

    <p>
      For most properties there should be few interoperability problems, but frustratingly when properties are assigned a <em>length</em>
the visual result can be completely different in the various SVG
implementations. The problem arises because the SVG specification
allows units to be omitted from lengths (in which case the lengths'
units are the units of the current coordinate system (user units)),
while on the other hand the CSS specification absolutely requires units
to be <em>explicity</em> specified for all length values. The question
is, are units required for lengths assigned to properties in SVG or
not? Which specification takes precedence? </p>

    <p> Unfortunately, this issue is a lot more compex
than it first seems, and the answers to these questions are still
disputed. The result is that implementations don't agree. Some require
units, while others don't. The only way to avoid problems is to always
specify a unit when assigning lengths to properties. Happily, in SVG,
px units are defined to be equivalent to the units established by the
current coordinate system (user units). In other words, wherever you
would otherwise have omitted the unit from a length assigned to a
property, use the px unit instead. For example, instead of writing: </p>

    <pre>&lt;text stroke-width="2" style="font-size:20;" ...&gt;<br></pre>

    <p>
      write:
    </p>

    <pre>&lt;text stroke-width="2<strong>px</strong>" style="font-size:20<strong>px</strong>;" ...&gt;<br></pre>

    <p>
      Note that units are only required for properties. Plain attributes such as the <code>width</code> or <code>height</code> attributes on the <code>&lt;rect&gt;</code>
tag do not require a unit since they do not map to a CSS property. They
can simply be assigned a number and it implicitly has the units of the
current coordinate system. </p>

    <p>
      According to the <a href="http://www.w3.org/TR/SVG11/propidx.html">SVG 1.1 Property Index</a>, there are only eight properties applicable to SVG 1.1 that accept a length value: <a href="http://www.w3.org/TR/SVG11/painting.html#StrokeWidthProperty">stroke-width</a>, <a href="http://www.w3.org/TR/SVG11/painting.html#StrokeDashoffsetProperty">stroke-dashoffset</a>, <a href="http://www.w3.org/TR/SVG11/text.html#FontProperty">font</a>, <a href="http://www.w3.org/TR/SVG11/text.html#FontSizeProperty">font-size</a>, <a href="http://www.w3.org/TR/SVG11/text.html#BaselineShiftProperty">baseline-shift</a>, <a href="http://www.w3.org/TR/SVG11/text.html#SpacingProperties">kerning</a>, <a href="http://www.w3.org/TR/SVG11/text.html#SpacingProperties">letter-spacing</a> and <a href="http://www.w3.org/TR/SVG11/text.html#SpacingProperties">word-spacing</a>. It is these properties that you should be careful to always specify a length for.
    </p>

    <!--p>
      and from the CSS2 (not CSS2.1) spec the following properties take <length>s (those relevant to SVG are listed above)

      width, height, font-size, line-height, vertical-align, marker-offset, letter-spacing, word-spacing, 
    </p-->

    <h2 id="namespace-aware-methods">Use namespace aware DOM methods</h2>

    <p>
      The <a href="http://www.w3.org/TR/REC-DOM-Level-1/">DOM Level 1</a> recommendation was created before the <a href="http://www.w3.org/TR/REC-xml-names/">original Namespaces in XML</a>
recommendation was released, therefore DOM1 isn't namespace aware. This
causes problems for namespaced XML such as SVG. To resove these
problems, <a href="http://www.w3.org/TR/DOM-Level-2-Core/">DOM Level 2 Core</a> added namespace aware equivalents of all the applicable DOM Level 1 methods. When scripting SVG <a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#Namespaces-Considerations">it is important to use the namespace aware methods</a>.
The table below lists the DOM1 methods that shouldn't be used in SVG
along with their equivalent DOM2 counterparts that should be used
instead. </p>

    <table>
      <tbody><tr>
        <th>DOM1 (don't use)</th>
        <th>DOM2 (use these instead!)</th>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-createAttribute">createAttribute</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrAttrNS">createAttributeNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-createElement">createElement</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-DocCrElNS">createElementNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-getAttributeNode">getAttributeNode</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElGetAtNodeNS">getAttributeNodeNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-getAttribute">getAttribute</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElGetAttrNS">getAttributeNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-getElementsByTagName">getElementsByTagName</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getElBTNNS">getElementsByTagNameNS</a> (also <a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-A6C90942">added to Element</a>)</td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-getNamedItem">getNamedItem</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-getNamedItemNS">getNamedItemNS</a></td>
      </tr>


      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#">hasAttribute</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElHasAttrNS">hasAttributeNS</a></td>
      </tr>


      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-removeAttribute">removeAttribute</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElRemAtNS">removeAttributeNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-removeNamedItem">removeNamedItem</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-removeNamedItemNS">removeNamedItemNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-setAttribute">setAttribute</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAttrNS">setAttributeNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-setAttributeNode">setAttributeNode</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-ElSetAtNodeNS">setAttributeNodeNS</a></td>
      </tr>
      <tr>
        <td><a href="http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-setNamedItem">setNamedItem</a></td>
        <td><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-setNamedItemNS">setNamedItemNS</a></td>
      </tr>
    </tbody></table>

    <p>
The first argument for all the DOM2 namespace aware methods must be the
"namespace name" of the element or attribute in question. For SVG <strong>elements</strong> this is 'http://www.w3.org/2000/svg'. However, note carefully: the <a href="http://www.w3.org/TR/xml-names11/#defaulting">Namespaces in XML 1.1</a> recommendation states that the namespace name for attributes without a prefix does not have a value. In other words <strong>you must use null as the namespace name for SVG attributes</strong>. As a result, to create an SVG 'rect' <strong>element</strong> using createElementNS you must write:
    </p>

    <pre>createElementNS('http://www.w3.org/2000/svg', 'rect');<br></pre>

    <p>
      However, to retrieve the value of the 'x' <strong>attribute</strong> on an SVG 'rect' element you must write:
    </p>

    <pre>getAttributeNS(<strong>null</strong>, 'x');<br></pre>

    <p> Note that this is not the case for attributes from
other (non-SVG) namespaces such as the xlink:href attribute which use a
namespace prefix. Since it has a namespace prefix in the markup
("xlink") it's namespace name is the value that was assigned to that
prefix, 'http://www.w3.org/1999/xlink'. Hence to get the value of the
xlink:href attribute of an 'a' element in SVG you would write: </p>

    <pre>getAttributeNS('http://www.w3.org/1999/xlink', 'href');<br></pre>

    <p>
      In summary the rule is simple. For elements with or without a namespace prefix, and for attributes <strong>with</strong> a namespace prefix, the namespace name is the namespace URI of the element/attribute in question. For attributes <strong>without</strong> a namespace prefix the namespace name is null.
    </p>

    <h2 id="asv-getters-and-setters">Don't use Adobe's getter and setter extensions</h2>

    <p>
Long, long ago when Adobe first released their SVG viewer plug-in,
Netscape 4 still had enough users that it was important to be
compatible with it. To do this it seems it was necessary to extend the
ECMAScript interfaces and provide corresponding getters and setters for
all the properties defined by the specification. As a result in ASV it
is possible to write code like this: </p>

<!-- <a href="http://support.adobe.com/devsup/devsup.nsf/docs/50530.htm">necessary to extend the ECMAScript interfaces</a> -->

    <pre>evt.getTarget().getOwnerDocument().getDocumentElement();<br></pre>

    <p>
      when the DOM and SVG specifications actually define properties, not methods, so the correct way to write this code is:
    </p><p>

    </p><pre>evt.target.ownerDocument.documentElement;<br></pre>

    <p> The problem is that no one else supports ASV's getter
and setter extensions. Scripts that uses them will not work in other
SVG implementations. Happily Netscape 4 is now irrelevant for most of
us, and since ASV supports the properties too, new SVG scripts can
conform to the standards and work in all SVG implementations by using
the properties. (In fact old code could, and should, be updated too.) </p>

    <p> It is difficult to give a list of what is and
isn't an ASV extension since there are so many properties. If you
aren't familiar enough with the specifications to know which getters
and setters are defined by the W3C and which are ASV extensions, be
sure to test your scripts using another SVG implementation such as
Mozilla Firefox or Batik. If you get errors relating to getters or
setters try using properties instead and see if that fixes things. You
can also search for getter and setter names in the <a href="http://www.w3.org/TR/SVG/idl.html">SVG</a>, <a href="http://www.w3.org/TR/DOM-Level-2-Core/idl-definitions.html">DOM2 Core</a>, <a href="http://www.w3.org/TR/DOM-Level-2-Events/idl-definitions.html">DOM2 Events</a> and <a href="http://www.w3.org/TR/DOM-Level-2-Style/idl-definitions.html">DOM2 Style</a> IDL. If you can't find them in any of those documents they probably aren't part of any W3C standard.
    </p>

    <hr>

    <address class="author">
      <a href="mailto:jwatt@jwatt.org">Jonathan Watt</a>
    </address><br><img src ="http://www.cnblogs.com/avlee/aggbug/330392.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41921/" target="_blank">[新闻]Internet 另一超级漏洞被公布</a>]]></description></item><item><title>ArrayList.ToArray(Type)  Or ArrayList.CopyTo(Array)</title><link>http://www.cnblogs.com/avlee/archive/2006/01/05/311447.html</link><dc:creator>Avlee</dc:creator><author>Avlee</author><pubDate>Thu, 05 Jan 2006 04:35:00 GMT</pubDate><guid>http://www.cnblogs.com/avlee/archive/2006/01/05/311447.html</guid><wfw:comment>http://www.cnblogs.com/avlee/comments/311447.html</wfw:comment><comments>http://www.cnblogs.com/avlee/archive/2006/01/05/311447.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/avlee/comments/commentRss/311447.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/avlee/services/trackbacks/311447.html</trackback:ping><description><![CDATA[<P>转自：<A title="ArrayList.ToArray(Type) usage" href="http://blogs.geekdojo.net/richardhsu/archive/2003/11/08/268.aspx">http://blogs.geekdojo.net/richardhsu/archive/2003/11/08/268.aspx</A><BR><BR>I was using ArrayList.CopyTo(Array) to convert arraylist to a type[] array. </P>
<P>I thought ArrayList.ToArray(Type) was for intrinsic types (int, string etc.) but forgot that one the facilitites of OOP is that types that we define can be treated as instinsic types for most occasions. Today I came across a code that showed the use of ArrayList.ToArray(Type) for a type defined by the programmer.</P>
<P>...<BR>return (Contact[])mContacts.ToArray(typeof(Contact));<BR>...</P>
<P>here mConstacts is of type ArrayList, and Contact is a class.</P>
<P>I was doing the following till now :-</P>
<P>C# :-</P>
<P>Contact[] contacts = new Contact[mContacts.Count];</P>
<P>mContacts.CopyTo(contacts);</P>
<P>return contacts;</P>
<P>I have yet to peek into the IL to see the difference/similarity between the two approaches in terms of internals, but the first one at least requires less code and fits in a single line. :-)</P>
<P>&nbsp;</P><img src ="http://www.cnblogs.com/avlee/aggbug/311447.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41920/" target="_blank">[新闻]3 个独特的未来搜索引擎</a>]]></description></item></channel></rss>