<?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>Misterdom's World &#187; Think tank</title>
	<atom:link href="http://www.guinard.org/~misterdom/category/think-tank/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guinard.org/~misterdom</link>
	<description>My Computing Logbook</description>
	<lastBuildDate>Sat, 24 Dec 2011 09:31:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a Automated Kiosk with Firefox and GWT on Windows XP</title>
		<link>http://www.guinard.org/~misterdom/2008/11/26/creating-a-kiosk/</link>
		<comments>http://www.guinard.org/~misterdom/2008/11/26/creating-a-kiosk/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 09:26:06 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Google Web Toolkit (GWT)]]></category>
		<category><![CDATA[Plogg and Smart Meters]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=50</guid>
		<description><![CDATA[My task for today was to create a kiosk application. In particular this application is meant to monitor the energy consumption of common appliances in an office. For that matter it uses the Ploggs sensor nodes and a Google Web Toolkit Application.
Now, the setting is such that the GWT application has to be displayed on [...]]]></description>
			<content:encoded><![CDATA[<p>My task for today was to create a kiosk application. In particular this application is meant to monitor the energy consumption of common appliances in an office. For that matter it uses the <a href="?cat=4">Ploggs sensor nodes</a> and a <a href="?cat=20">Google Web Toolkit Application</a>.</p>
<p>Now, the setting is such that the GWT application has to be displayed on a screen of a computer dedicated to that application. The monitoring app has to be running the whole day in full-screen mode without anybody doing anything with the browser but see and surf on the page(s) you selected. </p>
<p>This is what&#8217;s commonly called a kiosk application. Now, here are the steps I went through to setup the kiosk, note that the computer runs Windows XP Pro SP 3:</p>
<p>1) Install Firefox and download the <a href="https://addons.mozilla.org/en-US/firefox/addon/1659">R-Kiosk plugin</a>. This guy starts Firefox in fullscreen mode and does not allow the user to use/display any menu. Note that after installing this plugin you won&#8217;t be able to use Firefox normally unless you start it in Safe Mode (Mozilla Firefox (Safe Mode) in your start menu).<br />
More info on that matter on: <a href="http://samanathon.com/firefox-2s-kiosk-mode/">http://samanathon.com/firefox-2s-kiosk-mode/</a> and <a href="http://davidstoker.org/blog/tag/r-kiosk/">http://davidstoker.org/blog/tag/r-kiosk/</a></p>
<p>2) Schedule Windows to start Firefox and everything else you need on startup:<br />
<a href="http://support.microsoft.com/kb/308569">http://support.microsoft.com/kb/308569</a><br />
If, just like me, you keep getting the: “0&#215;80070005: Access is denied&#8221; error message when trying to schedule a task then try the option &#8220;Run only if logged in&#8221; and schedule the task to start &#8220;At Logon&#8221;.<br />
Note that if you want everything to start auto-magically, without user involvement, you should not set a user password. </p>
<p>3) For this kiosk we want everything to be automated which means we need two more scheduled tasks:</p>
<p>Shutdown: this is quite straightforward using the <code>shutdown</code> command (yeah, even Windows has got things like that!). Create a batch file containing the shutdown command:<br />
<code><br />
cd\<br />
shutdown -s -f -t 30<br />
</code><br />
Which says: shutdown this computer (-s), force all apps to close (-f) and do that in 30 seconds (-t)<br />
Now, all you need to do is to schedule that to happen everyday at, say, 8 o&#8217;clock (see <a href="http://samanathon.com/windows-tip-shutdown-your-computer-with-a-batch-file/">http://samanathon.com/windows-tip-shutdown-your-computer-with-a-batch-file</a>)<br />
More info on the shutdown command on: and <a href="and http://www.yinfor.com/blog/archives/2007/04/schedule_to_shutdown_your_wind.html ">http://www.yinfor.com/blog/archives/2007/04/schedule_to_shutdown_your_wind.html<br />
</a></p>
<p>Startup: now that&#8217;s a bit more tricky since we need to wake up a computer that&#8217;s &#8230; shutdown, i.e. no chance do it by scheduling a Windows task!<br />
The answer to that is: BIOS. Well at least most BIOS offer a wake-on-schedule functionality. In our case the BIOS of the Intel Desktop Board D945GCLF offers it. All I had to do was to hit F2 at startup (i.e. access the BIOS) and enable the &#8220;Wake on Alarm&#8221; option to 8 o&#8217;clock in the morning which did the trick&#8230;</p>
<p>4) Last but not least (this is an edit since I noticed that this morning when the kiosk screen turned black!): you need to be sure that the PC does not turn off the screen after a while. The best-thing to do is to activate the Presentation mode in Control Panel -> Power Options -> Power Scheme and select Presentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2008/11/26/creating-a-kiosk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t Break my Back!!</title>
		<link>http://www.guinard.org/~misterdom/2008/11/14/dont-break-my-back/</link>
		<comments>http://www.guinard.org/~misterdom/2008/11/14/dont-break-my-back/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 12:07:59 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Lifestyle]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=44</guid>
		<description><![CDATA[As a researcher in computer science (who thinks a CS researcher day without any line of code is a wasted day  ) I end up spending quite a bit of time sitting in front of my computer. 
So far so good, till today I was young and innocent and could spend 14 hours in [...]]]></description>
			<content:encoded><![CDATA[<p>As a researcher in computer science (who thinks a CS researcher day without any line of code is a wasted day <img src='http://www.guinard.org/~misterdom/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) I end up spending quite a bit of time sitting in front of my computer. </p>
<p>So far so good, till today I was young and innocent and could spend 14 hours in a raw debugging an obscure prototype in C. HOWEVER, since a while now I end up having such bad back pain that I decided to act!</p>
<p>What&#8217;s my point? Well I was trying to find a tool that would force me to take (short) breaks on a regular basis (let&#8217;s say every 60 minutes).<br />
I actually found a tool that does much better, it&#8217;s a timer but also a personal trainer: StrechClock!<br />
<img src="http://www.stretchclock.com/images/Logo.jpg" alt="StrechClock logo" /></p>
<p>Every 60 minutes (you can customize that) it pops up a browser window which contains a youtube video of a one to two minutes stretching exercise demonstrated by a guy in suite (that guy is just hilarious at first!).</p>
<p>That great tool comes as a Vista sidebar Gadget (which I&#8217;m using) and as a igoogle gadget. It&#8217;s free but there is a cool business model behind it, the site that pops up also offers some related adds and a shopping corner, nothing intrusive and rather contextual.</p>
<p>Yes, it&#8217;s cool but moreover it also seems to&#8230; work! I actually started using it a week ago and I already fell the difference (nope, I don&#8217;t have any shares in that company, at least not at the time of writing). </p>
<p>From a technical point of view I also quite like the app since it is a nice example of a web/desktop &#8220;mashup&#8221;. The tool installed on your desktop is directly connected to a website which in turns uses youtube to display contextual content (videos). Isn&#8217;t that a nice example of the cloud?</p>
<p>Last note: you might end up looking really foolish doing these exercise in front of your colleagues. BUT three replies to that: 1) who will look foolish in 10 years time when they can&#8217;t bend anymore? Um? 2) let&#8217;s all use it! 3) who cares, looking foolish is cool!</p>
<p>Get it now: <a href="http://www.stretchclock.com/download/default.htm">http://www.stretchclock.com/download/default.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2008/11/14/dont-break-my-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giving some REST to your C++ code: embedding the SHTTPD server.</title>
		<link>http://www.guinard.org/~misterdom/2008/10/27/giving-some-rest-to-your-c-code-embedding-the-shttp-server/</link>
		<comments>http://www.guinard.org/~misterdom/2008/10/27/giving-some-rest-to-your-c-code-embedding-the-shttp-server/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 14:28:33 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Dev Logbook]]></category>
		<category><![CDATA[Plogg and Smart Meters]]></category>
		<category><![CDATA[Visual Studio .Net]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[visualstudio]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=21</guid>
		<description><![CDATA[Wanting to turn the Ploggs, into more RESTful devices, I needed to add a web server (HTTP) to the C++ code managing the Ploggs.
After comparing and trying a number of lightweight web servers (Apache was not an option for this kind of small app) I picked SHTTPD, mainly because:

 It was one of the few [...]]]></description>
			<content:encoded><![CDATA[<p>Wanting to turn the <a href="?cat=4">Ploggs</a>, into more RESTful devices, I needed to add a web server (HTTP) to the C++ code managing the Ploggs.</p>
<p>After comparing and trying a number of lightweight web servers (Apache was not an option for this kind of small app) I picked <a href="http://shttpd.sourceforge.net/">SHTTPD</a>, mainly because:</p>
<ol>
<li> It was one of the few I managed to embed in my C++ code (I&#8217;m not a C expert&#8230;)</li>
<li> It offered the possibility of registering call back methods when a particular URL is called, which makes it a quite good candidate for a REST interface.</li>
</ol>
<p>Here is how I did proceed to integrate it to my Microsoft Visual C++ project:</p>
<ol>
<li>Compile the project (the core, not the example), this should create a <code>shttpd.lib</code> file. (<a href="?p=17">This post might in case you do not succeed this step </a>).</li>
<li>Copy the shttpd.lib, shttpd.h to your src folder (the one of your Visual Studio project).</li>
<li>Download <a href="http://shttpd.sourceforge.net/shttpd.pem">shttpd.pem</a> and copy it to your src folder as well.</li>
<li>Add the <code>shttpd.h</code> file to your project.</li>
<li>Add the following lib references to your project: <code>shttpd.lib ws2_32.lib</code>, see <a href="?p=15">to get details on how to add it.</a></li>
<li>Add the code to start and setup the server. Snippets can be found in the example folder of the SHTTPD distrib. That in my case:</li>
</ol>
<p><code><br />
// TestSHTTPD.cpp : Defines the entry point for the console application.<br />
#include<br />
#include<br />
#include<br />
#include<br />
#include </code></p>
<p>#include &#8220;stdafx.h&#8221;<br />
#include &#8220;shttpd.h&#8221;</p>
<p>#define ALIAS_URI &#8220;/my_c&#8221;<br />
#define ALIAS_DIR &#8220;c:\\&#8221;</p>
<p>static void show_index(struct shttpd_arg *arg) {<br />
shttpd_printf(arg, &#8220;%s&#8221;,<br />
&#8220;HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n&#8221;<br />
&#8220;Welcome to embedded example of SHTTPD&#8221;);<br />
arg-&gt;flags |= SHTTPD_END_OF_OUTPUT;<br />
}</p>
<p>int _tmain(int argc, char* argv[])<br />
{<br />
/*<br />
* Initialize SHTTPD context.<br />
* Attach folder c:\ to the URL /my_c  (for windows), and<br />
* /etc/ to URL /my_etc (for UNIX). These are Apache-like aliases.<br />
* Set WWW root to current directory.<br />
* Start listening on ports 8080 and 8081<br />
*/<br />
int	data = 1234567;<br />
struct shttpd_ctx	*ctx;<br />
ctx = shttpd_init(argc, argv);<br />
shttpd_set_option(ctx, &#8220;ssl_cert&#8221;, &#8220;shttpd.pem&#8221;);<br />
shttpd_set_option(ctx, &#8220;aliases&#8221;, ALIAS_URI &#8220;=&#8221; ALIAS_DIR);<br />
shttpd_set_option(ctx, &#8220;ports&#8221;, &#8220;8080,8081s&#8221;);</p>
<p>/* Register an index page under two URIs */<br />
shttpd_register_uri(ctx, &#8220;/&#8221;, &amp;show_index, (void *) &amp;data);<br />
shttpd_register_uri(ctx, &#8220;/abc.html&#8221;, &amp;show_index, (void *) &amp;data);</p>
<p>/* Serve connections infinitely until someone kills us */<br />
for (;;)<br />
shttpd_poll(ctx, 1000);</p>
<p>/* Probably unreached, because we will be killed by a signal */<br />
shttpd_fini(ctx);</p>
<p>return 0;<br />
}</p>
<p>You should now be able to use the web server within your application.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2008/10/27/giving-some-rest-to-your-c-code-embedding-the-shttp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running a makefile from the command line on Windows</title>
		<link>http://www.guinard.org/~misterdom/2008/10/23/running-a-makefile-from-the-command-line-on-windows/</link>
		<comments>http://www.guinard.org/~misterdom/2008/10/23/running-a-makefile-from-the-command-line-on-windows/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 13:33:14 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Dev Logbook]]></category>
		<category><![CDATA[Ubicomp / Pervasive]]></category>
		<category><![CDATA[Visual Studio .Net]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=17</guid>
		<description><![CDATA[Running a makefile in command-line on Windows can be painful if you try to set all the environment variables (path, bin folder for the nmake utility, and so forth) manually, luckily enough, Visual Studio (Express edition as well) comes bundled with a batch file that does it for you: vcvars32.bat.
The tool is located in the [...]]]></description>
			<content:encoded><![CDATA[<p>Running a makefile in command-line on Windows can be painful if you try to set all the environment variables (path, bin folder for the nmake utility, and so forth) manually, luckily enough, Visual Studio (Express edition as well) comes bundled with a batch file that does it for you: <code>vcvars32.bat</code>.</p>
<p>The tool is located in the <code>bin</code> folder of your Visual Studio install.</p>
<p>Source: <a href="http://www.codeguru.com/forum/archive/index.php/t-419379.html">http://www.codeguru.com/forum/archive/index.php/t-419379.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2008/10/23/running-a-makefile-from-the-command-line-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building a sensor network for energy monitoring: Plogg and Play!</title>
		<link>http://www.guinard.org/~misterdom/2008/10/14/building-a-sensor-network-for-energy-monitoring-plogg-and-play/</link>
		<comments>http://www.guinard.org/~misterdom/2008/10/14/building-a-sensor-network-for-energy-monitoring-plogg-and-play/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 14:00:43 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Plogg and Smart Meters]]></category>
		<category><![CDATA[Ubicomp / Pervasive]]></category>
		<category><![CDATA[pervasive]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[smartmeters]]></category>
		<category><![CDATA[ubicomp]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=3</guid>
		<description><![CDATA[
According to http://www.plogginternational.com/ the Plogg &#8220;is a combined smart meter plug (kWh) and data logger, especially suited for metering, monitoring and control at the point of use &#8211; the appliance level.&#8221;
I would add not any kind of smart meter. Indeed, each Plogg is a sensor node, namely a small embedded computer that communicates with it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.guinard.org/~misterdom/wp-content/uploads/2008/10/plogg.gif"><img class="alignnone size-medium wp-image-4" title="plogg" src="http://www.guinard.org/~misterdom/wp-content/uploads/2008/10/plogg-300x178.gif" alt="" width="300" height="178" /></a></p>
<p>According to <a href="http://www.plogginternational.com/">http://www.plogginternational.com/</a> the Plogg &#8220;is a combined smart meter plug (kWh) and data logger, especially suited for metering, monitoring and control at the point of use &#8211; the appliance level.&#8221;</p>
<p>I would add not any kind of smart meter. Indeed, each Plogg is a sensor node, namely a small embedded computer that communicates with it peers (and possibly a number of computers/mobiles) using wireless connectivity.</p>
<p>Since I started working on a project that aims at making people aware of the energy consumption of appliances in a plain old office of the <a href="http://www.cudrefin02.ch/">Cudrefin02 foundation</a> I thought testing the Ploggs would be a good thing.</p>
<p>I&#8217;ll report on my Ploggs experiences on a regular basis on this blogg, um sorry I mean blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2008/10/14/building-a-sensor-network-for-energy-monitoring-plogg-and-play/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

