<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1053615194817097162</id><updated>2024-10-02T15:30:38.434+09:00</updated><category term="Tips"/><category term="C/C++"/><category term="Lua"/><category term="心理学"/><category term="開発"/><category term="JScript"/><category term="PHP"/><category term="JavaScript"/><category term="WSH"/><category term="コンパイルエラー"/><category term="DB"/><category term="デザインパターン"/><category term="テスト"/><category term="EXCEL"/><category term="HTML"/><category term="VC++"/><category term="Xcode"/><category term="blogger"/><category term="コミュニケーション"/><category term="生活"/><category term="CSS"/><category term="Objective-C"/><category term="Smarty"/><category term="UML"/><category term="iphone"/><category term="photoshop"/><category term="sqlite iphone"/><category term="マネージメント"/><category term="豆知識"/><category term="遊び"/><title type='text'>Snowy Code</title><subtitle type='html'>このブログは主に&#xa;C&#xa;C++&#xa;PHP&#xa;WSH&#xa;XCODE&#xa;オブジェクト指向&#xa;に関する記事が多いはず！</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>95</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-617937041199804330</id><published>2011-04-22T16:39:00.000+09:00</published><updated>2011-04-22T16:39:29.649+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="マネージメント"/><title type='text'>客の要求＋αのα</title><content type='html'>それは物事を先読みして客の為に何が出来るか、客の立場になって考えると答えが出てくるのであった・・・</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/617937041199804330/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2011/04/blog-post.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/617937041199804330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/617937041199804330'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2011/04/blog-post.html' title='客の要求＋αのα'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-4397129052744407483</id><published>2010-11-16T13:05:00.005+09:00</published><updated>2010-11-16T13:08:38.060+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sqlite iphone"/><title type='text'>sqlite3で外部のsqlファイルを実行するコマンド</title><content type='html'>sqlite&amp;gt; .read create.sql&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/4397129052744407483/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/11/sqlite3sql.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4397129052744407483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4397129052744407483'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/11/sqlite3sql.html' title='sqlite3で外部のsqlファイルを実行するコマンド'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-7889601509216293592</id><published>2010-08-13T00:10:00.000+09:00</published><updated>2010-08-13T00:10:16.408+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><category scheme="http://www.blogger.com/atom/ns#" term="Smarty"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>SmartyでPHPの関数を呼ぶ</title><content type='html'>&lt;b&gt;Smarty&lt;/b&gt;で&lt;b&gt;配列&lt;/b&gt;の&lt;b&gt;数&lt;/b&gt;を&lt;b&gt;取得&lt;/b&gt;するにはどうすればいんだろうと、調べていたら&lt;br /&gt;
{$array|@count}&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;$array：配列&lt;/li&gt;
&lt;li&gt;@：$arrayが配列ですよと指定している&lt;/li&gt;
&lt;li&gt;count：PHPのcount関数&lt;/li&gt;
&lt;/ul&gt;で出来ると言うことがわかりました。&lt;br /&gt;
そんでもってcount()はPHPの関数で、それはつまりSmartyからPHPの関数を呼び出すことが出来るってことです。しらなかったぁ～</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/7889601509216293592/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/08/smartyphp.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/7889601509216293592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/7889601509216293592'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/08/smartyphp.html' title='SmartyでPHPの関数を呼ぶ'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-7419148318792446710</id><published>2010-07-27T02:30:00.001+09:00</published><updated>2010-07-27T02:31:13.705+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="photoshop"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>photoshopで移動とかするときにグリッドや端に張り付かないようにする</title><content type='html'>え～&lt;b&gt;PhotoShop&lt;/b&gt;ってかなり出来る子なんで、選択して移動とかするときグリッドや画像の端っことかにかってに張り付いてくれますよね、でもね&lt;br /&gt;
「よけーなことすんじゃねぇ」って思うときがたまにあるんですよね、&lt;br /&gt;
こう、マウステクを駆使してちょっとだけ、ほんの１pxだけとか移動したいのにグイってなっちゃうんですよね。そんなときは&lt;br /&gt;
上段メニューの[ビュー]にある[スナップ]のチェックをハズします。（photshop 6.0の場合）&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89Y6aPJynctEpZ1_3WVFV23SyoX-2mSp5pp_yO5P8kOxWprzdpM6jpstJgSkOgGaDjH9VKt5REhO6wMAu_js6BV48j36SN_QNvwe466Idl7jEXWI5bgc9Ri7d5MKi5ksZyzpC6LsWpR7C/s1600/%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E3%83%9C%E3%83%BC%E3%83%8902.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89Y6aPJynctEpZ1_3WVFV23SyoX-2mSp5pp_yO5P8kOxWprzdpM6jpstJgSkOgGaDjH9VKt5REhO6wMAu_js6BV48j36SN_QNvwe466Idl7jEXWI5bgc9Ri7d5MKi5ksZyzpC6LsWpR7C/s320/%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E3%83%9C%E3%83%BC%E3%83%8902.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;これです。&lt;br /&gt;
これで移動とかするときスナップされなくなって微調整ができます。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/7419148318792446710/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/photoshop.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/7419148318792446710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/7419148318792446710'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/photoshop.html' title='photoshopで移動とかするときにグリッドや端に張り付かないようにする'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj89Y6aPJynctEpZ1_3WVFV23SyoX-2mSp5pp_yO5P8kOxWprzdpM6jpstJgSkOgGaDjH9VKt5REhO6wMAu_js6BV48j36SN_QNvwe466Idl7jEXWI5bgc9Ri7d5MKi5ksZyzpC6LsWpR7C/s72-c/%E3%82%AF%E3%83%AA%E3%83%83%E3%83%97%E3%83%9C%E3%83%BC%E3%83%8902.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-6282141330395095457</id><published>2010-07-24T03:39:00.002+09:00</published><updated>2010-07-24T03:45:01.894+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><title type='text'>order byで激はまり</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
table.table010 {
  margin-top: 0.2em;
  margin-bottom: 1em;
  width: 570px;
  border-collapse: collapse;
  border: solid 1px #999;
  font-size: 100%;
  text-align: center;
  width:300px;
  margin:2px;
}

table.table010 caption {
  margin-top: 1em;
  text-align: left;
}

table.table010 th,
table.table010 td {
  border: solid 1px #999;
  padding: 4px 6px;
  white-space: nowrap;
}

table.table010 th {
  background: #E6E6E6;
  white-space: nowrap;
  color: #666;
}

--&gt;
&lt;/style&gt;&lt;br /&gt;
今日はクエリのorder byで激はまりしました&lt;br /&gt;
SQL SERVERだったんですけど&lt;br /&gt;
&lt;table class=&quot;table010&quot;&gt;&lt;caption&gt;table hoge&lt;/caption&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;id&lt;/th&gt;&lt;th&gt;no&lt;/th&gt;&lt;th&gt;num&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;400&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;これを&lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;table010&quot;&gt;&lt;caption&gt;table hoge&lt;/caption&gt; &lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;id&lt;/th&gt;&lt;th&gt;no&lt;/th&gt;&lt;th&gt;num&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;300&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;NULL&lt;/td&gt;&lt;td&gt;400&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;200&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;2&lt;/td&gt;&lt;td&gt;100&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;こう並べたかったんですけど、条件としては&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;noがNULLである行が最優先&lt;/li&gt;
&lt;li&gt;noがNULL以外の中でnumの値を降順でソートする&lt;/li&gt;
&lt;/ul&gt;もしかしたらすごく簡単なのかもしれませんが、スキルが低くてかなりはまりました。&lt;br /&gt;
&lt;b&gt;order by&lt;/b&gt;するときに&lt;b&gt;複数&lt;/b&gt;の&lt;b&gt;カラム&lt;/b&gt;を同時に見てソートするって出来るんでしょうかね？&lt;br /&gt;
で、苦労の末に出来上がったクエリがこれです。&lt;br /&gt;
&lt;pre class=&quot;SQL&quot; name=&quot;code&quot;&gt;select
 *
from
 hoge
order by
 no / no * num * -1;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/6282141330395095457/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/order-by.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/6282141330395095457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/6282141330395095457'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/order-by.html' title='order byで激はまり'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-5100469008562411153</id><published>2010-07-23T00:32:00.001+09:00</published><updated>2010-07-23T00:33:22.099+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="生活"/><category scheme="http://www.blogger.com/atom/ns#" term="遊び"/><title type='text'>タクティクスオウガ～運命の輪～</title><content type='html'>15年ぶりに当時のスタッフでミメイクしているみたいですね。&lt;br /&gt;
公式HPは&lt;a href=&quot;http://www.square-enix.co.jp/tacticsogre/&quot;&gt;ここ&lt;/a&gt;です。&lt;br /&gt;
私は、前からやってみたいなと思いつつもやらずじまいなのですが発売から15年たっても色あせない魅力を感じていますしHPの音楽聞いてほんのりぞわぞわってきましたｗ。&lt;br /&gt;
PSP本体は持ってないんですけど「&lt;b&gt;タクティクスオウガ～運命の輪～&lt;/b&gt;」が発売されたら本体と同時に買ってしまうかもしれませんｗ&lt;br /&gt;
&lt;br /&gt;
とはいえHPも出来たばかりで、発売日、価格共に未定なので気長に待つ方がよさげですね。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/5100469008562411153/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post_23.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5100469008562411153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5100469008562411153'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post_23.html' title='タクティクスオウガ～運命の輪～'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-3110876844854085802</id><published>2010-07-21T23:35:00.002+09:00</published><updated>2010-07-21T23:37:39.182+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="心理学"/><title type='text'>あまりやりたくない、憂鬱な仕事をこなすにはどうするか？</title><content type='html'>やりたくない仕事だからってやらないといけないわけで・・・&lt;br /&gt;
退屈な仕事でもやらないと終わらないわけで・・・&lt;br /&gt;
終わりそうもない仕事でもやらないと終わらないわけで・・・&lt;br /&gt;
そんなときやる気を出すための方法をいくつか列挙してみる&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;目標をつくってみる&lt;/li&gt;
&lt;li style=&quot;color: #e69138;&quot;&gt;ご褒美を用意してみる&lt;/li&gt;
&lt;li&gt;その仕事をやってなにか得るものはないかと考えてみる&lt;/li&gt;
&lt;li style=&quot;color: #e69138;&quot;&gt;仕事が楽しくなる方法は無いかと考えてみる&lt;/li&gt;
&lt;li&gt;とりあえず楽しいことを考えてみる&lt;/li&gt;
&lt;li style=&quot;color: #e69138;&quot;&gt;誰かと競争してみる&lt;/li&gt;
&lt;li&gt;わくわくするような何かを探してみる&lt;/li&gt;
&lt;li style=&quot;color: #e69138;&quot;&gt;誰かの為にがんばってみる&lt;/li&gt;
&lt;li&gt;自分の為にがんばってみる&lt;/li&gt;
&lt;li style=&quot;color: #e69138;&quot;&gt;自分を褒めてみる&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/3110876844854085802/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post_21.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/3110876844854085802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/3110876844854085802'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post_21.html' title='あまりやりたくない、憂鬱な仕事をこなすにはどうするか？'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-3411519365573912905</id><published>2010-07-21T01:01:00.000+09:00</published><updated>2010-07-21T01:01:48.488+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第14回</title><content type='html'>テーブルは常に参照型です(キリッ&lt;br /&gt;
数値は参照型ではありません。&lt;br /&gt;
文字列は参照型かもしれませんが文字列を直接編集する事はできないので特に意識する事は無いと思います。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/3411519365573912905/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua14.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/3411519365573912905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/3411519365573912905'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua14.html' title='C++プログラマがLuaを勉強してみる第14回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-6216534583441411447</id><published>2010-07-20T01:42:00.001+09:00</published><updated>2010-07-20T01:43:05.392+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第13回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆C/C++からLuaを呼び出すためのライブラリをコンパイルしてみる&lt;/b&gt;&lt;/div&gt;さて、今回はLua5.1.4とVisual Studio 2008を使ってライブラリをコンパイルしてみます。 &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;STEP 1:ソースをダウンロード&lt;/b&gt;&lt;/div&gt;まずは&lt;a href=&quot;http://www.lua.org/download.html&quot;&gt;ここ&lt;/a&gt;からソースをダウンロードして解凍します。&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;STEP 2:Visual Studio 2008でプロジェクト作成&lt;/b&gt;&lt;br /&gt;
VC++でWin32プロジェクトを作成します。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQYJklUTZB8KKASF8STiis6Kc6jNAuoTgSgQjVu-WDJ0iqfv6mWmEksQYWmWBHkwY7bv6UD8RlViAPEveXl-iOS1AUUfr6jCuxLmDW52of8EYfpbjTbUqjqX7R05-H-YSsdZxHxssWndHW/s1600/001.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQYJklUTZB8KKASF8STiis6Kc6jNAuoTgSgQjVu-WDJ0iqfv6mWmEksQYWmWBHkwY7bv6UD8RlViAPEveXl-iOS1AUUfr6jCuxLmDW52of8EYfpbjTbUqjqX7R05-H-YSsdZxHxssWndHW/s320/001.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;次にアプリケーションの設定をスタティックライブラリに設定します。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfF7Hpr1sKVoOCP4eodugE18cIxgH_pAX4bZZcGXCheRJ_KX1yfAkOsSxgVt_UWi-k85tlk5UcUOEOf-8k6lvIlFdgD-GlGTbhIsesk34uBND9T6rFRzgRENRw7IWqOgULf2V53dcatXQC/s1600/002.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfF7Hpr1sKVoOCP4eodugE18cIxgH_pAX4bZZcGXCheRJ_KX1yfAkOsSxgVt_UWi-k85tlk5UcUOEOf-8k6lvIlFdgD-GlGTbhIsesk34uBND9T6rFRzgRENRw7IWqOgULf2V53dcatXQC/s320/002.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&amp;nbsp;完了します。&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;STEP 3:srcの取り込み&lt;/b&gt;&lt;br /&gt;
ダウンロードしたlua-5.1.4.tar.gzを解凍して&lt;b&gt;src&lt;/b&gt;フォルダSTEP 2で作成したプロジェクトの有るフォルダにコピーします。&lt;br /&gt;
srcフォルダ内の.cファイルと.hファイルをプロジェクトに取り込みます。&lt;br /&gt;
このとき下記のファイルは必要有りません。&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;lua.c&lt;/li&gt;
&lt;li&gt;luac.c&lt;/li&gt;
&lt;li&gt;print.c &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaaM5gQ9Uf2zJZ9GRvduHIsOhQx4Qxozm-C1P55fG7NXk4vgiz14SNe3sY3Qh-Bfq3tbbLh7mt7FZDEfgvrv7dQMW58O6mO0jPFMN87JzjfnPcSmQqe0KXMjKgzqkAE5DX0ympjFtz0pw1/s1600/003.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaaM5gQ9Uf2zJZ9GRvduHIsOhQx4Qxozm-C1P55fG7NXk4vgiz14SNe3sY3Qh-Bfq3tbbLh7mt7FZDEfgvrv7dQMW58O6mO0jPFMN87JzjfnPcSmQqe0KXMjKgzqkAE5DX0ympjFtz0pw1/s320/003.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;STEP 4:プロジェクトの設定&lt;/b&gt;&lt;/div&gt;プリプロセッサの定義に&lt;b&gt;_CRT_SECURE_NO_DEPRECATE&lt;/b&gt;を追加します。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaLtDnYZhGNaykHicnfK0AMKfDC9pWb24H-y17PuQcvoRnj6uAb-8bk7ruLZTris0tZIHgJS7VWitRPyTPwLY1llxiSMlnRllZSTiWtgWN0T8FIhYhzU9HEJc_hC2NYyMTvA3Lq03oTZM6/s1600/004.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaLtDnYZhGNaykHicnfK0AMKfDC9pWb24H-y17PuQcvoRnj6uAb-8bk7ruLZTris0tZIHgJS7VWitRPyTPwLY1llxiSMlnRllZSTiWtgWN0T8FIhYhzU9HEJc_hC2NYyMTvA3Lq03oTZM6/s320/004.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
えーっとプロジェクトの設定とかあまり詳しくないので過不足あったらすいません。&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;color: #38761d;&quot;&gt;STEP 4:ビルド&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/6216534583441411447/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua13.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/6216534583441411447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/6216534583441411447'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua13.html' title='C++プログラマがLuaを勉強してみる第13回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQYJklUTZB8KKASF8STiis6Kc6jNAuoTgSgQjVu-WDJ0iqfv6mWmEksQYWmWBHkwY7bv6UD8RlViAPEveXl-iOS1AUUfr6jCuxLmDW52of8EYfpbjTbUqjqX7R05-H-YSsdZxHxssWndHW/s72-c/001.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-8402592759406049809</id><published>2010-07-19T02:12:00.001+09:00</published><updated>2010-07-19T02:15:20.226+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++"/><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第12回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆C/C++からLuaを実行する&lt;/b&gt;&lt;/div&gt;C++からLuaのコードを実行するサンプルをつくりました。&lt;br /&gt;
C++からLuaのコードを実行するためのライブラリ(lib)のコンパイルは後日紹介します。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;C++&quot; name=&quot;code&quot;&gt;extern &quot;C&quot; {
#include &quot;lua.h&quot;
#include &quot;lualib.h&quot;
#include &quot;lauxlib.h&quot;
}

int main(int argc, char* argv[])
{

 // LuaのVMを生成
 lua_State *const L = lua_open();

 // Luaの標準ライブラリを開く
 luaL_openlibs(L);

 while (true) {
  // luaファイルを指定して実行する
  if (luaL_dofile(L, &quot;test.lua&quot;)) {
   // エラー内容の取得
   printf(&quot;error:%s\n&quot;, lua_tostring(L, -1));
   lua_pop(L, 1);
   return 0;
  }

  // 直接コードを指定する
  if (luaL_dostring(L, &quot;print(&#39;hello lua world&#39;)&quot;)) {
   // エラー内容の取得
   printf(&quot;error:%s\n&quot;, lua_tostring(L, -1));
   lua_pop(L, 1);
   return 0;
  }

  printf(&quot;\n&quot;);
  printf(&quot;hit any key...\n&quot;);
  printf(&quot;0 is exit\n&quot;);
  const char c = getchar();
  if (c == &#39;0&#39;) {
   break;
  }
 }

 // LuaのVMを閉じる
 lua_close(L);

 return 0;
}
&lt;/pre&gt;getchar()のところでtest.luaを編集ご実行すると編集内容が反映されます。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/8402592759406049809/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua12.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/8402592759406049809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/8402592759406049809'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua12.html' title='C++プログラマがLuaを勉強してみる第12回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-4580882147313291486</id><published>2010-07-18T03:45:00.000+09:00</published><updated>2010-07-18T03:45:57.088+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++"/><category scheme="http://www.blogger.com/atom/ns#" term="コンパイルエラー"/><title type='text'>LIBCMT.libとMSVCRTD.libの競合</title><content type='html'>Luaのライブラリを利用しようとしたら出たエラーです。&lt;br /&gt;
ライブラリ(lib)がVC2005でコンパイルされていたので&lt;br /&gt;
VC2008のReleaseモードでコンパイルしたらでなくなりました。&lt;br /&gt;
&lt;br /&gt;
LIBCMT.lib(_file.obj) : error LNK2005: ___iob_func は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a は既に MSVCRTD.lib(cinitexe.obj) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z は既に MSVCRTD.lib(cinitexe.obj) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a は既に MSVCRTD.lib(cinitexe.obj) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z は既に MSVCRTD.lib(cinitexe.obj) で定義されています。&lt;br /&gt;
LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(hooks.obj) : error LNK2005: &quot;void __cdecl terminate(void)&quot; (?terminate@@YAXXZ) は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(crt0.obj) : error LNK2005: _mainCRTStartup は既に MSVCRTD.lib(crtexe.obj) で定義されています。&lt;br /&gt;
LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(mlock.obj) : error LNK2005: __unlock は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(mlock.obj) : error LNK2005: __lock は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(dosmap.obj) : error LNK2005: __errno は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(lconv.obj) : error LNK2005: _localeconv は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(atox.obj) : error LNK2005: _atoi は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LIBCMT.lib(strtol.obj) : error LNK2005: _strtoul は既に MSVCRTD.lib(MSVCR90D.dll) で定義されています。&lt;br /&gt;
LINK : warning LNK4098: defaultlib &#39;MSVCRTD&#39; は他のライブラリの使用と競合しています。/NODEFAULTLIB:library を使用してください。&lt;br /&gt;
LINK : warning LNK4098: defaultlib &#39;LIBCMT&#39; は他のライブラリの使用と競合しています。/NODEFAULTLIB:library を使用してください。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/4580882147313291486/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/libcmtlibmsvcrtdlib.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4580882147313291486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4580882147313291486'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/libcmtlibmsvcrtdlib.html' title='LIBCMT.libとMSVCRTD.libの競合'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-4722648614999269878</id><published>2010-07-17T04:15:00.001+09:00</published><updated>2010-07-17T04:21:40.575+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="心理学"/><title type='text'>相手の意見を頭ごなしに否定しない</title><content type='html'>誰しも有ると思いますが、相手よりも優位に立ちたい、自分の評価を上げたい等の心理からついつい相手の意見を否定したり、あらを探したりしてしまいがちですがそれだと仕事、人間関係ともにうまくいかない場合が多いのではないでしょうか？&lt;br /&gt;
そこで、相手の意見は出来るだけ否定せずに意見をよく理解してメリットデメリットを述べ、その上で自分の持っている意見を提示するのが良いのではないでしょうか。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/4722648614999269878/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post_17.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4722648614999269878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4722648614999269878'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post_17.html' title='相手の意見を頭ごなしに否定しない'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-5579989033648962366</id><published>2010-07-16T01:02:00.000+09:00</published><updated>2010-07-16T01:02:23.949+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>PHPのforeachで$valueを参照型にする</title><content type='html'>&lt;b&gt;PHP5&lt;/b&gt;以降&lt;b&gt;foreach&lt;/b&gt;の&lt;b&gt;$value&lt;/b&gt;を&lt;b&gt;参照型&lt;/b&gt;にすることができるんですね、今日知りました。&lt;br /&gt;
参照型にすると次のようなメリットがありますね&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;コピー処理が実行されないのでループ処理が速くなる&lt;/li&gt;
&lt;li&gt;配列内の各要素に処理をするのが楽&lt;/li&gt;
&lt;/ul&gt;逆にデメリットは&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;参照であるがゆえにプログラマが意図しない処理となってしまう場合がある&lt;/li&gt;
&lt;/ul&gt;ってとこですかね&lt;br /&gt;
簡単なコード例を用意しました。&lt;br /&gt;
&lt;pre class=&quot;PHP&quot; name=&quot;code&quot;&gt;$num_array = array(1,2,3,4,5);
    foreach ($num_array as &amp;amp;$value) {
        $num += 1;
    }
    unset($value);
    print_r($num_array);
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/5579989033648962366/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/phpforeachvalue.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5579989033648962366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5579989033648962366'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/phpforeachvalue.html' title='PHPのforeachで$valueを参照型にする'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-1505824344525955082</id><published>2010-07-14T23:44:00.006+09:00</published><updated>2010-07-14T23:55:33.234+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="JScript"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><title type='text'>WEBベージ上のテキストデータをクリップボードへコピーする（IE）</title><content type='html'>IE限定ですが&lt;strong&gt;JScript&lt;/strong&gt;をつかってWEBページ上のテキスト情報を&lt;strong&gt;クリップボード&lt;/strong&gt;に&lt;strong&gt;コピー&lt;/strong&gt;することができます。&lt;br /&gt;
&lt;script type=&quot;text/JScript&quot;&gt;
&lt;!--
function clipText(_id) {
 var El = document.getElementById(_id);
 var text = El.innerText;
 clipboardData.setData(&quot;Text&quot;, text);
 alert(&quot;クリップボードにコピーしました&quot;);
}
//--&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;span id=&quot;clip&quot;&gt;愛をください。&lt;/span&gt;&lt;br /&gt;
&lt;input onclick=&quot;clipText(&#39;clip&#39;);&quot; type=&quot;button&quot; value=&quot;お・し・て・ね♪&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
ソースコードはこんな感じです。&lt;br /&gt;
&lt;span style=&quot;color: #351c75;&quot;&gt;JScript&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;JavaScript&quot; name=&quot;code&quot;&gt;&lt;script type=&quot;text/JScript&quot;&gt;
&lt;!--
function clipText(_id) {
    var El = document.getElementById(_id);
    var text = El.innerText;
    clipboardData.setData(&quot;Text&quot;, text);
    alert(&quot;クリップボードにコピーしました&quot;);
}
//--&gt;
&lt;/script&gt;
&lt;/pre&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;HTML&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;HTML&quot; name=&quot;code&quot;&gt;&lt;span id=&quot;clip&quot;&gt;愛をください。&lt;/span&gt;
&lt;input onclick=&quot;clipText(&#39;clip&#39;);&quot; type=&quot;button&quot; /&gt;
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/1505824344525955082/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/webie.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/1505824344525955082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/1505824344525955082'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/webie.html' title='WEBベージ上のテキストデータをクリップボードへコピーする（IE）'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-85088368959541777</id><published>2010-07-13T23:43:00.001+09:00</published><updated>2010-07-13T23:43:32.573+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DB"/><title type='text'>SQL Serverでハイフンを含んだ文字列のソートが変</title><content type='html'>&amp;nbsp;なんか、SQL Serverでハイフンを含んだ文字列のソートがうまくいかなくて困ったんですけど&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #351c75;&quot;&gt;A-10&lt;/div&gt;&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;color: #351c75;&quot;&gt;A-30&lt;/div&gt;&lt;div style=&quot;color: #351c75;&quot;&gt;A20&lt;/div&gt;&lt;br /&gt;
って並んでほしぃのに&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #351c75;&quot;&gt;A-10&lt;/div&gt;&lt;div style=&quot;color: #351c75;&quot;&gt;A20 &lt;/div&gt;&lt;div style=&quot;color: #351c75;&quot;&gt;A-30&lt;/div&gt;&lt;br /&gt;
って並んでしまうんです。 &lt;br /&gt;
んでいろいろ調べてみたんですがSELECTするときに「&lt;b&gt;COLLATE Japanese_BIN&lt;/b&gt;」をつけるとうまくいきました。&lt;br /&gt;
&lt;br /&gt;
select * from&amp;nbsp; aaa order by name COLLATE Japanese_BIN&lt;br /&gt;
&lt;br /&gt;
こんな感じです&lt;br /&gt;
&lt;span&gt;         &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/85088368959541777/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/sql-server.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/85088368959541777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/85088368959541777'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/sql-server.html' title='SQL Serverでハイフンを含んだ文字列のソートが変'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-4696562122906769626</id><published>2010-07-13T00:43:00.000+09:00</published><updated>2010-07-13T00:43:44.072+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EXCEL"/><title type='text'>EXCELで重複する行（レコード)を非表示にする</title><content type='html'>EXCELで重複する行(レコード)を非表示にするには&lt;br /&gt;
&lt;br /&gt;
１．列を選択する&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ152Ayg91rj7cmlr20IqNJdY9XZWoYUi08yejWNwDC4PWj-M1Onekb2Znu9M2vktqS9YDTf2JpjT8EGGfF2K2DXtAtEBPZcyiFZQSVwRZMJ8wAzODZoBXxUtdWjp80Ak8JrNmQLV48FVy/s1600/001.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ152Ayg91rj7cmlr20IqNJdY9XZWoYUi08yejWNwDC4PWj-M1Onekb2Znu9M2vktqS9YDTf2JpjT8EGGfF2K2DXtAtEBPZcyiFZQSVwRZMJ8wAzODZoBXxUtdWjp80Ak8JrNmQLV48FVy/s320/001.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
２．メニュー[データ]→[フィルタ]→[フィルタオプションの設定]を起動する&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRO-hLcH5JVfuw_1A9E9_hN9L1eMHIK1EVcodJ0rzJjD2cG_pzCHGCVaRVVrXdXjkWjz11QaAsZdFS_Dm6ySdAxsmxNdjnVeuZMPL2aMEWFOJGxCqUzj3Omtbq0O8uiK_wr9f6IjG2DsDD/s1600/002.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRO-hLcH5JVfuw_1A9E9_hN9L1eMHIK1EVcodJ0rzJjD2cG_pzCHGCVaRVVrXdXjkWjz11QaAsZdFS_Dm6ySdAxsmxNdjnVeuZMPL2aMEWFOJGxCqUzj3Omtbq0O8uiK_wr9f6IjG2DsDD/s320/002.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
３．「重複するレコードは無視する」にチェックを入れる&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfK0GZC1SojUBb5dORTcejTQ9SdZ2mwsKDPIhBKIZWOJF4s2D2Tb22ogH7XLy3Qo4RUhg6ho8M3bAr4HwHauAIZAdiVJgH994_ueFLDerA2A8Lg6QPa_LXFgkRQ_K_2hPtPyp-Arh177SS/s1600/003.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfK0GZC1SojUBb5dORTcejTQ9SdZ2mwsKDPIhBKIZWOJF4s2D2Tb22ogH7XLy3Qo4RUhg6ho8M3bAr4HwHauAIZAdiVJgH994_ueFLDerA2A8Lg6QPa_LXFgkRQ_K_2hPtPyp-Arh177SS/s320/003.gif&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
でOK</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/4696562122906769626/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/excel_13.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4696562122906769626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4696562122906769626'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/excel_13.html' title='EXCELで重複する行（レコード)を非表示にする'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ152Ayg91rj7cmlr20IqNJdY9XZWoYUi08yejWNwDC4PWj-M1Onekb2Znu9M2vktqS9YDTf2JpjT8EGGfF2K2DXtAtEBPZcyiFZQSVwRZMJ8wAzODZoBXxUtdWjp80Ak8JrNmQLV48FVy/s72-c/001.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-2706970134705007535</id><published>2010-07-12T02:59:00.001+09:00</published><updated>2010-07-12T02:59:50.741+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="EXCEL"/><title type='text'>EXCELで奇数の行だけ色をかえる</title><content type='html'>&lt;b&gt;EXCEL&lt;/b&gt;で奇数の行だけセルの色を変更するには&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;適用するセル範囲を選択する &lt;/li&gt;
&lt;li&gt;メニューから「条件付き書式の設定」を起動する&lt;/li&gt;
&lt;li&gt;「&lt;span style=&quot;color: #cc0000;&quot;&gt;数式が&lt;/span&gt;」を選し「&lt;span style=&quot;color: #cc0000;&quot;&gt;=MOD(ROW(),2)=1&lt;/span&gt;」を入力する&lt;/li&gt;
&lt;li&gt;書式を設定する&lt;/li&gt;
&lt;/ol&gt;でok</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/2706970134705007535/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/excel.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/2706970134705007535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/2706970134705007535'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/excel.html' title='EXCELで奇数の行だけ色をかえる'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-5594588155065641402</id><published>2010-07-11T01:45:00.000+09:00</published><updated>2010-07-11T01:45:34.200+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PHP"/><title type='text'>PHPで32bitを超える数値を扱う場合の注意点</title><content type='html'>今日しごとで出た問題なんですけど、&lt;b&gt;PHP&lt;/b&gt;の&lt;b&gt;intval()&lt;/b&gt;って環境に関係なく&lt;b&gt;32bit&lt;/b&gt;で丸められるみたいなんですよね。&lt;br /&gt;
下記のコードを実行してみてください &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;PHP&quot; name=&quot;code&quot;&gt;$a = 123456789;
 $b = $a * 100;
 print_r($b);
 print_r(intval($b))
&lt;/pre&gt;&lt;br /&gt;
正しく表示されてたらすいません。&lt;br /&gt;
未確認ですが、intval()だけじゃなくてsprintf()などの%dも同様の問題が有るみたいです。、</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/5594588155065641402/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/php32bit.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5594588155065641402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5594588155065641402'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/php32bit.html' title='PHPで32bitを超える数値を扱う場合の注意点'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-302803457551575840</id><published>2010-07-10T02:40:00.000+09:00</published><updated>2010-07-10T02:40:05.439+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第11回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆コルーチンによるタイマスレッドみたいなの&lt;/b&gt;&lt;/div&gt;を作ってみました。&lt;br /&gt;
で、こんなの使うのだろうか。。。よくわかりませんｗ&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;isTimeout = false

--タイムアウトハンドラ
function timeOutHandler(_limit)
 isTimeout = true
end

--タイマコルーチン用関数
function timer(_limit, callBack)
 local limit = _limit --リミット
 local startTime = os.time() --開始時間
 local latest = os.time() --前回の時間
 local countDown = _limit --カウントダウン用

 print(countDown)
 while true do
  local time = os.time()
  if startTime + limit &amp;lt;= os.time() then
   break
  elseif latest &amp;lt; time then
   print(coroutine.status(co))
   latest = time
   countDown = countDown - 1
   print(countDown)
  end
  coroutine.yield() --コルーチンを中断して処理をもどす
 end
 callBack(limit) --コールバック関数を呼ぶ

end

co = coroutine.create(timer) --コルーチンの生成
print(coroutine.status(co)) --ステータスの表示

--メインループ
repeat
 coroutine.resume(co, 10, timeOutHandler) --コルーチンの開始と再開
until isTimeout

print(coroutine.status(co))
print(&quot;time out&quot;)
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/302803457551575840/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua11.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/302803457551575840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/302803457551575840'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua11.html' title='C++プログラマがLuaを勉強してみる第11回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-2912465454173010922</id><published>2010-07-09T01:18:00.003+09:00</published><updated>2010-07-09T01:42:30.753+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><category scheme="http://www.blogger.com/atom/ns#" term="デザインパターン"/><title type='text'>C++プログラマがLuaを勉強してみる第10回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆Luaでテンプレートメソッドパターン&lt;/b&gt;&lt;/div&gt;今回はLua初心者のくせに&lt;b&gt;テンプレートメソッドパターン&lt;/b&gt;に挑戦してしまいました。&lt;br /&gt;
テンプレートメソッドパターンについては&lt;a href=&quot;http://snowycode.blogspot.com/2010/05/ctemplatemethod.html&quot;&gt;ここ&lt;/a&gt;参照 &lt;br /&gt;
無理矢理感が否めないので、ぜんぜんちっげーよ！ってコメント待ってます！&lt;br /&gt;
&lt;br /&gt;
まずは、簡単にクラス図の説明を書きます。&lt;br /&gt;
なんかどっかでみたよーな命名ですが気にしない気にしない&lt;br /&gt;
&amp;nbsp;&amp;nbsp; CaffeineBeverageクラス(Superクラス)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; △&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ---------------- &lt;br /&gt;
&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&lt;br /&gt;
Coffeeクラス&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Teaクラス&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
以下ソースコード&lt;br /&gt;
&lt;div style=&quot;color: #990000;&quot;&gt;&lt;b&gt;CaffeineBeverage.lua&lt;/b&gt;&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;----------------------------------------
--CaffeineBeverageクラス
----------------------------------------
CaffeineBeverage = {}

-- new
function CaffeineBeverage:new(_caffeineBeverage)
 local obj = {}
 -- field
 if _caffeineBeverage then
  obj.name = _caffeineBeverage.name
 else
  obj.name = &quot;&quot;
 end

 self.__index = self
 setmetatable(obj, self)
 return obj
end

-- property
function CaffeineBeverage:set(_name)
 self.name = _name
end


-- __tostring over ride
function CaffeineBeverage:__tostring()
 return &quot;name:&quot;..self.name
end

-- clone
function CaffeineBeverage:clone()
 return CaffeineBeverage:new(self)
end

-- prepareRecipe
function CaffeineBeverage:prepareRecipe()
 CaffeineBeverage:boilWater()
 CaffeineBeverage:brew()
 CaffeineBeverage:pourInCup()
 CaffeineBeverage:addCondiments()
end

-- boilWater
function CaffeineBeverage:boilWater()
 print(&quot;お湯を沸かす。。。&quot;)
end

-- brew()
function CaffeineBeverage:brew()
 error(&quot;have to override&quot;)
end

-- pourInCup
function CaffeineBeverage:pourInCup()
 print(&quot;カップに注ぐ。。。&quot;)
end

-- addCondiments
function CaffeineBeverage:addCondiments()
 error(&quot;have to override&quot;)
end
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Coffee.lua&lt;/b&gt;&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;dofile(&quot;CaffeineBeverage.lua&quot;) -- C/C++で言うところの#include

----------------------------------------
--Coffeeクラス
----------------------------------------
Coffee = {}

-- new
function Coffee:new(_coffee)
  obj = {}
 -- field
 if _coffee then
  obj = CaffeineBeverage:new(_coffee)
 else
  obj = CaffeineBeverage:new()
 end

 -- clone (override)
 obj.__index.brew = function()
  return Coffee:new(self)
 end

 -- brew (overrice)
 obj.__index.brew = function()
  print(&quot;コーヒーをドリップする&quot;)
 end

 -- addCondiments (override)
 obj.__index.addCondiments = function()
  print(&quot;砂糖とクリープを加える&quot;)
 end

 return obj
end
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #990000;&quot;&gt;&lt;b&gt;Tea.lua&lt;/b&gt;&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;dofile(&quot;CaffeineBeverage.lua&quot;)
----------------------------------------
--Teaクラス
----------------------------------------
Tea = {}

-- new
function Tea:new(_tea)
  obj = {}
 -- field
 if _tea then
  obj = CaffeineBeverage:new(_tea)
 else
  obj = CaffeineBeverage:new()
 end

 -- clone
 obj.__index.brew = function()
  return Tea:new(self)
 end

 -- brew
 obj.__index.brew = function()
  print(&quot;ティーバッグをお湯に浸す&quot;)
 end

 -- addCondiments
 obj.__index.addCondiments = function()
  print(&quot;砂糖とレモン&quot;)
 end

 return obj
end
&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;color: #990000;&quot;&gt;&lt;b&gt;main.lua&lt;/b&gt;&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;dofile(&quot;Coffee.lua&quot;)
dofile(&quot;Tea.lua&quot;)

----------------------------------------
-- main
----------------------------------------
function main()
 print(&quot;--コーヒーの生成&quot;)
 a = Coffee:new()
 a:set(&quot;コーヒー&quot;)
 print(a)
 a:prepareRecipe()

 print(&quot;\n&quot;)

 print(&quot;--紅茶の生成&quot;)
 b = Tea:new()
 b:set(&quot;紅茶&quot;)
 print(b)

 b:prepareRecipe()

 print(&quot;\n&quot;)

 print(&quot;--コピーコンストラクタの使用&quot;)
 c = Tea:new(b)
 print(c)
 c:set(&quot;レモンティ&quot;)
 print(c)
 print(b)

 print(&quot;\n&quot;)

 print(&quot;クローン&quot;)
 d = c:clone()
 print(d)
 d:set(&quot;レモンの紅茶&quot;)
 print(d)
 print(c)
end

-- call main
-- try catchみたいなの使ってます。
-- error()ってメソッドがthrowに相当します。
local status, err = pcall(main)
if status then
 -- do nothing
else
 print(err)
end
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/2912465454173010922/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua10.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/2912465454173010922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/2912465454173010922'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua10.html' title='C++プログラマがLuaを勉強してみる第10回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-889106372629166818</id><published>2010-07-08T02:31:00.001+09:00</published><updated>2010-07-09T01:43:17.810+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第9回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆関数定義時のピリオド「.」とコロン「：」の違い&lt;/b&gt;&lt;/div&gt;コロンで定義した場合はselfが使用できます&lt;br /&gt;
ピリオドで定義した場合は引数にself(C++でいうところのthis)を取るとselfに自信が代入されます&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;test = {
 name = &quot;yamada&quot;
}

-- コロン
function test:printName() 
 print(self.name) -- selfにtestが入っている
end

-- ピリオドでselfの引数をもつ
function test.printName2(self)
 print(self.name) -- selfにtestが入っている
end

-- ピリオドでselfなし
function test.printName3()
-- print(self.name) -- selfは使用できない
 print(&quot;yamada&quot;)
end
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/889106372629166818/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua9.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/889106372629166818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/889106372629166818'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua9.html' title='C++プログラマがLuaを勉強してみる第9回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-2267571409378064310</id><published>2010-07-07T01:40:00.004+09:00</published><updated>2010-07-07T02:24:53.106+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第8回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆クラス&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;---------------------------------------
--Characterクラスの定義
---------------------------------------
Character = {} --Characterクラス

--newメソッド
function Character:new(_character)

 obj = {}
 --メンバ変数の定義と初期化
 if _character then
  --コピーコンストラクタ的な処理
  obj.name = _character.name
  obj.age = _character.age
 else
  --デフォルトコンストラクタ適な処理
  obj.name = &quot;&quot;
  obj.age = 0
 end

 --Characterのメソッドをobjに設定
 --継承みたいな感じ
 self.__index = self
 setmetatable(obj, self)
 return obj
end

--setメソッド
function Character:set(_name, _age)
 self.name = _name
 self.age = _age
end

--__tostringメタメソッドのオーバーライド
function Character:__tostring()
 return &quot;name:&quot;..self.name..&quot;\n&quot;..&quot;age:&quot;..self.age
end

--cloneメソッド
function Character:clone()
 return Character:new(self)
end

----------------------------------------
--クラスの使用
----------------------------------------
c = Character:new() --オブジェクトの生成
c:set(&quot;suzuki&quot;, 12) --データの設定
d = Character:new(c) --コピーコンストラクタの使用

print(&quot;--c--&quot;)
print(c)
print(&quot;--d--&quot;)
print(d)
print(&quot;\n&quot;)

c:set(&quot;suzuki_2&quot;, 24)
d:set(&quot;yamada&quot;, 55)
print(&quot;==c==&quot;)
print(c)
print(&quot;==d==&quot;)
print(d)
print(&quot;\n&quot;)

e = d:clone()
d:set(&quot;takeda&quot;, 77)
print(&quot;##d##&quot;)
print(d)
print(&quot;##e##&quot;)
print(e)
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/2267571409378064310/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua7.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/2267571409378064310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/2267571409378064310'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua7.html' title='C++プログラマがLuaを勉強してみる第8回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-5655751441608475837</id><published>2010-07-06T00:42:00.001+09:00</published><updated>2010-07-07T02:25:24.412+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第7回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆関数&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;--基本
function f(_arg)
    print(_arg)
end
f(&quot;Hello World&quot;)

f2 = function()
   print(&quot;Hello World2&quot;)
end
f2()

--数の合わない引数
function fu(_arg1, _arg2)
    print(&quot;_arg1:&quot;, _arg1)
    print(&quot;_arg2:&quot;, _arg2)
end
fu(&quot;Hello&quot;)
fu(&quot;Hello&quot;, &quot;World&quot;)
fu(&quot;Hello&quot;, &quot;World&quot;, &quot;Hi&quot;)

--可変長引数
function fun(...)
    args = {...}
    for index, value in ipairs(args) do
        print(index, &quot;:&quot;, value)
    end
end
fun(&quot;Hello&quot;, &quot;World&quot;)
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/5655751441608475837/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/function-farg-printargendfhello-worldf2.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5655751441608475837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/5655751441608475837'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/function-farg-printargendfhello-worldf2.html' title='C++プログラマがLuaを勉強してみる第7回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-4841082053266557514</id><published>2010-07-05T02:27:00.005+09:00</published><updated>2010-07-05T02:39:57.594+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Lua"/><title type='text'>C++プログラマがLuaを勉強してみる第6回</title><content type='html'>&lt;div style=&quot;color: #351c75;&quot;&gt;&lt;b&gt;◆制御構文&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;color: #351c75;&quot;&gt;fouループ&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;for i = 1, 10 do
    print(i)
end
&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;color: #351c75;&quot;&gt;whileループ&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;while true do
    str = io.read()
    if str == &quot;exit&quot; then
        break
    else
        print(str)
    end
end
&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;color: #351c75;&quot;&gt;repeatループ&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;repeat
    i = i + 1
    print(i)
until 5 &lt; i
&lt;/pre&gt;

&lt;div style=&quot;color: #351c75;&quot;&gt;if分岐&lt;/div&gt;&lt;pre class=&quot;Lua&quot; name=&quot;code&quot;&gt;a = io.read() 
if a == 1 then
    a = a + 10
    print(a) 
elseif a == 2 then
    a = a + 20
    print(a) 
else
    print(a)
end
&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/4841082053266557514/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua6.html#comment-form' title='0 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4841082053266557514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/4841082053266557514'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/clua6.html' title='C++プログラマがLuaを勉強してみる第6回'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1053615194817097162.post-1614206468026098056</id><published>2010-07-04T01:59:00.004+09:00</published><updated>2010-07-04T02:08:23.470+09:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="コミュニケーション"/><category scheme="http://www.blogger.com/atom/ns#" term="心理学"/><title type='text'>出した指示を相手が把握しているか確認する</title><content type='html'>&lt;div style=&quot;color: #990000;&quot;&gt;「逆に私に作業指示をだしてください」&lt;/div&gt;&lt;span style=&quot;color: #990000;&quot;&gt;「これからの作業について説明してください」&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
部下や同僚に作業指示を出した後、相手が把握しているかを確認するとき&lt;br /&gt;
「把握しましたか？」&lt;br /&gt;
「わかりましたか？」&lt;br /&gt;
「できますか？」&lt;br /&gt;
&lt;br /&gt;
とついつい聞いてしまいがちですが、この確認の仕方だと相手は把握していてもしていなくても&lt;br /&gt;
「はい、大丈夫です」&lt;br /&gt;
のような「yes」の返事がほとんどだと思います。&lt;br /&gt;
これだと、相手が把握していなかった場合工数が無駄になってしまいます。&lt;br /&gt;
&lt;br /&gt;
そこで、&lt;br /&gt;
&lt;div style=&quot;color: #990000;&quot;&gt;&amp;nbsp;「逆に私に作業指示をだしてください」&lt;/div&gt;&lt;span style=&quot;color: #990000;&quot;&gt;「これからの作業について説明してください」&lt;/span&gt;&lt;br /&gt;
という聴き方で相手が作業内容を把握しているか確認します。&lt;br /&gt;
この方法によって指示をもらった人自身が、自分が把握している部分、していない部分を明確にすることができますし、指示を出した方も作業内容を再度確認することが出来ます。</content><link rel='replies' type='application/atom+xml' href='http://snowycode.blogspot.com/feeds/1614206468026098056/comments/default' title='コメントの投稿'/><link rel='replies' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post.html#comment-form' title='2 件のコメント'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/1614206468026098056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1053615194817097162/posts/default/1614206468026098056'/><link rel='alternate' type='text/html' href='http://snowycode.blogspot.com/2010/07/blog-post.html' title='出した指示を相手が把握しているか確認する'/><author><name>スノウ</name><uri>http://www.blogger.com/profile/10635324836939762085</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>