﻿<?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>语源科技BlogJava-不曾真实</title><link>http://www.blogjava.net/wenzhoou/</link><description>虽然工人可能是锤子的主人，但锤子却依然故我。
工具精确地知道自己应被如何使用，而使用者对此却只会有模糊的概念。</description><language>zh-cn</language><lastBuildDate>Tue, 28 Apr 2026 20:48:45 GMT</lastBuildDate><pubDate>Tue, 28 Apr 2026 20:48:45 GMT</pubDate><ttl>60</ttl><item><title>明天我要离开了</title><link>http://www.blogjava.net/wenzhoou/archive/2006/03/30/38378.html</link><dc:creator>不曾真实</dc:creator><author>不曾真实</author><pubDate>Thu, 30 Mar 2006 15:46:00 GMT</pubDate><guid>http://www.blogjava.net/wenzhoou/archive/2006/03/30/38378.html</guid><wfw:comment>http://www.blogjava.net/wenzhoou/comments/38378.html</wfw:comment><comments>http://www.blogjava.net/wenzhoou/archive/2006/03/30/38378.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/wenzhoou/comments/commentRss/38378.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wenzhoou/services/trackbacks/38378.html</trackback:ping><description><![CDATA[         明天是我在现在这家公司呆的最后一天了。说起来也是很伤感的。5年半的时间，有喜悦，有悲哀，有成功，有失败，有锐意激扬，也有颓废沉默，但是我的命运和呼吸始终是和她一起的。你看，这个小小的集体，没有人比我更在意她，也绝对没有一个人，比我付出的更多。我像一个父亲，从别人手中捡来了一个孩子，悉心抚养他，改变自己去教他，守着它，不让别人说他的坏话。而现在，春去秋来，花落花来，这个孩子慢慢长大了，懂事了，而我却不得不离开他了。我想，如果，我从来没有拥有过这些，或许我可以走开得更洒脱些，更早些。<br />        人付出的越多，要求的回报也就越多。而爱，是超越付出之外的。所以我一定是爱他的。不过也很奇怪，每次我工作不开心的时候，我就想离开这里，已经有很多次了，我个人也觉得总是和公司的整体有些格格不入。想想，有时候我也挺横的，一副敢拉皇帝下马的架势。不过，那也仅限于对小组不利的人和事。和小组的兄弟姐妹们，大家倒是一团和气。大家私下都觉得我这个领导挺好的，跟我干长技术，学知识，还出活，最主要的是大家开心。看到我不开心他们都会来劝我的。当然我倒不是因为公司给的钱少，其实公司也挺器重我的，给我也给的不少，但是在公司里，还是缺少家的感觉。<br />        前几天看到一句话深有感触：人类的第二类追求是有可能成功的，但是第一类追求却注定失败。比如说你可以赢得一场战争，或者赚很多的钱，也许是得到一个女子的芳心，都属于第二类的追求，是有可能成功的。而第一类追求，指的是追求生命的意义，试图解释生命存在的价值等，都是永远没有尽头的，对他追寻的结果必然导致失败。正是因为这个原因，拿破仑，丘吉尔，罗斯福可以感受到成功，而苏格拉底，尼采，老庄却永远也感受不到。书中说到，然而，它（第一类追求）不是唯一值得关注的对象。可是实际上，我觉得，只要它出现了，它总是在那里，越发强烈的引诱你去思考它，你可以暂时不去想，但是只要你闲暇的时间，就会往那边看上两眼。<br />        就拿打游戏来说，我们沉迷于炼级，爆装备，可是即使是这样，也从来不会阻止你去思考游戏的意义是什么，一到等级上去了，装备能够拿出来炫了，也就是大家纷纷离开的时候，就算是紧张的FPS游戏也是一样，总是无法阻止你去思考你正坐做的事情的根本的，真正的意义。人可以用金钱美女装备车子等一切身外之物来麻痹自己，但是这些东西都是会有尽头的，而带来的欢乐也总是有限的可怜。<br />        明天会怎么样，也许只有明天才知道。<br /><br />       罗罗嗦嗦说了这么多，那我再用一首诗来结束这篇文章：<br />        　　既不回头，何必不忘；<br />　　        既然无缘，何需誓言。<br />　　       今日种种，似水无痕，<br />　　        明夕何夕，君已陌路。<img src ="http://www.blogjava.net/wenzhoou/aggbug/38378.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wenzhoou/" target="_blank">不曾真实</a> 2006-03-30 23:46 <a href="http://www.blogjava.net/wenzhoou/archive/2006/03/30/38378.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DOCTYPE和filter的关系</title><link>http://www.blogjava.net/wenzhoou/archive/2006/03/30/38205.html</link><dc:creator>不曾真实</dc:creator><author>不曾真实</author><pubDate>Thu, 30 Mar 2006 02:29:00 GMT</pubDate><guid>http://www.blogjava.net/wenzhoou/archive/2006/03/30/38205.html</guid><wfw:comment>http://www.blogjava.net/wenzhoou/comments/38205.html</wfw:comment><comments>http://www.blogjava.net/wenzhoou/archive/2006/03/30/38205.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wenzhoou/comments/commentRss/38205.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wenzhoou/services/trackbacks/38205.html</trackback:ping><description><![CDATA[今天写代码发现一个奇怪的现象：<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #0000ff">&lt;!</span><span style="COLOR: #ff00ff">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">div </span><span style="COLOR: #ff0000">style</span><span style="COLOR: #0000ff">="filter:shadow(color=#cccccc,direction=120);width:300;padding-right:10;padding-bottom:10"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"> <br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">table </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">=300 </span><span style="COLOR: #ff0000">border</span><span style="COLOR: #0000ff">=1 </span><span style="COLOR: #ff0000">bgcolor</span><span style="COLOR: #0000ff">=#EAEAEA</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">td </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">="93"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">111</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">td </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">="91"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">222</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">td </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">="94"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">333</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">table</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">div</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span></div>无法正常显示。<br />但是如果把DOCTYPE里边的<font color="#ff00ff"> <a href="http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd</a></font><font color="#000000">删除掉，就可以正常显示filter了。真是奇怪。</font><img src ="http://www.blogjava.net/wenzhoou/aggbug/38205.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wenzhoou/" target="_blank">不曾真实</a> 2006-03-30 10:29 <a href="http://www.blogjava.net/wenzhoou/archive/2006/03/30/38205.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSP图标合成的例子</title><link>http://www.blogjava.net/wenzhoou/archive/2006/03/22/36898.html</link><dc:creator>不曾真实</dc:creator><author>不曾真实</author><pubDate>Wed, 22 Mar 2006 10:48:00 GMT</pubDate><guid>http://www.blogjava.net/wenzhoou/archive/2006/03/22/36898.html</guid><wfw:comment>http://www.blogjava.net/wenzhoou/comments/36898.html</wfw:comment><comments>http://www.blogjava.net/wenzhoou/archive/2006/03/22/36898.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/wenzhoou/comments/commentRss/36898.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wenzhoou/services/trackbacks/36898.html</trackback:ping><description><![CDATA[
		<p>  今天做了一个Jsp页面合成图标的例子。<br />  起因每次网上去合成Gmail图片，觉得不爽<img height="20" src="http://www.blogjava.net/Emoticons/QQ/icon18.gif" width="25" border="0" />（偶这里联网慢拉）。然后就找了一份合成Gmail图片的代码，<a href="http://playtime.uni.cc/downloads.php?page=gmail">http://playtime.uni.cc/downloads.php?page=gmail</a>。下下来一看，php的，而且还需要一个GD的库。不过代码倒是看明白了。很短，也很无趣。<img height="20" src="http://www.blogjava.net/Emoticons/QQ/09.gif" width="20" border="0" /><br /><br />  于是我就想能不能用Jsp合成图标阿。<img height="20" src="http://www.blogjava.net/Emoticons/QQ/05.gif" width="20" border="0" /><br />  然后搜了一下，网上果然有介绍。于是就自己照猫画虎做了一个爱因斯坦的图片合成的例子。<br /><br />   </p>
		<p align="center">
				<img height="480" alt="r_ai.JPG" src="http://www.blogjava.net/images/blogjava_net/wenzhoou/8793/r_ai.JPG" width="576" border="0" />
		</p>
		<p>
				<br />
				<br />
		</p>
		<p>  下边是代码。总共不到100行。<br />  通过测试，响应速度还挺快的<img height="20" src="http://www.blogjava.net/Emoticons/QQ/knife.gif" width="20" border="0" />。这里是核心<img height="20" src="http://www.blogjava.net/Emoticons/QQ/icon19.gif" width="20" border="0" />部分<br /><br /></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #008000">/*</span>
				<span style="COLOR: #008000"> =====ImageGen.jsp======== </span>
				<span style="COLOR: #008000">*/</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> @ page language </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> java </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">  contentType </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> image/jpeg </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> @ page </span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> java.io.* </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> @ page </span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> java.awt.* </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> @ page </span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> java.awt.image.* </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> @ page </span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> com.sun.image.codec.jpeg.* </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /><br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">static</span>
				<span style="COLOR: #000000"> Font fnt  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000"> ;  </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">!</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">static</span>
				<span style="COLOR: #000000"> BufferedImage bg  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000"> ;  </span>
				<span style="COLOR: #000000">%&gt;</span>
				<span style="COLOR: #000000"> <br /></span>
				<span style="COLOR: #000000">&lt;%</span>
				<span style="COLOR: #000000"> <br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  DEBUG:  -&gt;   long  st  =  System.currentTimeMillis();</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    request.setCharacterEncoding( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> shift_jis </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> );<br />     String  text  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  request.getParameter( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> text </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> );<br />     </span>
				<span style="COLOR: #0000ff">if</span>
				<span style="COLOR: #000000"> (text  </span>
				<span style="COLOR: #000000">==</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000"> ) text  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #000000">""</span>
				<span style="COLOR: #000000"> ;<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  DEBUG:  -&gt;  System.err.println( " text:  " + text);<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000"> because font  and  background need only read once, so make it static.</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">     </span>
				<span style="COLOR: #0000ff">if</span>
				<span style="COLOR: #000000"> (fnt  </span>
				<span style="COLOR: #000000">==</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000"> )     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  handwriting font make it looks funny.s</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">        fnt  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  Font.createFont(Font.TRUETYPE_FONT, </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000">  FileInputStream(getServletContext().getRealPath( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> / </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> ) </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> LHANDW.TTF </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> ));<br />     </span>
				<span style="COLOR: #0000ff">if</span>
				<span style="COLOR: #000000"> (bg  </span>
				<span style="COLOR: #000000">==</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000"> )<br />    {<br />        JPEGImageDecoder decoder  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  JPEGCodec.createJPEGDecoder( </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000">  FileInputStream(getServletContext().getRealPath( </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> / </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> ) </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> einstein.jpg </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> ));<br />        bg  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  decoder.decodeAsBufferedImage();<br />    }<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  draw background</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000">  width  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  bg.getWidth();<br />    </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000">  height  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  bg.getHeight();<br />    BufferedImage bi  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">   </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000">  BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);<br />    Graphics2D g  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  bi.createGraphics();<br />    g.drawImage(bg, </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> , </span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000"> , </span>
				<span style="COLOR: #0000ff">null</span>
				<span style="COLOR: #000000"> );<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  start draw text that user input</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    g.setColor(Color.WHITE);<br />    g.setFont(fnt.deriveFont(20f));<br />     </span>
				<span style="COLOR: #0000ff">int</span>
				<span style="COLOR: #000000">  stringwidth  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  g.getFontMetrics().stringWidth(text);<br />    g.drawString(text, </span>
				<span style="COLOR: #000000">300</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">-</span>
				<span style="COLOR: #000000"> stringwidth </span>
				<span style="COLOR: #000000">/</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">2</span>
				<span style="COLOR: #000000"> , </span>
				<span style="COLOR: #000000">120</span>
				<span style="COLOR: #000000"> );<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">   end  draw</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    g.dispose();<br />    bi.flush();<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  encode  and  output result</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">    JPEGImageEncoder encoder  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  JPEGCodec.createJPEGEncoder(response.getOutputStream());<br />    JPEGEncodeParam param  </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">  encoder.getDefaultJPEGEncodeParam(bi);<br />    param.setQuality( </span>
				<span style="COLOR: #000000">1</span>
				<span style="COLOR: #000000"> .0f,  </span>
				<span style="COLOR: #0000ff">false</span>
				<span style="COLOR: #000000"> );<br />    encoder.setJPEGEncodeParam(param);<br />    encoder.encode(bi);<br /><br />     </span>
				<span style="COLOR: #008000">//</span>
				<span style="COLOR: #008000">  DEBUG:  -&gt;  System.err.println( " Time Cost:  " + (System.currentTimeMillis()  -  st));</span>
				<span style="COLOR: #008000">
						<br />
				</span>
				<span style="COLOR: #000000">%&gt;</span>
		</div>
		<br />下边是界面部分<img height="20" src="http://www.blogjava.net/Emoticons/QQ/44.gif" width="20" border="0" /><br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">/* ======Image.jsp====== */<br /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@ page language</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">java</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> contentType</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;charset=shift_jis</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@ page import</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">java.net.URLEncoder</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000">Image Gen</span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">title</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">meta </span><span style="COLOR: #ff0000">http-equiv</span><span style="COLOR: #0000ff">="Content-Type"</span><span style="COLOR: #ff0000"> content</span><span style="COLOR: #0000ff">="text/html; charset=shift_jis"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">head</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">table </span><span style="COLOR: #ff0000">width</span><span style="COLOR: #0000ff">="100%"</span><span style="COLOR: #ff0000"> border</span><span style="COLOR: #0000ff">="0"</span><span style="COLOR: #ff0000"> align</span><span style="COLOR: #0000ff">="center"</span><span style="COLOR: #ff0000"> cellspacing</span><span style="COLOR: #0000ff">="1"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;&lt;</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"><br />    request.setCharacterEncoding(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">shift_jis</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br />    </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">String</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> text </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> request.getParameter(</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">);<br />    </span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">if</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(text</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">null</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> || text.length() </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">==</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">0</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">) text </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">Please input !</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</span><span style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">;<br /></span><span style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">IMG </span><span style="COLOR: #ff0000">src</span><span style="COLOR: #0000ff">=&lt;%= </span><span style="COLOR: #ff0000">"ImageGen.jsp?text</span><span style="COLOR: #0000ff">="+URLEncoder.encode(text,"</span><span style="COLOR: #ff0000">shift_jis") %</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"> border="0" /&gt;<br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;&lt;/</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><br /></span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">tr </span><span style="COLOR: #ff0000">valign</span><span style="COLOR: #0000ff">="top"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">form </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="gen"</span><span style="COLOR: #ff0000"> action</span><span style="COLOR: #0000ff">="Image.jsp"</span><span style="COLOR: #ff0000"> method</span><span style="COLOR: #0000ff">="post"</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />        </span><span style="COLOR: #008000">&lt;!--</span><span style="COLOR: #008000"> textarea name="text" rows="8" cols="70" </span><span style="COLOR: #008000">--&gt;</span><span style="COLOR: #000000"><br />        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">name</span><span style="COLOR: #0000ff">="text"</span><span style="COLOR: #ff0000"> </span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br />        </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">input </span><span style="COLOR: #ff0000">type</span><span style="COLOR: #0000ff">="submit"</span><span style="COLOR: #ff0000"> value</span><span style="COLOR: #0000ff">="Create Image"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">form</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br />    </span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">td</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">tr</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">table</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">body</span><span style="COLOR: #0000ff">&gt;</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #0000ff">&lt;/</span><span style="COLOR: #800000">html</span><span style="COLOR: #0000ff">&gt;</span></div><br />用到的图片和字体在这里：<a href="/Files/wenzhoou/Resource_JSPImgGen.zip">http://www.blogjava.net/Files/wenzhoou/Resource_JSPImgGen.zip</a><img src ="http://www.blogjava.net/wenzhoou/aggbug/36898.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wenzhoou/" target="_blank">不曾真实</a> 2006-03-22 18:48 <a href="http://www.blogjava.net/wenzhoou/archive/2006/03/22/36898.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JspWiki的存储和版本管理</title><link>http://www.blogjava.net/wenzhoou/archive/2006/03/21/36635.html</link><dc:creator>不曾真实</dc:creator><author>不曾真实</author><pubDate>Tue, 21 Mar 2006 06:28:00 GMT</pubDate><guid>http://www.blogjava.net/wenzhoou/archive/2006/03/21/36635.html</guid><wfw:comment>http://www.blogjava.net/wenzhoou/comments/36635.html</wfw:comment><comments>http://www.blogjava.net/wenzhoou/archive/2006/03/21/36635.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/wenzhoou/comments/commentRss/36635.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/wenzhoou/services/trackbacks/36635.html</trackback:ping><description><![CDATA[
		<p>  今天又折腾了下JspWiki，（恩，为什么说又呢？因为我以前折腾过。哈哈，其实我今天突然想知道JspWiki的数据存储和版本管理是怎么实现的。）这么一折腾，发现这个东西还是挺不错，挺好玩儿的。<br />  JspWiki的官方网站：<a href="http://www.jspwiki.org/">http://www.jspwiki.org</a><br />  下载后安装，（其实也不用安装，很简单的拷贝和修改配置文件拉<img height="19" src="http://www.blogjava.net/Emoticons/regular_smile.gif" width="19" border="0" />，我直接用我以前安装的一个版本）<br />  有一条配置“jspwiki.fileSystemProvider.pageDir”要改了，不然在系统盘下生成一个“/p/web/www-data/jspwiki/”的目录。挺郁闷的。<br />  启动后，页面上都是空空一片。觉得不爽。<br />  然后从下载的bin包下边找到一个“JSPWiki-samplepages.zip”文件，解开到刚才设定的pageDir下边，重启动以后，就有东西了。<br />  感觉纯英文不爽，上<a href="http://sourceforge.net/projects/startemplate">http://sourceforge.net/projects/startemplate</a>去下了个Template。恩，感觉不错了。<br />  （编辑了一下，发现LeftMenu有些问题，估计是一个小BUG吧。）<br /><br />  收获：<br />            1.发现原来JSPWiki默认采用的是文本存储<br />            2.pageProvider有三种，决定了版本是用什么管理的。<br />               FileSystemProvider 没有版本管理<br />               VersioningFileProvider 直接文本方式的版本管理<br />               RCSFileProvider 就是和RCS集成进行管理（我是这么想的，RCS是什么东东改天继续研究）<br />             3.FileSystemProvider和VersioningFileProvider因为直接存储的文本文件，而且没有分目录，<br />                所以不是一个很好的方案。<br />             4.VersioningFileProvider的版本管理就是直接把旧文件存到另外一个Old目录下边<br />                （当然是要改名字拉）。<br />                实际上按照版本，改为1.txt,2.txt等等<br />                我怎么没想到呢<img height="20" src="http://www.blogjava.net/Emoticons/QQ/21.gif" width="20" border="0" />。<br /></p>
<img src ="http://www.blogjava.net/wenzhoou/aggbug/36635.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/wenzhoou/" target="_blank">不曾真实</a> 2006-03-21 14:28 <a href="http://www.blogjava.net/wenzhoou/archive/2006/03/21/36635.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>