<?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>Florent Clairambault</title>
	<atom:link href="http://florent.clairambault.fr/feed" rel="self" type="application/rss+xml" />
	<link>http://florent.clairambault.fr</link>
	<description></description>
	<lastBuildDate>Sat, 28 Aug 2010 15:26:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>TC65FM : TC65 Fast Manager</title>
		<link>http://florent.clairambault.fr/tc65fm-tc65-fast-manager?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=tc65fm-tc65-fast-manager</link>
		<comments>http://florent.clairambault.fr/tc65fm-tc65-fast-manager#comments</comments>
		<pubDate>Wed, 21 Jul 2010 20:00:02 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Cinterion]]></category>
		<category><![CDATA[TC65]]></category>
		<category><![CDATA[TC65 tools]]></category>
		<category><![CDATA[TC65FM]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2919</guid>
		<description><![CDATA[I did this program because I had to reprogram some chips without a working MES deployment environment. I could deploy the TC65 program on a server but not upload it on the chip. And then I thought it could do a nice application for all the people deploying TC65 programs in a production environment. What [...]]]></description>
			<content:encoded><![CDATA[<p>I did this program because I had to reprogram some chips without a working MES deployment environment. I could deploy the TC65 program on a server but not upload it on the chip. And then I thought it could do a nice application for all the people deploying TC65 programs in a production environment.</p>
<p>What this program basically does is to respond to &#8220;^SYSSTART&#8221; messages coming from the TC65 chip to launch an OTAP update and/or launch the program. But in the details it does a little bit more as it can auto-detect the port of the chip.</p>
<p>Some of the features might not be working great or even not working at all. The program will be improved with the time, my testings and your comments but it&#8217;s currently used for my own needs.</p>
<p><strong>You can <a href="http://florent.clairambault.fr/downloads/tc65fm.exe">download it</a>.</strong></p>
<p>Here is the &#8220;-h&#8221; output :</p>

<div class="wp_codebox"><table><tr id="p29196"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p2919code6"><pre class="sh" style="font-family:monospace;">TC65FM 0.1 - Fast Manager - Copyright WebIngenia 2010
&nbsp;
 -b  --behavior &lt;behavior&gt;     Behavior, can be : 
       i  / install              Install only
       r  / run                  Run only
       ri / run-and-install      Run and install
       n  / none                 Nothing
 -na --net-apn &lt;apn&gt;           Network APN
 -nu --net-user &lt;user&gt;         Network User
 -np --net-password &lt;password&gt; Network password
 -nd --net-dns &lt;dns&gt;           Network DNS
 -au --application-url &lt;url&gt;   Application url
 -sA --serial-autodetect       Serial auto-Detect
 -sp --serial-port &lt;port&gt;      Serial port (default: COM4)
 -ss --serial-speed &lt;speed&gt;    Serial speed (defau:t 9600)
 -tp --target-program          Target program
 -ni --no-ipr                  Desactivate IPR command (not recommended)
 -ae --autostart-enable        Enable autostart
 -ad --autostart-disable       Disable autostart
 -at --autostart-time          Time before autostart
 -pc --password-current        Current password
 -pn --password-next           Next password
 -h  --help                    This help</pre></td></tr></table></div>

<p>There&#8217;s also a &#8220;network autodetection&#8221; feature which is in a very early stage. So if you want to test it you can using the &#8220;-nA&#8221; option (but you shouldn&#8217;t).</p>
<p>Let&#8217;s say you want to automatically install the program each time a chip (configured with a serial baudrate of 9600) connects to the COM4 port :</p>

<div class="wp_codebox"><table><tr id="p29197"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p2919code7"><pre class="bash" style="font-family:monospace;">tc65fm <span style="color: #660033;">-sp</span> COM4 <span style="color: #660033;">-ss</span> <span style="color: #000000;">9600</span> <span style="color: #660033;">-na</span> <span style="color: #ff0000;">&quot;m2minternet&quot;</span> <span style="color: #660033;">-nu</span> <span style="color: #ff0000;">&quot;http://webingenia.com/myPath/myApp.jad&quot;</span> <span style="color: #660033;">-tg</span> <span style="color: #ff0000;">&quot;a:/wim2msoft.jad&quot;</span></pre></td></tr></table></div>

<p>The program creates two types of log files. One for the complete running time and one for each communication with the chip occuring after a restart (and the identification of the chip by its IMEI).</p>
<p>Here is the logs of what you should get at each chip startup with this app :</p>

<div class="wp_codebox"><table><tr id="p29198"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p2919code8"><pre class="txt" style="font-family:monospace;">TC65FM v0.1 - Copyright Webingenia - www.webingenia.com
2010-07-17 09:43:25.682 | &lt;-- AT
2010-07-17 09:43:25.733 | --&gt; AT
2010-07-17 09:43:25.748 | --&gt; OK
2010-07-17 09:43:25.766 | &lt;-- AT+IPR=9600
2010-07-17 09:43:25.828 | --&gt; AT+IPR=9600
2010-07-17 09:43:25.829 | --&gt; OK
2010-07-17 09:43:25.847 | &lt;-- AT+CFUN=1,1
2010-07-17 09:43:25.908 | --&gt; AT+CFUN=1,1
2010-07-17 09:43:26.932 | --&gt; OK
2010-07-17 09:43:30.164 | --&gt; ^SYSSTART
2010-07-17 09:43:30.169 | &lt;-- AT+CGSN
2010-07-17 09:43:30.228 | --&gt; AT+CGSN
2010-07-17 09:43:30.292 | --&gt; 353234023540741
2010-07-17 09:43:30.292 | --&gt; OK</pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p29199"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p2919code9"><pre class="txt" style="font-family:monospace;">TC65FM v0.1 - Copyright Webingenia - www.webingenia.com
2010-07-17 09:43:31.174 | &lt;-- ATE1
2010-07-17 09:43:31.236 | --&gt; ATE1
2010-07-17 09:43:31.253 | --&gt; OK
2010-07-17 09:43:31.256 | &lt;-- AT^SJOTAP=,http://webingenia.com:8080/myPath/myApp.jad,a:,,,gprs,m2minternet,,,,,,
2010-07-17 09:43:31.413 | --&gt; AT^SJOTAP=,http://webingenia.com:8080/myPath/myApp.jar,a:,,,gprs,m2minternet,,,,,,
2010-07-17 09:43:31.461 | --&gt; OK
2010-07-17 09:43:31.477 | &lt;-- AT^SJOTAP
2010-07-17 09:43:31.540 | --&gt; AT^SJOTAP
2010-07-17 09:43:31.573 | --&gt; OK
2010-07-17 09:43:31.578 | &lt;-- AT^SCFG=&quot;Trace/Syslog/OTAP&quot;,&quot;1&quot;
2010-07-17 09:43:31.668 | --&gt; AT^SCFG=&quot;Trace/Syslog/OTAP&quot;,&quot;1&quot;
2010-07-17 09:43:31.685 | --&gt; SYSLOG ENABLED
2010-07-17 09:43:47.622 | --&gt; [OTAP] GPRS connection established.
2010-07-17 09:43:47.702 | --&gt; [OTAP] Try to get http://webingenia.com:8080/myPath/myApp.jad ...
2010-07-17 09:43:51.812 | --&gt; [OTAP] Connected.
2010-07-17 09:43:51.861 | --&gt; [OTAP] Transfer finished.
2010-07-17 09:43:51.941 | --&gt; [OTAP] Try to get http://webingenia.com:8080/myPath/myApp.jar ...
2010-07-17 09:44:01.781 | --&gt; [OTAP] Connected.
2010-07-17 09:44:02.340 | --&gt; [OTAP] Transfer finished.
2010-07-17 09:44:05.541 | --&gt; [OTAP] JAM status: 900 Success.
2010-07-17 09:44:11.524 | --&gt; [OTAP] Reboot now.
2010-07-17 09:44:11.540 | --&gt; ^SYSSTART
2010-07-17 09:44:11.544 | &lt;-- AT+CGSN
2010-07-17 09:44:11.605 | --&gt; AT+CGSN
2010-07-17 09:44:11.652 | --&gt; 353234023540741
2010-07-17 09:44:11.668 | --&gt; OK</pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p291910"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p2919code10"><pre class="txt" style="font-family:monospace;">TC65FM v0.1 - Copyright Webingenia - www.webingenia.com
2010-07-17 09:44:12.048 | &lt;-- AT^SJRA=a:/secretApp.jad
2010-07-17 09:44:12.132 | --&gt; AT^SJRA=a:/secretApp.jad
2010-07-17 09:44:12.389 | --&gt; OK
2010-07-17 09:44:13.652 | --&gt; WIM2MSoft
2010-07-17 09:44:14.036 | --&gt; Thread-5 : [1/7] Initiating...
2010-07-17 09:44:14.534 | --&gt; Thread-5 : [2/7] Loading settings...
2010-07-17 09:44:15.126 | --&gt; Thread-5 : [3/7] main AT Command interface...
2010-07-17 09:44:15.222 | --&gt; Thread-5 : [4/7] Loading SMS Management...
2010-07-17 09:44:15.510 | --&gt; Thread-5 : [5/7] Checking SIM card...
2010-07-17 09:44:20.676 | --&gt; Thread-5 : [6/7] Loading M2MP network communication...
2010-07-17 09:44:21.908 | --&gt; Thread-5 : [7/7] Loading the main program...
2010-07-17 09:44:32.485 | --&gt; nwr : NetworkLayer.Connect : Could not connect to 84.14.33.44:3000 ex : class javax.microedition.io.ConnectionNotFoundException :  Remote host has rejected the connection.
2010-07-17 09:44:53.845 | --&gt; nwr : NetworkLayer.Connect : Could not connect to 84.14.33.44:3000 ex : class javax.microedition.io.ConnectionNotFoundException :  Remote host has rejected the connection.</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/tc65fm-tc65-fast-manager/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dear Google Analytics</title>
		<link>http://florent.clairambault.fr/dear-google-analytics?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=dear-google-analytics</link>
		<comments>http://florent.clairambault.fr/dear-google-analytics#comments</comments>
		<pubDate>Mon, 19 Jul 2010 20:17:50 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Analytics]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2945</guid>
		<description><![CDATA[Dear Google Analytics, or dear blog readers (if any). I just read the google analytics stats of a site and noticed a totally new source of traffic: &#8220;Other&#8221;. What do you think it could be ? Somehow it reminded me this blog post of a graphic designer (who seems quite talented and very creative) :]]></description>
			<content:encoded><![CDATA[<p><a href="http://i.mivi.fr/03c30a41cb4aa110c0b59eb5b4d56ff48c3df5ae.png"><img src="http://i.mivi.fr/03c30a41cb4aa110c0b59eb5b4d56ff48c3df5ae.x.300.png" style="position: relative; float: right; margin-left: 10px" /></a><br />
Dear Google Analytics, or dear blog readers (if any). I just read the google analytics stats of a site and noticed a totally new source of traffic: &#8220;Other&#8221;. What do you think it could be ?</p>
<p>Somehow it reminded me <a href="http://www.27bslash6.com/p2p2.html">this blog post</a> of a graphic designer (who seems quite talented and very creative) :<br />
<img src="http://i.mivi.fr/a05b20452c193fc2b51ad6ca34d5ba406e008605.gif" /><br />
<img src="http://i.mivi.fr/063b38062899965b810d0a36b3d74b7f09003358.gif" /><br />
<img src="http://i.mivi.fr/b680f0e8ac824709989b6e5ec5721b51e6ac25a9.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/dear-google-analytics/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Latitude History</title>
		<link>http://florent.clairambault.fr/google-latitude-history?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-latitude-history</link>
		<comments>http://florent.clairambault.fr/google-latitude-history#comments</comments>
		<pubDate>Sat, 17 Jul 2010 08:00:21 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Latitude]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2928</guid>
		<description><![CDATA[I thought about this service as soon as Google released the Google Latitude service : &#8220;It would be great if they could save data so that we could see where we were at a specific time.&#8221; And I very quickly published some code to get my position (you could be tracking me right now with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.mivi.fr/87862c736fd9fcbeaeaa0ecfbc54732e1f670fac.png" style="position: relative; float: right; margin-left: 10px" />I thought about this service as soon as Google released the Google Latitude service : &#8220;It would be great if they could save data so that we could see where we were at a specific time.&#8221; And I very quickly published <a href="http://florent.clairambault.fr/access-your-google-latitude-position-from-a-net-app">some code to get my position</a> (you could be tracking me right now with it). I thought they would never release the history saving feature as people would have feared for their privacy and things like that. But they did it.</p>
<p><a href="http://www.google.com/latitude/apps/history">http://www.google.com/latitude/apps/history</a></p>
<p>I don&#8217;t know if it&#8217;s just me but I find it somehow related to what does foursquare in the way that it both help you to connect to your friends and you become rich of the location data you give them. In foursquare you have the possibility to become the mayor of nearly anything. In Google Maps, well, you possess your own tracking data.<br />
Which basically means that the more you track, the more you create content. Couldn&#8217;t it be one of the key motivational factors ?</p>
<p>Google knows my mails, my contacts, my web search history, my favorites (using chrome sync), my discussions (on google talk even though I&#8217;m progressively switching to Skype), my photos, my credit card number, some friends on orkut and now my position. If you think they&#8217;re an evil big brother, you should just create better products, I&#8217;ll switch to your instantly.</p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/google-latitude-history/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Technology brotherhoods</title>
		<link>http://florent.clairambault.fr/technology-brotherhoods?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=technology-brotherhoods</link>
		<comments>http://florent.clairambault.fr/technology-brotherhoods#comments</comments>
		<pubDate>Tue, 06 Jul 2010 21:00:02 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[productivity]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2870</guid>
		<description><![CDATA[I often hear people talking about which technology is better between C / C++ / C# .Net / java. Most of the time, it&#8217;s more a political/brotherhood/community thing (like football, even thought frenchies like me aren&#8217;t so proud of their team now) than a technical talk. I find it absurd. Computer science is about efficiency [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.mivi.fr/08d1a596d5f04e8a326679be679c2c76934ed624.x.300.jpg" style="position: relative; float: right; margin-left: 10px"/><br />
I often hear people talking about which technology is better between C / C++ / C# .Net / java. Most of the time, it&#8217;s more a political/brotherhood/community thing (like football, even thought frenchies like me aren&#8217;t so proud of their team now) than a technical talk.<br />
I find it absurd. Computer science is about efficiency and making more money. You can take into account the pleasure you have to work on a technology (as you will be more likely to be more efficient with it), but it should still remain about efficiency.</p>
<p>The following video is about java &#038; C# .Net. I&#8217;ve done quite a lot of C# .Net, Java and C, and some ObjectiveC (while developing iPhone applications) and a little bit of C++. The only thing I <strong>feel</strong> is that Sun with java had the good ideas, Microsoft with .Net took them and finished the work. Still, I often code in java, mostly for the TC65 chip, it&#8217;s quite comfortable. But for instance, it was longer to implement the <a href="http://florent.clairambault.fr/tag/m2mp">M2MP protocol</a> on the <a href="http://florent.clairambault.fr/tag/tc65">TC65</a> chip than the C# .net server. Mostly because of the unsigned types I had to &#8220;emulate&#8221; and the lack of generics (which are not available on the TC65&#8242;s JVM).</p>
<p>By the way, I&#8217;m running .Net apps on Linux everyday using <a href="http://www.mono-project.com/">Mono</a>. </p>
<p>Here is the best example of what I&#8217;m talking about :</p>
<div style="text-align: center">
<video src="http://florent.clairambault.fr/downloads/video/java4ever.mp4" controls="controls" />
</div>
<p>For all these lame people who don&#8217;t have an HTML5 compatible browser, you can go to <a href="http://www.youtube.com/watch?v=9g1y7f1xjJ0">the original video</a>. The reason I downloaded it here in my blog is that you are forced to register to YouTube to watch it. </p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/technology-brotherhoods/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
<enclosure url="http://florent.clairambault.fr/downloads/video/java4ever.mp4" length="12992699" type="video/mp4" />
		</item>
		<item>
		<title>Nao the robot</title>
		<link>http://florent.clairambault.fr/nao-the-robot?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=nao-the-robot</link>
		<comments>http://florent.clairambault.fr/nao-the-robot#comments</comments>
		<pubDate>Wed, 30 Jun 2010 22:16:09 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[aldebaran robotics]]></category>
		<category><![CDATA[nao]]></category>
		<category><![CDATA[robot]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2839</guid>
		<description><![CDATA[I&#8217;ve got a highschool friend whose father started a robot company. And this isn&#8217;t any robot company, they built the finest consumer product robot. And she&#8217;s now representing the company and leading the communication around the robot in Shanghaï. She and her 9 people team, spent 5 full-time working months to do this quite amazing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve got a highschool friend whose father started <a href="http://www.aldebaran-robotics.com/">a robot company</a>. And this isn&#8217;t any robot company, they built the finest consumer product robot. And she&#8217;s now representing the company and leading the communication around the robot in Shanghaï. She and her 9 people team, spent 5 full-time working months to do this quite amazing show :</p>
<div style="text-align: center">
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/uIuRc1r_N34&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/uIuRc1r_N34&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;color1=0x2b405b&#038;color2=0x6b8ab6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
</div>
<p>Edit :<br />
I just remembered my friend Alice already has <a href="http://heureuxquicommealice.blogspot.com/">a blog</a> where <a href="http://heureuxquicommealice.blogspot.com/2010/06/nao-on-france-pavilion.html">she speaks about this great robot</a>. My excuse for not remembering it is that she doesn&#8217;t update it very often.</p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/nao-the-robot/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m starting to like Skype</title>
		<link>http://florent.clairambault.fr/im-starting-to-like-skype?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=im-starting-to-like-skype</link>
		<comments>http://florent.clairambault.fr/im-starting-to-like-skype#comments</comments>
		<pubDate>Sat, 26 Jun 2010 07:00:19 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[non technical]]></category>
		<category><![CDATA[skype]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2813</guid>
		<description><![CDATA[I&#8217;ve &#8220;always&#8221; used IM clients. I started with ICQ, switched to AIM, then MSN, then Jabber, then Gtalk and more recently Skype. I have all of them open, mostly because I like to be able to talk to everyone without forcing them to switch to something to talk to me but the main client I [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.mivi.fr/eb15524717a67668121236a7ef5054d296190546.x.128.jpg" style="position: relative; float: right; margin-right: 10px"><br />
I&#8217;ve &#8220;always&#8221; used IM clients. I started with ICQ, switched to AIM, then MSN, then Jabber, then Gtalk and more recently Skype. I have all of them open, mostly because I like to be able to talk to everyone without forcing them to switch to something to talk to me but the main client I use, is currently Skype.</p>
<p>Skype is the only one client that isn&#8217;t open in any way (application and every protocols). Well I must say, they&#8217;ve released their SDK (<a href="http://developer.skype.com/">SkypeKit</a>) very recently (the 22/06/10). People can now build softwares around Skype. But this is not what I want to talk about.</p>
<p>Why I am starting to like Skype ? It&#8217;s the best around multiple computers. I can open it on Windows host, a Mac Os X host, a Linux host, and iPhone and still follow the same chat conversation without losing any word of it. What you received is shared among all computers and what you send too. This might also be the biggest drawback for some people. You have to take care of closing your session at work before talking trash about your boss.</p>
<p>Why I&#8217;m still not loving it ?</p>
<ul>
<li>The available / away state clearly doesn&#8217;t work well. It just fails to automatically detect the available / away state. It feels like it&#8217;s a totally broken feature (and I&#8217;m not the only one who feels that way).</li>
<li>Exchanged messages sometimes have pretty important delays (something like 5 to 30 seconds).</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/im-starting-to-like-skype/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recycling .net objects to improve performances</title>
		<link>http://florent.clairambault.fr/recycling-net-objects-to-improve-performances?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=recycling-net-objects-to-improve-performances</link>
		<comments>http://florent.clairambault.fr/recycling-net-objects-to-improve-performances#comments</comments>
		<pubDate>Tue, 15 Jun 2010 20:00:02 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2792</guid>
		<description><![CDATA[C# .Net allocation and freeing system is quite efficient but when you need to create a huge number of objects, it&#8217;s just not fast enough. So what you can do is try to recycle each object to avoid to recreate them. You will then just need to set their property. In my tests, this class [...]]]></description>
			<content:encoded><![CDATA[<p>C# .Net allocation and freeing system is quite efficient but when you need to create a huge number of objects, it&#8217;s just not fast enough. So what you can do is try to recycle each object to avoid to recreate them. You will then just need to set their property. </p>
<p>In my tests, this class reduced the allocation time from 12 to 15 times:</p>

<div class="wp_codebox"><table><tr id="p279212"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p2792code12"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">sealed</span> <span style="color: #6666cc; font-weight: bold;">class</span> Heap<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span> <span style="color: #0600FF; font-weight: bold;">where</span> T<span style="color: #008000;">:</span><span style="color: #6666cc; font-weight: bold;">class</span>, <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
	<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> Stack<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span> _stack <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Stack<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
	<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">int</span> _count<span style="color: #008000;">;</span>
&nbsp;
	<span style="color: #0600FF; font-weight: bold;">public</span> T Allocate<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
		var obj <span style="color: #008000;">=</span> _count <span style="color: #008000;">!=</span> <span style="color: #FF0000;">0</span> <span style="color: #008000;">?</span> _stack<span style="color: #008000;">.</span><span style="color: #0000FF;">Pop</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">:</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> T<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #0600FF; font-weight: bold;">return</span> obj<span style="color: #008000;">;</span>
	<span style="color: #008000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Free<span style="color: #008000;">&#40;</span> T obj <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
		<span style="color: #008000;">++</span>_count<span style="color: #008000;">;</span>
		_stack<span style="color: #008000;">.</span><span style="color: #0000FF;">Push</span><span style="color: #008000;">&#40;</span> obj <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>You might think that this process is really painful as you have to manually free every single objects you use. But in fact you just have to recycle most of the objects. If you forget some, that&#8217;s not really important (they will just get garbage collected).</p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/recycling-net-objects-to-improve-performances/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A little TC65 development document</title>
		<link>http://florent.clairambault.fr/tc65dev-document?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=tc65dev-document</link>
		<comments>http://florent.clairambault.fr/tc65dev-document#comments</comments>
		<pubDate>Sun, 13 Jun 2010 16:47:19 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Cinterion]]></category>
		<category><![CDATA[TC65]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2785</guid>
		<description><![CDATA[During the last months I spent some time writing a document on the TC65 development. It is primary aimed at TC65 project managers and developers. This document can be considered as a draft and I&#8217;m waiting for any of your comments to fix / improve / complete it. It&#8217;s currently 40 pages long. Here is [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.mivi.fr/85978f19836fda42f7bc43e25d1c05e80ca0e15f.x.300.png" style="position: relative; float: right; margin-left: 10px" /></p>
<p>During the last months I spent some time writing a document on the TC65 development. It is primary aimed at TC65 project managers and developers.</p>
<p>This document can be considered as a draft and I&#8217;m waiting for any of your comments to fix / improve / complete it. It&#8217;s currently 40 pages long.</p>
<p>Here is <a href="http://florent.clairambault.fr/downloads/Cinterion/TC65Dev.pdf">the document</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/tc65dev-document/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Google PowerMeter and sample C# .Net API usage</title>
		<link>http://florent.clairambault.fr/google-powermeter-and-sample-c-net-api-usage?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=google-powermeter-and-sample-c-net-api-usage</link>
		<comments>http://florent.clairambault.fr/google-powermeter-and-sample-c-net-api-usage#comments</comments>
		<pubDate>Sat, 29 May 2010 17:00:18 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Power]]></category>
		<category><![CDATA[green]]></category>
		<category><![CDATA[Z-wave]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2723</guid>
		<description><![CDATA[Google PowerMeter offers you to collect your home&#8217;s / enterprise&#8217;s / specific equipment&#8217;s power usage and have some basic analysis on it. There&#8217;s also a Google PowerMeter API so that everyone can build devices able to report their consumption and applications. I would say one cheap and evolutive way to implement this API would be [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://i.mivi.fr/acdeb2ba6ad51309f5d9f6eafbe3ad7566f30afa.x.300.jpg" style="position: relative; float: right; margin-left: 10px" /></p>
<p><a href="http://www.google.com/powermeter/about/about.html">Google PowerMeter</a> offers you to collect your home&#8217;s / enterprise&#8217;s / specific equipment&#8217;s power usage and have some basic analysis on it.</p>
<p>There&#8217;s also a <a href="http://code.google.com/intl/ro-RO/apis/powermeter/">Google PowerMeter API</a> so that everyone can build devices able to report their consumption and applications.</p>
<p>I would say one cheap and evolutive way to implement this API would be to use a Z-Wave power meter and have a Z-Wave central controller sent the data to Google servers. It could quickly get interesting because this could make you know the exact consumption of all your lights by calculating the result of the light-on/light-off order on individual lights. And this could even lead to define some max energy consumption scenarios so that you don&#8217;t allow more than X watts for all the lights of your house (this is just a idea, I would never put this in my home).</p>
<p>I know this isn&#8217;t the next BIG thing. Because everyone knows it&#8217;s all about the social right-now. But still, I think this could be the most green project of all time. Because it clearly shows people (or enterprises) how they consume energy and gives the useful analysis to find solutions. And for once it doesn&#8217;t try to make you feel guilty about not being green enough, it just brings facts.</p>
<p>By the way, you can have a negative energy consumption (power meter counting backward) in Google PowerMeter. I don&#8217;t think this is a bug, it must be for people selling their energy for their solar or wind energy producer equipments. But unfortunately you set the estimated cost of energy but you can&#8217;t set its estimated revenue price.</p>
<h3>Sample API call</h3>
<p>Here is a sample Google PowerMeter API call in C# .Net :<br />
<em>I just changed a little bit of the authentication parameters so that you can&#8217;t actually upload data on my account.</em></p>

<div class="wp_codebox"><table><tr id="p272314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
</pre></td><td class="code" id="p2723code14"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Globalization</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Net</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Threading</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">/* Equipment was activated with this URL :
 * https://www.google.com/powermeter/device/activate?mfg=WebIngenia&amp;model=TestEquipment1&amp;did=100102030405&amp;cvars=1&amp;dvars=0&amp;rurl=http://test.webingenia.com/powerMeter&amp;snonce=123
 *
 * The resulting request was (available here : http://test.webingenia.com/read/powerMeter#id2473 ) :
 * $_POST = array(
 *		[snonce] =&gt; 123
 *		[hash] =&gt; _____6c2562aeb7bab4e24afc7beeb18c701c04ba,____8c9f62fa8a137eba7fa35b5f58802fca2e56,____f4db13304c49d36fb81b20cabbe147f8ce34
 *		[token] =&gt; ________FhCtzebg_P____8BGMWjtUs
 *		[path] =&gt; /user/____4578579014915368/____4578579014915368/variable/WebIngenia.TestEquipment1.100102030405
 * )
 *
 */</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> test <span style="color: #008000;">&#123;</span>
	<span style="color: #6666cc; font-weight: bold;">class</span> Program <span style="color: #008000;">&#123;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> Random _random <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Random<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">String</span> DeviceHash <span style="color: #008000;">=</span> <span style="color: #008080; font-style: italic;">// Useless</span>
			<span style="color: #666666;">&quot;____bf8262aeb7bab4e24afc7beeb18c701c04ba,____8c9f62fa8a137eba7fa35b5f58802fca2e56,____f4db13304c49d36fb81b20cabbe147f8ce34&quot;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">String</span> DeviceToken <span style="color: #008000;">=</span> <span style="color: #008080; font-style: italic;">// Needed for authentication</span>
			<span style="color: #666666;">&quot;________FhCtzebg_P____8BGMWjtUs&quot;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">String</span> DevicePath <span style="color: #008000;">=</span> <span style="color: #008080; font-style: italic;">// URL of the device</span>
			<span style="color: #666666;">&quot;/user/____4578579014915368/_____4578579014915368/variable/WebIngenia.TestEquipment1.100102030405&quot;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">String</span> DeviceVar <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;c1&quot;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">String</span> FeedUrl <span style="color: #008000;">=</span> <span style="color: #008080; font-style: italic;">// URL of the Google PowerMeter API</span>
			<span style="color: #666666;">&quot;https://www.google.com/powermeter/feeds&quot;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">String</span> EventUrl <span style="color: #008000;">=</span> <span style="color: #008080; font-style: italic;">// URL where to send the data</span>
			FeedUrl <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;/event&quot;</span><span style="color: #008000;">;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">const</span> <span style="color: #6666cc; font-weight: bold;">int</span> Period <span style="color: #008000;">=</span> <span style="color: #FF0000;">5000</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// 5 to 10 seconds</span>
&nbsp;
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">double</span> MeterValue <span style="color: #008000;">&#123;</span>
			get <span style="color: #008000;">&#123;</span>
				<span style="color: #0600FF; font-weight: bold;">return</span> Settings<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span><span style="color: #008000;">.</span><span style="color: #0000FF;">MeterValue</span><span style="color: #008000;">;</span>
			<span style="color: #008000;">&#125;</span>
			set <span style="color: #008000;">&#123;</span>
				Settings<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span><span style="color: #008000;">.</span><span style="color: #0000FF;">MeterValue</span> <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
				Settings<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Save</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #008000;">&#125;</span>
		<span style="color: #008000;">&#125;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Send<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
&nbsp;
			<span style="color: #008080; font-style: italic;">// We increment the counter (by 0 to 1 kWh)</span>
			MeterValue <span style="color: #008000;">+=</span> _random<span style="color: #008000;">.</span><span style="color: #0000FF;">NextDouble</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
			Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;MeterValue : {0}&quot;</span>, MeterValue <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
			<span style="color: #008080; font-style: italic;">// This is what we are going to send</span>
			var strContent <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span>
			<span style="color: #666666;">@&quot;
&lt;feed xmlns=&quot;</span><span style="color: #666666;">&quot;http://www.w3.org/2005/Atom&quot;</span><span style="color: #666666;">&quot; xmlns:meter=&quot;</span><span style="color: #666666;">&quot;http://schemas.google.com/meter/2008&quot;</span><span style="color: #666666;">&quot;&gt;
	&lt;entry&gt;
      &lt;category scheme=&quot;</span><span style="color: #666666;">&quot;http://schemas.google.com/g/2005#kind&quot;</span><span style="color: #666666;">&quot; term=&quot;</span><span style="color: #666666;">&quot;http://schemas.google.com/meter/2008#instMeasurement&quot;</span><span style="color: #666666;">&quot; /&gt;
      &lt;meter:subject&gt;{0}&lt;/meter:subject&gt;
      &lt;meter:occurTime meter:uncertainty=&quot;</span><span style="color: #666666;">&quot;1.0&quot;</span><span style="color: #666666;">&quot;&gt;{1}&lt;/meter:occurTime&gt;
      &lt;meter:quantity meter:uncertainty=&quot;</span><span style="color: #666666;">&quot;0.001&quot;</span><span style="color: #666666;">&quot; meter:unit=&quot;</span><span style="color: #666666;">&quot;kW h&quot;</span><span style="color: #666666;">&quot;&gt;{2}&lt;/meter:quantity&gt;
    &lt;/entry&gt;
&lt;/feed&gt;&quot;</span>,
				FeedUrl <span style="color: #008000;">+</span> DevicePath <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.&quot;</span> <span style="color: #008000;">+</span> DeviceVar,						<span style="color: #008080; font-style: italic;">// Device URL</span>
				DateTime<span style="color: #008000;">.</span><span style="color: #0000FF;">UtcNow</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;yyyy-MM-dd'T'HH:mm:ss.fffK&quot;</span> <span style="color: #008000;">&#41;</span>,	<span style="color: #008080; font-style: italic;">// Current UTC date</span>
				MeterValue<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span> CultureInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">InvariantCulture</span> <span style="color: #008000;">&#41;</span>			<span style="color: #008080; font-style: italic;">// Meter value</span>
			<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
			<span style="color: #008080; font-style: italic;">// We convert it into raw content</span>
			var content <span style="color: #008000;">=</span> Encoding<span style="color: #008000;">.</span><span style="color: #0000FF;">UTF8</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetBytes</span><span style="color: #008000;">&#40;</span> strContent <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
			<span style="color: #008080; font-style: italic;">// We create the POST request</span>
			var req <span style="color: #008000;">=</span> WebRequest<span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span> EventUrl <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			req<span style="color: #008000;">.</span><span style="color: #0000FF;">Headers</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;Authorization&quot;</span>, <span style="color: #666666;">&quot;AuthSub token=<span style="color: #008080; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #008000;">+</span> DeviceToken <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\&quot;</span>&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			req<span style="color: #008000;">.</span><span style="color: #0000FF;">Method</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;POST&quot;</span><span style="color: #008000;">;</span>
			req<span style="color: #008000;">.</span><span style="color: #0000FF;">ContentLength</span> <span style="color: #008000;">=</span> content<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
			req<span style="color: #008000;">.</span><span style="color: #0000FF;">ContentType</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;application/atom+xml&quot;</span><span style="color: #008000;">;</span>
&nbsp;
			<span style="color: #0600FF; font-weight: bold;">try</span> <span style="color: #008000;">&#123;</span>
				<span style="color: #008080; font-style: italic;">// Opening the request stream means starting the request</span>
				Console<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;Requesting...&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
				<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span> var requestStream <span style="color: #008000;">=</span> req<span style="color: #008000;">.</span><span style="color: #0000FF;">GetRequestStream</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
&nbsp;
					<span style="color: #008080; font-style: italic;">// We send the content</span>
					requestStream<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span> content, <span style="color: #FF0000;">0</span>, content<span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
					<span style="color: #008080; font-style: italic;">// And we end the request by getting the response</span>
					<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span> var streamReader <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StreamReader<span style="color: #008000;">&#40;</span> req<span style="color: #008000;">.</span><span style="color: #0000FF;">GetResponse</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetResponseStream</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
						Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;Result : &quot;</span> <span style="color: #008000;">+</span> streamReader<span style="color: #008000;">.</span><span style="color: #0000FF;">ReadToEnd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
					<span style="color: #008000;">&#125;</span>
				<span style="color: #008000;">&#125;</span>
			<span style="color: #008000;">&#125;</span>
			<span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span> WebException e <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span> <span style="color: #008080; font-style: italic;">// If a webException occurs (should be 400)</span>
				<span style="color: #008080; font-style: italic;">// We display the error</span>
				var response <span style="color: #008000;">=</span> e<span style="color: #008000;">.</span><span style="color: #0000FF;">Response</span> <span style="color: #0600FF; font-weight: bold;">as</span> HttpWebResponse<span style="color: #008000;">;</span>
				<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span> response <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&#41;</span> <span style="color: #008080; font-style: italic;">// This is not the exception that we want</span>
					<span style="color: #0600FF; font-weight: bold;">throw</span><span style="color: #008000;">;</span>
				<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span> response <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
					<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span> var responseStream <span style="color: #008000;">=</span> response<span style="color: #008000;">.</span><span style="color: #0000FF;">GetResponseStream</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
						Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span>
							<span style="color: #666666;">&quot;Error {0} : {1} &quot;</span>,
							response<span style="color: #008000;">.</span><span style="color: #0000FF;">StatusCode</span>,
							<a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> StreamReader<span style="color: #008000;">&#40;</span> responseStream <span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ReadToEnd</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
						<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
					<span style="color: #008000;">&#125;</span>
				<span style="color: #008000;">&#125;</span>
			<span style="color: #008000;">&#125;</span>
		<span style="color: #008000;">&#125;</span>
&nbsp;
		<span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
			<span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span> <span style="color: #0600FF; font-weight: bold;">true</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
				<span style="color: #0600FF; font-weight: bold;">try</span> <span style="color: #008000;">&#123;</span>
					Send<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
				<span style="color: #008000;">&#125;</span>
				<span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span> Exception ex <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
					Console<span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;Exception : &quot;</span> <span style="color: #008000;">+</span> ex <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
				<span style="color: #008000;">&#125;</span>
				Thread<span style="color: #008000;">.</span><span style="color: #0000FF;">Sleep</span><span style="color: #008000;">&#40;</span> Period <span style="color: #008000;">+</span> _random<span style="color: #008000;">.</span><span style="color: #0000FF;">Next</span><span style="color: #008000;">&#40;</span> Period <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #008000;">&#125;</span>
		<span style="color: #008000;">&#125;</span>
&nbsp;
		<span style="color: #008080; font-style: italic;">// This code was generated by Visual Studio (but I prefer to put it here rather than having to publish the VS project)</span>
		<span style="color: #008080;">#region Auto-generated</span>
		<span style="color: #008000;">&#91;</span><span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Runtime</span><span style="color: #008000;">.</span><span style="color: #0000FF;">CompilerServices</span><span style="color: #008000;">.</span><span style="color: #0000FF;">CompilerGeneratedAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
		<span style="color: #008000;">&#91;</span><span style="color: #000000;">System.<span style="color: #0000FF;">CodeDom</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Compiler</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">GeneratedCodeAttribute</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator&quot;</span>, <span style="color: #666666;">&quot;9.0.0.0&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
		<span style="color: #0600FF; font-weight: bold;">internal</span> <span style="color: #0600FF; font-weight: bold;">sealed</span> <span style="color: #6666cc; font-weight: bold;">class</span> Settings<span style="color: #008000;">:</span><span style="color: #000000;">System.<span style="color: #0000FF;">Configuration</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">ApplicationSettingsBase</span> <span style="color: #008000;">&#123;</span>
&nbsp;
			<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> Settings defaultInstance <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span>Settings<span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#40;</span> Synchronized<span style="color: #008000;">&#40;</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Settings<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
			<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> Settings <span style="color: #0600FF; font-weight: bold;">Default</span> <span style="color: #008000;">&#123;</span>
				get <span style="color: #008000;">&#123;</span>
					<span style="color: #0600FF; font-weight: bold;">return</span> defaultInstance<span style="color: #008000;">;</span>
				<span style="color: #008000;">&#125;</span>
			<span style="color: #008000;">&#125;</span>
&nbsp;
			<span style="color: #008000;">&#91;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Configuration</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">UserScopedSettingAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
			<span style="color: #008000;">&#91;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Diagnostics</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">DebuggerNonUserCodeAttribute</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
			<span style="color: #008000;">&#91;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Configuration</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">DefaultSettingValueAttribute</span><span style="color: #008000;">&#40;</span> <span style="color: #666666;">&quot;3000&quot;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
			<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">double</span> MeterValue <span style="color: #008000;">&#123;</span>
				get <span style="color: #008000;">&#123;</span>
					<span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">&#40;</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#40;</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">&#91;</span> <span style="color: #666666;">&quot;MeterValue&quot;</span> <span style="color: #008000;">&#93;</span> <span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
				<span style="color: #008000;">&#125;</span>
				set <span style="color: #008000;">&#123;</span>
					<span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">&#91;</span> <span style="color: #666666;">&quot;MeterValue&quot;</span> <span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
				<span style="color: #008000;">&#125;</span>
			<span style="color: #008000;">&#125;</span>
		<span style="color: #008000;">&#125;</span>
		<span style="color: #008080;">#endregion</span>
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>I didn&#8217;t let it running too much time but still you can see that it works :<br />
<a href="http://i.mivi.fr/dd6f0441bdec29e66f68ff07a5530c52237ff66e.png"><img src="http://i.mivi.fr/dd6f0441bdec29e66f68ff07a5530c52237ff66e.x.800.png" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/google-powermeter-and-sample-c-net-api-usage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP-Codebox fix so that it doesn&#8217;t prevent posts export</title>
		<link>http://florent.clairambault.fr/wp-codebox-fix-so-that-it-doesnt-prevent-posts-export?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wp-codebox-fix-so-that-it-doesnt-prevent-posts-export</link>
		<comments>http://florent.clairambault.fr/wp-codebox-fix-so-that-it-doesnt-prevent-posts-export#comments</comments>
		<pubDate>Sat, 15 May 2010 07:00:08 +0000</pubDate>
		<dc:creator>Florent Clairambault</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WP Codebox]]></category>

		<guid isPermaLink="false">http://florent.clairambault.fr/?p=2695</guid>
		<description><![CDATA[If you have a PHP configured with some open_basedir restriction (which is recommended), the WP-Codebox plugin will prevent you from exporting the posts of your blog. Go to your blog, go in the &#8220;wp-content/plugins/wp-codebox&#8221; dir and edit the &#8220;wp-codebox.php&#8221; file : On line 27, you should have : 1 2 include_once &#34;../../../wp-config.php&#34;; include_once &#34;../../../wp-settings.php&#34;; Well, [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a PHP configured with some <a href="http://www.php.net/manual/en/ini.core.php#ini.open-basedir">open_basedir restriction</a> (which is recommended), the WP-Codebox plugin will prevent you from exporting the posts of your blog.</p>
<p>Go to your blog, go in the &#8220;wp-content/plugins/wp-codebox&#8221; dir and edit the &#8220;wp-codebox.php&#8221; file :<br />
On line 27, you should have :</p>

<div class="wp_codebox"><table><tr id="p269517"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p2695code17"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">&quot;../../../wp-config.php&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include_once</span> <span style="color: #0000ff;">&quot;../../../wp-settings.php&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Well, it fails because the plugin doesn&#8217;t use the good practices, so it&#8217;s pretty easy to fix :</p>

<div class="wp_codebox"><table><tr id="p269518"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p2695code18"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-config.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span> ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/wp-settings.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I&#8217;d like to thank the developer of this plugin for doing such a great job. It brings the power of <a href="http://qbnz.com/highlighter/">geshi</a> (not the latest version by the way) into <a href="http://wordpress.org/">wordpress</a>.</p>
<div style="display: none">
BTW, why change :<br />
* include_once to require_once : Why should we accept that a file couldn&#8217;t be included on go on ?<br />
* double quote to simple quote : php reads it faster because it doesn&#8217;t parse vars (&#8220;$&#8221; starting words).<br />
* no parenthesis to parenthesis : Well, it&#8217;s a method isn&#8217;t it ?
</div>
]]></content:encoded>
			<wfw:commentRss>http://florent.clairambault.fr/wp-codebox-fix-so-that-it-doesnt-prevent-posts-export/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
