<?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>Aska13's Blog</title>
	<atom:link href="http://aska13.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aska13.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 14 Apr 2010 02:18:37 +0000</lastBuildDate>
	<language>zh-tw</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='aska13.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Aska13's Blog</title>
		<link>http://aska13.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://aska13.wordpress.com/osd.xml" title="Aska13&#039;s Blog" />
	<atom:link rel='hub' href='http://aska13.wordpress.com/?pushpress=hub'/>
		<item>
		<title>GCC 編譯心得</title>
		<link>http://aska13.wordpress.com/2010/04/14/gcc-%e7%b7%a8%e8%ad%af%e5%bf%83%e5%be%97/</link>
		<comments>http://aska13.wordpress.com/2010/04/14/gcc-%e7%b7%a8%e8%ad%af%e5%bf%83%e5%be%97/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 02:18:37 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[EE相關]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=244</guid>
		<description><![CDATA[include math.h時 需要在編譯的時候加上 -lm參數(for linker) ex: gcc ex.c -lm -o ex include stdio.h 需要加上-lc 參數 一般不加的原因, 是因為-lc是default參數<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=244&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>include math.h時 需要在編譯的時候加上 -lm參數(for linker)<br />
ex: gcc ex.c -lm -o ex</p>
<p>include stdio.h 需要加上-lc 參數<br />
一般不加的原因, 是因為-lc是default參數</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/244/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/244/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/244/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=244&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/04/14/gcc-%e7%b7%a8%e8%ad%af%e5%bf%83%e5%be%97/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>新竹油漆師傅</title>
		<link>http://aska13.wordpress.com/2010/04/13/%e6%96%b0%e7%ab%b9%e6%b2%b9%e6%bc%86%e5%b8%ab%e5%82%85/</link>
		<comments>http://aska13.wordpress.com/2010/04/13/%e6%96%b0%e7%ab%b9%e6%b2%b9%e6%bc%86%e5%b8%ab%e5%82%85/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 03:05:34 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[生活記事]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=242</guid>
		<description><![CDATA[網站 http://tw.myblog.yahoo.com/jw!qlAQBVmfQ0AhHp7jSpelBA&#8211;/profile 量少可以按日點工.(材料自備) 合作方式可以洽談. 師傅老實, 配合度高. 價錢很便宜.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=242&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>網站</p>
<p><span style="font-family:Arial,Helvetica;"><a href="http://tw.myblog.yahoo.com/jw%21qlAQBVmfQ0AhHp7jSpelBA--/profile" target="_blank">http://tw.myblog.yahoo.com/jw!qlAQBVmfQ0AhHp7jSpelBA&#8211;/profile</a></span></p>
<p><span style="font-family:Arial,Helvetica;">量少可以按日點工.(材料自備)<br />
合作方式可以洽談.<br />
師傅老實, 配合度高. 價錢很便宜.<br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=242&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/04/13/%e6%96%b0%e7%ab%b9%e6%b2%b9%e6%bc%86%e5%b8%ab%e5%82%85/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>[轉貼]perl dec2hex</title>
		<link>http://aska13.wordpress.com/2010/04/12/%e8%bd%89%e8%b2%bcperl-dec2hex/</link>
		<comments>http://aska13.wordpress.com/2010/04/12/%e8%bd%89%e8%b2%bcperl-dec2hex/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 11:14:14 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[EE相關]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=239</guid>
		<description><![CDATA[#!/usr/bin/perl $foo = 123; $hexval = sprintf(『%x』, $foo); $decval = hex($hexval); print 『\n$foo in hex is $hexval and in dec is $decval\n』;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=239&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>#!/usr/bin/perl</p>
<p>$foo = 123;<br />
$hexval = sprintf(『%x』, $foo);<br />
$decval = hex($hexval);</p>
<p>print 『\n$foo in hex is $hexval and in dec is $decval\n』;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=239&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/04/12/%e8%bd%89%e8%b2%bcperl-dec2hex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>嵌入式 C語言查表</title>
		<link>http://aska13.wordpress.com/2010/04/01/%e5%b5%8c%e5%85%a5%e5%bc%8f-c%e8%aa%9e%e8%a8%80%e6%9f%a5%e8%a1%a8/</link>
		<comments>http://aska13.wordpress.com/2010/04/01/%e5%b5%8c%e5%85%a5%e5%bc%8f-c%e8%aa%9e%e8%a8%80%e6%9f%a5%e8%a1%a8/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 11:06:12 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[IC_design]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=234</guid>
		<description><![CDATA[先宣告 &#8216;表&#8217;架構. strcut lut{ unsigned char m00; unsigned char m01; } 之後將表矩陣做出來. struct lut a[]={ {1,2},{3,4}}; 之後可以利用矩陣index和struct內宣告來取. 例如 a[0].m00, a[1].m01 若是有多個表切換 struct lut *local_tb; switch(tb_sel){ case(0): local_tb = tb1; break; case(1): local_tb = tb2; break; default: local_tb = tb1; break; };<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=234&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>先宣告 &#8216;表&#8217;架構.</p>
<p>strcut lut{<br />
unsigned char m00;<br />
unsigned char m01;<br />
}</p>
<p>之後將表矩陣做出來.</p>
<p>struct lut a[]={ {1,2},{3,4}};</p>
<p>之後可以利用矩陣index和struct內宣告來取.<br />
例如 a[0].m00, a[1].m01</p>
<p>若是有多個表切換<br />
struct lut *local_tb;<br />
switch(tb_sel){<br />
case(0): local_tb = tb1;<br />
break;<br />
case(1): local_tb = tb2;<br />
break;<br />
default: local_tb = tb1;<br />
break;<br />
};</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=234&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/04/01/%e5%b5%8c%e5%85%a5%e5%bc%8f-c%e8%aa%9e%e8%a8%80%e6%9f%a5%e8%a1%a8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>[轉貼]matlab 檔案處理.</title>
		<link>http://aska13.wordpress.com/2010/03/31/%e8%bd%89%e8%b2%bcmatlab-%e6%aa%94%e6%a1%88%e8%99%95%e7%90%86/</link>
		<comments>http://aska13.wordpress.com/2010/03/31/%e8%bd%89%e8%b2%bcmatlab-%e6%aa%94%e6%a1%88%e8%99%95%e7%90%86/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 11:54:35 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[IC_design]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=232</guid>
		<description><![CDATA[http://tw.myblog.yahoo.com/jw!laMc_3KQEk.bNqgMewVZeSI-/article?mid=34 http://www.ymlib.net/article/sort010/info-341.html 檔案的存取及處理 本分享主要是給新使用者容易上手 因此寫的有點簡單 希望大家見諒 fopen開啟檔案 [fid,message]=fopen(‘檔案名稱’,’參數’) fid  為檔案識別碼，當使用fopen 開啟檔案成功時，就會送回正整數的fid碼，如3，反之若開啟失敗時則fid會送回 –1的值給，message為開啟檔案若錯誤時則傳回錯誤訊息 參數(Permission)： ‘r’   只能讀，若檔案不存在時會發生錯誤 ‘r+’ 能讀能寫，若檔案不存在時會發生錯誤 ‘w’  只能寫，若檔案不存在時會建立一新的檔案，若檔案存在則會將內容覆蓋過 去 ‘w+’ 能 讀能寫，若檔案不存在時會建立一新的檔案，若檔案存在則會將內容覆蓋過去 ‘a’  只能附加(append)使用讀的方式，若檔案不存在時會建立一新的檔案，若檔案存在則會將內 容加於檔案後方 ‘a+’  只能附加(append)使用讀或寫的方式，若檔案不存在時會建立一新的檔案，若檔案存在則會 將內容加於檔案後方 fclose關閉檔案 status=fclose(fid) fclose(&#8216;all&#8217;) 當執行fclose 成功就會送回一個0值給status。 檔案存取fscanf，fprintf，fread，fwrite 若檔案內容可以分為二進位或ASCII 若為ASCII碼時，檔案存取的方法為： (1) fscanf，fprintf fscanf讀取檔案 Variable=fscanf(fid,&#8217;資料格式&#8217;,讀取資料的大小) 格式 %g  表示為浮點數值 %d  表示為十進位數值 %s  表示為字串 A = fscanf(fid,&#8217;%5d&#8217;)   %讀檔案格式為十進位整數 A = fscanf(fid,&#8217;%5d&#8217;,100)   %只讀100筆 fscanf寫入檔案 fprintf(fid,’資料格式’,資料矩陣或變數); x = 0:.1:1; y [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=232&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://tw.myblog.yahoo.com/jw!laMc_3KQEk.bNqgMewVZeSI-/article?mid=34</p>
<p>http://www.ymlib.net/article/sort010/info-341.html</p>
<p><strong>檔案的存取及處理</strong></p>
<p>本分享主要是給新使用者容易上手<br />
因此寫的有點簡單<br />
希望大家見諒</p>
<p>fopen開啟檔案<br />
[fid,message]=fopen(‘檔案名稱’,’參數’)<br />
fid  為檔案識別碼，當使用fopen 開啟檔案成功時，就會送回正整數的fid碼，如3，反之若開啟失敗時則fid會送回 –1的值給，message為開啟檔案若錯誤時則傳回錯誤訊息<br />
參數(Permission)：<br />
‘r’   只能讀，若檔案不存在時會發生錯誤<br />
‘r+’ 能讀能寫，若檔案不存在時會發生錯誤<br />
‘w’  只能寫，若檔案不存在時會建立一新的檔案，若檔案存在則會將內容覆蓋過 去<br />
‘w+’ 能 讀能寫，若檔案不存在時會建立一新的檔案，若檔案存在則會將內容覆蓋過去<br />
‘a’  只能附加(append)使用讀的方式，若檔案不存在時會建立一新的檔案，若檔案存在則會將內 容加於檔案後方<br />
‘a+’  只能附加(append)使用讀或寫的方式，若檔案不存在時會建立一新的檔案，若檔案存在則會 將內容加於檔案後方</p>
<p>fclose關閉檔案<br />
status=fclose(fid)<br />
fclose(&#8216;all&#8217;)<br />
當執行fclose 成功就會送回一個0值給status。</p>
<p>檔案存取fscanf，fprintf，fread，fwrite<br />
若檔案內容可以分為二進位或ASCII<br />
若為ASCII碼時，檔案存取的方法為：<br />
(1)  fscanf，fprintf<br />
fscanf讀取檔案<br />
Variable=fscanf(fid,&#8217;資料格式&#8217;,讀取資料的大小)<br />
格式<br />
%g  表示為浮點數值<br />
%d  表示為十進位數值<br />
%s  表示為字串</p>
<p>A  = fscanf(fid,&#8217;%5d&#8217;)   %讀檔案格式為十進位整數<br />
A = fscanf(fid,&#8217;%5d&#8217;,100)   %只讀100筆</p>
<p>fscanf寫入檔案<br />
fprintf(fid,’資料格式’,資料矩陣或變數);</p>
<p>x  = 0:.1:1; y = [x; exp(x)];<br />
fid = fopen(&#8216;exp.txt&#8217;,'w&#8217;);<br />
fprintf(fid,&#8217;%6.2f  %12.8f\n&#8217;,y);<br />
fclose(fid);</p>
<p>(2) Variable=load(‘檔案名稱’)</p>
<p>當然必須先使用save將檔案儲存<br />
如倒案為<strong><span style="text-decoration:underline;">bb</span></strong>變數為aa</p>
<p>save  <strong><span style="text-decoration:underline;">bb</span></strong>.txt aa -ascii</p>
<p>(存為.txt主要是為了可以看到資料內容)<br />
再由load <strong><span style="text-decoration:underline;">bb</span></strong>即可</p>
<p>若檔案內容是二進位檔時，檔案存取的方法為：<br />
fread讀取檔案<br />
fread(FID,讀取的資料大小,&#8217;資料精度&#8217;)<br />
資料精度<br />
char      函符號的字元 (8位元)<br />
uchar    不含正負符號的字元 (8位元)<br />
short     短整數 (16位元，範圍在-215~215-1)<br />
int        整數 (32位元)<br />
long     長整數 (32位元，範圍在-231~231-1)<br />
ushort    不含正負符號的短整數<br />
uint      不含正負符號的短整數<br />
ulong     不含正負符號的短整數<br />
float      單精準浮點小數 (32位元)<br />
double   雙精準浮點小數 (64位元)</p>
<p>a=fread(fid)﹔  此時a為一串二進位碼<br />
b=char(a’)﹔  將二進位碼變成橫向的字串<br />
c=str2num(b);  字串變數字</p>
<p>fwrite寫入檔案<br />
fwrite  (fid,寫入資料,’資料精度’)</p>
<p>fid  = fopen(&#8216;magic5.bin&#8217;,'wb&#8217;)<br />
fwrite(fid,magic(5),&#8217;integer*4&#8242;)</p>
<p>EXAMPLE：<br />
fid=fopen(‘exp.txt’,’wt’);<br />
fprintf(fid,’%d %2.1f %4.2f’,10,20,3.2,14.58);<br />
fclose(fid);</p>
<p>x=load(‘exp.txt’);</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>matlab中fwrite函数的具体使用方法实例如下：</p>
<p>fwrite函数按照指定的数据精度将矩阵中的元素写入到文件中。其调用格式为：<br />
COUNT＝fwrite（fid，A，precision）<br />
说明：其中COUNT返回所写的数据元素个数（可缺省），fid为文件句柄，A用来存放写入文件的数据，precision代表数据精度，<span style="color:#ff0000;">常用的数据精度 有：char、uchar、int、long、float、double等</span>。缺省数据精度为uchar，即无符号字符格式。<br />
例6.8 将一个二进制矩阵存入磁盘文件中。<br />
&gt;&gt; a=[1 2 3 4 5 6 7 8 9];<br />
&gt;&gt; fid=fopen(&#8216;d:\test.bin&#8217;,'wb&#8217;)</p>
<p>%以二进制数据写入方式打开文件<br />
fid =<br />
3            %其值大于0，表示打开成功<br />
&gt;&gt; fwrite(fid,a,&#8217;double&#8217;)<br />
ans =<br />
9            %表示写入了9个数据<br />
&gt;&gt; fclose(fid)<br />
ans =<br />
0            %表示关闭成功</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/232/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/232/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/232/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=232&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/03/31/%e8%bd%89%e8%b2%bcmatlab-%e6%aa%94%e6%a1%88%e8%99%95%e7%90%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>[備忘] Linux下的verilog開發環境</title>
		<link>http://aska13.wordpress.com/2010/03/24/%e5%82%99%e5%bf%98-linux%e4%b8%8b%e7%9a%84verilog%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83/</link>
		<comments>http://aska13.wordpress.com/2010/03/24/%e5%82%99%e5%bf%98-linux%e4%b8%8b%e7%9a%84verilog%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 11:35:23 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[IC_design]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=228</guid>
		<description><![CDATA[Icarus Verilog + GTKWave compiler: Icarus Verilog yum可以直接安裝 yum install iverilog 編譯: iverilog -o outf  a.v tb_a.v 執行 outf 產生fsdb 編譯: iverilog -o outf -c filelist.f 利用-c flag 可以加入filelist檔. tb內產生fsdb的語法 initial begin $dumpfile(『./tb_ex.fsdb』); $dumpvars(0, tb_ex); end<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=228&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Icarus Verilog + GTKWave</p>
<p>compiler: Icarus Verilog<br />
yum可以直接安裝<br />
yum install iverilog</p>
<p>編譯: iverilog -o outf  a.v tb_a.v<br />
執行 outf 產生fsdb</p>
<p>編譯: iverilog -o outf -c filelist.f<br />
利用-c flag 可以加入filelist檔.</p>
<p>tb內產生fsdb的語法</p>
<p>initial begin<br />
$dumpfile(『./tb_ex.fsdb』);<br />
$dumpvars(0, tb_ex);<br />
end</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/228/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/228/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/228/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=228&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/03/24/%e5%82%99%e5%bf%98-linux%e4%b8%8b%e7%9a%84verilog%e9%96%8b%e7%99%bc%e7%92%b0%e5%a2%83/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>[轉貼] Ncverilog 的一些经验</title>
		<link>http://aska13.wordpress.com/2010/03/24/%e8%bd%89%e8%b2%bc-ncverilog-%e7%9a%84%e4%b8%80%e4%ba%9b%e7%bb%8f%e9%aa%8c/</link>
		<comments>http://aska13.wordpress.com/2010/03/24/%e8%bd%89%e8%b2%bc-ncverilog-%e7%9a%84%e4%b8%80%e4%ba%9b%e7%bb%8f%e9%aa%8c/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 11:30:35 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[IC_design]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=226</guid>
		<description><![CDATA[http://blog.21ic.com/user1/1425/archives/2008/47280.html 1.Verilog和Ncverilog命令使用库文件或库目录 ex). ncverilog -f run.f -v lib/lib.v -y lib2 +libext+.v  //一般编译文件在run.f中, 库文件在lib.v中,lib2目录中的.v文件系统自动搜索 使用库文件或库目录,只编译需要的模块而不必全部编译 2.Verilog Testbench信号记录的系统任务: 1). SHM数据库可以记录在设计仿真过程中信号的变化. 它只在probes有效的时间内记录你set probe on的信号的变化. ex). $shm_open(『waves.shm』);  //打开波形数据库 $shm_probe(top, 『AS』); // set probe on 『top』, 第二个参数:  A &#8211;  signals of the specific  scrope S &#8212; Ports of the specified scope and below, excluding library cells C &#8212; Ports of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=226&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://blog.21ic.com/user1/1425/archives/2008/47280.html</p>
<p><strong>1.Verilog和Ncverilog命令使用库文件或库目录</strong><br />
ex). ncverilog  -f run.f -v lib/lib.v -y lib2 +libext+.v  //一般编译文件在run.f中,  库文件在lib.v中,lib2目录中的.v文件系统自动搜索<br />
使用库文件或库目录,只编译需要的模块而不必全部编译</p>
<p><strong>2.Verilog Testbench信号记录的系统任务:</strong><br />
1).  SHM数据库可以记录在设计仿真过程中信号的变化. 它只在probes有效的时间内记录你set probe on的信号的变化.<br />
ex). $shm_open(『waves.shm』);  //打开波形数据库<br />
$shm_probe(top, 『AS』); // set probe on 『top』,<br />
第二个参数:  A &#8211;  signals of the specific  scrope<br />
S &#8212; Ports of the specified scope and below, excluding library cells<br />
C &#8212; Ports of the specified scope and below, including library cells<br />
AS &#8212; Signals of the specified scope and below, excluding library cells<br />
AC &#8212; Signals of the specified scope and below, including library cells<br />
还有一个 M ,表示当前scope的memories, 可以跟上面的结合使用, 『AM』 『AMS』 『AMC』<br />
什么都不加表示当前scope的ports;<br />
$shm_close    //关闭数据库<br />
2).  VCD数据库也可以记录在设计仿真过程中信号的变化. 它只记录你选择的信号的变化.<br />
ex).  $dumpfile(『filename』);    //打开数据库<br />
$dumpvars(1,  top.u1);   //scope = top.u1, depth = 1<br />
第一个参数表示深度, 为0时记录所有深度; 第二个参数表示scope,省略时表当前的scope.<br />
$dumpvars; //depth = all scope = all<br />
$dumpvars(0); //depth = all scope = current<br />
$dumpvars(1, top.u1); //depth = 1 scope = top.u1<br />
$dumpoff      //暂停记录数据改变,信号变化不写入库文件中<br />
$dumpon       //重新恢复记录<br />
3). Debussy fsdb数据库也可以记录信号的变化,它的优势是可以跟debussy结合,方便调试.<br />
如果要在ncverilog仿真时,记录信号, 首先要设置debussy:<br />
a. setenv  LD_LIBRARY_PATH :$LD_LIBRARY_PATH<br />
(path for debpli.so  file (/share/PLI/nc_xl//nc_loadpli1))<br />
b. while invoking  ncverilog use the +ncloadpli1 option.<br />
ncverilog -f  run.f +debug +ncloadpli1=debpli:deb_PLIPtr<br />
fsdb数据库文件的记录方法,是使用$fsdbDumpfile和$fsdbDumpvars系统函数,使用方法参见VCD<br />
注意:  在用ncverilog的时候,为了正确地记录波形,要使用参数: 『+access+rw』, 否则没有读写权限</p>
<p><strong>3. ncverilog编译的顺序:  ncverilog file1 file2 &#8230;.</strong><br />
有时候这些文件存在依存关系,如在file2中要用到在file1中定义的变量,这时候就要注意其编译的顺序是从后到前,就先编译file2然后才是 file2.</p>
<p><strong>4. 信号的强制赋值force</strong><br />
首先,  force语句只能在过程语句中出现,即要在initial 或者 always 中间. 去除force 用 release 语句.<br />
initial begin     force sig1 = 1&#8242;b1; &#8230; ; release sig1; end<br />
force可以对wire赋值,这时整个net都被赋值; 也可以对reg赋值.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=226&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/03/24/%e8%bd%89%e8%b2%bc-ncverilog-%e7%9a%84%e4%b8%80%e4%ba%9b%e7%bb%8f%e9%aa%8c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>sendmail alias</title>
		<link>http://aska13.wordpress.com/2010/01/30/sendmail-alias/</link>
		<comments>http://aska13.wordpress.com/2010/01/30/sendmail-alias/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 12:09:00 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=223</guid>
		<description><![CDATA[使用sendmail的alias功能 設定檔路徑: /etc/aliases ex: vr_name:  real_user1, real_user2 設定完需下指令』newaliases』<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=223&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>使用sendmail的alias功能</p>
<p>設定檔路徑: /etc/aliases<br />
ex: vr_name:  real_user1, real_user2</p>
<p>設定完需下指令』newaliases』</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/223/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/223/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/223/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=223&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/01/30/sendmail-alias/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>Perl脚本</title>
		<link>http://aska13.wordpress.com/2010/01/21/perl%e8%84%9a%e6%9c%ac/</link>
		<comments>http://aska13.wordpress.com/2010/01/21/perl%e8%84%9a%e6%9c%ac/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 03:41:42 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[IC_design]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=221</guid>
		<description><![CDATA[http://www.vaciller.com/manage/article/articledetail.asp?ID=35 Perl脚本： #!/usr/local/bin/perl -w use strict; use Getopt::Long; #use vars qw ($para); #use File::Copy; #get options my %options; GetOptions(\%options, "help&#124;h&#124;?", "deb") &#124;&#124; print_usage(); if(exists $options{help}){ print_usage(); } #tools paths my $ncvlog = "/home/cf/eda/ius/tools/bin/ncvlog"; my $ncelab = "/home/cf/eda/ius/tools/bin/ncelab"; my $ncsim = "/home/cf/eda/ius/tools/bin/ncsim"; my $verdi = "/home/cf/eda/verdi2009/bin/verdi"; my $novas = "/home/cf/eda/verdi2009/share/PLI/nc61/LINUX/nc_loadpli1/debpli.so"; #source files my $srcfile = ""; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=221&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>http://www.vaciller.com/manage/article/articledetail.asp?ID=35
Perl脚本：

#!/usr/local/bin/perl -w

use strict;
use Getopt::Long;
#use vars qw ($para);
#use File::Copy;

#get options
my %options;
GetOptions(\%options, "help|h|?", "deb") || print_usage();
if(exists $options{help}){
  print_usage();
}

#tools paths
my $ncvlog = "/home/cf/eda/ius/tools/bin/ncvlog";
my $ncelab = "/home/cf/eda/ius/tools/bin/ncelab";
my $ncsim = "/home/cf/eda/ius/tools/bin/ncsim";
my $verdi = "/home/cf/eda/verdi2009/bin/verdi";
my $novas = "/home/cf/eda/verdi2009/share/PLI/nc61/LINUX/nc_loadpli1/debpli.so";

#source files
my $srcfile = "";
$srcfile = "/home/cf/workspace/nc/counter/count.v";
$srcfile .= " /home/cf/workspace/nc/counter/count_tb.v";

#run verdi to debug
if(exists $options{deb}){
  system("$verdi -2001 $srcfile -ssf counter.fsdb");
#  system("$verdi -2001 $srcfile");
  die;
}

#compile
system("$ncvlog -messages $srcfile");

#elab
system("$ncelab -messages -access +wrc -loadpli1 $novas:deb_PLIPtr  worklib.counter_tb:module");

#simulation
system("$ncsim -messages worklib.counter_tb:module");

#the following is sub functions
sub print_usage{
  print "Run scripts: $0\n";
  print "$0 [-help|h|?] [-deb]\n";
  die;
}</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=221&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/01/21/perl%e8%84%9a%e6%9c%ac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP做簡單日曆</title>
		<link>http://aska13.wordpress.com/2010/01/19/php%e5%81%9a%e7%b0%a1%e5%96%ae%e6%97%a5%e6%9b%86/</link>
		<comments>http://aska13.wordpress.com/2010/01/19/php%e5%81%9a%e7%b0%a1%e5%96%ae%e6%97%a5%e6%9b%86/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:20:56 +0000</pubDate>
		<dc:creator>aska13</dc:creator>
				<category><![CDATA[網頁程式]]></category>

		<guid isPermaLink="false">http://aska13.wordpress.com/?p=219</guid>
		<description><![CDATA[http://pink0420.pixnet.net/blog/post/4795571 &#60;? $year = date(『Y』); $month = date(『m』); $day = date(『d』); //本月最後一天 $lastday = date(『d』,mktime (0,0,0,$month+1,0,$year)); //本月第一天星期幾 $firstweek = date(『D』,mktime (0,0,0,$month,1,$year)); //上個月最後一天 $last_month_day = date(『d』,mktime (0,0,0,$month,0,$year)); $week["Sun"] = 0; $week["Mon"] = 1; $week["Tue"] = 2; $week["Wed"] = 3; $week["Thu"] = 4; $week["Fri"] = 5; $week["Sat"] = 6; $first_day = $week[$firstweek]; $next_month_day =1; $run7 = 1; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=219&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>http://pink0420.pixnet.net/blog/post/4795571</p>
<p>&lt;?<br />
$year = date(『Y』);<br />
$month = date(『m』);<br />
$day   = date(『d』);<br />
//本月最後一天<br />
$lastday = date(『d』,mktime (0,0,0,$month+1,0,$year));<br />
//本月第一天星期幾<br />
$firstweek = date(『D』,mktime (0,0,0,$month,1,$year));<br />
//上個月最後一天<br />
$last_month_day = date(『d』,mktime (0,0,0,$month,0,$year));</p>
<p>$week["Sun"] = 0;<br />
$week["Mon"] = 1;<br />
$week["Tue"] = 2;<br />
$week["Wed"] = 3;<br />
$week["Thu"] = 4;<br />
$week["Fri"] = 5;<br />
$week["Sat"] = 6;</p>
<p>$first_day = $week[$firstweek];<br />
$next_month_day =1;<br />
$run7 = 1;<br />
echo 『&lt;table&gt;<br />
&lt;tr&gt;<br />
&lt;td colspan=7 align=center&gt;&lt;b&gt;{$year}-{$month}&lt;/b&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;Sun&lt;/td&gt;<br />
&lt;td&gt;Mon&lt;/td&gt;<br />
&lt;td&gt;Tue&lt;/td&gt;<br />
&lt;td&gt;Wed&lt;/td&gt;<br />
&lt;td&gt;Thu&lt;/td&gt;<br />
&lt;td&gt;Fri&lt;/td&gt;<br />
&lt;td&gt;Sat&lt;/td&gt;<br />
&lt;/tr&gt;』;</p>
<p>for( $i=0 ; $i&lt;35 ; $i++ ){<br />
if($run7%7 ==1 ){<br />
echo 『&lt;tr&gt;』;<br />
}<br />
if( $i&lt;$first_day ){<br />
$color = 『#666666&#8243;;<br />
$days = $lastday-($first_day-$i-1);<br />
}else if($i&lt;=$lastday+1){<br />
$color = 『#0000CC』;<br />
$days = $i-$first_day+1;<br />
}<br />
else{<br />
$color = 『#666666&#8243;;<br />
$days = $next_month_day;<br />
$next_month_day++;<br />
}<br />
echo 『&lt;td align=center&gt;&lt;font color={$color}&gt;{$days}&lt;/font&gt;&lt;/td&gt;\n』;</p>
<p>if($run7%7 ==0 ){<br />
echo 『&lt;/tr&gt;\n』;<br />
$run7 = 1;<br />
}else{<br />
$run7++;<br />
}</p>
<p>}<br />
echo 『&lt;/table&gt;』;</p>
<p>?&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aska13.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aska13.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aska13.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aska13.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aska13.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aska13.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aska13.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aska13.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aska13.wordpress.com&amp;blog=6884109&amp;post=219&amp;subd=aska13&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aska13.wordpress.com/2010/01/19/php%e5%81%9a%e7%b0%a1%e5%96%ae%e6%97%a5%e6%9b%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ab2e192b0d57ac2629a5373249af14bb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aska13</media:title>
		</media:content>
	</item>
	</channel>
</rss>
