<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:xhtml="http://www.w3.org/1999/xhtml"
	>
<channel>
	<title>プログラム110番 へのコメント</title>
	<atom:link href="http://www.sps.co.jp/qa/?feed=comments-rss2" rel="self" type="application/rss+xml" />
	<link>http://www.sps.co.jp/qa</link>
	<description>プログラミングその他に関する質問と回答</description>
	<lastBuildDate>Thu, 22 Jul 2010 08:57:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>fumiu より Debian で rails 2.3.8 がmongrel以外で動かない件 へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=81&#038;cpage=1#comment-75</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Thu, 22 Jul 2010 08:57:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=81#comment-75</guid>
		<description>コードを追いかけたところ、rack のロードで失敗していた模様。
要求バージョンが「~&gt; 1.1.0」となっており、rack 自体は 1.2.1 と 1.1.0 が gem で導入されていた。

どうやら「~&gt;」演算子は指定バージョンより大きくて、かつ最終桁のみ異なるものを要求するらしく、1.1.0 では大きくなく、1.2.0 では2桁目が違うのでダメとなっていた。

とりあえず gems/actionpack-2.3.8/lib/action_controller.rb 中と specifications/actionpack-2.3.8.gemspec 中の「~&gt; 1.1.0」の部分を「~&gt; 1.1」と修正したところ、無事に動作するようになった。</description>
		<content:encoded><![CDATA[<p>コードを追いかけたところ、rack のロードで失敗していた模様。<br />
要求バージョンが「~> 1.1.0」となっており、rack 自体は 1.2.1 と 1.1.0 が gem で導入されていた。</p>
<p>どうやら「~>」演算子は指定バージョンより大きくて、かつ最終桁のみ異なるものを要求するらしく、1.1.0 では大きくなく、1.2.0 では2桁目が違うのでダメとなっていた。</p>
<p>とりあえず gems/actionpack-2.3.8/lib/action_controller.rb 中と specifications/actionpack-2.3.8.gemspec 中の「~> 1.1.0」の部分を「~> 1.1」と修正したところ、無事に動作するようになった。</p>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より jpmobile でDoCoMoのセッションIDが変わる へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=75&#038;cpage=1#comment-73</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Thu, 25 Mar 2010 04:58:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=75#comment-73</guid>
		<description>以下のページに原因と解決策がある。

http://blog.t-4u.net/web/tag/14/article/105

簡単に抜粋すると、plugin/jpmobile/lib/jpmobile/trans_sid.rb の内容を以下のように変更(10行目)する。

変更前
[ruby]
module ParamsOverCookie
  def self.included(base)
    base.class_eval do
      # cookie よりも params を先に見るパッチ
      def load_session_with_jpmobile(env)
        request = Rack::Request.new(env)
        unless @cookie_only
          sid = request.params[@key]
        end
        sid &#124;&#124;= request.cookies[@key]  # ここでsidがnil

        sid, session = get_session(env, sid)
        [sid, session]
      end
      alias_method_chain :load_session, :jpmobile
    end
  end
end
[/ruby]

変更後
[ruby]
        #sid &#124;&#124;= request.cookies[@key]
        sid = sid &#124;&#124; request.cookies[@key] &#124;&#124; request.params[@key]
[/ruby]</description>
		<content:encoded><![CDATA[<p>以下のページに原因と解決策がある。</p>
<p><a href="http://blog.t-4u.net/web/tag/14/article/105" rel="nofollow">http://blog.t-4u.net/web/tag/14/article/105</a></p>
<p>簡単に抜粋すると、plugin/jpmobile/lib/jpmobile/trans_sid.rb の内容を以下のように変更(10行目)する。</p>
<p>変更前</p>
<pre class="brush: ruby;">
module ParamsOverCookie
  def self.included(base)
    base.class_eval do
      # cookie よりも params を先に見るパッチ
      def load_session_with_jpmobile(env)
        request = Rack::Request.new(env)
        unless @cookie_only
          sid = request.params[@key]
        end
        sid ||= request.cookies[@key]  # ここでsidがnil

        sid, session = get_session(env, sid)
        [sid, session]
      end
      alias_method_chain :load_session, :jpmobile
    end
  end
end
</pre>
<p>変更後</p>
<pre class="brush: ruby;">
        #sid ||= request.cookies[@key]
        sid = sid || request.cookies[@key] || request.params[@key]
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より lldebug の MinGW でのコンパイル へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=73&#038;cpage=1#comment-72</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Tue, 09 Mar 2010 06:17:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=73#comment-72</guid>
		<description>上の状態で make すると、途中からコマンドの先頭に「X」が入ってエラーしているのが分かった。
どうやら最後のリンクでコケているようなので、その部分だけ抽出してみると次のようになった。
「/usr/local/lib/libboost-*」の部分や、「&quot;/c/Program Files/*&quot;」の部分は各自の環境に合わせること。

build.sh
[bash]
#!/bin/sh

g++ -g -O2 -o lldebug_frame.exe lldebug_frame-*.o \
../treelistctrl/libtreelistctrl.a \
../wxscintilla/libwxscintilla.a \
/usr/local/lib/libboost_thread-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_filesystem-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_system-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_serialization-mgw34-mt-1_42.lib \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/ws2_32.lib&quot; \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/mswsock.lib&quot; \
`wx-config --libs`
[/bash]

これを使ってリンクすると、「undefined reference」エラーが発生してしまう。
どうも「wxTextCtrlBase::overflow(int)」あたりで問題になっているらしい。
これをキーワードに色々検索したが、ちょうどヒットするものは無かった。
探しているうちに以下のURLに辿り着き、MinGW での wxWidget のコンパイルオプションが載っていたので、それを試してみることにした。

http://max.berger.name/howto/wxWidgets/wxWidgets_MinGW.jsp

使ったコマンドは「./configure --enable-optimise --enable-stl --enable-unicode --disable-threads --enable-static --disable-shared --enable-monolithic」の後に通常通り「make」だ。

この状態で lldebug_frame の続きをコンパイルしようとしたら「const TCHAR」が「const WCHAR」と違うと怒られた。
仕方無いので build/lldebug_frame/Makefile 中に以下のように「-DUNICODE」を定義する。3行目、5行目、9行目だ。

[cpp]
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -pipe -O2 -mms-bitfields -march=i686 -DUNICODE
CPP = gcc -E
CPPFLAGS = -DUNICODE
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2 -DUNICODE
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
[/cpp]

これでまた libtool あたりで X… というコマンドのエラーで止まる状態になる。このコメントの最初と同様である。

ここで build/lldebug_frame の中で「/bin/sh build.sh」を実行すると、今度は「wxTextCtrlBase」に関する問題が消えているはずだ。

もし自前のboostライブラリがコンパイル済みで、このあたりで「boost_system」関連のエラーが出るようであれば、下のように変更してから「make clean;make」でエラー後に「/bin/sh build.sh」をしてみると直るかもしれない。変更は3行目と13行目だ。

修正前
[cpp]
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           -I../../extralib/treelistctrl/include \
           -I../../extralib/wxscintilla/include

lldebug_frame_CPPFLAGS = -DLLDEBUG_VISUAL \
                         -Wall $(WXCPPFLAGS)

lldebug_frame_LDADD = $(libadd) \
                      ../treelistctrl/libtreelistctrl.a \
                      ../wxscintilla/libwxscintilla.a \
                      ../boost_system/libboost_system.a \
                      -lboost_thread-mt \
                      -lboost_filesystem-mt \
                      -lboost_serialization-mt \
                      $(WXLIBS)
[/cpp]

修正後
[cpp]
INCLUDES = -I../../include \
           -I../../src \
           -I/usr/local/include/boost/asio \
           -I../../extralib/treelistctrl/include \
           -I../../extralib/wxscintilla/include

lldebug_frame_CPPFLAGS = -DLLDEBUG_VISUAL \
                         -Wall $(WXCPPFLAGS)

lldebug_frame_LDADD = $(libadd) \
                      ../treelistctrl/libtreelistctrl.a \
                      ../wxscintilla/libwxscintilla.a \
                      -lboost_system-mt \
                      -lboost_thread-mt \
                      -lboost_filesystem-mt \
                      -lboost_serialization-mt \
                      $(WXLIBS)
[/cpp]

これで lldebug_frame.exe が出来ていればOKである。

続いて build/lua_debug/Makefile を次のように修正する。lldebug の時と同様の手順である。修正は3行目および4行目だ。

修正前
[cpp]
top_builddir = ../..
top_srcdir = ../..
INCLUDES = -I../../include `lua-config --include`
LUA_LIBS = `lua-config --libs`
lua_debug_SOURCES = ../../src/lua_debug/lua_debug.c
[/cpp]

修正後
[cpp]
top_builddir = ../..
top_srcdir = ../..
INCLUDES = -I../../include -I/usr/local/include/lua
LUA_LIBS = -L/usr/local/lib -llua
lua_debug_SOURCES = ../../src/lua_debug/lua_debug.c
[/cpp]

ここで「make」すると、また libtool まわりでエラーになるかもしれない。その時は以下の build.sh を作って、実行するとよい。

[bash]
#!/bin/sh

g++ -g -O2 -o lua_debug.exe lua_debug-*.o \
-L/usr/local/lib \
../lldebug/liblldebug.a \
/usr/local/lib/libboost_system-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_thread-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_filesystem-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_serialization-mgw34-mt-1_42.lib \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/ws2_32.lib&quot; \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/mswsock.lib&quot; \
-llua
[/bash]

これで前と同様に「/bin/sh build.sh」するとリンクできるはずである。
この時に「boost::system::get_posix_category()」などについてエラーが出ていたら、仕方無いので build/lldebug/ に戻って Makefile を編集し、もう一度「make clean;make」しなければならない。

修正前 build/lldebug/Makefile
[cpp]
top_srcdir = ../..
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           -I/usr/local/include/lua

noinst_LIBRARIES = liblldebug.a
[/cpp]

修正後 build/lldebug/Makefile (4行目)
[cpp]
top_srcdir = ../..
INCLUDES = -I../../include \
           -I../../src \
           -I/usr/local/include/boost/asio \
           -I/usr/local/include/lua

noinst_LIBRARIES = liblldebug.a
[/cpp]

たぶん、これで lua_debug.exe が出来るはずである。
ここまで出来れば、あとは build/lldebug/liblldebug.a を /usr/local/lib/ にコピーし、build/lldebug_frame/lldebug_frame.exe を /usr/local/bin/ にコピーしておけばよい。

テストは以下のようなファイルを作って、build/lua_debug/lua_debug.exe にファイル名を与えて起動すると、デバッグウィンドウが表示されることで行える。

[perl]
-- test.lua

function hello()
  print &quot;hello&quot;
end

hello()
[/perl]

実際のプログラムは include 以下のヘッダファイル二つを /usr/local/include あたりへコピーしておき、lua.h の代わりに lldebug.h をインクルードして通常通り使えばいい模様。詳しくは&lt;a href=&quot;http://wikiwiki.jp/lldebug/&quot; rel=&quot;nofollow&quot;&gt;サイト&lt;/a&gt;か lua_debug のソースを参照のこと。

以上である。</description>
		<content:encoded><![CDATA[<p>上の状態で make すると、途中からコマンドの先頭に「X」が入ってエラーしているのが分かった。<br />
どうやら最後のリンクでコケているようなので、その部分だけ抽出してみると次のようになった。<br />
「/usr/local/lib/libboost-*」の部分や、「&#8221;/c/Program Files/*&#8221;」の部分は各自の環境に合わせること。</p>
<p>build.sh</p>
<pre class="brush: bash;">
#!/bin/sh

g++ -g -O2 -o lldebug_frame.exe lldebug_frame-*.o \
../treelistctrl/libtreelistctrl.a \
../wxscintilla/libwxscintilla.a \
/usr/local/lib/libboost_thread-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_filesystem-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_system-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_serialization-mgw34-mt-1_42.lib \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/ws2_32.lib&quot; \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/mswsock.lib&quot; \
`wx-config --libs`
</pre>
<p>これを使ってリンクすると、「undefined reference」エラーが発生してしまう。<br />
どうも「wxTextCtrlBase::overflow(int)」あたりで問題になっているらしい。<br />
これをキーワードに色々検索したが、ちょうどヒットするものは無かった。<br />
探しているうちに以下のURLに辿り着き、MinGW での wxWidget のコンパイルオプションが載っていたので、それを試してみることにした。</p>
<p><a href="http://max.berger.name/howto/wxWidgets/wxWidgets_MinGW.jsp" rel="nofollow">http://max.berger.name/howto/wxWidgets/wxWidgets_MinGW.jsp</a></p>
<p>使ったコマンドは「./configure &#8211;enable-optimise &#8211;enable-stl &#8211;enable-unicode &#8211;disable-threads &#8211;enable-static &#8211;disable-shared &#8211;enable-monolithic」の後に通常通り「make」だ。</p>
<p>この状態で lldebug_frame の続きをコンパイルしようとしたら「const TCHAR」が「const WCHAR」と違うと怒られた。<br />
仕方無いので build/lldebug_frame/Makefile 中に以下のように「-DUNICODE」を定義する。3行目、5行目、9行目だ。</p>
<pre class="brush: cpp;">
CC = gcc
CCDEPMODE = depmode=gcc3
CFLAGS = -pipe -O2 -mms-bitfields -march=i686 -DUNICODE
CPP = gcc -E
CPPFLAGS = -DUNICODE
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -g -O2 -DUNICODE
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
</pre>
<p>これでまた libtool あたりで X… というコマンドのエラーで止まる状態になる。このコメントの最初と同様である。</p>
<p>ここで build/lldebug_frame の中で「/bin/sh build.sh」を実行すると、今度は「wxTextCtrlBase」に関する問題が消えているはずだ。</p>
<p>もし自前のboostライブラリがコンパイル済みで、このあたりで「boost_system」関連のエラーが出るようであれば、下のように変更してから「make clean;make」でエラー後に「/bin/sh build.sh」をしてみると直るかもしれない。変更は3行目と13行目だ。</p>
<p>修正前</p>
<pre class="brush: cpp;">
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           -I../../extralib/treelistctrl/include \
           -I../../extralib/wxscintilla/include

lldebug_frame_CPPFLAGS = -DLLDEBUG_VISUAL \
                         -Wall $(WXCPPFLAGS)

lldebug_frame_LDADD = $(libadd) \
                      ../treelistctrl/libtreelistctrl.a \
                      ../wxscintilla/libwxscintilla.a \
                      ../boost_system/libboost_system.a \
                      -lboost_thread-mt \
                      -lboost_filesystem-mt \
                      -lboost_serialization-mt \
                      $(WXLIBS)
</pre>
<p>修正後</p>
<pre class="brush: cpp;">
INCLUDES = -I../../include \
           -I../../src \
           -I/usr/local/include/boost/asio \
           -I../../extralib/treelistctrl/include \
           -I../../extralib/wxscintilla/include

lldebug_frame_CPPFLAGS = -DLLDEBUG_VISUAL \
                         -Wall $(WXCPPFLAGS)

lldebug_frame_LDADD = $(libadd) \
                      ../treelistctrl/libtreelistctrl.a \
                      ../wxscintilla/libwxscintilla.a \
                      -lboost_system-mt \
                      -lboost_thread-mt \
                      -lboost_filesystem-mt \
                      -lboost_serialization-mt \
                      $(WXLIBS)
</pre>
<p>これで lldebug_frame.exe が出来ていればOKである。</p>
<p>続いて build/lua_debug/Makefile を次のように修正する。lldebug の時と同様の手順である。修正は3行目および4行目だ。</p>
<p>修正前</p>
<pre class="brush: cpp;">
top_builddir = ../..
top_srcdir = ../..
INCLUDES = -I../../include `lua-config --include`
LUA_LIBS = `lua-config --libs`
lua_debug_SOURCES = ../../src/lua_debug/lua_debug.c
</pre>
<p>修正後</p>
<pre class="brush: cpp;">
top_builddir = ../..
top_srcdir = ../..
INCLUDES = -I../../include -I/usr/local/include/lua
LUA_LIBS = -L/usr/local/lib -llua
lua_debug_SOURCES = ../../src/lua_debug/lua_debug.c
</pre>
<p>ここで「make」すると、また libtool まわりでエラーになるかもしれない。その時は以下の build.sh を作って、実行するとよい。</p>
<pre class="brush: bash;">
#!/bin/sh

g++ -g -O2 -o lua_debug.exe lua_debug-*.o \
-L/usr/local/lib \
../lldebug/liblldebug.a \
/usr/local/lib/libboost_system-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_thread-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_filesystem-mgw34-mt-1_42.lib \
/usr/local/lib/libboost_serialization-mgw34-mt-1_42.lib \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/ws2_32.lib&quot; \
&quot;/c/Program Files/Microsoft Platform SDK/Lib/mswsock.lib&quot; \
-llua
</pre>
<p>これで前と同様に「/bin/sh build.sh」するとリンクできるはずである。<br />
この時に「boost::system::get_posix_category()」などについてエラーが出ていたら、仕方無いので build/lldebug/ に戻って Makefile を編集し、もう一度「make clean;make」しなければならない。</p>
<p>修正前 build/lldebug/Makefile</p>
<pre class="brush: cpp;">
top_srcdir = ../..
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           -I/usr/local/include/lua

noinst_LIBRARIES = liblldebug.a
</pre>
<p>修正後 build/lldebug/Makefile (4行目)</p>
<pre class="brush: cpp;">
top_srcdir = ../..
INCLUDES = -I../../include \
           -I../../src \
           -I/usr/local/include/boost/asio \
           -I/usr/local/include/lua

noinst_LIBRARIES = liblldebug.a
</pre>
<p>たぶん、これで lua_debug.exe が出来るはずである。<br />
ここまで出来れば、あとは build/lldebug/liblldebug.a を /usr/local/lib/ にコピーし、build/lldebug_frame/lldebug_frame.exe を /usr/local/bin/ にコピーしておけばよい。</p>
<p>テストは以下のようなファイルを作って、build/lua_debug/lua_debug.exe にファイル名を与えて起動すると、デバッグウィンドウが表示されることで行える。</p>
<pre class="brush: perl;">
-- test.lua

function hello()
  print &quot;hello&quot;
end

hello()
</pre>
<p>実際のプログラムは include 以下のヘッダファイル二つを /usr/local/include あたりへコピーしておき、lua.h の代わりに lldebug.h をインクルードして通常通り使えばいい模様。詳しくは<a href="http://wikiwiki.jp/lldebug/" rel="nofollow">サイト</a>か lua_debug のソースを参照のこと。</p>
<p>以上である。</p>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より lldebug の MinGW でのコンパイル へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=73&#038;cpage=1#comment-71</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Fri, 05 Mar 2010 10:33:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=73#comment-71</guid>
		<description>wxWidget と Boost(バージョン1.41.0以降が必要)は準備済みとする。

まずは extralib/treelistctrl をコンパイルするために、extralib/treelistctrl/src/treelistctrl.cpp に以下の4行目のようにインクルードを追加する。

[cpp]
#include &lt;wx/dcscreen.h&gt;
#include &lt;wx/scrolwin.h&gt;

#include &lt;wx/dcmemory.h&gt;

#include &quot;wx/treelistctrl.h&quot;
[/cpp]

続いて、.configure の後に出来上がる build/lldebug/Makefile を以下のように修正する。

修正前
[cpp]
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           `lua-config --include`
[/cpp]

修正後(Luaのヘッダファイルが/usr/local/include/luaにある場合)
[cpp]
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           -I/usr/local/include/lua
[/cpp]

その後、src/net/echostream.h の139行目(以下の2行目)を次のように変更する。

修正前
[cpp]
virtual std::streampos seekoff(std::streamoff /*off*/,
			   std::ios::seek_dir /*dir*/, 
		   int mode = std::ios::in &#124; std::ios::out) {
[/cpp]

修正後
[cpp]
virtual std::streampos seekoff(std::streamoff /*off*/,
			   std::ios::seekdir /*dir*/, 
		   int mode = std::ios::in &#124; std::ios::out) {
[/cpp]

同様に src/net/remoteengine.cpp にも以下のインクルードを追加する。

[cpp]
#include &lt;iostream&gt;
[/cpp]

さらに src/visual/sourceview.cpp の465行目(下の2行目)に以下のように「.data()」を追加する。

[cpp]
              wxCharBuffer cbuffer = GetLineRaw(i);
              std::string buffer = (cbuffer.data() != NULL ? cbuffer.data() : &quot;&quot;);

              // trim newlines
[/cpp]

これで make できるようになるはず…と思いきや、まだ通らない。
この続きは次回ということで。</description>
		<content:encoded><![CDATA[<p>wxWidget と Boost(バージョン1.41.0以降が必要)は準備済みとする。</p>
<p>まずは extralib/treelistctrl をコンパイルするために、extralib/treelistctrl/src/treelistctrl.cpp に以下の4行目のようにインクルードを追加する。</p>
<pre class="brush: cpp;">
#include &lt;wx/dcscreen.h&gt;
#include &lt;wx/scrolwin.h&gt;

#include &lt;wx/dcmemory.h&gt;

#include &quot;wx/treelistctrl.h&quot;
</pre>
<p>続いて、.configure の後に出来上がる build/lldebug/Makefile を以下のように修正する。</p>
<p>修正前</p>
<pre class="brush: cpp;">
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           `lua-config --include`
</pre>
<p>修正後(Luaのヘッダファイルが/usr/local/include/luaにある場合)</p>
<pre class="brush: cpp;">
INCLUDES = -I../../include \
           -I../../src \
           -I../../extralib/boost_asio_0_3_9 \
           -I/usr/local/include/lua
</pre>
<p>その後、src/net/echostream.h の139行目(以下の2行目)を次のように変更する。</p>
<p>修正前</p>
<pre class="brush: cpp;">
virtual std::streampos seekoff(std::streamoff /*off*/,
			   std::ios::seek_dir /*dir*/,
		   int mode = std::ios::in | std::ios::out) {
</pre>
<p>修正後</p>
<pre class="brush: cpp;">
virtual std::streampos seekoff(std::streamoff /*off*/,
			   std::ios::seekdir /*dir*/,
		   int mode = std::ios::in | std::ios::out) {
</pre>
<p>同様に src/net/remoteengine.cpp にも以下のインクルードを追加する。</p>
<pre class="brush: cpp;">
#include &lt;iostream&gt;
</pre>
<p>さらに src/visual/sourceview.cpp の465行目(下の2行目)に以下のように「.data()」を追加する。</p>
<pre class="brush: cpp;">
              wxCharBuffer cbuffer = GetLineRaw(i);
              std::string buffer = (cbuffer.data() != NULL ? cbuffer.data() : &quot;&quot;);

              // trim newlines
</pre>
<p>これで make できるようになるはず…と思いきや、まだ通らない。<br />
この続きは次回ということで。</p>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より xtal のMinGW でのコンパイル へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=71&#038;cpage=1#comment-70</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Fri, 05 Mar 2010 05:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=71#comment-70</guid>
		<description>まず vc9 のフォルダをそのまま mingw などという名前でコピーする。
続いて、gcc/Makefile を mingw 内にコピーする。
その後、以下のようにオプション設定を変更してから mingw フォルダに移動して make するとバイナリが出来上がる。

修正前
&lt;code&gt;OPT = -O2 -DNDEBUG -fno-rtti -fno-exceptions -Wall -DXTAL_USE_PTHREAD_TLS
LOPT = -lpthread -lstdc++
&lt;/code&gt;

修正後
&lt;code&gt;OPT = -O2 -DNDEBUG -fno-rtti -fno-exceptions -Wall -DWIN32 -D_CONSOLE
LOPT = -lstdc++
&lt;/code&gt;
</description>
		<content:encoded><![CDATA[<p>まず vc9 のフォルダをそのまま mingw などという名前でコピーする。<br />
続いて、gcc/Makefile を mingw 内にコピーする。<br />
その後、以下のようにオプション設定を変更してから mingw フォルダに移動して make するとバイナリが出来上がる。</p>
<p>修正前<br />
<code>OPT = -O2 -DNDEBUG -fno-rtti -fno-exceptions -Wall -DXTAL_USE_PTHREAD_TLS<br />
LOPT = -lpthread -lstdc++<br />
</code></p>
<p>修正後<br />
<code>OPT = -O2 -DNDEBUG -fno-rtti -fno-exceptions -Wall -DWIN32 -D_CONSOLE<br />
LOPT = -lstdc++<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より ipトンネリングの設定方法(Debian GNU/Linux) へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=65&#038;cpage=1#comment-69</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Fri, 05 Mar 2010 05:00:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=65#comment-69</guid>
		<description>両側のルータにて、以下のようなコマンドでトンネルを設定すればよい。

[bash]
# ルータA
# 
# インターネットIP：192.168.100.1
# ローカルネットIP：192.168.1.1

ip tunnel add tun0 mode ipip local 192.168.100.1 remote 192.168.100.2
ip link set tun0 up
ip addr add 192.168.3.1 dev tun0
ip route add 192.168.2.0/24 dev tun0
ip route add 192.168.3.0/24 dev tun0
[/bash]

[bash]
# ルータB
# 
# インターネットIP：192.168.100.2
# ローカルネットIP：192.168.2.1

ip tunnel add tun0 mode ipip local 192.168.100.2 remote 192.168.100.1
ip link set tun0 up
ip addr add 192.168.3.2 dev tun0
ip route add 192.168.1.0/24 dev tun0
ip route add 192.168.3.0/24 dev tun0
[/bash]</description>
		<content:encoded><![CDATA[<p>両側のルータにて、以下のようなコマンドでトンネルを設定すればよい。</p>
<pre class="brush: bash;">
# ルータA
#
# インターネットIP：192.168.100.1
# ローカルネットIP：192.168.1.1

ip tunnel add tun0 mode ipip local 192.168.100.1 remote 192.168.100.2
ip link set tun0 up
ip addr add 192.168.3.1 dev tun0
ip route add 192.168.2.0/24 dev tun0
ip route add 192.168.3.0/24 dev tun0
</pre>
<pre class="brush: bash;">
# ルータB
#
# インターネットIP：192.168.100.2
# ローカルネットIP：192.168.2.1

ip tunnel add tun0 mode ipip local 192.168.100.2 remote 192.168.100.1
ip link set tun0 up
ip addr add 192.168.3.2 dev tun0
ip route add 192.168.1.0/24 dev tun0
ip route add 192.168.3.0/24 dev tun0
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より Rails で POST リクエストすると 422 エラーが返る へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=60&#038;cpage=1#comment-49</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Fri, 11 Dec 2009 03:37:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=60#comment-49</guid>
		<description>CSRF 対策のため、GET メソッド以外は認証用のトークン文字列を必要とします。
該当のコントローラに「skip_before_filter :verify_authenticity_token」を記述することで回避できますが、セキュリティ強度は落ちます。

詳しくは http://d.hatena.ne.jp/willnet/20080509/1210338845 などを参照してください。</description>
		<content:encoded><![CDATA[<p>CSRF 対策のため、GET メソッド以外は認証用のトークン文字列を必要とします。<br />
該当のコントローラに「skip_before_filter :verify_authenticity_token」を記述することで回避できますが、セキュリティ強度は落ちます。</p>
<p>詳しくは <a href="http://d.hatena.ne.jp/willnet/20080509/1210338845" rel="nofollow">http://d.hatena.ne.jp/willnet/20080509/1210338845</a> などを参照してください。</p>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より SQLite でインデックスを作ろうとするとエラーになる へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=52&#038;cpage=1#comment-33</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Fri, 27 Nov 2009 02:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=52#comment-33</guid>
		<description>以下のrequireを先頭に追加してから、その下の3行をマイグレーション本文に追加するとSQLite以外でのみcreate_indexされるようにできます。

[ruby]
require &#039;active_record/connection_adapters/sqlite_adapter&#039;

unless connection.kind_of?(ActiveRecord::ConnectionAdapters::SQLiteAdapter)
  create_index :table, :col
end
[/ruby]</description>
		<content:encoded><![CDATA[<p>以下のrequireを先頭に追加してから、その下の3行をマイグレーション本文に追加するとSQLite以外でのみcreate_indexされるようにできます。</p>
<pre class="brush: ruby;">
require 'active_record/connection_adapters/sqlite_adapter'

unless connection.kind_of?(ActiveRecord::ConnectionAdapters::SQLiteAdapter)
  create_index :table, :col
end
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より MySQL で text データが 65535 バイトしか入らない へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=49&#038;cpage=1#comment-32</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Fri, 27 Nov 2009 02:13:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=49#comment-32</guid>
		<description>以下のrequireを先頭に入れ、マイグレーション本文で下の3行を参考にテーブル変更のSQLを実行させると、より多くの文字数を入力できます。
mediumtext では最大 1677215 文字まで、largetext ならば最大 4294967295 文字まで入ります。

[ruby]
require &#039;active_record/connection_adapters/mysql_adapter&#039;

if connection.kind_of?(ActiveRecord::ConnectionAdapters::MysqlAdapter)
  execute &quot;ALTER TABLE table CHANGE COLUMN col col mediumtext&quot;
end
[/ruby]</description>
		<content:encoded><![CDATA[<p>以下のrequireを先頭に入れ、マイグレーション本文で下の3行を参考にテーブル変更のSQLを実行させると、より多くの文字数を入力できます。<br />
mediumtext では最大 1677215 文字まで、largetext ならば最大 4294967295 文字まで入ります。</p>
<pre class="brush: ruby;">
require 'active_record/connection_adapters/mysql_adapter'

if connection.kind_of?(ActiveRecord::ConnectionAdapters::MysqlAdapter)
  execute &quot;ALTER TABLE table CHANGE COLUMN col col mediumtext&quot;
end
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>fumiu より linux で sparse ファイルを作る方法 へのコメント</title>
		<link>http://www.sps.co.jp/qa/?p=41&#038;cpage=1#comment-8</link>
		<dc:creator>fumiu</dc:creator>
		<pubDate>Tue, 13 Oct 2009 07:40:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.sps.co.jp/qa/?p=41#comment-8</guid>
		<description>ddコマンドを利用して「dd if=/dev/zero of=file.img bs=1024M count=0 seek=4」などのように実行すればよい。
上の例では 4GB の sparse ファイルを作成している。状況に応じて bs と seek を調整すること。</description>
		<content:encoded><![CDATA[<p>ddコマンドを利用して「dd if=/dev/zero of=file.img bs=1024M count=0 seek=4」などのように実行すればよい。<br />
上の例では 4GB の sparse ファイルを作成している。状況に応じて bs と seek を調整すること。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
