<?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>coding &#187; unifei</title>
	<atom:link href="http://www.coding.com.br/category/unifei/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coding.com.br</link>
	<description>have you coded today?</description>
	<lastBuildDate>Fri, 23 Jul 2010 02:37:02 +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>Básico de passagem de parâmetros em C++</title>
		<link>http://www.coding.com.br/unifei/basico-de-passagem-de-parametros-em-c/</link>
		<comments>http://www.coding.com.br/unifei/basico-de-passagem-de-parametros-em-c/#comments</comments>
		<pubDate>Mon, 31 May 2010 04:15:15 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[unifei]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=1021</guid>
		<description><![CDATA[para não acontecer certos erros que vi por aí&#8230;
Em C++ há três maneiras de passar um parâmetro para uma função, as tradicionais herdadas da linguagem C: valor e ponteiro; além da novidade: a passagem por referência. Para ilustrar veja o seguinte exemplo, passar uma estrutura de dados &#8220;grande&#8221; (neste caso aproximadamente 10 kilobytes) para uma [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><em>para não acontecer certos erros que vi por aí&#8230;</em></p>
<p>Em C++ há <strong>três</strong> maneiras de passar um parâmetro para uma função, as tradicionais herdadas da linguagem C: <em>valor </em>e <em>ponteiro</em>; além da novidade: a passagem por <em>referência. </em>Para ilustrar veja o seguinte exemplo, passar uma estrutura de dados &#8220;grande&#8221; (neste caso aproximadamente 10 kilobytes) para uma função:</p>
<p><span style="color: #0000ff;"><strong>#include<span style="color: #008000;">&lt;iostream&gt;</span></strong></span><br />
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;string.h&gt;</span> </strong></span></p>
<p><strong>using</strong> <strong>namespace</strong> <span style="color: #2040a0;">std</span><span style="color: #4444ff;">;</span></p>
<p><strong>struct</strong> <span style="color: #2040a0;">Big</span> <span style="color: #4444ff;"><strong>{</strong></span><br />
<strong> char</strong> <span style="color: #2040a0;">text</span><span style="color: #4444ff;">[</span><span style="color: #ff0000;">10000</span><span style="color: #4444ff;">]</span><span style="color: #4444ff;">;</span><br />
<strong> int</strong> <span style="color: #2040a0;">id</span><span style="color: #4444ff;">;</span><br />
<span style="color: #4444ff;"><strong>}</strong></span><span style="color: #4444ff;">;</span></p>
<p><strong>void</strong> <span style="color: #2040a0;">f1</span><span style="color: #4444ff;">(</span> <span style="color: #2040a0;">Big</span> <span style="color: #2040a0;">v</span> <span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span><br />
<span style="color: #2040a0;"> cout</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">v</span>.<span style="color: #2040a0;">text</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">endl</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> cout</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #008000;">&#8220;Ox&#8221;</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">hex</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">v</span>.<span style="color: #2040a0;">id</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">endl</span><span style="color: #4444ff;">;</span><br />
<span style="color: #4444ff;"><strong>}</strong></span></p>
<p><strong>void</strong> <span style="color: #2040a0;">f2</span><span style="color: #4444ff;">(</span> <strong>const</strong> <span style="color: #2040a0;">Big</span> <span style="color: #4444ff;">*</span><span style="color: #2040a0;">v</span> <span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span><br />
<span style="color: #2040a0;"> cout</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">v</span><span style="color: #4444ff;">-</span><span style="color: #4444ff;">&gt;</span><span style="color: #2040a0;">text</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">endl</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> cout</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #008000;">&#8220;Ox&#8221;</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">hex</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">v</span><span style="color: #4444ff;">-</span><span style="color: #4444ff;">&gt;</span><span style="color: #2040a0;">id</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">endl</span><span style="color: #4444ff;">;</span><br />
<span style="color: #4444ff;"><strong>}</strong></span></p>
<p><strong>void</strong> <span style="color: #2040a0;">f3</span><span style="color: #4444ff;">(</span> <strong>const</strong> <span style="color: #2040a0;">Big</span> <span style="color: #4444ff;">&amp;</span><span style="color: #2040a0;">v</span> <span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span><br />
<span style="color: #2040a0;"> cout</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">v</span>.<span style="color: #2040a0;">text</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">endl</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> cout</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #008000;">&#8220;Ox&#8221;</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">hex</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">v</span>.<span style="color: #2040a0;">id</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">endl</span><span style="color: #4444ff;">;</span><br />
<span style="color: #4444ff;"><strong>}</strong></span></p>
<p><strong>int</strong> <span style="color: #2040a0;">main</span><span style="color: #4444ff;">(</span><strong>int</strong> <span style="color: #444444;">/*argc*/</span>, <strong>char</strong> <span style="color: #4444ff;">*</span> <span style="color: #444444;">/*argv*/</span><span style="color: #4444ff;">[</span><span style="color: #4444ff;">]</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span></p>
<p><span style="color: #2040a0;"> Big</span> <span style="color: #4444ff;">*</span><span style="color: #2040a0;">b0</span> <span style="color: #4444ff;">=</span> <strong>new</strong> <span style="color: #2040a0;">Big</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> Big</span> <span style="color: #2040a0;">b1</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> Big</span> <span style="color: #4444ff;">&amp;</span><span style="color: #2040a0;">b2</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">b1</span><span style="color: #4444ff;">;</span></p>
<p><span style="color: #2040a0;"> strcpy</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">b0</span><span style="color: #4444ff;">-</span><span style="color: #4444ff;">&gt;</span><span style="color: #2040a0;">text</span>,<span style="color: #008000;">&#8220;asdfg asdfg asdf asdf asdf asdf&#8221;</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> strcpy</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">b1</span>.<span style="color: #2040a0;">text</span>,<span style="color: #008000;">&#8220;azsxd azsxd azsxd azsxd azsxd azsxd&#8221;</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span></p>
<p><span style="color: #2040a0;"> b0</span><span style="color: #4444ff;">-</span><span style="color: #4444ff;">&gt;</span><span style="color: #2040a0;">id</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0xbc</span><span style="color: #4444ff;">;</span><br />
<span style="color: #2040a0;"> b1</span>.<span style="color: #2040a0;">id</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0xde</span><span style="color: #4444ff;">;</span></p>
<p><span style="color: #2040a0;"> f2</span><span style="color: #4444ff;">(</span> <span style="color: #2040a0;">b0</span> <span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> <span style="color: #444444;">/* pointer */</span><br />
<span style="color: #2040a0;"> f1</span><span style="color: #4444ff;">(</span> <span style="color: #2040a0;">b1</span> <span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> <span style="color: #444444;">/* value */</span><br />
<span style="color: #2040a0;"> f3</span><span style="color: #4444ff;">(</span> <span style="color: #2040a0;">b2</span> <span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span> <span style="color: #444444;">/* reference */</span><br />
<span style="color: #4444ff;"><strong>}</strong></span></p>
<p><span style="color: #4444ff;"><strong><br />
</strong></span></p>
<p>Veja o código <em>assembly</em> gerado pelo compilador (g++) para cada um dos três casos:</p>
<p><strong>1) Ponteiro</strong></p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;"><span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">-</span><span style="color: #0000ff;">0xc</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">eax</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">%</span><span style="color: #00007f;">eax</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">esp</span><span style="color: #009900; font-weight: bold;">&#41;</span>
<span style="color: #00007f; font-weight: bold;">call</span>   <span style="color: #0000ff;">0x8048885</span></pre></div></div>

<p><strong>2) Valor</strong></p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;">movl   $<span style="color: #0000ff;">0x0</span><span style="color: #339933;">,-</span><span style="color: #0000ff;">0x2728</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span>
<span style="color: #00007f; font-weight: bold;">lea</span>    <span style="color: #339933;">-</span><span style="color: #0000ff;">0x2720</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">eax</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">%</span><span style="color: #00007f;">eax</span><span style="color: #339933;">,-</span><span style="color: #0000ff;">0x272c</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span>
<span style="color: #00007f; font-weight: bold;">jmp</span>    <span style="color: #0000ff;">0x8048a36</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">-</span><span style="color: #0000ff;">0x272c</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">ecx</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">-</span><span style="color: #0000ff;">0x2728</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">edx</span>
movzbl <span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ecx</span><span style="color: #339933;">,%</span><span style="color: #00007f;">edx</span><span style="color: #339933;">,</span><span style="color: #0000ff;">1</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">eax</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">-</span><span style="color: #0000ff;">0x2728</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">edx</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">%</span><span style="color: #00007f;">al</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">esp</span><span style="color: #339933;">,%</span><span style="color: #00007f;">edx</span><span style="color: #339933;">,</span><span style="color: #0000ff;">1</span><span style="color: #009900; font-weight: bold;">&#41;</span>
addl   $<span style="color: #0000ff;">0x1</span><span style="color: #339933;">,-</span><span style="color: #0000ff;">0x2728</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span>
cmpl   $<span style="color: #0000ff;">0x2714</span><span style="color: #339933;">,-</span><span style="color: #0000ff;">0x2728</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span>
<span style="color: #00007f; font-weight: bold;">jb</span>     <span style="color: #0000ff;">0x8048a16</span>
<span style="color: #00007f; font-weight: bold;">call</span>   <span style="color: #0000ff;">0x80488fe</span></pre></div></div>

<p><strong>3) Referência</strong></p>

<div class="wp_syntax"><div class="code"><pre class="asm" style="font-family:monospace;"><span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">-</span><span style="color: #0000ff;">0x8</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">ebp</span><span style="color: #009900; font-weight: bold;">&#41;</span><span style="color: #339933;">,%</span><span style="color: #00007f;">eax</span>
<span style="color: #00007f; font-weight: bold;">mov</span>    <span style="color: #339933;">%</span><span style="color: #00007f;">eax</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">&#40;</span><span style="color: #339933;">%</span><span style="color: #00007f;">esp</span><span style="color: #009900; font-weight: bold;">&#41;</span>
<span style="color: #00007f; font-weight: bold;">call</span>   <span style="color: #0000ff;">0x804880c</span></pre></div></div>

<p>Talvez seja importante:</p>
<ul>
<li>Se você prefere a sintaxe da intel? Mude no GDB: <em>set disassembly-flavor intel</em></li>
<li>Não precisa ser muito esperto para ver que a passagem por valor é a pior de todas, veja quanto código <em>assembly</em> foi gerado [#fail]</li>
<li>A passagem por referência é inclusive mais eficiente pois aloca no %ebp (<em>base pointer</em>) [8 bytes ao invés de 12 bytes do ponteiro].</li>
<li>A passagem por referência provê a eficiência da passagem por ponteiros com a clareza da passagem por valor.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/basico-de-passagem-de-parametros-em-c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>td</title>
		<link>http://www.coding.com.br/unifei/td-1/</link>
		<comments>http://www.coding.com.br/unifei/td-1/#comments</comments>
		<pubDate>Mon, 10 May 2010 04:03:24 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[unifei]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=993</guid>
		<description><![CDATA[Estou utilizando o Vim et all, para escrever o texto do meu trabalho de conclusão de curso (conhecido também como trabalho de diploma, td), são basicamente as ferramentas:

vim &#8211; editor
aspell &#8211; correção ortográfica
bibtex &#8211; referencias textuais
latex &#8211; processador de texto
abntex &#8211; padrão do documento

A norma (!) diz que as palavras estrangeiras devem ser escritas em [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Estou utilizando o Vim <em>et all</em>, para escrever o texto do meu trabalho de conclusão de curso (conhecido também como trabalho de diploma, td), são basicamente as ferramentas:</p>
<ol>
<li><a href="http://www.vim.org/" target="_blank">vim</a> &#8211; editor</li>
<li><a href="http://aspell.net/" target="_blank">aspell</a> &#8211; correção ortográfica</li>
<li><a href="http://www.bibtex.org/" target="_blank">bibtex</a> &#8211; referencias textuais</li>
<li><a href="http://www.latex-project.org/" target="_blank">latex</a> &#8211; processador de texto</li>
<li><a href="http://sourceforge.net/apps/mediawiki/abntex/index.php?title=Main_Page" target="_blank">abntex</a> &#8211; padrão do documento</li>
</ol>
<p style="text-align: justify;">A norma (!) diz que as palavras estrangeiras devem ser escritas em <em>itálico. </em>Como é um texto técnico, há o uso frequente de palavras <em>in english</em> e o risco de deixar uma para trás é grande. Como a motivação para não escrever é maior, dispersei e acabei fazendo um programa que a partir de uma entrada (CSV) varre o texto e insere o itálico quando for necessário. O protótipo até agora esta assim:</p>
<p><a href="http://www.coding.com.br/wp-content/uploads/2010/05/italico.png"><img class="aligncenter size-full wp-image-999" src="http://www.coding.com.br/wp-content/uploads/2010/05/italico.png" alt="" width="441" height="322" /></a></p>
<p style="text-align: justify;">O código ainda não está limpo para torná-lo acessível num repositório on-line. Além disso, acho que há outras maneiras mais eficazes: sed, python, etc. Como não sei quando vou ter tempo para torná-lo útil de verdade, vou colar aqui as duas partes do código que achei interessante.</p>
<p style="text-align: justify;">A alteração no texto é simples: primeiro varremos o texto procurando pelo termo (<em>*palavra</em> é um iteraror da QStringList) e associamos um índice para cada ocorrência (<em>indexOf</em>) adicionando em uma lista (<em>pos</em> é um QList&lt;int&gt;). Antes de fazermos a troca (<em>replace</em>) comparamos com outra lista (<em>blacklist</em>) se essa inserção já não está dentro de um <em>\textit</em>. Se isso não acontecer, pode existir casos do tipo: <em>\textit{\textit{itálico}}</em>.</p>
<pre><strong>while</strong> <span style="color: #4444ff;">(</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">i</span><span style="color: #4444ff;">=</span><span style="color: #2040a0;">s</span>.<span style="color: #2040a0;">indexOf</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">*</span><span style="color: #2040a0;">palavra</span>,<span style="color: #2040a0;">i</span><span style="color: #4444ff;">+</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">!</span><span style="color: #4444ff;">=</span> <span style="color: #4444ff;">-</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span>
	<span style="color: #2040a0;">pos</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">i</span><span style="color: #4444ff;">;</span>

<strong>for</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">index</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span>, <span style="color: #2040a0;">offset</span><span style="color: #4444ff;">=</span><span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span> <span style="color: #2040a0;">index</span> <span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">pos</span>.<span style="color: #2040a0;">length</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">;</span> <span style="color: #2040a0;">index</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">)</span>
	<strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">blacklist</span>.<span style="color: #2040a0;">contains</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">pos</span>.<span style="color: #2040a0;">at</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">index</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">=</span><span style="color: #4444ff;">=</span> <span style="color: #ff0000;">false</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
		<span style="color: #2040a0;">str</span> <span style="color: #4444ff;">=</span> <span style="color: #008000;">"<span style="color: #77dd77;">\\</span>textit{"</span> <span style="color: #4444ff;">+</span> <span style="color: #4444ff;">*</span><span style="color: #2040a0;">palavra</span> <span style="color: #4444ff;">+</span> <span style="color: #008000;">"}"</span><span style="color: #4444ff;">;</span>
		<span style="color: #2040a0;">s</span>.<span style="color: #2040a0;">replace</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">pos</span>.<span style="color: #2040a0;">at</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">index</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">+</span><span style="color: #2040a0;">offset</span>,<span style="color: #4444ff;">(</span><span style="color: #4444ff;">*</span><span style="color: #2040a0;">palavra</span><span style="color: #4444ff;">)</span>.<span style="color: #2040a0;">length</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">)</span>,<span style="color: #2040a0;">str</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
		<span style="color: #2040a0;">offset</span> <span style="color: #4444ff;">+</span><span style="color: #4444ff;">=</span> <span style="color: #ff0000;">9</span><span style="color: #4444ff;">;</span>
	<span style="color: #4444ff;"><strong>}</strong></span></pre>
<p style="text-align: justify;">A construção da <em>blacklist</em> pode também ser aproveitada para evitar outros contextos, como notas de rodapé. Apenas trocar o <em>\\texti</em>t pelo<em> \\footnote</em>.</p>
<pre><strong>while</strong> <span style="color: #4444ff;">(</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">a</span><span style="color: #4444ff;">=</span><span style="color: #2040a0;">s</span>.<span style="color: #2040a0;">indexOf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"<span style="color: #77dd77;">\\</span>textit{"</span>,<span style="color: #2040a0;">b</span><span style="color: #4444ff;">+</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">!</span><span style="color: #4444ff;">=</span> <span style="color: #4444ff;">-</span><span style="color: #ff0000;">1</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
	<span style="color: #2040a0;">b</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">s</span>.<span style="color: #2040a0;">indexOf</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"}"</span>,<span style="color: #2040a0;">a</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
	<strong>if</strong> <span style="color: #4444ff;">(</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">c</span><span style="color: #4444ff;">=</span><span style="color: #2040a0;">s</span>.<span style="color: #2040a0;">indexOf</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">*</span><span style="color: #2040a0;">palavra</span>,<span style="color: #2040a0;">a</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">b</span><span style="color: #4444ff;">)</span>
		<span style="color: #2040a0;">blacklist</span> <span style="color: #4444ff;">&lt;</span><span style="color: #4444ff;">&lt;</span> <span style="color: #2040a0;">s</span>.<span style="color: #2040a0;">indexOf</span><span style="color: #4444ff;">(</span><span style="color: #4444ff;">*</span><span style="color: #2040a0;">palavra</span>,<span style="color: #2040a0;">a</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span></pre>
<p>Conclusão: esse <em>post</em> nem era para existir, mas quem sabe eu não invento algum programa que escreva o texto sozinho <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Até mais!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/td-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>latex + bibtex</title>
		<link>http://www.coding.com.br/unifei/latex-bibtex/</link>
		<comments>http://www.coding.com.br/unifei/latex-bibtex/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 22:44:14 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[unifei]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=948</guid>
		<description><![CDATA[Tá tudo certo e nada funciona?
Supondo que você tenha dois arquivos.

artigo.tex
biblio.bbl

E está tendo erros quando tenta fazer uma citação (\cite{Autor}), tipo:

LaTeX Warning: There were undefined references.
LaTeX Warning: Citation `XXXX&#8217; on page n undefined on input line N.

Isso acontece pois alguns arquivos precisam ser gerados (basicamente o aux, bbl e blg) e há uma dependência circular. [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><em>Tá tudo certo e nada funciona?</em></p>
<p>Supondo que você tenha dois arquivos.</p>
<ol>
<li>artigo.tex</li>
<li>biblio.bbl</li>
</ol>
<p>E está tendo erros quando tenta fazer uma citação (<em>\cite{Autor}</em>), tipo:</p>
<ul>
<li>LaTeX Warning: There were undefined references.</li>
<li>LaTeX Warning: Citation `XXXX&#8217; on page n undefined on input line N.</li>
</ul>
<p>Isso acontece pois alguns arquivos precisam ser gerados (basicamente o <em>aux</em>, <em>bbl</em> e <em>blg</em>) e há uma dependência circular. A solução é simples:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">pdflatex artigo.tex
bibtex all
pdflatex artigo.tex
pdflatex artigo.tex</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/latex-bibtex/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Calourada Livre 2010</title>
		<link>http://www.coding.com.br/unifei/calourada-livre-2010/</link>
		<comments>http://www.coding.com.br/unifei/calourada-livre-2010/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 22:39:30 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[unifei]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[software livre]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=775</guid>
		<description><![CDATA[Este ano pensei minha apresentação no Calourada Livre como uma série de &#8220;dicas&#8221; para os bixos aprenderem sobre Software Livre ainda na graduação, associando quando possível as matérias oferecidas no curso.
 
Slides: http://www.slideshare.net/maluta/calourada2010
:wq
]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Este ano pensei minha apresentação no Calourada Livre como uma série de &#8220;dicas&#8221; para os bixos aprenderem sobre Software Livre ainda na graduação, associando quando possível as matérias oferecidas no curso.</p>
<p style="text-align: justify;"><em> </em></p>
<p style="text-align: center;">Slides: <a title="Slides da minha apresentação no Calourada Livre realizado esta semana na Universidade Federal de Itajubá." href="http://www.slideshare.net/maluta/calourada2010" target="_blank">http://www.slideshare.net/maluta/calourada2010</a></p>
<p>:wq</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/calourada-livre-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Executando o TASM no GNU/Linux</title>
		<link>http://www.coding.com.br/unifei/executando-o-tasm-no-gnulinux/</link>
		<comments>http://www.coding.com.br/unifei/executando-o-tasm-no-gnulinux/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 00:50:34 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[unifei]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[borland]]></category>
		<category><![CDATA[tasm]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=309</guid>
		<description><![CDATA[A série de utilitários Turbo da Borland foi muito popular nos 80 e 90. Havia o Turbo Assembler, Turbo Liker, Turbo C, Turbo Debugger, etc; A versão que preciso utilizar tem retrições no endereçamento da memória roda no modo do MS-DOS. Hoje, sem o qemu/virtualbox para utilizar o Windows, resolvi partir para o Wine e [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">A série de utilitários <em>Turbo</em> da Borland foi muito popular nos 80 e 90. Havia o <em>Turbo Assembler</em>, <em>Turbo Liker</em>, <em>Turbo C</em>, <em>Turbo Debugger</em>, etc; A versão que preciso utilizar tem <span style="text-decoration: line-through;">retrições no endereçamento da memória</span> roda no modo do MS-DOS. Hoje, sem o qemu/virtualbox para utilizar o Windows, resolvi partir para o Wine e obtive o seguinte erro:</p>
<pre style="padding-left: 30px; text-align: justify;"># wine TASM.EXE
err:dosmem:DOSMEM_MapDosLayout Need full access to the first megabyte for DOS mode</pre>
<p style="text-align: justify;">Lembrei então do programa <a href="http://www.dosemu.org" target="_blank">dosemu</a>. A instalação (está presente na maioria dos gerenciadores de pacotes) e uso são simples. Após a execução você é direcionado a um <em>prompt</em> (igual ao <em>command</em> no Windows) que executa o <a href="http://www.freedos.org/" target="_blank">FreeDOS</a>. A partir deste ponto é ir até a partição com permissão de escrita &#8211; no meu caso D: &#8211; que reflete o diretório /root do  sistema.</p>
<div class="wp-caption aligncenter" style="width: 592px"><img class="size-full wp-image-464" title="tasm rodando no linux" src="http://www.coding.com.br/wp-content/uploads/2009/10/3972507943_12b58d3b30_o.png" alt="tasm rodando no linux" width="582" height="346" /><p class="wp-caption-text">Executando o Turbo Debugger 2.0 no DOSEMU</p></div>
<p>Alguns pontos:</p>
<ul>
<li style="text-align: justify;">É possivel utilizar o DOSEMU com o usuário <a href="http://dosemu.sourceforge.net/docs/README/1.1.3.7/runasuser.html" target="_blank">normal</a>.</li>
<li style="text-align: justify;">Usar o &#8216;edit&#8217; é perda te tempo, prefira <a href="http://www.vim.org" target="_blank">outras</a> opções e utilize o <em>prompt</em> somente para invocar os comandos.</li>
<li style="text-align: justify;">Se realmente não precisasse, nunca iria usar este programa, hoje em dia há opções <strong>bem</strong> melhores como o GNU Assembler (<a href="http://en.wikipedia.org/wiki/GNU_Assembler" target="_blank">gas</a>) ou até mesmo o <a href="http://www.coding.com.br/programacao/depurando-programas-em-assembly-no-gnulinux-parte-1/" target="_blank">nasm</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/executando-o-tasm-no-gnulinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Erro no Portal Academico Unifei</title>
		<link>http://www.coding.com.br/unifei/erro-no-portal-academico-unifei/</link>
		<comments>http://www.coding.com.br/unifei/erro-no-portal-academico-unifei/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 23:22:37 +0000</pubDate>
		<dc:creator>Celso Fernandes</dc:creator>
				<category><![CDATA[unifei]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=18</guid>
		<description><![CDATA[Erro no sistema acadêmico da Universidade Federal de Itajubá]]></description>
			<content:encoded><![CDATA[<p>Noite de domingo, vou checar minhas notas no sistemas acadêmico da universidade quando&#8230;</p>
<div id="attachment_19" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.coding.com.br/wp-content/uploads/2009/06/portalacademico_shot.png"><img class="size-medium wp-image-19" title="Erro no Portal Acadêmico da Unifei" src="http://www.coding.com.br/wp-content/uploads/2009/06/portalacademico_shot-300x176.png" alt="Erro no Portal Acadêmico da Unifei" width="300" height="176" /></a><p class="wp-caption-text">Erro no Portal Acadêmico da Unifei</p></div>
<p style="text-align: right;">acesso dia 28/06/2009 as 20:05</p>
<p>é, no space left on device.. armazenamento ta caro hoje em dia.. isso porque nem é época de matrícula (ou será que domingo a noite da pico de acesso no sistema?!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/unifei/erro-no-portal-academico-unifei/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
