<?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>Anna Filina &#187; Uncategorized</title>
	<atom:link href="http://annafilina.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://annafilina.com/blog</link>
	<description>I fix stuff</description>
	<lastBuildDate>Thu, 17 May 2012 19:58:42 +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>Deleting From Self-Referencing Tables</title>
		<link>http://annafilina.com/blog/doctrine-delet-from-self-referencing-tables/</link>
		<comments>http://annafilina.com/blog/doctrine-delet-from-self-referencing-tables/#comments</comments>
		<pubDate>Thu, 17 May 2012 19:58:41 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=755</guid>
		<description><![CDATA[Today, I ran into a common issue when deleting records from a table. I was using Doctrine 1.2 on top of MySQL. Deleting a certain number of records failed due to an integrity constraint.
Self-Referencing Tables
A self-referencing table is one that has a foreign key pointing to the same table. For example, a folder hierarchy might<div><a href="http://annafilina.com/blog/doctrine-delet-from-self-referencing-tables/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>Today, I ran into a common issue when deleting records from a table. I was using <strong>Doctrine 1.2</strong> on top of <strong>MySQL</strong>. Deleting a certain number of records failed due to an integrity constraint.</p>
<h3>Self-Referencing Tables</h3>
<p>A self-referencing table is one that has a foreign key pointing to the same table. For example, a folder hierarchy might have a parent_id column referring to its parent folder. Deleting a single row that has children should normally fail. But what if you wanted to delete a whole tree at once? Would you go recursively from the bottom up?</p>
<h3>Solution</h3>
<p>A simple way to achieve this is to use the following statement before: <strong>SET FOREIGN_KEY_CHECKS=0;</strong> This will prevent the MySQL database from complaining about the integrity constraint.</p>
<p>To achieve this using Doctrine, you can execute a raw query using the currently opened connection. Use the table name from which you expect to delete later, to make sure that the right connection is used.</p>
<pre class="brush:php">Doctrine::getTable("TableName")
  -&gt;getConnection()
  -&gt;getDbh()
  -&gt;query("SET FOREIGN_KEY_CHECKS=0;");
</pre>
<p>Now run your delete queries. Don&#8217;t forget to SET FOREIGN_KEY_CHECKS=1; at the end if you expect to execute more queries later on using the same connection.</p>
<p>Here&#8217;s an example of a delete query with Doctrine:</p>
<pre class="brush:php">Doctrine_Query::create()
  -&gt;delete()
  -&gt;from("Folder")
  -&gt;where("id &gt; 25")
  -&gt;execute();
</pre>
<h3>Best Practices</h3>
<p>You add database constraints for a reason and <strong>pointing to inexistant records compromises your data&#8217;s integrity</strong>. This approach assumes that you know in advance that removing the row set is alright. I only use this method in maintenance scripts, not in the normal application flow.</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/doctrine-delet-from-self-referencing-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Podcast About Sexism in Tech: What I Learned</title>
		<link>http://annafilina.com/blog/sexism-in-tech/</link>
		<comments>http://annafilina.com/blog/sexism-in-tech/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 13:30:59 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gender]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=741</guid>
		<description><![CDATA[I had the pleasure of discussing with fellow members of the PHP community a very sensitive topic: sexism in tech. I have been invited to a special episode of Voices of the ElePHPant with Elizabeth (Beth) Tucker Long, Elizabeth (Liz) Naramore and Laura Thomson. Cal Evans was the host. The podcast&#8217;s page features links for some<div><a href="http://annafilina.com/blog/sexism-in-tech/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>I had the pleasure of discussing with fellow members of the PHP community a very sensitive topic: sexism in tech. I have been invited to a special <a href="http://voicesoftheelephpant.com/2012/03/27/sexism-in-tech">episode of Voices of the ElePHPant</a> with Elizabeth (Beth) Tucker Long, Elizabeth (Liz) Naramore and Laura Thomson. Cal Evans was the host. The podcast&#8217;s page features links for some of the topics discussed.</p>
<p>The purpose of this post is not to transcribe the podcast, but to share with you what I learned from this conversation and what I personally took away from it.</p>
<h3>The Culture and the Issues</h3>
<p>Although many say that the culture does not make women flee or prevent them from joining, Laura argued that it may, at the very least, prevent women from contributing. While it would seem that the culture doesn&#8217;t want to change, Liz said that many men participate in criticism against sexist behavior, which shows that the community actually cares for an attitude change. She also supported empathy and respect as opposed to only increasing the number of women in tech, which is also a big part of the desired change.</p>
<p>I have a problem with the way some of the sexism issues are brought to attention. I believe Twitter to be a poor medium: no body language, no intonation and only 140 characters at a time. When someone is being impolite or curses, a dialog is hard to establish and important issues often get overlooked because of that. Beth agreed with me that swearing and getting confrontational is not helpful, but we do need to address the problems regardless.</p>
<h3>Brand Hygiene and Admitting Wrongs</h3>
<p>We agreed that the nature of the brand or the gender of the perpetrator do not matter. Having women dancing around in underwear, when associated with a brand, will project a certain image of that brand. It&#8217;s up to the brand to decide whether it is the image that it is looking for.</p>
<p>I came to understand that no matter in what manner issues are raised, they should be treated as basic customer service issues. A company should not take it personal. Implied economic threats (by bringing employers into a discussion) are unethical and need to be avoided at all costs.</p>
<p>Liz taught us that it&#8217;s ok to apologize, even if we didn&#8217;t mean to offend. &#8220;When you bump into someone on the street, whether or not you meant it, you say that you&#8217;re sorry.&#8221; I hope that nerds will find it easier to admit a wrong with this analogy in mind.</p>
<h3>Will the Industry Mature?</h3>
<p>Liz argued that if left to our own devices, no change will come. Beth stated that sexist behavior is not appropriate, no matter how young you are. &#8220;Young people have the same capacity to reason as older people.&#8221; Also, such behavior is not limited to young people and it&#8217;s unfair to blame it all on them. In the meantime, Laura said, we must be allowed to be creative and enjoy our industry. That means calling out people who step out of line.</p>
<h3>Conclusion</h3>
<p>We have come to an agreement that spending all our efforts criticizing bad behavior takes effort away from doing something about it. It&#8217;s alright to point out something inappropriate to help people recognize when they have done something wrong. According to Beth, the real way to solve this problem is to &#8220;mentor and encourage people who are feeling excluded or discouraged and help them out, be it women or other minority group that&#8217;s feeling left out&#8221;.</p>
<p>It&#8217;s good to have groups that help these minorities, as long as it doesn&#8217;t exclude others, because then they will be separated once more. One such group is PHP Women.</p>
<p>I will personally be presenting a PHP Workshop for Women with the support of Montreal Girl Geeks next month. I will post a link as soon as we have details about the venue. I&#8217;m still looking for training assistants as well. Tentative date is April 26th.</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/sexism-in-tech/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>More Women to Speak at Dev Conferences?</title>
		<link>http://annafilina.com/blog/more-women-to-speak-at-dev-conferences/</link>
		<comments>http://annafilina.com/blog/more-women-to-speak-at-dev-conferences/#comments</comments>
		<pubDate>Wed, 22 Feb 2012 23:52:11 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gender]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=730</guid>
		<description><![CDATA[Why do we have so few female speakers at IT conferences? I&#8217;m not talking about SEO / Social Media / UX conferences. I&#8217;m talking about hard-core programming conferences. I have been organizing conferences since 2006 and no matter how hard I tried, I ended up with nearly no proposals from women.
It starts with the lack<div><a href="http://annafilina.com/blog/more-women-to-speak-at-dev-conferences/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>Why do we have so few female speakers at IT conferences? I&#8217;m not talking about SEO / Social Media / UX conferences. I&#8217;m talking about hard-core programming conferences. I have been organizing conferences since 2006 and no matter how hard I tried, I ended up with nearly no proposals from women.</p>
<p>It starts with the lack of females in this field. Prejudice or discrimination don&#8217;t prevent women from choosing IT, but they can certainly make life hard. These problems exist in every field though&#8230;</p>
<p>The real issue, in my opinion, comes from how parents stimulate their kids. We buy Tonkas and Legos for our boys, Barbies and winged ponies for our girls. If the girl never developed her spatial-temporal reasoning because she didn&#8217;t have the right tools, then she will have a hard time with software analysis and design. She will probably not be attracted to it at all.</p>
<p><a rel="attachment wp-att-737" href="http://annafilina.com/blog/more-women-to-speak-at-dev-conferences/dreamstime_xs_8408503/"><img class="alignright size-full wp-image-737" title="Girl With Lego" src="http://annafilina.com/blog/wp-content/uploads/dreamstime_xs_8408503.jpg" alt="" width="480" height="319" /></a></p>
<p>Don&#8217;t most girls dream of being a doctor or a teacher? They were caring for dolls all their childhood. Don&#8217;t all boys dream of being a detective or an astronaut? They were building spaceships with their Lego. They were certainly not discriminated into choosing these fields at the age of 5.</p>
<p>I see a simple and lasting solution: stimulate both genders with the full range of toys early on (as soon as they are born). I had all kinds of toys in my youth, and so was not stuck in a limited range of possible careers. I chose programming when I was 11 and I still love it. That didn&#8217;t prevent me from having a keen interest in health, psychology and child education either.</p>
<p>Do you have other solutions?</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/more-women-to-speak-at-dev-conferences/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Profiling MySQL Queries &#8211; Part 1</title>
		<link>http://annafilina.com/blog/profiling-mysql-queries-1/</link>
		<comments>http://annafilina.com/blog/profiling-mysql-queries-1/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 14:52:02 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=723</guid>
		<description><![CDATA[You website is slow. You suspect MySQL queries are slow, but don&#8217;t know where to begin. This article, aimed at intermediate developers, will present my methodology and serve as a starting point for first-timers. I won&#8217;t go in-depth, only cover some of the basics.
Turn On the Slow Query Log
I once had a server with 7.1K<div><a href="http://annafilina.com/blog/profiling-mysql-queries-1/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>You website is slow. You suspect MySQL queries are slow, but don&#8217;t know where to begin. This article, aimed at intermediate developers, will present my methodology and serve as a starting point for first-timers. I won&#8217;t go in-depth, only cover some of the basics.</p>
<h3>Turn On the Slow Query Log</h3>
<p>I once had a server with 7.1K slow queries. Here&#8217;s how to see which queries are slow:</p>
<ol>
<li>Find the configuration file named my.cnf</li>
<li>Configure the location of the file where to log the queries, and set the minimum time, in seconds, that the query should run to be considered &#8220;slow&#8221;.<br />
log-slow-queries = /var/log/mysql/mysql-slow.log<br />
long_query_time = 1</li>
<li> Restart MySQL and start poking around your application (or run automated tests, if you have written any).</li>
</ol>
<div id="_mcePaste">As you use your application, the log file will start filling. I usually document the query variations I try and clock the query with each change to see which ones had the most impact. Using EXPLAIN EXTENDED can help you pinpoint where you are losing most of your performance in a query. I will cover this in detail in the next article.</div>
<div>Note: if you ever see queries like these SELECT /*!40001 SQL_NO_CACHE */ * FROM `table_name`, they are usually associated with a mysqldump command, and not with a query from within your application.</div>
<h3>Inspect Server Statistics</h3>
<p>I know of two ways to view server stats:</p>
<ol>
<li>by running the command SHOW STATUS; in MySQL command-line,</li>
<li>by clicking on the Status tab in phpMyAdmin</li>
</ol>
<p>Example: select_full_join must be 0. If not, the description recommends me to check my table indices. Try checking these stats on a production server, where the load is more realistic, and some of the red flags will only be raised when you have many concurrent users.</p>
<p>If you run into high numbers in the innodb_row_lock group, you can use the InnoDB monitor to check in real-time which tables are locked. Note that if too few users are using the application, this monitor may not show any rows. SHOW INNODB STATUS;</p>
<p>If you are not sure why certain values are too high or how you can improve them, search for the variable names online. I always document the values before and after I make optimization changes.</p>
<h3>Conclusion</h3>
<p>This should give you a starting point to begin profiling your queries. Not all the problems can be solved with proper queries; be ready to look into hardware, configuration and table structure/indices. Happy profiling!</p>
<p>In my next article, I will talk about the usage of EXPLAIN.</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/profiling-mysql-queries-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Performance Pitfalls</title>
		<link>http://annafilina.com/blog/jquery-perf-pitfalls/</link>
		<comments>http://annafilina.com/blog/jquery-perf-pitfalls/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 23:45:24 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=710</guid>
		<description><![CDATA[Introduction
At FooLab, we have been using jQuery because it&#8217;s easy to learn, there is a big community with a lot of examples and advice and also because it&#8217;s easier to find developers familiar with it. It&#8217;s not a bad framework, but it&#8217;s very easy to abuse when you do not know how it works and<div><a href="http://annafilina.com/blog/jquery-perf-pitfalls/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>At FooLab, we have been using jQuery because it&#8217;s easy to learn, there is a big community with a lot of examples and advice and also because it&#8217;s easier to find developers familiar with it. It&#8217;s not a bad framework, but it&#8217;s very easy to abuse when you do not know how it works and what it implies.</p>
<h3>Selectors</h3>
<p>Consider these two selectors: &#8220;.photo&#8221; and &#8220;#photo&#8221;. The first one will force jQuery to go through every single DOM element, searching for the class attribute, searching for the one containing the word &#8220;photo&#8221;, because you can have multiple class names separated with spaces. Now imagine that you do that for a dozen selectors, inside a function that can be executed multiple times per second. The second selector will simply go and get the element by id, directly. No traversing.</p>
<p>You can&#8217;t always use ids, but you can help jQuery narrow the scope. You can define a scope using a second parameter: $(&#8220;.photo&#8221;, container). In this example, container = $(&#8220;.container&#8221;) so jQuery has no business traversing elements outside of that container. If the container has an id, then you can just write $(&#8220;#container .photo&#8221;).</p>
<p>You can also prevent jQuery from traversing every element by specifying the node name $(&#8220;div.photo&#8221;). This way, jQuery will not have to check the class attribute if it&#8217;s not a div. Yes, it is more flexible to use the same class across various HTML tags, but you have to make a choice.</p>
<p>Sometimes you will win a mere 0.5%, and sometimes you will win 2,485% performance increase and be really happy that you read about selectors. These tips can also be applied to CSS selectors, to style your page faster.</p>
<h3>The getComputedStyle()</h3>
<p>When you change the size of an element in the middle of the page, the browser has to recalculate many (if not all) element sizes to render your page correctly. And we&#8217;re not just talking about height x width. Borders, padding, margins, line-height all have to be taken into account. We don&#8217;t think much of it when the page first loads, because we attribute it to the network latency, but rendering a page is actually a lot of work. If you ever move elements around dynamically and notice a delay, that&#8217;s how much time it takes&#8230; with all your CPU cores.</p>
<p>Say you are using the<a href="http://jqueryui.com/demos/button/"> jQuery UI Button</a> to skin your elements. The page is loaded with default button elements. All is calculated and positioned. Then for every single .button() you call, the size of that element changes, and the entire page is redrawn. So for an initialization function calling 20 .button(), you get 20 page redraws. You may even get that problem when you enable and disable the buttons dynamically. If you&#8217;re only using .button() for skinning, it&#8217;s better to let go and use CSS instead.</p>
<h3>The hide()</h3>
<p>This one is related to the above measuring issue. When you .hide() an element, jQuery sets the display:none style, the space occupied by the element becomes empty and the page has to be redrawn. Whenever you can, set visibility:hidden instead. I once got a 2,740% performance increase on a commonly used function, with just that little thing.</p>
<p>Read my <a href="http://annafilina.com/blog/profiling-js-apps/">previous article</a> to learn how to find the areas of your application that are eating the most CPU.</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/jquery-perf-pitfalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Profiling JS Applications</title>
		<link>http://annafilina.com/blog/profiling-js-apps/</link>
		<comments>http://annafilina.com/blog/profiling-js-apps/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 23:44:45 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=704</guid>
		<description><![CDATA[Introduction
Some of the web apps that we build at FooLab rely heavily on Javascript. But when your CPU usage is through the roof, where do you start looking?
Methodology
Many developers start straight with a hypothesis and then try various corrections until something happens. This is a waste of time; no amount of experience changes that. Here&#8217;s<div><a href="http://annafilina.com/blog/profiling-js-apps/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Some of the web apps that we build at FooLab rely heavily on Javascript. But when your CPU usage is through the roof, where do you start looking?</p>
<h3>Methodology</h3>
<p>Many developers start straight with a hypothesis and then try various corrections until something happens. This is a waste of time; no amount of experience changes that. Here&#8217;s I do it:</p>
<h4>1. Ask a question</h4>
<p>&#8220;Why is my machine using so much CPU?&#8221;</p>
<h4>2. Observe</h4>
<p>I use Chrome Developer Tools to poke around at first. Under the profiles tab, I start recording, perform the actions that seem to be causing the problem a few times and press stop. I remember seeing similar tools in Firefox and Safari.</p>
<p>There are many ways to analyze the data, but I found that sorting by Total to be most helpful. The Total is the time spent in the function and all functions called from within it, giving you the scope to look in.</p>
<h4>3. Propose an explanation</h4>
<p>Concentrate on functions that you wrote yourself, and then see in your code what they do. Try to think of any processes can be slow, unneeded or executed more times than needed.</p>
<h4>4. Benchmark</h4>
<p>I use benchmark.js which I include this file in my page. Then I add the necessary code to run the functions spotted in step 2. I like to run this code right after my home-brewed MVC has done initializing:</p>
<pre class="brush:js">var suite = new Benchmark.Suite;
suite.add('addEventListeners', function() {
  addEventListeners();
}).add('render', function() {
  render();
}).on('cycle', function(ev, bench) {
  console.log(String(bench));
}).run({
  'async': false,
  'minSamples': 50
});</pre>
<p>This will output a line for every .add you have, telling you the number of operations per second and margin of error. Rerun it if the margin is too wide. Make sure that you benchmark as many functions as you can before you start patching it. Write them in a table so that you can later compare with the improved code.</p>
<h4>5. Fix the code</h4>
<p>Now go ahead and start making adjustments. It&#8217;s good to make one type of optimization at once and run the benchmark again, writing all the numbers in a table side by side. Example: optimize jQuery selectors first. This way you can see which functions have been improved how, leading you to avoid certain mistakes in the future and having something to demonstrate and teach to your teammates.</p>
<p><a href="http://annafilina.com/blog/jquery-perf-pitfalls/">Read my next article</a> about some of the common places where jQuery murders your CPU.</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/profiling-js-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Symfony Form: Extract Values</title>
		<link>http://annafilina.com/blog/symfony-form-extract-values/</link>
		<comments>http://annafilina.com/blog/symfony-form-extract-values/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 13:20:46 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=697</guid>
		<description><![CDATA[I had to look deep into Symfony 1.4 code this morning as I was trying to get a field&#8217;s value. Form values come from different sources: default values, record values (when editing, for example), original POST values and clean POST values. So when is each available and how do we get it?
Get the values by<div><a href="http://annafilina.com/blog/symfony-form-extract-values/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>I had to look deep into Symfony 1.4 code this morning as I was trying to get a field&#8217;s value. Form values come from different sources: default values, record values (when editing, for example), original POST values and clean POST values. So when is each available and how do we get it?</p>
<h3>Get the values by type</h3>
<p>Default values are what you will be presented with when you display an empty form.</p>
<blockquote><p>Get all values using $form-&gt;getDefaults() or a single value using $form-&gt;getDefault($name).</p></blockquote>
<p>Record values, which are merged with the default values, are displayed when a Doctrine record is associated with the form.</p>
<blockquote><p>Get all values using $form-&gt;getDefaults() or a single value using $form-&gt;getDefault($name).</p></blockquote>
<p>Original POST values are displayed when the form validation failed.</p>
<blockquote><p>Get all values using $form-&gt;getTaintedValues().</p></blockquote>
<p>Clean POST values are the ones that have been validated and transformed by the form validators. At that point, you will most likely choose to save the form and redirect.</p>
<blockquote><p>Get all values using $form-&gt;getValues() or a single value using $form-&gt;getValue($name).</p></blockquote>
<h3>Get all values regardless of origin</h3>
<p>In one scenario, I needed to access the form&#8217;s values to inject them into Javascript. There is a method to extract a value as it will appear in the HTML, without worrying about whether it&#8217;s default, record, dirty  POST or clean POST.</p>
<blockquote><p>Get the value directly from the field using $form-&gt;offsetGet($name)-&gt;getValue(). Alternatively, you can use $form[$name]-&gt;getValue() which will yield the same result.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/symfony-form-extract-values/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Their Programming Language Sucks!</title>
		<link>http://annafilina.com/blog/their-prog-language-sucks/</link>
		<comments>http://annafilina.com/blog/their-prog-language-sucks/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 13:16:14 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=690</guid>
		<description><![CDATA[Or at least this is what I hear often all around me. Many want to think that their language is better than all others, and go to great lengths to discredit them. Just like at sport events, people would paint their faces in their team&#8217;s colors and yell insults at the opponents.
I&#8217;m here to tell you that<div><a href="http://annafilina.com/blog/their-prog-language-sucks/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>Or at least this is what I hear often all around me. Many want to think that their language is better than all others, and go to great lengths to discredit them. Just like at sport events, people would paint their faces in their team&#8217;s colors and yell insults at the opponents.</p>
<p>I&#8217;m here to tell you that all languages are great and suck in their own way. There is no need to switch to a language just because someone told you that it was better; that&#8217;s often irrelevant, although counter-intuitive. You will always be more productive with the language that you have worked with for the past 10 or more years. While you spend another 10 years becoming an expert in a new language, you&#8217;re providing lower value for your customers. And what if by the time you are finally done switching, a shiny new awesome language comes out? You&#8217;ll be chasing your tail all your life. It&#8217;s like trying to keep up with teenage fashion.</p>
<p>If you&#8217;re fresh out of college, the same rules don&#8217;t apply. You&#8217;re not an expert in anything yet, even if your youth arrogance screams otherwise. You haven&#8217;t dealt with clients that will have your head on a spike if you don&#8217;t meet the deadline. You didn&#8217;t have junior freelancers do half the work, encrypt their code and disappear. You didn&#8217;t have to take over large teams that wasted millions of dollars and haven&#8217;t even finished arguing about the framework. Those are the real problems.</p>
<p>When you didn&#8217;t swear any allegiances yet, you are free to choose your language. So choose one that has potential in your eyes, one that has strong community support (even if it&#8217;s not an open source language), one that has good job prospects, one that has training and conferences available&#8230; this is what&#8217;s going to affect your life most, and not some pretty syntax.</p>
<p>In conclusion, I&#8217;d like to say that it&#8217;s not helpful to attack a programming language based on function names, frequency of releases, syntax, market share and other meaningless aspects. The real questions that you should be asking are whether your sh*t can be written in that language and whether you can get a well-paid job or contract. Finally, a diversity of languages and philosophies should be encouraged, so that we can learn from them and bring the concepts back to our own little world and flourish.</p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/their-prog-language-sucks/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>On Food Additives and Cancer</title>
		<link>http://annafilina.com/blog/on-food-additives-and-cancer/</link>
		<comments>http://annafilina.com/blog/on-food-additives-and-cancer/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 15:47:48 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[health]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=676</guid>
		<description><![CDATA[Do you enjoy soft drinks? Do you drink the diet version for less sugar? Many of these drinks contain cancerogenic additives, especially the sugar-free versions. Read until the end for a not-so-drastic solution.]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">Disclaimer: Brand names are used for comparison only. It is not my intention to attack a product&#8217;s or a company&#8217;s reputation. Equivalent products may contain the same ingredients.</span></p>
<p>Do you enjoy soft drinks? Do you drink the diet version for less sugar? Many of these drinks contain cancerogenic additives, especially the sugar-free versions. Read until the end for a not-so-drastic solution.</p>
<h3>The numbers</h3>
<pre>Product   | Volume | Calories | Sugar | Cancerogenic Ingredients
---------------------------------------------------------------------------------------
Coke      | 237ml  | 100      | 27g   | Caramel coloring
Diet Coke | 237ml  | 0        | 0     | Caramel coloring, aspartame, potassium benzoate
Guru      | 250ml  | 100      | 25g   | None</pre>
<h3>The explanation</h3>
<p><strong>Coke</strong> contains caramel coloring. That subtance contains compounds proven to cause cancer in mammals<sup>1</sup>.</p>
<p>Turn to <strong>Diet Coke</strong> to save a few calories, and it gets scarier: three ingredients cause cancer. Aspartame causes cancer over a long-term consumption and is especially dangerous for children<sup>2</sup>. Potassium benzoate, much like sodium benzoate, reacts with vitamin C to create small amounts of benzene: a chemical that causes leukemia and other cancers<sup>3</sup>.</p>
<p><strong>Guru</strong>, on the other hand, contains less sugar, even for a higher volume. Sugar comes from sugarcane which is more expensive to produce. It contains guarana, a common ingredient in soft drinks in South America. It&#8217;s high in caffeine but is not dangerous when consumed moderately.</p>
<h3>Nobody lives forever, say you?</h3>
<p>Even infants have been diagnosed with cancer and one may suffer all his life instead of dying. I had a friend in his early thirties who had colorectal cancer. This means that he had to wear adult diapers so we wouldn&#8217;t defecate in his underwear. It was painful and embarrassing for him. He did not catch it early, so he will bear it all his life.</p>
<h3>The lesson</h3>
<p>Our bodies are so complex and different that there are no absolutely safe substances out there. Even water can be fatal if consumed abusively<sup>4</sup>. Consuming generally safe products in moderation is a good bet.</p>
<p>Many companies, striving to make increasingly cheaper and appealing products, often use cheap artificial alternatives to common ingredients. It&#8217;s mostly the consumer&#8217;s fault. We ask for cheap products, good food texture, long conservation, availability all year round and other follies. There is no point in blaming companies for satisfying our impractical requests.</p>
<p>I am ready to pay double or even triple for my grocery if that means living cancer-free until the ripe age of 120. Are you ready to sacrifice some extravagant requests to live healthier? Will you demand a more expensive but safer product variations from your favorite companies?</p>
<hr />
<h3>References</h3>
<p>1. The “caramel coloring” used to color all the top cola brands isn’t natural caramel coloring at all. Instead, it’s made by reacting sugars with ammonia and sulfites at high temperatures. This reaction results in the formation of 2-methylimidazole and 4-methylimidazole, both of which are chemicals documented by the U.S. government to cause cancer in mammals.</p>
<p><a href="http://www.naturalnews.com/031383_caramel_coloring_cola.html">http://www.naturalnews.com/031383_caramel_coloring_cola.html</a></p>
<p>2. [The study] indicated that rats first exposed to aspartame at eight weeks of age caused lymphomas and leukemias in females.</p>
<p><a href="http://www.cspinet.org/reports/chemcuisine.htm#aspartame">http://www.cspinet.org/reports/chemcuisine.htm#aspartame</a></p>
<p>3. Another problem occurs when sodium benzoate is used in beverages that also contain ascorbic acid (vitamin C). The two substances, in an acidic solution, can react together to form small amounts of benzene, a chemical that causes leukemia and other cancers.</p>
<p><a href="http://www.cspinet.org/reports/chemcuisine.htm#sodiumb">http://www.cspinet.org/reports/chemcuisine.htm#sodiumb</a></p>
<p>4. Water can be considered a poison when over-consumed just like any other substance.</p>
<p><a href="http://en.wikipedia.org/wiki/Water_intoxication">http://en.wikipedia.org/wiki/Water_intoxication</a></p>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/on-food-additives-and-cancer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updating RubyGem on OSX</title>
		<link>http://annafilina.com/blog/updating-rubygem-on-osx/</link>
		<comments>http://annafilina.com/blog/updating-rubygem-on-osx/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 18:30:12 +0000</pubDate>
		<dc:creator>Anna</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://annafilina.com/blog/?p=672</guid>
		<description><![CDATA[No gem would install on my machine because my RubyGem was outdated and rubyforge.org kept returning 302 (redirect) status code. After trying every recipe to update RubyGem on Mac OSX that I had the patience for, I came up with my own solution.
Failed attempts
sudo ruby ~/Downloads/rubygems-1.8.6/setup.rb
sudo gem update --system
sudo gem install rubygems-update --source http://production.s3.rubygems.org/
update_rubygems
Successful attempt
sudo gem<div><a href="http://annafilina.com/blog/updating-rubygem-on-osx/">Read the rest...</a></div><br />]]></description>
			<content:encoded><![CDATA[<p>No gem would install on my machine because my RubyGem was outdated and rubyforge.org kept returning 302 (redirect) status code. After trying every recipe to update RubyGem on Mac OSX that I had the patience for, I came up with my own solution.</p>
<h3>Failed attempts</h3>
<pre class="brush:shell">sudo ruby ~/Downloads/rubygems-1.8.6/setup.rb
sudo gem update --system
sudo gem install rubygems-update --source http://production.s3.rubygems.org/
update_rubygems</pre>
<h3>Successful attempt</h3>
<pre class="brush:shell">sudo gem update --system --source http://production.s3.rubygems.org/yaml</pre>
]]></content:encoded>
			<wfw:commentRss>http://annafilina.com/blog/updating-rubygem-on-osx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

