<?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; programming</title>
	<atom:link href="http://coder.cl/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://coder.cl</link>
	<description>system programmer &#38; web developer</description>
	<lastBuildDate>Thu, 29 Jul 2010 21:52:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>c++ type casting operators</title>
		<link>http://coder.cl/2010/07/c-type-casting-operators/</link>
		<comments>http://coder.cl/2010/07/c-type-casting-operators/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 21:25:52 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=740</guid>
		<description><![CDATA[Traditionally, C programmers and Java programmers are accustomed to use the type casting form: (type)variable. C++, instead of that classical type casting form, has various type casting operators, used for different purposes. Each operator is used with different kinds of references, for example, you can not use the static_cast operator with virtual classes. Type casting [...]]]></description>
			<content:encoded><![CDATA[<p>Traditionally, <strong>C</strong> programmers and <strong>Java</strong> programmers are accustomed to use the type casting form: <i>(type)variable</i>. <strong>C++</strong>, instead of that classical type casting form, has various type casting operators, used for different purposes. Each operator is used with different kinds of references, for example, you can not use the <i>static_cast</i> operator with virtual classes. Type casting operators in <strong>C++</strong> has a syntax very similar to <i>C++ Templates</i>: <i>cast_operator&lt;type&gt;(variable)</i>.</p>
<p><span id="more-740"></span></p>
<p></p>
<h3>const_cast operators</h3>
<p>If you want an expression to being <i>const</i>, just use the <i>const_cast</i> operator. For example if a legacy function written in <i>C</i> requires of a <i>const</i> argument, just pass a non-const argument by using the <i>const_cast</i> operator:</p>
<pre name="code" class="cpp">
extern "C" {
    void my_function(const char *p);
};

std::string s = std::string("hello world");
my_function(const_cast&lt;char *&gt;(s.c_str()));
</pre>
<p></p>
<h3>static_cast operator</h3>
<p>The static_cast operator performs the conversion unconditionally, without verifying data types at <i>compile time</i>. This makes this operator quite dangerous, so, you need to verify data types before you use variables in this kind of type casting.</p>
<pre name="code" class="cpp">
if (typeid(*ptr_a) == typeid(MyClass)) {
    ptr_b = static_cast&lt;MyClass&gt;(ptr_a);
    ptr_b-&gt;applySomeMethod();
}
</pre>
<p>You can use the <i>typeid</i> C++ builtin to verify the data type. Also, you must consider that this operator is valid only if the conversion is explicit. Suppose <i>Parent</i> is a base class to <i>Child</i> and that <i>Unrelated</i> is an unrelated class. Then conversions from <i>Child</i> to <i>Parent</i> are valid, but a conversion from <i>Child</i> to <i>Unrelated</i> is disallowed:</p>
<pre name="code" class="cpp">
Parent a;
Child b;
Parent *a_1 = static_cast&lt;Parent *&gt;(&amp;b); // valid upcast
Unrelated *c_1 = static_cast&lt;Unrelated *&gt;(&amp;b_1); // invalid, Unrelated
</pre>
<p>The best usage for the <i>static_cast</i> opertaor, are numerical conversions, so you can cast from int, double, float and others of similar type to another int, double, float and similar types, including <i>enum types</i>. Some compilers does this kind of conversion explicit, but more strict compilers usually throw the proper warning on this kinds of assignment, without the proper type casting operation (line 4).</p>
<pre name="code" class="cpp">
float a;
int b;
a = static_cast&lt;float&gt;(b);
a = b;
</pre>
<p></p>
<h3>dynamic_cast operator</h3>
<p>The <i>dynamic_cast</i> operator, among other things, does a runtime check over types applied on the cast operation. As the above example of <i>static_cast</i> operator, dynamic cast does the <i>typeid()</i> checking. Then, if you have a pointer or reference to an object whose declared type is a base class, but you need to obtain a derived class pointer or reference, you should use <i>dynamic_cast</i>, since the <i>dynamic_cast</i> operator is another RTTI (<i>Run-time type information</i>) operator. The use of <i>dynamic_cast</i> derives into more overhead of your program, so you must use it with moderation.</p>
<pre name="code" class="cpp">
if (ptr_b == static_cast&lt;MyClass&gt;(ptr_a);) {
    ptr_b-&gt;applySomeMethod();
}
</pre>
<p>If the type checking and conversion fails, the operator returns a non-null reference, else it will return a null reference (zero). Also, some compilers will advice on the proper usage of the <i>dynamic_cast</i> operator, the more strict ones, will throw an error.</p>
<pre name="code" class="cpp">
Parent a;
Child b;
Parent *a_1 = dynamic_cast&lt;Parent *&gt;(&amp;b); // valid upcast
Unrelated *c_1 = dynamic_cast&lt;Unrelated *&gt;(&amp;b_1); // invalid, returns NULL
</pre>
<p></p>
<h3>reinterpret_cast operator</h3>
<p>This &mdash; possibly &mdash; is the most risky to use type casting operator. It completely transforms a pointer to very different types. For example:</p>
<pre name="code" class="cpp">
some_struct_s {
    short a;
    short b;
};
typedef struct some_struct_s some_struct_t;
some_struct_t *s;
unsigned long v = 0xd34db33f;
s = reinterpret_cast&lt;some_struct_t *&gt;(&amp;v);
std::cout &lt;&lt; s-&gt;a; // display first 2 bytes of value
</pre>
<p>As the example above, the pointer was completely transformed to different kind, with the dangerous assumption that the platform has a byte alignment that make possible to access the first to bytes of some address using this kind of operation. This cast is not portable, some compilers should throw some error about it.</p>
<p>The fact is that the <i>reinterpret_cast</i> operator overrides the initial declaration of the given variable, and makes possible to that variable to being reinterpreted as a different one. The usage of the <i>reinterpret_cast</i> must be done careful, for example for derived to base class reinterpretation.</p>
<pre name="code" class="cpp">
BaseClass a;
DerivedClass *c = reinterpret_cast&lt;DerivedClass *&gt;(&amp;a);
</pre>
<p>Since many of this kind of conversions are not possible in all compilers, you must try to setup your compiler to the most pedantic flags that it can allow. For example on GCC, you should use <i>-Wall -Wextra -Wshadow -pedantic -std=c++98</i> as compiler flags. It will keep your code portable and will allow you to create more standarized programs.</p>
<p>Here is a full compiling example of the core ideas in this post:</p>
<pre name='code' class='cpp'>

class A {
public:
	A();
	~A();
};

class B : public A {
public:
	B();
	~B();
};

A::A() {
}

A::~A() {
}

B::B() : A() {
}

B::~B() {
}

int
main(int argc, char **argv)
{

	A *ptr_a = new A();
	B *ptr_b = new B();

	A *a_1 = static_cast&lt;A *&gt;(ptr_b);
	B *b_1 = static_cast&lt;B *&gt;(ptr_a);

	A *a_2 = dynamic_cast&lt;A *&gt;(ptr_b);

	A *a_3 = reinterpret_cast&lt;A *&gt;(ptr_b);
	B *b_3 = reinterpret_cast&lt;B *&gt;(ptr_a);

	const A *a_4 = const_cast&lt;A *&gt;(ptr_a);
	const B *b_4 = const_cast&lt;B *&gt;(ptr_b);

	delete ptr_a;
	delete ptr_b;

	return 0;

}
</pre>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F&amp;title=c%2B%2B%20type%20casting%20operators&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Traditionally%2C%20C%20programmers%20and%20Java%20programmers%20are%20accustomed%20to%20use%20the%20type%20casting%20form%3A%20%28type%29variable.%20C%2B%2B%2C%20instead%20of%20that%20classical%20type%20casting%20form%2C%20has%20various%20type%20casting%20operators%2C%20used%20for%20different%20purposes.%20Each%20operator%20is%20used%20wi" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F&amp;title=c%2B%2B%20type%20casting%20operators&amp;notes=Traditionally%2C%20C%20programmers%20and%20Java%20programmers%20are%20accustomed%20to%20use%20the%20type%20casting%20form%3A%20%28type%29variable.%20C%2B%2B%2C%20instead%20of%20that%20classical%20type%20casting%20form%2C%20has%20various%20type%20casting%20operators%2C%20used%20for%20different%20purposes.%20Each%20operator%20is%20used%20wi" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F&amp;title=c%2B%2B%20type%20casting%20operators&amp;bodytext=Traditionally%2C%20C%20programmers%20and%20Java%20programmers%20are%20accustomed%20to%20use%20the%20type%20casting%20form%3A%20%28type%29variable.%20C%2B%2B%2C%20instead%20of%20that%20classical%20type%20casting%20form%2C%20has%20various%20type%20casting%20operators%2C%20used%20for%20different%20purposes.%20Each%20operator%20is%20used%20wi" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F&amp;title=c%2B%2B%20type%20casting%20operators" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F&amp;t=c%2B%2B%20type%20casting%20operators" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=c%2B%2B%20type%20casting%20operators%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fc-type-casting-operators%2F&amp;title=c%2B%2B%20type%20casting%20operators&amp;annotation=Traditionally%2C%20C%20programmers%20and%20Java%20programmers%20are%20accustomed%20to%20use%20the%20type%20casting%20form%3A%20%28type%29variable.%20C%2B%2B%2C%20instead%20of%20that%20classical%20type%20casting%20form%2C%20has%20various%20type%20casting%20operators%2C%20used%20for%20different%20purposes.%20Each%20operator%20is%20used%20wi" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/07/c-type-casting-operators/">Permalink</a> | <a href="http://coder.cl/2010/07/c-type-casting-operators/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/07/c-type-casting-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>configuring snmptrapd</title>
		<link>http://coder.cl/2010/07/configuring-snmptrapd/</link>
		<comments>http://coder.cl/2010/07/configuring-snmptrapd/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 23:28:27 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=703</guid>
		<description><![CDATA[snmptrapd(8) is a SNMP trap daemon, in other words, it captures SNMP notifications from the network and similar devices. In this post I will try to explain how to configure this daemon to allow a network server to process SNMP traps using both, embeded perl handlers for snmptrapd(8) and plain standard input &#8212; or stdin [...]]]></description>
			<content:encoded><![CDATA[<p><strong>snmptrapd(8)</strong> is a SNMP trap daemon, in other words, it captures SNMP notifications from the network and similar devices. In this post I will try to explain how to configure this daemon to allow a network server to process SNMP traps using both, embeded perl handlers for <strong>snmptrapd(8)</strong> and plain standard input &mdash; or <i>stdin</i> &mdash; handlers.</p>
<p><span id="more-703"></span></p>
<p></p>
<h3>daemon configuration</h3>
<p>The daemon is quite easy to configure, you must setup the <strong>snmptrapd.conf(5snmp)</strong> file. For this configuration, you must read your desired configuration options, such as <i>logging</i> and <i>execution</i>. For example if we have a <i>community</i> called <i>inetsnmp</i>, we can configure the file to allow traps from that community and also configure a trap handler written in perl.</p>
<pre name="code" class="bash">

# configure inetsnmp community to allow logging,
# execution of handlers and network traffic.
authCommunity   log,execute,net         inetsnmp

# perl embeded handler.
perl do "/usr/share/snmp/handler/trapdembed.pl"
</pre>
<p>This configuration is not enough, the <strong>snmptrapd(8)</strong> daemon uses <strong>hosts.allow(5)</strong> facility, so we need to add the proper rule in that file:</p>
<pre name="code" class="bash">

snmptrapd : 192.168.100.0/255.255.255.0 : allow
snmptrapd : 10.10.10.0/255.255.255.0 : allow
</pre>
<p></p>
<h3>the embeded perl handler</h3>
<pre name="code" class="perl">
#!/usr/bin/perl -w
#

# strict perl is better
use strict;
use FileHandle;
use Data::Dumper;
use NetSNMP::TrapReceiver;

# we create a sample/demo log file...
my $log = FileHandle-&gt;new(&quot;/var/log/snmptrapsample.log&quot;, &quot;a+&quot;) ||
    die &quot;Failed to open log file&quot;;

# how we process an SNMP variable
sub process_var {
    my ($var) = @_;
    my %res;
    my $name = &quot;$var-&gt;[0]&quot;;
    my ($vt, $vv) = split /: /, &quot;$var-&gt;[1]&quot;;
    $res{'oid'} = $name;
    $res{'type'} = $vt;
    $res{'value'} = $vv;
    return \%res;
}

# our default receiver
sub default_receiver {
    my ($pdu, $ivars) = @_;
    my %vars;
    $log-&gt;print(Dumper($pdu));
    foreach my $k (@{$_[1]}) {
        $vars{$k-&gt;[0]} = process_var($k);
    }
    $log-&gt;print(Dumper(\%vars));
    $log-&gt;flush;
}

# every OIDs pass through the default_receiver
NetSNMP::TrapReceiver::register(&quot;all&quot;, \&amp;default_receiver) ||
    die &quot;Failed to laod Sample Trap Receiver\n&quot;;

# status message...
print STDERR &quot;Loaded Sample Trap Receiver\n&quot;;
</pre>
<p>This <strong>perl(1)</strong> handler will allow you basically to create a handler which is capable to process SNMP notifications creating two main variables on the handler itself <i>$pdu</i> which is the reference to the <i>%pdu</i> hash and <i>%vars</i> hash. Both hashes contains the proper data to process the request as you want:</p>
<pre name="code" class="perl">

%pdu = {
    'notificationtype' =&gt; 'TRAP',
    'receivedfrom' =&gt; 'UDP: [10.10.10.1]:53951-&gt;[192.168.100.5]',
    'version' =&gt; 1,
    'errorstatus' =&gt; 0,
    'messageid' =&gt; 0,
    'community' =&gt; 'public',
    'transactionid' =&gt; 1,
    'errorindex' =&gt; 0,
    'requestid' =&gt; 1012897136
};

%vars = {
    'IF-MIB::ifDescr' =&gt; {
        'value' =&gt; 'eth0',
        'type' =&gt; 'STRING',
        'oid' =&gt; 'IF-MIB::ifDescr'
    },
    'IF-MIB::ifAdminStatus.1' =&gt; {
        'value' =&gt; '1',
        'type' =&gt; 'INTEGER',
        'oid' =&gt; 'IF-MIB::ifAdminStatus.1'
    },
    'DISMAN-EVENT-MIB::sysUpTimeInstance' =&gt; {
        'value' =&gt; '(0) 0:00:00.00',
        'type' =&gt; 'Timeticks',
        'oid' =&gt; 'DISMAN-EVENT-MIB::sysUpTimeInstance'
    },
    'IF-MIB::ifIndex.1' =&gt; {
        'value' =&gt; '1',
        'type' =&gt; 'INTEGER',
        'oid' =&gt; 'IF-MIB::ifIndex.1'
    },
    'SNMPv2-MIB::snmpTrapOID.0' =&gt; {
        'value' =&gt; 'IF-MIB::linkUp',
        'type' =&gt; 'OID',
        'oid' =&gt; 'SNMPv2-MIB::snmpTrapOID.0'
    },
    'IF-MIB::ifOperStatus.1' =&gt; {
        'value' =&gt; '1',
        'type' =&gt; 'INTEGER',
        'oid' =&gt; 'IF-MIB::ifOperStatus.1'
    }
};
</pre>
<p>Where each OID or variable, can be treated by using the <strong>NetSNMP::OID</strong> package. Fora <i>stdin</i> handler, if you don&#8217;t know about <strong>perl(1)</strong>, the difference is made on the <strong>snmptrapd.conf(5snmp)</strong> file, instead of configuring a global perl script which itself registers which OIDs will handle, you need to configure a global trap handler or each handler for each OID that you want to handle:</p>
<pre name="code" class="bash">

# configure inetsnmp community to allow logging,
# execution of handlers and network traffic.
authCommunity   log,execute,net         inetsnmp

traphandle     default           /usr/share/snmp/handler/defaultstding.py   default
traphandle     IF-MIB::linkUp    /usr/share/snmp/handler/ifuphandler.py     up
</pre>
<p>This will make your script or application to receive the OID data from <i>stdin</i> as follows:</p>
<pre>
router
UDP: [10.10.10.1]:37745->[192.168.100.5]
DISMAN-EVENT-MIB::sysUpTimeInstance 0:0:00:00.00
SNMPv2-MIB::snmpTrapOID.0 IF-MIB::linkUp
IF-MIB::ifIndex.1 1
IF-MIB::ifAdminStatus.1 up
IF-MIB::ifOperStatus.1 up
IF-MIB::ifDescr eth0
</pre>
<p>And also will require that you will enable in some manner the processing of that data as <i>plain text</i>.</p>
<p>Good luck configuring SNMP traps <img src='http://coder.cl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F&amp;title=configuring%20snmptrapd&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=snmptrapd%288%29%20is%20a%20SNMP%20trap%20daemon%2C%20in%20other%20words%2C%20it%20captures%20SNMP%20notifications%20from%20the%20network%20and%20similar%20devices.%20In%20this%20post%20I%20will%20try%20to%20explain%20how%20to%20configure%20this%20daemon%20to%20allow%20a%20network%20server%20to%20process%20SNMP%20traps%20using%20both%2C%20embed" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F&amp;title=configuring%20snmptrapd&amp;notes=snmptrapd%288%29%20is%20a%20SNMP%20trap%20daemon%2C%20in%20other%20words%2C%20it%20captures%20SNMP%20notifications%20from%20the%20network%20and%20similar%20devices.%20In%20this%20post%20I%20will%20try%20to%20explain%20how%20to%20configure%20this%20daemon%20to%20allow%20a%20network%20server%20to%20process%20SNMP%20traps%20using%20both%2C%20embed" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F&amp;title=configuring%20snmptrapd&amp;bodytext=snmptrapd%288%29%20is%20a%20SNMP%20trap%20daemon%2C%20in%20other%20words%2C%20it%20captures%20SNMP%20notifications%20from%20the%20network%20and%20similar%20devices.%20In%20this%20post%20I%20will%20try%20to%20explain%20how%20to%20configure%20this%20daemon%20to%20allow%20a%20network%20server%20to%20process%20SNMP%20traps%20using%20both%2C%20embed" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F&amp;title=configuring%20snmptrapd" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F&amp;t=configuring%20snmptrapd" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=configuring%20snmptrapd%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fconfiguring-snmptrapd%2F&amp;title=configuring%20snmptrapd&amp;annotation=snmptrapd%288%29%20is%20a%20SNMP%20trap%20daemon%2C%20in%20other%20words%2C%20it%20captures%20SNMP%20notifications%20from%20the%20network%20and%20similar%20devices.%20In%20this%20post%20I%20will%20try%20to%20explain%20how%20to%20configure%20this%20daemon%20to%20allow%20a%20network%20server%20to%20process%20SNMP%20traps%20using%20both%2C%20embed" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/07/configuring-snmptrapd/">Permalink</a> | <a href="http://coder.cl/2010/07/configuring-snmptrapd/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/07/configuring-snmptrapd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>query optimizations, quick recipes</title>
		<link>http://coder.cl/2010/07/query-optimizations-quick-recipes/</link>
		<comments>http://coder.cl/2010/07/query-optimizations-quick-recipes/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 13:13:24 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=694</guid>
		<description><![CDATA[Optimizing SQL queries is quite simple task, you just need to follow some rules on how you sort the filtering criteria and how you use your select statements. I will try to explain how you can optimize your queries in this post. named columns Use named columns, instead of using the * wildcard. For example: [...]]]></description>
			<content:encoded><![CDATA[<p>Optimizing SQL queries is quite simple task, you just need to follow some rules on how you sort the filtering criteria and how you use your select statements. I will try to explain how you can optimize your queries in this post.</p>
<p><span id="more-694"></span></p>
<p></p>
<h3>named columns</h3>
<p>Use named columns, instead of using the <strong>*</strong> wildcard. For example:</p>
<pre name='code' class='sql'>
select
    t.*
from
    tbl as t
where
    t.tab_date > current_date - interval 1 month
order by
    t.tab_date desc;
</pre>
<p>Will be more slower than:</p>
<pre name='code' class='sql'>
select
    t.tab_id,
    t.tab_state,
    t.tab_date,
    t.tab_name
from
    tbl as t
where
    t.tab_date > current_date - interval 1 month
order by
    t.tab_date desc
</pre>
<p></p>
<h3>join filtering</h3>
<p>If you filter on join, your query will be faster, for example:</p>
<pre name='code' class='sql'>
select
    t1.tab_id,
    coalesce(t2.tab_date, current_date) as tab_date,
    t1.tab_name
from
    table1 as t1
        left join table2 as t2 on (t1.tab_id = t2.tab_tab_id)
where
    t2.tab_date IS NULL or t2.tab_date > current_date - interval 1 month;
</pre>
<p>Will be more slower than</p>
<pre name='code' class='sql'>
select
    t1.tab_id,
    coalesce(t2.tab_date, current_date) as tab_date,
    t1.tab_name
from
    table1 as t1
        left join table2 as t2 on (t1.tab_id = t2.tab_tab_id
            and t2.tab_date > current_date - interval 1 month);
</pre>
<p></p>
<h3>smaller set first</h3>
<p>The smaller set must selected first, for example:</p>
<pre name='code' class='sql'>
select
    t1.tab_id,
    coalesce(t2.tab_date, current_date) as tab_date,
    t1.tab_name
from
    table1 as t1
        left join table2 as t2 on (t2.tab_tab_id = t1.tab_id
            and t2.tab_date > current_date - interval 1 month);
</pre>
<p>Will be more slower than:</p>
<pre name='code' class='sql'>
select
    t1.tab_id,
    coalesce(t2.tab_date, current_date) as tab_date,
    t1.tab_name
from
    table1 as t1
        left join table2 as t2 on (t1.tab_id = t2.tab_tab_id
            and t2.tab_date > current_date - interval 1 month);
</pre>
<p>Since <tt>t1</tt> has less rows than <tt>t2</tt>, and <tt>t2</tt> is referencing <tt>t1</tt>. Assuming that <tt>t1</tt> has a smaller set of rows and is the referenced table. This applies to column selection too and where statements.</p>
<p></p>
<h3>notes</h3>
<p>You must measure the time of your queries, so you can have a more precise query. Those rules are not <i>absolute</i>.</p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F&amp;title=query%20optimizations%2C%20quick%20recipes&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Optimizing%20SQL%20queries%20is%20quite%20simple%20task%2C%20you%20just%20need%20to%20follow%20some%20rules%20on%20how%20you%20sort%20the%20filtering%20criteria%20and%20how%20you%20use%20your%20select%20statements.%20I%20will%20try%20to%20explain%20how%20you%20can%20optimize%20your%20queries%20in%20this%20post.%0D%0A%0D%0A%0D%0Anamed%20columns%0D%0A%0D" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F&amp;title=query%20optimizations%2C%20quick%20recipes&amp;notes=Optimizing%20SQL%20queries%20is%20quite%20simple%20task%2C%20you%20just%20need%20to%20follow%20some%20rules%20on%20how%20you%20sort%20the%20filtering%20criteria%20and%20how%20you%20use%20your%20select%20statements.%20I%20will%20try%20to%20explain%20how%20you%20can%20optimize%20your%20queries%20in%20this%20post.%0D%0A%0D%0A%0D%0Anamed%20columns%0D%0A%0D" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F&amp;title=query%20optimizations%2C%20quick%20recipes&amp;bodytext=Optimizing%20SQL%20queries%20is%20quite%20simple%20task%2C%20you%20just%20need%20to%20follow%20some%20rules%20on%20how%20you%20sort%20the%20filtering%20criteria%20and%20how%20you%20use%20your%20select%20statements.%20I%20will%20try%20to%20explain%20how%20you%20can%20optimize%20your%20queries%20in%20this%20post.%0D%0A%0D%0A%0D%0Anamed%20columns%0D%0A%0D" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F&amp;title=query%20optimizations%2C%20quick%20recipes" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F&amp;t=query%20optimizations%2C%20quick%20recipes" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=query%20optimizations%2C%20quick%20recipes%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F07%2Fquery-optimizations-quick-recipes%2F&amp;title=query%20optimizations%2C%20quick%20recipes&amp;annotation=Optimizing%20SQL%20queries%20is%20quite%20simple%20task%2C%20you%20just%20need%20to%20follow%20some%20rules%20on%20how%20you%20sort%20the%20filtering%20criteria%20and%20how%20you%20use%20your%20select%20statements.%20I%20will%20try%20to%20explain%20how%20you%20can%20optimize%20your%20queries%20in%20this%20post.%0D%0A%0D%0A%0D%0Anamed%20columns%0D%0A%0D" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/07/query-optimizations-quick-recipes/">Permalink</a> | <a href="http://coder.cl/2010/07/query-optimizations-quick-recipes/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/07/query-optimizations-quick-recipes/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>Daniel Molina Wegener</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>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F&amp;title=%5BANN%5D%20pyxser-1.4.4r%20was%20released&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Hello%2C%20today%20I%27ve%20released%20pyxser-1.4.4r%2C%20the%20publishing%20message%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A%0D%0AHello%20Python%20Community.%0D%0A%0D%0AI%27m%20pleased%20to%20announce%20pyxser-1.4.4r%2C%20a%20python%20extension%20which%20contains%20functions%20to%20serialize%20and%20deserialize%20Python%20Objects%20into%20XML." title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F&amp;title=%5BANN%5D%20pyxser-1.4.4r%20was%20released&amp;notes=Hello%2C%20today%20I%27ve%20released%20pyxser-1.4.4r%2C%20the%20publishing%20message%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A%0D%0AHello%20Python%20Community.%0D%0A%0D%0AI%27m%20pleased%20to%20announce%20pyxser-1.4.4r%2C%20a%20python%20extension%20which%20contains%20functions%20to%20serialize%20and%20deserialize%20Python%20Objects%20into%20XML." title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F&amp;title=%5BANN%5D%20pyxser-1.4.4r%20was%20released&amp;bodytext=Hello%2C%20today%20I%27ve%20released%20pyxser-1.4.4r%2C%20the%20publishing%20message%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A%0D%0AHello%20Python%20Community.%0D%0A%0D%0AI%27m%20pleased%20to%20announce%20pyxser-1.4.4r%2C%20a%20python%20extension%20which%20contains%20functions%20to%20serialize%20and%20deserialize%20Python%20Objects%20into%20XML." title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F&amp;title=%5BANN%5D%20pyxser-1.4.4r%20was%20released" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F&amp;t=%5BANN%5D%20pyxser-1.4.4r%20was%20released" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%5BANN%5D%20pyxser-1.4.4r%20was%20released%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F06%2Fann-pyxser-1-4-4r-was-released%2F&amp;title=%5BANN%5D%20pyxser-1.4.4r%20was%20released&amp;annotation=Hello%2C%20today%20I%27ve%20released%20pyxser-1.4.4r%2C%20the%20publishing%20message%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A%0D%0AHello%20Python%20Community.%0D%0A%0D%0AI%27m%20pleased%20to%20announce%20pyxser-1.4.4r%2C%20a%20python%20extension%20which%20contains%20functions%20to%20serialize%20and%20deserialize%20Python%20Objects%20into%20XML." title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener 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><br/>Post tags: <br/></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>database usage rules</title>
		<link>http://coder.cl/2010/04/database-usage-rules/</link>
		<comments>http://coder.cl/2010/04/database-usage-rules/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 14:39:55 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=683</guid>
		<description><![CDATA[Modelling databases is not a simple task. Many times we found some misspelled words, mixed case words and some horrifying things on many databases of third party systems. My rules are simple to follow, and most of them ensures a well designed database, with special care on how do we query that database, creating reliable [...]]]></description>
			<content:encoded><![CDATA[<p>Modelling databases is not a simple task. Many times we found some misspelled words, mixed case words and some horrifying things on many databases of third party systems. My rules are simple to follow, and most of them ensures a well designed database, with special care on how do we query that database, creating reliable and optimised for speed table design and queries.</p>
<p><span id="more-683"></span></p>
<p><br/></p>
<h3>table design</h3>
<p>You must follow a simple rule, <i>fixed length</i> data types goes first, from the one that fits with <i>CPU register length</i> to those types that have variable length. For example a a simple table design for MySQL could be as follows:</p>
<pre name='code' class='sql'>
CREATE TABLE customer
(
    customer_id bigint(11) NOT NULL AUTO_INCREMENT,
    cus_priority int NOT NULL,
    cus_state int NOT NULL,
    cus_products int NOT NULL,
    cus_date datetime NOT NULL,
    cus_name varchar(100) NOT NULL,
    cus_email varchar(50) NOT NULL,
    PRIMARY KEY USING BTREE (customer_id)
)
ENGINE= InnoDB DEFAULT CHARSET= utf8
</pre>
<p>If you take a look on the column order, fixed length table keys have the first priority, fixed length data types have the second priority and the last priority on the table creation script is for those types with variable length. From the perspective of the RDBMS system that we are using, the table structure is read the first time that we query the table, then each fixed length column is read in sequence as the RDBMS systems reads each row from the disk or memory, hence each non-fixed length column is read consequently each time that a row is handled, reading the column length first and then skipping the column offset on the disk or memory to handle the next column. So, reading non-fixed length columns is hard for the RDBMS.</p>
<p>Imagine those tables created with <i>variable length keys</i>!, those tables are creating a heavy overhead on any kind of table created. So, try to use table keys of fixed length, such as <i>int</i> and <i>bigint</i>. Including those tables which have a fixed length made of <i>char(n)</i>, are creating a heavy overhead, since those tables are using <i>string comparison algorithms</i> instead of <i>memory block</i> comparison, such as comparing integer types, which is more easy to handle.</p>
<p>Using a naming convention matters too. The table above has a lowercase name, lower case table fields and each field has a prefix related to the table. Why does they have a prefix?, while we are querying a table is more comfortable to identify them by the prefix that they have, specially when we are creating joined queries, allowing unique column identifiers.</p>
<p><br/></p>
<h3>query optimisation</h3>
<p>Some older RDBMS systems do not support the usage of the <i>join</i> keyword, so we must create joined queries using the <i>where</i> statement. But nowdays in most RDBMS systems supports the <i>join</i> keyword, allowing more faster queries, so there is a technique allowing us to create joins from the older way of using <i>where</i> statements.</p>
<pre name='code' class='sql'>
select
    pro.product_id,
    pro.pro_name,
    sum(coalesce(pay.pay_price, 0.0)) as payment
from
    product as pro
        left join subscription as sus on (pro.product_id = sus.product_id)
        left join payment as pay on (sus.payment_id = pay.payment_id)
group by
    pro.product_id,
    pro.pro_name
order by
    pro.product_id,
    pro.pro_name
</pre>
<p>The query above will bring us a report about <i>payments</i> related to each product on the database. If you see there is no where statement. Also, examine the join conditionals, the <i>smallest</i> dataset is filtered at the <i>left side</i> of the conditional. The more we filter on the join conditionals, faster is the query result. That query took just <i>0.002</i> seconds. Let&#8217;s see what happens with a non-joined query and using the <i>where</i> statement.</p>
<pre name='code' class='sql'>
select
    pro.product_id,
    pro.pro_name,
    sum(coalesce(pay.pay_price, 0.0)) as payments
from
    product as pro,
    subscription as sus,
    payment as pay
where
    (pro.product_id = sus.product_id and sus.product_id is not null)
    and (pro.product_id = sus.product_id or sus.product_id is null)
    and (sus.payment_id = pay.payment_id or pay.payment_id is null)
group by
    pro.product_id,
    pro.pro_name
order by
    pro.product_id,
    pro.pro_name
</pre>
<p>Using the <i>where</i> statement, the same query took <i>0.012</i> seconds. What happened behind on the RDBMS side? On the first query, row filtering was made while the RDBMS was reading rows from each table, hence on the second query, the selection was made over the complete dataset retrieved from all selection tables. In this case we have an enhancement of <i>600%</i> on performance, on more complex queries the same happens. Also the <i>having</i> clause is evil too, since it process those rows retrieved after the selection process on those rows retrieved on at last.</p>
<pre name='code' class='sql'>

select
    pro.product_id,
    pro.pro_name,
    sum(coalesce(pay.pay_price, 0.0)) as payment
from
    product as pro
        left join subscription as sus on (pro.product_id = sus.product_id)
        left join payment as pay on (sus.payment_id = pay.payment_id)
group by
    pro.product_id,
    pro.pro_name
having
    payment > 200000
order by
    pro.product_id,
    pro.pro_name
</pre>
<p>The <i>having</i> clause can process <i>aggregate columns</i>, but that processing is made at end of the selection process, so you must try to replace that <i>having</i> clause by other join or where statement if you have an option to do that.</p>
<p><br/></p>
<h3>rdbms tuning</h3>
<p>Each RDBMS has its own parameters. For example, MySQL have some parameters which allow you to have entire tables on memory, so most queries to those tables in memory are faster than reading the hard drive. If you have a system that is querying a database concurrently, you should increase the memory limit, allowing the RDBMS to maintain that table on memory. You must research which options fits for better on the RDBMS that you are using, which kind of keys and table format fits better with your needs. For example on MySQL InnoDB table format is not always the best option, since InnoDB require the highest resource usage, over other kind of tables available on MySQL RDBMS.</p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F&amp;title=database%20usage%20rules&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Modelling%20databases%20is%20not%20a%20simple%20task.%20Many%20times%20we%20found%20some%20misspelled%20words%2C%20mixed%20case%20words%20and%20some%20horrifying%20things%20on%20many%20databases%20of%20third%20party%20systems.%20My%20rules%20are%20simple%20to%20follow%2C%20and%20most%20of%20them%20ensures%20a%20well%20designed%20databas" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F&amp;title=database%20usage%20rules&amp;notes=Modelling%20databases%20is%20not%20a%20simple%20task.%20Many%20times%20we%20found%20some%20misspelled%20words%2C%20mixed%20case%20words%20and%20some%20horrifying%20things%20on%20many%20databases%20of%20third%20party%20systems.%20My%20rules%20are%20simple%20to%20follow%2C%20and%20most%20of%20them%20ensures%20a%20well%20designed%20databas" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F&amp;title=database%20usage%20rules&amp;bodytext=Modelling%20databases%20is%20not%20a%20simple%20task.%20Many%20times%20we%20found%20some%20misspelled%20words%2C%20mixed%20case%20words%20and%20some%20horrifying%20things%20on%20many%20databases%20of%20third%20party%20systems.%20My%20rules%20are%20simple%20to%20follow%2C%20and%20most%20of%20them%20ensures%20a%20well%20designed%20databas" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F&amp;title=database%20usage%20rules" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F&amp;t=database%20usage%20rules" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=database%20usage%20rules%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fdatabase-usage-rules%2F&amp;title=database%20usage%20rules&amp;annotation=Modelling%20databases%20is%20not%20a%20simple%20task.%20Many%20times%20we%20found%20some%20misspelled%20words%2C%20mixed%20case%20words%20and%20some%20horrifying%20things%20on%20many%20databases%20of%20third%20party%20systems.%20My%20rules%20are%20simple%20to%20follow%2C%20and%20most%20of%20them%20ensures%20a%20well%20designed%20databas" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/04/database-usage-rules/">Permalink</a> | <a href="http://coder.cl/2010/04/database-usage-rules/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/04/database-usage-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>using dependency injection on gui</title>
		<link>http://coder.cl/2010/04/using-dependency-injection-on-gui/</link>
		<comments>http://coder.cl/2010/04/using-dependency-injection-on-gui/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 17:04:32 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=670</guid>
		<description><![CDATA[Many people know the Model View Controller architectural pattern. Another interesting pattern is Presentation Abstraction Control architectural pattern. We can implement it using Dependency Injection or similar Inversion of Control patterns. So, when we are modeling solutions, we many times leave the control or business logic on the Controller. This will guide us to a [...]]]></description>
			<content:encoded><![CDATA[<p>Many people know the <i>Model View Controller</i> architectural pattern. Another interesting pattern is <i>Presentation Abstraction Control</i> architectural pattern. We can implement it using <i>Dependency Injection</i> or similar <i>Inversion of Control</i> patterns. So, when we are modeling solutions, we many times leave the control or business logic on the <i>Controller</i>. This will guide us to a very coupled platform. Remember that any well designed architecture claims for cohesion instead of coupling its components. On this article I will try to analyze the use of IoC on the PAC pattern, so we can have more maintainable software components, mainly on <i>n-tier architectures</i>.</p>
<p><span id="more-670"></span></p>
<p><br/></p>
<h3>control classes and interfaces</h3>
<p>We can hold our business logic on separate classes. As example we will use a <i>bank loan</i> application, which is supposed to bring us the proper load for certain kind of customers of a bank. So, we need to define an interface pf the loan component.</p>
<pre name='code' class='java'>
interface Loan {
    void setUserData(User bankUser);
    void setCustomerData(Customer cus, Account acc);
    LoanResults getLoanResults();
}
</pre>
<p>This simple interface should be implemented by a variety of Loan types, from consumer ones to mortgage ones, since this variety of loans have different evaluation and estimation logic.</p>
<div style='border: 1px solid #000; text-align: center; overflow: scroll;'>
<img src='http://coder.cl/uploads/2010/04/loan-classes.png' title='Loan Classes' alt='Loan Classes' width='510'>
</div>
<p>Now we need to define a way to instantiate the proper Loan implementation. The proper Loan implementation request is on the hands of the control layer, since the Loan interface is the <i>abstraction</i> layer itself. So, if we have to need the same methods for every Loan that we request, we just use a <i>Factory Pattern</i> returning the interface Loan, instead of his real implementation.</p>
<p><br/></p>
<h3>the abstraction layer</h3>
<p>The abstraction layer is implemented on the Loan interface and its returning implementation based on the factory pattern. So we need to implement the factory outside of the package that holds that set of interfaces and implementations. The factory also hold the logic that <i>decides</i> which Loan implementation will be returned, based on the user data, customer data and account data. So we need a call similar to this one:</p>
<pre name='code' class='java'>
Loan loanRequest = LoanFactory.getInstance(data);
LoanResults requestResults = loanRequest.getLoanResults();
</pre>
<p>So, the <i>factory</i> and the <i>loan interface</i> holds the abstraction layer, separating the decoupling the business logic from its real implementation and generating more cohesion. What does the loan request form in the application about those components? The answer is quiet simple: nothing. We will use another pattern to hold input data and pass it through the abstraction layer from the presentation layer. Here is when we are doing <i>dependency injection</i>.</p>
<p><br/></p>
<h3>the presentation layer</h3>
<p>The presentation layer, which in this case holds a simple <i>LoanRequestForm</i> will never know which concrete class will be used to deliver the <i>LoanResults</i>, so we have to define an instance of another pattern, an <i>Adapter</i>. The adapter should transform the input data from the LoanRequestForm to some kind of Data Transfer Object, to be passed to the factory as CustomerData.</p>
<pre name='code' class='java'>
class LoanRequestForm {
    protected Customer cus;
    protected User usr;
    protected Account acc;
    protected LoanRequestFormAdapter adapter = new LoanRequestFormAdapter();
    protected Loan loanRequest;

    LoanResults getLoanResults() {
        try {
            loanRequest = LoanFactory.getInstance(adapter.transform(this));
            LoanResults requestResults = loanRequest.getLoanResults();
            return requestResults;
        } catch (InvalidDataException ex) {
            log.error(ex);
        }
    }
}
</pre>
<p>Here we are injecting a dependency for the LoanRequestForm and also we acquiring abstraction through the LoanFactory, transforming its input using the LoanRequestFormAdapter to transform the form data into a DTO (Data Transfer Object). The business logic is completely separated from the its User Interface and the abstraction layer. So we are fitting the model with PAC pattern and the IoC DI pattern at once.</p>
<div style='border: 1px solid #000; text-align: center; overflow: scroll;'>
<img src='http://coder.cl/uploads/2010/04/di-pattern-pac-pattern.png' title='Loan Classes' alt='Loan Classes' width='510'>
</div>
<p>The transformation between the form and the factory is a must. The factory can not depend on the form and the form can not depend on the factory. The adapter plays an important role here, since it&#8217;s separating layers and transforming the application into an <i>n-tier architected</i> application, so we have more control over changes and possible enhancements on the model. Also it will bring us possible automated processes, since the factory do not needs the form to operate over the loan. So you build another application that just handles the user data and generate loan bids automatically to the customers based on the same logic, then we are reusing the properly the code.</p>
<p><br/></p>
<h3>conclusion</h3>
<p>We can glue the PAC pattern with IoC DI pattern, so we have more reliable and flexible GUI implementations, then we can work in our platforms without worries about how to generate reusable code if we follow well designed and well applied patterns. Also we can use frameworks, but it depends on the application size and how do need to work on it. For an application with just two active forms, we do not need large scale architectures.</p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F&amp;title=using%20dependency%20injection%20on%20gui&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Many%20people%20know%20the%20Model%20View%20Controller%20architectural%20pattern.%20Another%20interesting%20pattern%20is%20Presentation%20Abstraction%20Control%20architectural%20pattern.%20We%20can%20implement%20it%20using%20Dependency%20Injection%20or%20similar%20Inversion%20of%20Control%20patterns.%20So%2C%20when" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F&amp;title=using%20dependency%20injection%20on%20gui&amp;notes=Many%20people%20know%20the%20Model%20View%20Controller%20architectural%20pattern.%20Another%20interesting%20pattern%20is%20Presentation%20Abstraction%20Control%20architectural%20pattern.%20We%20can%20implement%20it%20using%20Dependency%20Injection%20or%20similar%20Inversion%20of%20Control%20patterns.%20So%2C%20when" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F&amp;title=using%20dependency%20injection%20on%20gui&amp;bodytext=Many%20people%20know%20the%20Model%20View%20Controller%20architectural%20pattern.%20Another%20interesting%20pattern%20is%20Presentation%20Abstraction%20Control%20architectural%20pattern.%20We%20can%20implement%20it%20using%20Dependency%20Injection%20or%20similar%20Inversion%20of%20Control%20patterns.%20So%2C%20when" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F&amp;title=using%20dependency%20injection%20on%20gui" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F&amp;t=using%20dependency%20injection%20on%20gui" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=using%20dependency%20injection%20on%20gui%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fusing-dependency-injection-on-gui%2F&amp;title=using%20dependency%20injection%20on%20gui&amp;annotation=Many%20people%20know%20the%20Model%20View%20Controller%20architectural%20pattern.%20Another%20interesting%20pattern%20is%20Presentation%20Abstraction%20Control%20architectural%20pattern.%20We%20can%20implement%20it%20using%20Dependency%20Injection%20or%20similar%20Inversion%20of%20Control%20patterns.%20So%2C%20when" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/04/using-dependency-injection-on-gui/">Permalink</a> | <a href="http://coder.cl/2010/04/using-dependency-injection-on-gui/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/04/using-dependency-injection-on-gui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a perspective on code quality</title>
		<link>http://coder.cl/2010/04/a-perspective-on-code-quality/</link>
		<comments>http://coder.cl/2010/04/a-perspective-on-code-quality/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 14:31:54 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=665</guid>
		<description><![CDATA[How can we measure the software quality? There are many perspectives on that issue of software development. Matthew Wilson has spotted some evaluations that we can follow to improve the quality of our code and bring us a wide perspective on what does matter when we are evaluating the software quality. Correctness: Software correctness can [...]]]></description>
			<content:encoded><![CDATA[<p>How can we measure the software quality? There are many perspectives on that issue of software development. Matthew Wilson has spotted some evaluations that we can follow to improve the quality of our code and bring us a wide perspective on what does matter when we are evaluating the software quality.</p>
<p><span id="more-665"></span></p>
<ul>
<li><strong>Correctness</strong>:
<p>Software correctness can be established using many techniques and tools, from <i>static analysis</i>, <i>runtime checkers</i> and <i>formal verification</i>. So we have enough tools to determine whether or not the software is correct. Also we can search for the proper algorithm, previously verified and tested to being used in our software.</p>
</li>
<li><strong>Robustness</strong>:
<p>We must try to create small and efficient code, regarding correctness and documenting it, so can create hardened code based on common standards to allow reliable modifications while we are maintaining the code. <a href='http://en.wikipedia.org/wiki/Jon_Postel'>Jon Postel</a>&#8216;s law says: <i>&quot;Be conservative in what you do; be liberal in what you accept from others&quot;</i>. This also reduces the amount of bugs that you can find on your applications.</p>
</li>
<li><strong>Efficiency</strong>:
<p>Efficient code has lower times and reduced cyclomatic complexity. For example we must prefer a construct that is <i>O(1)</i> instead of one that is <i>O(n)</i>, if it is available, and we must prefer a construct that has a cyclomatic complexity of <i>78</i> rather than other with <i>129</i>: <i>&quot;simplicity is divine&quot;</i>.</p>
</li>
<li><strong>Portability</strong>:
<p>The code must be portable. To create portable code we must simply omit the usage of language/platform specific features. There many standards that we can follow to create portable code and there also are compiler options to help us in that task. For example, GCC supports pedantic compiling flags to regard the strictness of some standards, try compiling your C code with: <tt>-Wall -Wextra -Wshadow -pedantic -std=c99</tt>, or your C++ code with: <tt>-Wall -Wextra -Wshadow -pedantic -std=c++98</tt>. Also there is a compiler with the portability issue in mind, the <a href='http://en.wikipedia.org/wiki/Tendra'>TENDRA</a> compiler, it comes with a <i>static analysis</i> tool too.</p>
</li>
<li><strong>Expressiveness</strong>:
<p>We must create legible code, this principle holds well known coding standards, naming conventions and similar scopes on how do we write the code, to let others read your code and understand it with a faster lookup to the documentation. Also documenting the code is a must. I&#8217;m sure that you can follow some standard on coding.</p>
</li>
<li><strong>Flexibility</strong>:
<p>We must try to use abstraction in our code, instead of concrete system calls. For example we have <i>dirent</i> on UNIX and <i>WIN32_FIND_DATA</i> on Windows, both structures are completely different and most Win32 API calls aren&#8217;t based on any known standard, so we need to create or use some kind of abstraction to access the system calls, like the <i>Façade</i> design pattern, to allow us to omit direct calls and create more flexible code, and easy to maintain.</p>
</li>
<li><strong>Modularity</strong>:
<p>It&#8217;s fully recommended that we must think on terms of OOP. For C programmers the book <i>&quot;<a href='http://www.planetpdf.com/codecuts/pdfs/ooc.pdf'>Object-oriented programming with ANSI-C</a>&quot;</i> possibly is a must read. Modularity bring us the robustness needed to operate on terms of cohesion, like any desired architecture, we want to implement <i>cohesion</i> instead of <i>attachment</i>, so we can create reusable code and modules.</p>
</li>
<li><strong>Discoverability</strong>:
<p>legible and modular code bring us a good discoverability, so we can establish good basis on well known standard APIs, like POSIX, C++0x and many others. This regards the intuitive approach of building portable code, so we can guess about how is called the function or class that we need to use in our problem.</p>
</li>
<li><strong>Transparency</strong>:
<p>In conjunction with modularity, transparency can bring us the proper cohesion between our software components. The proper abstraction layer between the application tiers allow us to create individual components that work together without <i>attachment</i> and with the proper <i>cohesion</i>. So the maintainability of the application becomes higher and easy.</p>
</ul>
<p>And here comes some questions: How can we measure all those points?; How can we become more strict and bring more reliable applications?. We must follow some steps to reach optimal software development process. The first one is to define the <i>application architecture</i>, so we can handle common problems with the proper <i>architectural patterns</i>. Then we must fit those <i>architectural patterns</i> with the proper <i>design patterns</i>. One time defined the <i>application architecture</i> we must design our components following that architecture. If we are using <i>Agile Methodologies</i>, we need a well defined architecture too, so we can follow a common paradigm on <i>how to solve</i> the problem that the application is solving.</p>
<p>Using third party frameworks or third party libraries is not a bad practice, but we must be constantly following its <i>roadmap</i>, looking the direction that the library or framework is following, so we can handle properly an incoming and imminent update. How to handle that issue?, using abstractions and modularity, which also reduces the amount of bugs. Here some patterns plays an important role in our quality goals, for example the <i>façade</i>, <i>factory</i> and <i>dependency inyection</i> patterns would help us on that task.</p>
<p><br/></p>
<h3>conclusion</h3>
<p>The more rigorous we are, we can get more reliable software. But sometimes we don&#8217;t have enough time or simply we don&#8217;t need to be too rigurous, for example we can not apply <i>formal verification</i> to enterprise applications, because usually those applications have millions of lines of code, instead possibly we can deliver just one module at time that has been verified formally. Instead we can use <i>metrics analyzers</i>, <i>static analyzers</i> and <i>runtime checkers</i> to bring us a better approach on how the code is working. You can learn <i>code hardening</i> techniques and <i>debugging techniques</i> to ensure your code too, which will bring you a better code if you get well taught on those topics.</p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F&amp;title=a%20perspective%20on%20code%20quality&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=How%20can%20we%20measure%20the%20software%20quality%3F%20There%20are%20many%20perspectives%20on%20that%20issue%20of%20software%20development.%20Matthew%20Wilson%20has%20spotted%20some%20evaluations%20that%20we%20can%20follow%20to%20improve%20the%20quality%20of%20our%20code%20and%20bring%20us%20a%20wide%20perspective%20on%20what%20does" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F&amp;title=a%20perspective%20on%20code%20quality&amp;notes=How%20can%20we%20measure%20the%20software%20quality%3F%20There%20are%20many%20perspectives%20on%20that%20issue%20of%20software%20development.%20Matthew%20Wilson%20has%20spotted%20some%20evaluations%20that%20we%20can%20follow%20to%20improve%20the%20quality%20of%20our%20code%20and%20bring%20us%20a%20wide%20perspective%20on%20what%20does" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F&amp;title=a%20perspective%20on%20code%20quality&amp;bodytext=How%20can%20we%20measure%20the%20software%20quality%3F%20There%20are%20many%20perspectives%20on%20that%20issue%20of%20software%20development.%20Matthew%20Wilson%20has%20spotted%20some%20evaluations%20that%20we%20can%20follow%20to%20improve%20the%20quality%20of%20our%20code%20and%20bring%20us%20a%20wide%20perspective%20on%20what%20does" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F&amp;title=a%20perspective%20on%20code%20quality" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F&amp;t=a%20perspective%20on%20code%20quality" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=a%20perspective%20on%20code%20quality%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-perspective-on-code-quality%2F&amp;title=a%20perspective%20on%20code%20quality&amp;annotation=How%20can%20we%20measure%20the%20software%20quality%3F%20There%20are%20many%20perspectives%20on%20that%20issue%20of%20software%20development.%20Matthew%20Wilson%20has%20spotted%20some%20evaluations%20that%20we%20can%20follow%20to%20improve%20the%20quality%20of%20our%20code%20and%20bring%20us%20a%20wide%20perspective%20on%20what%20does" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/04/a-perspective-on-code-quality/">Permalink</a> | <a href="http://coder.cl/2010/04/a-perspective-on-code-quality/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/04/a-perspective-on-code-quality/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>Daniel Molina Wegener</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 style='border: 1px solid #000; width: 600px; overflow: scroll;'>
<img src='http://coder.cl/uploads/2010/04/pyxser-last-12months.png' border='0' width='510' />
</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 style='border: 1px solid #000; width: 600px; overflow: scroll;'>
<img src='http://coder.cl/uploads/2010/04/caffeine-last-year.png' border='0' width='510' />
</div>
<div style='border: 1px solid #000; width: 600px; overflow: scroll;'>
<img src='http://coder.cl/uploads/2010/04/caffeine-2009.png' border='0' width='510' />
</div>
<div style='border: 1px solid #000; width: 600px; overflow: scroll;'>
<img src='http://coder.cl/uploads/2010/04/caffeine-2008.png' border='0' width='510' />
</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 <img src='http://coder.cl/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F&amp;title=my%20contribution%20to%20free%2Fopen%20source%20software&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=I%27ve%20worked%20on%20FOSS%20for%20years.%20Currently%20I%20have%20two%20active%20projects%20pyxser%20and%20caffeine.%20Both%20of%20them%20requires%20a%20great%20effort%20to%20being%20completed.%20Take%20an%20overview%20on%20their%20development%3A%0D%0A%0D%0Apyxser%0D%0A%0D%0Apyxser%20have%20about%20one%20year%20of%20development%2C%20some%20mont" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F&amp;title=my%20contribution%20to%20free%2Fopen%20source%20software&amp;notes=I%27ve%20worked%20on%20FOSS%20for%20years.%20Currently%20I%20have%20two%20active%20projects%20pyxser%20and%20caffeine.%20Both%20of%20them%20requires%20a%20great%20effort%20to%20being%20completed.%20Take%20an%20overview%20on%20their%20development%3A%0D%0A%0D%0Apyxser%0D%0A%0D%0Apyxser%20have%20about%20one%20year%20of%20development%2C%20some%20mont" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F&amp;title=my%20contribution%20to%20free%2Fopen%20source%20software&amp;bodytext=I%27ve%20worked%20on%20FOSS%20for%20years.%20Currently%20I%20have%20two%20active%20projects%20pyxser%20and%20caffeine.%20Both%20of%20them%20requires%20a%20great%20effort%20to%20being%20completed.%20Take%20an%20overview%20on%20their%20development%3A%0D%0A%0D%0Apyxser%0D%0A%0D%0Apyxser%20have%20about%20one%20year%20of%20development%2C%20some%20mont" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F&amp;title=my%20contribution%20to%20free%2Fopen%20source%20software" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F&amp;t=my%20contribution%20to%20free%2Fopen%20source%20software" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=my%20contribution%20to%20free%2Fopen%20source%20software%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fmy-contribution-to-freeopen-source-software%2F&amp;title=my%20contribution%20to%20free%2Fopen%20source%20software&amp;annotation=I%27ve%20worked%20on%20FOSS%20for%20years.%20Currently%20I%20have%20two%20active%20projects%20pyxser%20and%20caffeine.%20Both%20of%20them%20requires%20a%20great%20effort%20to%20being%20completed.%20Take%20an%20overview%20on%20their%20development%3A%0D%0A%0D%0Apyxser%0D%0A%0D%0Apyxser%20have%20about%20one%20year%20of%20development%2C%20some%20mont" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener 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><br/>Post tags: <br/></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>
		<item>
		<title>[ann] pyxser-1.4.2r available</title>
		<link>http://coder.cl/2010/02/ann-pyxser-1-4-2r-available/</link>
		<comments>http://coder.cl/2010/02/ann-pyxser-1-4-2r-available/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 22:05:16 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<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=622</guid>
		<description><![CDATA[Dear pyxser users, I&#8217;m pleased to announce that I&#8217;ve released pyxser-1.4.2r. The current ChangeLog for this release is as follows: 1.4.2r (2010.02.10): Daniel Molina Wegener &#60;dmw at coder dot cl&#62; * pyxser_collections.c: Added constraint checks for NULL pointers removing nested statements. * pyxser.c: Removed nested statements. * pyxser_tools.c: Added constratints checks for NULL pointers, removed [...]]]></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.4.2r</b>. The current <i>ChangeLog</i> for this release is as follows:</p>
<pre>
1.4.2r (2010.02.10):

        Daniel Molina Wegener &lt;dmw at coder dot cl&gt;
        * pyxser_collections.c: Added constraint checks for NULL
        pointers removing nested statements.
        * pyxser.c: Removed nested statements.
        * pyxser_tools.c: Added constratints checks for NULL pointers,
        removed nested statements and added strict checking for lists
        since it was crashing with an ambigous list definition that
        can not be handled by PyList_Check().
        * test-utf8.py: Added tests to determine if it continue
        crashing with module serialization.

        Thanks to pyxser users for their feedback.
</pre>
<p><span id="more-622"></span></p>
<p>I want to bring special thanks to <i>Dariusz Suchojad</i> for his feedback. I&#8217;ve fixed some type checking bugs and minor ones. Now pyxser is capable to do module serialization, but not in concrete one, still is not capable to distribute modules, so it is capable to create a simple module representation as XML, under the <i>pyxser serialization model</i>.</p>
<p>I hope that it will help you on your programming tasks.</p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F&amp;title=%5Bann%5D%20pyxser-1.4.2r%20available&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Dear%20pyxser%20users%2C%20I%27m%20pleased%20to%20announce%20that%20I%27ve%20released%20pyxser-1.4.2r.%20The%20current%20ChangeLog%20for%20this%20release%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A1.4.2r%20%282010.02.10%29%3A%0D%0A%0D%0A%20%20%20%20%20%20%20%20Daniel%20Molina%20Wegener%20%26lt%3Bdmw%20at%20coder%20dot%20cl%26gt%3B%0D%0A%20%20%20%20%20%20%20%20%2A%20pyxser_collections.c%3A" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F&amp;title=%5Bann%5D%20pyxser-1.4.2r%20available&amp;notes=Dear%20pyxser%20users%2C%20I%27m%20pleased%20to%20announce%20that%20I%27ve%20released%20pyxser-1.4.2r.%20The%20current%20ChangeLog%20for%20this%20release%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A1.4.2r%20%282010.02.10%29%3A%0D%0A%0D%0A%20%20%20%20%20%20%20%20Daniel%20Molina%20Wegener%20%26lt%3Bdmw%20at%20coder%20dot%20cl%26gt%3B%0D%0A%20%20%20%20%20%20%20%20%2A%20pyxser_collections.c%3A" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F&amp;title=%5Bann%5D%20pyxser-1.4.2r%20available&amp;bodytext=Dear%20pyxser%20users%2C%20I%27m%20pleased%20to%20announce%20that%20I%27ve%20released%20pyxser-1.4.2r.%20The%20current%20ChangeLog%20for%20this%20release%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A1.4.2r%20%282010.02.10%29%3A%0D%0A%0D%0A%20%20%20%20%20%20%20%20Daniel%20Molina%20Wegener%20%26lt%3Bdmw%20at%20coder%20dot%20cl%26gt%3B%0D%0A%20%20%20%20%20%20%20%20%2A%20pyxser_collections.c%3A" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F&amp;title=%5Bann%5D%20pyxser-1.4.2r%20available" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F&amp;t=%5Bann%5D%20pyxser-1.4.2r%20available" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=%5Bann%5D%20pyxser-1.4.2r%20available%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fann-pyxser-1-4-2r-available%2F&amp;title=%5Bann%5D%20pyxser-1.4.2r%20available&amp;annotation=Dear%20pyxser%20users%2C%20I%27m%20pleased%20to%20announce%20that%20I%27ve%20released%20pyxser-1.4.2r.%20The%20current%20ChangeLog%20for%20this%20release%20is%20as%20follows%3A%0D%0A%0D%0A%0D%0A1.4.2r%20%282010.02.10%29%3A%0D%0A%0D%0A%20%20%20%20%20%20%20%20Daniel%20Molina%20Wegener%20%26lt%3Bdmw%20at%20coder%20dot%20cl%26gt%3B%0D%0A%20%20%20%20%20%20%20%20%2A%20pyxser_collections.c%3A" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/02/ann-pyxser-1-4-2r-available/">Permalink</a> | <a href="http://coder.cl/2010/02/ann-pyxser-1-4-2r-available/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/02/ann-pyxser-1-4-2r-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>a meta parser model</title>
		<link>http://coder.cl/2010/02/a-meta-parser-model/</link>
		<comments>http://coder.cl/2010/02/a-meta-parser-model/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 20:28:07 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=608</guid>
		<description><![CDATA[One of my most recent projects is a Meta-Parser. The core requirement is to write a dynamic parser, which can be configured, allowing the user to setup certain patterns around the given input and extract those pattern tokens to being exposed to other layers of the main project. Surely this is a challenge, and interesting [...]]]></description>
			<content:encoded><![CDATA[<p>One of my most recent projects is a <i>Meta-Parser</i>. The core requirement is to write a <i>dynamic parser</i>, which can be configured, allowing the user to setup certain <i>patterns</i> around the given input and extract those <i>pattern tokens</i> to being exposed to other layers of the main project. Surely this is a challenge, and interesting part of the global project. I&#8217;ve finished to work on this part of the project, it is implemented in <strong>C++</strong> as the client requires it, and I&#8217;ve made a simple model based on the <i>PAC architectural pattern</i>.</p>
<p><span id="more-608"></span></p>
<p><br/></p>
<h3>overview</h3>
<p>First we need a concrete class implementing the <i>parser</i>, but it needs an <i>abstraction layer</i> and also something which provides the proper <i>parsing states</i> to its internals. Finally we need to expose those extracted tokens outside of this component &mdash; the meta-parser.</p>
<div style='border: 1px solid #000; text-align: center; overflow: auto;'><a href='http://coder.cl/uploads/2010/01/meta-parser-model.png' alt='Meta Parser Model' title='Meta Parser Model' target='_blank'><img border='0' alt='MetaParser Model' title='Meta Parser Model' src='http://coder.cl/uploads/2010/01/meta-parser-model.png' style='text-align: center;' width='510'></a></div>
<p>Clearly the <i>abstraction</i> is made in top of a <i>single template</i>, the control is given from the <tt>ParserService</tt> class and the presentation is provided through the <tt>Token</tt> interface with the proper implementations.</p>
<p><br/></p>
<h3>substring automaton</h3>
<p>Another interesting point is how specific string parsing is implemented. The system uses an FSM, which implements a simple automaton:</p>
<div style='border: 1px solid #000; text-align: center; overflow: auto;'><a href='http://coder.cl/uploads/2010/01/token-automaton.png' alt='Token Automaton' title='Token Automaton' target='_blank'><img border='0' alt='Token Automaton' title='Token Automaton' src='http://coder.cl/uploads/2010/01/token-automaton.png' style='text-align: center;' width='510'></a></div>
<p>So, parsing the <i>left hand token</i> <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_4915096576fdeeedc7ba7cef3cd31c4c.png" style="vertical-align:-7.5px; display: inline-block ;" alt="delta(q1,lht) = q2" title="delta(q1,lht) = q2"/> implies parsing the <i>value token</i> <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_ecccc704d408393d4051575c35e3445c.png" style="vertical-align:-7.5px; display: inline-block ;" alt="delta(q2,vt) = q3" title="delta(q2,vt) = q3"/> and then it states the <i>right hand token</i>, to complete the cycle reaching again the stored <i>value token</i> <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_2d830b19423a4457c112115fd4b23384.png" style="vertical-align:-7.5px; display: inline-block ;" alt="delta(q3,rht) = q2" title="delta(q3,rht) = q2"/>. This is used to extract substrings. Where every token is configurable with a proprietary language. Finally, the full parser <i>specific</i> implementation is made on top of <i>state machines</i> which are used according the proper configuration representation using thitd party classes and structures, so is possible to extract the required tokens from the input source.</p>
<p>Also, each <i>configuration</i> and <i>parser</i> instances are designed for concurrency. The project will be running on with parallel tasks inside a mutithreaded &mdash; and possibly multiprocess &mdash; service <i>daemon</i>. Driven by my client schedule, I can not implement <i>wait free</i> algorithms, so I will be using standard operating system provided locks &mdash; and more easy to handle algorithms.</p>
<p><br/></p>
<h3>in deep with abstractions</h3>
<p>Although the PAC pattern is designed for user interfaces, the usage of this pattern to communicate components and generate strong abstraction layers helps a lot on design and maintainability issues. Indeed, this patterns guarantee a reward while we are coding some design patterns. In this case, for example the <tt>MetaParser</tt> and the <tt>ParserService</tt> are both an instance of <i>Adapters</i>, where a transformation is made from one layer to other. While <tt>MetaParser</tt> is a strong  abstraction layer for the given implementations.</p>
<p>Finally <tt>ParserService</tt> provide us the proper way to handle different parsing tasks, so we can determine inside it which abstraction to use though the proper <tt>MetaParser</tt> instance.</p>
<p><br/></p>
<h3>conclusion</h3>
<p>The <i>PAC</i> pattern can be used to implement component communications and proper abstraction between application layers, among the usage on user interfaces. Does it falls in other <i>architectural pattern</i>? Anyone knows?.</p>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F&amp;title=a%20meta%20parser%20model&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=One%20of%20my%20most%20recent%20projects%20is%20a%20Meta-Parser.%20The%20core%20requirement%20is%20to%20write%20a%20dynamic%20parser%2C%20which%20can%20be%20configured%2C%20allowing%20the%20user%20to%20setup%20certain%20patterns%20around%20the%20given%20input%20and%20extract%20those%20pattern%20tokens%20to%20being%20exposed%20to%20other" title="LinkedIn"><img src="http://coder.cl/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F&amp;title=a%20meta%20parser%20model&amp;notes=One%20of%20my%20most%20recent%20projects%20is%20a%20Meta-Parser.%20The%20core%20requirement%20is%20to%20write%20a%20dynamic%20parser%2C%20which%20can%20be%20configured%2C%20allowing%20the%20user%20to%20setup%20certain%20patterns%20around%20the%20given%20input%20and%20extract%20those%20pattern%20tokens%20to%20being%20exposed%20to%20other" title="del.icio.us"><img src="http://coder.cl/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F&amp;title=a%20meta%20parser%20model&amp;bodytext=One%20of%20my%20most%20recent%20projects%20is%20a%20Meta-Parser.%20The%20core%20requirement%20is%20to%20write%20a%20dynamic%20parser%2C%20which%20can%20be%20configured%2C%20allowing%20the%20user%20to%20setup%20certain%20patterns%20around%20the%20given%20input%20and%20extract%20those%20pattern%20tokens%20to%20being%20exposed%20to%20other" title="Digg"><img src="http://coder.cl/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F&amp;title=a%20meta%20parser%20model" title="Reddit"><img src="http://coder.cl/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F&amp;t=a%20meta%20parser%20model" title="Facebook"><img src="http://coder.cl/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=a%20meta%20parser%20model%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F" title="Twitter"><img src="http://coder.cl/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fcoder.cl%2F2010%2F02%2Fa-meta-parser-model%2F&amp;title=a%20meta%20parser%20model&amp;annotation=One%20of%20my%20most%20recent%20projects%20is%20a%20Meta-Parser.%20The%20core%20requirement%20is%20to%20write%20a%20dynamic%20parser%2C%20which%20can%20be%20configured%2C%20allowing%20the%20user%20to%20setup%20certain%20patterns%20around%20the%20given%20input%20and%20extract%20those%20pattern%20tokens%20to%20being%20exposed%20to%20other" title="Google Bookmarks"><img src="http://coder.cl/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>


<br/><br/><br/><hr height="1px" width="50%" />
<div style='text-align: center !important;'><b>Copyright © 2010 Daniel Molina Wegener</b><br/><b>Atribución-No Comercial-Sin Derivadas 2.0 Chile</b><br/><a target='_new' rel="license" href="http://creativecommons.org/licenses/by-nc-nd/2.0/cl/"><img alt="Creative Commons License" style="border-width:0" src="/cc88x31.png" /></a></div>
<br/><hr height="1px" width="100%" />
<p><small>© Daniel Molina Wegener for <a href="http://coder.cl">coder . cl</a>, 2010. | <a href="http://coder.cl/2010/02/a-meta-parser-model/">Permalink</a> | <a href="http://coder.cl/2010/02/a-meta-parser-model/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/02/a-meta-parser-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
