<?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>PABLO GODEL &#187; tips</title>
	<atom:link href="http://pablogodel.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://pablogodel.com</link>
	<description>Software Development / Sailing / Photography / House Music</description>
	<lastBuildDate>Sun, 08 Nov 2009 03:42:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>No graphs in Ganglia</title>
		<link>http://pablogodel.com/2009/06/18/no-graphs-in-ganglia/</link>
		<comments>http://pablogodel.com/2009/06/18/no-graphs-in-ganglia/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 20:34:21 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://pablogodel.com/?p=34</guid>
		<description><![CDATA[Today I was installing Ganglia in a new server. After successfully compiling and installing gmond and gmetad I placed the web files in a directory accessible by Apache.
When I loaded the web page, all graphs were empty/broken.  Something was wrong. PHP had GD enabled, so it was not it. I checked the php log and [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was installing <a href="http://ganglia.info/">Ganglia</a> in a new server. After successfully compiling and installing gmond and gmetad I placed the web files in a directory accessible by Apache.</p>
<p>When I loaded the web page, all graphs were empty/broken.  Something was wrong. PHP had GD enabled, so it was not it. I checked the php log and no errors were found, but when I looked at the error_log I saw the following:</p>
<blockquote><p>No fonts found; this probably means that the fontconfig<br />
library is not correctly configured. You may need to<br />
edit the fonts.conf configuration file. More information<br />
about fontconfig can be found in the fontconfig(3) manual<br />
page and on http://fontconfig.org</p></blockquote>
<p>First of all, I had missed the requirement to have fontconfig. So I went ahead and installed it. After the installation was complete, the problem was still there. I checked and /usr/share/fonts was empty, but there is another directory, /usr/share/X11/fonts which had plenty of fonts. So I renamed the original fonts directory and created a symlink to the one that has plenty of fonts.</p>
<p>After this, ganglia&#8217;s graphs showed up as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://pablogodel.com/2009/06/18/no-graphs-in-ganglia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding fonts in Adobe Flex</title>
		<link>http://pablogodel.com/2009/05/12/embedding-fonts-in-adobe-flex/</link>
		<comments>http://pablogodel.com/2009/05/12/embedding-fonts-in-adobe-flex/#comments</comments>
		<pubDate>Tue, 12 May 2009 20:48:45 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://pablogodel.com/2009/05/12/embedding-fonts-in-adobe-flex/</guid>
		<description><![CDATA[I just solved a problem that I have been fighting for many hours and generated a lot of frustration. The solution was quite simple, but it proved difficult to identify the problem.
When you need to embed a font in Adobe Flex, you do so by adding something like this in the css:

@font-face {
   [...]]]></description>
			<content:encoded><![CDATA[<p>I just solved a problem that I have been fighting for many hours and generated a lot of frustration. The solution was quite simple, but it proved difficult to identify the problem.</p>
<p>When you need to embed a font in Adobe Flex, you do so by adding something like this in the css:</p>
<pre class="brush: css;">
@font-face {
        font-family: Gotham;
        src: url('assets/Gotham.otf');
}
.headerText
{
	font-family: Gotham;
	font-size: 18pt;
	color:#fbaf33;
}
</pre>
<p>The original problem was that some parts of the Flex application were using the font, but specific components did not. The problem got confusing when a co-worker was able to see the correct font in all components with the same code base.</p>
<p>After much research and trial and error, we found that the reason he was able to see the font in all components was that he had the font installed in his computer. So apparently, Flash and the browser displayed the correct font from the system when not being able to get it from the embed font.</p>
<p>So, after finding out that the font had to be installed locally to be displayed all across the Flex application, and after removing the font locally, the solution came quicker:</p>
<p>When embedding fonts in Flex, you need to embed each font style and weight separately. And this important: You cannot specify the weight in the css style names. You just specify which font family you want to use to use a different font weight.</p>
<p>This is how it would be done:</p>
<pre class="brush: css;">
@font-face {
        font-family: Gotham;
        src: url('assets/Gotham.otf');
}
@font-face {
        font-family: Gotham-Bold;
        src: url('assets/Gotham-Bold.otf');
}

.headerText
{
	font-family: Gotham;
	font-size: 18pt;
	color:#fbaf33;
}

.headerText2
{
	font-family: Gotham-Bold;
	font-size: 18pt;
	color:#fbaf33;
}
</pre>
<p>I am sure I will not make this mistake again!</p>
]]></content:encoded>
			<wfw:commentRss>http://pablogodel.com/2009/05/12/embedding-fonts-in-adobe-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate hostname with RegExpValidator in Flex</title>
		<link>http://pablogodel.com/2009/05/06/validate-hostname-with-regexpvalidator-in-flex/</link>
		<comments>http://pablogodel.com/2009/05/06/validate-hostname-with-regexpvalidator-in-flex/#comments</comments>
		<pubDate>Thu, 07 May 2009 02:02:12 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://pablogodel.com/?p=21</guid>
		<description><![CDATA[I spent quite some time trying to get this working. The documentation available for RegExpValidator is not very extensive just to put it in a nice way.
All I needed to do is validate a string to verify if it follows the pattern of a hostname.
After much work and research I finally narrowed it down and [...]]]></description>
			<content:encoded><![CDATA[<p>I spent quite some time trying to get this working. The documentation available for RegExpValidator is not very extensive just to put it in a nice way.</p>
<p>All I needed to do is validate a string to verify if it follows the pattern of a hostname.</p>
<p>After much work and research I finally narrowed it down and here it is:</p>
<pre class="brush: js;">
&lt;mx:RegExpValidator id=&quot;regExpV&quot;
source=&quot;{tbDomainName}&quot; property=&quot;text&quot;
flags=&quot;i&quot; expression=&quot;^[a-zA-Z0-9\-\.]+\.[A-Za-z]\{2,6\}$&quot;
/&gt;
</pre>
<p>Notice the backslashes for escaping { and }  as these characters are used in Flex for data binding.</p>
]]></content:encoded>
			<wfw:commentRss>http://pablogodel.com/2009/05/06/validate-hostname-with-regexpvalidator-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Duplicating a propel object</title>
		<link>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/</link>
		<comments>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 14:42:48 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://pablogodel.com/?p=9</guid>
		<description><![CDATA[Today I needed to quickly duplicate some rows in a table that is in a Symfony application. I am using the admin generator so I also have the schema as a Propel series of objects.
I did a quick search on Google and did not find any place on how to effectively duplicate a Propel object [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to quickly duplicate some rows in a table that is in a <a href="http://www.symfony-project.org/">Symfony</a> application. I am using the admin generator so I also have the schema as a <a href="http://propel.phpdb.org/trac/">Propel</a> series of objects.</p>
<p>I did a quick search on Google and did not find any place on how to effectively duplicate a Propel object which in turn would duplicate the row in a table.</p>
<p>Basically, what I need is another record with the same values except the primary key which is an autoincremented integer.</p>
<p>Here is the snipped of code that I added to the Propel object.</p>
<pre class="brush: php;">

 public function duplicate()
 {
 // duplicate object
 $ap = clone $this;

 $values = $ap-&gt;toArray( );

 $values2 = array();

 // create array of fields with null so we can force all values to be modified
 foreach( $values as $idx =&gt; $v )
 {
 $values2[ $idx ] = null;
 }

 // force all values to be changed so the doInsert inserts the values.
 $ap-&gt;fromArray( $values2 );
 $ap-&gt;fromArray( $values );

 $ap-&gt;setIsActive(false);
 $ap-&gt;setId(null);
 $ap-&gt;setNew(true);
 $ap-&gt;save();

 return $ap;
 }
</pre>
<p>Is there is another easier way, maybe provided by Propel, which I could not find, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://pablogodel.com/2009/04/20/duplicating-a-propel-object/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flex binding tip when adding components dynamically</title>
		<link>http://pablogodel.com/2009/04/16/flex-binding-tip-when-adding-components-dynamically/</link>
		<comments>http://pablogodel.com/2009/04/16/flex-binding-tip-when-adding-components-dynamically/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 15:44:30 +0000</pubDate>
		<dc:creator>Pablo</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://pablogodel.com/?p=3</guid>
		<description><![CDATA[Today I was developing this UI using Flex where a panel is added as a child dynamically. Inside the Panel there is a form with a series of input elements, and I use Binding to put back the changes of an Input component into the object that originally had the text.
A weird problem occured: The [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was developing this UI using Flex where a panel is added as a child dynamically. Inside the Panel there is a form with a series of input elements, and I use Binding to put back the changes of an Input component into the object that originally had the text.</p>
<p>A weird problem occured: The input text was empty even though the property in the object has some text. I tested by removing the Binding and was able to see the text in the Input.  Weird&#8230; I&#8217;ve done this so many times before and never had a problem.</p>
<p>Well, it turns out that if you set the object where the Input grabs the text from before adding the component to the tree of UIComponents for some reason the Binding messes up. So the solution was adding the Panel to the parent and then setting this object where Input grabs the text from.</p>
]]></content:encoded>
			<wfw:commentRss>http://pablogodel.com/2009/04/16/flex-binding-tip-when-adding-components-dynamically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
