<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NeatCN(NeatStudio工作室)</title>
	<atom:link href="http://www.neatcn.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.neatcn.com</link>
	<description>NeatStudio工作室</description>
	<lastBuildDate>Sat, 26 Jun 2010 13:37:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Enterprise Caching Summary[using asp.net]</title>
		<link>http://www.neatcn.com/show-70-1.shtml</link>
		<comments>http://www.neatcn.com/show-70-1.shtml#comments</comments>
		<pubDate>Sat, 26 Jun 2010 13:37:11 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[caching]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=70</guid>
		<description><![CDATA[Original page url is:http://www.cnblogs.com/teddyma/archive/2010/02/23/1672295.html ,Author is Teddy. let&#8217;s read the file&#8230; Background Caching is an very important topic in enterprise-level multi-tier application, especially for web application. A general rule for applying caching is you should consider do necessary caching at each tier of your application if possible. The other basic rule for applying caching is [...]]]></description>
			<content:encoded><![CDATA[<p>Original page url is:http://www.cnblogs.com/teddyma/archive/2010/02/23/1672295.html ,Author is Teddy.<br />
let&#8217;s read the file&#8230;<br />
<strong>Background</strong></p>
<p>Caching is an very important topic in enterprise-level multi-tier application, especially for web application. A general rule for applying caching is you should consider do necessary caching at each tier of your application if possible. The other basic rule for applying caching is the closer the cache is near the user, the cheaper the cost to implement it is. For example, to implement browser side caching is much cheaper than at server side.</p>
<p>For a B/S application, from client to server side, possible tiers to implement caching include:</p>
<p>    * Browser: local sandbox cache, memory cache<br />
    * Network Router: CDN<br />
    * Web Server: HTTP output cache, memory cache, distributed cache<br />
    * Application Server: memory cache, distributed cache<br />
    * Database Server: memory cache, file system cache</p>
<p>The Cache-Control HTTP Headers‎ standardizes the cache policy from browser, to network router and to Web server. Different Web browsers implement their internal caching according to the standard Web protocols.</p>
<p>CDN helps us cache and distribute content through Network routers between browsers and Web servers automatically.</p>
<p>Modern database systems could manage the caching of database server well enough by themselves.</p>
<p>So the only places need additional implementation for caching are in our application code, for a B/S application it may include:</p>
<p>    * Browser side code (scripts, Flash/Silverlight, Java Applet/MS ActiveX/Smart Client, etc)<br />
    * Application code<br />
    * Database query code</p>
<p>I don’t want to talk much about caching in browser side code and database query code, because browser side caching more means how many memory you want the browser to occupy at client machine and there are no “thread synchronization” problems to be considered; and database side caching has its own guideline according to the database query language standards and different database system implementation.</p>
<p>So what left, worth to be discussed more is the caching in main application code. For a .NET C# application, this should mean the C# code to be compiled into executables to be deployed onto different tier servers. To be simple for discussion, let’s make our discussion below focus on .NET C# application only.<br />
Caching in Application Code<br />
1. Output Cache</p>
<p>The word “output cache” seems be invented by Microsoft together with ASP.NET. But its principle is simple. It caches the entire HTTP response message by a key which consists of a specified set of fields in a HTTP request. Since with output cache, a HTTP request could get the response message without further execution if the key exists in the output cache active key list, the performance of the Web server could be improved a lot. Especially, from II6, page level output cache could be dealt at IIS instead of at the ASP.NET ISAPI, there for, the performance is even much better than before.</p>
<p>So, as a general rule, for any request, if the response is possible to be reused to some extent, you should consider use output cache. But before use it, according to the “the closer the cheaper” rule, you should consider apply caching at “closer” places than Web server first. For example, practically, if possible, pay for CDN to extend the benefit of output cache out of your Web server to 3rd party CDN servers.<br />
2. ASP.NET Cache Class and EntLib Caching Application Block</p>
<p>Behind the output cache, is the caching for application data. ASP.NET provides the Caching class, and similarly, the EntLib provides the caching application block. Each of the Cache class implements not only a thread safe hash table, but also common cache expiration policies. But so far, there are still not build-in cache replacement algorithms, such as FIFO &#038; LRU, which are required by most real enterprise application. That’s why I  implements a set of cache classes with LRU algorithms in NIntegrate. And either of the Cache classes is still in-process caching only, which means, in a load-balanced farm, the application data cached in Cache instances may exists duplicated in each of the server in the farm.<br />
3. Caching Service &#038; Distributed Hash Table</p>
<p>If you want to shared cached data among processes and even among servers, you need shared caching service in separate process or distributed hash table.</p>
<p>A caching service is a service wrapping a hash table executing in a separate process, but store shared data among different processes on the same server. For example, I could implement it as a namedpipe binding based WCF service, exposing methods for operating an internal hash table, which stores shared application data of 3 ASP.NET application deployed on the same Web server.</p>
<p>Furthermore, a distributed hash table is more like a caching service be deployed on a separate server or even farm, which stores shared application data of different applications deployed on different servers and farms. The biggest benefit of distributed hash table is the cached data is not duplicated in different server, so you could expire cached data centrally. But you should realize that the performance of a distributed hash table is worse than a caching service deployed on the same server of an application, and of course far worse than in-process caching. But in practice, because in most cases, the performance bottle neck of enterprise applications is database server, and compare to querying database, the performance of distributed hash table is still much faster and  it could be scale-out easier than database, so distributed hash table could still benefit a lot on performance and is a indispensable part of enterprise applications.<br />
&#8211;the end &#8211;<br />
Yes ,you know the caching must be using three types on ouput or application or database ,so you can optimize it with these types on php.if use outpucache ,you can choose ob_* function.if use application cache,you can choose APC or Eacceraltor or ZendOptimizer.If use database cache ,you can choose memcached or filecache .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-70-1.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Bloom Filters</title>
		<link>http://www.neatcn.com/show-68-1.shtml</link>
		<comments>http://www.neatcn.com/show-68-1.shtml#comments</comments>
		<pubDate>Mon, 21 Jun 2010 14:14:47 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[BloomFilter]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=68</guid>
		<description><![CDATA[前段时间，yhustc问群里的人说是，如果有两个4G的文件，怎么样把其中相同的URL取出来？（文件大小4G，每行一个URL，每个URL64个字节），一下子迷惘了。后来他说了这个Bloom Filters，于是找了点资料 。
以下为部分资料，下次贴带图片（公式）的。。【文中有图片，但事实上原文并没有图片，来源于http://www.chinaunix.net/jh/25/601028.html，由于不知道如何在这里粘贴图片，因此本文中没有包含图片说明，请对照原文档来阅读，原文档在：http://www.perl.com/pub/a/2004/04/08】]]></description>
			<content:encoded><![CDATA[<p>前段时间，yhustc问群里的人说是，如果有两个4G的文件，怎么样把其中相同的URL取出来？（文件大小4G，每行一个URL，每个URL64个字节），一下子迷惘了。后来他说了这个Bloom Filters，于是找了点资料 。<br />
以下为部分资料，下次贴带图片（公式）的。。【文中有图片，但事实上原文并没有图片，来源于http://www.chinaunix.net/jh/25/601028.html】<br />
仙子注：这篇文章是半年前翻译的，最早贴于公司内部的BBS上，并引起一些争论。Bloom Filters是一种效率较高的内存索引算法，它本身具有矛盾性：一方面能快速测试目标成员是否存在，另一方面又不可避免的具有假命中率。如下文档仅供参考。<br />
由于不知道如何在这里粘贴图片，因此本文中没有包含图片说明，请对照原文档来阅读，原文档在：http://www.perl.com/pub/a/2004/04/08/bloom_filters.html?page=1   或可email给我索取中文PDF文档。</p>
<p>使用Bloom Filters</p>
<p>原作者：Maciej Ceglowski<br />
April 08, 2004 </p>
<p>任何perl使用者都熟悉hash查询，一个存在测试的语句可以这样写：</p>
<pre class="brush:perl">
foreach my $e ( @things ) { $lookup{$e}++ }

sub check {
my ( $key ) = @_;
print "Found $key!" if exists( $lookup{ $key } );
}
</pre>
<p>虽然hash查询很有用，但对非常大的列表，或keys自身非常大时，这种查询可能变得不实用。当查询hash增长得太大，通常的做法是将它移到数据库或文件中，只在本地缓存里保存最常用的关键字，这样能改善性能。</p>
<p>许多人不知道有一种优雅的算法，用以代替hash查询。它是一种古老的算法，叫做Bloom filter。 Bloom filter允许你在有限的内存里（你想在这块内存里存放关键字的完整列表），执行成员测试，这样就能避开使用磁盘或数据库进行查询的性能瓶颈。也许你会认为，空间的节省是有代价的：存在着可大可小的假命中率风险，并且一旦你增加key到filter后，就不能删除它。然而在许多情形下，这些局限是可接受的，bloom filter能编制有用工具。（仙子注：例如代理服务器软件Squid就使用了bloom filter算法。）</p>
<p>例如，假如你运行了一个高流量的在线音乐存储站点，并且如果你已知歌曲存在，就可以通过仅获取歌曲信息的方法，来最大程度的减少数据库压力。你可以在启动时构建一个bloom filter，在试图执行昂贵的数据库查询前，可以用它执行快速的成员存在测试。</p>
<pre class="brush:perl">
use Bloom::Filter;

my $filter = Bloom::Filter->new( error_rate => 0.01, capacity => $SONG_COUNT );
open my $fh, "enormous_list_of_titles.txt" or die "Failed to open: $!";

while (< $fh>) {
chomp;
$filter->add( $_ );
}

sub lookup_song {
my ( $title ) = @_;
return unless $filter->check( $title );
return expensive_db_query( $title ) or undef;
}
</pre>
<p>在该示例里，该测试给出假命中的几率是1%，在假命中率情况下程序会执行昂贵的数据库索取操作，并最终返回空结果。尽管如此，你已避开了99%的昂贵查询时间，仅使用了用于hash查询的一小片内存。更进一步，1%假命中率的filter，每个key的存储空间在2字节以下。这比你执行完整的 hash查询所需的内存少得多。</p>
<p>bloom filters在Burton Bloom之后命名，Burton Bloom 1970年首先在文档里描述了它们，文档名 Space/time trade-offs in hash coding with allowable errors.在那些内存稀少的日子里，bloom filters因其简洁而倍受重视。事实上，最早的应用之一是拼写检查程序。然而，由于有少数非常明显的特性，该算法特别适合社会软件应用。</p>
<p>因为bloom filters使用单向hash来存储数据，因此不可能在不做穷举搜索的情况下，重建filter里的keys列表。甚至这点看起来并非象很有用，既然来自穷举搜索的假命中会覆盖掉真正的keys列表。所以bloom filters能在不向全世界广播完整列表的情况下，共享关于已有资料的信息。因为这个理由，它们在peer-to-peer应用中特别有用，在这个应用中大小和隐私是重要的约束。</p>
<p>bloom filters如何工作</p>
<p>bloom filter由2部分组成：1套k hash函数，1个给定长度的位向量。选择位向量的长度，和hash函数的数量，依赖于我们想增加多少keys到设置中，以及我们能容忍的多高的假命中率。</p>
<p>bloom filter中所有的hash函数被配置过，其范围匹配位向量的长度。例如，假如向量是200位长，hash函数返回的值就在1到 200之间。在filter里使用高质量的hash函数相当重要，它保证输出等分在所有可能值上－－hash函数里的“热点”会增加假命中率。（仙子注：所谓“热点”是指结果过分频繁的分布在某些值上。）</p>
<p>要将某个key输入bloom filer中，我们在每个k hash函数里遍历它，并将结果作为在位向量里的offsets，并打开我们在该offsets上找到的任何位。假如该位已经设置，我们继续保留其打开。还没有在bloom filter里关闭位的机制。</p>
<p>在本示例里，让我们看看某个bloom filter，它有3个hash函数，并且位向量的长度是14。我们用空格和星号来表示位向量，以便于观察。你也许想到，空的bloom filter以所有的位关闭为开始，如图1所示。</p>
<p>图1：空的bloom filter</p>
<p>现在我们将字符apples增加到filter中去。为了做到这点，我们以apples为参数来运行每个hash函数，并采集输出：</p>
<p>hash1(&#8220;apples&#8221;) = 3<br />
hash2(&#8220;apples&#8221;) = 12<br />
hash3(&#8220;apples&#8221;) = 11</p>
<p>然后我们打开在向量里相应位置的位－－在这里就是位3，11，和12，如图2所示。</p>
<p>图2：激活了3位的bloom filter</p>
<p>为了增加另1个key，例如plums，我们重复hash运算过程：</p>
<p>hash1(&#8220;plums&#8221;) = 11<br />
hash2(&#8220;plums&#8221;) = 1<br />
hash3(&#8220;plums&#8221;) = 8</p>
<p>再次打开向量里相应的位，如图3里的高亮度显示。</p>
<p>图3：增加了第2个key的bloom filter</p>
<p>注意位置11的位已被打开－－在前面的步骤里，当我们增加apples时已设置了它。位11现在有双重义务，存储apples和plums两者的信息。当增加更多的keys时，它也会存储其他keys的信息。这种交迭让bloom filters如此紧凑－－任何位同时编码多个keys。这种交迭也意味着你永不能从filter里取出key，因为你不能保证你所关闭的位没有携载其他keys的信息。假如我们试图执行反运算过程来从filter里删除apples，就会不经意的关闭编码plums的1个位。从bloom filter里剥离key的唯一方法是重建filter，剔除无用key。</p>
<p>检查是否某个key已经存在于filter的过程，非常类似于增加新key。我们在所有的hash函数里遍历key，然后检查是否在那些 offsets上的位都是打开的。假如任何一位关闭，我们知道该key肯定不存在于filter中。假如所有位都打开，我们知道该key可能存在。</p>
<p>我说“可能”是因为存在一种情况，该key是个假命中。例如，假如我们用字符mango来测试filter，看看会发生什么情况。我们运行mango遍历hash函数：</p>
<p>hash1(&#8220;mango&#8221;) = 8<br />
hash2(&#8220;mango&#8221;) = 3<br />
hash3(&#8220;mango&#8221;) = 12</p>
<p>然后检查在那些offsets上的位，如图4所示。</p>
<p>图4：bloom filter的假命中</p>
<p>所有在位置3，8，和12的位都是打开的，故filter会报告mango是有效key。</p>
<p>当然，mango并非有效key－－我们构建的filter仅包含apples和plums。事实是mango的offsets非常巧合的指向了已激活的位。这就找到了1个假命中－－某个key看起来位于filter中，但实际不是。</p>
<p>正如你想的一样，假命中率依赖于位向量的长度和存储在filter里的keys的数量。位向量越宽阔，我们检查的所有k位被打开的可能性越小，除非该key确实存在于filter中。在hash函数的数量和假命中率之间的关系更敏感。假如使用的hash函数太少，在keys之间的差别就很少；但假如使用hash函数太多，filter会过于密集，增加了冲突的可能性。可以使用如下公式来计算任何filter的假命中率：</p>
<p>c = ( 1 &#8211; e(-kn/m) )k</p>
<p>这里c是假命中率，k是hash函数的数量，n是filter里keys的数量，m是filter的位长。</p>
<p>当使用bloom filters时，我们先要有个意识，期待假命中率多大；也应该有个粗糙的想法，关于多少keys要增加到filter里。我们需要一些方法来验证需要多大的位向量，以保证假命中率不会超出我们的限制。下列方程式会从错误率和keys数量求出向量长度：</p>
<p>m = -kn / ( ln( 1 &#8211; c ^ 1/k ) )</p>
<p>请注意另1个自由变量：k，hash函数的数量。可以用微积分来得出k的最小值，但有个偷懒的方法来做它：</p>
<pre class="brush:perl">
sub calculate_shortest_filter_length {
my ( $num_keys, $error_rate ) = @_;
my $lowest_m;
my $best_k = 1;

foreach my $k ( 1..100 ) {
my $m = (-1 * $k * $num_keys) /
( log( 1 - ($error_rate ** (1/$k))));

if ( !defined $lowest_m or ($m < $lowest_m) ) {
$lowest_m = $m;
$best_k   = $k;
}
}
return ( $lowest_m, $best_k );
}
</pre>
<p>为了给你直观的感觉，关于错误率和keys数量如何影响bloom filters的存储size，表1列出了一些在不同的容量/错误率组合下的向量size。</p>
<p>ErrorRate   Keys   RequiredSize   Bytes/Key<br />
1%           1K       1.87 K         1.9<br />
0.1%         1K       2.80 K         2.9<br />
0.01%        1K       3.74 K         3.7<br />
0.01%       10K       37.4 K         3.7<br />
0.01%      100K        374 K         3.7<br />
0.01%        1M       3.74 M         3.7<br />
0.001%       1M       4.68 M         4.7<br />
0.0001%      1M       5.61 M         5.7 </p>
<p>在Perl里构建bloom filter</p>
<p>为了构建1个工作bloom filter，我们需要1套良好的hash函数。这些容易解决－－在CPAN上有几个优秀的hash算法可用。对我们的目的来说，较好的选择是Digest::SHA1，它是强度加密的hash，用C实现速度很快。通过对不同值的输出列表进行排序，我们能使用该模块来创建任意数量的hash函数。如下是构建唯一hash函数列表的子函数：
</pre>
<pre class="brush:perl">
use Digest::SHA1 qw/sha1/;

sub make_hashing_functions {
my ( $count ) = @_;
my @functions;

for my $salt (1..$count ) {
push @functions, sub { sha1( $salt, $_[0] ) };
}

return @functions;
}
</pre>
<p>为了能够使用这些hash函数，我们必须找到1个方法来控制其范围。Digest::SHA1返回令人为难的过长160位hash输出，这仅在向量长度为2的160次方时有用，而这种情况实在罕见。我们结合使用位chopping和division来将输出削减到可用大小。</p>
<p>如下子函数取某个key，运行它遍历hash函数列表，并返回1个长度（$FILTER_LENGTH）的位掩码：</p>
<pre class="brush:perl">
sub make_bitmask {
my ( $key ) = @_;
my $mask    = pack( "b*", '0' x $FILTER_LENGTH);

foreach my $hash_function ( @functions ){ 

my $hash       = $hash_function->($key);
my $chopped    = unpack("N", $hash );
my $bit_offset = $result % $FILTER_LENGTH;

vec( $mask, $bit_offset, 1 ) = 1;
}
return $mask;
}
</pre>
<p>让我们逐行分析上述代码：</p>
<pre class="brush:perl">
my $mask = pack( "b*", '0' x $FILTER_LENGTH);
</pre>
<p>我们以使用perl的pack操作来创建零位向量开始，它是$FILTER_LENGTH长。pack取2个参数，1个模型和1个值。b模型告诉 pack将值解释为bits，*指“重复任意多需要的次数”，跟正则表达式类似。perl实际上会补充位向量的长度为8的倍数，但我们将忽视这些多余位。</p>
<p>有1个空的位向量在手中，我们准备开始运行key遍历hash函数：</p>
<pre class="brush:perl">
my $hash = $hash_function->($key);
my $chopped = unpack("N", $hash );
</pre>
<p>我们保存首个32位输出，并丢弃剩下的。这点可让我们不必要求BigInt支持。第2行做实际的位chopping。模型里的N告诉unpack以网络字节顺序来解包32位整数。因为未在模型里提供任何量词，unpack仅解包1个整数，然后终止。</p>
<p>假如你对位chopping过度狂热，你可以将hash分割成5个32位的片断，并对它们一起执行OR运算，将所有信息保存在原始hash里：</p>
<pre class="brush:perl">
my $chopped = pack( "N", 0 );
my @pieces  =  map { pack( "N", $_ ) } unpack("N*", $hash );
$chopped    = $_ ^ $chopped foreach @pieces;
</pre>
<p>但这样作可能杀伤力过度。</p>
<p>现在我们有了来自hash函数的32位整数输出的列表，下一步必须做的是，裁减它们的大小，以使其位于（1..$FILTER_LENGTH）范围内。</p>
<pre class="brush:perl">
my $bit_offset = $chopped % $FILTER_LENGTH;
</pre>
<p>现在我们已转换key为位offsets列表，这正是我们所求的。</p>
<p>剩下唯一要做的事情是，使用vec来设置位，vec取3个参数：向量自身，开始位置，要设置的位数量。我们能象赋值给变量一样来分配值给vec：</p>
<pre class="brush:perl">
vec( $mask, $bit_offset, 1 ) = 1;
</pre>
<p>在设置了所有位后，我们以1个位掩码来结束，位掩码和bloom filter长度一样。我们可以使用这个掩码来增加key到filter中：</p>
<pre class="brush:perl">
sub add {
my ( $key, $filter ) = @_;

my $mask = make_bitmask( $key );
$filter  = $filter | $mask;
}
</pre>
<p>或者我们使用它来检查是否key已存在：</p>
<pre class="brush:perl">
sub check {
my ( $key, $filter ) = @_;
my $mask  = make_bitmask( $key );
my $found = ( ( $filter &#038; $mask ) eq $mask );
return $found;
}
</pre>
<p>注意这些是位逻辑运算符OR(|)和AND(&#038;)，而并非通用的逻辑OR(||)和AND(&#038;&#038;)运算符。将这两者混在一起，会导致数小时的有趣调试。第1个示例将掩码和位向量进行OR运算，打开任何未设置的位。第2个示例将掩码和filter里相应的位置进行比较－－假如掩码里所有的打开位也在filter里打开，我们知道已找到一个匹配。</p>
<p>一旦你克服了使用vec,pack和位逻辑运算符的难度，bloom filters实际非常简单。http://www.perl.com/2004/04/08/examples/Filter.pm 这里给出了Bloom::Filter模块的完整信息。</p>
<p>分布式社会网络中的bloom filters</p>
<p>当前的社会网络机制的弊端之一是，它们要求参与者泄露其联系列表给中央服务器，或公布它到公共Internet，这2种情况下都牺牲了大量的用户隐私。通过交换bloom filters而不是暴露联系列表，用户能参与社会网络实践，而不用通知全世界他们的朋友是谁。编码了某人联系信息的 bloom filter能用来检查它是否包含了给定的用户名或email地址，但不能强迫要求它展示用于构建它的完整keys列表。甚至有可能将假命中率（虽然它听起来不像好特性），转换为有用工具。</p>
<p>假如我非常关注这些人，他们通过对bloom filter运行字典攻击，来试图对社会网络进行反工程。我可以构建filter，它具备较高的假命中率（例如50%），然后发送filter的多个拷贝给朋友，并变换用于构建每个filter的hash函数。我的朋友收集到的filters越多，他们见到的假命中率越低。例如，在5个filters情况下，假命中率是0.5的5次方，或3%－－通过发送更多filters，还能进一步减少假命中率。</p>
<p>假如这些filters中的任何一个被中途截取，它会展示全部50%的假命中率。所以我能隔离隐私风险，并且一定程度上能控制其他人能多清楚的</p>
<p>了解我的网络。我的朋友能较高程度的确认是否某个人位于联系列表里，但那些仅截取了1个或2个filters的人，几乎不会获取到什么。如下是个perl函数，它对1组嘈杂的filters检查某个key：</p>
<pre class="brush:perl">
use Bloom::Filter;

sub check_noisy_filters {
my ( $key, @filters ) = @_;
foreach my $filter ( @filters ) {
return 0 unless $filter->check( $key );
}
return 1;
}
</pre>
<p>假如你和你的朋友同意使用相同的filter长度和hash函数设置，你也能使用位掩码对比来估计在你们的社会网络之间的交迭程度。在2个bloom filters里的共享位数量会给出1个可用的距离度量。</p>
<pre class="brush:perl">
sub shared_on_bits {
my ( $filter_1, $filter_2 ) = @_;
return unpack( "%32b*",  $filter_1 &#038; $filter_2 )
}
</pre>
<p>另外，你能使用OR运算，结合2个有相同长度和hash函数的bloom filters来创建1个复合filter。例如，假如你参与某个小型邮件列表，并希望基于组里每个人的地址本来创建白名单，你可以为每个参与者独立的创建1个bloom filter，然后将filters一起进行OR运算，将结果输入Voltron-like主列表。组里成员不会了解到其他成员的联系信息，并且filter仍能展示正确的行为。</p>
<p>肯定还有其他针对社会网络和分布式应用的bloom filter妙用。如下参考列出一些有用资源。</p>
<p>参考<br />
· Bloom Filters &#8212; the math. A good place to start for an overview of the math behind Bloom filters.<br />
· Some Motley Bloom Tricks. Handy filter tricks and theory page.<br />
· Bloom Filter Survey. A handy survey article on Bloom filter network applications.<br />
· LOAF. Our own system for incorporating social networks onto email using Bloom filters.<br />
· Compressed Bloom Filters. If you are passing filters around a network, you will want to optimize them for minimum size; this paper gives a good overview of compressed Bloom filters.<br />
· Bloom16. A CPAN module implementing a counting Bloom filter.<br />
· Text::Bloom. CPAN module for using Bloom filters with text collections.<br />
· Privacy-Enhanced Searches Using Encryted Bloom Filters. This paper discusses how to use encryption and Bloom filters to set up a query system that prevents the search engine from knowing the query you are running.<br />
· Bloom Filters as Summaries. Some performance data on actually using Bloom filters as cache summaries.<br />
· Using Bloom Filters for Authenticated Yes/No Answers in the DNS. Internet draft for using Bloom filters to implement Secure DNS</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-68-1.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0</title>
		<link>http://www.neatcn.com/show-67-1.shtml</link>
		<comments>http://www.neatcn.com/show-67-1.shtml#comments</comments>
		<pubDate>Mon, 07 Jun 2010 23:15:39 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[Wordpress开发]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=67</guid>
		<description><![CDATA[【2010-06-21】今天，我已经升级到了3.0了。over &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- 上次是RC，这次是RC2，看来正式版离我们很近了。 事实上我也明白，如果不想多用户版，2.9已经够用了。wp为了让插件更容易开发，忽略的是性能，因此，在不装插件的情况下，WP的性能其实也还是可以接受的。只是插件多了，每次都要add_actin,add_xxxxx，就慢上很多。虽然插件都有缓存，但IO的消耗不会少呀？ 看原新闻怎么说吧，RC2只更新了一条： Changes: This release contains many bugfixes and improvements since Release Candidate 1. There have been improvements in the nav menus, multisite, the TwentyTen theme, and the upgrade functions, to name a few. There is also new contextual help available. 感觉好象没什么太大的意义，看来，稳定多了。stable版本即将出现了]]></description>
			<content:encoded><![CDATA[<p>【2010-06-21】今天，我已经升级到了3.0了。over<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
上次是RC，这次是RC2，看来正式版离我们很近了。<br />
事实上我也明白，如果不想多用户版，2.9已经够用了。wp为了让插件更容易开发，忽略的是性能，因此，在不装插件的情况下，WP的性能其实也还是可以接受的。只是插件多了，每次都要add_actin,add_xxxxx，就慢上很多。虽然插件都有缓存，但IO的消耗不会少呀？<br />
看原新闻怎么说吧，RC2只更新了一条：<br />
Changes:<br />
This release contains many bugfixes and improvements since Release Candidate 1. There have been improvements in the nav menus, multisite, the TwentyTen theme, and the upgrade functions, to name a few. There is also new contextual help available.<br />
感觉好象没什么太大的意义，看来，稳定多了。stable版本即将出现了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-67-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress : Adding Administration Menus</title>
		<link>http://www.neatcn.com/show-66-1.shtml</link>
		<comments>http://www.neatcn.com/show-66-1.shtml#comments</comments>
		<pubDate>Wed, 26 May 2010 03:43:59 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[Wordpress开发]]></category>
		<category><![CDATA[adminpage]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=66</guid>
		<description><![CDATA[If you want to give your pluging an options page,you must set a administration menu or options sub menu. Some manual can find it on wordpress.org.
OK,to add an administration menu, you must do three things:

   1. Create a function that contains the menu-building code
   2. Register the above function using the "admin_menu" action hook
   3. Create the HTML output for the page (screen) displayed when the menu item is clicked ]]></description>
			<content:encoded><![CDATA[<p>If you want to give your pluging an options page,you must set a administration menu or options sub menu. Some manual can find it on wordpress.org.<br />
OK,to add an administration menu, you must do three things:</p>
<p>   1. Create a function that contains the menu-building code<br />
   2. Register the above function using the &#8220;admin_menu&#8221; action hook<br />
   3. Create the HTML output for the page (screen) displayed when the menu item is clicked </p>
<p>It is that second step that is often overlooked by new developers. You cannot simply call the menu code described; you must put it inside a function, and then register the function.</p>
<p>Here is a very simple example of the three steps just described. This plugin will add a sub-level menu item under the Settings top-level menu, and when selected, that menu item will cause a very basic screen to display. Note: this code should be added to a main plugin PHP file or a separate PHP include file. </p>
<pre class="brush:php">
< ?php
add_action('admin_menu', 'my_plugin_menu');

function my_plugin_menu() {
  add_options_page('My Plugin Options', 'My Plugin', 'manage_options', 'my-unique-identifier', 'my_plugin_options');
}

function my_plugin_options() {
  if (!current_user_can('manage_options'))  {
    wp_die( __('You do not have sufficient permissions to access this page.') );
  }
  echo '< div class="wrap" >';
  echo '< p >Here is where the form would go if I actually had options.< / p >';
  echo '< / div >';
}
?>
</pre>
<p>Now,you looked this example, the function, my_plugin_menu(), adds a new item to the Administration menu via the add_options_page function. Note: more complicated multiple menu items can be added, but that will be described later. Notice the add_action line&#8211;that invokes the hook which &#8220;registers&#8221; the function, my_plugin_menu(). Without that add_action, a PHP error for &#8220;undefined function&#8221; will be thrown when attempting to activate the plugin. Finely, the add_options_page  code refers to the my_plugin_options() function which contains the actual page to be displayed (and PHP code to be processed) when someone clicks the menu item.</p>
<p>The actual detail of these processes is described in more detail in the sections below. Remember to enclose creation of the menu and the html page in functions, and invoke the admin_menu hook to get the whole process started!<br />
&#8212;//some code and english manual copy from http://codex.wordpress.org/Adding_Administration_Menus&#8212;<br />
if you want to set an administration menu,you can see it..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-66-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress开发的几个事项</title>
		<link>http://www.neatcn.com/show-64-1.shtml</link>
		<comments>http://www.neatcn.com/show-64-1.shtml#comments</comments>
		<pubDate>Tue, 18 May 2010 01:01:39 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[Wordpress开发]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=64</guid>
		<description><![CDATA[1、自定义字段，详见 http://codex.wordpress.org/Using_Custom_Fields ，几个常见的方法有： add_post_meta($id,$key,$value,$unique),update_post_meta,delete_post_meta get_post_meta,get_post_meta_keys,get_post_meta_values 用于模版中的有，the_meta,get_post_meta 2、图片存在哪里？图片其实也是一条post数据，只是 post_type = attachment而己 其它post_type有，draft（草稿）,revision（历史数据）等。 当图片的post_parent没有值时，认为它是孤立附件。如果有值是认为是有关联的，仅关联第一次，如果有多个文章插入此图片，默认只关联第一次的。 3、wp_links是友情链接表 wp_comments是回复表 wp_commentmeta和postmeta类似，但一般都用不到。 wp_options是系统配置表，可以用get_options等获取。 wp_terms等三个表是关联表，wp_terms里面存放了category,tag等信息 wp_users等两个表是用户相关表。由于usermeta信息是key,value对应的，所以当要取所有的用户及全部配置信息时就很郁闷。如果用户不多，建议是把wp_usermeta全部取出来之后，再用foreach等做键值对应，否则，SQL查询就会死人。]]></description>
			<content:encoded><![CDATA[<p>1、自定义字段，详见  http://codex.wordpress.org/Using_Custom_Fields ，几个常见的方法有：<br />
    add_post_meta($id,$key,$value,$unique),update_post_meta,delete_post_meta<br />
    get_post_meta,get_post_meta_keys,get_post_meta_values<br />
    用于模版中的有，the_meta,get_post_meta</p>
<p>2、图片存在哪里？图片其实也是一条post数据，只是  post_type = attachment而己<br />
    其它post_type有，draft（草稿）,revision（历史数据）等。<br />
    当图片的post_parent没有值时，认为它是孤立附件。如果有值是认为是有关联的，仅关联第一次，如果有多个文章插入此图片，默认只关联第一次的。</p>
<p>3、wp_links是友情链接表<br />
        wp_comments是回复表<br />
        wp_commentmeta和postmeta类似，但一般都用不到。<br />
        wp_options是系统配置表，可以用get_options等获取。<br />
        wp_terms等三个表是关联表，wp_terms里面存放了category,tag等信息<br />
        wp_users等两个表是用户相关表。由于usermeta信息是key,value对应的，所以当要取所有的用户及全部配置信息时就很郁闷。如果用户不多，建议是把wp_usermeta全部取出来之后，再用foreach等做键值对应，否则，SQL查询就会死人。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-64-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress的插件开发全攻略（目录）</title>
		<link>http://www.neatcn.com/show-63-1.shtml</link>
		<comments>http://www.neatcn.com/show-63-1.shtml#comments</comments>
		<pubDate>Mon, 17 May 2010 03:10:54 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[Wordpress开发]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=63</guid>
		<description><![CDATA[这篇文章是我转自sexywp.com的文章，有PDF版的下载哦，不过仔细看了之后，还是觉得比较简单，当然如果是初学的话，了解一下也足够了。 How to Write a WordPress Plugin &#8211; Introduction 介绍 Seven Reasons to Write a WordPress Plugin 编写插件的七个理 由 How to Get Ideas for WordPress Plugins 怎样获得 WordPress插件的创意 Structure of a WordPress Plugin WordPress 插件的结构 WordPress Plugin Actions WordPress 插件Actions WordPress Plugin Filters WordPress 插件Filter Constructing a WordPress Plugin Admin Panel 构造一个 WordPress插件管理员面板 Constructing a [...]]]></description>
			<content:encoded><![CDATA[<p>这篇文章是我转自sexywp.com的文章，有PDF版的下载哦，不过仔细看了之后，还是觉得比较简单，当然如果是初学的话，了解一下也足够了。</p>
<ol>
<li><a href="http://www.devlounge.net/articles/how-to-write-a-wordpress-plugin-introduction">How  to Write a WordPress Plugin &#8211; Introduction</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-01.htm">介绍</a></li>
<li><a href="http://www.devlounge.net/articles/seven-reasons-to-write-a-wordpress-plugin">Seven  Reasons to Write a WordPress Plugin</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-02.htm">编写插件的七个理 由</a></li>
<li><a href="http://www.devlounge.net/articles/how-to-get-ideas-for-wordpress-plugins">How  to Get Ideas for WordPress Plugins</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-03.htm">怎样获得 WordPress插件的创意</a></li>
<li><a href="http://www.devlounge.net/articles/structure-of-a-wordpress-plugin">Structure  of a WordPress Plugin</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-04.htm">WordPress 插件的结构</a></li>
<li><a href="http://www.devlounge.net/articles/wordpress-plugin-actions">WordPress  Plugin Actions</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-05.htm">WordPress  插件Actions</a></li>
<li><a href="http://www.devlounge.net/articles/wordpress-plugin-filters">WordPress  Plugin Filters</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-06.htm">WordPress 插件Filter</a></li>
<li><a href="http://www.devlounge.net/articles/constructing-an-wordpress-plugin-admin-panel">Constructing  a WordPress Plugin Admin Panel</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-07.htm">构造一个 WordPress插件管理员面板</a></li>
<li><a href="http://www.devlounge.net/articles/constructing-a-wordpress-plugin-users-panel">Constructing  a WordPress Plugin User’s Panel</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-08.htm">构建一个 WordPress插件用户面板</a></li>
<li><a href="http://www.devlounge.net/articles/wordpress-plugins-and-database-interaction">WordPress  Plugins and Database Interaction</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-09.htm">WordPress 插件和数据库交互</a></li>
<li><a href="http://www.devlounge.net/articles/using-javascript-and-css-with-your-wordpress-plugin">Using  JavaScript and CSS with your WordPress Plugin</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-10.htm">在你的 WordPress插件中使用Javascript和CSS</a></li>
<li><a href="http://www.devlounge.net/articles/using-ajax-with-your-wordpress-plugin">Using  AJAX with your WordPress Plugin</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-11.htm">在你的WP插件中 使用AJAX</a></li>
<li><a href="http://www.devlounge.net/articles/releasing-and-promoting-your-wordpress-plugin">Releasing  and Promoting Your WordPress Plugin</a></li>
<li><a href="http://sexywp.com/how-to-write-a-wp-plugin-12.htm">发布并推广你的 WordPress插件</a></li>
</ol>
<p>作者：<a href="http://sexywp.com/">Charles </a>原文链接：<a href="http://sexywp.com/how-to-write-a-wp-plugin-contents.htm">插件开发全攻略（目 录）</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-63-1.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Yii framework documentation and api manual</title>
		<link>http://www.neatcn.com/show-62-1.shtml</link>
		<comments>http://www.neatcn.com/show-62-1.shtml#comments</comments>
		<pubDate>Thu, 06 May 2010 12:42:25 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=62</guid>
		<description><![CDATA[When you wrote your php code with yii framewok,you must look the reference.so i try to find yii framework documentation and api manual. Yii api manual is a chm file,so you can download it ,and you can write code for the reference.(又在乱写了。。。) Yii documentation that gives the definitive description of every feature of Yii and [...]]]></description>
			<content:encoded><![CDATA[<p>When you wrote your php code with yii framewok,you must look the reference.so i try to find yii framework documentation and api manual.<br />
Yii api manual is a chm file,so you can download it ,and you can write code for the reference.(又在乱写了。。。)<br />
Yii documentation that gives the definitive description of every feature of Yii and is being constantly updated to reflect the latest enhancements and changes.it&#8217;s showed on Yii frontpage.This tutorial release also available by some languages.Chinese also among them.<br />
if you want to find chinese manual ,please type the url:</p>
<p>http://www.yiiframework.com/doc/guide/zh_cn/index</p>
<p>and </p>
<p>http://dreamneverfall.cn/yiidoc/index.htm.</p>
<p>And you can also be downloaded in PDF format.<br />
Over&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-62-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php-curl manual</title>
		<link>http://www.neatcn.com/show-61-1.shtml</link>
		<comments>http://www.neatcn.com/show-61-1.shtml#comments</comments>
		<pubDate>Thu, 29 Apr 2010 01:16:49 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[curl]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=61</guid>
		<description><![CDATA[curl 是使用URL语法的传送文件工具，支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP 上传，kerberos、基于HTT格式的上传、代理、cookie、用户＋口令证明、文件传送恢复、http代理通道和大量其他有用的技巧。详见参考手册。 以下关于此函数各项使用参数: bool curl_setopt (int ch, string option, mixed value) curl_setopt()函数将为一个CURL会话设置选项。option参数是你想要的设置，value是这个选项给定的值。 下列选项的值将被作为长整形使用(在option参数中指定)： * CURLOPT_INFILESIZE: 当你上传一个文件到远程站点，这个选项告诉PHP你上传文件的大小。 * CURLOPT_VERBOSE: 如果你想CURL报告每一件意外的事情，设置这个选项为一个非零值。 * CURLOPT_HEADER: 如果你想把一个头包含在输出中，设置这个选项为一个非零值。 * CURLOPT_NOPROGRESS: 如果你不会PHP为CURL传输显示一个进程条，设置这个选项为一个非零值。注意：PHP自动设置这个选项为非零值，你应该仅仅为了调试的目的来改变这个选项。 * CURLOPT_NOBODY: 如果你不想在输出中包含body部分，设置这个选项为一个非零值。 * CURLOPT_FAILONERROR: 如果你想让PHP在发生错误(HTTP代码返回大于等于300)时，不显示，设置这个选项为一人非零值。默认行为是返回一个正常页，忽略代码。 * CURLOPT_UPLOAD: 如果你想让PHP为上传做准备，设置这个选项为一个非零值。 * CURLOPT_POST: 如果你想PHP去做一个正规的HTTP POST，设置这个选项为一个非零值。这个POST是普通的 application/x-www-from-urlencoded 类型，多数被HTML表单使用。 * CURLOPT_FTPLISTONLY: 设置这个选项为非零值，PHP将列出FTP的目录名列表。 [...]]]></description>
			<content:encoded><![CDATA[<p>curl 是使用URL语法的传送文件工具，支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP 上传，kerberos、基于HTT格式的上传、代理、cookie、用户＋口令证明、文件传送恢复、http代理通道和大量其他有用的技巧。详见参考手册。</p>
<p>以下关于此函数各项使用参数:</p>
<p>bool curl_setopt (int ch, string option, mixed value)</p>
<p>curl_setopt()函数将为一个CURL会话设置选项。option参数是你想要的设置，value是这个选项给定的值。</p>
<p>下列选项的值将被作为长整形使用(在option参数中指定)：</p>
<p>* CURLOPT_INFILESIZE: 当你上传一个文件到远程站点，这个选项告诉PHP你上传文件的大小。<br />
* CURLOPT_VERBOSE: 如果你想CURL报告每一件意外的事情，设置这个选项为一个非零值。<br />
* CURLOPT_HEADER: 如果你想把一个头包含在输出中，设置这个选项为一个非零值。<br />
* CURLOPT_NOPROGRESS: 如果你不会PHP为CURL传输显示一个进程条，设置这个选项为一个非零值。注意：PHP自动设置这个选项为非零值，你应该仅仅为了调试的目的来改变这个选项。<br />
* CURLOPT_NOBODY: 如果你不想在输出中包含body部分，设置这个选项为一个非零值。<br />
* CURLOPT_FAILONERROR: 如果你想让PHP在发生错误(HTTP代码返回大于等于300)时，不显示，设置这个选项为一人非零值。默认行为是返回一个正常页，忽略代码。<br />
* CURLOPT_UPLOAD: 如果你想让PHP为上传做准备，设置这个选项为一个非零值。<br />
* CURLOPT_POST: 如果你想PHP去做一个正规的HTTP POST，设置这个选项为一个非零值。这个POST是普通的 application/x-www-from-urlencoded 类型，多数被HTML表单使用。<br />
* CURLOPT_FTPLISTONLY: 设置这个选项为非零值，PHP将列出FTP的目录名列表。<br />
* CURLOPT_FTPAPPEND: 设置这个选项为一个非零值，PHP将应用远程文件代替覆盖它。<br />
* CURLOPT_NETRC: 设置这个选项为一个非零值，PHP将在你的 ~./netrc 文件中查找你要建立连接的远程站点的用户名及密码。<br />
* CURLOPT_FOLLOWLOCATION: 设置这个选项为一个非零值(象 “Location: “)的头，服务器会把它当做HTTP头的一部分发送(注意这是递归的，PHP将发送形如 “Location: “的头)。<br />
* CURLOPT_PUT: 设置这个选项为一个非零值去用HTTP上传一个文件。要上传这个文件必须设置CURLOPT_INFILE和CURLOPT_INFILESIZE选项.<br />
* CURLOPT_MUTE: 设置这个选项为一个非零值，PHP对于CURL函数将完全沉默。<br />
* CURLOPT_TIMEOUT: 设置一个长整形数，作为最大延续多少秒。<br />
* CURLOPT_LOW_SPEED_LIMIT: 设置一个长整形数，控制传送多少字节。<br />
* CURLOPT_LOW_SPEED_TIME: 设置一个长整形数，控制多少秒传送CURLOPT_LOW_SPEED_LIMIT规定的字节数。<br />
* CURLOPT_RESUME_FROM: 传递一个包含字节偏移地址的长整形参数，(你想转移到的开始表单)。<br />
* CURLOPT_SSLVERSION: 传递一个包含SSL版本的长参数。默认PHP将被它自己努力的确定，在更多的安全中你必须手工设置。<br />
* CURLOPT_TIMECONDITION: 传递一个长参数，指定怎么处理CURLOPT_TIMEVALUE参数。你可以设置这个参数为TIMECOND_IFMODSINCE 或 TIMECOND_ISUNMODSINCE。这仅用于HTTP。<br />
* CURLOPT_TIMEVALUE: 传递一个从1970-1-1开始到现在的秒数。这个时间将被CURLOPT_TIMEVALUE选项作为指定值使用，或被默认 TIMECOND_IFMODSINCE使用。</p>
<p>下列选项的值将被作为字符串：</p>
<p>* CURLOPT_URL: 这是你想用PHP取回的URL地址。你也可以在用curl_init()函数初始化时设置这个选项。<br />
* CURLOPT_USERPWD: 传递一个形如[username]:[password]风格的字符串,作用PHP去连接。<br />
* CURLOPT_PROXYUSERPWD: 传递一个形如[username]:[password] 格式的字符串去连接HTTP代理。<br />
* CURLOPT_RANGE: 传递一个你想指定的范围。它应该是”X-Y”格式，X或Y是被除外的。HTTP传送同样支持几个间隔，用逗句来分隔(X-Y,N-M)。<br />
* CURLOPT_POSTFIELDS: 传递一个作为HTTP “POST”操作的所有数据的字符串。<br />
* CURLOPT_REFERER: 在HTTP请求中包含一个”referer”头的字符串。<br />
* CURLOPT_USERAGENT: 在HTTP请求中包含一个”user-agent”头的字符串。<br />
* CURLOPT_FTPPORT: 传递一个包含被ftp “POST”指令使用的IP地址。这个POST指令告诉远程服务器去连接我们指定的IP地址。这个字符串可以是一个IP地址，一个主机名，一个网络界面名 (在UNIX下)，或是‘-’(使用系统默认IP地址)。<br />
* CURLOPT_COOKIE: 传递一个包含HTTP cookie的头连接。<br />
* CURLOPT_SSLCERT: 传递一个包含PEM格式证书的字符串。<br />
* CURLOPT_SSLCERTPASSWD: 传递一个包含使用CURLOPT_SSLCERT证书必需的密码。<br />
* CURLOPT_COOKIEFILE: 传递一个包含cookie数据的文件的名字的字符串。这个cookie文件可以是Netscape格式，或是堆存在文件中的HTTP风格的头。<br />
* CURLOPT_CUSTOMREQUEST: 当进行HTTP请求时，传递一个字符被GET或HEAD使用。为进行DELETE或其它操作是有益的，更Pass a string to be used instead of GET or HEAD when doing an HTTP request. This is useful for doing or another, more obscure, HTTP request. 注意: 在确认你的服务器支持命令先不要去这样做。下列的选项要求一个文件描述(通过使用fopen()函数获得)：<br />
* CURLOPT_FILE: 这个文件将是你放置传送的输出文件，默认是STDOUT.<br />
* CURLOPT_INFILE: 这个文件是你传送过来的输入文件。<br />
* CURLOPT_WRITEHEADER: 这个文件写有你输出的头部分。<br />
* CURLOPT_STDERR: 这个文件写有错误而不是stderr。用来获取需要登录的页面的例子,当前做法是每次或许都登录一次,有需要的人再做改进了.</p>
<p>If you want to look ennglish manual,you can find it from &#8220;http://cn.php.net/manual/en/curl.constants.php&#8221;,and example page is:http://www.neatcn.com/show-23-1.shtml.<br />
The Chinese manual from php-curl ,copy from http://52037872.cn/blog/post/263</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-61-1.shtml/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>YUI Node and jQuery</title>
		<link>http://www.neatcn.com/show-59-1.shtml</link>
		<comments>http://www.neatcn.com/show-59-1.shtml#comments</comments>
		<pubDate>Wed, 28 Apr 2010 13:27:03 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[Javascript开发]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=59</guid>
		<description><![CDATA[The Node Utility provides an expressive way to collect, create, and manipulate DOM nodes. Each Node instance represents an underlying DOM node, and each NodeList represents a collection of DOM nodes. With Node, you can manage classNames (myNode.addClass(&#8216;foo&#8217;)) and styles (myNode.setStyle(&#8216;opacity&#8217;, 0.5)), create elements (Y.Node.create(&#8216;< div id="foo" class="foo">< p>foo&#8217;)), and much more.[..sorry ,if i don't [...]]]></description>
			<content:encoded><![CDATA[<p>The Node Utility provides an expressive way to collect, create, and manipulate DOM nodes. Each Node instance represents an underlying DOM node, and each NodeList represents a collection of DOM nodes. With Node, you can manage classNames (myNode.addClass(&#8216;foo&#8217;)) and styles (myNode.setStyle(&#8216;opacity&#8217;, 0.5)), create elements (Y.Node.create(&#8216;< div id="foo" class="foo">< p>foo&#8217;)), and much more.[..sorry ,if i don't change the created html code,it will be showd HTML,not source]</p>
<p>Note: The method Y.get has been deprecated in favor of Y.one. The methods Node::query and Node::queryAll have been deprecated in favor of Node::one and Node::all. They still function as expected in this release, but support will be removed in a subsequent release. </p>
<p>The easiest way to include the source files for Node and its dependencies is to add the YUI seed file to your page, using the following script tag, and allow the YUI instance to download any additional files which may be required:</p>
<pre class="brush:javascript">
<script type="text/javascript" charset="utf-8"
        src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js">
</script>
// Create new YUI instance, and populate it with the required modules
YUI().use('node', function(Y) {

    // Node available, and ready for use.

});
jQuery(function($){

});
(function($){

})(jQuery);
</pre>
<p>you can see the detail page on &#8220;http://developer.yahoo.com/yui/3/node/&#8221;<br />
PS:<br />
on the end ,i find a bug on jquery,please look these codes:</p>
<pre class="brush:html">
<script src="http://localhost/jquery.js"></script>
<div id='tt'></div>

<script language="JavaScript">
<!--
(function($$){
	$$('#tt').text('

ttteeesssttt');
})(jQuery);
//-->
</script>
</pre>
<p>when i open this page on browser,it showed blank page.so i changed it </p>
<pre class="brush:html">
<script src="http://localhost/jquery.js"></script>
<div id='tt'></div>

<script language="JavaScript">
<!--
jQuery(function(){
	(function($$){
		$$('#tt').text('

ttteeesssttt');
	})(jQuery);
});
//-->
</script>
</pre>
<p>it&#8217;ok&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-59-1.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>try to use Yii framework</title>
		<link>http://www.neatcn.com/show-57-1.shtml</link>
		<comments>http://www.neatcn.com/show-57-1.shtml#comments</comments>
		<pubDate>Mon, 26 Apr 2010 14:23:31 +0000</pubDate>
		<dc:creator>膘叔</dc:creator>
				<category><![CDATA[PHP开发]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://www.neatcn.com/?p=57</guid>
		<description><![CDATA[i want to try use the framework named Yii,so i downloaded it . It&#8217;s so easy to create a new project. First,please edit yiic.bat on framework directory,and set PHP_COMMAND path. Second.open yiic.bat on command line.if no paramters ,it will be show: Yii command runner (based on Yii v1.1.1) Usage: E:\www\htdocs\travel\yii\framework\yiic [parameters...] The following commands are [...]]]></description>
			<content:encoded><![CDATA[<p>i want to try use the framework named Yii,so i downloaded it .<br />
It&#8217;s so easy to create a new project.<br />
First,please edit yiic.bat on framework directory,and set PHP_COMMAND path.<br />
Second.open yiic.bat on command line.if no paramters ,it will be show:</p>
<blockquote><p>Yii command runner (based on Yii v1.1.1)<br />
Usage: E:\www\htdocs\travel\yii\framework\yiic <command -name> [parameters...]</p>
<p>The following commands are available:<br />
 &#8211; message<br />
 &#8211; shell<br />
 &#8211; webapp</p>
<p>To see individual command help, use the following:<br />
   E:\www\htdocs\travel\yii\framework\yiic help </command><command -name></command></p></blockquote>
<p>Third.type yiic.bat webapp test,and type yes,yiic.bat created the project by name test.<br />
//以后要学英文，越写越烂。<br />
//请不要指责英文，本身就很烂，语法错误非常多，看得懂就行吧，当然能够告诉我语法错误也好，以后逐步改善吧，毕竟不写，永远也写不对。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neatcn.com/show-57-1.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
