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

<channel>
	<title>openSUSEでHomeServer - Weblog &#187; プログラミング</title>
	<atom:link href="http://weblog.linux-domain.net/category/%e3%83%97%e3%83%ad%e3%82%b0%e3%83%a9%e3%83%9f%e3%83%b3%e3%82%b0/feed" rel="self" type="application/rss+xml" />
	<link>http://weblog.linux-domain.net</link>
	<description>IT業界のことや商品を紹介していきます！</description>
	<lastBuildDate>Sun, 02 Oct 2011 13:24:49 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>gd.sh改良しました。</title>
		<link>http://weblog.linux-domain.net/2007/12/27/49.html</link>
		<comments>http://weblog.linux-domain.net/2007/12/27/49.html#comments</comments>
		<pubDate>Wed, 26 Dec 2007 21:14:47 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[シェルスクリプト]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://linux-domain.net/weblog/2007/12/27/gdsh%e6%94%b9%e8%89%af%e3%81%97%e3%81%be%e3%81%97%e3%81%9f%e3%80%82/</guid>
		<description><![CDATA[以前紹介したzsh auto_pushd のシェルスクリプトで gd.shというの書いたのですが、少し改良しました。 改良した点はdirs -v -l で表示される重複したディレクトリは表示しないよう にしたのと、逆順ソートにして最新のディレクトリが一番下に表示されるように しました。改良時間は１時間くらいなのでうまく動かない場合があるかもしれませんが その時はコメントお願いします。 では プログラムです。 ここから————– #!/bin/sh dirs -v -l &#124; awk '{ a[$1]=$2; b[$1]=$2; } END{ for( i=0; i&#60;NR; i++){ work=a[i]; checknum=0; for( j=i+1; j&#60;NR; j++){ if( work == a[j] ){ b[j] = "skip"; } } } for ( i=NR-1; i&#62;-1; i--){ if ( b[i] != [...]]]></description>
			<content:encoded><![CDATA[<p>以前紹介した<a href="http://linux-domain.net/weblog/2007/05/28/zsh-auto_pushd-%e3%81%ae%e3%82%b7%e3%82%a7%e3%83%ab%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88/">zsh auto_pushd のシェルスクリプト</a>で</p>
<p>gd.shというの書いたのですが、少し改良しました。</p>
<p>改良した点はdirs -v -l で表示される重複したディレクトリは表示しないよう</p>
<p>にしたのと、逆順ソートにして最新のディレクトリが一番下に表示されるように</p>
<p>しました。改良時間は１時間くらいなのでうまく動かない場合があるかもしれませんが</p>
<p>その時はコメントお願いします。</p>
<p>では プログラムです。</p>
<p>ここから————–</p>
<pre>#!/bin/sh
dirs -v -l | awk '{
    a[$1]=$2;
    b[$1]=$2;
}
END{
    for( i=0; i&lt;NR; i++){
        work=a[i];
        checknum=0;
        for( j=i+1; j&lt;NR; j++){
            if( work == a[j] ){
                b[j] = "skip";
            }
        }
    }
    for ( i=NR-1; i&gt;-1; i--){
        if ( b[i] != "skip"){
            printf("%d %s\n",i,b[i]);
        }
    }
}'
echo 移動したい番号を選んでください。
read newdir
# 入力値に1をプラスし、その終了ステータスを判定する。
expr 1 + $newdir &gt;/dev/null 2&gt;&amp;1
case $? in
    0 | 1 )var=`dirs -v -l |grep -w $newdir |awk '{printf("%s\n",$2)}'`
        cd $var;;
    * ) echo " 数字以外が入力されました &gt;$newdir" ;;
esac</pre>
<p>ここまで————–</p>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/12/27/49.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Javaにはポインタがない！！</title>
		<link>http://weblog.linux-domain.net/2007/09/10/45.html</link>
		<comments>http://weblog.linux-domain.net/2007/09/10/45.html#comments</comments>
		<pubDate>Mon, 10 Sep 2007 11:57:30 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[プログラミング]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://linux-domain.net/weblog/2007/09/10/java%e3%81%ab%e3%81%af%e3%83%9d%e3%82%a4%e3%83%b3%e3%82%bf%e3%81%8c%e3%81%aa%e3%81%84%ef%bc%81%ef%bc%81/</guid>
		<description><![CDATA[よくJavaにはポインタがないのでＣ言語よりもわかりやすい という人をよく見かける。 確かに明示的なポインタの宣言はJavaにはない。 だがポインタという概念がなくなったわけではないと私は思う。 例えば以下プログラムはどうだろう？ class test{     public static void main(String[] args){         tmp a =new tmp();         tmp b =new tmp();         a.data=10;         b.data=20;         a = b;         b.data=100;         System.out.println(&#8220;a= &#8221; +a.data);         System.out.println(&#8220;b= &#8221; +b.data);     } } class tmp{     int data; } 実行結果は以下の通りである。 a= 100 b= 100 [...]]]></description>
			<content:encoded><![CDATA[<p>よくJavaにはポインタがないのでＣ言語よりもわかりやすい</p>
<p>という人をよく見かける。</p>
<p>確かに明示的なポインタの宣言はJavaにはない。</p>
<p>だがポインタという概念がなくなったわけではないと私は思う。</p>
<p>例えば以下プログラムはどうだろう？</p>
<p>class test{<br />
    public static void main(String[] args){<br />
        tmp a =new tmp();<br />
        tmp b =new tmp();<br />
        a.data=10;<br />
        b.data=20;<br />
        a = b;<br />
        b.data=100;</p>
<p>        System.out.println(&#8220;a= &#8221; +a.data);<br />
        System.out.println(&#8220;b= &#8221; +b.data);<br />
    }<br />
}<br />
class tmp{<br />
    int data;<br />
}</p>
<p>実行結果は以下の通りである。<br />
a= 100<br />
b= 100</p>
<p>どうだろう？</p>
<p>a=10</p>
<p>b=100</p>
<p>と想像してしまった人はいないだろうか？</p>
<p>どこでa.dataに100という数字が入ってきてしまったんだろう？</p>
<p>問題は</p>
<p>a = b;<br />
の箇所だ。</p>
<p>そうクラスは参照型なのである。</p>
<p>つまりclass tmp aにはクラスのアドレスが格納されている。</p>
<p>これはＣ言語でいうポインタとほぼ一緒ではないだろうか？</p>
<p>クラスのアドレスが格納されているので</p>
<p>a=b;</p>
<p>でアドレスの参照先が一緒になってしまう。</p>
<p>参照先が一緒なので</p>
<p>b.data=100;</p>
<p>でa.dataも100になってしまうというわけだ。</p>
<p>ポインタという概念がない人にとっては</p>
<p>戸惑ってしまうだろう。</p>
<table border="0" cellpadding="5">
<tr>
<td colspan="2"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4798013005/suselinuxhome-22/" target="_blank">Javaのオブジェクト指向がゼッタイにわかる本―最初からそう教えてくれればいいのに!</a></td>
</tr>
<tr>
<td valign="top"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4798013005/suselinuxhome-22/" target="_blank"><img src="http://ecx.images-amazon.com/images/I/51WNK7S07FL._SL160_.jpg" border="0" alt="Javaのオブジェクト指向がゼッタイにわかる本―最初からそう教えてくれればいいのに!" /></a></td>
<td valign="top"><font size="-1">立山 秀利</p>
<p>秀和システム  2006-05<br />売り上げランキング : 148137</p>
<p><strong>おすすめ平均  </strong><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" /><br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />タイトルはあやしいが、結構わかりやすい<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />オブジェクト指向って何？っていう初心者に、いいです。</p>
<p><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4798013005/suselinuxhome-22/" target="_blank">Amazonで詳しく見る</a></font><font size="-2"> by <a href="http://www.goodpic.com/mt/aws/index.html" >G-Tools</a></font></td>
</tr>
</table>
<table border="0" cellpadding="5">
<tr>
<td colspan="2"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4756142524/suselinuxhome-22/" target="_blank">Javaを独習する前に読む本</a></td>
</tr>
<tr>
<td valign="top"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4756142524/suselinuxhome-22/" target="_blank"><img src="http://ecx.images-amazon.com/images/I/51C7PR6W5QL._SL160_.jpg" border="0" alt="Javaを独習する前に読む本" /></a></td>
<td valign="top"><font size="-1">青木 峰郎</p>
<p>アスキー  2003-02<br />売り上げランキング : 269320</p>
<p><strong>おすすめ平均  </strong><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" /><br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />独習したい人の最初の本に最適<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />Javaの世界をのぞくのに最適<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />もっと早くこの本に出会いたかった</p>
<p><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4756142524/suselinuxhome-22/" target="_blank">Amazonで詳しく見る</a></font><font size="-2"> by <a href="http://www.goodpic.com/mt/aws/index.html" >G-Tools</a></font></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/09/10/45.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>シェルスクリプト　コンパイラ　shc</title>
		<link>http://weblog.linux-domain.net/2007/07/05/35.html</link>
		<comments>http://weblog.linux-domain.net/2007/07/05/35.html#comments</comments>
		<pubDate>Thu, 05 Jul 2007 10:43:37 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[シェルスクリプト]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://suselinux-server.com/weblog/2007/07/05/%e3%82%b7%e3%82%a7%e3%83%ab%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%80%80%e3%82%b3%e3%83%b3%e3%83%91%e3%82%a4%e3%83%a9%e3%80%80shc/</guid>
		<description><![CDATA[みなさんLinuxやUnixでバックアップや毎日定期的に動かしたい プログラムなどはシェルで作ってそれをcronなどで登録してると 思うのですが、シェルの中身はテキストなので、パスワードもそのまま丸見えの状態ではないでしょうか？ セキュリティ上パスワードが丸見えというのは、危険だと思うので どうにかなかならないものかと思っていたら シェルスクリプトをバイナリの実行形式にコンパイルするツールを発見しました。 その名もshc です。 これでコンパイルしたら一緒にC言語ファイル（中身はたぶんよくわからない用になっている）も作成されるので、シェルスクリプトを配布したいが、ソースは公開したくないと時にも使える。 もちろんシェルの暗号化にも使える。 一度試してみてはいかがでしょうか？ UNIXシェルスクリプトコマンドブック 山下 哲典 ソフトバンククリエイティブ 2005-05-25売り上げランキング : 94863 おすすめ平均 最強！秘密兵器 Amazonで詳しく見る by G-Tools UNIX シェルスクリプト辞典 (Desktop reference) 志田 智 翔泳社 2005-07-23売り上げランキング : 372552 おすすめ平均 よみやすい Amazonで詳しく見る by G-Tools]]></description>
			<content:encoded><![CDATA[<p>みなさんLinuxやUnixでバックアップや毎日定期的に動かしたい</p>
<p>プログラムなどはシェルで作ってそれをcronなどで登録してると</p>
<p>思うのですが、シェルの中身はテキストなので、パスワードもそのまま丸見えの状態ではないでしょうか？</p>
<p>セキュリティ上パスワードが丸見えというのは、危険だと思うので</p>
<p>どうにかなかならないものかと思っていたら<br />
シェルスクリプトをバイナリの実行形式にコンパイルするツールを発見しました。</p>
<p>その名も<a href="http://translation.azurestone.org/shc/"><strong>shc</strong></a> です。<br />
これでコンパイルしたら一緒にC言語ファイル（中身はたぶんよくわからない用になっている）も作成されるので、シェルスクリプトを配布したいが、ソースは公開したくないと時にも使える。</p>
<p>もちろんシェルの暗号化にも使える。</p>
<p>一度試してみてはいかがでしょうか？</p>
<table border="0" cellpadding="5">
<tr>
<td colspan="2"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4797330635/suselinuxhome-22/" target="_top">UNIXシェルスクリプトコマンドブック</a></td>
</tr>
<tr>
<td valign="top"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4797330635/suselinuxhome-22/" target="_top"><img src="http://ecx.images-amazon.com/images/I/514MGKZR89L._SL160_.jpg" border="0" alt="UNIXシェルスクリプトコマンドブック" /></a></td>
<td valign="top"><font size="-1">山下 哲典</p>
<p>ソフトバンククリエイティブ  2005-05-25<br />売り上げランキング : 94863</p>
<p><strong>おすすめ平均  </strong><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" /><br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />最強！<br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />秘密兵器</p>
<p><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4797330635/suselinuxhome-22/" target="_top">Amazonで詳しく見る</a></font><font size="-2"> by <a href="http://www.goodpic.com/mt/aws/index.html" >G-Tools</a></font></td>
</tr>
</table>
<table border="0" cellpadding="5">
<tr>
<td colspan="2"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4798109231/suselinuxhome-22/" target="_top">UNIX シェルスクリプト辞典 (Desktop reference)</a></td>
</tr>
<tr>
<td valign="top"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4798109231/suselinuxhome-22/" target="_top"><img src="http://ecx.images-amazon.com/images/I/510RRRR4JCL._SL160_.jpg" border="0" alt="UNIX シェルスクリプト辞典 (Desktop reference)" /></a></td>
<td valign="top"><font size="-1">志田 智</p>
<p>翔泳社  2005-07-23<br />売り上げランキング : 372552</p>
<p><strong>おすすめ平均  </strong><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" /><br /><img src="http://g-images.amazon.com/images/G/01/detail/stars-5-0.gif" alt="star" />よみやすい</p>
<p><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4798109231/suselinuxhome-22/" target="_top">Amazonで詳しく見る</a></font><font size="-2"> by <a href="http://www.goodpic.com/mt/aws/index.html" >G-Tools</a></font></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/07/05/35.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>zsh auto_pushd のシェルスクリプト</title>
		<link>http://weblog.linux-domain.net/2007/05/28/30.html</link>
		<comments>http://weblog.linux-domain.net/2007/05/28/30.html#comments</comments>
		<pubDate>Mon, 28 May 2007 12:53:00 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[シェルスクリプト]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://suselinux-server.com/weblog/?p=30</guid>
		<description><![CDATA[LinuxやUnixを使っている人はシェルというものにこだわりがあるものだ。 solarisやBSD系の人はだいたいcsh tcsh。Linuxの人はbashが定番なのだが、 zshはご存知だろうか？アルファベットのｚがついているので最後のシェルという 意味らしいのだが、その名にふさわしく最強のシェルだそうだ。 どんな感じかは漢のzshというコラムに zshの魅力が紹介されている。 この中のsetopt auto_pushd　というオプションが便利だな～と私は使ってみて思った。 ということで、シェルスクリプトで似たような感じができないかなと思ったので、作ってみました。 けっこうzshが入ってる環境は少ないもので（笑） とりあえず下記のプログラムをファイルに保存し実行権限をつけてください。 ここではgd.shという名前に保存したとする。 ここから&#8212;&#8212;&#8212;&#8212;&#8211; #!/bin/sh dirs -v echo 移動したい番号を選んでください。 read newdir # 入力値に1をプラスし、その終了ステータスを判定する。 expr 1 + $newdir &#62;/dev/null 2&#62;&#38;1 case $? in 0 &#124; 1 )var=`dirs -v -l &#124; grep -w $newdir &#124; awk '{printf("%s\n",$2)}'` cd $var;; * ) echo " 数字以外が入力されました &#62;$newdir" ;; esac [...]]]></description>
			<content:encoded><![CDATA[<p>LinuxやUnixを使っている人はシェルというものにこだわりがあるものだ。<br />
solarisやBSD系の人はだいたいcsh tcsh。Linuxの人はbashが定番なのだが、<br />
zshはご存知だろうか？アルファベットのｚがついているので最後のシェルという<br />
意味らしいのだが、その名にふさわしく最強のシェルだそうだ。</p>
<p>どんな感じかは<a href="http://journal.mycom.co.jp/column/zsh/">漢のzsh</a>というコラムに<br />
zshの魅力が紹介されている。</p>
<p>この中のsetopt auto_pushd　というオプションが便利だな～と私は使ってみて思った。<br />
ということで、シェルスクリプトで似たような感じができないかなと思ったので、作ってみました。<br />
けっこうzshが入ってる環境は少ないもので（笑）</p>
<p>とりあえず下記のプログラムをファイルに保存し実行権限をつけてください。<br />
ここではgd.shという名前に保存したとする。</p>
<p>ここから&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<pre>#!/bin/sh
dirs -v
echo 移動したい番号を選んでください。
read newdir

# 入力値に1をプラスし、その終了ステータスを判定する。
expr 1 + $newdir &gt;/dev/null 2&gt;&amp;1
case $? in
    0 | 1 )var=`dirs -v -l | grep -w $newdir | awk '{printf("%s\n",$2)}'`
               cd $var;;
        * ) echo " 数字以外が入力されました &gt;$newdir" ;;
esac</pre>
<p>ここまで&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>そして、pathが通っているとこに持っていってください。<br />
次にaliasに下記を設定してください。<br />
alias gd=&#8217;. gd.sh&#8217;<br />
alias cd=&#8217;pushd &gt; /dev/null&#8217;</p>
<p>これで終了です。<br />
# gd<br />
で起動できると思います。<br />
あとはお好きにしてください。</p>
<p>また便利なシェルスクリプトを作ったら載せてみたいと思います。</p>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/05/28/30.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>パフォーマンス</title>
		<link>http://weblog.linux-domain.net/2007/01/28/23.html</link>
		<comments>http://weblog.linux-domain.net/2007/01/28/23.html#comments</comments>
		<pubDate>Sun, 28 Jan 2007 14:10:37 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[プログラミング]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://suselinux-server.com/weblog/?p=23</guid>
		<description><![CDATA[パフォーマンスを考えているコーディングしているだろうか？ 私もできれば速く効率のよいコードが良いと 考えていたのだが、必ずしもそれが良いコードではないということを知った。 Donald Knutは「An Empirical Study of Fortan Programs」という論文の中 で、プログラムの４％未満が実行時間の５０％以上を占めているとしている。 つまりプログラムのほんの４％が実行時間の大半を占めているので、プログラムを コーディングする際にパフォーマンスを考慮してコーディングするのではなく 読みやすさメンテナンスを最優先コーディングすべきだと思う。 実際にプログラムが完成したところで実行して遅いと感じたらパフォーマンスの ことを考えても遅くないと思う。実際にプロファイラなどを使ってどこの 箇所が実行を遅くしているのかを調べる必要がある。まあその箇所も全体の４％ を探しあててそこ改善すればだいたいＯＫになるはずだ。 なので最初からコーディングする際にパフォーマンスを意識して 全体を速くしても意味がないし効率が悪いし、パフォーマンスを意識して 読みやすさメンテナスが悪くなっては元も子ないのである。 コードチューニングのテクニックで「行数が少ない方が速い」という定説があるがこれは嘘である。 下の例 rei1： for i =1 to 10 　　a[i] = i end for rei2: a[1]=1 a[2]=2 a[3]=3 a[4]=4 a{5]=5 a[6]=6 a[7]=7 a{8]=8 a[9]=9 a[10]=10 行数が少ない方が速いのというならrei1のほうが速いと考えるだろうが 実際には 言語 rei1の所要時間 rei2の所要時間 Visual Basic 8.47 3.16 Java [...]]]></description>
			<content:encoded><![CDATA[<p>パフォーマンスを考えているコーディングしているだろうか？<br />
私もできれば速く効率のよいコードが良いと<br />
考えていたのだが、必ずしもそれが良いコードではないということを知った。</p>
<p>Donald Knutは「An Empirical Study of Fortan Programs」という論文の中<br />
で、プログラムの４％未満が実行時間の５０％以上を占めているとしている。<br />
つまりプログラムのほんの４％が実行時間の大半を占めているので、プログラムを<br />
コーディングする際にパフォーマンスを考慮してコーディングするのではなく<br />
読みやすさメンテナンスを最優先コーディングすべきだと思う。</p>
<p>実際にプログラムが完成したところで実行して遅いと感じたらパフォーマンスの<br />
ことを考えても遅くないと思う。実際にプロファイラなどを使ってどこの<br />
箇所が実行を遅くしているのかを調べる必要がある。まあその箇所も全体の４％<br />
を探しあててそこ改善すればだいたいＯＫになるはずだ。</p>
<p>なので最初からコーディングする際にパフォーマンスを意識して<br />
全体を速くしても意味がないし効率が悪いし、パフォーマンスを意識して<br />
読みやすさメンテナスが悪くなっては元も子ないのである。</p>
<p>コードチューニングのテクニックで「行数が少ない方が速い」という定説があるがこれは嘘である。<br />
下の例</p>
<pre>

rei1：
for i =1 to 10
　　a[i] = i
end for

rei2:
a[1]=1
a[2]=2
a[3]=3
a[4]=4
a{5]=5
a[6]=6
a[7]=7
a{8]=8
a[9]=9
a[10]=10
</pre>
</p>
<p>行数が少ない方が速いのというならrei1のほうが速いと考えるだろうが<br />
実際には</p>
<table border="1">
<tbody>
<tr>
<td>言語</td>
<td>rei1の所要時間</td>
<td>rei2の所要時間</td>
</tr>
<tr>
<td>Visual Basic</td>
<td>8.47</td>
<td>3.16</td>
</tr>
<tr>
<td>Java</td>
<td>12.6</td>
<td>3.23</td>
</tr>
</tbody>
</table>
<p>である。驚きだろうがコードの行数を減らしたからといって速度には関係ないのである。<br />
またコンパイラにもよって速度というのは変わってくるので、以前この方法で速くなったという<br />
経験則はまったく通じないのである。<br />
またこの続きはいつか書きたいと思う。</p>
<div class="amazlet-box" style="margin-bottom:0px;">
<div class="amazlet-image" style="float:left;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873111528/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank"><img src="http://images-jp.amazon.com/images/P/4873111528.09.MZZZZZZZ.jpg" alt="Unixシステムパフォーマンスチューニング 第2版" style="border: none;" /></a></div>
<div class="amazlet-info" style="float:left;margin-left:15px;line-height:120%">
<div class="amazlet-name" style="margin-bottom:10px;line-height:120%"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873111528/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank">Unixシステムパフォーマンスチューニング 第2版</a></p>
<div class="amazlet-powered-date" style="font-size:7pt;margin-top:5px;font-family:verdana;line-height:120%">posted with <a href="http://www.amazlet.com/browse/ASIN/4873111528/suselinuxhome-22" title="Unixシステムパフォーマンスチューニング 第2版" target="_blank">amazlet</a> on 07.01.28</div>
</div>
<div class="amazlet-detail">ジャン‐パオロ・D. ムズメキ マイク ルキダス Gian‐Paolo D. Musumeci Mike Loukides 砂原 秀樹 高橋 敏明 岡島 順治郎 <br />オライリージャパン <br />売り上げランキング: 190235</div>
<div class="amazlet-review" style="margin-top:10px; margin-bottom:10px">
<div class="amazlet-review-average" style="margin-bottom:5px">おすすめ度の平均: <img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif" alt="4.0" /></div>
<p><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-3-0.gif" alt="3" /> チューニングの初歩<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif" alt="5" /> 第２版はすごい　SolarisとLinux対応</p>
</div>
<div class="amazlet-link" style="margin-top: 5px"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873111528/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank">Amazon.co.jp で詳細を見る</a></div>
</div>
<div class="amazlet-footer" style="clear: left"></div>
</div>
<div class="amazlet-box" style="margin-bottom:0px;">
<div class="amazlet-image" style="float:left;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873111560/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank"><img src="http://images-jp.amazon.com/images/P/4873111560.09.MZZZZZZZ.jpg" alt="Javaパフォーマンスチューニング 第2版" style="border: none;" /></a></div>
<div class="amazlet-info" style="float:left;margin-left:15px;line-height:120%">
<div class="amazlet-name" style="margin-bottom:10px;line-height:120%"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873111560/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank">Javaパフォーマンスチューニング 第2版</a></p>
<div class="amazlet-powered-date" style="font-size:7pt;margin-top:5px;font-family:verdana;line-height:120%">posted with <a href="http://www.amazlet.com/browse/ASIN/4873111560/suselinuxhome-22" title="Javaパフォーマンスチューニング 第2版" target="_blank">amazlet</a> on 07.01.28</div>
</div>
<div class="amazlet-detail">ジャック シラジ Jack Shirazi 今野 睦 福与 直也 杉野 博史 <br />オライリージャパン <br />売り上げランキング: 218786</div>
<div class="amazlet-review" style="margin-top:10px; margin-bottom:10px">
<div class="amazlet-review-average" style="margin-bottom:5px">おすすめ度の平均: <img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-3-0.gif" alt="3.0" /></div>
<p><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-2-0.gif" alt="2" /> 内容は良いんですが．．．<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif" alt="4" /> コードレベルのパフォーマンスチューニング</p>
</div>
<div class="amazlet-link" style="margin-top: 5px"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/4873111560/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank">Amazon.co.jp で詳細を見る</a></div>
</div>
<div class="amazlet-footer" style="clear: left"></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/01/28/23.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessにテーブルを作成する</title>
		<link>http://weblog.linux-domain.net/2007/01/22/22.html</link>
		<comments>http://weblog.linux-domain.net/2007/01/22/22.html#comments</comments>
		<pubDate>Sun, 21 Jan 2007 15:34:01 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://suselinux-server.com/weblog/?p=22</guid>
		<description><![CDATA[Accessにテーブル追加するサンプルです。 private void button1_Click(object sender, System.EventArgs e) {　　  　　 System.Data.OleDb.OleDbConnection cn =   　　new System.Data.OleDb.OleDbConnection();   　　System.Data.OleDb.OleDbCommand cmd; 　　　// 接続文字列を設定してデータベースに接続する   　　cn.ConnectionString = &#8220;Provider=Microsoft.Jet.OLEDB.4.0;&#8221;   　　+ &#8220;Data Source=C:¥tmp¥DBSample.mdb;&#8221;;   　　cn.Open(); 　　　// 追加するテーブルが存在していたら削除しておく   　　try   　　{   　　　　cmd = new System.Data.OleDb.OleDbCommand(   　　　　&#8221;DROP TABLE 社員&#8221;, cn);   　　　　cmd.ExecuteNonQuery();   　　}   　　catch{} 　　　try   　　{ [...]]]></description>
			<content:encoded><![CDATA[<p>Accessにテーブル追加するサンプルです。</p>
<p>private void button1_Click(object sender, System.EventArgs e)<br />
{　　<br />
 　　 System.Data.OleDb.OleDbConnection cn =<br />
  　　new System.Data.OleDb.OleDbConnection();<br />
  　　System.Data.OleDb.OleDbCommand cmd;</p>
<p>　　　// 接続文字列を設定してデータベースに接続する<br />
  　　cn.ConnectionString = &#8220;Provider=Microsoft.Jet.OLEDB.4.0;&#8221;<br />
  　　+ &#8220;Data Source=C:¥tmp¥DBSample.mdb;&#8221;;<br />
  　　cn.Open();</p>
<p>　　　// 追加するテーブルが存在していたら削除しておく<br />
  　　try<br />
  　　{<br />
  　　　　cmd = new System.Data.OleDb.OleDbCommand(<br />
  　　　　&#8221;DROP TABLE 社員&#8221;, cn);<br />
  　　　　cmd.ExecuteNonQuery();<br />
  　　}<br />
  　　catch{}</p>
<p>　　　try<br />
  　　{<br />
  　　　　// 社員 テーブルを追加する<br />
  　　　　cmd = new System.Data.OleDb.OleDbCommand(<br />
  　　　　&#8221;CREATE TABLE 社員(社員番号 INT, 氏名 TEXT(30))&#8221;, cn);<br />
  　　　　cmd.ExecuteNonQuery();<br />
  　　}<br />
  　　catch( Exception ex)<br />
  　　{<br />
  　　　　MessageBox.Show(ex.Message.ToString());<br />
  　　}　</p>
<p>　　　// データベースへの接続を切断する<br />
  　　cn.Close();</p>
<p>　　　MessageBox.Show(&#8220;［社員］テーブルを追加しました。&#8221;, &#8220;結果通知&#8221;);<br />
}</p>
<p style="float: left" class="amazlet-image"><a name="amazletlink" target="_blank" href="http://www.amazon.co.jp/exec/obidos/ASIN/4883375072/suselinuxhome-22/ref=nosim/" title="amazletlink"><img src="http://images-jp.amazon.com/images/P/4883375072.09.MZZZZZZZ.jpg" alt="速効解決!逆引きハンドブックVisual C#" style="border: medium none" /></a></p>
<p style="margin-bottom: 10px; line-height: 120%" class="amazlet-name"><a name="amazletlink" target="_blank" href="http://www.amazon.co.jp/exec/obidos/ASIN/4883375072/suselinuxhome-22/ref=nosim/" title="amazletlink">速効解決!逆引きハンドブックVisual C#</a></p>
<p style="margin-top: 5px; font-size: 7pt; line-height: 120%; font-family: verdana" class="amazlet-powered-date">posted with <a target="_blank" href="http://www.amazlet.com/browse/ASIN/4883375072/suselinuxhome-22" title="速効解決!逆引きハンドブックVisual C#">amazlet</a> on 07.01.22</p>
<p class="amazlet-detail">日向 俊二<br />
ソシム<br />
売り上げランキング: 9460
</p>
<p style="margin-bottom: 5px" class="amazlet-review-average">おすすめ度の平均: <img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif" alt="5.0" /></p>
<p><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-5-0.gif" alt="5" /> 手許においておくと便利</p>
<p style="margin-top: 5px" class="amazlet-link"><a name="amazletlink" target="_blank" href="http://www.amazon.co.jp/exec/obidos/ASIN/4883375072/suselinuxhome-22/ref=nosim/" title="amazletlink">Amazon.co.jp で詳細を見る</a></p>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/01/22/22.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessのテーブル一覧取得</title>
		<link>http://weblog.linux-domain.net/2007/01/17/21.html</link>
		<comments>http://weblog.linux-domain.net/2007/01/17/21.html#comments</comments>
		<pubDate>Wed, 17 Jan 2007 14:10:20 +0000</pubDate>
		<dc:creator>管理人</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://suselinux-server.com/weblog/?p=21</guid>
		<description><![CDATA[たまにはプログラム的なことも書こうかなと思いまして リファレンス的なものを作っていこうかなと。 なにかの役に立つかもしれなので（なんの役に立つかはわからないが・・） 環境はVisual C# 2005 Express Editionです。 ということで、Accessのファイルのテーブル一覧取得です。 private void button1_Click(object sender, System.EventArgs e){ System.Data.OleDb.OleDbConnection cn = new System.Data.OleDb.OleDbConnection(); DataTable dt; // 接続文字列を設定してデータベースに接続する cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:¥tmp¥DBSample.mdb;"; cn.Open(); // テーブル一覧を取得する dt = cn.GetOleDbSchemaTable( System.Data.OleDb.OleDbSchemaGuid.Tables , new object[] {null, null, null, "TABLE"}); // データベースへの接続を切断する cn.Close(); // 結果を表示する foreach(DataRow dtRow in dt.Rows) System.Diagnostics.Debug.WriteLine(dtRow[2].ToString()); } [...]]]></description>
			<content:encoded><![CDATA[<p>たまにはプログラム的なことも書こうかなと思いまして<br />
リファレンス的なものを作っていこうかなと。</p>
<p>なにかの役に立つかもしれなので（なんの役に立つかはわからないが・・）</p>
<p>環境は<a href="http://www.microsoft.com/japan/msdn/vstudio/express/vcsharp/">Visual C# 2005 Express Edition</a>です。</p>
<p>ということで、Accessのファイルのテーブル一覧取得です。</p>
<pre>
private void button1_Click(object sender, System.EventArgs e){
    System.Data.OleDb.OleDbConnection cn =
        new System.Data.OleDb.OleDbConnection();
    DataTable dt;

    // 接続文字列を設定してデータベースに接続する
    cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"
        + "Data Source=C:¥tmp¥DBSample.mdb;";
    cn.Open();

    // テーブル一覧を取得する
    dt = cn.GetOleDbSchemaTable(
        System.Data.OleDb.OleDbSchemaGuid.Tables
        , new object[] {null, null, null, "TABLE"});

     // データベースへの接続を切断する
    cn.Close();

    // 結果を表示する
    foreach(DataRow dtRow in dt.Rows)
        System.Diagnostics.Debug.WriteLine(dtRow[2].ToString());
}
</pre>
<p>結果は出力ウィンドウに表示されます。</p>
<div class="amazlet-box" style="margin-bottom:0px;">
<div class="amazlet-image" style="float:left;"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/479810146X/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank"><img src="http://images-jp.amazon.com/images/P/479810146X.09.MZZZZZZZ.jpg" alt="独習C#" style="border: none;" /></a></div>
<div class="amazlet-info" style="float:left;margin-left:15px;line-height:120%">
<div class="amazlet-name" style="margin-bottom:10px;line-height:120%"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/479810146X/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank">独習C#</a></p>
<div class="amazlet-powered-date" style="font-size:7pt;margin-top:5px;font-family:verdana;line-height:120%">posted with <a href="http://www.amazlet.com/browse/ASIN/479810146X/suselinuxhome-22" title="独習C#" target="_blank">amazlet</a> on 07.01.17</div>
</div>
<div class="amazlet-detail">ハーバート シルト Herbert Schildt スリーエーシステムズ 矢嶋 聡 <br />翔泳社 <br />売り上げランキング: 43705</div>
<div class="amazlet-review" style="margin-top:10px; margin-bottom:10px">
<div class="amazlet-review-average" style="margin-bottom:5px">おすすめ度の平均: <img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif" alt="4.0" /></div>
<p><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif" alt="4" /> C#の文法を学ぶ本だというのは確かにそのとおり<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif" alt="4" /> .NET Frameworkの解説書ではありません、文法マニュアルです<br /><img src="http://images-jp.amazon.com/images/G/09/x-locale/common/customer-reviews/stars-4-0.gif" alt="4" /> この本はC#の文法の本です。</p>
</div>
<div class="amazlet-link" style="margin-top: 5px"><a href="http://www.amazon.co.jp/exec/obidos/ASIN/479810146X/suselinuxhome-22/ref=nosim/" name="amazletlink" target="_blank">Amazon.co.jp で詳細を見る</a></div>
</div>
<div class="amazlet-footer" style="clear: left"></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://weblog.linux-domain.net/2007/01/17/21.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

