<?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>Here comes the Sun &#187; Yan</title>
	<atom:link href="http://sunng.info/blog/tag/yan/feed/" rel="self" type="application/rss+xml" />
	<link>http://sunng.info/blog</link>
	<description>47% users on this site use *nix</description>
	<lastBuildDate>Sat, 04 Feb 2012 13:08:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>New composite based captcha image</title>
		<link>http://sunng.info/blog/2010/01/new-composite-based-captcha-image/</link>
		<comments>http://sunng.info/blog/2010/01/new-composite-based-captcha-image/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 14:54:39 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=429</guid>
		<description><![CDATA[recaptcha的验证码新增了alpha composite的新机制取代干扰线，今天用了一些时间在YAN上也实现了这种绘图机制。 使用Java2D的AlphaComposite实现，选用的Rule为alpha 1.0的SrcOut，即通过公式 Ar = As * (1 – Ad ) Cr = Cs * (1 – Ad ) 用语言描述就是叠加区域的透明度为0. 使用这种机制必须采用BufferedImage.TYPE_INT_ARGB的图像，并且输出支持alpha通道的格式。]]></description>
			<content:encoded><![CDATA[<p>recaptcha的验证码新增了alpha composite的新机制取代干扰线，今天用了一些时间在<a href="http://bitbucket.org/sunng/yan/" target="_blank">YAN</a>上也实现了这种绘图机制。</p>
<p><a title="30a2512d899641a8ab79a7c86946ff71 by 贝小塔, on Flickr" href="http://www.flickr.com/photos/40741608@N08/4308533479/"><img src="http://farm3.static.flickr.com/2752/4308533479_42337f4525_o.png" alt="30a2512d899641a8ab79a7c86946ff71" width="300" height="100" /></a><br />
<a title="f03ec596b91b4ce985c5b5af4a79e961 by 贝小塔, on Flickr" href="http://www.flickr.com/photos/40741608@N08/4308533483/"><img src="http://farm5.static.flickr.com/4068/4308533483_a9e687b74c_o.png" alt="f03ec596b91b4ce985c5b5af4a79e961" width="300" height="100" /></a></p>
<p>使用Java2D的AlphaComposite实现，选用的Rule为alpha 1.0的SrcOut，即通过公式</p>
<p>Ar = As * (1 – Ad )<br />
Cr = Cs * (1 – Ad )<br />
用语言描述就是叠加区域的透明度为0. 使用这种机制必须采用BufferedImage.TYPE_INT_ARGB的图像，并且输出支持alpha通道的格式。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/01/new-composite-based-captcha-image/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Happy new year with Yan 0.4</title>
		<link>http://sunng.info/blog/2010/01/happy-new-year-with-yan-0-4/</link>
		<comments>http://sunng.info/blog/2010/01/happy-new-year-with-yan-0-4/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 16:10:59 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[hg]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=418</guid>
		<description><![CDATA[I am glad to release the Yan 0.4 at the last night of 2009. It&#8217;s an important release which witnesses the improvement on both code and the project itself. We have great changes in all modules.  Packages have been rearranged &#8230; <a href="http://sunng.info/blog/2010/01/happy-new-year-with-yan-0-4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am glad to release the Yan 0.4 at the last night of 2009. It&#8217;s an important release which witnesses the improvement on both code and the project itself. We have great changes in all modules.  Packages have been rearranged and renamed to be more comprehensible. Let&#8217;s dive into the changeset:</p>
<h3>Changeset</h3>
<ul>
<li>ApiKey database derby / h2 support, still use hsql as default because it&#8217;s fastest (#9)</li>
<li>Captcha provider classes now loaded dynamically on runtime. They are not managed by guice container any longer. (#15)</li>
<li>The useless cache module was completely removed (#10)</li>
<li>ApiKey CR<span style="text-decoration: line-through;">U</span>D UI has been replaced by RESTful GET/PUT/DELETE interfaces</li>
<li>For text-based captcha, just return the question in ticket, no need for (also impossible to)  retrieve it from browser (#8)</li>
<li>Resource has been separated from the project file (#14 #18)</li>
<li>Add test to make sure the /ticket and /validate request are sent by the same application (#17)</li>
<li>Standardized error output: use HTTP error for client(browser), a selected error object for application (#24 #26)</li>
<li>/captcha/ request (invoked by client directly) now accepts configuration parameters</li>
<li>ApiKey is now binded to specified domain, it will check the /captcha request&#8217;s referer (#27)</li>
<li>NEW captcha provider introduced in: Tiled Image Captcha (#12)</li>
<li>JMX monitoring support on EhCache (#33)</li>
<li>a great deal of code improvements and bug-fixes</li>
</ul>
<h3>Interface changes</h3>
<p>The object return by /ticket has its attribute &#8220;url&#8221; renamed to &#8220;data&#8221;.</p>
<h3>Screenshots</h3>
<p>Use visualvm or jconsole the monitor ehcache status and statistics (enabled in 0.4 by default):</p>
<p><img class="alignnone" src="http://farm5.static.flickr.com/4034/4231348850_db1b877ba8.jpg" alt="" width="500" height="313" /></p>
<p>The new captcha provider in ruby and python sample application (<a href="http://bitbucket.org/sunng/yan/wiki/SampleCode" target="_blank">Sample Code</a>):</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2645/4230582459_bf63ce6677.jpg" alt="" width="500" height="313" /></p>
<h3>Download &amp; Deploy</h3>
<p>Since 0.4, yan package are available for download directly. Please refer to the  <a href="http://bitbucket.org/sunng/yan/downloads/" target="_blank">download page</a>, grab both yan-0.4.war and yan-resource.tar.bz2. Just throw the war package to your servlet container.  Then extract the resource package to your disk. Don&#8217;t forget to set the environment variable:<br />
<em>export YAN_RESOURCE=/path/to/your/resource</em></p>
<p>Start the servlet container in the same context, browser <em>http://localhost:8080/yan-0.4/</em> to see the test page and emulate the captcha process.</p>
<h3>Retrieve the code</h3>
<p>Clone the mercurial repository from bitbucket.org</p>
<p><em>$ hg clone https://sunng@bitbucket.org/sunng/yan/</em></p>
<p>You will get a copy of whole code repository (because mercurial is a distributed version control system). You are on the default branch at the beginning. The default branch maintains the code of 0.4, if you want to see latest things on Yan, switch to the development branch by</p>
<p><em>$ hg update 0.5-dev</em></p>
<p>Yan 0.5 is already on the way.</p>
<h3>Reporting Issue</h3>
<p>Issue reporting and patch submitting are always welcomed. Check the <a href="http://bitbucket.org/sunng/yan/issues/" target="_blank">issue tracker on bitbucket</a>, you will find <a href="http://bitbucket.org/sunng/yan/issues/?kind=proposal&amp;version=0.5" target="_blank">new features</a> in 0.5</p>
<p>Thanks for your support and <img class="alignnone" src="http://farm5.static.flickr.com/4030/4231554900_935d453250_o.png" alt="" width="250" height="40" />!</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2010/01/happy-new-year-with-yan-0-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hush!</title>
		<link>http://sunng.info/blog/2009/12/hush/</link>
		<comments>http://sunng.info/blog/2009/12/hush/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 11:57:34 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[留影]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=400</guid>
		<description><![CDATA[今天新增的拼图验证码的可配置性非常强，你只要替换资源文件，在配置文件中修改提问的模版，指定图片的大小、行数、列数，就可以创造一套全新的验证码。他的简单程度实在超出你的想象。]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" src="http://farm3.static.flickr.com/2577/4215800886_9e33ac4830_o.png" alt="" width="329" height="492" /></p>
<p>今天新增的拼图验证码的可配置性非常强，你只要替换资源文件，在配置文件中修改提问的模版，指定图片的大小、行数、列数，就可以创造一套全新的验证码。他的简单程度实在超出你的想象。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/12/hush/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Web 2.0 Icon Captcha</title>
		<link>http://sunng.info/blog/2009/12/web-2-0-icon-captcha/</link>
		<comments>http://sunng.info/blog/2009/12/web-2-0-icon-captcha/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 07:29:39 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=393</guid>
		<description><![CDATA[Yan 新增了一种验证码类型，Web 2.0 图标验证码。用户根据图标的内容和提示的信息，提交验证码。验证码图片如下： 提示文字： Please figure out twitter icons. 用户输入Twitter图标左上角上的字母，即可进行验证。在Yan的测试界面上使用如图： Web2.0 Icon实际上是Yan中新增的拼图验证码的一个实例，利用拼图验证码可以生成相似的更有创意的验证码。在我的开发环境中生成这样一张图片大约需要80ms。 项目中使用的图标均从互联网收集，遵循CC等协议或经作者授权，详情参考项目中README文件。 祝DAF同学生日快乐。]]></description>
			<content:encoded><![CDATA[<p>Yan 新增了一种验证码类型，Web 2.0 图标验证码。用户根据图标的内容和提示的信息，提交验证码。验证码图片如下：</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2556/4215434144_f589085acd_o.png" alt="" width="256" height="192" /></p>
<p>提示文字： Please figure out twitter icons.</p>
<p>用户输入Twitter图标左上角上的字母，即可进行验证。在Yan的测试界面上使用如图：</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2565/4214663971_cdc2168f69_o.png" alt="" width="394" height="503" /></p>
<p>Web2.0 Icon实际上是Yan中新增的拼图验证码的一个实例，利用拼图验证码可以生成相似的更有创意的验证码。在我的开发环境中生成这样一张图片大约需要80ms。</p>
<p>项目中使用的图标均从互联网收集，遵循CC等协议或经作者授权，详情参考项目中README文件。</p>
<p>祝DAF同学生日快乐。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/12/web-2-0-icon-captcha/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Load Test on Yan</title>
		<link>http://sunng.info/blog/2009/12/load-test-on-yan/</link>
		<comments>http://sunng.info/blog/2009/12/load-test-on-yan/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 04:07:19 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=382</guid>
		<description><![CDATA[给Yan的验证码图片服务做了压力测试。测试环境： Intel Xeon 3.00GHz 4核 内存2G Red Hat Enterprise Linux AS release 4 (Nahant Update 7) Jetty 6 / JDK 6 Jetty采用默认配置 maxThreads 200。 测试工具：ab (Apache Bench) 分别用10/50/100/200/500/1000并发用户，每个用户请求100次进行测试。结果如下： 10 50 100 200 500 1000 Requests per second 487.11 472.09 442.74 &#8230; <a href="http://sunng.info/blog/2009/12/load-test-on-yan/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>给Yan的验证码图片服务做了压力测试。测试环境：</p>
<ul>
<li>Intel Xeon 3.00GHz 4核</li>
<li>内存2G</li>
<li>Red Hat Enterprise Linux AS release 4 (Nahant Update 7)</li>
<li>Jetty 6 / JDK 6</li>
</ul>
<p>Jetty采用默认配置 maxThreads 200。</p>
<p>测试工具：ab (Apache Bench)</p>
<p>分别用10/50/100/200/500/1000并发用户，每个用户请求100次进行测试。结果如下：</p>
<p><!--   		BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"宋体"; font-size:x-small } --></p>
<p><!--   		BODY,DIV,TABLE,THEAD,TBODY,TFOOT,TR,TH,TD,P { font-family:"宋体"; font-size:x-small } --></p>
<table border="0" cellspacing="0" frame="VOID" rules="NONE">
<colgroup>
<col width="161"></col>
<col width="159"></col>
<col width="167"></col>
<col width="169"></col>
<col width="160"></col>
<col width="145"></col>
<col width="136"></col>
</colgroup>
<tbody>
<tr>
<td align="LEFT"></td>
<td align="RIGHT"><span style="font-family: Arial;">10</span></td>
<td align="RIGHT"><span style="font-family: Arial;">50</span></td>
<td align="RIGHT"><span style="font-family: Arial;">100</span></td>
<td align="RIGHT"><span style="font-family: Arial;">200</span></td>
<td align="RIGHT"><span style="font-family: Arial;">500</span></td>
<td align="RIGHT"><span style="font-family: Arial;">1000</span></td>
</tr>
<tr>
<td align="LEFT"><span style="font-family: Arial;">Requests per second</span></td>
<td align="RIGHT"><span style="font-family: Arial;">487.11</span></td>
<td align="RIGHT"><span style="font-family: Arial;">472.09</span></td>
<td align="RIGHT"><span style="font-family: Arial;">442.74</span></td>
<td align="RIGHT"><span style="font-family: Arial;">421.63</span></td>
<td align="RIGHT"><span style="font-family: Arial;">408.11</span></td>
<td align="RIGHT"><span style="font-family: Arial;">326.12</span></td>
</tr>
<tr>
<td align="LEFT"><span style="font-family: Arial;">Time per request</span></td>
<td align="RIGHT"><span style="font-family: Arial;">2.05</span></td>
<td align="RIGHT"><span style="font-family: Arial;">2.12</span></td>
<td align="RIGHT"><span style="font-family: Arial;">2.26</span></td>
<td align="RIGHT"><span style="font-family: Arial;">2.37</span></td>
<td align="RIGHT"><span style="font-family: Arial;">2.45</span></td>
<td align="RIGHT"><span style="font-family: Arial;">3.07</span></td>
</tr>
<tr>
<td align="LEFT"><span style="font-family: Arial;">Transfer rate</span></td>
<td align="RIGHT"><span style="font-family: Arial;">987.91</span></td>
<td align="RIGHT"><span style="font-family: Arial;">955.54</span></td>
<td align="RIGHT"><span style="font-family: Arial;">896.85</span></td>
<td align="RIGHT"><span style="font-family: Arial;">854.31</span></td>
<td align="RIGHT"><span style="font-family: Arial;">826.25</span></td>
<td align="RIGHT"><span style="font-family: Arial;">660.45</span></td>
</tr>
</tbody>
</table>
<p>﻿<img class="alignnone" src="http://farm3.static.flickr.com/2677/4212622846_f6023f9b40_o.png" alt="" width="358" height="334" /></p>
<p>目前对每个请求独立使用JDK的awt实时绘图，吞吐量可以达到400以上，如果稍稍优化一下Jetty的配置，性能还有一定的提升空间。这个结果还是不错的。</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/12/load-test-on-yan/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Yan in Ruby Web Application</title>
		<link>http://sunng.info/blog/2009/12/use-yan-in-ruby-web-application/</link>
		<comments>http://sunng.info/blog/2009/12/use-yan-in-ruby-web-application/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 15:16:45 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[把戏]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=360</guid>
		<description><![CDATA[I will show you the usage of Yan captcha service. In this tutorial, it&#8217;s based on a simple ruby web application of the Sinatra web framework. Before we start to use the service, it is necesary to get Yan running. &#8230; <a href="http://sunng.info/blog/2009/12/use-yan-in-ruby-web-application/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I will show you the usage of Yan captcha service. In this tutorial, it&#8217;s based on a simple ruby web application of the Sinatra web framework.</p>
<p>Before we start to use the service, it is necesary to get Yan running. Download the code from <a href="http://bitbucket.org/sunng/yan/" target="_blank">the project page</a>, then build and run it with maven:<br />
<em>mvn jetty:run</em></p>
<p>To enable the application to use Yan, we have to register our application to get an API Key. If you use Yan 0.3, there is a secret registration page at <em>http://localhost:8080/yan/reg.jsp</em> The page is protected by HTTP Basic Authentication, the username and password are store in &#8216;realm.properties&#8217; which is considered to locate in the root directory. Open the file you can see the plain text username and password. If you are running the latest development version, there is no long any UI for API Key creation, but restful interface. This won&#8217;t be hard to you, pickup your tools such as curl or poster (a firefox extension) to send a HTTP request. Take curl as example, do it like this:<br />
<em>curl -X PUT &#8220;http://localhost:8080/yan/apikey/&#8221; -d &#8220;SinatraTestApp&#8221; -u &#8220;username:password&#8221;</em></p>
<p>If it works, you will get a line of json:<br />
<em>{&#8220;apikey&#8221;:&#8221;b251b0dc2eed31cac38555b61d4fa6a453923bfd&#8221;,&#8221;appName&#8221;:&#8221;SinatraTestApp&#8221;}</em><br />
Save this apikey.</p>
<p>Sinatra is generally considered to be the world&#8217;s lightest and smallest web framework. And our application is rather simple. Just check the code:</p>
<pre class="brush:ruby">require "rubygems"
require "sinatra"
require "net/http"
require "yaml"

apikey='b251b0dc2eed31cac38555b61d4fa6a453923bfd'

get '/' do
	conn = Net::HTTP.new('localhost', 8080)
	q = "ip=#{@env['REMOTE_ADDR']}&amp;apikey=#{apikey}&amp;alt=yaml&amp;mode=0"
	resp, data = conn.get("/yan/ticket?#{q}")
	@ticket = YAML::load(data)
	haml :sinatra_captcha
end

post '/' do
	conn = Net::HTTP.new('localhost', 8080)
	q = "ip=#{@env['REMOTE_ADDR']}&amp;apikey=#{apikey}&amp;key=#{params['key']}&amp;code=#{params['captcha']}"
	resp, data = conn.get("/yan/validate?#{q}")
	data
end

use_in_file_templates!
__END__

@@ sinatra_captcha
%html
	%head
		%title Yan Captcha on Sinatra
	%body
		%form{:action=&gt;"/", :method=&gt;"post"}
			%p
				Username:
				%input{:name=&gt;"username", :type=&gt;"text"}
			%p
				Password:
				%input{:name=&gt;"password", :type=&gt;"password"}
			%p
				Captcha:
				%img{:src=&gt;@ticket['url']}
				%br
				%input{:name=&gt;"captcha", :type=&gt;"text"}
				%input{:name=&gt;"key", :type=&gt;"hidden", :value=&gt;@ticket['key']}
				%input{:type=&gt;'submit'}
</pre>
<p>There are two parts of this application: ruby code and haml. I just use in-file-template for convenience. We define a get handler and a post handler on the path &#8216;/&#8217;. The get handler will request a ticket from Yan which contains captcha image url and ticket key. The post handler will extract user input and submit the Yan&#8217;s validator and return user the result. And the HAML code is template for page rendering after GET request.</p>
<p>Maybe you need to install sinatra and some dependency:<br />
<em>sudo gem install sinatra haml</em></p>
<p>Run the code with a build-in WEBrick<br />
<em>ruby sinatra-yan.rb</em></p>
<p>Browse to the default url, test it:</p>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2766/4203612734_3237ed066c_o.png" alt="" width="459" height="268" /></p>
<p>For another similar tutorial using python, check Yan&#8217;s wiki page:<br />
<a href="http://bitbucket.org/sunng/yan/wiki/SampleCode" target="_blank">http://bitbucket.org/sunng/yan/wiki/SampleCode</a></p>
<p>Thank you for your support. btw, today is my dear girl friend&#8217;s birthday, I just wish her happy everyday.</p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/12/use-yan-in-ruby-web-application/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Yan 0.3</title>
		<link>http://sunng.info/blog/2009/12/yan-0-3/</link>
		<comments>http://sunng.info/blog/2009/12/yan-0-3/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 14:51:10 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[ANN]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=357</guid>
		<description><![CDATA[经过一周的重构和开发，我的开源项目，验证码服务，打上了0.3的tag，算是一个release吧。 This release has been focusing on support for different types captcha generators. Now Yan is not only able to provide image/jpeg captcha, but also text/plain and any others. Changeset: Internal API Changes: Cache API improved: new CacheItemIdentity and CacheIdStrategy &#8230; <a href="http://sunng.info/blog/2009/12/yan-0-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>经过一周的重构和开发，我的开源项目，验证码服务，打上了0.3的tag，算是一个release吧。</p>
<p>This release has been focusing on support for different types captcha generators. Now Yan is not only able to provide image/jpeg captcha, but also text/plain and any others.</p>
<h3>Changeset:</h3>
<ul>
<li>Internal API Changes:
<ul>
<li>Cache API improved: new CacheItemIdentity and CacheIdStrategy were introduced in to provide convertion between cache item name and captcha info model;</li>
<li>Captcha Generator API improved: Add CaptchaGeneratorInfo to define some meta information on captcha providers (such as mode code, captcha type);</li>
<li>Captcha Data Model(CaptchaInfo) and Ticket Data Model improved: configuration parameters are separated from required parameters and has been more generic for different types of generator algorisms;</li>
</ul>
</li>
<li>External API Changes:
<ul>
<li>Rename /image url to /captcha for better literal accuracy;</li>
<li>/ticket now supports multiple types of applicable format (plain text / json / xml / yaml);</li>
<li>/ticket now returns the mime type of the captcha generator;</li>
<li>Add a Simple-Plain-Text generator as a sample for those whose mime type is other than image/jpeg;</li>
</ul>
</li>
<li>Other changes:
<ul>
<li>I created a new branch for next version of Yan. So the code in repository now has multiply branches, you can use &#8216;hg update branch-name&#8217; to switch between difference branches;</li>
<li>The sample test page for the service (index.jsp) has been adopt to the new protocol and totally restyled.</li>
</ul>
</li>
</ul>
<p><img class="alignnone" src="http://farm3.static.flickr.com/2503/4200328968_b3dd1fee5f.jpg" alt="" width="500" height="391" /></p>
<p>Again, grab code from the development repository:<br />
<em>hg clone https://sunng@bitbucket.org/sunng/yan/</em></p>
<p>If you don&#8217;t use mercurial/hg, you can also download the tagged version from the page:<br />
<a href="http://bitbucket.org/sunng/yan/downloads/" target="_blank"><em>http://bitbucket.org/sunng/yan/downloads/</em></a></p>
<p>Just use maven to resolve dependency, build and run the project:<br />
<em>mvn jetty:run</em></p>
<p>Feel free to report issue <img src='http://sunng.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/12/yan-0-3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Yan Captcha Service</title>
		<link>http://sunng.info/blog/2009/10/yan-captcha-service/</link>
		<comments>http://sunng.info/blog/2009/10/yan-captcha-service/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 15:32:58 +0000</pubDate>
		<dc:creator>sunng</dc:creator>
				<category><![CDATA[把戏]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[foss]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[Yan]]></category>

		<guid isPermaLink="false">http://www.classicning.com/blog/?p=291</guid>
		<description><![CDATA[I&#8217;d like to announce my recent works, a project called Yan Captcha Service written in Java which is aimed to provide whole solutions of captcha for your websites. It will be very easy to use the service because 1. interfaces &#8230; <a href="http://sunng.info/blog/2009/10/yan-captcha-service/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to announce my recent works, a project called Yan Captcha Service written in Java which is aimed to provide whole solutions of captcha for your websites. It will be very easy to use the service because 1. interfaces are based on plain http url; 2. different kinds of usage are supported to fit your requirements; 3. the architecture is open so you can add your own solid implementation of captcha; 4. less coupling with your system. And designed for scalability, currently, it applies JGroups to share sessions (memcached support will be added soon), thus you can setup a cluster for the service.</p>
<p>As you may know, the open-source project is split from my current work-time project because it is more closed to my idea. However, soon we will have the product opened to our thousands (millions ?) of users. I can gain feedback from the challenge and improve the open-source edition.</p>
<p>The code is maintained by open-source scm, mercurial (also known as hg). The project is now hosted on <a href="http://bitbucket.org/sunng/yan/">bitbucket.org</a>. You can clone the code to local via:<br />
<em>$ hg clone https://sunng@bitbucket.org/sunng/yan/</em></p>
<p>To build the project, run this command in root of project directory:<br />
<em>mvn install</em></p>
<p>To run in a develop environment:<br />
<em>mvn jetty:run</em></p>
<p><a href="http://bitbucket.org/sunng/yan/issues/?status=new&amp;status=open" target="_blank">Issue reporting</a> and patches are always welcomed.</p>
<p>Check the wiki pages for more information about the project:<br />
<a href="http://bitbucket.org/sunng/yan/wiki/Home">http://bitbucket.org/sunng/yan/wiki/Home</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sunng.info/blog/2009/10/yan-captcha-service/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

