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

<channel>
	<title>Mateusz Loskot</title>
	<atom:link href="http://mateusz.loskot.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://mateusz.loskot.net</link>
	<description>mloskot&#039;s life, programming, c++, geo and adventures</description>
	<lastBuildDate>Tue, 10 Jan 2012 22:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Cycling to work moved to RunKeeper</title>
		<link>http://mateusz.loskot.net/2012/01/10/cycling-to-work-moved-to-runkeeper/</link>
		<comments>http://mateusz.loskot.net/2012/01/10/cycling-to-work-moved-to-runkeeper/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 22:00:22 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[cycling]]></category>
		<category><![CDATA[runkeeper]]></category>
		<category><![CDATA[sport]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2933</guid>
		<description><![CDATA[A week ago, I started my cycling to work chronicles. Then Peter reminded me about RunKeeper. So, I have moved my cycling logs to my profile at RunKeeper: http://runkeeper.com/user/mloskot/. It is much more convenient than posting it here.]]></description>
			<content:encoded><![CDATA[<p>A week ago, I <a href="/?p=2875">started</a> my cycling to work chronicles. Then <a href="http://zsoldosp.blogspot.com/">Peter</a> <a href="https://twitter.com/#!/zsepi/status/156313289448628224">reminded</a> me about <a href="http://runkeeper.com/">RunKeeper</a>. So, I have moved my cycling logs to my profile at RunKeeper: <a href="http://runkeeper.com/user/mloskot/">http://runkeeper.com/user/mloskot/</a>. It is much more convenient than posting it here.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2012/01/10/cycling-to-work-moved-to-runkeeper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cycling to work &#8211; Day #2</title>
		<link>http://mateusz.loskot.net/2012/01/06/cycling-to-work-day-2/</link>
		<comments>http://mateusz.loskot.net/2012/01/06/cycling-to-work-day-2/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 10:21:54 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[cycling]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2917</guid>
		<description><![CDATA[Update: Cycling to work moved to RunKeeper Route: #1 Distance: 8.1 km Time: 22 min Conditions: prime, cycling under the raising sun, +5C seems to fit into the perfect temperature range for cycling in a city.]]></description>
			<content:encoded><![CDATA[<p>Update: <a href="/?p=2933">Cycling to work moved to RunKeeper</a></p>
<ul>
<li>Route: <a href="http://goo.gl/nevZY">#1</a></li>
<li>Distance: 8.1 km</li>
<li>Time: 22 min</li>
<li>Conditions: prime, cycling under the raising sun, +5C seems to fit into the perfect temperature range for cycling in a city.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2012/01/06/cycling-to-work-day-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Robert&#8217;s rules of Boost testing</title>
		<link>http://mateusz.loskot.net/2012/01/05/roberts-rules-of-boost-testing/</link>
		<comments>http://mateusz.loskot.net/2012/01/05/roberts-rules-of-boost-testing/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 23:16:44 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[boost.geometry]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2887</guid>
		<description><![CDATA[By the way of trying to figure out how to make tests building faster? (I will post about it later), I have learned some interesting practices regarding Boost testing in general. Especially, Robert Ramey shared his best practices, worth to &#8230; <a href="http://mateusz.loskot.net/2012/01/05/roberts-rules-of-boost-testing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>By the way of trying to figure out <a href="http://lists.boost.org/Archives/boost/2011/12/189026.php">how to make tests building faster?</a> (I will post about it later), I have learned some interesting practices regarding Boost testing in general. Especially, <a href="http://lists.boost.org/Archives/boost/2011/12/189045.php">Robert Ramey shared</a> his best practices, worth to look at really. New release of Boost will be released <a href="http://www.boost.org/community/index.html">next week</a>, so I&#8217;m testing <a href="http://www.boost.org/libs/geometry/">Boost.Geometry</a> library and it is a good opportunity to apply some of Robert&#8217;s rules.</p>
<blockquote><p>I&#8217;m testing against &#8220;known good&#8221; components &#8211; the next release branch.</p></blockquote>
<p>How to run tests of current development line of a library (a Boost library, e.g. Boost.Geometry) against Boost release branch? Assuming all the library development happens in Boost trunk, let&#8217;s say in <code>${DEV}/boost/_svn/trunk</code> where <code>${DEV}</code> is your base workshop location, do this:</p>
<ul>
<li>Checkout Boost release branch<code>
<pre class="brush: plain; title: ; notranslate">
mkdir -p ${DEV}/boost/_svn/branches/release
cd ${DEV}/boost/_svn/branches/release
svn co https://svn.boost.org/svn/boost/branches/release/ .
</pre>
<p></code></li>
<li>Stay in <code>${DEV}/boost/_svn/branches/release</code></li>
<li>Build and install Boost.Build v2 from the release branch:
<pre class="brush: plain; title: ; notranslate">
cd tools/build/v2
# On Windows, run bootstrap.bat
./bootstrap.sh
# On Windows, I use C:\usr as prefix for my Boost installation
./b2 --prefix=/usr/local install
# Note, this command will also install b2 utility in ${prefix}/bin
</pre>
</li>
<li>Switch Boost.Geometry directories to trunk:
<pre class="brush: plain; title: ; notranslate">
svn switch https://svn.boost.org/svn/boost/trunk/boost/geometry boost/geometry
svn switch https://svn.boost.org/svn/boost/trunk/libs/geometry libs/geometry
</pre>
</li>
<li>Run tests and generate full log in file:
<pre class="brush: plain; title: ; notranslate">
export BGLOG=boost-geometry-test.log
date &gt; $BGLOG &amp; b2 &gt;&gt; $BGLOG 2&lt;&amp;1 &amp; date &gt;&gt; $BGLOG

# On Windows, I run this with logging this way:
set BGLOG=%CD%\boost-geometry-test.log
dateu.exe &gt; %BGLOG% &amp; b2 &gt;&gt; %BGLOG% 2&lt;&amp;1 &amp; dateu.exe &gt;&gt; %BGLOG%
</pre>
<p>Note, the <code>dateu.exe</code> is renamed Unix utility <code>date.exe</code> installed from <a href="http://gnuwin32.sourceforge.net/">GnuWin32</a> packages. I just like it.</p>
</li>
</ul>
<p>Inspect the log file for test failures, for example by quick check of number of passed tests:</p>
<pre class="brush: plain; title: ; notranslate">
$ grep &quot;\*passed\*&quot; boost-geometry-test.log | wc -l
111
</pre>
<p>That&#8217;s it.</p>
<blockquote><p>Try this out &#8211; it will help a lot.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2012/01/05/roberts-rules-of-boost-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cycling to work &#8211; Day #1</title>
		<link>http://mateusz.loskot.net/2012/01/05/cycling-to-work-day-1/</link>
		<comments>http://mateusz.loskot.net/2012/01/05/cycling-to-work-day-1/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 20:23:30 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[cycling]]></category>
		<category><![CDATA[london]]></category>
		<category><![CDATA[weather]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2875</guid>
		<description><![CDATA[Update: Cycling to work moved to RunKeeper Route: #1 Distance: 8.1 km Time:25 min Conditions: first minute in the sun, then dramatic change &#8220;When the wind blows and the rain feels cold&#8221;&#8230;and thing layer of ice is forming on my &#8230; <a href="http://mateusz.loskot.net/2012/01/05/cycling-to-work-day-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Update: <a href="/?p=2933">Cycling to work moved to RunKeeper</a></p>
<ul>
<li>Route: <a href="http://goo.gl/nevZY">#1</a></li>
<li>Distance: 8.1 km</li>
<li>Time:25 min</li>
<li>Conditions: first minute in the sun, then dramatic change <em>&#8220;When the wind blows and the rain feels cold&#8221;</em>&#8230;and thing layer of ice is forming on my ankles and lower legs, but thankfully with no head in snow; it lasted for the first 3km and was enough to soak me well. Next, cycling in light rain. My shoes had been wet for the rest of the day. Tip: always have spare trousers and socks backed up in your office (t-shirts are obvious).</li>
</ul>
<p>New year, new challenges, new ideas. My new idea is to start logging cycling commuter chronicles and perhaps similar log for climbing, and running too if my weak <em>strong will</em> allows. Apparently, I have too much time up on my sleeves. Anyway, I&#8217;m going to post rather short log messages than detailed blog posts (if Twitter allowed ~300 characters, I&#8217;d probably use Twitter).</p>
<p>I have been cycling to work since I got my first bicycle <a href="/?p=284">here in London</a>. A lazy weekend during spring 2010, I made a trip to <a href="http://road.cc/content/news/31008-brick-lane-market-targeted-bike-theft-operation">Brick Lane</a> where I spent 90 quid, and a lot more hopes I hadn&#8217;t been buying from a thieve, to get my very first <a href="http://en.wikipedia.org/wiki/Fixed-gear_bicycle">fixi</a>. (If anyone in London used to have bright green fixi (though I bought it as black) with white handlebars and black saddle (<a href="http://www.flickr.com/photos/mloskot/4539435308/">photo</a>) and it was stolen, then let me know :-) .) I got my bicycle and started regular commute from <a href=" http://streetmap.co.uk/grid/530451_183998_106">N1</a> to <a href="http://streetmap.co.uk/grid/530325_180905_106">WC2R</a>.</p>
<p>Long story short, whenever I have to struggle through the crowds to get into the lifts in Covent Garden Underground Station, I honestly suffer. Cycling is simply great. The only disadvantage is that I no longer have 40 minutes per day to read a book.</p>
<p>Kudos to folks from <a href="http://www.cyclestreets.net/">CycleStreets</a> for the great service useful in optimising cycling routes.</p>
<p>Tip: every time you approach a minicab, imagine you are cycling on streets of one of the large cities in the far east and apply no trust rule whatsoever.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2012/01/05/cycling-to-work-day-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Boost.Geometry mailing list moved</title>
		<link>http://mateusz.loskot.net/2012/01/05/boost-geometry-mailing-list-moved/</link>
		<comments>http://mateusz.loskot.net/2012/01/05/boost-geometry-mailing-list-moved/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 00:08:55 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[boost.geometry]]></category>
		<category><![CDATA[geometry]]></category>
		<category><![CDATA[mailing list]]></category>
		<category><![CDATA[osgeo]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2868</guid>
		<description><![CDATA[I have moved mailing list of the Boost.Geometry library from server at OSGeo to Boost mailing list server. All existing subscribers and archives have been moved to the new server. The new list is available at geometry at lists dot &#8230; <a href="http://mateusz.loskot.net/2012/01/05/boost-geometry-mailing-list-moved/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have moved mailing list of the Boost.Geometry library from server at <a href="http://lists.osgeo.org">OSGeo</a> to <a href="http://lists.boost.org ">Boost</a> mailing list server. All existing subscribers and archives have been moved to the new server.</p>
<p>The new list is available at <a href="http://lists.boost.org/mailman/listinfo.cgi/geometry">geometry at lists dot boost dot org</a>. It is also mirrored at Nabble as <a href="http://boost-geometry.203548.n3.nabble.com/">Boost.Geometry</a>.</p>
<p>The old <a href="http://lists.osgeo.org/mailman/listinfo/ggl">ggl at lists dot osgeo dot org</a> will be wiped out soon.</p>
<p>If anyone experiences any problems with the new geometry at lists.boost.org, please <a href="/contact">contact</a> me directly.</p>
<p>Big thanks to the <a href="http://osgeo.org">OSGeo Foundation</a> for hosting the <em>ggl</em> mailing list and thanks to <a href="http://www.boost.org">Boost</a> admins for help with the new server.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2012/01/05/boost-geometry-mailing-list-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 11 patch for Boost.Build accepted</title>
		<link>http://mateusz.loskot.net/2011/12/19/visual-studio-11-patch-for-boost-build-accepted/</link>
		<comments>http://mateusz.loskot.net/2011/12/19/visual-studio-11-patch-for-boost-build-accepted/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 11:28:11 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[boost.build]]></category>
		<category><![CDATA[visual c++]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[visual studio 11]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2861</guid>
		<description><![CDATA[A few days ago I submitted patch with small fixes for Boost.Build to support Visual Studio 11 toolset. The patch has been accepted and committed to the current trunk in Boost repo. Thanks to Volodya for reviewing the patch.]]></description>
			<content:encoded><![CDATA[<p>A few days ago I submitted patch with <a href="/?p=2841">small fixes for Boost.Build</a> to support Visual Studio 11 toolset. The <a href="https://svn.boost.org/trac/boost/ticket/6283">patch has been accepted</a> and committed to the current trunk in Boost repo. Thanks to <a href="http://vladimir_prus.blogspot.com/">Volodya</a> for reviewing the patch.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2011/12/19/visual-studio-11-patch-for-boost-build-accepted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pygit-svn-mirror 0.1 released</title>
		<link>http://mateusz.loskot.net/2011/12/19/pygit-svn-mirror-0-1-released/</link>
		<comments>http://mateusz.loskot.net/2011/12/19/pygit-svn-mirror-0-1-released/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 01:13:40 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Eloy Durán]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2849</guid>
		<description><![CDATA[I have been looking for easy and quick solution to mirror Subversion repositories in Git at GitHub. With bit of reading and testing, I came up with some quite usable workflow. But, most likely due to my lack of Git &#8230; <a href="http://mateusz.loskot.net/2011/12/19/pygit-svn-mirror-0-1-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been looking for easy and quick solution to mirror <a href="http://subversion.apache.org/">Subversion</a> repositories in <a href="http://git-scm.com/">Git</a> at <a href="http://github.com">GitHub</a>. With bit of reading and testing, I came up with some quite usable <a href="http://trac.osgeo.org/gdal/wiki/UsingGitToMaintainGDALWorkflow">workflow</a>. But, most likely due to my lack of <a href="http://progit.org/">Git fu</a>, I wasn&#8217;t happy with it. Especially, could not find how to update Git mirrors from various locations and computers, also to allow others to do that.</p>
<p>Lately, I have found a tool written in <a href="http://www.ruby-lang.org/">Ruby</a> by <a href="https://github.com/alloy">Eloy Durán</a>. It is <a href="https://github.com/alloy/git-svn-mirror/">git-svn-mirror</a> &#8211; <em>a command-line tool that automates the task of creating a Git mirror for a SVN repository, and keeping it up-to-date</em>. I installed Eloy&#8217;s tool from <a href="https://rubygems.org/gems/git-svn-mirror">Ruby gems</a> and played with it for a while. I really liked it.</p>
<p>I skimmed the Ruby code of <code>git-svn-mirror</code> and found out it makes use of <a href="http://schacon.github.com/git/user-manual.html">bare repositories in Git</a>. A Git bare repository stores just the contents of the <code>.git</code> directory, without any files checked out around it. Long story short, this script does almost exactly what I need and if there is something it does not do, then I can add it.</p>
<p>I have never written a single line of code in Ruby and I don&#8217;t feel like I need to learn it now. So, I decided to port <a href="https://github.com/alloy/git-svn-mirror/">git-svn-mirror</a> to Python. I have just pushed <a href="https://github.com/mloskot/pygit-svn-mirror">pygit-svn-mirror</a> 0.1 based on git-svn-mirror 0.1 to the repository at GitHub. I have tried to follow command line interface and overall code structure of the original version in Ruby. I have also preserved the original license and Eloy&#8217;s copyright.</p>
<p>There is README.md file included with detailed guide on how to use the <code>pygit-svn-mirror</code>. Basically, there are two commands: <code>init</code> and <code>update</code>. For each command, <code>--help</code> option will display required and supported arguments.</p>
<p>For example, creating mirror of Subversion repository of PROJ.4 project at GitHub involves the following commands:</p>
<pre class="brush: plain; gutter: true; light: true; title: ; notranslate">
mkdir /path/to/proj4/mirror
cd /path/to/proj4/mirror
git-svn-mirror.py init \
  --from=https://svn.osgeo.org/metacrs/proj/ \
  --to=git@github.com:&lt;USRNAME&gt;/proj.4.git
</pre>
<p>and to update the mirror from its workbench directory:</p>
<pre class="brush: plain; gutter: true; light: true; title: ; notranslate">
cd /path/to/proj4/mirror
git-svn-mirror.py update
</pre>
<p>or from any folder but with workbench location pointed explicitly:</p>
<pre class="brush: plain; gutter: true; light: true; title: ; notranslate">
git-svn-mirror.py update -w /path/to/proj4/mirror
</pre>
<p><a href="/contact">Feedback</a>, <a href="https://github.com/mloskot/pygit-svn-mirror/issues">bug reports and patches</a> highly appreciated.</p>
<p>Finally, big thanks to <a href="https://github.com/alloy">Eloy Durán</a> for the original <a href="https://github.com/alloy/git-svn-mirror/">git-svn-mirror</a> written in Ruby.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2011/12/19/pygit-svn-mirror-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moved twitter.com/mateuszloskot to twitter.com/mloskot</title>
		<link>http://mateusz.loskot.net/2011/12/17/moved-twitter-commateuszloskot-to-twitter-commloskot/</link>
		<comments>http://mateusz.loskot.net/2011/12/17/moved-twitter-commateuszloskot-to-twitter-commloskot/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 16:13:14 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2845</guid>
		<description><![CDATA[Long time ago, I&#8217;d used twitter.com/mloskot account which I removed. Someone had taken it over and when I decided to come back to Twitter, I had to register as twitter.com/mateuszloskot. Today, Pantera noticed mloskot account has been released &#8211; someone &#8230; <a href="http://mateusz.loskot.net/2011/12/17/moved-twitter-commateuszloskot-to-twitter-commloskot/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Long time ago, I&#8217;d used <a href="http://twitter.com/mloskot">twitter.com/mloskot</a> account which I <a href="/?p=1100">removed</a>. Someone had taken it over and when I decided to come back to Twitter, I had to register as <a href="http://twitter.com/mateuszloskot">twitter.com/mateuszloskot</a>.</p>
<p>Today, Pantera noticed <code>mloskot</code> account has been released &#8211; someone apparently has got fed up with twitting :) &#8211; so I have switched back to my old account name.</p>
<p>It seems Twitter is pretty clever and preserves all my following/followers and status settings. Sweet.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2011/12/17/moved-twitter-commateuszloskot-to-twitter-commloskot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 11 support for Boost.Build</title>
		<link>http://mateusz.loskot.net/2011/12/17/visual-studio-11-support-for-boost-build/</link>
		<comments>http://mateusz.loskot.net/2011/12/17/visual-studio-11-support-for-boost-build/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 15:57:09 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[bjam]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[boost.build]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[toolset]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2841</guid>
		<description><![CDATA[I have just submitted patch with update for Boost.Build machinery to properly detect Visual Studio 11 (currently available as Developer Preview). I have very little experience with Boost.Build v2 internals, so the patch may need further improvements. It works in &#8230; <a href="http://mateusz.loskot.net/2011/12/17/visual-studio-11-support-for-boost-build/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have just submitted <a href="https://svn.boost.org/trac/boost/ticket/6283" title="#6283 (Visual Studio 11 support for Boost.Build) - Boost C++ Libraries">patch with update for Boost.Build</a> machinery to properly detect Visual Studio 11 (currently available as Developer Preview).</p>
<p>I have very little experience with <a href="http://www.boost.org/boost-build2/">Boost.Build v2</a> internals, so the patch may need further improvements. It works in my environment on Windows 7 (64-bit) with Visual Studio 2010 Express Edition installed alongside the <a href="http://msdn.microsoft.com/en-us/vstudio/hh127353">Visual Studio 11 Developer Preview</a>.</p>
<p>If you want to use Visual Studio 11 as Boost.Build toolset, just put the following entry in your user-config.jam file:</p>
<pre class="brush: plain; title: ; notranslate">
using msvc : 11.0 ;
</pre>
<p>To verify if the toolset is recognised correctly, use <code>b2</code> debugging options:</p>
<pre class="brush: plain; title: ; notranslate">
b2 --debug-configuration --debug-building --debug-generator buffer.cpp
notice: found boost-build.jam at D:/dev/boost/_svn/trunk/boost-build.jam
notice: loading Boost.Build from D:/dev/boost/_svn/trunk/tools/build/v2
notice: Searching C:\Windows C:\Users\mloskot C:\Users\mloskot D:\dev\boost\_svn\trunk\tools/build/v2 D:/dev/boost/_svn/trunk/tools/build/v2/kernel D:/dev/
boost/_svn/trunk/tools/build/v2/util D:/dev/boost/_svn/trunk/tools/build/v2/build D:/dev/boost/_svn/trunk/tools/build/v2/tools D:/dev/boost/_svn/trunk/tool
s/build/v2/contrib D:/dev/boost/_svn/trunk/tools/build/v2/. for site-config configuration file site-config.jam .
notice: Loading site-config configuration file site-config.jam from D:/dev/boost/_svn/trunk/tools/build/v2/site-config.jam .
notice: Searching C:\Users\mloskot C:\Users\mloskot D:\dev\boost\_svn\trunk\tools/build/v2 D:/dev/boost/_svn/trunk/tools/build/v2/kernel D:/dev/boost/_svn/
trunk/tools/build/v2/util D:/dev/boost/_svn/trunk/tools/build/v2/build D:/dev/boost/_svn/trunk/tools/build/v2/tools D:/dev/boost/_svn/trunk/tools/build/v2/
contrib D:/dev/boost/_svn/trunk/tools/build/v2/. for user-config configuration file user-config.jam .
notice: Loading user-config configuration file user-config.jam from C:/Users/mloskot/user-config.jam .
notice: [msvc-cfg] msvc-11.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe'
notice: [msvc-cfg] msvc-10.0 detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe'
notice: [msvc-cfg] msvc-10.0express detected, command: 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe'
notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe' for msvc, condition &lt;toolset&gt;msvc-11.0
notice: [msvc-cfg] condition: '&lt;toolset&gt;msvc-11.0/&lt;architecture&gt;/&lt;address-model&gt;', setup: 'call &quot;C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcv
arsall.bat&quot; x86 &gt;nul
...
</pre>
<p>and look for the following message reported:</p>
<pre class="brush: plain; title: ; notranslate">
notice: will use 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe' for msvc, condition &lt;toolset&gt;msvc-11.0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2011/12/17/visual-studio-11-support-for-boost-build/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Python sys.stdout redirection in C++</title>
		<link>http://mateusz.loskot.net/2011/12/01/python-sys-stdout-redirection-in-cpp/</link>
		<comments>http://mateusz.loskot.net/2011/12/01/python-sys-stdout-redirection-in-cpp/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 00:30:25 +0000</pubDate>
		<dc:creator>mloskot</dc:creator>
				<category><![CDATA[open source]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[embedding]]></category>
		<category><![CDATA[extending]]></category>
		<category><![CDATA[interpreter]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[stdout]]></category>
		<category><![CDATA[sys]]></category>

		<guid isPermaLink="false">http://mateusz.loskot.net/?p=2819</guid>
		<description><![CDATA[Lately, I have been embedding Python interpreter and implementing plenty of Python extensions in C++ using plain C API provided by Python 3. One of common challenges at C/C++ level is to intercept output sent to sys.stdout or sys.stderr by &#8230; <a href="http://mateusz.loskot.net/2011/12/01/python-sys-stdout-redirection-in-cpp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Lately, I have been <a href="http://docs.python.org/py3k/extending/embedding.html">embedding Python interpreter</a> and implementing plenty of Python extensions in C++ using <a href="http://docs.python.org/py3k/c-api/index.html">plain C API</a> provided by Python 3. One of common challenges at C/C++ level is to intercept output sent to <code>sys.stdout</code> or <code>sys.stderr</code> by Python functions like <code>print</code>. <a href="http://docs.python.org/py3k/faq/extending.html">Python Embedding/Extending FAQ</a> suggests common solution based on Python code:</p>
<pre class="brush: python; title: ; notranslate">
# catcher code
import sys
class StdoutCatcher:
   def __init__(self):
      self.data = ''
   def write(self, stuff):
      self.data = self.data + stuff
catcher = StdoutCatcher()
sys.stdout = catcher
</pre>
<p>This Python code can be executed by embedded Python interpreter using <code>PyRun_SimpleString</code>, then the output can be accessed by fetching <code>__main__</code> module attributes:</p>
<pre class="brush: cpp; title: ; notranslate">
PyObject* m = PyImport_AddModule(&quot;__main__&quot;);
char const* code = &quot;... catcher code here...&quot;;
PyRun_SimpleString(code);
PyRun_SimpleString(&quot;print(3.14)&quot;);
PyObject* catcher = PyObject_GetAttrString(m, &quot;catcher&quot;);
PyObject* output = PyObject_GetAttrString(catcher, &quot;data&quot;);
// get textual data contained in output
</pre>
<p>Such mix of Python and C code is neither convenient to use nor states a flexible solution. I simply don&#8217;t like this prosthesis, especially if I need to frequently switch between number output sinks.</p>
<p>So, I have come up with better solution which allows me to directly bind any callable C++ entity. The syntax I mean looks and feels like this:</p>
<pre class="brush: cpp; title: ; notranslate">
int main()
{
    PyImport_AppendInittab(&quot;emb&quot;, emb::PyInit_emb);
    Py_Initialize();
    PyImport_ImportModule(&quot;emb&quot;);

    PyRun_SimpleString(&quot;print(\'hello to console\')&quot;);

    // here comes the ***magic***
    std::string buffer;
    {
        // switch sys.stdout to custom handler
        emb::stdout_write_type write =
            [&amp;buffer] (std::string s) { buffer += s; };

        emb::set_stdout(write);
        PyRun_SimpleString(&quot;print(\'hello to buffer\')&quot;);
        PyRun_SimpleString(&quot;print(3.14)&quot;);
        PyRun_SimpleString(&quot;print(\'still talking to buffer\')&quot;);
        emb::reset_stdout();
    }

    PyRun_SimpleString(&quot;print(\'hello to console again\')&quot;);
    Py_Finalize();

    // output what was written to buffer object
    std::clog &lt;&lt; buffer &lt;&lt; std::endl;
}
</pre>
<p>This allows me to handle <code>sys.stdout.write</code> with C++ free function, class member function, named function objects or even anonymous functions as in the example above where I use <a href="http://en.wikipedia.org/wiki/C%2B%2B11">C++11 lambda</a>.</p>
<p>Complete implementation of the <code>emb</code> module in C/C++ using plain Python C API is available from my <a href="https://github.com/mloskot/workshop/tree/master/python">Python workshop at GitHub</a>:</p>
<pre>git clone git://github.com/mloskot/workshop.git</pre>
<p>The complete code is enclosed in <a href="https://github.com/mloskot/workshop/blob/master/python/emb/emb.cpp">python/emb/emb.cpp</a> file. Note, this is a minimal example to present the essential concept. In production-ready code, it certainly needs more attention around reference counting of PyObject, getting rid of global state, and so one.</p>
]]></content:encoded>
			<wfw:commentRss>http://mateusz.loskot.net/2011/12/01/python-sys-stdout-redirection-in-cpp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

