<?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; development</title>
	<atom:link href="http://coder.cl/category/development/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>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>a successful team</title>
		<link>http://coder.cl/2010/04/a-successful-team/</link>
		<comments>http://coder.cl/2010/04/a-successful-team/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 16:50:17 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=655</guid>
		<description><![CDATA[Few people is capable to understand the meaning of working in teams. Among other things, on a team we need to set the proper communication channels. My last assignment as employee of a company was Software Architect for a set of projects for a new client on the company. I was in need to do [...]]]></description>
			<content:encoded><![CDATA[<p>Few people is capable to understand the meaning of working in teams. Among other things, on a team we need to set the proper communication channels. My last assignment as employee of a company was <i>Software Architect</i> for a set of projects for a new client on the company. I was in need to do research about the platform where we were working on and I don&#8217;t mean the third party pieces, such as language, application server and related stuff, I mean the <i>enterprise application</i>. It was poorly documented, so we need to harvest the code seeking for answers.</p>
<p><span id="more-655"></span></p>
<p>As result, we got a nice architecture design, very applicable to most problems present on the platform. Also, I was capable to answer many questions about the <i>enterprise application</i>. Many of those answers were made based on reverse engineering the source code, tracking every step and tracing component execution. Each member was capable to read some books that we recommended with the Project Manager and understand the third party software, like <i>Google Web Toolkit</i> and <i>Apache FOP</i>. The Project Manager was a good leader guiding the team to the right direction on what to read and how self taught those technologies, while I was doing the proper research, then we got a good team response, and being considered as a good provider.</p>
<p>The key on success was nobody was afraid to ask about the <i>enterprise application</i>, so each member of the team was capable to understand how to interact with  those layers that were not accessible as source code &mdash; like a black box &mdash; and that everyone on the team was responsible of learning the techonologies related to the team work: &quot;<i>read that book</i>&quot;, &quot;<i>read that blog article</i>&quot;, &quot;<i>take a look on this specification</i>&quot; and some other phrases were common on that team, so everyone was capable to understand their own task.</p>
<div style='border: 1px solid #000; text-align: center;'>
<img src='http://coder.cl/uploads/2010/04/team-organization.png' border='0' />
</div>
<p>Most questions were channeled directly to the project manager, then I he was capable to answer, the problem was solved on the fly. In other case, the problem was delivered to me as software architect. Also, team members were capable to ask me directly. Also, most questions were made on SCRUM sessions, and few ones were asked outside of those SCRUM sessions. Few books on <i>Software Architecture</i>, <i>JavaEE Design Patterns</i>, <i>Design Patterns</i> and <i>Architectural Patterns</i>, bring us a wide perspective on how to solve most problems for the kind of components that we were developing. So, most problems were found on the black-box-like <i>enterprise application</i>, since we were having few referrals.</p>
<p>Even if one <i>software engineer</i> was considered &mdash; before joining the team &mdash; as an NNPP or bad programmer, on the team we got a good result. I agree with <i>Phillip G. Armour</i> in his article <i>&quot;In Prise of Bad Programmers&quot;</i>, where he treat this problem as an advantage to make stronger teams:</p>
<blockquote><p>
Sometimes the teams are not made up of all superheroes and when the team asserts itself to overcome some limitation, even with its own personnel, it can become better than it would have been without limitations.
</p></blockquote>
<p>All team members were capable to learn about the <i>enterprise application</i> without the pressure of of not having someone supporting them and fear to commit bugs into the VCS. The were constantly improving their skills, by different reasons, but everyone was <i>learning</i>. As spotted <i>Pete Godlife</i> on his article <i>&quot;Live to love Learning&quot;</i>:</p>
<blockquote><p>
Your motivation might be to keep yourself fresh, to sharpen your existing skills or simply to satisfy your natural curiosity. Or the reason might be more mercenary: to strengthen your employability, or allow you to move into a programming field you are more interested in.
</p></blockquote>
<div style='border: 1px solid #000; text-align: center;'>
<img src='http://coder.cl/uploads/2010/04/question-model.png' border='0' />
</div>
<p><br/></p>
<h3>conclusion</h3>
<p>On every new <i>application</i> which requires new components or maintenance, we need to research it, we must invest time looking on how it works, how affects any change and how we can contribute to improve its construction. Analysis capability is learned along the time and acquired by studying applications and code, you can not request a 100% successful development to someone that do not have the proper guide on a large <i>enterprise application</i>, you need someone doing research on it, doing reverse engineering if it is not documented and let the people learn from that member that have the advantage, even if the application <a href='http://i.imgur.com/yzVW1.jpg'>looks like this one</a> &mdash; which fortunately isn&#8217;t the case in this post.</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-successful-team%2F&amp;title=a%20successful%20team&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Few%20people%20is%20capable%20to%20understand%20the%20meaning%20of%20working%20in%20teams.%20Among%20other%20things%2C%20on%20a%20team%20we%20need%20to%20set%20the%20proper%20communication%20channels.%20My%20last%20assignment%20as%20employee%20of%20a%20company%20was%20Software%20Architect%20for%20a%20set%20of%20projects%20for%20a%20new%20cl" 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-successful-team%2F&amp;title=a%20successful%20team&amp;notes=Few%20people%20is%20capable%20to%20understand%20the%20meaning%20of%20working%20in%20teams.%20Among%20other%20things%2C%20on%20a%20team%20we%20need%20to%20set%20the%20proper%20communication%20channels.%20My%20last%20assignment%20as%20employee%20of%20a%20company%20was%20Software%20Architect%20for%20a%20set%20of%20projects%20for%20a%20new%20cl" 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-successful-team%2F&amp;title=a%20successful%20team&amp;bodytext=Few%20people%20is%20capable%20to%20understand%20the%20meaning%20of%20working%20in%20teams.%20Among%20other%20things%2C%20on%20a%20team%20we%20need%20to%20set%20the%20proper%20communication%20channels.%20My%20last%20assignment%20as%20employee%20of%20a%20company%20was%20Software%20Architect%20for%20a%20set%20of%20projects%20for%20a%20new%20cl" 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-successful-team%2F&amp;title=a%20successful%20team" 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-successful-team%2F&amp;t=a%20successful%20team" 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%20successful%20team%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F04%2Fa-successful-team%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-successful-team%2F&amp;title=a%20successful%20team&amp;annotation=Few%20people%20is%20capable%20to%20understand%20the%20meaning%20of%20working%20in%20teams.%20Among%20other%20things%2C%20on%20a%20team%20we%20need%20to%20set%20the%20proper%20communication%20channels.%20My%20last%20assignment%20as%20employee%20of%20a%20company%20was%20Software%20Architect%20for%20a%20set%20of%20projects%20for%20a%20new%20cl" 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-successful-team/">Permalink</a> | <a href="http://coder.cl/2010/04/a-successful-team/#comments">One comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/04/a-successful-team/feed/</wfw:commentRss>
		<slash:comments>1</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>ramblings on email formalization</title>
		<link>http://coder.cl/2010/02/ramblings-on-email-formalization/</link>
		<comments>http://coder.cl/2010/02/ramblings-on-email-formalization/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 15:13:14 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=619</guid>
		<description><![CDATA[Netiquette (RFC1855) is a set of standard rules on writing electronic mail. Many of those conventions appears to be lost in time, and bad practices on writing emails are more popular around the Internet. I agree with those rules, but I think that some additional stuff can be used to get more organized electronic mail. [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://tools.ietf.org/html/rfc1855'><i>Netiquette (RFC1855)</i></a> is a set of standard rules on writing electronic mail. Many of those conventions appears to be lost in time, and bad practices on writing emails are more popular around the Internet. I agree with those rules, but I think that some additional stuff can be used to get more organized electronic mail. Here are some rules, some of them extracted from the netiquette used on mailing lists and Usenet.</p>
<p><span id="more-619"></span></p>
<p><br/></p>
<h3>the subject matters</h3>
<p>Sure, a good subject can be used to index properly your emails. For example try to use some kind of convention, do not throw the subject as a previously known conversation. For many years I&#8217;ve been using my own convention on electronic mail subjects for my projects. Generally I use the form: <i>&quot;Client, Project, Real Subject&quot;</i> or <i>&quot;Project, Real Subject&quot;</i>. So you can easily find your messages related to each project just by looking on the subject. The proper subject is a good introduction to the email that you will write or read.</p>
<p><br/></p>
<h3>the format matters</h3>
<p>Plain text (text/plain), wrapped on column 76 or 64 &mdash; it depends on your taste &mdash; with well formed paragraphs and using the proper mime encoding for localization &mdash; on Usenet and some mailing lists is useful to use US-ASCII as encoding. Many companies are using <b>HTML</b> formatted mail with those gif images as company logos attached, and sometimes a huge disclaimer as email footer, and many replying on top of the previous message. Well, your fancy looks ugly here. I use <i>Kontact</i>, hence I use <i>Kmail</i> and a great feature of <i>Kmail</i> is the fact that it do not opens HTML formatted mails immediately, it regards my preference and ask me if I want to open it. Do you remember the <i>I love you</i> virus which was spreading through electronic mail?. Fancy colors and pictures leave your mail looking as <b>SPAM</b>, overfilled with <i>propaganda</i>, and those huge disclaimers for me are a disrespect to me, since it is like to send a real mail, and mail service opens the envelope and attach another document into it.</p>
<p>A possible solution is to standardize the proper E-Mail header for those bring that information without modifying the content of the original message:</p>
<ul>
<li><strong>X-Company-Logo</strong>, should contain an URL to the company logo. I hope that it should reside under HTTPS protocol.</li>
<li><strong>X-Disclaimer</strong>, should contain an URL to the company disclaimer of the electronic mail.</li>
<li><strong>X-Sender-Identity</strong>, should contain an URL to the sender contact information, possibly a vCard or a plain text signature.</li>
</ul>
<p>Sending that information &mdash; since most SMTP email is authenticated &mdash; can be easyly inserted on the electronic mail and it will become a part of the envelope, not the original message.</p>
<p><br/></p>
<h3>labeling for indexing</h3>
<p>Many mail clients are using <i>labels</i> to create additional indexes on the electronic mail, but seems that is not standardized. Here an additional mail header should be useful &mdash; I hope that most companies will agree. <strong>X-Labels</strong> should be used to add labels to the electronic mail, it can be delimited with the <i>;;</i> string. So, it will become standardized for most clients, including on sending mail, so the mail client can receive them and ask the user if he wants to add the label.</p>
<p><br/></p>
<h3>conclusions</h3>
<p>Read some mailing lists or Usenet newsgroups to get introduced on how to write and read electronic mail. Read the RFC 1855 to get the <i>real rules</i> on formal electronic mail. Stop sending that fancy electronic mail, it has no sense, your company will not be more respected by sending those mails, for many people it has the opposed effect.</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%2Framblings-on-email-formalization%2F&amp;title=ramblings%20on%20email%20formalization&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Netiquette%20%28RFC1855%29%20is%20a%20set%20of%20standard%20rules%20on%20writing%20electronic%20mail.%20Many%20of%20those%20conventions%20appears%20to%20be%20lost%20in%20time%2C%20and%20bad%20practices%20on%20writing%20emails%20are%20more%20popular%20around%20the%20Internet.%20I%20agree%20with%20those%20rules%2C%20but%20I%20think%20that%20som" 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%2Framblings-on-email-formalization%2F&amp;title=ramblings%20on%20email%20formalization&amp;notes=Netiquette%20%28RFC1855%29%20is%20a%20set%20of%20standard%20rules%20on%20writing%20electronic%20mail.%20Many%20of%20those%20conventions%20appears%20to%20be%20lost%20in%20time%2C%20and%20bad%20practices%20on%20writing%20emails%20are%20more%20popular%20around%20the%20Internet.%20I%20agree%20with%20those%20rules%2C%20but%20I%20think%20that%20som" 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%2Framblings-on-email-formalization%2F&amp;title=ramblings%20on%20email%20formalization&amp;bodytext=Netiquette%20%28RFC1855%29%20is%20a%20set%20of%20standard%20rules%20on%20writing%20electronic%20mail.%20Many%20of%20those%20conventions%20appears%20to%20be%20lost%20in%20time%2C%20and%20bad%20practices%20on%20writing%20emails%20are%20more%20popular%20around%20the%20Internet.%20I%20agree%20with%20those%20rules%2C%20but%20I%20think%20that%20som" 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%2Framblings-on-email-formalization%2F&amp;title=ramblings%20on%20email%20formalization" 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%2Framblings-on-email-formalization%2F&amp;t=ramblings%20on%20email%20formalization" 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=ramblings%20on%20email%20formalization%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F02%2Framblings-on-email-formalization%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%2Framblings-on-email-formalization%2F&amp;title=ramblings%20on%20email%20formalization&amp;annotation=Netiquette%20%28RFC1855%29%20is%20a%20set%20of%20standard%20rules%20on%20writing%20electronic%20mail.%20Many%20of%20those%20conventions%20appears%20to%20be%20lost%20in%20time%2C%20and%20bad%20practices%20on%20writing%20emails%20are%20more%20popular%20around%20the%20Internet.%20I%20agree%20with%20those%20rules%2C%20but%20I%20think%20that%20som" 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/ramblings-on-email-formalization/">Permalink</a> | <a href="http://coder.cl/2010/02/ramblings-on-email-formalization/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/02/ramblings-on-email-formalization/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>
		<item>
		<title>development commandments</title>
		<link>http://coder.cl/2010/01/development-commandments/</link>
		<comments>http://coder.cl/2010/01/development-commandments/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 20:57:35 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=602</guid>
		<description><![CDATA[I don&#8217;t use recipes to ensure the quality of my software. Most of those development tasks to make the software a reliable tool are techniques learned along the time, without considering the methodology behind the software development. I can&#8217;t stand for any methodology as the better methodology that you can use. I just follow few [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t use recipes to ensure the quality of my software. Most of those development tasks to make the software a reliable tool are techniques learned along the time, without considering the methodology behind the software development. I can&#8217;t stand for any methodology as the <i>better methodology</i> that you can use. I just follow few commandments or rules on software development, and all of them bring me good results.</p>
<p><span id="more-602"></span></p>
<ol>
<li><strong>&quot;request well specified requirements&quot;</strong>
<p>Request well specified requirements. Even if you are using one of those <i>dynamic methodologies</i>. Never let your boss to set ambiguous requirements, this will be your <i>hell</i> and <i>nightmare</i>, and request a formal requirement in the proper email and documentation. I do not mean a word document with tons of lines, I&#8217;m talking about requirement clarifications, where you are responsible to request the proper clarifications if you are looking something ambiguous. Also your boss is responsible to write well specified requirements, both technically and functionally. There are well known gay bosses who send ambiguous requirements and usually they are changing those requirements every day&#8230; Yeah! the same ones who are delivering your application with the initial deadline even when they are taking new ones! If the client do not have the proper knowledge about software, the client do no have the proper knowledge to evaluate deadlines, the same happens with your boss.</p>
</li>
<li><strong>&quot;formalize your progress&quot;</strong>
<p>Formalize your work progress, by using mails, the proper VCS comments, and source code documentation, even is that is required by your boss or not. You need to register properly your work progress, and you <i>must</i> create the proper <i>sub-milestones</i> for each project milestone which is assigned to you.</p>
</li>
<li><strong>&quot;forget that job without a technically skilled boss&quot;</strong>
<p>Do not work on company where your boss is not capable to define properly what he wants and even on a company where the boss is not capable to catch the client requirements. A boss must be capable to <b>charge</b> every new requirement to the client, if your boss do not do that, your boss is giving away your time and <i>your life</i>. If your job requires you out of workday, your job <i>sucks</i>, and even your boss, since he/she is not capable to handle new requirements and make the proper charge. Also, a good <i>manager</i> knows that you need the proper time to do all those tasks listed bellow <img src='http://coder.cl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</li>
<li><strong>&quot;clean code&quot;</strong>
<p>Clean code, legible code and well indented code will allow more developers to handle it. If work on a company where <i>real teamwork</i> matters, everyone will be capable to support your development if you are busy in other task. Clean code is that one which has few ugly modification &mdash; most of them regarding software performance &mdash; and follows well known coding standards, such as naming conventions, indentation rules and documenting techniques. Regard a 7 bit US-ASCII encoding, and never use accents &mdash; simply because some editors, compilers, and coding tools do not support other encodings and most software is compatible with 7 bit US-ASCII encoding. For localization use external packages, such as <i>property files</i> in Java, <i>gettext</i> files with C and C++, and related tools.</p>
<p>You always must have in mind that your code will be taken into the most ancient platform and the most newbie coder &mdash; just someone what happens to some environments when you setup UTF-8 encoding on the project and you add a non UTF-8 file in it, and the headache that you get when you are not conscious about <b>WTF</b> is happening. Your boss will be entirely happy with the lost time&#8230;</p>
</li>
<li><strong>&quot;commented code&quot;</strong>
<p>Well documented code is not that one which holds <i>poetry</i> inside it. Useful and descriptive comments are those ones which allows the developer to understand which logic is contained in your functions. Also you must comment every modification separately, for example if you change a <tt>b * Math.pow(2.0, a);</tt> operation by <tt>a &lt;&lt; b</tt> to get more performance, comment it!</p>
<p>There are well known commenting techniques. Take a look on known documents, such as <i>manual pages</i> to have wide perspective on how to comment the code &mdash; manual pages have the best documentation structure that I&#8217;ve ever seen. I think that toy documentation, like <i>javadoc</i>, really sucks, since it is poorly redacted and non descriptive. Do you really know someone who is able to develop an entire Java application just by looking at the javadoc without looking for examples? The same happens with C# and .NET documentation.</p>
</li>
<li><strong>&quot;use annotations to track your project&quot;</strong>
<p>Classical annotation, on your VCS or code comments will help you to track pending tasks, enhancements that may be done and will allow you to pass messages to other developers. There are classical ones <tt>TODO:</tt> and <tt>XXX:</tt> for example. You can use TODO for all your &quot;To Do&quot; tasks in each file and &quot;XXX&quot; for precisely document modifications and enhancements that may be done on the code. This will ensure that pending tasks will never be lost in some ugly word document on an erased mail which tries to poorly describe a required task. Also you can support those tasks by using <i>Issue Tracking</i> and <i>Bug Tracking</i> systems, but are like those ugly lost documents and you can not explain in detail with the code itself which task is required where <img src='http://coder.cl/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</li>
<li><strong>&quot;check for null pointers&quot;</strong>
<p>Before using an object, check if it is null, otherwise use an error catching mechanism. This rule do not needs more explanations, and is a well known issue and spotted the right title: <a href='http://qconlondon.com/london-2009/presentation/Null+References:+The+Billion+Dollar+Mistake'>The Billion Dollar Mistake</a>.</p>
</li>
<li><strong>&quot;do not trust user input&quot;</strong>.
<p>I do not trust the user input, <b>never</b>. I&#8217;m always trying to validate the user input, since the common user is doing mistakes using applications. The user input and generally the <i>input</i> in your functions require certain validation, from the <i>data type</i> to <i>expected values</i>, such as range or length. Validation in Web Applications should be made in both sides too, the Web Browser &mdash; using JavaScript and HTML attributes &mdash; and the server side. The most important one is the <b>server side validation</b> and it is a <b>must</b>. On other kind of applications, user input must be validated too.</p>
</li>
<li><strong>&quot;apply debugging&quot;</strong>.
<p>Do not stay comfortable with the code <i>working</i>. Debug your applications, tracing each step. Remember that you can modify variable values in your code inside your debugger, so you can do more code hardening tests. Learn about your debugger the better as you can. Read books on debugging techniques: &quot;<a href='http://www.amazon.com/dp/0814474578/?tag=sollc-intl-20'>Debugging</a>&quot; and &quot;<a href='http://www.amazon.com/dp/0735619670/?tag=sollc-intl-20'>Code Complete</a>&quot;, for example. I&#8217;m conscious about the fact that every language and every debugger works different, but debugging techniques are always sharing common tasks and checks.</p>
</li>
<li><strong>&quot;apply static analysis&quot;</strong>.
<p>Apply static analysis to ensure that your code is clean and using better practices. Indeed, those kind of tools will help you to discover more bugs. Some of them can do code path checking and Boolean evaluation checking. If the language that you are using do not have support from static analysis tools, it really sucks. There are well known tools for doing static analysis and source code checking, and also are well known bugs discovered along the time with those tools. You must combine debugging and static analysis together.</p>
</li>
</ol>
<p>If you do not work on a company where you do not have the proper time to do each of those tasks listed above, <i>your job sucks</i>. Surely you are delivering bad code, sometimes with those <i>invisible bugs</i> that appears when you are not expecting them. Falling one time and another on the same bugs and the same project that may not be released at time.</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%2F01%2Fdevelopment-commandments%2F&amp;title=development%20commandments&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=I%20don%27t%20use%20recipes%20to%20ensure%20the%20quality%20of%20my%20software.%20Most%20of%20those%20development%20tasks%20to%20make%20the%20software%20a%20reliable%20tool%20are%20techniques%20learned%20along%20the%20time%2C%20without%20considering%20the%20methodology%20behind%20the%20software%20development.%20I%20can%27t%20stand%20f" 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%2F01%2Fdevelopment-commandments%2F&amp;title=development%20commandments&amp;notes=I%20don%27t%20use%20recipes%20to%20ensure%20the%20quality%20of%20my%20software.%20Most%20of%20those%20development%20tasks%20to%20make%20the%20software%20a%20reliable%20tool%20are%20techniques%20learned%20along%20the%20time%2C%20without%20considering%20the%20methodology%20behind%20the%20software%20development.%20I%20can%27t%20stand%20f" 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%2F01%2Fdevelopment-commandments%2F&amp;title=development%20commandments&amp;bodytext=I%20don%27t%20use%20recipes%20to%20ensure%20the%20quality%20of%20my%20software.%20Most%20of%20those%20development%20tasks%20to%20make%20the%20software%20a%20reliable%20tool%20are%20techniques%20learned%20along%20the%20time%2C%20without%20considering%20the%20methodology%20behind%20the%20software%20development.%20I%20can%27t%20stand%20f" 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%2F01%2Fdevelopment-commandments%2F&amp;title=development%20commandments" 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%2F01%2Fdevelopment-commandments%2F&amp;t=development%20commandments" 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=development%20commandments%20-%20http%3A%2F%2Fcoder.cl%2F2010%2F01%2Fdevelopment-commandments%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%2F01%2Fdevelopment-commandments%2F&amp;title=development%20commandments&amp;annotation=I%20don%27t%20use%20recipes%20to%20ensure%20the%20quality%20of%20my%20software.%20Most%20of%20those%20development%20tasks%20to%20make%20the%20software%20a%20reliable%20tool%20are%20techniques%20learned%20along%20the%20time%2C%20without%20considering%20the%20methodology%20behind%20the%20software%20development.%20I%20can%27t%20stand%20f" 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/01/development-commandments/">Permalink</a> | <a href="http://coder.cl/2010/01/development-commandments/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2010/01/development-commandments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>source code optimization in c</title>
		<link>http://coder.cl/2009/12/source-code-optimization-in-c/</link>
		<comments>http://coder.cl/2009/12/source-code-optimization-in-c/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 21:45:02 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=589</guid>
		<description><![CDATA[&#34;&#8230;premature optimization is the root of all evil&#34;. &#8212; Donald Knuth I agree with the fact that we must do our source code level optimizations when we have finshed the construction stage or it is almost complete. I was searching articles and papers about optimizing C source code to be applied on my programs and [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>
<i>&quot;&#8230;premature optimization is the root of all evil&quot;</i>.<br />
<i style='align: right;'>&mdash; Donald Knuth</i>
</p></blockquote>
<p>I agree with the fact that we must do our source code level optimizations when we have finshed the construction stage or it is almost complete. I was searching articles and papers about optimizing C source code to be applied on my programs and libraries. I&#8217;ve collected some of those optimizations. But you must not confuse algorithm optimization, source code optimization and compiler optimization, since the first one refers to <i>algorithm design</i> and the second one just refers to the <i>algorithm implementation</i>, and both are sharing just few common approaches to formal reductions.</i><span id="more-589"></span></p>
<p>Usually the source code optimization just applies well known formal reductions. We will not treat those formalities in this article. Instead we will take a look on some examples that I&#8217;ve collected, allowing a common reasoning about how to optimize the source code. Most ideas for source code optimizations comes from &eta;-conversions using &lambda; equivalences, allowing for example reductions from <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_109bdcfacfe30bd05b191cfd2e7c3612.png" style="vertical-align:-7.5px; display: inline-block ;" alt="O(log ~n) ~left~ O(n)" title="O(log ~n) ~left~ O(n)"/>. Also, some optimizations without an apparent &eta;-conversion, since most is done at low level, as those which are taken by the compiler and translated to less assembler instructions, such as function inlining and parameter reduction. Most &eta;-conversions which implies &eta;-reductions, and are called <i>strength reductions</i>. But we have also the opposed side, where we are &mdash; instead of doing reductions &mdash; populating our programs with more lines of code, including repeated code, such as the loop unrolling optimization.</p>
<p><br/></p>
<h3>inline code</h3>
<p>C supports both <i>macros</i> and <i>inlining functions</i>. Both features are reaching the same effect, when the code is compiled, all <i>inlined</i> instructions are placed when we call the macro or the inline function. For example, a typical approach, is a <tt>max(a, b)</tt> function or a <tt>MAX(a, b)</tt> macro.</p>
<pre name="code" class="c">
/* the slowest expression, compiling and running */
int
max(int a, int b)
{
	if (a &gt; b)
		return a;
	else
		return b;
}

/* normal expression with inlining */
inline int
max(int a, int b)
{
	return ((a &gt; b) ? a : b);
}

/* the faster expression using macros */
#define MAX(a, b)			((a &gt; b) ? a : b)
</pre>
<p>The <i>inline</i> and the <i>macro</i> definitions both are similar. The macro places every occurrence of <tt>MAX(var1, var2)</tt> expressions with the <tt>((var1 > var2) ? var1 : var2)</tt> expression. The <i>inline</i> does the same, and places every occurrence of <tt>max(var1, var2)</tt> with the <i>result</i> of the expression <tt>((var1 > var2) ? var1 : var2)</tt>. So, the macro usage is oriented to replace entire blocks of code, instead of inline functions which are oriented to replace calls and skip the assembler <i>call</i> instruction and its derivates. We may look examples of the <i>call</i> opcode in typical system calls on operating systems, such as FreeBSD system calls.</p>
<p><br/></p>
<h3>parameter reduction</h3>
<p>Reducing parameters implies less assembler instructions. C calling convention typically push parameters into the stack, which implies that for each parameter a <i>push</i> opcode call is made. For example you can group function arguments &mdash; if they are use subsequently by a group of functions &mdash; under <tt>struct</tt> forms. Think a little, each <i>push</i> instruction in his family takes 2 clocks, varying to 18 clocks on x86 architecture &mdash; depending on vendor and model. For 8 arguments, it will take from 16 to 36 clocks, against 2 to 18 clocks with one argument. This approach on argument reduction may be applied to those functions which are not inlined.</p>
<pre name='code' class='c'>
/* slower version */
int
my_function(int arg1, int arg2, int arg3, int arg4)
{
	/* do something... */
}

/* faster version */
struct myargs
{
	int arg1; int arg2; int arg3; int arg4;
};

int
my_function(struct myargs *args)
{
	/* do something... */
}
</pre>
<p><br/></p>
<h3>practical reductions</h3>
<p>We do <i>reduction</i> when we remove unnecessary steps in our functions. We can do most reductions just by thinking a little on the code, and also there are some well known reductions which can be used as optimizations.</p>
<h4>removing else</h4>
<pre name='code' class='c'>
/* with else, smaller code, but slower one */
inline int
test(int a)
{
	return a &gt; 0 ? 1 : 0;
}

/* without else, large code but faster one */
inline int
test(int a)
{
	if (a &gt; 0)
		return 1;
	/* implied else */
	return 0;
}
</pre>
<p>On this optimization, we are removing <tt>jmp</tt> and <tt>jxx</tt> family of instructions, where most of them takes near to 7 clocks on x86 architecture and also the required instruction to setup the proper context for the following instruction in the program sequence. This is like the <i>spartan programming</i> style, where most code is minimized through reductions and similar programming tasks.</p>
<h4>bitwise operations</h4>
<p>Bitwise operations are cheaper than other operations. For example, curiously, a shift operation and plus operations have less clocks than multiplication and division operations. The happens to logical evaluations. In other post, I&#8217;ve wrote about <a href='http://coder.cl/2008/12/29/minimization-patterns/'>logical minimizations</a>. A complement to what I&#8217;ve said, is the fact that <tt>mul</tt> instruction takes from 10 to 40 clocks and <i>div</i> instruction takes from 15 to 40 clocks on x86 architecture, against <tt>add</tt>, <tt>sub</tt>, <tt>shr</tt>, <tt>shl</tt> and similar instruction that are taking from 2 to 7 clocks. Remember that the number clocks used by some instruction is vendor and model dependent. For example if we do:</p>
<pre name='code' class='c'>
/* we take a call to the math.h function pow() */
n = y * pow(2.0, x);

/* we can replace it by */
n = y &lt;&lt; x;
</pre>
<p>In other words, the <tt>x &lt;&lt; y</tt> operation is equivalent to <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_994.5_975cf26e16a8e396b3e831896513a495.png" style="vertical-align:-5.5px; display: inline-block ;" alt="y * 2 ^ x" title="y * 2 ^ x"/>. You can find other math equivalences too. From this basic approach, we can reach other types of optimizations through the proper maths. You can take a look on the <a href='http://www.jjj.de/bitwizardry/bitwizardrypage.html'>bit wizardry</a> page from <i>Jörg Arndt</i> if you want to seek for more bitwise operations and reductions.</p>
<h4>reversing counter loops</h4>
<p>Usually we do one step loops for fixed set of counters. The following example shows a reduction which can be used every time we can do a reverse loop.</p>
<pre name='code' class='c'>
/* for loop coded usually */
for (c = 0; c &lt; MAX_C_VALUE; c++) {
	/* do something... */
}

/* for reversed loop */
for (c = MAX_C_VALUE; c--; /* we do not do nothing here */ ) {
	/* do something... */
}
</pre>
<h4>table lookups</h4>
<p>A table lookup is the technique where we create an array and kind related structures to lookup for data, usually previously calculated data or simply, we are looking for concrete data that we want to use.</p>
<pre name='code' class='c'>
/* we can have a switch statement */
ourtype_t *varn = NULL;
switch (var1) {
case 0:
	varn = value1; break;
case 1:
	varn = value2; break;
case 2:
	varn = value3; break;
default:
	varn = value1;
}

/* or have an if/else statement */
if (var1 == 0)
	varn = value1;
else if (var1 == 1)
	varn = value2;
else if (var2 == 2)
	varn = value3;
else
	varn = value1;

/* so we can simply replace those values using arrays */
ourtype_t mapsvalues[] = { value1, value2, value3 };
varn = mapsvalues[var1];
</pre>
<p>Also we usually can setup reductions by creating <i>table lookups</i> and <i>state machines</i>, so we can create the proper map between certain variable data and certain <i>function</i>. State machines are a powerful abstraction which allows us to code different states inside data structures.</p>
<p>We can have predefined values in our table lookup tasks. Then we are using <a href='http://en.wikipedia.org/wiki/Lazy_evaluation'>lazy evaluation</a>. Every time we have a constant value which is requested and not calculated each time we work with it, we are doing lazy evaluation.</p>
<h4>register keyword</h4>
<pre name='code' class='c'>
/* using the register keyword should help creating faster code */
register int counter;
</pre>
<p><br/></p>
<h3>reduce data access computation</h3>
<p>If we have deep constructed data structures (<tt>struct</tt> in C), every time we access most deep nodes, we are using <i>pointer arithmetics</i>, which implies basic math operations to access certain parts of our structures. Here we can do tow tasks: <i>alias creation and usage</i> and <i>padding adjustment</i>. Alias usage, means that we must use an internal pointer to access directly a structure member, so we omit pointer calculation each time we access it. Padding adjustment, is just about to create the proper data structure member order.</p>
<pre name='code' class='c'>
/* structure without the proper padding */
struct my_struct {
	char *a;
	void *b;
	int c;
	double n;
	char *x;
};

/* the same structure with the proper padding */
struct my_struct {
	double n;
	int c;
	char *a;
	char *x;
	void *b;
};
</pre>
<p>Also the data access computation is reduced on assembler level code, not the C code. Here we have an implied &eta;-reduction and invisible one. For deeply and nested data structures, we have the same issue. We should have as rule that the structure size must have an ideal size of <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_994.5_2d815e98c648cc714c03be5dad8ec434.png" style="vertical-align:-5.5px; display: inline-block ;" alt="~s = ~n^2" title="~s = ~n^2"/>, with <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_995_6ded80df32818a359c9e6e317b4a741b.png" style="vertical-align:-5px; display: inline-block ;" alt="~s" title="~s"/> as the structure size and <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_995_7f9468a4201f228dc27a50d25c44c696.png" style="vertical-align:-5px; display: inline-block ;" alt="~n" title="~n"/> as the padding adjustemnt to power of two.</p>
<pre name='code' class='c'>
/* some structs with nested members */
struct a {
	int m1;
};

struct b {
	int m2;
	struct a *m3;
}

struct c {
	int m4;
	struct b *m5;
}

/* the non cheaper version to access its members */
struct c *x = some_function_returning_c();
x-&gt;m5-&gt;m3-&gt;m1 = some_other_function();
if (x-&gt;m5-&gt;m3-&gt;m1 != 0) {
	another_function(x-&gt;m5-&gt;m3-&gt;m1);
}

/* the cheaper version to access its members
   using aliases */
struct c *x = some_function_returning_c();
struct b *p;
b = x-&gt;m5-&gt;m3;
b-&gt;m1 = some_other_function();
if (b-&gt;m1 != 0) {
	another_function(b-&gt;m1);
}
</pre>
<p><br/></p>
<h3>loop unrolling</h3>
<p>Each step on a loop repeats some instructions. For example if we have a fixed size array, where we must treat each element with certain function, we can use unrolled loops.</p>
<pre name='code' class='c'>
/* normal iteration over fixed size array */
for (i = 0; i &lt; 100; i++) {
	call_some_function(my_array[i]);
}

/* applied loop unrolling and reverse loop */
for (i = 100; i--;) {
	call_some_function(my_array[i]);
	call_some_function(my_array[--i]);
	call_some_function(my_array[--i]);
	call_some_function(my_array[--i]);
	call_some_function(my_array[--i]);
}
</pre>
<p>Note that here we have a fixed size array. In other case is hard to know the array size. Also we can use our compiler optimization to unroll each loop, if our compiler has the proper option. For example <i>GCC</i> supports automatic loop unrolling by using the <i>-funroll-loops</i> flag.</p>
<p><br/></p>
<h3>loop jamming</h3>
<p>Reusing blocks of code inside loops matters.</p>
<pre name='code' class='c'>
/* here we have two loops for something that can
   be done one loop */
for (i = 0; i &lt; 100; i++) {
	some_function_a(my_array[i]);
}
for (i = 0; i &lt; 100; i += 10) {
	some_function_b(my_array[i]);
}

/* here we have two loops for something that can
   be done one loop */
for (i = 0; i &lt; 100; i++) {
	some_function_a(my_array[i]);
	if ((i % 10) == 0) {
		some_function_b(my_array[i]);
	}
}
</pre>
<p>On the example above we have the proper loop doing the same tasks with less operations, so we have reduced the steps of that loop from <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_7b1dc71d185484895c3d041d16d3e12c.png" style="vertical-align:-7.5px; display: inline-block ;" alt="O(2n)" title="O(2n)"/> to <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_125ef5dbfb16f87edc57260c2f532793.png" style="vertical-align:-7.5px; display: inline-block ;" alt="O(n)" title="O(n)"/> &mdash; note that <img src="http://coder.cl/wp-content/plugins/wpmathpub/phpmathpublisher/img/math_992.5_7b1dc71d185484895c3d041d16d3e12c.png" style="vertical-align:-7.5px; display: inline-block ;" alt="O(2n)" title="O(2n)"/> is just symbolic and not strict.</p>
<p><br/></p>
<h3>bit padding matters</h3>
<p>It depends on the architecture. Processing data types shorter or larger than the register size do not have a cheaper cost than using them. For example if we use <tt>char</tt> or <tt>short</tt>, we are not using a complete register, which is more hard to handle than register length variables, such as <tt>int</tt> and <tt>long</tt>.</p>
<p><br/></p>
<h3>references</h3>
<ul>
<li>Michael E. Lee, <a href='http://leto.net/docs/C-optimization.php'>&quot;Optimization of Computer Programs in C&quot;</a>, Ontek Corporation.</li>
<li>Adrian Barnetts, <a href='http://www.abarnett.demon.co.uk/tutorial.html'>&quot;C optimisation tutorial&quot;</a>.</li>
<li>Paul Hsieh, <a href='http://www.azillionmonkeys.com/qed/optimize.html'>&quot;Programming Optimization&quot;</a>.</li>
<li>Koushik Ghosh, <a href='http://www.codeproject.com/KB/cpp/C___Code_Optimization.aspx'>Writing Efficient C and C Code Optimization</a>, The Code Project.</li>
<li><a href='http://www.eventhelix.com/realtimemantra/basics/optimizingcandcppcode.htm'>Optimizing C and C++ Code</a>. EventHelix.</li>
<li>Cris H. Pappas and William H. Murray, <i>&quot;386 Microprocessor Handbook</a>&quot;</i>, McGraw Hill.</li>
</ul>



share this article at: 


	<a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fcoder.cl%2F2009%2F12%2Fsource-code-optimization-in-c%2F&amp;title=source%20code%20optimization%20in%20c&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=%0D%0A%26quot%3B...premature%20optimization%20is%20the%20root%20of%20all%20evil%26quot%3B.%0D%0A%26mdash%3B%20Donald%20Knuth%0D%0A%0D%0A%0D%0AI%20agree%20with%20the%20fact%20that%20we%20must%20do%20our%20source%20code%20level%20optimizations%20when%20we%20have%20finshed%20the%20construction%20stage%20or%20it%20is%20almost%20complete.%20I%20was%20searchin" 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%2F2009%2F12%2Fsource-code-optimization-in-c%2F&amp;title=source%20code%20optimization%20in%20c&amp;notes=%0D%0A%26quot%3B...premature%20optimization%20is%20the%20root%20of%20all%20evil%26quot%3B.%0D%0A%26mdash%3B%20Donald%20Knuth%0D%0A%0D%0A%0D%0AI%20agree%20with%20the%20fact%20that%20we%20must%20do%20our%20source%20code%20level%20optimizations%20when%20we%20have%20finshed%20the%20construction%20stage%20or%20it%20is%20almost%20complete.%20I%20was%20searchin" 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%2F2009%2F12%2Fsource-code-optimization-in-c%2F&amp;title=source%20code%20optimization%20in%20c&amp;bodytext=%0D%0A%26quot%3B...premature%20optimization%20is%20the%20root%20of%20all%20evil%26quot%3B.%0D%0A%26mdash%3B%20Donald%20Knuth%0D%0A%0D%0A%0D%0AI%20agree%20with%20the%20fact%20that%20we%20must%20do%20our%20source%20code%20level%20optimizations%20when%20we%20have%20finshed%20the%20construction%20stage%20or%20it%20is%20almost%20complete.%20I%20was%20searchin" 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%2F2009%2F12%2Fsource-code-optimization-in-c%2F&amp;title=source%20code%20optimization%20in%20c" 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%2F2009%2F12%2Fsource-code-optimization-in-c%2F&amp;t=source%20code%20optimization%20in%20c" 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=source%20code%20optimization%20in%20c%20-%20http%3A%2F%2Fcoder.cl%2F2009%2F12%2Fsource-code-optimization-in-c%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%2F2009%2F12%2Fsource-code-optimization-in-c%2F&amp;title=source%20code%20optimization%20in%20c&amp;annotation=%0D%0A%26quot%3B...premature%20optimization%20is%20the%20root%20of%20all%20evil%26quot%3B.%0D%0A%26mdash%3B%20Donald%20Knuth%0D%0A%0D%0A%0D%0AI%20agree%20with%20the%20fact%20that%20we%20must%20do%20our%20source%20code%20level%20optimizations%20when%20we%20have%20finshed%20the%20construction%20stage%20or%20it%20is%20almost%20complete.%20I%20was%20searchin" 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 © 2009 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>, 2009. | <a href="http://coder.cl/2009/12/source-code-optimization-in-c/">Permalink</a> | <a href="http://coder.cl/2009/12/source-code-optimization-in-c/#comments">One comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2009/12/source-code-optimization-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>java mutexes</title>
		<link>http://coder.cl/2009/12/java-mutexes/</link>
		<comments>http://coder.cl/2009/12/java-mutexes/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 11:25:27 +0000</pubDate>
		<dc:creator>Daniel Molina Wegener</dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://coder.cl/?p=548</guid>
		<description><![CDATA[Java synchronization is usually made through the synchronized keyword. Synchronized allow users to create a mutex around certain variable, class or method, where a mutex allows concurrent access to it. By concurrent access we should understand access from multiple threads. If an operation is atomic, there one and only one process or thread executing it. [...]]]></description>
			<content:encoded><![CDATA[<p>Java synchronization is usually made through the <i>synchronized</i> keyword. Synchronized allow users to create a mutex around certain variable, class or method, where a mutex allows concurrent access to it. By concurrent access we should understand <i>access from multiple threads</i>. If an operation is <i>atomic</i>, there one and only one process or thread executing it. Then, mutex based operations are atomic.</p>
<p><span id="more-548"></span></p>
<p>In Java, thread synchronization made using the <i>synchronized</i> keyword can create a heavy &mdash; with a high number of threads &mdash; overhead in two main cases, the first one is when it is used on classes and the second one when it is used in methods. Then we must think a way to create small locks, mainly if we are using design patterns like <i>singletons</i>.</p>
<pre name="code" class="java">
/* BAD CASE 1, throws NullPointerException */
class BadMutexBaseClass {
	private static BadMutexBaseClass singletonInstance;
	public static BadMutexBaseClass getInstance(void) {
		synchronized (singletonInstance) {
			if (singletonInstance == null) {
				singletonInstance = new BadMutexBaseClass();
			}
			return singletonInstance;
		}
	}
}
</pre>
<pre name="code" class="java">
/* BAD CASE 2, heavy overhead */
class BadMutexBaseClass {
	private static BadMutexBaseClass singletonInstance;
	public synchronized static BadMutexBaseClass getInstance(void) {
		if (singletonInstance == null) {
			singletonInstance = new BadMutexBaseClass();
		}
		return singletonInstance;
	}
}
</pre>
<p>Both cases are wrong, we must use mutex object, without touching the singleton member and allowing the program to access the singleton atomically. We can use a basic <i>Object</i> instance to create the proper mutex.</p>
<pre name="code" class="java">
/* MUTEX BASED CASE */
class MutexBaseClass {
	private static Object mutex = new Object();
	private static MutexBaseClass singletonInstance;
	public static MutexBaseClass getInstance(void) {
		synchronized (mutex) { /* critical section */
			if (singletonInstance == null) {
				singletonInstance = new MutexBaseClass();
			}
			return singletonInstance;
		}
	}
}
</pre>
<p>By creating a <i>dummy</i> object, we can use it as mutex in our program. With a more low level perspective, this technique is similar to the one used with <a href="http://www.opengroup.org/onlinepubs/000095399/functions/pthread_mutex_lock.html">pthread_mutex_lock(P)</a> techniques while we are programming with threads in <b>C</b>. An interesting point is the fact that <i>non-blocking algorithms</i> are faster than locking ones. The mutex technique is a blocking technique. Non-blocking techniques, such as lock-free and obstruction-free, can allow the user to implement faster &mdash; but more complex &mdash; code.</p>
<p><b>GCC</b> has <a href="http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html">built-in atomic</a> operations to allow the creation of such code, like <i>CAS</i> operations, allowing the use of <i>lock-free</i> techniques. For example in the code bellow &mdash; which is using the __sync_bool_compare_and_swap atomic operation &mdash; we can see that the  <i>CAS</i> or <i>Compare and Swap</i> operation is made around the number of transactions with <i>old value</i> and <i>old value plus one</i>.</p>
<pre name="code" class="c">
do {
	old = vproc_shmem->vp_shmem_transaction_cnt;

	if (unlikely(old &lt; 0)) {
		if (vproc_shmem->vp_shmem_flags &amp; VPROC_SHMEM_EXITING) {
			_exit(0);
		} else {
			__crashreporter_info__ = &quot;Unbalanced: vproc_transaction_begin()&quot;;
		}
		abort();
	}
} while( !__sync_bool_compare_and_swap(&amp;vproc_shmem->vp_shmem_transaction_cnt, old, old + 1) );
</pre>
<p>I hope that Java will include kind that <i>atomic operations</i> to allow the use of non-blocking algorithms and more faster code and since I agree with the fact that we are entering the multi-core era&#8230;</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%2F2009%2F12%2Fjava-mutexes%2F&amp;title=java%20mutexes&amp;source=coder+.+cl+system+programmer+%26amp%3B+web+developer&amp;summary=Java%20synchronization%20is%20usually%20made%20through%20the%20synchronized%20keyword.%20Synchronized%20allow%20users%20to%20create%20a%20mutex%20around%20certain%20variable%2C%20class%20or%20method%2C%20where%20a%20mutex%20allows%20concurrent%20access%20to%20it.%20By%20concurrent%20access%20we%20should%20understand%20access" 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%2F2009%2F12%2Fjava-mutexes%2F&amp;title=java%20mutexes&amp;notes=Java%20synchronization%20is%20usually%20made%20through%20the%20synchronized%20keyword.%20Synchronized%20allow%20users%20to%20create%20a%20mutex%20around%20certain%20variable%2C%20class%20or%20method%2C%20where%20a%20mutex%20allows%20concurrent%20access%20to%20it.%20By%20concurrent%20access%20we%20should%20understand%20access" 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%2F2009%2F12%2Fjava-mutexes%2F&amp;title=java%20mutexes&amp;bodytext=Java%20synchronization%20is%20usually%20made%20through%20the%20synchronized%20keyword.%20Synchronized%20allow%20users%20to%20create%20a%20mutex%20around%20certain%20variable%2C%20class%20or%20method%2C%20where%20a%20mutex%20allows%20concurrent%20access%20to%20it.%20By%20concurrent%20access%20we%20should%20understand%20access" 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%2F2009%2F12%2Fjava-mutexes%2F&amp;title=java%20mutexes" 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%2F2009%2F12%2Fjava-mutexes%2F&amp;t=java%20mutexes" 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=java%20mutexes%20-%20http%3A%2F%2Fcoder.cl%2F2009%2F12%2Fjava-mutexes%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%2F2009%2F12%2Fjava-mutexes%2F&amp;title=java%20mutexes&amp;annotation=Java%20synchronization%20is%20usually%20made%20through%20the%20synchronized%20keyword.%20Synchronized%20allow%20users%20to%20create%20a%20mutex%20around%20certain%20variable%2C%20class%20or%20method%2C%20where%20a%20mutex%20allows%20concurrent%20access%20to%20it.%20By%20concurrent%20access%20we%20should%20understand%20access" 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 © 2009 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>, 2009. | <a href="http://coder.cl/2009/12/java-mutexes/">Permalink</a> | <a href="http://coder.cl/2009/12/java-mutexes/#comments">No comment</a><br/>Post tags: <br/></small></p>
]]></content:encoded>
			<wfw:commentRss>http://coder.cl/2009/12/java-mutexes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
