<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Computers and Buildings</title>
	
	<link>http://computersandbuildings.com</link>
	<description>Programming energy-efficient buildings</description>
	<lastBuildDate>Tue, 07 Feb 2012 05:07:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/computersandbuildings" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="computersandbuildings" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Automatic data collection without FTP</title>
		<link>http://computersandbuildings.com/2012/02/automatic-data-collection-without-ftp/</link>
		<comments>http://computersandbuildings.com/2012/02/automatic-data-collection-without-ftp/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 05:07:26 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=581</guid>
		<description><![CDATA[I haven&#8217;t written anything in a while, so I thought I might begin by sharing some ideas on how we collect test site data at Neurobat without using FTP. We have a Dropbox Teams account, which gives us about north of 1 TB of storage. The idea is to install Dropbox on each netbook that [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t written anything in a while, so I thought I might begin by
sharing some ideas on how we collect test site data at Neurobat
without using FTP.</p>

<p>We have a <a href="https://www.dropbox.com/teams">Dropbox Teams</a> account,
which gives us about north of 1 TB of storage. The idea is to install
Dropbox on each netbook that monitors a test site, and to have it save
its monitored data to its Dropbox folder. Then when/if that netbook
has internet access, it will automatically upload the data to a shared
folder on our Dropbox account, from which it will be re-distributed to
all interested parties:</p>

<pre><code>    X
   / \
  /   \
 /     \
/+-----+\
 |     |   +---------+
 |     |...|netbook-1|....
 |     |   +---------+   .
 +-----+                 .
  site 1                 .
                         .
                         .
                         .
    X                    .
   / \                   .
  /   \                 +-----------------------------------------+
 /     \                |  ____                  _                |
/+-----+\               | |  _ \ _ __ ___  _ __ | |__   _____  __ |
 |     |   +---------+  | | | | | '__/ _ \| '_ \| '_ \ / _ \ \/ / |
 |     |...|netbook-2|..| | |_| | | | (_) | |_) | |_) | (_) &gt;  &lt;  |.
 |     |   +---------+  | |____/|_|  \___/| .__/|_.__/ \___/_/\_\ |
 +-----+                |                 |_|                     |
  site 2                +-----------------------------------------+
                         .
                         .
                         .
    X                    .
   / \                   .
  /   \                  .
 /     \                 .
/+-----+\                .
 |     |   +---------+   .
 |     |...|netbook-3|....
 |     |   +---------+
 +-----+
  site 3
</code></pre>

<p>For simplicity (and for licencing costs) the same user account is
linked to each netbook. For historic reasons, that account is
<code>nagios@neurobat.net</code> (yes, a Nagios server is going to monitor that
data too).</p>

<p>Since we don&#8217;t want data from, say, site 3 to be copied over to the
local drive of netbook-1, we enable the &#8220;Selective Sync&#8221; feature on
the netbooks so that each netbook sees only a folder dedicated to that
site. The folder layout thus looks like this:</p>

<pre><code>Monitoring/
├── site 1
│   └── sensors
├── site 2
│   └── sensors
└── site 3
</code></pre>

<p>The <code>Monitoring</code> folder is the globally shared folder, shared by
<code>nagios@neurobat.net</code> with all Neurobat users interested in analyzing
the data.</p>

<p>The only downside we have identified with this approach is that
whenever a new site is added, that site&#8217;s data will by default also be
synchronized with all existing sites. Selective sync will only let you
exclude folders that already exist; as far as I know, you cannot ask
Dropbox to <em>not</em> sync new folders in that shared folder. And I am
<a href="https://www.dropbox.com/votebox/5843/selective-sync-should-only-sync-the-folders-i-have-selected-not-new-folders-that-get-added">apparently not the only one to find this annoying</a>.</p>

<p>An alternative might have been to have a separate shared folder for
each site. However, for each new site one would then have to share
that folder with all Neurobat users. Furthermore, since all sites use
the same Dropbox user, you would still end up with that site&#8217;s data
being sync&#8217;ed all over the place.</p>

<p>That being said, we have found the above scheme to work out very well
in practice. The automatic synchronization of Dropbox makes it a
superior alternative to, say, hand-written FTP-calling scripts we
might have used in the past century. And if you have notifications
turned on for your Dropbox account (I personally don&#8217;t) it will be
very reassuring to regularly see your test site data being updated on
your local machine without any human intervention.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2012/02/automatic-data-collection-without-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>homeR: an R package for building physics</title>
		<link>http://computersandbuildings.com/2011/05/homer-an-r-package-for-building-physics/</link>
		<comments>http://computersandbuildings.com/2011/05/homer-an-r-package-for-building-physics/#comments</comments>
		<pubDate>Thu, 26 May 2011 09:54:54 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=569</guid>
		<description><![CDATA[For the past few weeks we&#8217;ve been very busy here at Neurobat with the analysis of field tests results. In the process of doing that, we had to implement several functions in R that relate to building physics. We thought it might be useful for the community to have access to those functions, so we [...]


Related posts:<ol><li><a href='http://computersandbuildings.com/2007/05/international-building-physics-toolbox/' rel='bookmark' title='International Building Physics Toolbox'>International Building Physics Toolbox</a></li>
<li><a href='http://computersandbuildings.com/2010/02/event-rate-of-arrival-analysis-with-r/' rel='bookmark' title='Event rate of arrival analysis with R'>Event rate of arrival analysis with R</a></li>
<li><a href='http://computersandbuildings.com/2007/07/java-gnu-scientific-library-010-released/' rel='bookmark' title='Java GNU Scientific Library 0.1.0 released'>Java GNU Scientific Library 0.1.0 released</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For the past few weeks we&#8217;ve been very busy here at Neurobat with the analysis of field tests results. In the process of doing that, we had to implement several functions in R that relate to building physics.</p>

<p>We thought it might be useful for the community to have access to those functions, so we decided to begin submitting them to <a href="http://cran.r-project.org/">CRAN</a>. That&#8217;s why we&#8217;re pleased to announce the first release of the <a href="http://cran.r-project.org/web/packages/homeR/index.html">homeR</a> package, which we will fill over time with such functions.</p>

<p>This first release, version 0.1, contains just <code>pmv</code>, a function to calculate the so-called <a href="http://en.wikipedia.org/wiki/Thermal_comfort#Research">Predicted Mean Vote</a>, i.e. a measure from -3 (cold) to +3 (hot) of thermal comfort as a function of several variables, including air temperature, clothing and metabolism.</p>

<p>Here I show how with this function one can derive a contour plot showing, for given clothing and metabolism, the optimal indoor temperature (assuming 50% relative humidity). We&#8217;re basically going to solve <code>pmv(clo, met, temp, sat) = 0</code> equation for <code>temp</code> across a grid of <code>clo</code> and <code>met</code> values with the <code>uniroot</code> function.</p>

<pre><code>&gt; clo &lt;- seq(0,2,length=21)
&gt; met &lt;- seq(0.6,3.2,length=21)
&gt; zero.pmv &lt;- function(clo, met) uniroot(function(temp) pmv(clo,met,temp,50), c(-10,40))$root
&gt; contourplot((outer(clo,met,Vectorize(zero.pmv))),
              cuts=20,
              aspect="fill",
              panel=function(...) {
                panel.grid(h=-1,v=-1,...)
                panel.contourplot(...)
              },
              row.values=clo, column.values=met,
              xlim=extendrange(clo), ylim=extendrange(met),
              xlab="[Clo]", ylab="[Met]")
</code></pre>

<p>And here is the resulting plot:</p>

<div id="attachment_570" class="wp-caption aligncenter" style="width: 310px"><a href="http://computersandbuildings.com/wp-content/uploads/2011/05/pmv.png"><img src="http://computersandbuildings.com/wp-content/uploads/2011/05/pmv-300x300.png" alt="Predicted Mean Vote contour plot" title="Predicted Mean Vote contour plot" width="300" height="300" class="size-medium wp-image-570" /></a><p class="wp-caption-text">Predicted Mean Vote contour plot</p></div>

<p>As you can see, this is pretty similar to that sort of plots one finds in standard textbooks on the subject, such as Claude-Alain Roulet&#8217;s <em>Santé et qualité de l&#8217;environnement intérieur dans les bâtiments</em>:</p>

<div id="attachment_571" class="wp-caption aligncenter" style="width: 310px"><a href="http://computersandbuildings.com/wp-content/uploads/2011/05/photo.jpg"><img src="http://computersandbuildings.com/wp-content/uploads/2011/05/photo-300x225.jpg" alt="PMV contour plot from textbook" title="PMV contour plot from textbook" width="300" height="225" class="size-medium wp-image-571" /></a><p class="wp-caption-text">PMV contour plot from textbook</p></div>

<p>Please give the <code>homeR</code> package a try, and give us your feedback. There&#8217;s only the <code>pmv</code> function in there at the time of writing but we plan to extend the package in the weeks to come.</p>


<p>Related posts:<ol><li><a href='http://computersandbuildings.com/2007/05/international-building-physics-toolbox/' rel='bookmark' title='International Building Physics Toolbox'>International Building Physics Toolbox</a></li>
<li><a href='http://computersandbuildings.com/2010/02/event-rate-of-arrival-analysis-with-r/' rel='bookmark' title='Event rate of arrival analysis with R'>Event rate of arrival analysis with R</a></li>
<li><a href='http://computersandbuildings.com/2007/07/java-gnu-scientific-library-010-released/' rel='bookmark' title='Java GNU Scientific Library 0.1.0 released'>Java GNU Scientific Library 0.1.0 released</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2011/05/homer-an-r-package-for-building-physics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Saikoro game engine in Lisp</title>
		<link>http://computersandbuildings.com/2011/05/saikoro-game-engine-in-lisp/</link>
		<comments>http://computersandbuildings.com/2011/05/saikoro-game-engine-in-lisp/#comments</comments>
		<pubDate>Fri, 20 May 2011 18:40:29 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[saikoro]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=559</guid>
		<description><![CDATA[Here at Neurobat we consecrate one day per sprint as a Lab Day, i.e. a day when, not unlike what Google does, we are free to work on whatever we want. Today was Lab Day and I took the opportunity to brush up my Lisp skills by writing a game, inspiring myself heavily from Conrad [...]


Related posts:<ol><li><a href='http://computersandbuildings.com/2006/12/choice-of-new-programming-language/' rel='bookmark' title='Choice of new programming language'>Choice of new programming language</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here at Neurobat we consecrate one day per sprint as a <em>Lab Day</em>, i.e. a day when, not unlike what Google does, we are free to work on whatever we want.</p>

<p>Today was Lab Day and I took the opportunity to brush up my Lisp skills by writing a game, inspiring myself heavily from Conrad Burski&#8217;s wonderful book <a href="http://www.amazon.com/gp/product/1593272812/ref=as_li_ss_tl?ie=UTF8&amp;tag=compandsmarbu-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399349&amp;creativeASIN=1593272812">Land of Lisp</a><img src="http://www.assoc-amazon.com/e/ir?t=&amp;l=as2&amp;o=1&amp;a=1593272812&amp;camp=217145&amp;creative=399349" width="1" height="1" border="0" alt="" style="border:none !important;margin:0px !important" />, which will teach you the necessary Lisp skills for the most important programming gig ever, that is, writing games.</p>

<p>I wrote a game engine for the <a href="http://boardgamegeek.com/boardgame/27813/saikoro">Saikoro</a> boardgame, a game simple enough to be amenable to the kind of AI described in the book. Without doing any major kind of optimization, the computer will play a perfect game on a 4 x 4 board by computing exhaustively a tree of all possible games from a starting position.</p>

<p>Here is what a typical game session looks like:</p>

<p><pre><code>$ sbcl --load saikoro.lisp
; snip some noise
Current player: A
| A[ 0] 3[ 1] 3[ 2] 2[ 3] |
| 1[ 4] 4[ 5] 2[ 6] 2[ 7] |
| 3[ 8] 4[ 9] 4[10] 2[11] |
| 1[12] 3[13] 4[14] B[15] |
Choose your move: 
1. 0 -&gt; 4 
2. 0 -&gt; 10 
3. 0 -&gt; 1 
4. 0 -&gt; 5 
2
Current player: B
| 0[ 0] 3[ 1] 3[ 2] 2[ 3] |
| 1[ 4] 4[ 5] 2[ 6] 2[ 7] |
| 3[ 8] 4[ 9] A[10] 2[11] |
| 1[12] 3[13] 4[14] B[15] |
Current player: A
| 0[ 0] 3[ 1] 3[ 2] 2[ 3] |
| 1[ 4] B[ 5] 2[ 6] 2[ 7] |
| 3[ 8] 4[ 9] A[10] 2[11] |
| 1[12] 3[13] 4[14] 0[15] |
Choose your move: 
1. 10 -&gt; 1 
2. 10 -&gt; 7 
2
Current player: B
| 0[ 0] 3[ 1] 3[ 2] 2[ 3] |
| 1[ 4] B[ 5] 2[ 6] A[ 7] |
| 3[ 8] 4[ 9] 0[10] 2[11] |
| 1[12] 3[13] 4[14] 0[15] |
Current player: A
| 0[ 0] 3[ 1] 3[ 2] 2[ 3] |
| B[ 4] 0[ 5] 2[ 6] A[ 7] |
| 3[ 8] 4[ 9] 0[10] 2[11] |
| 1[12] 3[13] 4[14] 0[15] |
Choose your move: 
1. 7 -&gt; 1 
1
Current player: B
| 0[ 0] A[ 1] 3[ 2] 2[ 3] |
| B[ 4] 0[ 5] 2[ 6] 0[ 7] |
| 3[ 8] 4[ 9] 0[10] 2[11] |
| 1[12] 3[13] 4[14] 0[15] |
Current player: A
| 0[ 0] A[ 1] 3[ 2] 2[ 3] |
| 0[ 4] 0[ 5] 2[ 6] 0[ 7] |
| 3[ 8] 4[ 9] 0[10] 2[11] |
| 1[12] B[13] 4[14] 0[15] |
Choose your move: 
1. 1 -&gt; 6 
2. 1 -&gt; 3 
3. 1 -&gt; 2 
3
Current player: B
| 0[ 0] 0[ 1] A[ 2] 2[ 3] |
| 0[ 4] 0[ 5] 2[ 6] 0[ 7] |
| 3[ 8] 4[ 9] 0[10] 2[11] |
| 1[12] B[13] 4[14] 0[15] |
Current player: A
| 0[ 0] 0[ 1] A[ 2] 2[ 3] |
| 0[ 4] 0[ 5] 2[ 6] 0[ 7] |
| 3[ 8] 4[ 9] 0[10] 2[11] |
| B[12] 0[13] 4[14] 0[15] |
B wins!
* (quit)
</code></pre></p>

<p>As you can see the UI is very rudimentary for the moment but I wanted to concentrate on getting the AI right first. Next I plan to optimize the AI, and make it work with a non-exhaustive game tree so it would work on larger boards.</p>

<p>If you&#8217;re interested in trying it out, feel free to <a href="https://github.com/dlindelof/saikoro">clone my repository</a>.</p>


<p>Related posts:<ol><li><a href='http://computersandbuildings.com/2006/12/choice-of-new-programming-language/' rel='bookmark' title='Choice of new programming language'>Choice of new programming language</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2011/05/saikoro-game-engine-in-lisp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pomodoro + Workrave = Well-being</title>
		<link>http://computersandbuildings.com/2011/04/pomodoro-workrave-well-being/</link>
		<comments>http://computersandbuildings.com/2011/04/pomodoro-workrave-well-being/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 18:30:31 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=554</guid>
		<description><![CDATA[I&#8217;ve been a big fan of the Pomodoro Technique for almost a year now. No, I don&#8217;t go as far as actually having a ticking timer in my office in front of my co-workers, and I don&#8217;t necessarily plan the day in advance, but I do try to break up my work in 25-min iterations [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a big fan of the <a href="http://www.pomodorotechnique.com/">Pomodoro Technique</a> for almost a year now. No, I don&#8217;t go as far as actually having a ticking timer in my office in front of my co-workers, and I don&#8217;t necessarily plan the day in advance, but I do try to break up my work in 25-min iterations punctuated by 5-min breaks.</p>

<p>I used to use Ubuntu&#8217;s Timer applet to alert me to take a break, but a month ago I found what I now believe to be the perfect complement to the Pomodoro Technique: a nice little application called <a href="http://www.workrave.org/">Workrave</a>.</p>

<p>Workrave will let you define work intervals after which it will, shall we say, strongly encourage you to take a break and propose a couple of physical exercises. I&#8217;ve installed Workrave under Ubuntu (I believe it runs also on Windows) and configured it for:</p>

<ul>
<li>no micro-breaks</li>
<li>a 5-min rest break after 25 min of work</li>
<li>a daily limit of 8 hours (never reached)</li>
</ul>

<p>Try it out! It&#8217;s completely free and quite nice. I can also recommend the P<a href="http://www.pragprog.com/titles/snfocus/pomodoro-technique-illustrated">omodoro Technique Illustrated book</a> from the Pragmatic Programmers, but you might also want to begin with the free &#8220;official&#8221; <a href="http://www.scribd.com/doc/36672142/">Pomodoro book</a>.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2011/04/pomodoro-workrave-well-being/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Converting Sweave/R plots for inclusion in Word/OpenOffice</title>
		<link>http://computersandbuildings.com/2011/04/converting-sweaver-plots-for-inclusion-in-wordopenoffice/</link>
		<comments>http://computersandbuildings.com/2011/04/converting-sweaver-plots-for-inclusion-in-wordopenoffice/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 13:13:12 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=549</guid>
		<description><![CDATA[Just a quick note to myself: When you use Sweave and produce high-quality plots in both EPS and PDF formats, you sometimes want to include them in Word or OpenOffice documents. You can&#8217;t directly include PDF files, and you can only include EPS files when they have a preview, which Sweave will not do by [...]


Related posts:<ol><li><a href='http://computersandbuildings.com/2007/06/latex-to-word-format-conversion-how-to/' rel='bookmark' title='LaTeX to Word format conversion how-to'>LaTeX to Word format conversion how-to</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Just a quick note to myself:</p>

<p>When you use <a href="http://www.stat.uni-muenchen.de/~leisch/Sweave/">Sweave</a> and produce high-quality plots in both EPS and PDF formats, you sometimes want to include them in Word or OpenOffice documents.</p>

<p>You can&#8217;t directly include PDF files, and you can only include EPS files when they have a preview, which Sweave will not do by default. And anyway, the EPS version of the graphs are made for black and white printers and will not be in color.</p>

<p>I&#8217;m using <code>convert</code> from the ImageMagick package to convert the PDF plots to PNG files. However, by default <code>convert</code> will give low-quality pictures. To have better images, I do:</p>

<pre><code>convert -density 300 XXX.pdf XXX.png
</code></pre>

<p>If you feel geeky enough you can even include this in a Makefile:</p>

<pre><code>figures: $(patsubst %.pdf, %.png, $(wildcard report-*.pdf))

report-%.png : report-%.pdf
    convert -density 300 $&amp;lt; $@
</code></pre>


<p>Related posts:<ol><li><a href='http://computersandbuildings.com/2007/06/latex-to-word-format-conversion-how-to/' rel='bookmark' title='LaTeX to Word format conversion how-to'>LaTeX to Word format conversion how-to</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2011/04/converting-sweaver-plots-for-inclusion-in-wordopenoffice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git and Scientific Reproducibility</title>
		<link>http://computersandbuildings.com/2011/01/git-and-scientific-reproducibility/</link>
		<comments>http://computersandbuildings.com/2011/01/git-and-scientific-reproducibility/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 23:00:39 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[science]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=510</guid>
		<description><![CDATA[I firmly believe that scientists and engineers&#8212;particularly scientists, by the way&#8212;should learn about, and use, version control systems (VCS) for their work. Here is why. I&#8217;ve been a user of free VCSs for a while now, beginning with my first exposure to CVS at CERN in 2002, through my discovery of Subversion during my doctoral [...]


Related posts:<ol><li><a href='http://computersandbuildings.com/2009/08/looking-up-an-ejb-from-a-web-service-under-jboss-4x/' rel='bookmark' title='Looking up an EJB from a Web Service under JBoss 4.x'>Looking up an EJB from a Web Service under JBoss 4.x</a></li>
<li><a href='http://computersandbuildings.com/2007/07/java-gnu-scientific-library-010-released/' rel='bookmark' title='Java GNU Scientific Library 0.1.0 released'>Java GNU Scientific Library 0.1.0 released</a></li>
<li><a href='http://computersandbuildings.com/2008/09/java-gnu-scientific-library-02-released/' rel='bookmark' title='Java GNU Scientific Library 0.2 released'>Java GNU Scientific Library 0.2 released</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I firmly believe that scientists and engineers&#8212;particularly scientists, by the way&#8212;should learn about, and use, version control systems (<a href="http://en.wikipedia.org/wiki/Revision_control">VCS</a>) for their work. Here is why.</p>

<p>I&#8217;ve been a user of free VCSs for a while now, beginning with my first exposure to <a href="http://savannah.nongnu.org/projects/cvs">CVS</a> at CERN in 2002, through my discovery of <a href="http://subversion.apache.org/">Subversion</a> during my doctoral years at EPFL, culminating in my current infatuation with <a href="http://git-scm.com/">Git</a> as a front-end to Subversion. <strong>I&#8217;m now a complete convert to that system</strong> and could not imaging working without it. Every week I discover <strong>new use cases</strong> for this tool that I had not thought about before (and that I suspect the Git developers didn&#8217;t, either).</p>

<p>This week I found such a use case for Git: <strong>enforcing scientific reproducibility</strong>. Let me explain. I&#8217;m currently working on prototype software written in <a href="http://www.mathworks.com/">MATLAB</a> that implements some advanced algorithms for the smart, predictive control of heating in buildings. As part of that work we need to evaluate several competing algorithm designs, and try out different parameters for the algorithms.</p>

<p>The traditional way of doing this is, of course, to set all your parameters right in your code for the first simulation, to run it, then to set the parameters right for the second one, to run it again, and so on. <strong>There are several problems with this approach</strong>.</p>

<p>First, you need a really good naming convention for the data you are going to generate to make sure that you know exactly which parameters you set for each run. And coming up with a good naming scheme for data files is not trivial.</p>

<p>Second, even if your data file naming convention is good enough that you can easily reproduce the experiment, how can you be sure that the settings are exactly right? That you didn&#8217;t, perhaps, tweak just that little extra configuration file just to work around that little bug in the software?</p>

<p>Third, <strong>how will you reproduce those results</strong>? Even assuming that you ran all your simulations based on a given, well-known revision number in your VCS (you do use a VCS, don&#8217;t you?), you will still need to dive in the code and set those configuration parameters yourself. A tedious, error-prone process, even if you manage to keep them all to one source file.</p>

<p>I think a system like Git solves all these problems. Here is how I did it.</p>

<p>I needed to run 7 simulations with different parameters, based on a stable version of our software, say r1409 in our Subversion repository.</p>

<p>I&#8217;m using Git as a front-end to Subversion. I began by creating a local branch (something Git, not Subversion, will let you do):</p>

<p><pre><code>$ git checkout -b simulations_based_on_r1409</code></pre></p>

<p>This will create a new branch from the current HEAD. Now the idea is to make a local commit on <em>that local branch</em> for each different set of parameters. Here is how:</p>

<ol>
  <li>Edit your source code so that all parameters are set right.</li>
  <li>Commit the changes on your local branch:
  <pre><code>$ git ci -am "With parameter X set to Y"
[simulations_based_on_r1409 66cea68] With parameter X set to   </code></pre></li>
<li>Note the 7 characters (66cea68 above) next to the branch name. These are the first 7 characters of the SHA-1 hash of your entire project, as computed by Git.</li>
<li>Run your simulation. Log the results, along with the short hash.</li>
<li>Repeat the steps above for each different configuration you want to run the experiment with.</li>
</ol>

<p>By the end of this process, you should have in your logbook a list of experimental results <em>along with the short hash of the entire project as it looked during that experiment.</em> It might, for instance, look something like this:</p>

<table border="" width="">
  <TR>
    <TH rowspan="" colspan="">Hash</TH>
    <TH rowspan="" colspan="">Parameter X</TH>
    <TH rowspan="" colspan="">Parameter Y</TH>
    <TH rowspan="" colspan="">Result</TH>
  </TR>
  <TR>
    <TD align="" colspan="">66cea68</TD>
    <TD align="" colspan="">23</TD>
    <TD align="" colspan="">42</TD>
    <TD align="" colspan="">1024</TD>
  </TR>
  <TR>
    <TD align="" colspan="">a4f683f</TD>
    <TD align="" colspan="">etc</TD>
    <TD align="" colspan="">etc</TD>
    <TD align="" colspan="">etc</TD>
</TR>
</table>

<p>As you can see there are at least two reasons why it&#8217;s important to record the short hash:</p>

<ol>
  <li>It will let you go back in time and <strong>reproduce an experiment</strong> <strong>exactly</strong> as it was when you ran it first.</li>
  <li>It will <strong>force you to commit all changes before running the experiment</strong>, which is a good thing.</li>
</ol>

<p>I&#8217;ve been running a series of simulations using a variation on this process, whereby I actually run several simulations in parallel on my 8-core machine. For this to work you need to <em>clone</em> your entire project, once per simulation. Then for each simulation you checkout the right version of your project, and run the experiment.</p>

<p>Quite seriously, I would <strong>never have been able to do anything remotely like this with a centralized version control system</strong>. The possibility to create local branches and to commit to them is a truly awesome feature of distributed version control systems such as Git. I don&#8217;t suppose the Git developers had scientists and engineers in mind when they developed this system, but hey, here we are.</p>

<p>Are you a scientist or an engineer wishing to dramatically improve your way of working? Then run, do not walk, to read the <a href="http://progit.org/">best book on Git there is.</a></p>


<p>Related posts:<ol><li><a href='http://computersandbuildings.com/2009/08/looking-up-an-ejb-from-a-web-service-under-jboss-4x/' rel='bookmark' title='Looking up an EJB from a Web Service under JBoss 4.x'>Looking up an EJB from a Web Service under JBoss 4.x</a></li>
<li><a href='http://computersandbuildings.com/2007/07/java-gnu-scientific-library-010-released/' rel='bookmark' title='Java GNU Scientific Library 0.1.0 released'>Java GNU Scientific Library 0.1.0 released</a></li>
<li><a href='http://computersandbuildings.com/2008/09/java-gnu-scientific-library-02-released/' rel='bookmark' title='Java GNU Scientific Library 0.2 released'>Java GNU Scientific Library 0.2 released</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2011/01/git-and-scientific-reproducibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thou shalt save energy</title>
		<link>http://computersandbuildings.com/2011/01/thou-shalt-save-energy/</link>
		<comments>http://computersandbuildings.com/2011/01/thou-shalt-save-energy/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 23:18:18 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Energy]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=519</guid>
		<description><![CDATA[I&#8217;m not sure anyone else is saying this, so I will: I think there is a clear and unambiguous scriptural mandate to reduce our current energy consumption. Now before you dismiss this post, this author and this blog as just another bible-thumping fanatic, remember that in certain countries, certain political parties profess strict adherence to [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure anyone else is saying this, so I will: I think <strong>there is
a clear and unambiguous scriptural mandate to reduce our current
energy consumption</strong>.</p>

<p>Now before you dismiss this post, this author and this blog as just
another bible-thumping fanatic, remember that in certain countries,
certain political parties profess strict adherence to Scripture while
being overtly skeptical about the whole climate warming problem. I
think they are wrong and here&#8217;s why.</p>

<p>Let&#8217;s first review why, from a scriptural point of
view, one could in principle argue that whether we take action or let things run
as they are makes no difference. I&#8217;ve heard some of these arguments from very good
(christian) friends, and I hope I&#8217;m not going to offend anyone by
refuting them later in this post:</p>

<ul>
<li>Revelation 21:1 tells us that all of creation will eventually be
destroyed and replaced by a new one: </li>
</ul>

<blockquote>Then I saw a new heaven and a new earth; for the first heaven and the first earth passed away, and there is no longer any sea.</blockquote>

<ul>
<li><p>God is sovereign, so no matter what we do, things will run according
to His will.</p></li>
<li><p>It is highly arrogant for Man to believe that they can do anything
about the climate.</p></li>
</ul>

<p>The last two arguments are probably the easiest to answer. God is
certainly sovereign, but that doesn&#8217;t remove our responsibility for
doing the right things and making the right choices in life. In fact,
God intends us to be co-creators with Him and to participate, so to
speak, in the creative act. This point has been persuasively argued
for by several authors such as C.S. Lewis and J.I. Packer.</p>

<p>The big problem with the first argument is that, even though the
current creation is indeed doomed in the long run, God asked us from
the beginning to take care of it, cf. Genesis 1:28:</p>

<blockquote>God blessed them; and God said to them, “Be fruitful and
multiply, and fill the earth, and subdue it; and rule over the fish of
the sea and over the birds of the sky and over every living thing that
moves on the earth.”</blockquote>

<p>See that? Commandment nr 3 in the whole Bible: subdue the Earth and
rule over it. No mention here of letting things run its course simply
because the creation is about (in the biblical perspective) to be
replaced.</p>

<p>Ah but you might argue that this command was given <em>before</em> the Fall,
and that everything went downhill since then. You&#8217;re right about the
downhill part, but look at this, Gen 3:23:</p>

<blockquote>therefore the Lord God sent him out from the garden of
Eden, to cultivate the ground from which he was taken.</blockquote>

<p>Man is kicked out of the Garden of Eden, and what is he to do?
Essentially the same thing, e.g. rule over the Earth and cultivate it
and take care of it. The only difference being, of course, that now
it&#8217;s going to be painful to do so (Gen 3:19).</p>

<p>The mandate to take care of creation is repeated several times, for
instance right after Noah comes out of the Ark after the Flood, Gen
9:1-2:</p>

<blockquote>And God blessed Noah and his sons and said to them, “Be
fruitful and multiply, and fill the earth. The fear of you and the
terror of you will be on every beast of the earth and on every bird of
the sky; with everything that creeps on the ground, and all the fish
of the sea, into your hand they are given.&#8221;</blockquote>

<p>Or of course Psalm 8:5-6:</p>

<blockquote>Yet You have made him a little lower than God, 
And You crown him with glory and majesty! You make him to rule over
the works of Your hands; You have put all things under his
feet.</blockquote>

<p>God intends us clearly to rule and manage His creation, no matter what
ultimate fate awaits it.</p>

<p>But the real suprise came to me while re-reading the following
(Deut. 22:6-7):</p>

<blockquote>“If you happen to come upon a bird’s nest along the way,
in any tree or on the ground, with young ones or eggs, and the mother
sitting on the young or on the eggs, you shall not take the mother
with the young; you shall certainly let the mother go, but the young
you may take for yourself, in order that it may be well with you and
that you may prolong your days.</blockquote>

<p>This was one of the many commands given Israel before entering the
promised land. The spirit of this passage, and of others like it, is
unambiguous: God is asking us simply to be <strong>utmostly careful in managing our
natural resources</strong>. We are forbidden to view Earth as just a vast source of
riches to be exploited as quickly and efficiently as possible. We are
explicitly commanded to make sure that Earth can go on being such a
source of riches, indefinitely if needed.</p>

<p>(I&#8217;ve even read somewhere that the number of years Israel spent in
babylonian captivity, 70, corresponds to the number of years the land
should have been allowed to rest since Israel took possession of it,
but didn&#8217;t. Here again, the importance of allowing natural resources
to replenish themselves is evident.)</p>

<p>The concept of &#8220;rest&#8221; is a potent one in Scripture. We are to rest
once a week. The land was to rest once every 7 years. We were supposed
to leave alone the corners of our fields that weren&#8217;t harvested. In
other words, <strong>Scripture is full of passages mandating a careful
management of our natural resources</strong>. Arguing that we can do whatever
we want with Earth simply because it is doomed to the eternal fire
anyway is not only lazy and criminal, it is also doctrinally false.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2011/01/thou-shalt-save-energy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Neurobat, day one</title>
		<link>http://computersandbuildings.com/2010/09/neurobat-day-one/</link>
		<comments>http://computersandbuildings.com/2010/09/neurobat-day-one/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 21:43:53 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=500</guid>
		<description><![CDATA[Yesterday marked my first day as Chief Technology Officer at Neurobat AG, a young company formed in Switzerland to industrialize and market advanced building control algorithms, such as the ones commonly researched and developed at my former laboratory, the Solar Energy and Building Physics Laboratory at EPFL. This also marks the end of almost three [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Yesterday marked my first day as Chief Technology Officer at <a href="http://www.neurobat.net/">Neurobat AG</a>, a young company formed in Switzerland to industrialize and market advanced building control algorithms, such as the ones commonly researched and developed at my former laboratory, the <a href="http://lesowww.epfl.ch/">Solar Energy and Building Physics Laboratory at EPFL</a>.</p>

<p>This also marks the end of almost three years spent building enterprise integration systems in Java for a certain coffeeshop. I&#8217;m now moving back to my original topics of interest, namely the intelligent control and simulation of buildings. Indeed, without disclosing too much, the very first project I will be working on is the implementation of certain ideas formulated during the Neurobat research project carried out aeons ago at LESO-PB. Except this time the systems won&#8217;t be running in the quiet and safe environment of an experimental building whose occupants have a history of forgiveness towards enthusiastic graduate students and their ideas&#8212;including myself. No, this time we mean business, that is, embedded systems that must be build rock-solid and run unattended for years, or possibly decades.</p>

<p>One issue that&#8217;s come up more than once was whether we should keep MATLAB as our lingua franca for prototyping and trying out new ideas and concepts before porting them to languages more, shall we say, closer to the machine. Or should we just dump it (including its non-negligible licencing costs, especially for an non-academic organization) and work directly as close to the metal as we dare?</p>

<p>Personally, without wanting to sound overly smug or anything, I think that someone asking this question has obviously never tried multiplying two matrices in C. The implementation contributed by <a href="http://www.nr.com/contrib/">James Trevelyan to the Numerical Recipes in C website</a> runs to about 33 lines:</p>

<pre><code>void dmmult( double **a, int a_rows, int a_cols, 
             double **b, int b_rows, int b_cols, double **y)
/* multiply two matrices a, b, result in y. y must not be same as a or b */
{
   int i, j, k;
   double sum;

   if ( a_cols != b_rows ) {
      fprintf(stderr,"a_cols  b_rows (%d,%d): dmmult\n", a_cols, b_rows);
      exit(1);
   }

#ifdef V_CHECK
   if ( !valid_dmatrix_b( a ) ) 
      nrerror("Invalid 1st matrix: dmmult\n");    
   if ( !valid_dmatrix_b( b ) ) 
      nrerror("Invalid 2nd matrix: dmmult\n");    
   if ( !valid_dmatrix_b( y ) ) 
      nrerror("Invalid result matrix: dmmult\n"); 
#endif

   /*  getchar();
       dmdump( stdout, "Matrix a", a, a_rows, a_cols, "%8.2lf");
       dmdump( stdout, "Matrix b", b, b_rows, b_cols, "%8.2lf");
       getchar();
   */
   for ( i=1; i&amp;lt;=a_rows; i++ ) 
      for ( j=1; j&amp;lt;=b_cols; j++ ) {
         sum = 0.0;
         for ( k=1; k&amp;lt;=a_cols; k++ ) sum += a[i][k]*b[k][j];
         y[i][j] = sum;
      }
}
</code></pre>

<p>Give me instead MATLAB&#039;s</p>

<pre><code>y = a * b
</code></pre>

<p>anytime. Now of course I realize the comparison is completely unfair. The C version includes error checking, comments, etc. But still, C is, after all, originally a systems programming language, while MATLAB-the-language is a DSL for doing precisely this sort of stuff. I never wanted to prove that C sucked at doing linear algebra&#8212;I just wanted to show that most trivial operations in MATLAB would have to be&#8212;by us&#8212;re-implemented in C before we can even begin using them. And I don&#039;t think we have that sort of time. Not outside of academia.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2010/09/neurobat-day-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resources for building simulation</title>
		<link>http://computersandbuildings.com/2010/08/resources-for-building-simulation/</link>
		<comments>http://computersandbuildings.com/2010/08/resources-for-building-simulation/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 19:00:57 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=490</guid>
		<description><![CDATA[About two weeks ago I posed the following question on the Bldg-sim mailing list: Where can I find a list of publications relevant to the field of building simulation? I&#8217;m particularly interested in refereed journals and books. The ensuing thread has been extremely helpful, in particular Shanta Tucker who pointed me to the IBPSA website. [...]


Related posts:<ol><li><a href='http://computersandbuildings.com/2008/09/article-watch-building-simulation-vol-1-nr-3/' rel='bookmark' title='Article watch: Building Simulation vol 1 nr 3'>Article watch: Building Simulation vol 1 nr 3</a></li>
<li><a href='http://computersandbuildings.com/2006/01/building-energy-software-tools-directory/' rel='bookmark' title='Building Energy Software Tools Directory'>Building Energy Software Tools Directory</a></li>
<li><a href='http://computersandbuildings.com/2008/09/journal-of-building-performance-simulation-volume-1-issue-2-article-watch/' rel='bookmark' title='Journal of Building Performance Simulation &#8211; Volume 1 Issue 2 article watch'>Journal of Building Performance Simulation &#8211; Volume 1 Issue 2 article watch</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>About two weeks ago I posed the following question on the <a href="http://lists.onebuilding.org/listinfo.cgi/bldg-sim-onebuilding.org">Bldg-sim</a> mailing list:</p>

<blockquote>Where can I find a list of publications relevant to the field of
building simulation? I&#8217;m particularly interested in refereed journals
and books.</blockquote>

<p>The <a href="http://lists.onebuilding.org/pipermail/bldg-sim-onebuilding.org/2010-August/021817.html">ensuing thread</a> has been extremely helpful, in particular Shanta Tucker who pointed me to the <a href="http://www.ibpsa.org/">IBPSA website</a>. There, on the <a href="http://www.ibpsa.org/m_references.asp">References</a> link, you will find a fairly complete listing of articles, resources and books, including the <strong>full contents of every IBPSA conference paper</strong>. What&#8217;s not to like?</p>


<p>Related posts:<ol><li><a href='http://computersandbuildings.com/2008/09/article-watch-building-simulation-vol-1-nr-3/' rel='bookmark' title='Article watch: Building Simulation vol 1 nr 3'>Article watch: Building Simulation vol 1 nr 3</a></li>
<li><a href='http://computersandbuildings.com/2006/01/building-energy-software-tools-directory/' rel='bookmark' title='Building Energy Software Tools Directory'>Building Energy Software Tools Directory</a></li>
<li><a href='http://computersandbuildings.com/2008/09/journal-of-building-performance-simulation-volume-1-issue-2-article-watch/' rel='bookmark' title='Journal of Building Performance Simulation &#8211; Volume 1 Issue 2 article watch'>Journal of Building Performance Simulation &#8211; Volume 1 Issue 2 article watch</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2010/08/resources-for-building-simulation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DB4ALL: reformatting the mess that Internet has become</title>
		<link>http://computersandbuildings.com/2010/07/db4all-reformatting-the-mess-that-internet-has-become/</link>
		<comments>http://computersandbuildings.com/2010/07/db4all-reformatting-the-mess-that-internet-has-become/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 18:09:21 +0000</pubDate>
		<dc:creator>lindelof</dc:creator>
				<category><![CDATA[Announcements]]></category>

		<guid isPermaLink="false">http://computersandbuildings.com/?p=482</guid>
		<description><![CDATA[I always try very hard to keep my posts within the main topic of this blog, namely computers in the context of building automation and simulation. Occasionally I fail, like for today&#8217;s post. I&#8217;d like to tell you about a software company co-founded by a friend and fellow Toastmaster of mine, David Portabella. The company&#8217;s [...]


Related posts:<ol><li><a href='http://computersandbuildings.com/2006/10/bug-finding-tools-for-java/' rel='bookmark' title='Bug finding tools for Java'>Bug finding tools for Java</a></li>
<li><a href='http://computersandbuildings.com/2007/06/java-gnu-scientific-library-project-update/' rel='bookmark' title='Java GNU Scientific Library project update'>Java GNU Scientific Library project update</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I always try very hard to keep my posts within the main topic of this blog, namely computers in the context of building automation and simulation. Occasionally I fail, like for today&#8217;s post.</p>

<p>I&#8217;d like to tell you about a software company co-founded by a friend and fellow Toastmaster of mine, David Portabella. The company&#8217;s name is <a href="http://www.db4all.com">DB4ALL</a>, and they specialize in software for retrieving structured data from the web.</p>

<p>(Disclaimer: I am not affiliated with this company. I have had the opportunity to play with their tool, which I sincerely think is a high-quality one, but I derive no remuneration from writing this piece.)</p>

<p>They&#8217;ve developed `Webminer&#8217;, a Java library for extracting data in a structured manner from any website. Suppose, for instance, that you need a relational database with the data from the <a href="https://www.cia.gov/library/publications/the-world-factbook/">CIA World Factbook</a>. That data, though in the public domain, cannot be obtained in the form of a relational database, but only by clicking around on the CIA website. But with &#8216;Webminer&#8217;, the smart guys at DB4ALL can write a custom application that will know how to navigate such websites, &#8216;scrape&#8217; and &#8216;normalize&#8217; its data, and save it to a relational database for you.</p>

<p>On <a href="http://www.db4all.com">DB4ALL&#8217;s website</a> you will find references to <a href="http://db4all.com/databases/">the two most popular datasets</a> that they&#8217;ve mined: the above-mentioned CIA World Factbook, and the SourceForge database of open-source projects. Having such data in a relational form is invaluable for any researcher or marketing analyst. Suppose for instance that you want scientific data on the popularity of different programming languages over time in open-source projects. Well with these datasets you have all you need to get started.</p>

<p>This, for instance, is a screenshot of the SourceForge dataset opened in Excel: <img width="100%" src="http://db4all.com/databases/sourceforge_reformatted/sourceforge_20100222_sample.png" /></p>

<p>All in all, if you need publicly available data from a website stored in a relational database form, you should definitely consider using <a href="http://www.db4all.com">DB4ALL</a>&#8216;s services.</p>


<p>Related posts:<ol><li><a href='http://computersandbuildings.com/2006/10/bug-finding-tools-for-java/' rel='bookmark' title='Bug finding tools for Java'>Bug finding tools for Java</a></li>
<li><a href='http://computersandbuildings.com/2007/06/java-gnu-scientific-library-project-update/' rel='bookmark' title='Java GNU Scientific Library project update'>Java GNU Scientific Library project update</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://computersandbuildings.com/2010/07/db4all-reformatting-the-mess-that-internet-has-become/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

