<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>大熊寶店 Jiashyang's Weblog</title>
	<atom:link href="http://jiashyang.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jiashyang.wordpress.com</link>
	<description>生活與工作</description>
	<lastBuildDate>Wed, 24 Dec 2008 06:20:20 +0000</lastBuildDate>
	<language>zh-tw</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jiashyang.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>大熊寶店 Jiashyang's Weblog</title>
		<link>http://jiashyang.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jiashyang.wordpress.com/osd.xml" title="大熊寶店 Jiashyang&#039;s Weblog" />
	<atom:link rel='hub' href='http://jiashyang.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Building GTK+2.0 developement library</title>
		<link>http://jiashyang.wordpress.com/2008/12/15/building-gtk20-developement-library/</link>
		<comments>http://jiashyang.wordpress.com/2008/12/15/building-gtk20-developement-library/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 06:20:23 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[GTK]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=59</guid>
		<description><![CDATA[reference gtk website http://www.gtk.org/ 上星期用了將近一個星期的時間，把環境建立起來，以下記錄簡單安裝過程，在安裝時有缺其它的 package 就直接用 yum 安裝上去了，當中有卡到 glib 舊版本的問題，所以用 rpm -e glib &#8211;nodeps 移除掉，但是不移除相依的 package。 OS:  Fedora Core 8 main Package: GTK+ 2.14、GLib 2.18、Pango 1.20 tarball 方式安裝我都裝到 /usr/local 目錄下(defalut path) install pixman package: # tar -zxvf pixman-0.13.2.tar.gz # cd pixman-0.13.2 第一種方式 # ./configure pixman_LIBS=』-L/usr/local/lib』 \ pixman_CFLAGS=』-I/usr/local/include』 \ # make LDFLAGS=』-L/usr/local/lib』 \ CFLAGS=』-I/usr/local/include/pixman-1&#8243; # [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=59&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>reference gtk website <a title="http://www.gtk.org/" href="http://www.gtk.org/" target="_blank">http://www.gtk.org/</a></p>
<p>上星期用了將近一個星期的時間，把環境建立起來，以下記錄簡單安裝過程，在安裝時有缺其它的 package 就直接用 yum 安裝上去了，當中有卡到 glib 舊版本的問題，所以用 rpm -e glib &#8211;nodeps 移除掉，但是不移除相依的 package。</p>
<p>OS:  Fedora Core 8<br />
main Package: <span style="color:#ff0000;">GTK+ 2.14、GLib 2.18、Pango 1.20</span><br />
tarball 方式安裝我都裝到 /usr/local 目錄下(defalut path)</p>
<p>install <span style="color:#ff0000;">pixman</span> package:<br />
# tar -zxvf pixman-0.13.2.tar.gz<br />
# cd pixman-0.13.2<br />
第一種方式<br />
# ./configure pixman_LIBS=』-L/usr/local/lib』 \<br />
pixman_CFLAGS=』-I/usr/local/include』 \</p>
<p># make LDFLAGS=』-L/usr/local/lib』 \<br />
CFLAGS=』-I/usr/local/include/pixman-1&#8243;</p>
<p># make isntall</p>
<p>第二種方式(pkgcofig 需再去找一下這方面的資料)<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>install <span style="color:#ff0000;">cario</span> package:<br />
# tar -zxvf cario-1.8.4.tar.gz<br />
# cd cario-1.8.4<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>install <span style="color:#ff0000;">glib</span> package:<br />
# tar -jxvf glib-2.18.0.tar.bz2<br />
# cd glib-2.18.0<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>install <span style="color:#ff0000;">atk</span> package:<br />
# tar -jxvf atk-1.25.2.tar.bz2<br />
# cd atk-1.25.2<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>install <span style="color:#ff0000;">pango</span> package:<br />
# tar -jxvf pango-1.20.5.tar.bz2<br />
# cd pango-1.20.5<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>install <span style="color:#ff0000;">tiff</span> package:<br />
# tar -zxvf tiff-3.8.2.tar.gz<br />
# cd tiff-3.8.2<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>install <span style="color:#ff0000;">libjped</span> and <span style="color:#ff0000;">jasper</span> used by yum<br />
install  <span style="color:#ff0000;">xorg-x11</span> and <span style="color:#ff0000;">x11</span> used by yum (ps. install all about x software development)</p>
<p>install <span style="color:#ff0000;">gtk+</span> package:<br />
# tar -jxvf gtk+-2.14.0.tar.bz2<br />
# cd gtk+-2.14.0<br />
# ./configure PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig \<br />
LD_LIBRARY_PATH=/usr/local/lib<br />
# make; make install</p>
<p>write sample code:<br />
copy gtk website sample code.<br />
how to compile? need pkg-config this tools, it can show include header and library about when you need library.<br />
like this &#8211;&gt; pkg-config &#8211;cflgs &#8211;libs pkg-name-xxx<br />
因為上面我裝在 /usr/local 的目錄下，所以在編譯時我必須指定所需要的標頭檔及函式庫在哪裡，預設只會去找 /usr/lib and /usr/include<br />
後來安裝的 pkg-config pc 檔案都在 /usr/local/lib/pkgconfig，所以我先設定PKG_CONFIG_PATH和LD_LIBRARY_PATH 路徑名稱<br />
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
compile:<br />
<span style="color:#ff0000;"><span style="color:#000000;">gcc -o helloGTK helloGTK.c </span>`pkg-config &#8211;cflags &#8211;libs gtk+-2.0`</span></p>
<br />Posted in GTK  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/59/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/59/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/59/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=59&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/12/15/building-gtk20-developement-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>shared memory of IPC</title>
		<link>http://jiashyang.wordpress.com/2008/10/02/shared-memory-of-ipc/</link>
		<comments>http://jiashyang.wordpress.com/2008/10/02/shared-memory-of-ipc/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 03:42:36 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=51</guid>
		<description><![CDATA[由 parent process fork 一個 child process, 這兩個 process communication 是透過 shared memory 的方式 sample code posix_share_memory.c 1 #include &#60;stdio.h&#62; 2 #include &#60;sys/shm.h&#62; 3 #include &#60;sys/stat.h&#62; 4 #include &#60;unistd.h&#62; 5 #include &#60;stdlib.h&#62; 6 #include &#60;string.h&#62; 7 8 int main() 9 { 10 int segment_id = 0; 11 char *shared_memory = NULL; 12 const int size [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=51&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>由 parent process fork 一個 child process, 這兩個 process communication 是透過 shared memory 的方式<br />
sample code</p>
<p>posix_share_memory.c</p>
<pre class="hl"><span class="hl line">    1 </span><span class="hl dir">#include &lt;stdio.h&gt;</span>
<span class="hl line">    2 </span><span class="hl dir">#include &lt;sys/shm.h&gt;</span>
<span class="hl line">    3 </span><span class="hl dir">#include &lt;sys/stat.h&gt;</span>
<span class="hl line">    4 </span><span class="hl dir">#include &lt;unistd.h&gt;</span>
<span class="hl line">    5 </span><span class="hl dir">#include &lt;stdlib.h&gt;</span>
<span class="hl line">    6 </span><span class="hl dir">#include &lt;string.h&gt;</span>
<span class="hl line">    7 </span>
<span class="hl line">    8 </span><span class="hl kwb">int</span> <span class="hl kwd">main</span><span class="hl sym">()</span>
<span class="hl line">    9 </span><span class="hl sym">{</span>
<span class="hl line">   10 </span>        <span class="hl kwb">int</span> segment_id <span class="hl sym">=</span> <span class="hl num">0</span><span class="hl sym">;</span>
<span class="hl line">   11 </span>        <span class="hl kwb">char</span> <span class="hl sym">*</span>shared_memory <span class="hl sym">=</span> NULL<span class="hl sym">;</span>
<span class="hl line">   12 </span>        <span class="hl kwb">const int</span> size <span class="hl sym">=</span> <span class="hl num">4096</span><span class="hl sym">;</span>
<span class="hl line">   13 </span>        pid_t child_pid <span class="hl sym">=</span> <span class="hl num">0</span><span class="hl sym">;</span>
<span class="hl line">   14 </span>
<span class="hl line">   15 </span>        <span class="hl com">/* Allocate a shared memory segment */</span>
<span class="hl line">   16 </span>        segment_id <span class="hl sym">=</span> <span class="hl kwd">shmget</span><span class="hl sym">(</span>IPC_PRIVATE<span class="hl sym">,</span> size<span class="hl sym">,</span> S_IRUSR <span class="hl sym">|</span> S_IWUSR<span class="hl sym">);</span>
<span class="hl line">   17 </span>
<span class="hl line">   18 </span>        <span class="hl com">/* Attach the shared memory segment */</span>
<span class="hl line">   19 </span>        shared_memory <span class="hl sym">= (</span><span class="hl kwb">char</span> <span class="hl sym">*)</span><span class="hl kwd">shmat</span><span class="hl sym">(</span>segment_id<span class="hl sym">,</span> NULL<span class="hl sym">,</span> <span class="hl num">0</span><span class="hl sym">);</span>
<span class="hl line">   20 </span>
<span class="hl line">   21 </span>        <span class="hl com">/* Write a message to the shared memory segment */</span>
<span class="hl line">   22 </span>        <span class="hl kwd">sprintf</span><span class="hl sym">(</span>shared_memory<span class="hl sym">,</span> <span class="hl str">"Hi, there"</span><span class="hl sym">);</span>
<span class="hl line">   23 </span>
<span class="hl line">   24 </span>        child_pid <span class="hl sym">=</span> <span class="hl kwd">fork</span><span class="hl sym">();</span>
<span class="hl line">   25 </span>        <span class="hl kwa">if</span> <span class="hl sym">(</span>child_pid <span class="hl sym">&lt;</span> <span class="hl num">0</span><span class="hl sym">) {</span> <span class="hl slc">// fork fail</span>
<span class="hl line">   26 </span>                <span class="hl kwd">printf</span><span class="hl sym">(</span><span class="hl str">"fork fail !!</span><span class="hl esc">\n</span><span class="hl str">"</span><span class="hl sym">);</span>
<span class="hl line">   27 </span>                <span class="hl kwa">goto</span> exit<span class="hl sym">;</span>
<span class="hl line">   28 </span>        <span class="hl sym">}</span> <span class="hl kwa">else if</span> <span class="hl sym">(</span>child_pid <span class="hl sym">&gt;</span> <span class="hl num">0</span><span class="hl sym">) {</span> <span class="hl slc">// parent process running</span>
<span class="hl line">   29 </span>                <span class="hl kwd">wait</span><span class="hl sym">(</span>NULL<span class="hl sym">);</span>
<span class="hl line">   30 </span>                <span class="hl kwd">printf</span><span class="hl sym">(</span><span class="hl str">"child process complete!!</span><span class="hl esc">\n</span><span class="hl str">"</span><span class="hl sym">);</span>
<span class="hl line">   31 </span>                <span class="hl kwd">printf</span><span class="hl sym">(</span><span class="hl str">"shared_memory is : %s</span><span class="hl esc">\n</span><span class="hl str">"</span><span class="hl sym">,</span> shared_memory<span class="hl sym">);</span>
<span class="hl line">   32 </span>                <span class="hl kwa">goto</span> exit<span class="hl sym">;</span>
<span class="hl line">   33 </span>        <span class="hl sym">}</span> <span class="hl kwa">else</span> <span class="hl sym">{</span> <span class="hl slc">// child process running</span>
<span class="hl line">   34 </span>                <span class="hl kwd">strcat</span><span class="hl sym">(</span>shared_memory<span class="hl sym">,</span> <span class="hl str">"</span><span class="hl esc">\n</span><span class="hl str">I'm child process"</span><span class="hl sym">);</span>
<span class="hl line">   35 </span>                <span class="hl kwd">exit</span><span class="hl sym">(</span><span class="hl num">0</span><span class="hl sym">);</span>
<span class="hl line">   36 </span>        <span class="hl sym">}</span>
<span class="hl line">   37 </span>
<span class="hl line">   38 </span>exit <span class="hl sym">:</span>
<span class="hl line">   39 </span>        <span class="hl com">/* Detach the shared memory segment */</span>
<span class="hl line">   40 </span>        <span class="hl kwd">shmdt</span><span class="hl sym">(</span>shared_memory<span class="hl sym">);</span>
<span class="hl line">   41 </span>
<span class="hl line">   42 </span>        <span class="hl com">/* Remove the shared memory segment */</span>
<span class="hl line">   43 </span>        <span class="hl kwd">shmctl</span><span class="hl sym">(</span>segment_id<span class="hl sym">,</span> IPC_RMID<span class="hl sym">,</span> NULL<span class="hl sym">);</span>
<span class="hl line">   44 </span>
<span class="hl line">   45 </span>        <span class="hl kwa">return</span> <span class="hl num">0</span><span class="hl sym">;</span>
<span class="hl line">   46 </span><span class="hl sym">}</span><span class="hl slc">// end of main</span>
<span class="hl line">   47 </span></pre>
<br />Posted in C/C++  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=51&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/10/02/shared-memory-of-ipc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>gcc編譯失敗&#8230;怎麼辦??</title>
		<link>http://jiashyang.wordpress.com/2008/07/27/gcc%e7%b7%a8%e8%ad%af%e5%a4%b1%e6%95%97%e6%80%8e%e9%ba%bc%e8%be%a6/</link>
		<comments>http://jiashyang.wordpress.com/2008/07/27/gcc%e7%b7%a8%e8%ad%af%e5%a4%b1%e6%95%97%e6%80%8e%e9%ba%bc%e8%be%a6/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 07:53:11 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[Unix like]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=44</guid>
		<description><![CDATA[出現以下類似情形 : test.c:1:19: 錯誤： stdio.h：沒有此一檔案或目錄 test.c:2:20: 錯誤： unistd.h：沒有此一檔案或目錄 test.c:3:19: 錯誤： fcntl.h：沒有此一檔案或目錄 test.c:4:23: 錯誤： sys/types.h：沒有此一檔案或目錄 test.c:5:22: 錯誤： sys/stat.h：沒有此一檔案或目錄 請安裝相關函式庫 sudo apt-get install build-essential<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=44&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>出現以下類似情形 :<br />
test.c:1:19: 錯誤： stdio.h：沒有此一檔案或目錄<br />
test.c:2:20: 錯誤： unistd.h：沒有此一檔案或目錄<br />
test.c:3:19: 錯誤： fcntl.h：沒有此一檔案或目錄<br />
test.c:4:23: 錯誤： sys/types.h：沒有此一檔案或目錄<br />
test.c:5:22: 錯誤： sys/stat.h：沒有此一檔案或目錄</p>
<p>請安裝相關函式庫<br />
sudo apt-get install build-essential</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=44&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/07/27/gcc%e7%b7%a8%e8%ad%af%e5%a4%b1%e6%95%97%e6%80%8e%e9%ba%bc%e8%be%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>install ie for ubuntu</title>
		<link>http://jiashyang.wordpress.com/2008/06/25/install-ie-for-ubuntu/</link>
		<comments>http://jiashyang.wordpress.com/2008/06/25/install-ie-for-ubuntu/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 06:00:43 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[Unix like]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=43</guid>
		<description><![CDATA[主要是參考下面這個 blog http://blog.pixnet.net/Nelson/post/12146305 安裝起來的 ie 怪怪的, 像檢索時無法輸入中文字, 啟動了 ie 後, 我的電腦硬碟燈一直閃不停, 效能變的好慢, 關掉 ie 也一樣 有幾次還當掉~~~&#124;&#124;&#124; 先記錄起來, 有空再裝一次看看 IEs 4 Linux web site http://www.tatanka.com.br/ies4linux/page/Main_Page Wine web site http://www.winehq.org/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=43&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>主要是參考下面這個 blog</p>
<p>http://blog.pixnet.net/Nelson/post/12146305</p>
<p>安裝起來的 ie 怪怪的, 像檢索時無法輸入中文字, 啟動了 ie 後, 我的電腦硬碟燈一直閃不停, 效能變的好慢, 關掉 ie 也一樣<br />
有幾次還當掉~~~|||<br />
先記錄起來, 有空再裝一次看看</p>
<p>IEs 4 Linux web site http://www.tatanka.com.br/ies4linux/page/Main_Page<br />
Wine web site http://www.winehq.org/</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/43/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/43/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/43/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/43/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/43/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=43&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/06/25/install-ie-for-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>Debian packages</title>
		<link>http://jiashyang.wordpress.com/2008/06/24/debian-packages/</link>
		<comments>http://jiashyang.wordpress.com/2008/06/24/debian-packages/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 01:51:30 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[Unix like]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=42</guid>
		<description><![CDATA[To install a .deb file, double click on it and then select InstallPackage Another choese, open terminal window and typeing: sudo dpkg -i PackageFile.deb To uninstall, run package manager or in terminal window typeing: sudo dpkg -r PackageName<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=42&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ul>
<li>To install a .deb file, double click on it and then select <strong>InstallPackage</strong></li>
<li>Another choese, open terminal window and typeing: <strong><span style="color:red;">sudo dpkg -i PackageFile.deb</span></strong></li>
<li>To uninstall, run <strong>package manager</strong> or in terminal window typeing: <strong><span style="color:red;">sudo dpkg -r PackageName</span></strong></li>
</ul>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=42&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/06/24/debian-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu 常用套件名稱(筆記)</title>
		<link>http://jiashyang.wordpress.com/2008/06/23/ubuntu-%e5%b8%b8%e7%94%a8%e5%a5%97%e4%bb%b6%e5%90%8d%e7%a8%b1%e7%ad%86%e8%a8%98/</link>
		<comments>http://jiashyang.wordpress.com/2008/06/23/ubuntu-%e5%b8%b8%e7%94%a8%e5%a5%97%e4%bb%b6%e5%90%8d%e7%a8%b1%e7%ad%86%e8%a8%98/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 06:16:15 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[Unix like]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=40</guid>
		<description><![CDATA[Flash Player plug-in firefox sudo apt-get install flashplugin-nonfree Eclipse sudo apt-get install eclipse JAVA JDK sudo apt-get install sun-java5-jdk 中文輸入法 sudo apt-get install gcin aMSN 昨天搞了一天,還是沒完全弄好,今天早上乾脆刪掉重新用套件管理方式來安裝好了(安裝前先移除舊版) 手動：1. 先安裝 tcl &#38; tk web site --&#62; http://tcl.sourceforge.net/ 2. 再安裝 aMSN web site --&#62; http://www.amsn-project.net/ 3. 過程不詳述(因為失敗), 完成後執行 aMSN 依照畫面指示安裝 TLS(第一次執行), 在這裡卡了很久尚未成功 自動：1. sudo apt-get install tcl tk [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=40&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Flash Player plug-in firefox<br />
sudo apt-get install <span style="color:red;"><strong>flashplugin-nonfree</strong></span></p>
<p>Eclipse<br />
sudo apt-get install <span style="color:red;"><strong>eclipse</strong></span></p>
<p>JAVA JDK<br />
sudo apt-get install <span style="color:red;"><strong>sun-java5-jdk</strong></span></p>
<p>中文輸入法<br />
sudo apt-get install <span style="color:red;"><strong>gcin</strong></span></p>
<p>aMSN<br />
昨天搞了一天,還是沒完全弄好,今天早上乾脆刪掉重新用套件管理方式來安裝好了(安裝前先移除舊版)</p>
<pre>手動：1. 先安裝 tcl &amp; tk   web site --&gt; http://tcl.sourceforge.net/
     2. 再安裝 aMSN web site --&gt; http://www.amsn-project.net/
     3. 過程不詳述(因為失敗), 完成後執行 aMSN 依照畫面指示安裝 TLS(第一次執行),
        在這裡卡了很久尚未成功

自動：1. sudo apt-get install tcl tk amsn tcltls
     2. 執行成功, 但......無法輸入中文(還在survey...|||)
繼無法輸入中文後, 無意間上網找 scim 與 gcin 有什麼不一樣, 間接執行切換輸入法指令後,
居然可以輸入中文了, 但我覺得是碰巧的, 不過還是記錄一下吧, 下面為使用 im-switch 切換輸入法

scim
<strong><span style="color:#ff0000;">   sudo im-switch -s scim
</span></strong>gcin
<strong><span style="color:#ff0000;">   sudo im-switch -s gcin
</span></strong></pre>
<p>GnomeBaker 燒錄軟體 for gnome<br />
sudo apt-get install <span style="color:#ff0000;"><strong>gnomebaker</strong></span></p>
<p>K3B 燒錄軟體 for KDE<br />
sudo apt-get install <strong><span style="color:#ff0000;">k3b</span></strong></p>
<p>chm 檢視器<br />
sudo apt-get install <span style="color:#ff0000;"><strong>gnochm</strong></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=40&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/06/23/ubuntu-%e5%b8%b8%e7%94%a8%e5%a5%97%e4%bb%b6%e5%90%8d%e7%a8%b1%e7%ad%86%e8%a8%98/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>Java Algorithm</title>
		<link>http://jiashyang.wordpress.com/2008/06/12/java-algorithm/</link>
		<comments>http://jiashyang.wordpress.com/2008/06/12/java-algorithm/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 16:13:55 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=37</guid>
		<description><![CDATA[DES Algorithm import javax.crypto.spec.DESKeySpec; import javax.crypto.spec.IvParameterSpec; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; public class DES { public final String DesKey = "12345678"; //8 bytes public final String iv = "12345678"; //DES,T-DES IV must be 8 bytes long public static void main(String[] args) { byte[] data = "123456789ABCDEFGhijklmnopq".getBytes(); DES des = new DES(); /** *ECB Mode** [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=37&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration:underline;">DES Algorithm</span></strong></p>
<div>
<pre><span style="color:red;"><strong>import</strong></span> javax<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>crypto<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>spec<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DESKeySpec<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
<span style="color:red;"><strong>import</strong></span> javax<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>crypto<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>spec<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>IvParameterSpec<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
<span style="color:red;"><strong>import</strong></span> javax<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>crypto<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>Cipher<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
<span style="color:red;"><strong>import</strong></span> javax<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>crypto<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>SecretKey<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
<span style="color:red;"><strong>import</strong></span> javax<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>crypto<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>SecretKeyFactory<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

<span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>class</strong></span> DES <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>final</strong></span> String DesKey <span style="font-size:xx-small;color:blue;">=</span> <span style="color:purple;">"12345678"</span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>  <span style="color:green;"><em>//8 bytes</em></span>
    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>final</strong></span> String iv <span style="font-size:xx-small;color:blue;">=</span> <span style="color:purple;">"12345678"</span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span> <span style="color:green;"><em>//DES,T-DES IV must be 8 bytes long
</em></span>
    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>static</strong></span> <span style="color:red;"><strong>void</strong></span> main<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>String<span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> args<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> data <span style="font-size:xx-small;color:blue;">=</span> <span style="color:purple;">"123456789ABCDEFGhijklmnopq"</span>.getBytes<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        DES des <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>new</strong></span> DES<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

        <span style="color:green;"><em>/** *ECB Mode** */</em></span>
        <span style="color:green;"><em>//encrypt
</em></span>        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> ECBencry <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>null</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>try</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            ECBencry <span style="font-size:xx-small;color:blue;">=</span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>ECBEncryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>data<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DesKey<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getBytes<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span> <span style="color:red;"><strong>catch</strong></span> <span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Exception e<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            System<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>out<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>println<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"ECB Mode encrypt error: "</span> <span style="font-size:xx-small;color:blue;">+</span> e<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getMessage<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

        <span style="color:green;"><em>//decrypt
</em></span>        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> ECBdecry <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>null</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>try</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            ECBdecry <span style="font-size:xx-small;color:blue;">=</span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>ECBDecryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>ECBencry<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DesKey<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getBytes<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span> <span style="color:red;"><strong>catch</strong></span> <span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Exception e<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            System<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>out<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>println<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"ECB Mode decrypt error: "</span> <span style="font-size:xx-small;color:blue;">+</span> e<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getMessage<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

        System<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>out<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>println<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"ECB Mode decrypt(plaintext): "</span> <span style="font-size:xx-small;color:blue;">+</span> <span style="color:red;"><strong>new</strong></span> String<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>ECBdecry<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

        <span style="color:green;"><em>/** *CBC Mode** */</em></span>
        <span style="color:green;"><em>//get IV
</em></span>        IvParameterSpec spec <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>new</strong></span> IvParameterSpec<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>iv<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getBytes<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:green;"><em>//encrypt
</em></span>        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> CBCencry <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>null</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>try</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            CBCencry <span style="font-size:xx-small;color:blue;">=</span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>CBCEncryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>data<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DesKey<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getBytes<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>,</strong></span> spec<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span> <span style="color:red;"><strong>catch</strong></span> <span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Exception e<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            System<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>out<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>println<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"CBC Mode encrypt error: "</span> <span style="font-size:xx-small;color:blue;">+</span> e<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getMessage<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

        <span style="color:green;"><em>//decrypt
</em></span>        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> CBCdecry <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>null</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>try</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            CBCdecry <span style="font-size:xx-small;color:blue;">=</span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>CBCDecryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>CBCencry<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> des<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DesKey<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getBytes<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>,</strong></span> spec<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span> <span style="color:red;"><strong>catch</strong></span> <span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Exception e<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
            System<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>out<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>println<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"CBC Mode decrypt error: "</span> <span style="font-size:xx-small;color:blue;">+</span> e<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getMessage<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

        System<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>out<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>println<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"CBC Mode decrypt(plaintext): "</span> <span style="font-size:xx-small;color:blue;">+</span> <span style="color:red;"><strong>new</strong></span> String<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>CBCdecry<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
    <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> ECBEncryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> plaintext<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> rawKeyData<span style="font-size:xx-small;color:blue;"><strong>)</strong></span>
            <span style="color:red;"><strong>throws</strong></span> Exception <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
        <span style="color:green;"><em>//getkey
</em></span>        DESKeySpec dks <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>new</strong></span> DESKeySpec<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>rawKeyData<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKeyFactory keyFactory <span style="font-size:xx-small;color:blue;">=</span> SecretKeyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKey key <span style="font-size:xx-small;color:blue;">=</span> keyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>generateSecret<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>dks<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

        <span style="color:green;"><em>//encrypt
</em></span>        Cipher cipher <span style="font-size:xx-small;color:blue;">=</span> Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES/ECB/PKCS5Padding"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>init<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>ENCRYPT_MODE<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> key<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> enbyte <span style="font-size:xx-small;color:blue;">=</span> cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>doFinal<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>plaintext<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>return</strong></span> enbyte<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
    <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> ECBDecryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> ciphertext<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> rawKeyData<span style="font-size:xx-small;color:blue;"><strong>)</strong></span>
            <span style="color:red;"><strong>throws</strong></span> Exception <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
        <span style="color:green;"><em>//getkey
</em></span>        DESKeySpec dks <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>new</strong></span> DESKeySpec<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>rawKeyData<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKeyFactory keyFactory <span style="font-size:xx-small;color:blue;">=</span> SecretKeyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKey key <span style="font-size:xx-small;color:blue;">=</span> keyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>generateSecret<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>dks<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

        <span style="color:green;"><em>//encrypt
</em></span>        Cipher cipher <span style="font-size:xx-small;color:blue;">=</span> Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES/ECB/PKCS5Padding"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>init<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DECRYPT_MODE<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> key<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> debyte <span style="font-size:xx-small;color:blue;">=</span> cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>doFinal<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>ciphertext<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>return</strong></span> debyte<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
    <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> CBCEncryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> plaintext<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> rawKeyData<span style="font-size:xx-small;color:blue;"><strong>,</strong></span>
            IvParameterSpec spec<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="color:red;"><strong>throws</strong></span> Exception <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
        <span style="color:green;"><em>//getkey
</em></span>        DESKeySpec dks <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>new</strong></span> DESKeySpec<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>rawKeyData<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKeyFactory keyFactory <span style="font-size:xx-small;color:blue;">=</span> SecretKeyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKey key <span style="font-size:xx-small;color:blue;">=</span> keyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>generateSecret<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>dks<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

        <span style="color:green;"><em>//encrypt
</em></span>        Cipher cipher <span style="font-size:xx-small;color:blue;">=</span> Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES/CBC/PKCS5Padding"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>init<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>ENCRYPT_MODE<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> key<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> spec<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> enbyte <span style="font-size:xx-small;color:blue;">=</span> cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>doFinal<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>plaintext<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>return</strong></span> enbyte<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
    <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>

    <span style="color:red;"><strong>public</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> CBCDecryption<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> ciphertext<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> rawKeyData<span style="font-size:xx-small;color:blue;"><strong>,</strong></span>
            IvParameterSpec spec<span style="font-size:xx-small;color:blue;"><strong>)</strong></span> <span style="color:red;"><strong>throws</strong></span> Exception <span style="font-size:xx-small;color:blue;"><strong>{</strong></span>
        <span style="color:green;"><em>//getkey
</em></span>        DESKeySpec dks <span style="font-size:xx-small;color:blue;">=</span> <span style="color:red;"><strong>new</strong></span> DESKeySpec<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>rawKeyData<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKeyFactory keyFactory <span style="font-size:xx-small;color:blue;">=</span> SecretKeyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        SecretKey key <span style="font-size:xx-small;color:blue;">=</span> keyFactory<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>generateSecret<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>dks<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>

        <span style="color:green;"><em>//encrypt
</em></span>        Cipher cipher <span style="font-size:xx-small;color:blue;">=</span> Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>getInstance<span style="font-size:xx-small;color:blue;"><strong>(</strong></span><span style="color:purple;">"DES/CBC/PKCS5Padding"</span><span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>init<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>Cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>DECRYPT_MODE<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> key<span style="font-size:xx-small;color:blue;"><strong>,</strong></span> spec<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>byte</strong></span><span style="font-size:xx-small;color:blue;"><strong>[</strong></span><span style="font-size:xx-small;color:blue;"><strong>]</strong></span> debyte <span style="font-size:xx-small;color:blue;">=</span> cipher<span style="font-size:xx-small;color:blue;"><strong>.</strong></span>doFinal<span style="font-size:xx-small;color:blue;"><strong>(</strong></span>ciphertext<span style="font-size:xx-small;color:blue;"><strong>)</strong></span><span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
        <span style="color:red;"><strong>return</strong></span> debyte<span style="font-size:xx-small;color:blue;"><strong>;</strong></span>
    <span style="font-size:xx-small;color:blue;"><strong>}</strong></span>
<span style="font-size:xx-small;color:blue;"><strong>}</strong></span></pre>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=37&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/06/12/java-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>徬徨</title>
		<link>http://jiashyang.wordpress.com/2008/05/21/%e5%be%ac%e5%be%a8/</link>
		<comments>http://jiashyang.wordpress.com/2008/05/21/%e5%be%ac%e5%be%a8/#comments</comments>
		<pubDate>Wed, 21 May 2008 06:50:30 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[心情]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=33</guid>
		<description><![CDATA[最近心情感到有點沮喪，有點煩，好累，在這個行業我只能孤軍奮戰(誰叫我自己想走這一條路 &#124;&#124;&#124;) 好想好好的休息一段時間，走的真的有點累了，不知道現在到底要走去哪？ 有時候連話都不太想講了，只想一個人靜靜的&#8230;&#8230;.(也不知道該發呆還是做其它事)<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=33&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>最近心情感到有點沮喪，有點煩，好累，在這個行業我只能孤軍奮戰(誰叫我自己想走這一條路 |||)<br />
好想好好的休息一段時間，走的真的有點累了，不知道現在到底要走去哪？</p>
<p>有時候連話都不太想講了，只想一個人靜靜的&#8230;&#8230;.(也不知道該發呆還是做其它事)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=33&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/05/21/%e5%be%ac%e5%be%a8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>BCB 分割字串函數</title>
		<link>http://jiashyang.wordpress.com/2008/05/12/bcb-%e5%88%86%e5%89%b2%e5%ad%97%e4%b8%b2%e5%87%bd%e6%95%b8/</link>
		<comments>http://jiashyang.wordpress.com/2008/05/12/bcb-%e5%88%86%e5%89%b2%e5%ad%97%e4%b8%b2%e5%87%bd%e6%95%b8/#comments</comments>
		<pubDate>Mon, 12 May 2008 08:13:22 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=32</guid>
		<description><![CDATA[TStringList *strList = new TStringList() ; TSysCharSet splitChars = TSysCharSet() &#60;&#60; &#8216; &#8216; &#60;&#60; &#8216;.&#8217;; ExtractStrings(splitChars, splitChars, 『192.168.0.1&#8243;, strList); for (int i = 0; i &#60; strList-&#62;Count; i++) ShowMessage(strList-&#62;Strings[i]); delete strList;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=32&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="cpp" style="font-family:monospace;color:#006;border:1px solid #d0d0d0;background-color:#f0f0f0;">
<ol>
<li>
<div style="font-family:'Courier New', Courier, monospace;font-weight:normal;white-space:nowrapcolor: #000020;">TStringList *strList = <span style="color:#0000dd;">new</span> TStringList<span style="color:#000000;">(</span><span style="color:#000000;">)</span> ;</div>
</li>
<li>
<div style="font-family:'Courier New', Courier, monospace;font-weight:normal;white-space:nowrapcolor: #000020;">TSysCharSet splitChars = TSysCharSet<span style="color:#000000;">(</span><span style="color:#000000;">)</span> &lt;&lt; <span style="color:#666666;">&#8216; &#8216;</span> &lt;&lt; <span style="color:#666666;">&#8216;.&#8217;</span>;</div>
</li>
<li></li>
<li>
<div style="font-family:'Courier New', Courier, monospace;font-weight:normal;white-space:nowrapcolor: #000020;">ExtractStrings<span style="color:#000000;">(</span>splitChars, splitChars, <span style="color:#666666;">『192.168.0.1&#8243;</span>, strList<span style="color:#000000;">)</span>;</div>
</li>
<li></li>
<li>
<div style="font-family:'Courier New', Courier, monospace;font-weight:normal;white-space:nowrapcolor: #000020;"><span style="color:#0000ff;">for</span> <span style="color:#000000;">(</span><span style="color:#0000ff;">int</span> i = <span style="color:#0000dd;">0</span>; i &lt; strList-&gt;Count; i++<span style="color:#000000;">)</span></div>
</li>
<li>
<div style="font-family:'Courier New', Courier, monospace;font-weight:normal;white-space:nowrapcolor: #000020;">ShowMessage<span style="color:#000000;">(</span>strList-&gt;Strings<span style="color:#000000;">[</span>i<span style="color:#000000;">]</span><span style="color:#000000;">)</span>;</div>
</li>
<li></li>
<li>
<div style="font-family:'Courier New', Courier, monospace;font-weight:normal;white-space:nowrapcolor: #000020;"><span style="color:#0000dd;">delete</span> strList;</div>
</li>
</ol>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=32&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/05/12/bcb-%e5%88%86%e5%89%b2%e5%ad%97%e4%b8%b2%e5%87%bd%e6%95%b8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
		<item>
		<title>book house</title>
		<link>http://jiashyang.wordpress.com/2008/05/09/book-house-%e5%bf%ab%e8%a6%81%e4%b8%8d%e5%ad%98%e5%9c%a8%e4%ba%86/</link>
		<comments>http://jiashyang.wordpress.com/2008/05/09/book-house-%e5%bf%ab%e8%a6%81%e4%b8%8d%e5%ad%98%e5%9c%a8%e4%ba%86/#comments</comments>
		<pubDate>Fri, 09 May 2008 05:06:30 +0000</pubDate>
		<dc:creator>jiashyang</dc:creator>
				<category><![CDATA[心情]]></category>

		<guid isPermaLink="false">http://jiashyang.wordpress.com/?p=28</guid>
		<description><![CDATA[之前在台中待過的一家公司，也是我第一個寫程式的工作，以前寫的東西目前還掛在上面展示^^&#124;&#124;&#124; 看之前的作品，感覺好像很慘~~ 圖書整合性自動化系統 天具教具管理系統 下面這一個是小熊熊寫的 佛寺管理系統<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=28&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>之前在台中待過的一家公司，也是我第一個寫程式的工作，以前寫的東西目前還掛在上面展示^^|||<br />
看之前的作品，感覺好像很慘~~</p>
<p><a href="http://59.125.25.232/mitopacw/" target="_blank">圖書整合性自動化系統<br />
</a></p>
<p><a title="天具教具管理系統" href="http://59.125.25.232/winaidnet/" target="_blank">天具教具管理系統</a></p>
<p>下面這一個是小熊熊寫的<br />
<a href="http://59.125.25.232/wtemples/" target="_blank">佛寺管理系統</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jiashyang.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jiashyang.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jiashyang.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jiashyang.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jiashyang.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jiashyang.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jiashyang.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jiashyang.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jiashyang.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jiashyang.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jiashyang.wordpress.com&amp;blog=3434396&amp;post=28&amp;subd=jiashyang&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jiashyang.wordpress.com/2008/05/09/book-house-%e5%bf%ab%e8%a6%81%e4%b8%8d%e5%ad%98%e5%9c%a8%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/882d618b5b2dd1d94a183ac6bed63901?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jiashyang</media:title>
		</media:content>
	</item>
	</channel>
</rss>
