<?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>Mostly Software Engineering &#187; Programming</title>
	<atom:link href="http://www.advansen.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.advansen.com</link>
	<description>Gabriel Gonzalez&#039;s notebook</description>
	<lastBuildDate>Thu, 22 Jul 2010 13:47:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python: POST XML over HTTP</title>
		<link>http://www.advansen.com/2010/07/22/python-post-xml-over-http/</link>
		<comments>http://www.advansen.com/2010/07/22/python-post-xml-over-http/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 13:46:26 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.advansen.com/?p=138</guid>
		<description><![CDATA[Short post to remind myself how to do HTTP requests using python, really easy stuff that I quickly forget.
Straight forward example using httplib and urllib from python. In the example I just perform some kind of login request retrieve the session id and then other request sending XML data using POST.
Code! Feel free to send [...]]]></description>
			<content:encoded><![CDATA[<p>Short post to remind myself how to do HTTP requests using python, really easy stuff that I quickly forget.</p>
<p>Straight forward example using httplib and urllib from python. In the example I just perform some kind of login request retrieve the session id and then other request sending XML data using POST.</p>
<p>Code! Feel free to send improvements</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">import</span> <span class="kw3">httplib</span>, <span class="kw3">urllib</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">import</span> <span class="kw3">re</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">params = <span class="kw3">urllib</span>.<span class="me1">urlencode</span><span class="br0">&#40;</span><span class="br0">&#123;</span><span class="st0">&#8216;q&#8217;</span>: <span class="st0">&#8216;login&#8217;</span>, <span class="st0">&#8216;email&#8217;</span>: <span class="st0">&#8216;juasjuas@lol.com&#8217;</span>, <span class="st0">&#8216;pwd&#8217;</span>: <span class="st0">&#8216;lala&#8217;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">conn = <span class="kw3">httplib</span>.<span class="me1">HTTPConnection</span><span class="br0">&#40;</span><span class="st0">&quot;my.lolizator.com:80&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">conn.<span class="me1">request</span><span class="br0">&#40;</span><span class="st0">&quot;GET&quot;</span>, <span class="st0">&quot;/cmd.php?&quot;</span>+params<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">response = conn.<span class="me1">getresponse</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">print</span> response.<span class="me1">status</span>, response.<span class="me1">reason</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#data = response.read()</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">#print data</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2">cookies = response.<span class="me1">getheader</span><span class="br0">&#40;</span><span class="st0">&quot;set-cookie&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">m = <span class="kw3">re</span>.<span class="me1">search</span><span class="br0">&#40;</span><span class="st0">&#8216;.*PHPSESSID=([a-zA-Z0-9]+);.*&#8217;</span>, cookies<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">session = m.<span class="me1">group</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">print</span> <span class="st0">&quot;session %s&quot;</span> % session</div>
</li>
<li class="li1">
<div class="de1">XML=<span class="st0">&#8216;&lt;tag1 name=&quot;testgroup&quot;&gt;&lt;tag2 id=&quot;12&quot; type=&quot;3&quot;&gt;&lt;tag3 id=&quot;1&quot;&gt;aaa&lt;/tag3&gt;&lt;/tag2&gt;&lt;/tag1&gt;&#8217;</span></div>
</li>
<li class="li2">
<div class="de2">params = <span class="kw3">urllib</span>.<span class="me1">urlencode</span><span class="br0">&#40;</span><span class="br0">&#123;</span><span class="st0">&#8216;q&#8217;</span>: <span class="st0">&#8217;set&#8217;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">headers = <span class="br0">&#123;</span> <span class="st0">&quot;Cookie&quot;</span>: <span class="st0">&quot;PHPSESSID=&quot;</span> + session, <span class="st0">&quot;Content-type&quot;</span>: <span class="st0">&quot;text/xml&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Content-Length&quot;</span>: <span class="st0">&quot;%d&quot;</span> % <span class="kw2">len</span><span class="br0">&#40;</span>XML<span class="br0">&#41;</span><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">conn.<span class="me1">request</span><span class="br0">&#40;</span><span class="st0">&quot;POST&quot;</span>, <span class="st0">&quot;/cmd.php?&quot;</span>+params, <span class="st0">&quot;&quot;</span>, headers<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">conn.<span class="me1">send</span><span class="br0">&#40;</span>XML<span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">response = conn.<span class="me1">getresponse</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">print</span> response.<span class="me1">status</span>, response.<span class="me1">reason</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">print</span> response.<span class="me1">read</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">conn.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2010/07/22/python-post-xml-over-http/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Internal Fragmentation: Python + Twitter</title>
		<link>http://www.advansen.com/2010/01/25/twitter-internal-fragmentation-python-twitter/</link>
		<comments>http://www.advansen.com/2010/01/25/twitter-internal-fragmentation-python-twitter/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 09:32:55 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[open source tools]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.advansen.com/?p=129</guid>
		<description><![CDATA[As a toy project to play a little bit more with Python and accessing Twitter, I came out with the idea of calculating the Internal Fragmentation of user&#8217;s tweet. 
To interface with Twitter services I used the Twitter extension located at http://code.google.com/p/python-twitter/, which has a pretty straightforward API.
The script shown below gives you back what [...]]]></description>
			<content:encoded><![CDATA[<p>As a toy project to play a little bit more with <strong>Python </strong>and accessing <strong>Twitter</strong>, I came out with the idea of calculating the <a href="http://en.wikipedia.org/wiki/Fragmentation_(computer)">Internal Fragmentation</a> of user&#8217;s tweet. </p>
<p>To interface with Twitter services I used the <a href="http://code.google.com/p/python-twitter/">Twitter extension</a> located at <a href="http://code.google.com/p/python-twitter/">http://code.google.com/p/python-twitter/</a>, which has a pretty straightforward API.</p>
<p>The script shown below gives you back what average percentage of your last 20 tweets have been wasted.</p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">import</span> &nbsp;twitter</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">import</span> &nbsp;<span class="kw3">sys</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">if</span> <span class="kw2">len</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#41;</span> != <span class="nu0">2</span>:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">print</span> &nbsp; <span class="st0">&quot;Provide a Twitter Username as Argument&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; exit<span class="br0">&#40;</span><span class="nu0">-1</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">api = twitter.<span class="me1">Api</span><span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li2">
<div class="de2">st = api.<span class="me1">GetUserTimeline</span><span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">sum</span> = <span class="nu0">0.0</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">for</span> s <span class="kw1">in</span> st:</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">sum</span> += <span class="br0">&#40;</span><span class="nu0">140.0</span> &#8211; <span class="kw2">len</span><span class="br0">&#40;</span>s.<span class="me1">text</span>.<span class="me1">encode</span><span class="br0">&#40;</span><span class="st0">&quot;utf-8&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>/<span class="nu0">140.0</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li2">
<div class="de2"><span class="kw1">print</span> <span class="st0">&quot;%s internal fragmentation is %.2f%s&quot;</span> % <span class="br0">&#40;</span><span class="kw3">sys</span>.<span class="me1">argv</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>, <span class="kw2">round</span><span class="br0">&#40;</span><span class="kw2">sum</span> / <span class="kw2">len</span><span class="br0">&#40;</span>st<span class="br0">&#41;</span> * <span class="nu0">100</span>, <span class="nu0">2</span><span class="br0">&#41;</span>, <span class="st0">&quot;%&quot;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>And now some results:<br />
<code><br />
$ python twinternal.py GabrielGonzalez<br />
GabrielGonzalez internal fragmentation is 39.89%<br />
$ python twinternal.py 48bits<br />
48bits internal fragmentation is 36.79%<br />
$ python twinternal.py reversemode<br />
reversemode internal fragmentation is 38.72%<br />
$ python twinternal.py aramosf<br />
aramosf internal fragmentation is 32.41%<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2010/01/25/twitter-internal-fragmentation-python-twitter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating an Installer Using NSIS (I)</title>
		<link>http://www.advansen.com/2009/09/01/creating-an-installer-using-nsis-i/</link>
		<comments>http://www.advansen.com/2009/09/01/creating-an-installer-using-nsis-i/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 09:00:26 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[NSIS]]></category>
		<category><![CDATA[open source tools]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.advansen.com/?p=85</guid>
		<description><![CDATA[Last week I faced a new problem, I had to program a installer for Windows in order to deploy some software we have produced at work. After a quick googling I found NSIS an installer generator, open source and with a simple scripting language.
NSIS comes with a compiler which parses the sentences writting in its [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I faced a new problem, I had to program a <strong><em>installer for Windows</em></strong> in order to deploy some software we have produced at work. After a quick googling I found <a href="http://nsis.sourceforge.net/Main_Page"><strong><em>NSIS</em></strong></a><strong><em> </em></strong>an installer generator, <strong><em>open source</em></strong> and with a simple scripting language.</p>
<p><em><strong>NSIS </strong></em>comes with a compiler which parses the sentences writting in its own language and produces a pretty decent installer. It also has a <a href="http://nsis.sourceforge.net/NSIS_2">look-and-feeling similar to latets Windows versions</a>, so it was the perfect choice!</p>
<p>The scripting language is really simple, we can generate a simple installer with only the next few lines:</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">outFile &#8220;installer.exe&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">installDir $DESKTOP</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">section</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>userInfo::getAccountType</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>pop $0</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>strCmp $0 &#8220;Admin&#8221; +3</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>messageBox MB_OK &#8220;not admin: $0&#8243;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>return</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>messageBox MB_OK &#8220;is admin&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>setOutPath $INSTDIR</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>file test.txt</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>writeUninstaller $INSTDIR\uninstaller.exe</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>createShortCut &#8220;$SMPROGRAMS\new oxtias.lnk&#8221; &#8220;$INSTDIR\uninstaller.exe&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">sectionEnd</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">section &#8220;Uninstall&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>delete $INSTDIR\uninstaller.exe</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>delete $INSTDIR\test.txt</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>delete &#8220;$SMPROGRAMS\new oxtias.lnk&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">sectionEnd</div>
<blockquote><p>OutFile &#8220;simpleAdvansenInstaller.exe&#8221;</p>
<p>InstallDir $DESKTOP</p>
<p>Section</p>
<p><span style="white-space:pre"> </span>SetOutPath $INSTDIR</p>
<p><span style="white-space:pre"> </span>WriteUninstaller $INSTDIR\uninstaller.exe</p>
<p><span style="white-space:pre"> </span>CreateShortCut &#8220;$SMPROGRAMS\simpleAdvansen.lnk&#8221; &#8220;$INSTDIR\uninstaller.exe&#8221;</p>
<p>SectionEnd</p>
<p>Section &#8220;Uninstall&#8221;</p>
<p><span style="white-space:pre"> </span>Delete $INSTDIR\uninstaller.exe</p>
<p><span style="white-space:pre"> </span>Delete $INSTDIR\test.txt</p>
<p><span style="white-space:pre"> </span>Delete &#8220;$SMPROGRAMS\simpleAdvansen.lnk&#8221;</p>
<p>SectionEnd</p></blockquote>
<p>After compiling the script with the tool NSIS package&#8217;s comes with, two executables are generated:</p>
<blockquote><p>simpleAdvansenInstaller.exe</p></blockquote>
<p>Which will copy the uninstaller.exe to the Installation Dir set up to the Desktop and will add an entry in the Programs Menu for the uninstaller.</p>
<blockquote><p>uninstaller.exe</p></blockquote>
<p>Will delete itself and remove the entry in the Programs Menu.</p>
<p>NOTE: NotePad++ highlights the syntax of <em><strong>NSIS </strong></em>as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2009/09/01/creating-an-installer-using-nsis-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Glueing applications with Python</title>
		<link>http://www.advansen.com/2009/08/27/glueing-applications-with-python/</link>
		<comments>http://www.advansen.com/2009/08/27/glueing-applications-with-python/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 12:54:44 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/?p=82</guid>
		<description><![CDATA[The problem I faced was the following:

Two processes I have to communicate with in order to validate data using stdin/stdout
No source code of this programs
Windows Platform

Since I am a UNIX guy I haven&#8217;t ever done anything advanced in Windows so I didn&#8217;t have the time to learn how to achive this in Windows as I [...]]]></description>
			<content:encoded><![CDATA[<p>The problem I faced was the following:</p>
<ul>
<li>Two processes I have to communicate with in order to validate data using stdin/stdout</li>
<li>No source code of this programs</li>
<li>Windows Platform</li>
</ul>
<p>Since I am a UNIX guy I haven&#8217;t ever done anything advanced in Windows so I didn&#8217;t have the time to learn how to achive this in Windows as I would have done in any other Unix. Obviously I downloaded Mingw and I tried to used the proper POSIX functions but it didn&#8217;t work.</p>
<p>Now is when Python comes into play. It is an <em>&#8220;easy to learn&#8221;</em> (at sometime I will be discussing this topic) scripting language with a pretty well support in Windows platform, at some point this support seemed better than perl&#8217;s one so I chose Python.</p>
<p>After googling for 2 minutes about basic Python syntax and looking for function descriptions I came up with the solution, which was really straightforward and worked super-duper.</p>
<blockquote><p>import subprocess</p>
<p>program = subprocess.Popen(['C:\path\to\program.exe, arg1, argn'], shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE);</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 105px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>ret = check_ad.communicate(username + &#8221; &#8221; + group[0])</div>
<p>ret = program.communicate(&#8220;writing to stdin&#8221;);</p>
<p>print ret</p>
<p><em>Read from stdout</em></p></blockquote>
<p>Really easy and simple code that can save someones life when working under pressure and do not have time to read a dozen of C/C++ examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2009/08/27/glueing-applications-with-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Classifying Bugs!</title>
		<link>http://www.advansen.com/2006/10/15/classifying-bugs/</link>
		<comments>http://www.advansen.com/2006/10/15/classifying-bugs/#comments</comments>
		<pubDate>Sun, 15 Oct 2006 15:26:50 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[Computer Security]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/2006/10/15/classifying-bugs/</guid>
		<description><![CDATA[I have just published a new paper under the &#8220;Good Coding Practices&#8221; section, which I think can be useful for someone else.
In this article I classify the bugs depending where in the life cycle of development they can be produced. This would be helpful to reduce the bugs which can be produced in the softwae [...]]]></description>
			<content:encoded><![CDATA[<p>I have just published a new paper under the &#8220;<a href="http://www.advansen.com/projects/good-coding-practices/">Good Coding Practices</a>&#8221; section, which I think can be useful for someone else.</p>
<p>In this article I classify the bugs depending where in the life cycle of development they can be produced. This would be helpful to reduce the bugs which can be produced in the softwae development and will help if any bug appears since we know, just with its behaviour, where in the life cycle was produce. Therefore we will be able to react sooner and fix it in less time.</p>
<p>This is the base of comming papers about building secure software systems from a software engineering point of view.</p>
<p>Besied the <a href="http://www.advansen.com/staff/gabriel/papers/Classifying_Your_Bugs.pdf">PDF</a>  and <a href="http://www.advansen.com/staff/gabriel/papers/Classifying_Your_Bugs.html">HTML</a> versions I always provide this time I have the <a href="http://docs.google.com/View?docid=dgrmqhpp_4fpmjpv">Google</a> version as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2006/10/15/classifying-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Integration</title>
		<link>http://www.advansen.com/2006/10/04/continuous-integration/</link>
		<comments>http://www.advansen.com/2006/10/04/continuous-integration/#comments</comments>
		<pubDate>Wed, 04 Oct 2006 17:07:40 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/2006/10/04/continuous-integration/</guid>
		<description><![CDATA[This is quick review of the article written by Martin Fowler about Continuous Integration, which basically explains that you should use a control version system and commit and build every day.
I only find, the advice regarding the periodicity of the commits and builds, not right at all since I think it would much better building [...]]]></description>
			<content:encoded><![CDATA[<p>This is quick review of the article written by <a target="_blank" href="http://www.martinfowler.com/articles/continuousIntegration.html">Martin Fowler</a> about Continuous Integration, which basically explains that you should use a control version system and commit and build every day.</p>
<p>I only find, the advice regarding the periodicity of the commits and builds, not right at all since I think it would much better building a few times a day rather than a build per commit.</p>
<p>So I propose a fixed building times spread over the working hours which, as I explain in the paper, leads to an improvement of the productivity while keeps the developers happy, which I think is a must for all the project managers.</p>
<p>You can find the article in the <a href="http://www.advansen.com/projects/good-coding-practices/">Good Coding Practices</a> section or get the pdf just <a href="http://www.advansen.com/staff/gabriel/papers/Continuous_Integration_Rev.pdf">here</a>.</p>
<p><strong>UPDATE: </strong><a href="http://www.advansen.com/staff/gabriel/papers/Continuous_Integration_Rev.html">HTML version</a> available!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2006/10/04/continuous-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Audio Show!!</title>
		<link>http://www.advansen.com/2006/09/29/first-audio-show/</link>
		<comments>http://www.advansen.com/2006/09/29/first-audio-show/#comments</comments>
		<pubDate>Fri, 29 Sep 2006 08:42:28 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/2006/09/29/first-audio-show/</guid>
		<description><![CDATA[Hi there, here is my very first Audio Show called &#8220;NITS&#8221; (Nothing Interesting To Say). Apologizes for my very bad speaking English but I haven&#8217;t been able to improve it as much as the written one.
The goal of this show is chat with someone about the computer related stuff I am working on, maybe I [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there,<a href="http://www.advansen.com/staff/gabriel/NITS/NITS_I.mp3"> here</a> is my very first Audio Show called &#8220;NITS&#8221; (Nothing Interesting To Say). Apologizes for my very bad speaking English but I haven&#8217;t been able to improve it as much as the written one.</p>
<p>The goal of this show is chat with someone about the computer related stuff I am working on, maybe I haven&#8217;t done my best this first time but I will keep on improving so stay tuned for the second show!</p>
<p>This I have talked:</p>
<p>- Aspect Oriented Programming</p>
<p>- Generative Programming</p>
<p>- Bluetooth Projects</p>
<p>PS: I think I haven&#8217;t spoken very much about technical stuff just a few general ideas really so I will focus on it a little more  <img src='http://www.advansen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2006/09/29/first-audio-show/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://www.advansen.com/staff/gabriel/NITS/NITS_I.mp3" length="7150150" type="audio/mpeg" />
		</item>
		<item>
		<title>GALD &amp; Programming and Design by Contract</title>
		<link>http://www.advansen.com/2006/08/14/gald-programming-and-design-by-contract/</link>
		<comments>http://www.advansen.com/2006/08/14/gald-programming-and-design-by-contract/#comments</comments>
		<pubDate>Mon, 14 Aug 2006 13:41:14 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/2006/08/14/gald-programming-and-design-by-contract/</guid>
		<description><![CDATA[Now GALD can be used to implement design by contract techniques. With just including a header and enabled the &#8220;By Contract&#8221; feature from the C preprocesor you will be able to enable pre/post conditions checks, completely written in straight forward C code, to your modules public interfaces.
Soon I will release a new version of GALD [...]]]></description>
			<content:encoded><![CDATA[<p>Now <a href="https://sourceforge.net/projects/gald">GALD</a> can be used to implement design by contract techniques. With just including a header and enabled the &#8220;By Contract&#8221; feature from the C preprocesor you will be able to enable pre/post conditions checks, completely written in straight forward C code, to your modules public interfaces.</p>
<p>Soon I will release a new version of <a href="https://sourceforge.net/projects/gald">GALD</a> with just a short manual to help using this new and very HELPFUL features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2006/08/14/gald-programming-and-design-by-contract/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>GALD now at SourceForge</title>
		<link>http://www.advansen.com/2006/08/02/gald-now-at-sourceforge/</link>
		<comments>http://www.advansen.com/2006/08/02/gald-now-at-sourceforge/#comments</comments>
		<pubDate>Wed, 02 Aug 2006 08:39:03 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/2006/08/02/gald-now-at-sourceforge/</guid>
		<description><![CDATA[I have created a project in Sourceforge to improve the development cycle of GALD as well as making easier to those interested on it to track updates and even collaborate with the project. GALD will not be longer updated in this server.
I still need to create a mini webpage for it but as some of [...]]]></description>
			<content:encoded><![CDATA[<p>I have created a <a href="https://sourceforge.net/projects/gald">project in Sourceforge</a> to improve the development cycle of GALD as well as making easier to those interested on it to track updates and even collaborate with the project. GALD will not be longer updated in this server.<br />
I still need to create a mini webpage for it but as some of you know I am not any good in the web world so it will be delayed for a few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2006/08/02/gald-now-at-sourceforge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple but yet powerful Memory Leakage Detection System GALD</title>
		<link>http://www.advansen.com/2006/07/18/simple-but-yet-powerful-memory-leakage-detection-system-gald/</link>
		<comments>http://www.advansen.com/2006/07/18/simple-but-yet-powerful-memory-leakage-detection-system-gald/#comments</comments>
		<pubDate>Tue, 18 Jul 2006 13:17:48 +0000</pubDate>
		<dc:creator>Gabriel Gonzalez</dc:creator>
				<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.advansen.com/2006/07/18/simple-but-yet-powerful-memory-leakage-detection-system-gald/</guid>
		<description><![CDATA[I have just released a simple tool, called GALD, which will make our life as developers easier since it allows you to detect the line where the memory problem is.
The good thing is you don&#8217;t need to replace the standard malloc(), calloc(), realloc() or free() functions since a macro subsystem will address link these to [...]]]></description>
			<content:encoded><![CDATA[<p>I have just released a simple tool, called <a href="http://www.advansen.com/projects/good-coding-practices/">GALD</a>, which will make our life as developers easier since it allows you to detect the line where the memory problem is.</p>
<p>The good thing is you don&#8217;t need to replace the standard malloc(), calloc(), realloc() or free() functions since a macro subsystem will address link these to the GALD&#8217;s functions.</p>
<p>You just need to #include <GALD/GALD.h> and run the application to check if you missed something while coding.</p>
<p>I look forward to hearing from you with desired improvents or any other comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.advansen.com/2006/07/18/simple-but-yet-powerful-memory-leakage-detection-system-gald/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>
