<?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>coder . cl &#187; c</title>
	<atom:link href="http://coder.cl/category/programming/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://coder.cl</link>
	<description>web developer &#38; system programmer</description>
	<lastBuildDate>Tue, 15 May 2012 10:46:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>what is thread-safe?</title>
		<link>http://coder.cl/2011/11/what-is-thread-safe/</link>
		<comments>http://coder.cl/2011/11/what-is-thread-safe/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 20:51:11 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=2044</guid>
		<description><![CDATA[What is thread-safe?. Thread-safe implies that for a given resource it will not be used at the same time by two or more threads or processes. By resource, we must understand a memory block or similar kind of resources. If you create a list that is shared between threads to store data, you will need [...]]]></description>
			<content:encoded><![CDATA[<p>What is thread-safe?. Thread-safe implies that for a given resource it will not be used at the same time by two or more threads or processes. By resource, we must understand a memory block or similar kind of resources. If you create a list that is shared between threads to store data, you will need a way to write that list &mdash; appending nodes or removing nodes &mdash; without writing it simultaneously. This implies the usage of thread-safety techniques that will bring you sequential access to the list allowing sequential writes, instead concurrent writes that will probably crash your application.</p>
<p><span id="more-2044"></span></p>
<p>There are various kinds of techniques that can be used to create thread-safe algorithms and data structures. The are two main classes called <i>blocking algorithms</i> and <i>non-blocking algorithms</i>. On a blocking algorithm, locks are used to encapsulate fragments of code where you must not do concurrent writes to avoid racing conditions, where that fragment is called <i>critical section</i>. On non-blocking algorithms, you do not use locks, instead you use atomic operations to switch between the used resources, for example using a technique called <i>compare and swap</i> or <i>CAS</i>.</p>
<p>A racing condition, is an event that occurs when two or more threads are accessing the same resource at the same time, leading to data corruption or system faults. The most classic lock techniques in Java and C, are the <tt>synchronized</tt> keyword on Java and <tt>pthread_mutex_lock()</tt> call in C. On Java we protect our critical section using <tt>synchronized</tt> as follows.</p>
<pre class="brush: java;">
class SingletonSampleImpl extends Object {  

    private static Object singletonMutex = new Object();
    private static SingletonSampleImpl instance = null;  

    public static SingletonSampleImpl getInstance() {
        synchronized (singletonMutex) {
            /* when we instantiate the singleton
               we have a critical section to protect
               from racing conditions */
            if (instance == null) {
                instance = new SingletonSampleImpl();
            }
        }
        return instance;
    }
}
</pre>
<p>The <tt>singletonMutex</tt> object acts as <i>mutex</i>, where a mutex &mdash; term that comes from <i>mutual exclusion</i> &mdash; has a flag that indicates to the other threads if it is blocked or not to jump into the critical section and execute the code. So, a mutex or semaphore is a mere <i>flag</i> that indicates to the program if the resource is busy or not. Using locks or blocking-algorithms is expensive on most systems, depending on how are they used. For example is very expensive to use a blocking algorithm to protect a socket, where it must <i>wait</i> its chance to be written by other threads, with inherent network time wait.</p>
<p>On the non-blocking side, we have three types of algorithms: <i>wait-free</i>, <i>lock-free</i> and <i>obstruction-free</i>. Where wait free is the strongest technique, but the hardest to handle, because once you implement it you have an algorithm that do not <i>waits</i> for writing or reading. Lock-free usually uses CAS, so it using a compare and swap operation to ensure that the critical section is protected, without locking. Obstruction-free uses locking, but a different one called live-locking.</p>
<p>The atomic operations used on the non-blocking techniques usually are operating on a very low level of the processor, because they must executed without the interference of any other threads. For example to work with atomic operations using the GCC compiler we have some <a href='http://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Atomic-Builtins.html' title='Built-in functions for atomic memory access'>special extensions to work with them</a>.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2011. |
<a href="http://coder.cl/2011/11/what-is-thread-safe/">Permalink</a> |
<a href="http://coder.cl/2011/11/what-is-thread-safe/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2011/11/what-is-thread-safe/&title=what is thread-safe?">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2011/11/what-is-thread-safe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>static analysis on c source</title>
		<link>http://coder.cl/2011/08/static-analysis-on-c-source/</link>
		<comments>http://coder.cl/2011/08/static-analysis-on-c-source/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 11:41:17 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=1758</guid>
		<description><![CDATA[Static analysis is cool, you can find bugs without running your programs or without debugging your programs, doing source code analysis with automated tools that analyzes your code execution path, variables and behaviour doing a static interpretation of your code. The resulting reports of static analysis can guide you to construct better code and correct [...]]]></description>
			<content:encoded><![CDATA[<p>Static analysis is cool, you can find bugs without running your programs or without debugging your programs, doing source code analysis with automated tools that analyzes your code execution path, variables and behaviour doing a static interpretation of your code. The resulting reports of static analysis can guide you to construct better code and correct a wide variety of errors on early stages of your program development, including hardening tasks, creating better programs with early corrections. There are various tools that can check your C source code and make your C programming tasks easier to handle.</p>
<p><span id="more-1758"></span></p>
<blockquote><p>
The sophistication of the analysis performed by tools varies from those that only consider the behaviour of individual statements and declarations, to those that include the complete source code of a program in their analysis. Uses of the information obtained from the analysis vary from highlighting possible coding errors (e.g., the lint tool) to formal methods that mathematically prove properties about a given program (e.g., its behaviour matches that of its specification) [<a href='http://en.wikipedia.org/wiki/Static_program_analysis' title='Static program analysis'>Static program analysis, Wikipedia</a>].
</p></blockquote>
<p>I&#8217;ve created a very simple Python script that wraps the execution of various of those tools to analyze C source code, grouping the execution of <a href='http://www.splint.org/' title='Annotation-Assisted Lightweight Static Checking'>splint static analyzer</a>, <a href='http://en.wikipedia.org/wiki/TenDRA_Compiler' title='TenDRA'>TenDRA static checker</a> and <a href='http://cppcheck.sourceforge.net/' title='cppcheck static checker'>cppcheck static checker</a>. Those tools will allow you to verify your C source code using static analysis, and will allow you to find bugs in your C source code finding patterns of well known programming errors. Along the time, with practice, you will not write the same errors twice, and if you use those tools, you will enhance your programming habits by doing better code, with the assistance of those tools, for example using uninitiated variables or unchecked variables will not be a problem for you.</p>
<p>The tool <i>cppcheck</i> do not requires configuration, you just need to run it using a small set of flags, usually <tt>cppcheck --enable style --enable information --enable unusedFunction</tt>, so you do not require to create a configuration file and those tests made by cppcheck are very lightweight. The TenDRA compile just checks for standard conformance, and common flags in TenDRA are like <tt>tchk -Xs -Yxpg4 -Yposix</tt>. Among those three tools, the most complex one is splint, since it is a guided static analyzer, which uses comments to guide the static analyzer on program analysis. It requires a configuration file, that is called <tt>.splintrc</tt> and should be placed in your <tt>$HOME</tt> directory. My <tt>.splintrc</tt> configuration file is as follows:</p>
<pre class="brush: bash;">
##
## .splintrc example file
##

+strict
+matchanyintegral
+trytorecover
+unixlib
-sysdirerrors
-syntax

-bugslimit 50
-sysdirs /usr:/usr/include:/usr/local/include:/usr/include/bits
-DHAVE_CONFIG=1
-DHAVE_CONFIG_H=1
-DNDEBUG=1
-I/usr/include
-I/usr/local/include
-I/opt/include
-I./include
-I../include
-I.
-I..
</pre>
<p>That is a very basic configuration, but is almost complete to allow you to check your C source code. You will find <i>splint</i> reporting errors that your compiler will not display, for example if you are using GCC and your compiler flags are strict, like <tt>-Wall -Wextra -Wshadow -pedantic -std=c99</tt> or <tt>-Wall -Wextra -Wshadow -pedantic -std=c90</tt>, will not report the same errors than splint does. You will find splint as a very strict tool to check your source code, displaying well known bugs, but not all reports should be handled as real, you must think on those errors that really have a real significance.</p>
<p>You can find the bugbuster.py script that I&#8217;ve wrote to use all those tools in one command from Emacs, by running the Emacs <tt>compile</tt> command on its web page <a href='http://coder.cl/products/bugbuster-py/' title='bugbuster.py'>here</a>, and the source code repository to contribute or download the script is located on <a href='https://github.com/dmw/bugbuster' title='bugbuster repository'>github.com here</a>. Enjoy enhancing your source code.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2011. |
<a href="http://coder.cl/2011/08/static-analysis-on-c-source/">Permalink</a> |
<a href="http://coder.cl/2011/08/static-analysis-on-c-source/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2011/08/static-analysis-on-c-source/&title=static analysis on c source">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2011/08/static-analysis-on-c-source/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[ann] pyxser-1.5.2-r2.win32 was released</title>
		<link>http://coder.cl/2011/03/ann-pyxser-1-5-2-r2-win32-was-released/</link>
		<comments>http://coder.cl/2011/03/ann-pyxser-1-5-2-r2-win32-was-released/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 17:55:47 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=1397</guid>
		<description><![CDATA[Dear pyxser users, I&#8217;m pleased to announce that I have released pyxser-1.5.2r-r2.win32. This is the same release as 1.5.2-r2, but for Win32 platform. It does not add new features or similar stuff, it&#8217;s just a compiled binary distribution for Windows machines. You can download this release build for Python 2.7 and Win32 machines on SourceForge. [...]]]></description>
			<content:encoded><![CDATA[<p>Dear <a href="http://coder.cl/products/pyxser/">pyxser</a> users, I&#8217;m pleased to announce that I have released <b>pyxser-1.5.2r-r2.win32</b>. This is the same release as 1.5.2-r2, but for Win32 platform. It does not add new features or similar stuff, it&#8217;s just a compiled binary distribution for Windows machines. You can download this release build for Python 2.7 and Win32 machines on SourceForge. Please follow the following link to download the <a href='https://sourceforge.net/projects/pyxser/files/pyxser-1.5.2-r2/'>pyxser-1.5.2-r2.win32</a> package. It uses the Windows Installer and it&#8217;s an executable. You just need to download an official Python 2.7 distribution to use this release.</p>
<p><span id="more-1397"></span></p>
<p>Some notes on performance. Windows has a very poor performance compared to Linux and FreeBSD platforms. Please check the following plot that compares the performance on Windows, Linux and FreeBSD:</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2011/03/profile-1.5.2.png?v=4.0' title='Compare pyxser-1.5.2 on Windows, Linux and FreeBSD'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2011/03/profile-1.5.2.png?v=4.0' alt='Compare pyxser-1.5.2 on Windows, Linux and FreeBSD' border='0' /></a></p>
<div>Compare pyxser-1.5.2 on Windows, Linux and FreeBSD</div>
</div>
<p>The performance on Windows is very poor. The effort required to migrate the source from POSIX platforms to Windows platforms is minimum. The difference the major effort was made on porting the setup script. My code is almost standard and it requires a C99 compiler, and usually I use the flags <tt>-Wall -Wextra -Wshadow -pedantic -std=c99</tt> to compile my sources, so I&#8217;m using very strict dialect. Seems that the Windows C compiler is C90 by default. No way to deal with the Windows compiler for some C keywords. I&#8217;m expecting to bring constant support for Win32 platform on future releases. I will be waiting your feedback :)</p>
<p>Some notes on the FreeBSD install, is the fact that it is a standard distribution, without kernel optimization and it is using distribution binaries &mdash; that means that everything is made for 80&#215;386 machines &mdash; and also it does not have any compiler optimization. Also, is well known that FreeBSD default binaries are slow, mainly because it lacks kernel optimization and standard C library optimizations. The libxml2 port on FreeBSD seems to be the problem, since it is not using the jemalloc library, and it is using the internal libxml2 memory allocator.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2011. |
<a href="http://coder.cl/2011/03/ann-pyxser-1-5-2-r2-win32-was-released/">Permalink</a> |
<a href="http://coder.cl/2011/03/ann-pyxser-1-5-2-r2-win32-was-released/#comments">One comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2011/03/ann-pyxser-1-5-2-r2-win32-was-released/&title=[ann] pyxser-1.5.2-r2.win32 was released">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2011/03/ann-pyxser-1-5-2-r2-win32-was-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[ann] pyxser-1.5.1r was released</title>
		<link>http://coder.cl/2010/10/ann-pyxser-1-5-1r-was-released/</link>
		<comments>http://coder.cl/2010/10/ann-pyxser-1-5-1r-was-released/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 16:25:47 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=980</guid>
		<description><![CDATA[Dear pyxser users, I&#8217;m pleased to announce that I&#8217;ve released pyxser-1.5.1r. This release includes a new argument for deserialization functions, so you can skip the initialization construct by using cinit = False as argument, this improves performance, but leaves uninitiated objects, without calling its default constructor. The ChangeLog for this release is as follows: 1.5.1r [...]]]></description>
			<content:encoded><![CDATA[<p>Dear <a href="http://coder.cl/products/pyxser/"><strong>pyxser</strong></a> users, I&#8217;m pleased to announce that I&#8217;ve released <b>pyxser-1.5.1r</b>. This release includes a new argument for deserialization functions, so you can skip the initialization construct by using <tt>cinit = False</tt> as argument, this improves performance, but leaves uninitiated objects, without calling its default constructor.</p>
<p><span id="more-980"></span></p>
<p>The <i>ChangeLog</i> for this release is as follows:</p>
<pre>
1.5.1r (2010.10.11):

        Daniel Molina Wegener &lt;dmw@coder.cl&gt;

        * On all files: algorithms were optimized, the code
        was flattened applying "The Zen of Python" and the
        performance was enhanced in 10%.

        * Was added the cinit argument to deserialization
        functions, which control whether or not, the default
        constructor is called, instead of creating a raw
        instance of deserialized objects.

        Thanks to pyxser users for their feedback.
</pre>
<p>The <tt>cinit = False</tt> argument makes <strong>pyxser</strong> to skip the default constructor, calling <tt>PyInstance_NewRaw()</tt> instead of the default constructor. This skips the initialization code on the <tt>__init__()</tt> method. The impact on the performance &mdash; if your objects do not require of the default constructor &mdash; is as follows:</p>
<div class="figure">
<a href="http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/10/profile-1.5.1-cinit.svg" target="_blank"><img src="http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/10/profile-1.5.1-cinit.png" border="0" /></a>
</div>
<p>This enhancement is minimal, but saves time when you work with very simple objects. To take a look on the documentation, the <strong>pyxser</strong> extension is self documented, so you just need to call <tt>pydoc -p8181</tt>, connect your browser to <i>http://localhost:8181/</i> and search for the pyxser extension documentation.</p>
<p>I hope that you will enjoy this release :D</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/10/ann-pyxser-1-5-1r-was-released/">Permalink</a> |
<a href="http://coder.cl/2010/10/ann-pyxser-1-5-1r-was-released/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/10/ann-pyxser-1-5-1r-was-released/&title=[ann] pyxser-1.5.1r was released">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/10/ann-pyxser-1-5-1r-was-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ann] pyxser-1.5r is available</title>
		<link>http://coder.cl/2010/08/ann-pyxser-1-5r-available/</link>
		<comments>http://coder.cl/2010/08/ann-pyxser-1-5r-available/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 00:26:59 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=892</guid>
		<description><![CDATA[Dear pyxser users, I&#8217;m pleased to announce that I&#8217;ve released pyxser-1.5r. This release has several bug fixes plus enhancements. pyxser now is 15% faster and do not have memory leaks. For people who do know pyxser, it is a Python Object to XML serializer and deserializer. You install pyxser, and you will have functions to [...]]]></description>
			<content:encoded><![CDATA[<p>Dear <a href="http://coder.cl/products/pyxser/">pyxser</a> users, I&#8217;m pleased to announce that I&#8217;ve released <b>pyxser-1.5r</b>. This release has several bug fixes plus enhancements. <strong>pyxser</strong> now is <i>15%</i> faster and do not have memory leaks. For people who do know <strong>pyxser</strong>, it is a <i>Python Object</i> to <i>XML</i> serializer and deserializer. You install pyxser, and you will have functions to convert Python Objects into XML and viceversa, convert that XML back into a <i>Python Object</i>.</p>
<p><span id="more-892"></span></p>
<p>This release is quite special, I&#8217;ve added lazy initialization of some resources, so it runs <i>15%</i> faster, and I&#8217;ve removed all memory leaks, so it just keeps using about <i>65MB</i> of RAM when is doing the <i>1,500,000.00</i> serialization and deserialization test. I&#8217;ve spent more time coding <strong>pyxser</strong> for this release. Just comparing the performance between the older release <i>1.4.6r</i> &mdash; a buggy release &mdash; with the current release <i>1.5r</i> we can see the performance enhancement as follows:</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-trunk-1.5r.svg?ver=2.0' target='_blank'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-trunk-1.5r.png?ver=2.0' border='0' /></a>
</div>
<p>The memory usage was reduced, on what <i>object creation</i> refers, but not on certain tasks &mdash; remember that now I&#8217;m using lazy initialization for some resources &mdash; and we can see a very similar to previous releases plot on how the memory is handled:</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-memory-1.5r.svg?ver=2.0' target='_blank'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-memory-1.5r.png?ver=2.0' border='0' /></a>
</div>
<p>The <i>memoization</i> has suffered some important changes. Now it uses <a href='http://docs.python.org/c-api/object.html#PyObject_Hash'>PyObject_Hash()</a> as object identification method. It&#8217;s qute slower than past revisions, but still it works faster using lazy initializations. Another important change made to the serialization algorithm, is the fact that now it is skipping <i>callable</i> objects, so function will not be serialized on any manner.</p>
<p>On the distribution now you will find on the <tt>test</tt> <del>folder</del> directory, some interesting tests, such as <i>utf-16</i> encoding test and <i>ascii</i> encoding test. All serializations now are using the Python embeded <i>Unicode</i> codecs for deserialization, that is not the case for serialization, it is using the <i>LibXML2</i> codec, so it can handle more encodings.</p>
<p>I must strongly thank to <strong>pyxser</strong> users for their feedback.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/08/ann-pyxser-1-5r-available/">Permalink</a> |
<a href="http://coder.cl/2010/08/ann-pyxser-1-5r-available/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/08/ann-pyxser-1-5r-available/&title=[ann] pyxser-1.5r is available">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/08/ann-pyxser-1-5r-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pyxser profiling</title>
		<link>http://coder.cl/2010/08/pyxser-profiling/</link>
		<comments>http://coder.cl/2010/08/pyxser-profiling/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 20:34:01 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=789</guid>
		<description><![CDATA[Today I was enhancing pyxser, and I&#8217;ve reduced some memory usage and enhanced its performance. I&#8217;ve reduced some functions to use less instructions and gained a little bit of better performance. But seems that still is using a large amount of dictionaries. or leaving them in memory until the test is finished. Also, I&#8217;ve modified [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was enhancing <a href='http://coder.cl/products/pyxser/'><strong>pyxser</strong></a>, and I&#8217;ve reduced some memory usage and enhanced its performance. I&#8217;ve reduced some functions to use less instructions and gained a little bit of better performance. But seems that still is using a large amount of dictionaries. or leaving them in memory until the test is finished. Also, I&#8217;ve modified the profiling script, to run 1000 times each function. The enhancements looks promising&#8230;</p>
<p><span id="more-789"></span></p>
<p><br/></p>
<h3>memory profiling</h3>
<p>On the profiling script, the only remaining reference to constructed objects. Some interesting notes about the memory profiling task, is that the most allocated object type is <i>str</i> with 278 allocations, and is using the <i>47%</i> with <i>10384</i> bytes, but the heaviest object is <i>dictionary</i> with 79 allocations, the <i>13%</i> and <i>457720</i> bytes. I&#8217;ve tested <strong>pyxser</strong> using valgrind without any kind of true report of memory leaks.</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-memory.svg?ver=2.0'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-memory.png?ver=2.0' border='0' alt='pyxser memory profiling' /></a>
</div>
<p>Also, in the pyxser distribution, you can find the <tt>test-utf8-leak.py</tt> script, which executes serialization and deserialization functions up to <i>1000000</i> times, leaving python executable just using a small portion of the operating system memory, and certainly you will notice that <strong>pyxser</strong> maintains its memory usage along that test.</p>
<p><br/></p>
<h3>speed tests</h3>
<p>Speed tests are going fine, I&#8217;ve reduced a small amount of the used by the serialized and created a new test that executes each pyxser function 1000 times. The result can be seen as follows:</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-trunk.svg?ver=2.2'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-trunk.png?ver=2.2' border='0' alt='pyxser memory profiling' /></a>
</div>
<p>Deserialization functions are the slowest ones, requiring almost the double time that serialization takes, but thinking a little, you will notice that the XML parsing process is slower than Python object tree traversal. Some functions, like <tt>getdtd()</tt> and <tt>getdtdc14n()</tt> practically do not require time to being executed, since both DTDs are pre-allocated on module loading, the same applies to pyxser XML schemas. I think that I will reduce the execution and load time along the time, since pyxser has reached a good maturity level, without memory leaks and well structured tests, for different kinds of objects &mdash; as any lazy resource initialization.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/08/pyxser-profiling/">Permalink</a> |
<a href="http://coder.cl/2010/08/pyxser-profiling/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/08/pyxser-profiling/&title=pyxser profiling">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/08/pyxser-profiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ann] pyxser-1.4.6r released</title>
		<link>http://coder.cl/2010/08/ann-pyxser-1-4-6r-released/</link>
		<comments>http://coder.cl/2010/08/ann-pyxser-1-4-6r-released/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 16:38:08 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=760</guid>
		<description><![CDATA[pyxser is a Python extension which holds functions to serialize and deserialize Python objects into XML. It&#8217;s one of my FOSS projects. Some characteristics of of this serializer are the fact that it can serialize objects with circular references and cross referenced objects &#8212; try to serialize an object with circular references in .NET. Other [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://coder.cl/products/pyxser/'><strong>pyxser</strong></a> is a Python extension which holds functions to serialize and deserialize Python objects into XML. It&#8217;s one of my FOSS projects. Some characteristics of of this serializer are the fact that it can serialize objects with circular references and cross referenced objects &mdash; try to serialize an object with circular references in .NET. Other facts is that it uses an <i>O(n)</i> algorithm, with <i>n</i> equal to the number of objects and not their references in the object tree. Today I&#8217;ve released <strong>pyxser-1.4.6r</strong>, let me show what I&#8217;ve done&#8230;</p>
<p><span id="more-760"></span></p>
<p><br/></p>
<h3>metrics</h3>
<p><strong>pyxser</strong> is complex. It requires some compiler construction techniques. The main one is <i>memoization</i>, which uses an internal and thread safe cache to allow the serializer to create unique XML instances of the <i>pyxs:obj</i> element. Also, it uses mutually recursive functions while is harvesting objects from the object tree using an preorder traversal tree algorithm. The result of implementing it, is the following table:</p>
<table width="80%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr>
<th width="60%">metric</th>
<th width="20%" align="right">overall</th>
<th width="20%" align="right">per module</th>
</tr>
<tr>
<td>number of modules</td>
<td align="right">1</td>
<td align="right">&nbsp;&mdash;&nbsp;</td>
</tr>
<tr>
<td>lines of code</td>
<td align=right>5343</td>
<td align=right>5343</td>
</tr>
<tr>
<td>mccabe&#8217;s cyclomatic number</td>
<td align=right>1025</td>
<td align=right>1025</td>
</tr>
<tr>
<td>loc/com</td>
<td align=right>10.024</td>
<td align="right">&nbsp;&mdash;&nbsp;</td>
</tr>
<tr>
<td>mvg/com</td>
<td align=right>1.923</td>
<td align="right">&nbsp;&mdash;&nbsp;</td>
</tr>
</table>
<p>But there is a fact, <strong>pyxser is fast as hell!</strong>. It can do <i>10010</i> serializations in <i>1.992</i> seconds and <i>11011</i> deserializations in <i>6.910</i> seconds. So, I was introducing some enhancements and securing the code doing code harndening test and shorting code flow paths. Now the code looks flat and more elegant.</p>
<p><br/></p>
<h3>profiling</h3>
<p>After securing the code I got a slower pyxser implementation. So, I was impressed since I got to double the time on certain internal functions. Here is the metric on how code was executed:</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-4r-6rc1.svg?ver=2.2'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-4r-6rc1.png?ver=2.2' border='0' /></a>
</div>
<p>But after some code cleanup, refactoring and code path shortening, I got much better results, and I&#8217;ve maintained the original perfomance with hardened, ordered and flat code. The reduction of nested statements was quite hard, but I&#8217;ve done it. It has just three levels as an average of nested statements:</p>
<div class="figure">
<a href='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-4r-6r.svg?ver=2.2'><img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/08/profile-4r-6r.png?ver=2.2' border='0' /></a>
</div>
<p><br/></p>
<h3>enhancements</h3>
<p><strong>pyxser</strong> now can serialize, for example <i>SqlAlchemy</i> objects, sent them through the network and restore the instance so far away. For those kind of objects you must follow a simple rule, use the <i>selector</i> argument and the <i>depth</i> argument. The <strong>pyxser</strong> distribution comes with some test files, <tt>test-utf8-sqlalchemy.py</tt> is one of those files, where we define a class <i>User</i>:</p>
<pre class='brush: python;'>
class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True)
    name = Column(String)
    fullname = Column(String)
    password = Column(String)

    def __init__(self):
        self.name = None
        self.fullname = None
        self.password = None

    def get_set(self):
        return (self.name, self.fullname, self.password)

    def __repr__(self):
        return &quot;User('%s','%s', '%s')&quot; % self.get_set()
</pre>
<p>The first rule is quite simple: the constructor must be a simple constructor, without arguments, but it can hold initialization code, just remain it without arguments. And the second rule is to use the <i>selector</i> argument:</p>
<pre class='brush: python;'>
def sqlalch_filter(v):
    r = ((not callable(v[1]))
         and (not (v[0].startswith(&quot;_&quot;)))
         and ((v[0] != &quot;metadata&quot;)))
    return r

def sqlalch_selector(o):
    r = dict(filter(sqlalch_filter, inspect.getmembers(o)))
    return r

serialized = pyxser.serialize(obj = ed_user, enc = 'utf-8', selector = sqlalch_selector, depth = 2)
</pre>
<p>This will create a very simple object:</p>
<pre class='brush: xml;'>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;pyxs:obj xmlns:pyxs=&quot;http://projects.coder.cl/pyxser/model/&quot; version=&quot;1.0&quot; type=&quot;User&quot; module=&quot;testpkg.sample&quot; objid=&quot;id170543564&quot;&gt;
  &lt;pyxs:prop type=&quot;str&quot; name=&quot;fullname&quot;&gt;Ed Jones&lt;/pyxs:prop&gt;
  &lt;pyxs:prop type=&quot;str&quot; name=&quot;password&quot;&gt;password&lt;/pyxs:prop&gt;
  &lt;pyxs:prop type=&quot;str&quot; name=&quot;name&quot;&gt;ed&lt;/pyxs:prop&gt;
&lt;/pyxs:obj&gt;
</pre>
<p>But when it is restored on the end, it will remain intact.</p>
<p>Some people was saying that pyxser do not comes with documentation. Those people have not seen the documentation. <strong>pyxser</strong> as any Python extension, is self documented, this means that you must launch <i>pydoc</i> to read it. If you never have used pydoc, just try it: <tt>pydoc -p8080</tt>, this will create a small web server running on localhost to let you read the documentation. It has some other interesting parameters, others than <i>depth</i> and <i>selector</i>, such as <i>typemap</i>, which allows you to create custom serializations of certain objects &mdash; such as files.</p>
<p><br/></p>
<h3>where is located</h3>
<p>The project is hosted at SourceForge: <a href='https://sourceforge.net/projects/pyxser/'>pyxser@sourceforge</a> and the home page of the project is located <a href='http://coder.cl/products/pyxser/'>pyxser@coder.cl</a>.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/08/ann-pyxser-1-4-6r-released/">Permalink</a> |
<a href="http://coder.cl/2010/08/ann-pyxser-1-4-6r-released/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/08/ann-pyxser-1-4-6r-released/&title=[ann] pyxser-1.4.6r released">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/08/ann-pyxser-1-4-6r-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mozilla extensions with xpcom</title>
		<link>http://coder.cl/2010/07/mozilla-extensions-with-xpcom/</link>
		<comments>http://coder.cl/2010/07/mozilla-extensions-with-xpcom/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 00:02:26 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=750</guid>
		<description><![CDATA[The XPCOM API can allow you to create low level extensions &#8212; I mean written in C++, with support for C and assembler through C++ &#8212; and plug ins for Mozilla products. For example, you can create an extension to browse IMAP folders from Mozilla Firefox. This API is analogous to the COM+ API on [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href='https://developer.mozilla.org/en/XPCOM'><strong>XPCOM</strong></a> API can allow you to create low level extensions &mdash; I mean written in C++, with support for C and assembler through C++ &mdash; and plug ins for <a href='http://www.mozilla.org/'>Mozilla</a> products. For example, you can create an extension to browse IMAP folders from <i>Mozilla Firefox</i>. This API is analogous to the <strong>COM+</strong> API on Micro$oft Windows. One of my most recent projects, is a <a href='http://www.mozilla.com/en-US/firefox/firefox.html'>Firefox</a> extension to handle <a href='http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol'>SNMP</a> protocol requests from JavaScript, so my extension is applied from the JavaScript within the HTML in the browser, allowing Firefox to act as an SNMP client. The extension is working fine, without memory leaks and allows you to do <i>get</i> and <i>walk</i> request. Possibly it will be expanded to more requests on the future.</p>
<p><span id="more-750"></span></p>
<p></p>
<h3>interface definition</h3>
<p>JavaScript requires <i>class definitions</i> to work. So, you need to create <a href='http://en.wikipedia.org/wiki/Interface_description_language'>IDL</a> definitions of your <i>scriptable</i> classes. The syntax for the <i>XPIDL</i> is quite standard, so isn&#8217;t difficult to create interfaces with this IDL variant. To allow you to use IDL defined interfaces on JavaScript, interfaces must be defined as <i>scriptable</i> and must be derived from <i>nsISupports</i> interface, with an unique <i>uuid</i>. Let me show you an example:</p>
<pre class='brush: java;'>
#include &quot;nsISupports.idl&quot;
#include &quot;nsIMyProtocolRequest.idl&quot;
#include &quot;nsIMyProtocolResponse.idl&quot;
#include &quot;nsIMyProtocolError.idl&quot;
#include &quot;nsIMyProtocolStatus.idl&quot;
#include &quot;nsIMyProtocolService.idl&quot;

[scriptable, uuid(3455c51a-3323-4343-844f-2342526113c2)]
interface nsIMyProtocolService : nsISupports
{
    readonly attribute nsIMyProtocolError error;
    nsIMyProtocolResponse get(in nsIMyProtocolRequest req);
    nsIMyProtocolStatus getStatus(in nsIMyProtocolRequest req);
};
</pre>
<p>This will create a XPCOM object wrapped in JavaScript similar to the following example:</p>
<pre class='brush: javascript;'>
var nsIMyProtocolService = {
    error: new nsIMyProtocolError(),
    get: function (req) {
    },
    getStatus: function (req) {
    },
};
</pre>
<p><br/></p>
<h3>class definition</h3>
<p>Here, <tt>error</tt> is a read only attribute, and <tt>get()</tt> and <tt>getStatus()</tt> are methods. But this isn&#8217;t enough, that is just the <i>interface definition</i>. The implementation must be done in C++ so the interface defintion is transformed to <strong>C++</strong> code &mdash; a C++ header specifically &mdash; which must be included in the class implementation <strong>C++</strong> code file. Where need to consider a special note on class attributes and methods: Every method implementation has the form: <i>nsresult MethodName(&#8230;input parameters if any&#8230;, &#8230;output parameters if any&#8230;)</i>, where nsresult is the type of the returned status to the XPCOM API to let it know <i>how was executed</i> the method, so you can return <tt>NS_OK</tt> on execution correctness, <tt>NS_ERROR_NULL_POINTER</tt> for invalid input as null pointers, <tt>NS_ERROR_INVALID_POINTER</tt> for invalid variable input and so on. Well, the class definition inside the implementation file, should look as follow:</p>
<pre class='brush: cpp;'>
class nsMyProtocolService : public nsIMyProtocolService
{
public:
    nsMyProtocolService();
    ~nsMyProtocolService();

    nsresult GetError(nsIMyProtocolError **out);
    nsresult Get(nsIMyProtocolRequest *req,
                 nsIMyProtocolResponse **out);
    nsresult GetStatus(nsIMyProtocolRequest *req,
                 nsIMyProtocolStatus **out);
private:
    int statusCode;
    int errorCode;
    char *errorString;
    nsIMyProtocolError *currentError;
}
</pre>
<p><br/></p>
<h3>class implementation</h3>
<p>You must be a <a href='http://c2.com/cgi-bin/wiki?ThreeStarProgrammer'>two star programmer</a> to know how to implement the argument passing and method output, but I know that you are a good C and C++ programmer, so this is not an obstacle and you can act as a <i>three star programmer</i> without problems. So, the implementation, for example for the <tt>GetError()</tt> method, which has been mapped to the <i>error</i> attribute on the <i>nsIMyProtocolService</i> interface, should look as follows:</p>
<pre class='brush: cpp;'>
nsresult
nsMyProtocolService::GetError(nsIMyProtocolError **out)
{
    nsMyProtocolError *rout;
    result = NS_ERROR_NULL_POINTER;
    if (out == NULL || out == nsnull) {
        return result;
    }
    rout = new nsMyProtocolError();
    if (rout == NULL) {
        result = NS_ERROR_NOT_INITIALIZED;
        return result;
    }
    if (currentError != NULL &amp;&amp; currentError != nsnull) {
        NS_RELEASE(currentError);
        delete currentError;
    }
    rout->SetErrorCode(errorCode);
    rout->SetErrorString(errorString);
    NS_ADDREF(rout);
    *out = rout;
    result = NS_OK;
    return result;
}
</pre>
<p>On the example above, we have created a new pointer to the <i>nsIMyProtocolError</i> interface implementation. That pointer, before is being returned to the JavaScript and wrapped by the XPCOM API, must have an increased <i>reference count</i>, so Firefox do not remove that object. But as any language which uses <i>reference counting</i> in its garbage collection tasks, requires a reference counting decrement before the object is released. So you need to release those references using the <tt>NS_RELEASE</tt> macro. As any software development &mdash; with or without a garbage collector behind &mdash; you must be careful with the memory usage. Any object with a reference count different from zero, will hang Firefox, so you need to release reference counting on destructors too.</p>
<pre class='brush: cpp;'>
nsMyProtocolService::~nsMyProtocolService()
{
    if (currentError != NULL &amp;&amp; currentError != nsnull) {
        NS_RELEASE(currentError);
        delete currentError;
    }
}
</pre>
<p><br/></p>
<h3></h3>
<p>The example above shows how the destructor releases the reference counting for the <i>currentError</i> object. But think a little. Every time you call <tt>GetError()</tt>, in other words, you request the <i>error</i> attribute on the <i>nsIMyProtocolService</i> instance, you are increasing references which are left without being decreased. You need an storage for those pointers, so you can use any collection class that you want and is supported by your platform, but is recommended that you use the kind of storage classes which are present on the XPCOM API. How to create a collection?</p>
<pre class='brush: cpp;'>

nsCOMPtr&lt;nsIMutableArray&gt; container;
container = do_CreateInstance(NS_ARRAY_CONTRACTID);
</pre>
<p>The <i>nsIMutableArray</i> provides an array class which can be used inside your Firefox extension and also it can be exposed as a JavaScript array, it is an <i>scriptable</i> class, and also provides methods for pushing and extracting elements as the JavaScript array does, so you can use methods such as <tt>GetLength()</tt>, which is mapped to the <i>length</i> attribute, <tt>AppendElement()</tt>, which is mapped to the <i>append()</i> method, <tt>QueryElementAt()</tt> which is mapped to the <i>array[index]</i> operator. The <i>do_CreateInstance</i> template will allow you create instances of you interfaces, when you are requesting them from other extensions. For example if you want to use the <i>WebDAV</i> extension from your C++ extension, you need to use <i>do_CreateInstance</i> template.</p>
<p><br/></p>
<h3>component declaration</h3>
<p>Finally, you need to register and expose your components to the JavaScript interface and the XPCOM API, so you need to define a contract identifier and add some static code to you extension.</p>
<pre class='brush: cpp;'>
#define NS_MYSVC_CONTRACTID         &quot;@mozilla.org/myprotocol/service;1&quot;
#define NS_MYSVC_CID
    { /* 3455c51a-3323-4343-844f-2342526113c2 */
        0x3455c51a,
            0x3323,
            0x4343,
            { 0x84, 0x4f, 0x23, 0x42, 0x52, 0x61, 0x13, 0xc2 }
    }

NS_GENERIC_FACTORY_CONSTRUCTOR(nsMyProtocolService)
NS_DECL_CLASSINFO(nsMyProtocolService)
static const nsModuleComponentInfo components[] =
{
    { &quot;My Protocol Service&quot;, NS_MYSVC_CONTRACTID, NS_MYSVC_CID,
      nsMyProtocolServiceConstructor,
      NULL, NULL, NULL,
      NS_CI_INTERFACE_GETTER_NAME(nsMyProtocolService),
      NULL,
      &amp;NS_CLASSINFO_NAME(nsMyProtocolService)
    }
};

NS_IMPL_NSGETMODULE(nsJxSNMPService, components)
</pre>
<p>This can be used as template, where the <i>components</i> array contains the interface definitions and interface implementation references that allow you to use those classes from JavaScript. This code will:</p>
<dl>
<dt><tt>NS_GENERIC_FACTORY_CONSTRUCTOR</tt></dt>
<dd>Will declare <tt>nsMyProtocolServiceConstructor</tt> to be used as default constructor by the <i>do_CreateInstance()</i> template.</dd>
<dt><tt>NS_DECL_CLASSINFO</tt></dt>
<dd>Will declare class information referencing the <i>nsMyProtocolService</i> class to allow you to use that class information from JavaScript to be exposed to the XPCOM API.</dd>
<dt><tt>NS_MYSVC_CONTRACTID</tt></dt>
<dd>Contract (interface) identifier, it will be required by your JavaScript to instantiate you class, using the interface as was defined in <i>nsIMyProtocolService</i>.</dd>
<dt><tt>NS_MYSVC_CID</tt></dt>
<dd>This is the unique <i>uuid</i> identifier for your component. Remember that those components are quite analogous to the COM+ components on the Window$ platform.</dd>
<dt><tt>NS_IMPL_NSGETMODULE(nsJxSNMPService, components)</tt></dt>
<dd>This line finally will expose &mdash; through static code &mdash; your component to the XPCOM API, and will allow your class to being used from JavaScript or your Firefox extension. Remember that <i>components</i> is an array which can hold multiple interface and class definitions.</dd>
</dl>
<p><br/></p>
<h3>component exposition</h3>
<p>If you followed the article with a conscious reading, the following lines of JavaScript will bring you the proper guide to instantiate your own component. I&#8217;m assuming that you are an experienced <i>system programmer</i> and <i>web developer</i> to handle this article:</p>
<pre class='brush: javascript;'>
const C = Components;
const CI = C.interfaces;
const CL = C.classes;

function getContract(contract) {
  try {
    return C.classes[contract];
  } catch (e) {
    alert(e.message);
  }
}

function getService(contract, iface) {
  try {
    return getContract(contract).getService(CI[iface]);
  } catch (e) {
    alert(e.message);
  }
}

function getInterface(contract, iface) {
  try {
    return getContract(contract).createInstance(CI[iface]);
  } catch (e) {
    alert(e.message);
  }
}

try {
    var myService = getService(&quot;@mozilla.org/myprotocol/service;1&quot;,
                               &quot;nsIMyProtocolService&quot;);

    var myRequest = getService(&quot;@mozilla.org/myprotocol/request;1&quot;,
                               &quot;nsIMyProtocolRequest&quot;);

    myRequest.first_argument = 200;
    myRequest.second_argument = &quot;hello world!&quot;;
    var myResponse = myService.get(myRequest);
    if (typeof(myService.error) == &quot;object&quot;
        &amp;&amp; myService.error.status != 0) {
        alert(myService.error.toString());
    }
} catch (e) {
    alert(e.message);
}
</pre>
<p><br/></p>
<h3>interesting code to look</h3>
<p>You can start downloading the Firefox source code and take a look on the following interfaces:</p>
<ul>
<li><strong>extensions/webdav</strong>, this defines the &quot;@mozilla.org/webdav/service;1&quot; interface, allowing you to create WebDAV clients from JavaScript.</li>
<li><strong>extensions/webservices</strong>, this defines the &quot;@mozilla.org/xmlextras/proxy/webserviceproxy;1,&quot; and similar interfaces, allowing you to create WebService client proxies from JavaScript.</li>
<li><strong>extensions/sql</strong>, this folder stores &quot;@mozilla.org/sql/connection;1&quot; and similar interfaces, so Firefox can be used directly as client to query some RDBMS engines &mdash; such as PostgreSQL and SQLite.</li>
</ul>
<p>You can go on deeper reading code and references to enhance your <strong>XPCOM</strong> component development ;)</p>
<p><br/></p>
<h3>references</h3>
<ul>
<li><a href='http://en.wikipedia.org/wiki/XPCOM'><i>&quot;XPCOM&quot;</i></a>, Wikipedia Article, as introductory reading.</li>
<li><a href='http://www.ibm.com/developerworks/webservices/library/co-xpcom.html'><i>&quot;XPCOM Part 1: An introduction to XPCOM&quot;</i></a>, IBM DeveloperWorks article, by <a href='http://www.ibm.com/developerworks/webservices/library/co-xpcom.html#author1'>Rick Parrish</a>.</li>
<li><a href='http://www.ibm.com/developerworks/webservices/library/co-xpcom2.html'><i>&quot;XPCOM Part 2: XPCOM component basics&quot;</i></a>, IBM DeveloperWorks article, by <a href='http://www.ibm.com/developerworks/webservices/library/co-xpcom.html#author1'>Rick Parrish</a>.</li>
<li><a href='http://www.ibm.com/developerworks/webservices/library/co-xpcom3.html'><i>&quot;XPCOM Part 3: Setting up XPCOM&quot;</i></a>, IBM DeveloperWorks article, by <a href='http://www.ibm.com/developerworks/webservices/library/co-xpcom.html#author1'>Rick Parrish</a>.</li>
<li><a href='https://developer.mozilla.org/en/XPCOM'><i>&quot;XPCOM&quot;</i></a>, Mozilla Reference Documentation.</li>
</ul>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/07/mozilla-extensions-with-xpcom/">Permalink</a> |
<a href="http://coder.cl/2010/07/mozilla-extensions-with-xpcom/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/07/mozilla-extensions-with-xpcom/&title=mozilla extensions with xpcom">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/07/mozilla-extensions-with-xpcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[ANN] pyxser-1.4.4r was released</title>
		<link>http://coder.cl/2010/06/ann-pyxser-1-4-4r-was-released/</link>
		<comments>http://coder.cl/2010/06/ann-pyxser-1-4-4r-was-released/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 16:24:50 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=688</guid>
		<description><![CDATA[Hello, today I&#8217;ve released pyxser-1.4.4r, the publishing message is as follows: Hello Python Community. I&#8217;m pleased to announce pyxser-1.4.4r, a python extension which contains functions to serialize and deserialize Python Objects into XML. It is a model based serializer. Here is the ChangeLog entry for this release: 1.4.4r (2010.02.10): Daniel Molina Wegener * src/include/pyxser_collections.h - [...]]]></description>
			<content:encoded><![CDATA[<p>Hello, today I&#8217;ve released <strong>pyxser-1.4.4r</strong>, the publishing message is as follows:</p>
<hr/>
<p>Hello Python Community.</p>
<p>I&#8217;m pleased to announce pyxser-1.4.4r, a python extension which contains functions to serialize and deserialize Python Objects into XML. It is a model based serializer. Here is the ChangeLog entry for this release:</p>
<p><span id="more-688"></span></p>
<pre>
1.4.4r (2010.02.10):

        Daniel Molina Wegener <d...@coder.cl>

        * src/include/pyxser_collections.h - added set handling
        function prototypes. Added support for unicode
        key names, which are converted to the user settings
        encoding (ie utf-8) inside the XML output.
        * src/pyxser_serializer.c - removed memory leak. Addded
        support for unicode object names in dictionary/list types.
        * src/pyxser_collections.c - added set handling function
        prototypes. added name property handling algorithm, so
        non string name properties are not serialized. I shall
        extend it to other modules.
        * src/pyxser_tools.c - added set handling prototypes and
        set type checking function.
        * test-utf8-leak.py - added serialization of SQL Alchemy
        objects, so we can test more complex Python objects
        serialization.
        * test-utf8-sqlalchemy.py - added sql alchemy object
        serialization test.
        * src/pyxser_serializer.c - reduced serialization algorithms,
        replacing deep nested if statements by flatten ones.
        * src/pyxser_collections.c - reduced serialization algorithms
        replacing deep nested if statements by flatten ones.
        * src/pyxser_typem.c - reduced serialization algorithms,
        replacing deep nested if statements by flatten ones.

        Thanks to pyxser users for their feedback.
</pre>
<p>This release contains some bug fixes, mainly related to type checking and type handling. I hope this small extension will help you on your programming tasks.</p>
<ul>
<li>The project is hosted at:<br/><a href='http://sourceforge.net/projects/pyxser/'>http://sourceforge.net/projects/pyxser/</a></li>
<li>The web page for the project is located at:<br/><a href='http://coder.cl/products/pyxser/'>http://coder.cl/products/pyxser/</a></li>
<li>PyPi entry is:<br/><a href='http://pypi.python.org/pypi/pyxser/1.4.4r'>http://pypi.python.org/pypi/pyxser/1.4.4r</a></li>
<li>For a sample article on how to integrate pyxser with ZSI WebServices:<br/><a href='http://coder.cl/2009/10/18/pyxser-and-zsi-webservices/'>http://coder.cl/2009/10/18/pyxser-and-zsi-webservices/</a></li>
</ul>
<p>Thanks and best regards&#8230;</p>
<hr/>
<p>I hope that this module can help you in your development tasks and thanks for your feedback.</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/06/ann-pyxser-1-4-4r-was-released/">Permalink</a> |
<a href="http://coder.cl/2010/06/ann-pyxser-1-4-4r-was-released/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/06/ann-pyxser-1-4-4r-was-released/&title=[ANN] pyxser-1.4.4r was released">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/06/ann-pyxser-1-4-4r-was-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>my contribution to free/open source software</title>
		<link>http://coder.cl/2010/04/my-contribution-to-freeopen-source-software/</link>
		<comments>http://coder.cl/2010/04/my-contribution-to-freeopen-source-software/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 22:34:34 +0000</pubDate>
		<dc:creator>dmw</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[caffeine]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[pyxser]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=643</guid>
		<description><![CDATA[I&#8217;ve worked on FOSS for years. Currently I have two active projects pyxser and caffeine. Both of them requires a great effort to being completed. Take an overview on their development: pyxser pyxser have about one year of development, some months doing research, and other months doing development or coding the Python Module. And the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve worked on FOSS for years. Currently I have two active projects <a href='http://coder.cl/products/pyxser/'>pyxser</a> and <a href='http://coder.cl/products/caffeine/'>caffeine</a>. Both of them requires a great effort to being completed. Take an overview on their development:</p>
<p><span id="more-643"></span></p>
<h3>pyxser</h3>
<p><b>pyxser</b> have about one year of development, some months doing research, and other months doing development or coding the <b>Python Module</b>.</p>
<div class="figure">
<img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/04/pyxser-last-12months.png' border='0' width='510' style="border: 2px solid #000;" />
</div>
<p>And the SVN log show an average hour for commits between 22:00 and 23:00</p>
<div style='height: 200px; overflow: scroll;'>
<pre>
r125 | damowe | 2010-02-10 16:15:49 -0300 (Wed, 10 Feb 2010) | 2 lines
r124 | damowe | 2010-02-10 15:52:31 -0300 (Wed, 10 Feb 2010) | 2 lines
r123 | damowe | 2010-02-10 13:30:15 -0300 (Wed, 10 Feb 2010) | 10 lines
r122 | damowe | 2010-02-02 08:47:07 -0300 (Tue, 02 Feb 2010) | 3 lines
r121 | damowe | 2009-12-26 21:52:49 -0300 (Sat, 26 Dec 2009) | 2 lines
r118 | damowe | 2009-12-26 21:40:33 -0300 (Sat, 26 Dec 2009) | 2 lines
r117 | damowe | 2009-12-25 15:20:30 -0300 (Fri, 25 Dec 2009) | 4 lines
r116 | damowe | 2009-12-22 20:09:25 -0300 (Tue, 22 Dec 2009) | 5 lines
r115 | damowe | 2009-12-21 19:47:50 -0300 (Mon, 21 Dec 2009) | 2 lines
r114 | damowe | 2009-12-20 01:38:45 -0300 (Sun, 20 Dec 2009) | 7 lines
r112 | damowe | 2009-12-03 09:48:41 -0300 (Thu, 03 Dec 2009) | 6 lines
r110 | damowe | 2009-11-30 14:52:10 -0300 (Mon, 30 Nov 2009) | 2 lines
r109 | damowe | 2009-11-30 14:46:43 -0300 (Mon, 30 Nov 2009) | 9 lines
r107 | damowe | 2009-08-23 11:43:52 -0400 (Sun, 23 Aug 2009) | 2 lines
r102 | damowe | 2009-08-23 11:29:07 -0400 (Sun, 23 Aug 2009) | 2 lines
r99 | damowe | 2009-08-23 11:12:20 -0400 (Sun, 23 Aug 2009) | 6 lines
r98 | damowe | 2009-08-08 15:15:07 -0400 (Sat, 08 Aug 2009) | 3 lines
r93 | damowe | 2009-07-28 21:59:10 -0400 (Tue, 28 Jul 2009) | 2 lines
r90 | damowe | 2009-07-27 22:22:55 -0400 (Mon, 27 Jul 2009) | 2 lines
r89 | damowe | 2009-07-27 22:21:50 -0400 (Mon, 27 Jul 2009) | 5 lines
r88 | damowe | 2009-07-26 22:27:23 -0400 (Sun, 26 Jul 2009) | 4 lines
r87 | damowe | 2009-07-20 16:02:27 -0400 (Mon, 20 Jul 2009) | 5 lines
r86 | damowe | 2009-07-17 22:24:53 -0400 (Fri, 17 Jul 2009) | 4 lines
r84 | damowe | 2009-05-09 23:19:49 -0400 (Sat, 09 May 2009) | 2 lines
r83 | damowe | 2009-05-09 22:31:00 -0400 (Sat, 09 May 2009) | 7 lines
r82 | damowe | 2009-05-09 11:00:44 -0400 (Sat, 09 May 2009) | 3 lines
r81 | damowe | 2009-05-08 21:31:56 -0400 (Fri, 08 May 2009) | 2 lines
r80 | damowe | 2009-04-28 00:32:53 -0400 (Tue, 28 Apr 2009) | 3 lines
r78 | damowe | 2009-04-26 19:21:16 -0400 (Sun, 26 Apr 2009) | 2 lines
r77 | damowe | 2009-04-26 19:13:26 -0400 (Sun, 26 Apr 2009) | 2 lines
r76 | damowe | 2009-04-26 17:34:09 -0400 (Sun, 26 Apr 2009) | 4 lines
r75 | damowe | 2009-04-25 19:31:45 -0400 (Sat, 25 Apr 2009) | 3 lines
r74 | damowe | 2009-04-24 20:49:40 -0400 (Fri, 24 Apr 2009) | 3 lines
r73 | damowe | 2009-04-23 23:06:46 -0400 (Thu, 23 Apr 2009) | 4 lines
r72 | damowe | 2009-04-22 08:28:31 -0400 (Wed, 22 Apr 2009) | 3 lines
r71 | damowe | 2009-04-22 00:52:12 -0400 (Wed, 22 Apr 2009) | 2 lines
r70 | damowe | 2009-04-22 00:28:48 -0400 (Wed, 22 Apr 2009) | 3 lines
r69 | damowe | 2009-04-21 23:09:09 -0400 (Tue, 21 Apr 2009) | 2 lines
r68 | damowe | 2009-04-21 16:41:11 -0400 (Tue, 21 Apr 2009) | 3 lines
r65 | damowe | 2009-04-19 01:24:34 -0400 (Sun, 19 Apr 2009) | 2 lines
r64 | damowe | 2009-04-19 01:22:15 -0400 (Sun, 19 Apr 2009) | 2 lines
r63 | damowe | 2009-04-19 01:17:29 -0400 (Sun, 19 Apr 2009) | 2 lines
r62 | damowe | 2009-04-19 01:10:33 -0400 (Sun, 19 Apr 2009) | 2 lines
r61 | damowe | 2009-04-19 00:01:47 -0400 (Sun, 19 Apr 2009) | 3 lines
r59 | damowe | 2009-04-18 22:57:01 -0400 (Sat, 18 Apr 2009) | 2 lines
r58 | damowe | 2009-04-18 22:30:30 -0400 (Sat, 18 Apr 2009) | 3 lines
r57 | damowe | 2009-04-18 04:26:58 -0400 (Sat, 18 Apr 2009) | 2 lines
r56 | damowe | 2009-04-18 03:28:56 -0400 (Sat, 18 Apr 2009) | 3 lines
r55 | damowe | 2009-04-15 23:38:34 -0400 (Wed, 15 Apr 2009) | 2 lines
r54 | damowe | 2009-04-15 23:10:32 -0400 (Wed, 15 Apr 2009) | 2 lines
r53 | damowe | 2009-04-15 22:46:15 -0400 (Wed, 15 Apr 2009) | 3 lines
r52 | damowe | 2009-04-10 18:30:22 -0400 (Fri, 10 Apr 2009) | 2 lines
r49 | damowe | 2009-04-10 00:17:25 -0400 (Fri, 10 Apr 2009) | 2 lines
r47 | damowe | 2009-04-08 23:43:50 -0400 (Wed, 08 Apr 2009) | 4 lines
r46 | damowe | 2009-04-08 14:29:42 -0400 (Wed, 08 Apr 2009) | 4 lines
r45 | damowe | 2009-04-08 01:31:22 -0400 (Wed, 08 Apr 2009) | 2 lines
r44 | damowe | 2009-04-08 01:30:18 -0400 (Wed, 08 Apr 2009) | 2 lines
r43 | damowe | 2009-04-08 01:28:36 -0400 (Wed, 08 Apr 2009) | 3 lines
r42 | damowe | 2009-04-06 21:58:57 -0400 (Mon, 06 Apr 2009) | 2 lines
r41 | damowe | 2009-04-06 21:46:19 -0400 (Mon, 06 Apr 2009) | 2 lines
r40 | damowe | 2009-04-06 21:36:55 -0400 (Mon, 06 Apr 2009) | 3 lines
r39 | damowe | 2009-04-05 22:25:50 -0400 (Sun, 05 Apr 2009) | 2 lines
r38 | damowe | 2009-04-05 22:19:10 -0400 (Sun, 05 Apr 2009) | 4 lines
r37 | damowe | 2009-04-04 20:18:15 -0400 (Sat, 04 Apr 2009) | 3 lines
r36 | damowe | 2009-03-31 23:49:23 -0400 (Tue, 31 Mar 2009) | 5 lines
r33 | damowe | 2009-03-28 12:13:41 -0400 (Sat, 28 Mar 2009) | 2 lines
r30 | damowe | 2009-03-26 22:17:10 -0400 (Thu, 26 Mar 2009) | 3 lines
r29 | damowe | 2009-03-26 21:59:57 -0400 (Thu, 26 Mar 2009) | 5 lines
r28 | damowe | 2009-03-26 21:17:10 -0400 (Thu, 26 Mar 2009) | 2 lines
r27 | damowe | 2009-03-25 23:26:30 -0400 (Wed, 25 Mar 2009) | 3 lines
r26 | damowe | 2009-03-25 22:58:16 -0400 (Wed, 25 Mar 2009) | 5 lines
r25 | damowe | 2009-03-25 22:03:16 -0400 (Wed, 25 Mar 2009) | 2 lines
r24 | damowe | 2009-03-25 21:00:44 -0400 (Wed, 25 Mar 2009) | 4 lines
r23 | damowe | 2009-03-25 20:48:26 -0400 (Wed, 25 Mar 2009) | 3 lines
r22 | damowe | 2009-03-25 20:34:30 -0400 (Wed, 25 Mar 2009) | 2 lines
r21 | damowe | 2009-03-25 20:15:58 -0400 (Wed, 25 Mar 2009) | 2 lines
r20 | damowe | 2009-03-24 20:47:42 -0400 (Tue, 24 Mar 2009) | 2 lines
r19 | damowe | 2009-03-23 23:41:47 -0400 (Mon, 23 Mar 2009) | 5 lines
r18 | damowe | 2009-03-23 21:03:13 -0400 (Mon, 23 Mar 2009) | 3 lines
r17 | damowe | 2009-03-23 20:16:58 -0400 (Mon, 23 Mar 2009) | 2 lines
r16 | damowe | 2009-03-19 22:57:46 -0400 (Thu, 19 Mar 2009) | 2 lines
r15 | damowe | 2009-03-19 22:30:56 -0400 (Thu, 19 Mar 2009) | 5 lines
r14 | damowe | 2009-03-19 20:37:13 -0400 (Thu, 19 Mar 2009) | 2 lines
r13 | damowe | 2009-03-19 00:37:39 -0400 (Thu, 19 Mar 2009) | 3 lines
r12 | damowe | 2009-03-19 00:11:23 -0400 (Thu, 19 Mar 2009) | 3 lines
r11 | damowe | 2009-03-18 23:47:08 -0400 (Wed, 18 Mar 2009) | 3 lines
r10 | damowe | 2009-03-17 22:25:47 -0400 (Tue, 17 Mar 2009) | 2 lines
r9 | damowe | 2009-03-17 22:23:21 -0400 (Tue, 17 Mar 2009) | 2 lines
r8 | damowe | 2009-03-17 22:16:37 -0400 (Tue, 17 Mar 2009) | 2 lines
r7 | damowe | 2009-03-17 00:55:43 -0400 (Tue, 17 Mar 2009) | 2 lines
r6 | damowe | 2009-03-16 23:33:31 -0400 (Mon, 16 Mar 2009) | 2 lines
r5 | damowe | 2009-03-15 17:21:57 -0400 (Sun, 15 Mar 2009) | 2 lines
r4 | damowe | 2009-03-15 17:07:39 -0400 (Sun, 15 Mar 2009) | 2 lines
r1 | damowe | 2009-03-15 15:35:31 -0400 (Sun, 15 Mar 2009) | 2 lines
</pre>
</div>
<p>The project has <b>6,198</b> lines of code&#8230; a good effort and a good product. During the day I must work on those projects which bring me money, at night and as hobbits I work on my FOSS projects. I have a little time to work on them.</p>
<h3>caffeine</h3>
<p><b>caffeine</b> or C Application Framework has <b>14,177</b> lines of code, and it is evaluated as one project with three humans working on it, but it is really one, me.</p>
<div class="figure">
<img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/04/caffeine-last-year.png' border='0' width='510' style="border: 1px solid #000;" />
</div>
<div class="figure">
<img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/04/caffeine-2009.png' border='0' width='510' style="border: 1px solid #000;" />
</div>
<div class="figure">
<img src='http://coder.cl.qfl.wpcdn.arcostream.com/uploads/2010/04/caffeine-2008.png' border='0' width='510' style="border: 1px solid #000;" />
</div>
<p>And the SVN log show an average hour for commits between 22:00 and 23:00</p>
<div style='height: 200px; overflow: scroll;'>
<pre>
r125 | damowe | 2009-09-30 14:45:06 -0400 (Wed, 30 Sep 2009) | 6 lines
r124 | damowe | 2009-09-26 18:49:31 -0400 (Sat, 26 Sep 2009) | 2 lines
r123 | damowe | 2009-09-26 17:46:26 -0400 (Sat, 26 Sep 2009) | 5 lines
r122 | damowe | 2009-09-26 13:14:50 -0400 (Sat, 26 Sep 2009) | 2 lines
r121 | damowe | 2009-09-26 12:25:19 -0400 (Sat, 26 Sep 2009) | 4 lines
r120 | damowe | 2009-09-22 05:18:11 -0400 (Tue, 22 Sep 2009) | 8 lines
r119 | damowe | 2009-09-19 23:27:06 -0400 (Sat, 19 Sep 2009) | 5 lines
r118 | damowe | 2009-09-19 19:06:50 -0400 (Sat, 19 Sep 2009) | 8 lines
r117 | damowe | 2009-09-01 22:18:54 -0400 (Tue, 01 Sep 2009) | 5 lines
r116 | damowe | 2008-10-27 07:40:14 -0300 (Mon, 27 Oct 2008) | 2 lines
r115 | damowe | 2008-10-27 07:38:30 -0300 (Mon, 27 Oct 2008) | 2 lines
r114 | damowe | 2008-10-27 07:35:09 -0300 (Mon, 27 Oct 2008) | 3 lines
r113 | damowe | 2008-10-25 13:01:20 -0300 (Sat, 25 Oct 2008) | 2 lines
r112 | damowe | 2008-06-10 21:10:30 -0400 (Tue, 10 Jun 2008) | 3 lines
r111 | damowe | 2008-06-06 20:05:39 -0400 (Fri, 06 Jun 2008) | 5 lines
r110 | damowe | 2008-05-08 21:12:50 -0400 (Thu, 08 May 2008) | 2 lines
r109 | damowe | 2008-05-06 23:53:10 -0400 (Tue, 06 May 2008) | 2 lines
r108 | damowe | 2008-05-05 23:37:42 -0400 (Mon, 05 May 2008) | 2 lines
r107 | damowe | 2008-04-27 02:08:49 -0400 (Sun, 27 Apr 2008) | 2 lines
r106 | damowe | 2008-04-26 11:59:49 -0400 (Sat, 26 Apr 2008) | 4 lines
r105 | damowe | 2008-04-22 23:06:33 -0400 (Tue, 22 Apr 2008) | 3 lines
r104 | damowe | 2008-04-21 21:13:06 -0400 (Mon, 21 Apr 2008) | 4 lines
r103 | damowe | 2008-02-10 13:16:32 -0300 (Sun, 10 Feb 2008) | 3 lines
r102 | damowe | 2008-02-10 10:22:34 -0300 (Sun, 10 Feb 2008) | 2 lines
r101 | damowe | 2008-02-10 10:08:35 -0300 (Sun, 10 Feb 2008) | 2 lines
r100 | damowe | 2008-01-06 12:07:57 -0300 (Sun, 06 Jan 2008) | 4 lines
r99 | damowe | 2008-01-05 20:03:27 -0300 (Sat, 05 Jan 2008) | 4 lines
r98 | damowe | 2008-01-01 17:29:14 -0300 (Tue, 01 Jan 2008) | 3 lines
r97 | damowe | 2007-12-31 15:47:20 -0300 (Mon, 31 Dec 2007) | 2 lines
r96 | damowe | 2007-12-30 12:15:46 -0300 (Sun, 30 Dec 2007) | 2 lines
r95 | damowe | 2007-12-30 12:06:41 -0300 (Sun, 30 Dec 2007) | 3 lines
r94 | damowe | 2007-12-30 07:59:58 -0300 (Sun, 30 Dec 2007) | 2 lines
r93 | damowe | 2007-12-25 10:37:15 -0300 (Tue, 25 Dec 2007) | 3 lines
r92 | damowe | 2007-12-22 09:57:27 -0300 (Sat, 22 Dec 2007) | 2 lines
r91 | damowe | 2007-12-22 09:56:15 -0300 (Sat, 22 Dec 2007) | 4 lines
r90 | damowe | 2007-12-22 07:26:39 -0300 (Sat, 22 Dec 2007) | 3 lines
r89 | damowe | 2007-12-16 22:21:51 -0300 (Sun, 16 Dec 2007) | 4 lines
r88 | damowe | 2007-12-03 21:35:27 -0300 (Mon, 03 Dec 2007) | 2 lines
r87 | damowe | 2007-12-01 23:56:53 -0300 (Sat, 01 Dec 2007) | 3 lines
r86 | damowe | 2007-12-01 23:44:02 -0300 (Sat, 01 Dec 2007) | 2 lines
r85 | damowe | 2007-11-11 09:06:24 -0300 (Sun, 11 Nov 2007) | 4 lines
r84 | damowe | 2007-11-10 21:43:36 -0300 (Sat, 10 Nov 2007) | 2 lines
r83 | damowe | 2007-11-10 21:25:58 -0300 (Sat, 10 Nov 2007) | 2 lines
r82 | damowe | 2007-10-07 11:39:55 -0400 (Sun, 07 Oct 2007) | 3 lines
r81 | damowe | 2007-10-07 08:32:09 -0400 (Sun, 07 Oct 2007) | 3 lines
r80 | damowe | 2007-09-30 21:53:52 -0400 (Sun, 30 Sep 2007) | 3 lines
r79 | damowe | 2007-09-19 18:27:20 -0400 (Wed, 19 Sep 2007) | 2 lines
r78 | damowe | 2007-09-18 00:34:21 -0400 (Tue, 18 Sep 2007) | 2 lines
r77 | damowe | 2007-09-17 17:10:57 -0400 (Mon, 17 Sep 2007) | 3 lines
r76 | damowe | 2007-09-15 17:27:45 -0400 (Sat, 15 Sep 2007) | 2 lines
r75 | damowe | 2007-09-08 11:19:19 -0400 (Sat, 08 Sep 2007) | 2 lines
r74 | damowe | 2007-09-02 12:11:38 -0400 (Sun, 02 Sep 2007) | 2 lines
r73 | damowe | 2007-09-02 10:57:54 -0400 (Sun, 02 Sep 2007) | 2 lines
r72 | damowe | 2007-09-02 10:55:09 -0400 (Sun, 02 Sep 2007) | 2 lines
r71 | damowe | 2007-09-02 09:38:43 -0400 (Sun, 02 Sep 2007) | 5 lines
r70 | damowe | 2007-09-02 02:13:20 -0400 (Sun, 02 Sep 2007) | 4 lines
r69 | damowe | 2007-08-31 20:05:06 -0400 (Fri, 31 Aug 2007) | 3 lines
r68 | damowe | 2007-08-26 13:34:53 -0400 (Sun, 26 Aug 2007) | 2 lines
r67 | damowe | 2007-08-26 13:15:04 -0400 (Sun, 26 Aug 2007) | 3 lines
r66 | damowe | 2007-08-26 10:10:19 -0400 (Sun, 26 Aug 2007) | 3 lines
r65 | damowe | 2007-08-25 19:00:10 -0400 (Sat, 25 Aug 2007) | 3 lines
r64 | damowe | 2007-08-19 00:26:00 -0400 (Sun, 19 Aug 2007) | 3 lines
r63 | damowe | 2007-08-18 10:36:16 -0400 (Sat, 18 Aug 2007) | 3 lines
r62 | damowe | 2007-08-15 17:23:28 -0400 (Wed, 15 Aug 2007) | 2 lines
r61 | damowe | 2007-08-13 07:48:31 -0400 (Mon, 13 Aug 2007) | 3 lines
r60 | damowe | 2007-08-12 17:06:08 -0400 (Sun, 12 Aug 2007) | 2 lines
r59 | damowe | 2007-08-12 16:33:09 -0400 (Sun, 12 Aug 2007) | 3 lines
r58 | damowe | 2007-08-12 13:39:59 -0400 (Sun, 12 Aug 2007) | 2 lines
r57 | damowe | 2007-08-12 01:26:32 -0400 (Sun, 12 Aug 2007) | 2 lines
r56 | damowe | 2007-08-11 13:26:10 -0400 (Sat, 11 Aug 2007) | 2 lines
r55 | damowe | 2007-08-11 13:21:17 -0400 (Sat, 11 Aug 2007) | 3 lines
r54 | damowe | 2007-08-06 21:58:22 -0400 (Mon, 06 Aug 2007) | 2 lines
r53 | damowe | 2007-08-04 23:03:06 -0400 (Sat, 04 Aug 2007) | 3 lines
r52 | damowe | 2007-08-04 22:39:10 -0400 (Sat, 04 Aug 2007) | 3 lines
r51 | damowe | 2007-08-04 17:28:45 -0400 (Sat, 04 Aug 2007) | 2 lines
r50 | damowe | 2007-08-04 16:54:48 -0400 (Sat, 04 Aug 2007) | 2 lines
r49 | damowe | 2007-07-29 09:15:12 -0400 (Sun, 29 Jul 2007) | 2 lines
r48 | damowe | 2007-07-28 17:38:23 -0400 (Sat, 28 Jul 2007) | 2 lines
r47 | damowe | 2007-07-16 23:45:16 -0400 (Mon, 16 Jul 2007) | 3 lines
r46 | damowe | 2007-07-16 16:47:06 -0400 (Mon, 16 Jul 2007) | 3 lines
r45 | damowe | 2007-07-15 20:03:51 -0400 (Sun, 15 Jul 2007) | 3 lines
r44 | damowe | 2007-07-15 12:10:35 -0400 (Sun, 15 Jul 2007) | 3 lines
r43 | damowe | 2007-07-02 17:30:56 -0400 (Mon, 02 Jul 2007) | 2 lines
r42 | damowe | 2007-07-02 10:46:27 -0400 (Mon, 02 Jul 2007) | 3 lines
r41 | damowe | 2007-06-30 16:23:19 -0400 (Sat, 30 Jun 2007) | 2 lines
r40 | damowe | 2007-06-23 21:08:20 -0400 (Sat, 23 Jun 2007) | 3 lines
r39 | damowe | 2007-06-23 10:37:22 -0400 (Sat, 23 Jun 2007) | 2 lines
r38 | damowe | 2007-06-23 10:33:24 -0400 (Sat, 23 Jun 2007) | 2 lines
r37 | damowe | 2007-06-22 23:10:58 -0400 (Fri, 22 Jun 2007) | 3 lines
r36 | damowe | 2007-06-20 21:57:34 -0400 (Wed, 20 Jun 2007) | 3 lines
r35 | damowe | 2007-06-18 21:22:26 -0400 (Mon, 18 Jun 2007) | 3 lines
r34 | damowe | 2007-06-17 21:33:13 -0400 (Sun, 17 Jun 2007) | 2 lines
r33 | damowe | 2007-06-17 21:31:58 -0400 (Sun, 17 Jun 2007) | 2 lines
r32 | damowe | 2007-06-17 18:48:40 -0400 (Sun, 17 Jun 2007) | 3 lines
r31 | damowe | 2007-06-17 12:03:32 -0400 (Sun, 17 Jun 2007) | 3 lines
r30 | damowe | 2007-06-17 11:50:15 -0400 (Sun, 17 Jun 2007) | 2 lines
r29 | damowe | 2007-06-16 21:48:05 -0400 (Sat, 16 Jun 2007) | 2 lines
r28 | damowe | 2007-06-16 21:43:38 -0400 (Sat, 16 Jun 2007) | 3 lines
r27 | damowe | 2007-06-09 18:25:07 -0400 (Sat, 09 Jun 2007) | 2 lines
r26 | damowe | 2007-06-09 18:05:07 -0400 (Sat, 09 Jun 2007) | 2 lines
r25 | damowe | 2007-06-09 18:03:56 -0400 (Sat, 09 Jun 2007) | 3 lines
r24 | damowe | 2007-06-03 20:45:25 -0400 (Sun, 03 Jun 2007) | 3 lines
r23 | damowe | 2007-06-03 19:08:34 -0400 (Sun, 03 Jun 2007) | 2 lines
r22 | damowe | 2007-06-03 19:07:35 -0400 (Sun, 03 Jun 2007) | 2 lines
r21 | damowe | 2007-05-21 10:48:01 -0400 (Mon, 21 May 2007) | 2 lines
r20 | damowe | 2007-05-20 22:00:12 -0400 (Sun, 20 May 2007) | 2 lines
r19 | damowe | 2007-05-20 21:45:38 -0400 (Sun, 20 May 2007) | 6 lines
r18 | damowe | 2007-05-20 10:57:12 -0400 (Sun, 20 May 2007) | 2 lines
r17 | damowe | 2007-05-19 22:22:24 -0400 (Sat, 19 May 2007) | 5 lines
r16 | damowe | 2007-05-18 21:41:36 -0400 (Fri, 18 May 2007) | 2 lines
r15 | damowe | 2007-05-14 23:02:09 -0400 (Mon, 14 May 2007) | 3 lines
r14 | damowe | 2007-05-13 12:03:47 -0400 (Sun, 13 May 2007) | 2 lines
r13 | damowe | 2007-05-13 01:01:13 -0400 (Sun, 13 May 2007) | 2 lines
r12 | damowe | 2007-05-12 22:48:18 -0400 (Sat, 12 May 2007) | 2 lines
r11 | damowe | 2007-05-12 22:41:14 -0400 (Sat, 12 May 2007) | 3 lines
r10 | damowe | 2007-05-07 08:57:33 -0400 (Mon, 07 May 2007) | 2 lines
r9 | damowe | 2007-05-03 08:37:04 -0400 (Thu, 03 May 2007) | 3 lines
r8 | damowe | 2007-05-02 20:50:25 -0400 (Wed, 02 May 2007) | 3 lines
r7 | damowe | 2007-05-01 17:43:00 -0400 (Tue, 01 May 2007) | 2 lines
r6 | damowe | 2007-05-01 09:31:08 -0400 (Tue, 01 May 2007) | 2 lines
r5 | damowe | 2007-05-01 09:24:07 -0400 (Tue, 01 May 2007) | 1 line
r4 | damowe | 2007-05-01 09:08:02 -0400 (Tue, 01 May 2007) | 2 lines
r3 | damowe | 2007-05-01 09:05:41 -0400 (Tue, 01 May 2007) | 2 lines
r2 | damowe | 2007-05-01 09:04:51 -0400 (Tue, 01 May 2007) | 2 lines
r1 | damowe | 2007-05-01 09:04:22 -0400 (Tue, 01 May 2007) | 2 lines
</pre>
</div>
<p><br/></p>
<p>Both projects requires effort and research, and both project are not simple ones to handle, since they are written in <b>C</b>, a language difficult to learn and handle&#8230; I hope that I can continue the foss development that I&#8217;ve started, but seems that I have some health problems now :(</p>
<hr />
<p><small>© dmw for <a href="http://coder.cl">coder . cl</a>, 2010. |
<a href="http://coder.cl/2010/04/my-contribution-to-freeopen-source-software/">Permalink</a> |
<a href="http://coder.cl/2010/04/my-contribution-to-freeopen-source-software/#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://coder.cl/2010/04/my-contribution-to-freeopen-source-software/&title=my contribution to free/open source software">del.icio.us</a>
<br/>
Post tags: <br/>
<br/>
<a href='http://creativecommons.org/licenses/by-nc-sa/3.0/' title='Creative Commons'><img src="http://coder.cl.qfl.wpcdn.arcostream.com/images/creative-commons.png" alt="Creative Commons"> Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)</a>
</small></p>]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/04/my-contribution-to-freeopen-source-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for ( 2e96b290f6c5ccd2bc6830557c0aba6e coder.cl/category/programming/c/feed/ ) in 0.55537 seconds, on May 15th, 2012 at 11:48 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 22nd, 2012 at 11:48 pm UTC -->
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<!-- Quick Cache Is Fully Functional :-) ... A Quick Cache file was just served for ( 2e96b290f6c5ccd2bc6830557c0aba6e coder.cl/category/programming/c/feed/ ) in 0.00058 seconds, on May 18th, 2012 at 11:56 am UTC. -->
