<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>makotoのブログ</title>
<link>https://ameblo.jp/yeele/</link>
<atom:link href="https://rssblog.ameba.jp/yeele/rss20.xml" rel="self" type="application/rss+xml" />
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
<description>プログラミング勉強にあたっての備忘録。</description>
<language>ja</language>
<item>
<title>C++ コンストラクタ初期化子</title>
<description>
<![CDATA[ コンストラクタ初期化子について勉強する。<br><br>たまにc++のソースをみることがあるのだが、<br><br>class Miso(){<br>  private:<br>    string tofu;<br>    string negi;  <br>  <br>  public Miso() : tofu("big"), negi("small") {<br>    <br>  }<br>}<br><br>こんな、構文を何回か見た記憶がある。<br>新鮮だった。<br>なんとなく初期化していることは感じとっていたが、今日はもう少し理解を深めようと思った。<br><br><br>when I read the link below first time, <br><a href="http://www.kab-studio.biz/Programing/Codian/Cpp/07.html" target="_blank">最初このリンク先ページ</a><br><br>I couldn't get, why <br>”コンストラクタ内に入った時にすでに<strong>参照が初期化されている</strong>からです”<br><br>なぜ、コンストラクタ内に入った時にすでに参照が初期化されているんですか！！！？？？<br>って思った。<br>そこで、いろいろ調べて<br><br><a href="http://www.geocities.co.jp/bleis_tift/cpp/init.html" target="_blank">代入より初期化</a>を読んだとき、なんとなく疑問の点が繋がり、理解に一歩前進した。<br>コンストラクタ内でやっていることは、実質、代入なんだ。<br>コンパイラーは、あるクラスを初期化するとき、そのクラスにコンストラクタ初期化子がない<br>場合、スタック、ヒープに確保するにかかわらず、適当に初期化（メモリ確保）してから、コンストラクタ<br>を呼び出す。<br><br>それから、<br><span style="font-style: italic;">初期化リストでは、言語組み込み型以外では初期化のためにコンストラクタを呼び出しますので、初期化値にはメンバであっても引数を記述できます</span>。（<a href="http://www.geocities.co.jp/bleis_tift/cpp/init.html" target="_blank">代入より初期化</a>　からの引用文）<br><br>上記のように、初期化子リストではそれぞれコンストラクタをようんでいるようだ。<br>かつ、非クラス型（POD型）でもコンストラクタ風に呼び出しできる。<br><br>こう考えると、変わった構文もすんなり理解できる。<br><br><br>なお、非クラス型でもコンストラクタ風に呼び出しができるのを知ったサイトは<a href="http://eetimes.jp/content/3004" target="_blank">サイト</a><br><br><br>
]]>
</description>
<link>https://ameblo.jp/yeele/entry-10817084972.html</link>
<pubDate>Tue, 01 Mar 2011 16:35:33 +0900</pubDate>
</item>
<item>
<title>android 写真の上に絵を描く。</title>
<description>
<![CDATA[ <img src="file:///C:/Users/makoto/AppData/Local/Temp/moz-screenshot.png"><table style="width: 1967px; height: 137px;" id="pubctors" class="jd-sumtable"><tbody><tr class=" api apilevel-1"></tr><tr class=" api apilevel-1"><td class="jd-typecol"><br></td><td width="100%" class="jd-linkcol"><div class="jd-descrdiv"><br><a href="http://stat.ameba.jp/user_images/20110213/13/yeele/d0/2d/p/o0797055911045698479.png"><img border="0" src="https://stat.ameba.jp/user_images/20110213/13/yeele/d0/2d/p/t02200154_0797055911045698479.png" alt="makotoのブログ"></a><br><br>やりたいこと。<br>写真の上に何かを描く。<br><br>方針<br>Viewをextensして自作 PracticeView を作る。<br>xmlのlayoutに入れて、setContextViewで描画。<br><br>行き詰まり<br><span class="sympad">02-13 02:46:45.181: ERROR/AndroidRuntime(635): java.lang.RuntimeException: Unable to start activity ComponentInfo{yeele.com.androidbasic/yeele.com.androidbasic.AndroidBasic}: android.view.InflateException: Binary XML file line #14: Error inflating class yeele.com.androidbasic.PracticeView<br><br><br>原因<br>Viewのconstractor!<br>public class PracticeView extends View {<br>    <br>    private Context context;<br>    public PracticeView(Context context){<br>        super(context);<br>        this.context = context;<br>        <br>    }<br><br>上のように書いていたのが間違い<br>reference をよく確認したら、xmlに使う場合は、以下のようなconstroctorを<br>使うようにすればいいと解釈。<br></span><table id="pubctors" class="jd-sumtable"><tbody><tr class=" api apilevel-1"></tr><tr class=" api apilevel-1"></tr><tr class=" api apilevel-1"><td class="jd-typecol"><nobr>&nbsp;</nobr>        </td>        <td width="100%" class="jd-linkcol"><nobr>        <span class="sympad"><br><br><br><br><a href="http://developer.android.com/reference/android/view/View.html#View%28android.content.Context,%20android.util.AttributeSet%29">View</a></span>(<a href="http://developer.android.com/reference/android/content/Context.html">Context</a> context, <a href="http://developer.android.com/reference/android/util/AttributeSet.html">AttributeSet</a> attrs)</nobr>                <div class="jd-descrdiv">Constructor that is called when inflating a view from XML.</div></td></tr></tbody></table><br><br>備考<br>もともとはlayoutにImageViewで写真を挿入、<br>これをプログラムから取得して、その上にラクガキを書きたかったが、<br>現時点では方法がわからず、viewに絵を描きたい場合は自作でView<br>を拡張子、お絵かきできるように拡張するしかないと結論づけた。<br><br></div></td></tr></tbody></table>
]]>
</description>
<link>https://ameblo.jp/yeele/entry-10799565754.html</link>
<pubDate>Sun, 13 Feb 2011 12:41:46 +0900</pubDate>
</item>
<item>
<title>python how to get a list of available encodings</title>
<description>
<![CDATA[ try this.<br><br>import encodings.aliases<br>encodings.aliases.aliases<br><br>http://bytes.com/topic/python/answers/852608-where-locate-existing-standard-encodings-python<br><br><br>
]]>
</description>
<link>https://ameblo.jp/yeele/entry-10590642904.html</link>
<pubDate>Wed, 14 Jul 2010 21:17:39 +0900</pubDate>
</item>
<item>
<title>python 関数ポインタ</title>
<description>
<![CDATA[ 前記事の補足です。参考までに。<br><br>関数名の()なしだと、関数ポインタとなる<br><br>def hoge(x, y, z):<br>    print x, y, z<br><br>if __name__ == "__main__":<br>    hoge("foo", 'hoge', 'var')<br>    print hoge<br>    x = hoge<br>    x("a", "b", "c")<br>    x("foo", 'hoge', 'var')<br><br>
]]>
</description>
<link>https://ameblo.jp/yeele/entry-10570761818.html</link>
<pubDate>Wed, 23 Jun 2010 00:42:36 +0900</pubDate>
</item>
<item>
<title>python removeできない！！The process cannot accesではまる！</title>
<description>
<![CDATA[ はまってしまったので、今後の為にメモを残しておきます。<br>以前にも１回同じ内容ではまった記憶あり、、、。<br><br>以下のソースだと、remove()で<br>WindowsError: [Error 32] The process cannot access the file because it is being used by another process<br>が発生します。<br><br>原因は、fr.close で()が記述してないから。<br>pythonでは関数を()なしで記述しても、問題ない。おそらく関数ポインタとして使えるのだろう。<br><br>import os<br>import time<br>#tardir = "E:\\workspace\\python\\testfolder\\__init__ - Copy.py"<br>tardir = r"E:\workspace\python\testfolder\__init__ - Copy.py"<br>print tardir<br>#"""<br>fr = open(tardir, "r")<br>#fr.close()<br>fr.close<br>#"""<br>#time.sleep(1)<br>print fr.closed;<br>#try:<br>os.remove(tardir);<br>#except:<br>#    print "catnot remove!!"    <br>#else:<br>#    print "It was removed!"<br><br><br>print "bye"<br><br><br>
]]>
</description>
<link>https://ameblo.jp/yeele/entry-10570746473.html</link>
<pubDate>Wed, 23 Jun 2010 00:16:24 +0900</pubDate>
</item>
<item>
<title>javascript オブジェクトリテラル　prototype</title>
<description>
<![CDATA[ javascript でオブジェクトリテラルつかって、宣言するときの注意点。<br><br><a href="http://stat.ameba.jp/user_images/20100608/23/yeele/19/c9/g/o0724060010581731280.gif"><img src="https://stat.ameba.jp/user_images/20100608/23/yeele/19/c9/g/t02200182_0724060010581731280.gif" alt="makotoのブログ-javascript prototype"></a>
]]>
</description>
<link>https://ameblo.jp/yeele/entry-10557851608.html</link>
<pubDate>Tue, 08 Jun 2010 23:46:19 +0900</pubDate>
</item>
</channel>
</rss>
