<?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>Rafael Kassner</title>
	<atom:link href="http://kassner.com.br/feed/" rel="self" type="application/rss+xml" />
	<link>http://kassner.com.br</link>
	<description>Programming pleasure is priceless</description>
	<lastBuildDate>Thu, 15 Mar 2012 11:38:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Apache Rewrite on VirtualHost = 400 Bad Request Error</title>
		<link>http://kassner.com.br/2012/03/apache-rewrite-no-virtualhost-erro-400-bad-request/</link>
		<comments>http://kassner.com.br/2012/03/apache-rewrite-no-virtualhost-erro-400-bad-request/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 11:46:39 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://kassner.com.br/?p=93</guid>
		<description><![CDATA[Mental note: If you are moving the Rewrite from .htaccess to VirtualHost configuration and get a 400 Bad Request error, one or both tips below can be useful: RewriteEngine On # Use the %{DOCUMENT_ROOT} RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -s [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -l [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] # Use the absolute path RewriteRule [...]]]></description>
			<content:encoded><![CDATA[<p>Mental note:</p>
<p>If you are moving the Rewrite from .htaccess to VirtualHost configuration and get a 400 Bad Request error, one or both tips below can be useful:</p>
<pre class="brush:plain">RewriteEngine On
# Use the %{DOCUMENT_ROOT}
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -s [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -l [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# Use the absolute path
RewriteRule ^.*$ /home/www/html/index.php [NC,L]</pre>
<p>That&#8217;s all.</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2012/03/apache-rewrite-no-virtualhost-erro-400-bad-request/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converting movies with tovid</title>
		<link>http://kassner.com.br/2012/02/convertendo-videos-com-tovid/</link>
		<comments>http://kassner.com.br/2012/02/convertendo-videos-com-tovid/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 21:36:49 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://kassner.com.br/?p=71</guid>
		<description><![CDATA[Hello A little tip to convert AVI files to DVD with embed subtitles. Installing tovid: sudo apt-get install tovid Converting AVI file to a DVD-ISO file. tovid -dvd -in Video.avi -subtitles Legenda.srt -out Video /usr/share/tovid/makexml Video.mpg -out Video export VIDEO_FORMAT=NTSC /usr/share/tovid/makedvd Video.xml mkisofs -dvd-video -udf -R -o Video.iso Video/ So, you just need to burn [...]]]></description>
			<content:encoded><![CDATA[<p>Hello</p>
<p>A little tip to convert AVI files to DVD with embed subtitles.</p>
<p>Installing tovid:</p>
<pre class="brush:shell">sudo apt-get install tovid</pre>
<p>Converting AVI file to a DVD-ISO file.</p>
<pre class="brush:shell">tovid -dvd -in Video.avi -subtitles Legenda.srt -out Video
/usr/share/tovid/makexml Video.mpg -out Video
export VIDEO_FORMAT=NTSC
/usr/share/tovid/makedvd Video.xml
mkisofs -dvd-video -udf -R -o Video.iso Video/</pre>
<p>So, you just need to burn your ISO file. You can use <a title="Brasero" href="http://projects.gnome.org/brasero/" target="_blank">Brasero</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2012/02/convertendo-videos-com-tovid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Developer VM</title>
		<link>http://kassner.com.br/2011/12/oracle-developer-vm/</link>
		<comments>http://kassner.com.br/2011/12/oracle-developer-vm/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 14:00:53 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[Português (Brasil)]]></category>

		<guid isPermaLink="false">http://kassner.com.br/?p=73</guid>
		<description><![CDATA[Olá Pessoal Na PHP Conference Brasil deste ano, Todd Trichler da divisão de Developer Marketing da Oracle disponibilizou para quem passou no estande uma Developer Virtual Machine em DVD, para o Virtual Box, contendo além de um Linux como sistema operacional, o Oracle Database 11g Release 2 e as ferramentas de desenvolvimento. Apesar da VM [...]]]></description>
			<content:encoded><![CDATA[<p>Olá Pessoal</p>
<p>Na PHP Conference Brasil deste ano, Todd Trichler da divisão de Developer Marketing da Oracle disponibilizou para quem passou no estande uma Developer Virtual Machine em DVD, para o Virtual Box, contendo além de um Linux como sistema operacional, o Oracle Database 11g Release 2 e as ferramentas de desenvolvimento.  Apesar da VM estar prontinha, é necessário alterar as configurações de rede da máquina virtual para que a mesma funcione corretamente. Prometi ao Todd que postaria no blog isso em português, então aí vai o passo-a-passo.</p>
<p>Quem não possui o DVD, pode fazer o download da VM através do endereço http://www.oracle.com/technetwork/community/developer-vm/index.html</p>
<p>1) Sobre o nome da máquina virtual, clique com o botão direito e vá em Configurações;</p>
<p><a href="http://kassner.com.br/wp-content/uploads/2011/12/vbox-1.png"><img class="alignnone size-full wp-image-74" title="Virtualbox - Configurações da VM" src="http://kassner.com.br/wp-content/uploads/2011/12/vbox-1.png" alt="" width="476" height="392" /></a></p>
<p>2) Na aba Rede, selecione a interface de rede ativa e mude o tipo de rede para NAT;</p>
<p><a href="http://kassner.com.br/wp-content/uploads/2011/12/vbox-2.png"><img class="alignnone size-medium wp-image-75" title="Virtualbox - Configurações de rede" src="http://kassner.com.br/wp-content/uploads/2011/12/vbox-2.png" alt="" width="456" height="379" /></a></p>
<p>3) Salve a configuração e inicie a VM.</p>
<p>Qualquer dúvida, entre em contato ou comente abaixo.</p>
<p>Até mais,<br />
Rafael Kassner.</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2011/12/oracle-developer-vm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Slow</title>
		<link>http://kassner.com.br/2011/01/magento-slow/</link>
		<comments>http://kassner.com.br/2011/01/magento-slow/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 15:58:12 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://kassner.com.br/?p=55</guid>
		<description><![CDATA[Hello. After an intense debug into Magento, we (Filipe Ibaldo and me) have found two problems in Magento code, related to slow Place Order with many products in cart (not many qty of a product). One of the problems is the order item save, which is executed precisely in app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php, on afterSave method, who spent [...]]]></description>
			<content:encoded><![CDATA[<p>Hello.</p>
<p>After an intense debug into Magento, we (<a title="Filipe Ibaldo" href="http://ibaldo.com.br/" target="_blank">Filipe Ibaldo</a> and me) have found two problems in Magento code, related to slow Place Order with many products in cart (not many qty of a product).<span id="more-55"></span></p>
<p>One of the problems is the order item save, which is executed precisely in app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php, on afterSave method, who spent many time on my machine (Core 2 Duo 2.26/4GB RAM), about 0.3 second for each product.</p>
<p>Considering the number of items average of customer&#8217;s cart is about 50 distinct products, this time, adding to another code executions and a high server load, is easily more than one minute, and this is unacceptable.</p>
<p>The found workaround is disable some observers from Mage_Downloadable and Mage_Rss, who execute in afterSave of each item in order.</p>
<p>In app/code/core/Mage/Downloadable/etc/config.xml, remove/comment the following lines:</p>
<pre class="brush:xml">            &lt;sales_order_item_save_after&gt;
                &lt;observers&gt;
                    &lt;downloadable_observer&gt;
                        &lt;class&gt;downloadable/observer&lt;/class&gt;
                        &lt;method&gt;saveDownloadableOrderItem&lt;/method&gt;
                    &lt;/downloadable_observer&gt;
                &lt;/observers&gt;
            &lt;/sales_order_item_save_after&gt;</pre>
<p>The code above appears twice.</p>
<p>In app/code/core/Mage/Rss/etc/config.xml, remove/comment the following lines:</p>
<pre class="brush:xml">            &lt;sales_order_item_save_after&gt;
                &lt;observers&gt;
                    &lt;notifystock&gt;
                        &lt;class&gt;rss/observer&lt;/class&gt;
                        &lt;method&gt;salesOrderItemSaveAfterNotifyStock&lt;/method&gt;
                    &lt;/notifystock&gt;
                &lt;/observers&gt;
            &lt;/sales_order_item_save_after&gt;
            &lt;sales_order_item_save_after&gt;
                &lt;observers&gt;
                    &lt;ordernew&gt;
                        &lt;class&gt;rss/observer&lt;/class&gt;
                        &lt;method&gt;salesOrderItemSaveAfterOrderNew&lt;/method&gt;
                    &lt;/ordernew&gt;
                &lt;/observers&gt;
            &lt;/sales_order_item_save_after&gt;</pre>
<p>With this workaround, the save time of each product went from 0.3 second to 0.001 second, an incredible speed improvement.</p>
<p>However, if you are using downloadable products or Magento Inventory Management, this modifications can broke related features, so, be careful.</p>
<p>Another problem found is related with module disable feature into System &gt; Configuration &gt; Advanced &gt; Advanced &gt; Disable Module Output. If you disable some module, their observers did not disabled, and you need to remove their configuration or delete module folder.</p>
<p>Bye.</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2011/01/magento-slow/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Include error on Zend_Loader</title>
		<link>http://kassner.com.br/2010/11/erro-de-include-no-zend_loader/</link>
		<comments>http://kassner.com.br/2010/11/erro-de-include-no-zend_loader/#comments</comments>
		<pubDate>Mon, 01 Nov 2010 12:41:31 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://kassner.com.br/?p=22</guid>
		<description><![CDATA[Hello. Today I found a problem in Zend Framework and his class autoloader, where an class_exists function call fires the Zend Framework autoloader. The function has an option to ignore the autoloader, but any class that I need loaded by Zend_Loader will return false. Then, if I call class_exists without disable autoloader, I got an file [...]]]></description>
			<content:encoded><![CDATA[<p>Hello.</p>
<p>Today I found a problem in Zend Framework and his class autoloader, where an <a title="PHP: class_exists - Manual" href="http://br.php.net/class_exists" target="_blank">class_exists</a> function call fires the Zend Framework autoloader. The function has an option to ignore the autoloader, but any class that I need loaded by Zend_Loader will return false.<span id="more-22"></span></p>
<p>Then, if I call class_exists without disable autoloader, I got an file not exists PHP warning, that&#8217;s why Zend_Loader doesn&#8217;t check if the file exists, just include.</p>
<p>The trick is change Zend/Loader.php to check if file exists before include, and this must be wrote in loadFile method.</p>
<pre class="brush:php">    public static function loadFile($filename, $dirs = null, $once = false)
    {
        self::_securityCheck($filename);

        /**
         * Search in provided directories, as well as include_path
         */
        $incPath = false;
        if (!empty($dirs) &amp;&amp; (is_array($dirs) || is_string($dirs))) {
            if (is_array($dirs)) {
                $dirs = implode(PATH_SEPARATOR, $dirs);
            }
            $incPath = get_include_path();
            set_include_path($dirs . PATH_SEPARATOR . $incPath);
        }

        /**
         * Try finding for the plain filename in the include_path.
         */
        if (!self::fileExists($filename)) {
            return false;
        }

        if ($once) {
            include_once $filename;
        } else {
            include $filename;
        }

        /**
         * If searching in directories, reset include_path
         */
        if ($incPath) {
            set_include_path($incPath);
        }

        return true;
    }

    public static function fileExists ($filename) {
        $paths = explode(PATH_SEPARATOR, get_include_path());
        foreach ($paths as $path) {
            if (file_exists($path . DIRECTORY_SEPARATOR . $filename)) {
                return true;
            }
        }
        return false;
    }</pre>
<p>Bye.</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2010/11/erro-de-include-no-zend_loader/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AI5 Digital Não</title>
		<link>http://kassner.com.br/2010/08/ai5-digital-nao/</link>
		<comments>http://kassner.com.br/2010/08/ai5-digital-nao/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 19:26:33 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[Português (Brasil)]]></category>

		<guid isPermaLink="false">http://www.kassner.com.br/?p=18</guid>
		<description><![CDATA[Estão armando, alguns grandes conglomerados financeiros, organizações de empresários, empresas de telecom entre outros, uma grande sacanagem contra todos nós: Querem, de alguma forma, instituir uma espécie de censura da internet Brasileira. Em nome da falsa garantia de proteger nossa privacidade dos bandidos, eles querem instituir um Big Brother de fato. Não devemos permitir tal [...]]]></description>
			<content:encoded><![CDATA[<p>Estão armando, alguns grandes conglomerados financeiros, organizações de empresários, empresas de telecom entre outros, uma grande sacanagem contra todos nós: Querem, de alguma forma, instituir uma espécie de censura da internet Brasileira. Em nome da falsa garantia de proteger nossa privacidade dos bandidos, eles querem instituir um Big Brother de fato.</p>
<p>Não devemos permitir tal ato.</p>
<p><a href="http://meganao.wordpress.com/2010/08/27/blogagem-coletiva-de-repudio-ao-ai5-digital/">http://meganao.wordpress.com/2010/08/27/blogagem-coletiva-de-repudio-ao-ai5-digital/</a></p>
<p>PS: sim, <a href="http://www.zaip.net/ai5-digital-nao">kibei do Zaip</a> esse texto, to sem tempo pra escrever, mas desde que o projeto foi lançado sou contra o mesmo&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2010/08/ai5-digital-nao/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizando múltiplas versões do PHP + Apache</title>
		<link>http://kassner.com.br/2010/07/utilizando-multiplas-versoes-do-php-apache/</link>
		<comments>http://kassner.com.br/2010/07/utilizando-multiplas-versoes-do-php-apache/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 18:21:48 +0000</pubDate>
		<dc:creator>Rafael Kassner</dc:creator>
				<category><![CDATA[Português (Brasil)]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.kassner.com.br/?p=11</guid>
		<description><![CDATA[Olá. Esta é uma dica para utilizar em ambiente de desenvolvimento e/ou testes, onde é necessário utilizar mais de uma versão do PHP, sem que seja necessário setar uma para todo seu ambiente. Neste caso, a versão será definida via .htaccess, porém, somente é possível utilizar esta técnica se você puder compilar o PHP. É [...]]]></description>
			<content:encoded><![CDATA[<p>Olá.</p>
<p>Esta é uma dica para utilizar em ambiente de desenvolvimento e/ou testes, onde é necessário utilizar mais de uma versão do PHP, sem que seja necessário setar uma para todo seu ambiente. Neste caso, a versão será definida via .htaccess, porém, somente é possível utilizar esta técnica se você puder compilar o PHP.<span id="more-11"></span></p>
<p>É realmente importante pra quem precisa dar suporte a ambientes e/ou sistemas legadosm ou testar a retrocompatiblidade de um código PHP. Parto do princípio que você já saiba compilar o PHP para seu ambiente, se não souber, procure no Google antes.</p>
<p><strong>Resumo:</strong></p>
<p>No source do PHP, substitua todas as entradas abaixo:</p>
<p>php5_module -&gt; php5_x_x_module<br />
libphp5 -&gt; libphp5.x.x<br />
application/x-httpd-php -&gt; application/x-httpd-php-5-x-x</p>
<p>E compile normalmente. No PHP 5.3.x pode ocorrer um erro informando que o libs/libphp5.3.x.so não foi encontrado, basta entrar na pasta libs e mover/copiar o libphp.so para libphp5.3.x.so.</p>
<p><strong>Passo-a-passo:</strong></p>
<p>Onde eu estiver especificando 5.x.x ou 5_x_x, isso significa a versão do PHP que você está compilando.</p>
<p>1. Baixe o source do PHP e descompacte para um diretório de sua preferência.</p>
<p>2. Com o auxílio de um editor de texto (TextMate, Notepad++, DreamWeaver, etc), procure em todo o diretório do source (que você descompactou anteriormente), e substitua:</p>
<table>
<tbody>
<tr>
<th>Procure por:</th>
<th>Substitua por:</th>
</tr>
<tr>
<td>php5_module</td>
<td>php5_x_x_module</td>
</tr>
<tr>
<td>libphp5</td>
<td>libphp5.x.x</td>
</tr>
<tr>
<td>application/x-httpd-php</td>
<td>application/x-httpd-php5-x-x</td>
</tr>
</tbody>
</table>
<p>Se você está se perguntando o que isso faz: essas substituições fazem com que cada versão diferente do PHP que você vá compilar seja definida como um novo módulo no Apache, ao invés de sempre ser php5_module.</p>
<p>A alteração do MimeType (terceira substituição) serve para que você consiga chavear entre as versões via .htaccess, pois não podemos colocar um LoadModule no .htaccess.</p>
<p>3. Compile sua versão do PHP normalmente, cada versão em um diretório separado.</p>
<p>3.1. Se você estiver compilando uma versão 5.3 do PHP, você pode receber um erro ao executar o comando make install, informando que o arquivo libs/libphp5.x.x.so não existe. Neste caso, basta copiar o arquivo libs/libphp5.so e tentar novamente.</p>
<p>3.2. Em alguns casos, o comando make install ativa o php5_module automaticamente no httpd.conf. Neste caso, revise o arquivo, pois em todas as minhas tentativas, por algum motivo obscuro, ele adicionava o módulo como o nome de php5_module, e não php5_x_x_module. Se isso acontecer, apenas renomeie o módulo.</p>
<p>3.3. Ainda é possível utilizar extensões dinamicamente no PHP, porém, você pode obter erros por estar usando uma extensão compilada para outra versão da qual você esteja rodando. Sugiro <a title="Compiling PECL extensions statically into PHP" href="http://www.phpbuilder.com/manual/en/install.pecl.static.php" target="_blank">compilar as extensões estaticamente</a>.</p>
<p>3.4. Sugiro cuidado ao definir a propriedade &#8211;with-config-file-path, para que o php.ini seja o diferente em várias versões do PHP. Você pode obter erros por definir alguma propriedade errada ou inexistente para uma versão específica do PHP.</p>
<p>4. Reinicie o Apache para as alterações terem efeito.</p>
<p>5. Para utilizar uma determinada versão (que você já compilou com este método) em um projeto no seu ambiente, basta adicionar a seguinte propriedade ao .htaccess do projeto:</p>
<blockquote><p>AddType application/x-httpd-php5-x-x .php</p></blockquote>
<p>Onde 5-x-x é a versão do PHP que você deseja.</p>
<p>Dúvidas? Deixe um comentário.</p>
]]></content:encoded>
			<wfw:commentRss>http://kassner.com.br/2010/07/utilizando-multiplas-versoes-do-php-apache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

