百度贴吧过滤规则

经常逛着百度贴吧,最近发现贴吧越来越“无耻”了,各种广告,无奈之下只有动手清理了。贴上我自己的傲游浏览器过滤规则,主要是屏蔽了一些和贴吧内容不吻合的帖子,边栏广告等。

!含游戏
##[class*="game"]
!贴吧首页,贴吧视频互动
##div[class="item live_show"]
!贴吧首页,滚动条
##div[class="top-sec clearfix"]
!贴吧首页,中部滚动广告
##div[class="platact_bigouter"]
!贴吧首页 豪友俱乐部
##div[class="member_rank"]
!贴吧内容条目
##div[class*="dasense"]
##li[class*="dasense"]
!本吧福利彩蛋
##div[id="tbmall_score_region"]
!幸运投注
##div[class*="lot_wrap"]
!广告
##[class*="_ad"]

 

《高效 XML》第5部分 Something went really wrong – OutOfMemoryException and StackOverflowException thrown when using XslCompiledTransform

来源:http://blogs.msdn.com/b/xmlteam/archive/2011/09/26/effective-xml-part-5-something-went-really-wrong-outofmemoryexception-and-stackoverflowexception-thrown-when-using-xslcompiledtransform.aspx

So, your application is crashing and it is crashing in?the?bad way. After spending hours of debugging and trying different things you figured out that this is this Xslt stylesheet that causes all the problems. How come? XslCompiledTransform is a compiler. It’s a bit different from C# or VB.NET compilers because it runs at runtime but the result of the compilation is basically the same – IL (Intermediate Language) code. One of disadvantages of running compilation at runtime is that compilation issues may have impact on the running application. In the “offline” scenario compiler would just return an error (the one I hate the most is “Internal Compiler Error” – still it will not affect my app at runtime ?? at worst there is no app). So, compilation may be one source of problems. The other source of problems can be the IL code the stylesheet was compiled to. Here there is not much difference between code generated from Xslt, C# or VB. In any case it is easy to write a program that compiles correctly but misbehaves at runtime (bugs anyone?). Let’s take a look at two most common unexpected exceptions you may hit when working with XslCompiledTransform and ways to resolve them.

继续阅读《高效 XML》第5部分 Something went really wrong – OutOfMemoryException and StackOverflowException thrown when using XslCompiledTransform

《高效 XML》第4部分 Let me project this (Xml file) for you

来源:http://blogs.msdn.com/b/xmlteam/archive/2011/09/26/effective-xml-part-4-let-me-project-this-xml-file-for-you.aspx

Xml is ubiquitous. No doubt about it. It is being used almost everywhere and almost by everyone. This includes places where huge amounts of data are being processed. This means xml files (or streams) used there are also huge. And the bigger the Xml file the harder it is to process. The two biggest problems are:

  • You need to query the document with a couple of XPath expressions or transform it with an Xslt file but the document is too big to be even loaded (the rule of thumb is that an Xml document needs up to 5 times memory of its size on the disk). When you try to load the document you get OutOfMemoryException and that’s about where your Xml processing ends.
  • You are able to load the document but all the queries or transformations are sloooow (and I assume it’s not because the queries or Xslt stylesheets are poorly written – if you are not sure see Effective Xml Part 3)

继续阅读《高效 XML》第4部分 Let me project this (Xml file) for you

《高效 XML》第3部分 Didn’t you say XslCompiledTransform was fast?

来源:http://blogs.msdn.com/b/xmlteam/archive/2011/09/26/effective-xml-part-3-didn-t-you-say-xslcompiledtransform-was-fast.aspx

“XslCompiledTransform is fast.”

“Really?”
“Yeah, XslCompiledTransform is fast… if used correctly.”

Indeed, depending on how you use XslCompiledTransform API your transformations can be really fast or not-that-fast (to say the least). The key to understanding where this difference comes from is to understan what XslCompiledTransform.Load() method actually does. The name of the method indicates that it is just used to load Xslt stylesheets. In reality the method does much more than this. It not only loads the Xslt stylesheet but it also compiles it to IL (Intermediate Language). Yes, after the stylesheet has been “loaded” somewhere there in memory is the real code built based on the provided stylesheet. Generating this code (i.e. “loading” the stylesheet) is costly but it allows for fast transformations – when you start a transformation in your app it no longer deals with the stylesheet, it just invokes the code the Xslt stylesheet was compiled to.

继续阅读《高效 XML》第3部分 Didn’t you say XslCompiledTransform was fast?

《高效XML》第2部分 How to kill the performance of an app with XPath…

来源:http://blogs.msdn.com/b/xmlteam/archive/2011/09/26/effective-xml-part-2-how-to-kill-the-performance-of-an-app-with-xpath.aspx

XPath expressions are pretty flexible. This flexibility allows for very creative ways of using XPath. Unfortunately some of them are suboptimal and cause bad performance of apps. This is especially visible in Xslt transformations where stylesheets contains tens if not hundreds of XPath expressions. Here is the list of the most common bad practices (or even anti-patterns) I have seen:

继续阅读《高效XML》第2部分 How to kill the performance of an app with XPath…

LINQ TO XML 笔记

来源:http://msdn.microsoft.com/zh-cn/library/bb387098.aspx

什么是LINQ to XML?

LINQ to XML 是一种启用了 LINQ 的内存 XML 编程接口,使用它,可以在 .NET Framework 编程语言中处理 XML。

LINQ to XML 将 XML 文档置于内存中,这一点很像文档对象模型 (DOM)。?您可以查询和修改 XML 文档,修改之后,可以将其另存为文件,也可以将其序列化然后通过 Internet 发送。?但是,LINQ to XML 与 DOM 不同:它提供一种新的对象模型,这是一种更轻量的模型,使用也更方便,这种模型利用了 Visual C# 2008 在语言方面的改进。

LINQ to XML 最重要的优势是它与 语言集成查询 (LINQ) 的集成。?由于实现了这一集成,因此,可以对内存 XML 文档编写查询,以检索元素和属性的集合。?LINQ to XML 的查询功能在功能上(尽管不是在语法上)与 XPath 和 XQuery 具有可比性。?Visual C# 2008 集成 LINQ 后,可提供更强的类型化功能、编译时检查和改进的调试器支持。

LINQ to XML 的另一个优势是通过将查询结果用作?XElement?和?XAttribute?对象构造函数的参数,实现了一种功能强大的创建 XML 树的方法。?这种方法称为“函数构造”,利用这种方法,开发人员可以方便地将 XML 树从一种形状转换为另一种形状。 继续阅读LINQ TO XML 笔记

【iebook 模板】动态加载杂志大背景

iebook 默认杂志背景
iebook 默认杂志背景

不知道大家是否厌倦了单一的杂志背景,希望杂志背景能随不同的页面发生变化呢(据说zmaker有此功能),经过不断努力楼主终于把这个特效模板弄出来了。在此感谢zmaker开发者提供的技术支持。

演示视频

使用说明:使用时,要将图片放在与 exe 文件同一目录以实现动态加载图片功能

wordpress英文引号变成中文问题

前几天在wordpress上粘贴了一篇重建图标缓存的文章,由于内容带有英文引号,在发表时,程序自动将英文引号改为中文全角引号,导致程序出错,解决方法如下:

1、进入程序后台,打开?wp-includes/formatting.php 文件

2、将如下粗体部分注释掉,保存后即可。

// This is not a tag, nor is the texturization disabled static strings
//$curl = str_replace($static_characters, $static_replacements, $curl);

// regular expressions
//$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);

iebook “程序未能打开指定的元素”解决方案

今天做了一个 flash 插入到iebook后,想修改里面的PNG图片,双击图片时程序弹出“程序未能打开指定的元素”对话框,经过研究,是因为flash设置错误(另一种原因是iebk文件出错了,请找官方客服恢复文件),解决方案如下:

1、打开Flash里的库面板,右键单击PNG文件,选择【属性…】
2、将压缩选项设为【无损(PNG/GIF)】,如图。确定后重新发布

iebook 程序无法打开指定的元素 解决方案
iebook 程序无法打开指定的元素 解决方案

3、将swf文件插入iebook