<?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>Dani Berg &#187; Programming</title>
	<atom:link href="http://daniberg.com/home/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://daniberg.com/home</link>
	<description>Angels like Kittens</description>
	<lastBuildDate>Mon, 30 Aug 2010 05:10:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Wearing a sysadmin hat</title>
		<link>http://daniberg.com/home/2010/02/wearing-a-sysadmin-hat/</link>
		<comments>http://daniberg.com/home/2010/02/wearing-a-sysadmin-hat/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 05:39:38 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=687</guid>
		<description><![CDATA[In the past weeks I&#8217;ve been doing some temporary sysadmin work for my day job and this new role extended to my night-time job. Yeah, I joined a startup but I&#8217;ll talk more about that some other day. I had to move one of the web services we offer in my regular job to its [...]]]></description>
			<content:encoded><![CDATA[
<p>In the past weeks I&#8217;ve been doing some temporary sysadmin work for my day job and this new role extended to my night-time job. Yeah, I joined a startup but I&#8217;ll talk more about that some other day.</p>
<p>I had to move one of the web services we offer in my regular job to its own server. It was a good change, we moved the entire app from a CentOS/cPanel box hosted on the Planet to an instance running Ubuntu on AWS.</p>
<p>CPanel is a really good product and saves you a lot of time but it is a pain in the butt if you are serving more than shared hosting accounts. If you have ever tried to automate tasks that handle virtual domains, email accounts and DNS entries you know what I&#8217;m talking about.</p>
<p>Anyway, I must admit that I&#8217;m having a blast wearing a sysadmin hat during part of my day.  I&#8217;m learning a lot. I have this great excuse to read some books that were on my TO READ list for a long time.</p>
<p>One of these books is <strong>Pro DNS and Bind</strong> by <em>Ron Aitchison</em>. I have had this book on my desk for months but I finally finished reading it. The book gave me a nice introduction to DNS servers, resolvers, zone files, resource records and diagnostic tools. Highly recommended.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2010/02/wearing-a-sysadmin-hat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A matter of guidance</title>
		<link>http://daniberg.com/home/2009/12/a-matter-of-guidance/</link>
		<comments>http://daniberg.com/home/2009/12/a-matter-of-guidance/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 05:08:51 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=306</guid>
		<description><![CDATA[Cloudy days are perfect for productive leisure, so in March before moving to the US I spent a lazy-cloudy-Sunday afternoon packing. Moving is always exciting and a good chance to get rid of everything that is not necessary in your life anymore. You can even leave bad vibes behind if you are spiritual. We tend [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniberg.com/home/wp-content/uploads/2009/12/LasVegas.JPG"><img class="alignleft size-medium wp-image-634" title="LasVegas" src="http://daniberg.com/home/wp-content/uploads/2009/12/LasVegas-168x300.jpg" alt="LasVegas" width="168" height="300" /></a> Cloudy days are perfect for productive leisure, so in March before moving to the US I spent a lazy-cloudy-Sunday afternoon packing. Moving is always exciting and a good chance to get rid of everything that is not necessary in your life anymore. You can even leave bad vibes behind if you are spiritual. We tend to gather too much junk. Keep it simple.</p>
<p>The cleanup included my bookshelf. My mission was to dispose of as many books as possible. Boy, books are heavy to carry and physics does not apply when it is part of your luggage.</p>
<p>While running through the titles I started to compare dates of purchase against subjects. I have had this habit since I was a teen, every time I buy a book I sign and date it.</p>
<p>Anyway, my small library was another lead to an obvious issue: my quest to become a programmer is a mess.</p>
<p>Here&#8217;s one good example. I wanted to code games when I was a teen. After some research I concluded that C++ and DirectX were the right tools for the job. I decided to start with C++ and ordered &#8220;C++ How to Program&#8221; by Deitel. Back then, a small number of web pages would advise: &#8220;You have to learn C&#8221;. My mind discarded that advice as fast as I could read it. Why would I learn C? Isn&#8217;t C++ not only C but PLUS PLUS! It is the future. Yeah, I know you are laughing at me.</p>
<p>I read and tried all the examples from &#8220;C++ How to Program&#8221; before reading or writing any line of pure C code and felt ready to dive into some DirectX books and code the best tic-tac-toe ever!</p>



<p>Turns out my ambitious plan needed a detour. You have to go through some Windows programming before you can dive into DirectX (I don&#8217;t know how it works now a days). Gosh, 70 lines of C code just to print Hello World in the Win32 API world.</p>
<p>I can&#8217;t just copy and paste code so I ordered &#8220;Programming Windows&#8221; by Petzold to become familiar with Windows programming. BTW, Programming Windows is a great book &#8212; and I found a minor mistake in the text! (<a href="http://www.jasondoucette.com/books/pw5/pw5errata.html#chapter5">Erratum #5</a>).</p>
<p>I read the book, tried the examples and the fact is: Win32 API is C Code.</p>
<p>Because of that I finally ordered the classic &#8220;The C programming language&#8221; book to fill this awful gap in my skill set. Comparing the dates of purchase I realized that I bought the C book 2 years after the C++ one. Sad.</p>
<p>I now remember that after going back and forth I finally achieved my goal. The best tic-tac-toe game ever written did compile and run without crashing. The euphoria lasted for almost 5 seconds!</p>
<p>Before writing my first line of code I was already humble and comfortable with the idea that it takes a lifetime to be a great developer. BUT, it took me a long time to have a better overview of the skills set you need to build in order to be a software developer.</p>
<p><em>It&#8217;s a matter of proper guidance</em>.</p>
<p>It doesn&#8217;t matter if it&#8217;s a CS degree or guru souls willing to show you the way.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/12/a-matter-of-guidance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Day Experience</title>
		<link>http://daniberg.com/home/2009/10/windows-day-experience/</link>
		<comments>http://daniberg.com/home/2009/10/windows-day-experience/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 04:41:33 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=505</guid>
		<description><![CDATA[I always try to have at least one small toy project that I can play with at night. Sometimes it consists of only reading the source code and mailing list from a big project and sometimes my toy project involves writing code and playing with different tools than the ones required by my daily job. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniberg.com/home/wp-content/uploads/2009/10/P1050463.JPG"><img class="alignleft size-thumbnail wp-image-516" title="vegas" src="http://daniberg.com/home/wp-content/uploads/2009/10/P1050463-150x150.jpg" alt="vegas" width="150" height="150" /></a>I always try to have at least one small toy project that I can play with at night. Sometimes it  consists of only reading the source code and mailing list from a big project and sometimes my toy project involves writing code and playing with different tools than the ones required by my daily job.</p>
<p>A few months ago I added to my schedule a <a href="http://daniberg.com/home/2009/06/windows-day/">Windows Day</a>. Brand new world. I dove into Vista, ASP.NET, C#, IIS, MSSQL and Visual Studio one day per week (and occasionally weekends) for a few months.</p>
<p>I was excited because of the novelty. I read a few books on the subject and had  to play with it.</p>
<p>Here are some random thoughts about my experience.</p>
<p>Right on the first day I got frustrated using the mouse for simple tasks like moving and copying files around so I installed <a href="http://cygwin.com">cygwin</a>.  <a href="http://www.joelonsoftware.com/articles/Biculturalism.html">A difference between two worlds</a>.<strong> </strong></p>
<p>I learned later that there is a Windows option for the command line: <a href="http://en.wikipedia.org/wiki/Windows_PowerShell">Powershell</a>. Although I didn&#8217;t try it the Wikipedia article gives me the impression that learning Powershell is probably a good investment for Windows developers.</p>
<p>Back to random thoughts.</p>
<p><span style="background-color: #ffffff; ">I was then ready to try Visual Studio. It is amazing to try  examples from books just dragging and dropping icons that build some correctly written snippet of code. I just doubt that experienced developers would follow that approach. </span></p>
<p><span style="background-color: #ffffff; ">One problem I had with Visual Studio was trying to set the Emacs key bindings. Leaving the keyboard home row to reach keys like arrows, page down and page up is disturbing. I followed <a href="http://www.davesquared.net/2008/02/emacs-key-bindings-everywhere.html">this post advice</a> and installed Emacs Everywhere.</span></p>
<p><a href="http://daniberg.com/home/wp-content/uploads/2009/10/P1050196.JPG"><img class="alignright size-thumbnail wp-image-519" title="P1050196" src="http://daniberg.com/home/wp-content/uploads/2009/10/P1050196-150x150.jpg" alt="P1050196" width="150" height="150" /></a></p>
<p>The next step was the database. Oh boy, choosing a MSSQL version is so damn confusing! I&#8217;m probably getting older and dumber but I couldn&#8217;t understand which option to download from the MS website. Installing MSSQL in Vista was quite painful, too. Had to follow some MS black magic recipes to get it running. Installation on Windows 7 Beta was a breeze though.</p>
<p>After setting up the database I went to the HTTP server. IIS is pretty straightforward. You can setup a working environment with just a few clicks.</p>
<p>Working environment ready and I started to follow the books&#8217; examples. A few ASP.NET web forms later and I was ready to start learning C#.</p>
<p>Talking about computer languages is somehow a taboo so it should suffice to say that C# is verbose.</p>
<p>Well, a few months after my first Windows I&#8217;m back to a Linux side project but I&#8217;m glad that I took some time to get an overall idea about the ASP.NET world. It&#8217;s not for me. Once you<span style="background-color: #ffffff; "> go open source you never go back. </span></p>
<p><span style="background-color: #ffffff; ">If you are only interested in building your client project it doesn&#8217;t really matter the platform you pick but it&#8217;s a disturbing feeling that you can&#8217;t  build IIS or poke Visual Studio&#8217;s source code. There is this sense of being a powerless and passive consumer always trying to catch up every .NET update.</span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/10/windows-day-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ancient bank institution file formats will make you bald</title>
		<link>http://daniberg.com/home/2009/09/ancient-bank-institution-file-formats-will-make-you-bald/</link>
		<comments>http://daniberg.com/home/2009/09/ancient-bank-institution-file-formats-will-make-you-bald/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 18:37:42 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=445</guid>
		<description><![CDATA[This past week I was documenting part of the system from the company I work for in Brazil, and while running through the payment options code I was again confronted by the ancient file format that bank institutions still use today. You&#8217;ll never complain about XML files again if you have to deal with a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniberg.com/home/wp-content/uploads/2009/09/computermuseum.jpg"><img class="alignleft size-thumbnail wp-image-461" title="computer museum" src="http://daniberg.com/home/wp-content/uploads/2009/09/computermuseum-150x150.jpg" alt="computer museum" width="150" height="150" /></a>This past week I was documenting part of the system from the company I work for in Brazil, and while running through the payment options code I was again confronted by the ancient file format that bank institutions still use today. You&#8217;ll never complain about XML files again if you have to deal with a bank file format in your life.</p>
<p>I don&#8217;t know how it works here in the US but years ago banks in Brazil came up with a file format dubbed <em>CNAB</em> to exchange financial transactions. It&#8217;s basically a layout where data fields are delimited by their byte positions. Seems pretty straight forward, right? So try implementing one and you will feel the pain.</p>
<p>The first problem is bureaucracy. You need a business account, lots of papers, signatures, phones calls and of course talking to Elaine. She is your bank account manager, really polite and willing to help but obviously completely clueless regarding any technical question. Most of the time she is not allowed to put you in contact with someone who works all day writing Cobol and has all the answers to your questions (I actually empathize with the Cobol guy and pity him whenever he needs to answer the phone).</p>
<p>After everything is set and you are allowed to interact with the bank system via their file format they email you the technical instructions. It&#8217;s a word document detailing the layout. Prepare yourself to learn how it works through trial and error and a lucky chance to talk to someone on the phone (yes, a real human being) who actually knows what is the default char for the field delimited between bytes 116 and 118.<em> Is it a blank space or just a zero? Can the file be encoded in UTF-8?<br />
</em></p>
<p>You just need a second bank to send you their layout documentation to prove your inner fear. Each bank implements its own CNAB layout version. This is the time you start praying for a framework to deal with all layout inconsistencies across bank institutions.</p>
<p>All is not lost though. After going through all this you have a new skill set. You are ready to work at any bank institution because you did your homework. You have grasped an understanding of all kinds of bank transactions. You have to do this even if you only want to automate monthly invoices for your customers. It&#8217;s a hell of a ride my friend.</p>
<p>Now, I&#8217;m not trying to undervalue the CNAB file format. It was probably a good solution 20 years ago. It still works. The problem I see is how banks are outdated compared to companies like Paypal and alike. What are they thinking? Can&#8217;t you just build a web interface to deal with your internal file formats? Just give me a Restful Web Service in XML or JSON so I can send monthly invoices or pay the employees.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/09/ancient-bank-institution-file-formats-will-make-you-bald/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how much does a line of code cost?</title>
		<link>http://daniberg.com/home/2009/08/how-much-does-a-line-of-code-cost/</link>
		<comments>http://daniberg.com/home/2009/08/how-much-does-a-line-of-code-cost/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 04:02:15 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[autoresponder]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=372</guid>
		<description><![CDATA[This past week I stumbled upon a nice tool: sloccount. Sloccount was written by David Wheeler and is a set of tools to count lines of code. Wheeler also has some really interesting papers regarding the linux kernel size and its development cost. After installing sloccount* I immediately started to harvest data on all projects [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniberg.com/home/wp-content/uploads/2009/08/P1040522.JPG"><img class="alignleft size-thumbnail wp-image-411" title="Rio de Janeiro" src="http://daniberg.com/home/wp-content/uploads/2009/08/P1040522-150x150.jpg" alt="Rio de Janeiro" width="150" height="150" /></a>This past week I stumbled upon a nice tool: <em>sloccount</em>. <a href="http://www.dwheeler.com/sloccount/">Sloccount</a> was written by David Wheeler and is a set of tools to count lines of code. Wheeler also has some really interesting papers regarding the linux kernel size and its development cost.</p>
<p>After installing sloccount<em>*</em> I immediately started to harvest data on all projects I currently have on my hard drive. I was really impressed by the first results. The costs are too high, I thought. A small project with 2,000 lines of PHP code like the Autoresponder has a development cost estimated at more than US$55k.</p>
<p>After reading sloccount&#8217;s user manual and pondering about the <a href="http://awakeautoresponder.com">Awake Autoresponder</a> I started to change my mind. 2k lines of PHP code encompass a lot more work than the number suggests. A few reasons for this:</p>
<ol>
<li>The code was updated every time a customer submitted a bug. As you know, fixing a bug does not necessarily imply more lines of code</li>
<li>Out of the box sloccount doesn&#8217;t compute HTML, CSS or Javascript</li>
<li>Technical support</li>
<li>Documentation</li>
</ol>
<p>It took me a few thousand commits, I don&#8217;t know how many emails and several hours of night debugging the script on customer&#8217;s servers to reach 2k working lines of code. It may sound like cheap advertisement or self promotion but I must say that US$49.90 for the script is a bargain!</p>
<p><em>* if you are running Ubuntu it&#8217;s easy as<br />
</em></p>
<p><code>sudo apt-get install sloccount</code></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/08/how-much-does-a-line-of-code-cost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>documentation and job transition</title>
		<link>http://daniberg.com/home/2009/08/documentation-and-job-transition/</link>
		<comments>http://daniberg.com/home/2009/08/documentation-and-job-transition/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 22:54:18 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=348</guid>
		<description><![CDATA[I&#8217;m living a transitional period. One might say that life is always on transitional mode. An eternal deja-vu. Cheap philosophy apart, I&#8217;m slowly starting to seek for a new job here in the US. I&#8217;m still working for my former employer but since currency exchange rates are not on my side (as of today I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniberg.com/home/wp-content/uploads/2009/08/sf.jpg"><img class="alignleft size-thumbnail wp-image-377" title="san francisco" src="http://daniberg.com/home/wp-content/uploads/2009/08/sf-150x150.jpg" alt="san francisco" width="150" height="150" /></a>I&#8217;m living a transitional period. One might say that life is always on transitional mode. An eternal deja-vu. Cheap philosophy apart, I&#8217;m slowly starting to seek for a new job here in the US. I&#8217;m still working for my former employer but since currency exchange rates are not on my side (as of today I need R$1.83 to buy US$1.00) I need an extra income. A part time job maybe? I don&#8217;t know yet.</p>
<p>Anyway, chances are I&#8217;ll be devoting fewer hours developing for my current employer  so I decided to improve our documentation base.</p>
<p>Documentation includes how to properly setup a working environment, main concepts of the system, shell scripts that do black magic, coding guidelines, etc. I&#8217;m also writing down a lot of ideas to improve the current system we have and formating TODO lists that only make sense in my head into prose.</p>
<p>The problem is that part of the system was first developed and discussed only in non-formal meetings. Yes, productive and get to the point meetings. We didn&#8217;t have the chance to properly document everything as dictate theory and common sense.</p>
<p>So, right now I&#8217;m writing. A lot.</p>
<p>One of my main goals is to make the life of future developers joining the team easier. What are the first steps? What is all that code supposed to do? What needs to be done? How it can be done?</p>
<p>It forced me to stop and look back. Stop being a <a href="http://en.wikipedia.org/wiki/Getting_Things_Done">GTD</a> code maniac and look back at everything that was done in 3 years.</p>
<p>It&#8217;s unbelievable not only the amount of things we&#8217;ve got done (lines of code in my case&#8230;) but also how much we improved. It was crazy, it is still crazy, but we fixed bugs, released updates and new features almost every day. Ohhh&#8230; s t a r t u p s.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/08/documentation-and-job-transition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>subversion emailed commits</title>
		<link>http://daniberg.com/home/2009/08/subversion-emailed-commits/</link>
		<comments>http://daniberg.com/home/2009/08/subversion-emailed-commits/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 21:16:55 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=357</guid>
		<description><![CDATA[As crazy as it may sound to most people, I like Mondays. The main reason for this is that my mind is refreshed after the weekend and I&#8217;m excited to get back to my regular job source code and get things done. Monday is also a good day for novelty. Well, this morning I did [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://daniberg.com/home/wp-content/uploads/2009/08/P1040990.JPG"><img class="alignleft size-thumbnail wp-image-362" title="Donuts" src="http://daniberg.com/home/wp-content/uploads/2009/08/P1040990-150x150.jpg" alt="Donuts" width="150" height="150" /></a>As crazy as it may sound to most people, I like Mondays. The main reason for this is that my mind is refreshed after the weekend and I&#8217;m excited to get back to my regular job source code and get things done. Monday is also a good day for novelty.</p>
<p>Well, this morning I did put into practice something that is most certainly not new for you: the post-commit SVN hook. As an experienced developer you can stop reading the post right now.</p>
<p>The post-commit is now active and all developers (the development team is small) receive an email after a commit is done. The email contains the revision number, author, log message and the diff generated by the commit.</p>
<p>I learned about this procedure reading the book <a href="http://daniberg.com/home/2009/05/producing-open-source-software/">Producing Open Source Software</a>.</p>
<p>The goal is to help everyone involved in the code to have a better idea of what is being done. Who is working where and most importantly, if someone is touching part of the code that is of special interest to you.</p>
<p>After a few commits and just skimming through the code you&#8217;ll see the benefits.</p>
<p>You start to police yourself to make small and well documented commits. Good.</p>
<p>It&#8217;s also easier to comment about code that was introduced/updated by your peers. The diff is right there in your email box and the changes are still fresh in the author&#8217;s head. Just hit reply!</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/08/subversion-emailed-commits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The benefits I get releasing the autoresponder</title>
		<link>http://daniberg.com/home/2009/03/the-benefits-i-get-releasing-the-autoresponder/</link>
		<comments>http://daniberg.com/home/2009/03/the-benefits-i-get-releasing-the-autoresponder/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 00:39:36 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[autoresponder]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=33</guid>
		<description><![CDATA[The history behind the Autoresponder. In 2003 I was working in my home-office in a small town in Brazil while trying to get a college physics degree. To pay my bills I was basically building websites in PHP after I left the Perl world. I was part of the staff for a project designed and [...]]]></description>
			<content:encoded><![CDATA[<p>The history behind the Autoresponder.</p>
<p>In 2003 I was working in my home-office in a small town in Brazil while trying to get a college physics degree. To pay my bills I was basically building websites in PHP after I left the Perl world. I was part of the staff for a project designed and managed by a grumpy old man in New York. God, I should have sent him a copy of <strong>Peopleware</strong> (<a href="http://www.amazon.com/gp/product/0932633439?ie=UTF8&amp;tag=d024-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0932633439">Peopleware: Productive Projects and Teams   (Second Edition)</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.com/e/ir?t=d024-20&amp;l=as2&amp;o=1&amp;a=0932633439" border="0" alt="" width="1" height="1" />). One day he subscribed for an autoresponder service. It was not cheap and the service was not good at all. I thought I could code the same features and add the others we needed in no more than 2 days. I did it in a weekend and started to share it for free. Back then I had no idea what FSF or OSI were. I started the professional version a while later since it was taking crucial time out of my <span style="text-decoration: line-through;">day</span> night to give support and add new features.<br />
<a href="http://daniberg.com/home/wp-content/uploads/2009/03/mountain_view.jpg"><img class="alignleft size-thumbnail wp-image-72" title="mountain_view" src="http://daniberg.com/home/wp-content/uploads/2009/03/mountain_view-150x150.jpg" alt="mountain_view" width="150" height="150" /></a>Since the release of the first version I receive emails daily from people reporting bugs, asking for new features, giving suggestions or simply wanting to say hello. Well, although it might not help me to sell more copies, I must be sincere about my efforts into this project. Time to work on it is scarce. I switch between my regular job (there are always new projects at a startup) and research mode at night.</p>
<p>Releasing is not easy. I suffered from it and some symptoms I believe are shared amongst a lot of developers. One is frustration. You know you can do better but time is against you. Another problem is loss of focus. I learned how to manage and maintain this project (<em>more on this some other day</em>) in the hard way. I made all the common naive decisions like trying to rewrite it from scratch or adding a new feature to make a new sale.</p>
<p>Not everything wrong though. I&#8217;m still working on it, right?</p>
<p>One major key: <strong>Releasing</strong>.<strong> </strong></p>
<p>It taught me a few lessons.</p>
<p>The first version was small and built to do only one task. It solved one problem of mine but it also worked for a few more users.</p>
<p>The main benefit: <strong>Feedback</strong>.</p>
<p>I not only read and pay attention to all the emails people send me, but also take note of each one. There are two possibilities here.</p>
<p>1. add a ticket to the bugtracking as a feature to be built or a bug to be fixed.</p>
<p>2. take notes in my to-do log for random idead.</p>
<p>After a few tickets and paragraphs I started to notice patterns and features people wanted most. This way I avoid writing fancy features and make better use of my time writing features that people actually want.</p>
<p><a href="http://daniberg.com/home/wp-content/uploads/2009/03/mountain_view2.jpg"><img class="alignleft size-thumbnail wp-image-75" title="mountain_view2" src="http://daniberg.com/home/wp-content/uploads/2009/03/mountain_view2-150x150.jpg" alt="mountain_view2" width="150" height="150" /></a>The downside of this approach is, unfortunaltely, the elimination of these &#8220;fancy features&#8221;. One of these features could turn out to be innovative and a killer feature for the app. Right now, I think this is not a concern. I have all  these crazy ideas being developed and written down in my notes. Today these features are expensive for me to code. Meanwhile I have fun building a more mature version of the autoresponder.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/03/the-benefits-i-get-releasing-the-autoresponder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CPanel, pdo_mysql and Magento</title>
		<link>http://daniberg.com/home/2009/01/cpanel-pdo_mysql-and-magento/</link>
		<comments>http://daniberg.com/home/2009/01/cpanel-pdo_mysql-and-magento/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 21:23:00 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=45</guid>
		<description><![CDATA[A few days ago I had to install Magento in one of our servers. No luck running the installation for the first time. pdo_mysql missing. The server has Whm/Cpanel installed so our server administrator tried EasyApache and built a new profile with pdo_mysql added. Still no luck. To fix the problem I just had to [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I had to install <a href="http://www.magentocommerce.com/" target="_blank">Magento</a> in one of our servers. No luck running the installation for the first time. pdo_mysql missing. The server has Whm/Cpanel installed so our server administrator tried EasyApache and built a new profile with pdo_mysql added. Still no luck.</p>
<p>To fix the problem I just had to open<br />
<span style="font-weight: bold;font-family:courier new;">/usr/local/lib/php.ini</span><br />
and move the line<br />
<span style="font-weight: bold;font-family:courier new;">extension=&#8221;pdo_mysql.so&#8221;</span><br />
to the end of the file.</p>
<p>Restart Apache and that&#8217;s it!</p>
<p>Hope it helps if you are dealing with the same problem.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2009/01/cpanel-pdo_mysql-and-magento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Users and Subdomains</title>
		<link>http://daniberg.com/home/2008/12/users-and-subdomains/</link>
		<comments>http://daniberg.com/home/2008/12/users-and-subdomains/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 21:09:00 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=44</guid>
		<description><![CDATA[Some months ago the company I work for needed a special feature that I think is very common at web services. The idea is to offer users their own subdomains. It is pretty much like this blog system. The idea is that all subdomains point to the same location on your server. You can then [...]]]></description>
			<content:encoded><![CDATA[<p>Some months ago the company I work for needed a special feature that I think is very common at  web services. The idea is to offer users their own subdomains. It is pretty much like this blog system.</p>
<p>The idea is that all subdomains point to the same location on your server. You can then fetch user data from a database using the subdomain name as a key. We use a lot of PHP here so our key would be something like $_SERVER['DOMAIN_NAME'].</p>
<p>I first thought of building a small script at the server to manage the subdomains. List, add and delete. Boring.</p>
<p>The server for this system had cPanel installed. It is a good tool but it took me a while to find out I could handle all subdomain errands with CPanel&#8217;s XML API. The documentation is very poor and lack details. By the time of this writing you don&#8217;t even have a complete list of methods for the subdomains:</p>
<p><a href="http://www.cpanel.net/plugins/api2/index.html">CPanel API</a></p>
<p>You can see here that the only method listed is for deleting Subdomains. Too bad. Lost some precious time digging cPanel code.</p>
<p>Anyway, here&#8217;s a simple class that you can use to list, add and delete subdomains if you have cPanel installed on your server.</p>
<p>You&#8217;ll probably need to adapt the code to your needs and enforce error checking.</p>
<p><a href="http://daniberg.com/download/cpanel.tar">cpanel.tar</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2008/12/users-and-subdomains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Improvement Guide</title>
		<link>http://daniberg.com/home/2008/09/improvement-guide/</link>
		<comments>http://daniberg.com/home/2008/09/improvement-guide/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 20:51:00 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=41</guid>
		<description><![CDATA[I played guitar in a heavy metal band for almost 7 years. Crazy time. I never achieved the status of a professional musician but trying to learn and write music was one of the best shots I took in my life. When I thought about that time there are two things that I learned and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://escapemetal.com/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5243403849793996610" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_g2WBI0UvgLU/SMRQBUjjB0I/AAAAAAAAABU/NRcTOgHp4KQ/s320/cuca.jpg" border="0" alt="" /></a>I played guitar in a heavy metal band for almost 7 years. Crazy time. I never achieved the status of a professional musician but trying to learn and write music was one of the best shots I took in my life.</p>
<p>When I thought about that time there are two things that I learned and I still take benefits from it:</p>
<p>1) how to drink like a man<br />
2) how to study</p>
<p>Well, for number one the good thing is that you can hang out on Saturday night and still be productive in the next morning. No <em>extreme hangover</em> as an ol&#8217; friend once told me.</p>
<p>On how to study I took the lesson from real guitar players &#8211; then Musicians. You need method. Otherwise you&#8217;ll play 10 hours a day and still suck. No matter what skills you want to improve you need method. Otherwise you won&#8217;t be able to play that killer arpeggio that make teens to listen to the same lead break a thousand times.</p>
<p>Now, I don&#8217;t believe that there&#8217;s a perfect or magic method to improve your learning experience. It is up to you to discover and implement what works better for you. Two rules are mandatory though:</p>
<p><span style="font-weight: bold;">Rule #1 &#8211; </span><span style="font-weight: bold;">S</span><span style="font-weight: bold;">mall steps</span></p>
<p>It&#8217;s like Jack the Ripper. Take it through pieces. It&#8217;s better for you to read 30 minutes a day than to spend your whole sunday with your face into that algorithm book you promised yourself to master.</p>
<p><a href="http://2.bp.blogspot.com/_g2WBI0UvgLU/SMRUuf-uQWI/AAAAAAAAABk/2LTnuPvD6Do/s1600-h/doomact2.gif" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5243409024001392994" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_g2WBI0UvgLU/SMRUuf-uQWI/AAAAAAAAABk/2LTnuPvD6Do/s320/doomact2.gif" border="0" alt="" /></a><br />
This said, you need a schedule and this bring us to</p>
<p><span style="font-weight: bold;">Rule #2: Routine</span></p>
<p>Routine is the hard part. At least in the beginning. It&#8217;s easy to be distracted and procrastinate. A good way to motivate you to go through is to give you some credits when you achieve goals.</p>
<p>Make small goals. Goals that you can achieve. You can start with something like <span style="font-style: italic;">I&#8217;ll read some completely unknown technology to me 30 minutes everyday</span>.</p>
<p>Let&#8217;s face it. 30 minutes won&#8217;t hurt you. In a week you&#8217;ll see that it&#8217;s a breeze. You&#8217;ll raise your bar for the next week.</p>
<p><span style="font-weight: bold;">My routine at this moment</span></p>
<p>Before building my schedule I had to couple with the idea that I won&#8217;t live forever &#8211; <span style="font-style: italic;">at least in this incarnation</span>. So there&#8217;s a finite number of subjects and time to spend on them.</p>
<p>At this current stage of my life I have the ability to divide my learning time by</p>
<p>1) the mornings before doing &#8220;real&#8221; code. I go earlier to the office.<br />
2) night time<br />
3) small breaks during the day. Generally a 10 min break to let your subconscious deal with some problem you&#8217;re trying to solve.</p>
<p>For the subjects to learn I have priorities. Some subjects are mandatory and some are fun and new &#8211; and they improve your mandatory skills anyway.</p>
<p>I&#8217;m working as a software engineer in a startup company for almost 2 years. The language I deal most of the time is PHP. So, PHP is in my priority list. It&#8217;s very important for me to have a deep understanding of the language that pays my rent. I try to get better at the PHP world by reading books, magazines and even reading the language source code.</p>
<p>For the fun part I have included Python and Game Programming in my schedule. I mainly use Python at small side projects and use C for some stupid and small games. Games are a fun place for me to learn about algorithms and data structures.</p>
<p>I label everything else as <span style="font-style: italic;">Tools</span>. In this section I have included 5 subjects. Right now they are Apache, Mysql, Emacs, Regular Expressions and SVN.</p>
<p>Ok, with the list of WHAT what to learn I insert it into my WHEN agenda.</p>
<p>1) Mornings &#8211; PHP. Here I read regular books, security with the language, what&#8217;s being done for version 6 and once in a while I try to read the language C source code.</p>
<p>2) Nights &#8211; Python or C Game Programming. Here I try to work on small side projects with Python/Django and sometimes coding small pieces of games.</p>
<p>3) Small breaks during the day &#8211; Here I set a subject for each day of the week. Apache on Mondays, Mysql on Tuesdays, Emacs on Wednesdays, Regular Expressions on Thrusdays and finally SVN on Fridays.</p>
<p>There are of course lots of other subjects that I&#8217;m interested in. Again, since my time is limited all other subjects are in my list for the future.</p>
<p>Having a schedule like this seems tedious at first. It&#8217;s not. In the end it&#8217;s all about having fun in what you do. If you&#8217;re not up to reading an algorithm book on Wednesday read something else or just go out to drink beer!! Salute.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2008/09/improvement-guide/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2 Monitors</title>
		<link>http://daniberg.com/home/2008/08/2-monitors/</link>
		<comments>http://daniberg.com/home/2008/08/2-monitors/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 17:00:00 +0000</pubDate>
		<dc:creator>Dani Berg</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://daniberg.com/home/?p=40</guid>
		<description><![CDATA[I had some problems some days ago setting up 2 monitors to work in Ubuntu. One of my colleagues pointed out that he was using a Nvidia card and it worked out of the box in his machine. So, I took his advice and replaced the ATI hardware here with a Nvidia card. We took [...]]]></description>
			<content:encoded><![CDATA[<p>I had some problems some days ago setting up 2 monitors to work in Ubuntu. One of my colleagues pointed out that he was using a Nvidia card and it worked out of the box in his machine. So, I took his advice and replaced the ATI hardware here with a Nvidia card. We took the Nvidia from a Windows user and left my old ATI there. Let&#8217;s face it. Microsoft scored. Both cards worked by just inserting the hardware and clicking the buttons &#8220;Yes&#8221; or &#8220;Next&#8221; in the Windows box.</p>
<p>Now my machine is running with 2 monitors on Ubuntu and with all fancy but cool effects from Compiz. We use 19&#8243; monitors here. Hardware in Brazil is so damn expensive. Let&#8217;s say thanks to the government for all taxes and making the acquisition of TOOLS we NEED to WORK this HARD.</p>
<p><a href="http://2.bp.blogspot.com/_g2WBI0UvgLU/SMQI9sn9UhI/AAAAAAAAABA/IpmQNpccEp8/s1600-h/2monitors.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img id="BLOGGER_PHOTO_ID_5243325722209899026" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_g2WBI0UvgLU/SMQI9sn9UhI/AAAAAAAAABA/IpmQNpccEp8/s320/2monitors.png" border="0" alt="" /></a>Anyway, I was curious on how people work with 2 monitors here. Right now, the best approach for me is to have Emacs on the left. On the right monitor I have the browser and the terminal. I leave the terminal maximized since it has transparency in it and it&#8217;s such a nice feature. I can type my bash stuff and still read what&#8217;s on the browser. Wohooo!! There&#8217;s just one feature missing in GNOME. I can&#8217;t set a different wallpaper for each screen. KDE has this option though.</p>
<p>Whenever I need to use another program or do some unusual task I go to a different Desktop. Two Desktops are enough for me. I can only do an unusual task at a time. I guess Rands is right when he says <a href="http://www.randsinrepose.com/archives/2008/03/06/i_dont_multitask.html" target="_blank">I Don&#8217;t Multitask</a>.</p>
<p>After some time working this way I&#8217;m changing my mind about two monitors. I&#8217;m now willing to work with only one monitor. But it must be HUGE!!</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4429654278687803";
/* 468x60, created 6/11/09 */
google_ad_slot = "0066133711";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://daniberg.com/home/2008/08/2-monitors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
