<?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>Marcos Junior</title>
	<atom:link href="http://webmarcos.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://webmarcos.net</link>
	<description>{ message: &#34;stay hungry... stay foolish&#34; }</description>
	<lastBuildDate>Tue, 29 Nov 2011 13:08:38 +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>[Sencha Touch 2.0] &#8211; TimePicker and TimePickerField</title>
		<link>http://webmarcos.net/2011/11/29/sencha-touch-2-0-timepicker-and-timepickerfield/</link>
		<comments>http://webmarcos.net/2011/11/29/sencha-touch-2-0-timepicker-and-timepickerfield/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 13:08:38 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Sencha]]></category>
		<category><![CDATA[Touch]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[hour]]></category>
		<category><![CDATA[minutes]]></category>
		<category><![CDATA[picker]]></category>
		<category><![CDATA[sencha]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[touch]]></category>

		<guid isPermaLink="false">http://webmarcos.net/?p=242</guid>
		<description><![CDATA[Olá Pessoal, como estão?? De volta ao blog, coloco hoje pra vocês um componente que precisei desenvolver para suprir a necessidade de um cliente em um projeto web mobile, com o Sencha Touch 2.0. Um dos módulos do projeto é uma agenda de compromissos, com a necessidade de informar a Data, e o Horario do [...]]]></description>
			<content:encoded><![CDATA[<p>Olá Pessoal, como estão??</p>
<p>De volta ao blog, coloco hoje pra vocês um componente que precisei desenvolver para suprir a necessidade de um cliente em um projeto web mobile, com o <a href="http://www.sencha.com/products/touch/" target="_blank">Sencha Touch 2.0</a>.<br />
Um dos módulos do projeto é uma agenda de compromissos, com a necessidade de informar a Data, e o Horario do compromisso,  porém a grande suíte de componentes prontos do Sencha Touch não inclui um componente do tipo TimePicker.</p>
<p>Pesquisando no Google, encontrei um ótimo <a href="http://appointsolutions.com/2011/09/sencha-touch-timepicker-form-field-picker-sheet/" target="_blank">componente</a>, porém não é compatível com a versão 2.0 do Sencha Touch.</p>
<p>O <a href="https://bitbucket.org/marcosgugs/sencha-touch-timepicker/" target="_blank">Código Fonte</a> do componente pode ser encontrado no meu <a href="https://bitbucket.org/marcosgugs/" target="_blank">BitBucket</a>.</p>
<p>Exemplos de uso:</p>
<p>Em um formulário ficaria assim:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
    xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'timepickerfield'</span><span style="color: #339933;">,</span>
    label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hora:'</span><span style="color: #339933;">,</span>
    value<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Você também pode alterar as configurações do TimePicker pelo field, por exemplo:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span>
    xtype<span style="color: #339933;">:</span> <span style="color: #3366CC;">'timepickerfield'</span><span style="color: #339933;">,</span>
    label<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hora:'</span><span style="color: #339933;">,</span>
    value<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    picker<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
        slotOrder<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'hour'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'minute'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
        hourText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Hora'</span><span style="color: #339933;">,</span>
        minuteText<span style="color: #339933;">:</span> <span style="color: #3366CC;">'Minuto'</span><span style="color: #339933;">,</span>
        hourFrom<span style="color: #339933;">:</span> <span style="color: #CC0000;">8</span><span style="color: #339933;">,</span>
        hourTo<span style="color: #339933;">:</span> <span style="color: #CC0000;">16</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>A Outra forma de usar o TimePicker é criando a instancia manualmente.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> picker <span style="color: #339933;">=</span> Ext.<span style="color: #660066;">create</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Ext.ux.TimePicker'</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// aqui vai as configurações do time picker</span>
&nbsp;
    minuteScale<span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span> <span style="color: #006600; font-style: italic;">// esta configuração faz com que os minutos utilizem uma scala.. neste exemplo, ficaria assim: 5,10,15,20,... .. o Default é 1</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>É isso ai pessoal, super simples!<br />
Qualquer dúvida deixem comentário. Bug&#8217;s, informe pelo <a href="https://bitbucket.org/marcosgugs/sencha-touch-timepicker/issues/new" target="_blank">BitBucket</a></p>
<p>Espero que tenha ajudado, grande abraço!</p>
<p> <img src='http://webmarcos.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2011/11/29/sencha-touch-2-0-timepicker-and-timepickerfield/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quero aprender Flex. Por onde começo?</title>
		<link>http://webmarcos.net/2010/06/07/quero-aprender-flex-por-onde-comeco/</link>
		<comments>http://webmarcos.net/2010/06/07/quero-aprender-flex-por-onde-comeco/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 20:25:37 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[aprender]]></category>
		<category><![CDATA[dicas]]></category>
		<category><![CDATA[onde começo?]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=234</guid>
		<description><![CDATA[O Marcos Bonatti (@mpbonatti) criou um post no blog dele dando várias dicas pra quem está começando no desenvolvimento em Flex 3 ou 4 Bora lá que as dicas são muito úteis. Só clicar aqui.]]></description>
			<content:encoded><![CDATA[<p>O Marcos Bonatti (<a href="http://twitter.com/mpbonatti" target="_blank" line="1">@mpbonatti</a>) criou um post no <a href="http://blog.mpbonatti.com.br" target="_blank" line="1">blog</a> dele dando várias dicas pra quem está começando no desenvolvimento em Flex 3 ou 4</p>
<p>Bora lá que as dicas são muito úteis.</p>
<p>Só clicar <a href="http://blog.mpbonatti.com.br/flex/quero-aprender-flex-por-onde-comeco" target="_blank" line="1">aqui</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2010/06/07/quero-aprender-flex-por-onde-comeco/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Resolvendo problemas com arredondamento</title>
		<link>http://webmarcos.net/2010/04/28/php-flex-resolvendo-problemas-com-arredondamento/</link>
		<comments>http://webmarcos.net/2010/04/28/php-flex-resolvendo-problemas-com-arredondamento/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 19:29:57 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[arredondamento]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[modulos]]></category>
		<category><![CDATA[pow]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=226</guid>
		<description><![CDATA[Um dos maiores problemas que ja passei trabalhando com duas linguagens em conjunto, foi a diferente forma em que elas trabalham com arredondamentos. Todas as linguagens tem suas funções nativas de arredondamento de valores, porém, algumas vezes, o resultado final não bate, dando uma diferença de centavos, que se somado podem virar milhões&#8230; Para resolver [...]]]></description>
			<content:encoded><![CDATA[<p>Um dos maiores problemas que ja passei trabalhando com duas linguagens em conjunto, foi a diferente forma em que elas trabalham com arredondamentos.<br />
Todas as linguagens tem suas funções nativas de arredondamento de valores, porém, algumas vezes, o resultado final não bate, dando uma diferença de centavos, que se somado podem virar milhões&#8230; <span id="more-226"></span></p>
<p>Para resolver este problema desenvolvi uma função de arredondamento que segue a lógica de &#8220;<em>Arredondamento por Módulos</em>&#8220;, que foi gentilmente explicada a mim por <a title="C2 Editora" href="http://www.c2.com.br" target="_blank" line="1">André Ctenas</a> ( Engenheiro, Fotógrafo e Nutricionista ), cliente da <a title="RIA Labs ( @ria_labs )" href="http://www.rialabs.com.br" target="_blank" line="1">RIA Labs</a>.</p>
<p>Abaixo segue a função em PHP e AS3, muito simples, com 2 parâmetros necessários:</p>
<p>Valor a ser arredondado<br />
Quantidade de casas decimais</p>
<h3>PHP:</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> round_number<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$valor</span><span style="color: #339933;">,</span> <span style="color: #000088;">$decimais</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$fator</span> <span style="color: #339933;">=</span> <span style="color: #990000;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #000088;">$decimais</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$valorArredondado</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$valor</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$fator</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color:#800080;">0.5</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$fator</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$valorArredondado</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>AS3:</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> round_number<span style="color: #000000;">&#40;</span> valor<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span><span style="color: #000066; font-weight: bold;">,</span> decimais<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">int</span> <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> fator<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">Math</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">pow</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight:bold;">10</span><span style="color: #000066; font-weight: bold;">,</span> decimais<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> result<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">Number</span><span style="color: #000000;">&#40;</span> <span style="color: #004993;">int</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>valor <span style="color: #000066; font-weight: bold;">*</span> fator<span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">+</span> <span style="color: #000000; font-weight:bold;">0.5</span><span style="color: #000000;">&#41;</span> <span style="color: #000066; font-weight: bold;">/</span> fator <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">return</span> result<span style="color: #000066; font-weight: bold;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<h3>Java ( enviado por <a href="http://twitter.com/javacia_caio" line="1">@javacia_caio</a> ):</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">double</span> round_number<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span> valor, <span style="color: #000066; font-weight: bold;">int</span> decimais<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">double</span> fator <span style="color: #339933;">=</span> <span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span>, decimais<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>valor <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span>valor <span style="color: #339933;">*</span> fator <span style="color: #339933;">+</span> <span style="color: #cc66cc;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> fator<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">long</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span>valor <span style="color: #339933;">*</span> fator <span style="color: #339933;">-</span> <span style="color: #cc66cc;">0.5</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> fator<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Você pode pegar estas funções e adicionar a sua classe de utilidades, e você não terá mais problemas com arredondamento.<br />
Você tbm pode usar a mesma lógica e criar esta função em outras linguagens.</p>
<p>[]&#8216;s</p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2010/04/28/php-flex-resolvendo-problemas-com-arredondamento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[FLEX] &#8211; Estilizando uma coluna do DataGrid&#8230;</title>
		<link>http://webmarcos.net/2010/04/28/flex-estilizando-uma-coluna-do-datagrid/</link>
		<comments>http://webmarcos.net/2010/04/28/flex-estilizando-uma-coluna-do-datagrid/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 17:01:21 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[boas praticas]]></category>
		<category><![CDATA[coluna]]></category>
		<category><![CDATA[data grid]]></category>
		<category><![CDATA[itemRenderer]]></category>
		<category><![CDATA[styles]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=216</guid>
		<description><![CDATA[Bom galera, após muito tempo sem blogar, hoje vou mostrar como fazer para estilizar os dados de uma coluna no DataGrid de uma forma mais limpa, customizável e, visando um melhor desempenho. Como assim estilizar um dado da coluna de um DataGrid? Talvez eu não tenha me expressado legal no título do post, então vou [...]]]></description>
			<content:encoded><![CDATA[<p>Bom galera, após muito tempo sem blogar, hoje vou mostrar como fazer para estilizar os dados de uma coluna no DataGrid de uma forma mais limpa, customizável e, visando um melhor desempenho.<span id="more-216"></span></p>
<p>Como assim estilizar um dado da coluna de um DataGrid?</p>
<p>Talvez eu não tenha me expressado legal no título do post, então vou explicar o que faz nosso exemplo.<br />
Basicamente é alterar a estilo do texto na coluna do datagrid, por exemplo: cor, negrito, itálico, etc&#8230;<br />
E o legal é que vc pode fazer uma formatação condicional, ou seja, dependendo de um determinado valor, a formatação é diferente&#8230;</p>
<p>Como assim, melhor desempenho?</p>
<p>Bom, primeiramente, a solução para esse nosso exemplo seria usar um itemRenderer, isso é algo que está bem explicado em diversos blogs por aí, então não vou explicar aqui como ele funciona, mas vou apenas detalhar umas coisas&#8230;</p>
<p>A forma mais utilizada para chegar a essa solução, seria criar um Componente do Tipo HBox, nele, adicionar um objeto do Tipo Label, dar um override no médodo data, e fazer a formatação do Label de acordo com o dado.</p>
<p>Isto funciona, porém, não é uma boa prática, pois o flex já tem uma classe expecífica para itemRenderer utilizando componentes mais leves como por exemplo o UITextField, desta forma, você apenas altera a formatação de um componente ja existente, não precisando criar um outro para aplicar a formatação.</p>
<p>Customizável?</p>
<p>Sim, sabemos que pela solução mais utilizada, dependendo da situação, teremos que criar vários itemRenderers diferentes&#8230;<br />
Neste exemplo, vamos criar um itemRenderer onde as cores, formatação, etc, vc define separadamente, tornando o seu itemRenderer reutilizável.</p>
<p>Bom, vamos para a prática, assim vocês vão entender melhor&#8230;</p>
<p>O primeiro passo, é criar nossa coluna customizada&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>marcosjunior<span style="color: #000066; font-weight: bold;">.</span>components<span style="color: #000066; font-weight: bold;">.</span>datagrid
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>dataGridClasses<span style="color: #000066; font-weight: bold;">.</span>DataGridColumn<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>core<span style="color: #000066; font-weight: bold;">.</span>ClassFactory<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> StylizedDataGridColumn <span style="color: #0033ff; font-weight: bold;">extends</span> DataGridColumn
	<span style="color: #000000;">&#123;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> StylizedDataGridColumn<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">this</span><span style="color: #000066; font-weight: bold;">.</span>itemRenderer = <span style="color: #0033ff; font-weight: bold;">new</span> ClassFactory<span style="color: #000000;">&#40;</span> StylizedDataGridItemRenderer <span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #6699cc; font-weight: bold;">var</span> stylesFunction<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Function</span>
&nbsp;
	<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Perceba que precisamos criar um atributo <strong>stylesFunction</strong>, esse atributo servirá para que possamos customizar nosso estilo, veremos mais a frente&#8230;<br />
Perceba também que no construtor da classe, estamos setando o itemRenderer desta coluna, que será a classe que iremos criar em seguida.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #9900cc; font-weight: bold;">package</span> com<span style="color: #000066; font-weight: bold;">.</span>marcosjunior<span style="color: #000066; font-weight: bold;">.</span>components<span style="color: #000066; font-weight: bold;">.</span>datagrid
<span style="color: #000000;">&#123;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.text</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">TextFormat</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>DataGrid<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>dataGridClasses<span style="color: #000066; font-weight: bold;">.</span>DataGridItemRenderer<span style="color: #000066; font-weight: bold;">;</span>
	<span style="color: #0033ff; font-weight: bold;">import</span> mx<span style="color: #000066; font-weight: bold;">.</span>controls<span style="color: #000066; font-weight: bold;">.</span>dataGridClasses<span style="color: #000066; font-weight: bold;">.</span>DataGridListData<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #9900cc; font-weight: bold;">class</span> StylizedDataGridItemRenderer <span style="color: #0033ff; font-weight: bold;">extends</span> DataGridItemRenderer
	<span style="color: #000000;">&#123;</span>
		<span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> StylizedDataGridItemRenderer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> lastUID<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span><span style="color: #000066; font-weight: bold;">;</span>	
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> <span style="color: #0033ff; font-weight: bold;">set</span> <span style="color: #004993;">data</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">data</span> = <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>listData <span style="color: #000066; font-weight: bold;">&amp;&amp;</span> listData<span style="color: #000066; font-weight: bold;">.</span>uid <span style="color: #000066; font-weight: bold;">!</span>= lastUID<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				styleChanged<span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;color&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
				lastUID = listData<span style="color: #000066; font-weight: bold;">.</span>uid<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		override <span style="color: #0033ff; font-weight: bold;">public</span> <span style="color: #339966; font-weight: bold;">function</span> getTextStyles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #000066; font-weight: bold;">!</span>listData<span style="color: #000000;">&#41;</span> 
			<span style="color: #000000;">&#123;</span>
				<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span>getTextStyles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> tf<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">TextFormat</span> = <span style="color: #0033ff; font-weight: bold;">super</span><span style="color: #000066; font-weight: bold;">.</span>getTextStyles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> dgListData<span style="color: #000066; font-weight: bold;">:</span>DataGridListData = listData <span style="color: #0033ff; font-weight: bold;">as</span> DataGridListData<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> dataGrid<span style="color: #000066; font-weight: bold;">:</span>DataGrid = dgListData<span style="color: #000066; font-weight: bold;">.</span>owner <span style="color: #0033ff; font-weight: bold;">as</span> DataGrid<span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> column<span style="color: #000066; font-weight: bold;">:</span>StylizedDataGridColumn = dataGrid<span style="color: #000066; font-weight: bold;">.</span>columns<span style="color: #000000;">&#91;</span>dgListData<span style="color: #000066; font-weight: bold;">.</span>columnIndex<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> o<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = column<span style="color: #000066; font-weight: bold;">.</span>stylesFunction<span style="color: #000000;">&#40;</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">,</span> column<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> p<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #0033ff; font-weight: bold;">in</span> o<span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				tf<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#93;</span> = o<span style="color: #000000;">&#91;</span>p<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
&nbsp;
			<span style="color: #0033ff; font-weight: bold;">return</span> tf<span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Bom, a mágica está no método <strong>getTextStyles</strong>, este é o método responsável pelo estilo do texto, então o que fazemos nele é pegar o retorno do atributo stylesFunction, que criamos na nossa Coluna, logo acima, este nos retornará um objeto o qual nós pegaremos os atributos dele e setaremos no nosso TextFormat.</p>
<p>Em seguida, colocaremos essas duas classes para funcionar</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">&lt;?</span>xml <span style="color: #004993;">version</span>=<span style="color: #990000;">&quot;1.0&quot;</span> encoding=<span style="color: #990000;">&quot;utf-8&quot;</span><span style="color: #000066; font-weight: bold;">?&gt;</span>
<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Application xmlns<span style="color: #000066; font-weight: bold;">:</span>mx=<span style="color: #990000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> layout=<span style="color: #990000;">&quot;absolute&quot;</span> xmlns<span style="color: #000066; font-weight: bold;">:</span>datagrid=<span style="color: #990000;">&quot;com.marcosjunior.components.datagrid.*&quot;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;!</span><span style="color: #000000;">&#91;</span>CDATA<span style="color: #000000;">&#91;</span>
&nbsp;
		<span style="color: #000000;">&#91;</span>Bindable<span style="color: #000000;">&#93;</span>
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #6699cc; font-weight: bold;">var</span> _dp<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #000000;">&#91;</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Marcos Junior&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">,</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Fábio Vedovelli&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">9</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">,</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;William Morais&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">7</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">,</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Tabata Ruiz&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">8</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">,</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Luiz Augusto&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">,</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Camila Rodrigues&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#125;</span><span style="color: #000066; font-weight: bold;">,</span>
			<span style="color: #000000;">&#123;</span> aluno<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #990000;">&quot;Paulo César&quot;</span><span style="color: #000066; font-weight: bold;">,</span> media_final<span style="color: #000066; font-weight: bold;">:</span> <span style="color: #000000; font-weight:bold;">4</span><span style="color: #000000;">&#125;</span>
			<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> changeStyles<span style="color: #000000;">&#40;</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">,</span> column<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> o<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Object</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span>
&nbsp;
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">data</span><span style="color: #000000;">&#91;</span>column<span style="color: #000066; font-weight: bold;">.</span>dataField<span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0xFF0000<span style="color: #000066; font-weight: bold;">;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bold</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">underline</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #004993;">value</span> <span style="color: #000066; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">7</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0xc34805<span style="color: #000066; font-weight: bold;">;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bold</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">underline</span> = <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">color</span> = 0x023064<span style="color: #000066; font-weight: bold;">;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">bold</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
				o<span style="color: #000066; font-weight: bold;">.</span><span style="color: #004993;">underline</span> = <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> o<span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #0033ff; font-weight: bold;">private</span> <span style="color: #339966; font-weight: bold;">function</span> situacao_labelFunction<span style="color: #000000;">&#40;</span><span style="color: #004993;">data</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Object</span><span style="color: #000066; font-weight: bold;">,</span> column<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn<span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #6699cc; font-weight: bold;">var</span> media<span style="color: #000066; font-weight: bold;">:</span><span style="color: #004993;">Number</span> = <span style="color: #004993;">data</span><span style="color: #000000;">&#91;</span><span style="color: #990000;">&quot;media_final&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>media <span style="color: #000066; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">5</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">value</span> = <span style="color: #990000;">&quot;Reprovado&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span> <span style="color: #0033ff; font-weight: bold;">if</span> <span style="color: #000000;">&#40;</span>media <span style="color: #000066; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight:bold;">7</span><span style="color: #000000;">&#41;</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">value</span> = <span style="color: #990000;">&quot;Exame&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">else</span>
			<span style="color: #000000;">&#123;</span>
				<span style="color: #004993;">value</span> = <span style="color: #990000;">&quot;Aprovado&quot;</span><span style="color: #000066; font-weight: bold;">;</span>
			<span style="color: #000000;">&#125;</span>
			<span style="color: #0033ff; font-weight: bold;">return</span> <span style="color: #004993;">value</span><span style="color: #000066; font-weight: bold;">;</span>
		<span style="color: #000000;">&#125;</span>
&nbsp;
		<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#93;</span><span style="color: #000066; font-weight: bold;">&gt;</span>
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Script<span style="color: #000066; font-weight: bold;">&gt;</span>
&nbsp;
	<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGrid id=<span style="color: #990000;">&quot;dg1&quot;</span> dataProvider=<span style="color: #990000;">&quot;{_dp}&quot;</span> <span style="color: #004993;">top</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">left</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">right</span>=<span style="color: #990000;">&quot;10&quot;</span> <span style="color: #004993;">bottom</span>=<span style="color: #990000;">&quot;10&quot;</span> verticalAlign=<span style="color: #990000;">&quot;middle&quot;</span> <span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>columns<span style="color: #000066; font-weight: bold;">&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Name&quot;</span> dataField=<span style="color: #990000;">&quot;aluno&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;140&quot;</span><span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGridColumn headerText=<span style="color: #990000;">&quot;Média&quot;</span> dataField=<span style="color: #990000;">&quot;media_final&quot;</span> <span style="color: #004993;">width</span>=<span style="color: #990000;">&quot;60&quot;</span> <span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;</span>datagrid<span style="color: #000066; font-weight: bold;">:</span>StylizedDataGridColumn headerText=<span style="color: #990000;">&quot;Situação&quot;</span> dataField=<span style="color: #990000;">&quot;media_final&quot;</span> labelFunction=<span style="color: #990000;">&quot;situacao_labelFunction&quot;</span> stylesFunction=<span style="color: #990000;">&quot;changeStyles&quot;</span> <span style="color: #000066; font-weight: bold;">/&gt;</span>
		<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>columns<span style="color: #000066; font-weight: bold;">&gt;</span> 
	<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>DataGrid<span style="color: #000066; font-weight: bold;">&gt;</span>
<span style="color: #000066; font-weight: bold;">&lt;/</span>mx<span style="color: #000066; font-weight: bold;">:</span>Application<span style="color: #000066; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Notemos que na criação do DataGrid, utilizamos a nossa Coluna customizada, nela, definimos o atributo <strong>stylesFunction</strong>, com uma função que criamos chamada <strong>changeStyles</strong><br />
Nesta função nós criamos as condições de formatação que quisermos, desde que retornemos um objeto com as formatações setadas corretamente.<br />
Este objeto será usado no itemRenderer para formatar o texto.</p>
<p>Note que também utilizamos o <strong>labelFunction</strong>, que no exemplo foi apenas para mostar que as propriedades nativas da Coluna do DataGrid funcionam normalmente, caso você não queira usar <strong>labelFunction</strong>, poderá setar o <strong>dataField</strong> normalmente como em outra coluna.</p>
<p>Veja um exemplo de como ficou nosso DataGrid:</p>
<p>			<embed src="http://blog.webmarcos.net/exemplos/flex/StylizedColumn/StylizedColumn.swf" quality="high" bgcolor="#869ca7" width="600" height="220" name="StylizedColumn" align="middle" 	play="true" loop="false" quality="high" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" line="1"><br />
			</embed></p>
<p>Você tbm pode fazer o download do source clicando <a href="http://blog.webmarcos.net/exemplos/flex/StylizedColumn/srcview/StylizedColumn.zip" line="1">aqui</a>.</p>
<p>Espero que isto tenha ajudado</p>
<p>Em breve mais dicas&#8230;</p>
<p>[]&#8216;s</p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2010/04/28/flex-estilizando-uma-coluna-do-datagrid/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP Headers e MIME Types</title>
		<link>http://webmarcos.net/2009/05/29/php-headers-e-mime-types/</link>
		<comments>http://webmarcos.net/2009/05/29/php-headers-e-mime-types/#comments</comments>
		<pubDate>Sat, 30 May 2009 04:11:23 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[mime]]></category>
		<category><![CDATA[types]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=184</guid>
		<description><![CDATA[Opa Pessoal, eu nunca decoro esses Headers e MIME Types e sempre que preciso usa-los é uma pesquisa no google. Resolvi postar aqui pra facilitar a minha vida, e de quem está procurando por isso&#8230; Atom 1 header&#40;'Content-type: application/atom+xml'&#41;; CSS 1 header&#40;'Content-type: text/css'&#41;; Javascript 1 header&#40;'Content-type: text/javascript'&#41;; JPEG Image 1 header&#40;'Content-type: image/jpeg'&#41;; JSON 1 header&#40;'Content-type: [...]]]></description>
			<content:encoded><![CDATA[<p>Opa Pessoal, eu nunca decoro esses Headers e MIME Types e sempre que preciso usa-los é uma pesquisa no google.<br />
Resolvi postar aqui pra facilitar a minha vida, e de quem está procurando por isso&#8230;</p>
<h4>Atom</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: application/atom+xml'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>CSS</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>Javascript</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/javascript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>JPEG Image</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: image/jpeg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>JSON</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: application/json'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>PDF</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: application/pdf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>RSS</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: application/rss+xml; charset=ISO-8859-1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>Text (Plain)</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/plain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h4>XML</h4>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: text/xml'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Espero ter ajudado!</p>
<p>Abraços <img src='http://webmarcos.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Vi em: http://davidwalsh.name/php-header-mime</p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2009/05/29/php-headers-e-mime-types/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Calcular similaridade entre duas Strings (%)</title>
		<link>http://webmarcos.net/2009/05/29/calcular-similaridade-entre-duas-strings/</link>
		<comments>http://webmarcos.net/2009/05/29/calcular-similaridade-entre-duas-strings/#comments</comments>
		<pubDate>Sat, 30 May 2009 03:03:44 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[igualdade]]></category>
		<category><![CDATA[percentual]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=180</guid>
		<description><![CDATA[Olá boa noite a todos, as coisas estão bem corridas pra mim, por isso o longo tempo sem posts no blog. Mas hoje separei algo interessante e que é pouco conhecido por programadores PHP. Ensinarei a calcular o percentual de igualdade entre duas Strings. Para isso vamos utilizar uma função do próprio PHP. Segue exemplo [...]]]></description>
			<content:encoded><![CDATA[<p>Olá boa noite a todos, as coisas estão bem corridas pra mim, por isso o longo tempo sem posts no blog.<br />
Mas hoje separei algo interessante e que é pouco conhecido por programadores PHP.</p>
<p>Ensinarei a calcular o percentual de igualdade entre duas Strings.</p>
<p>Para isso vamos utilizar uma função do próprio PHP. Segue exemplo abaixo.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$texto1</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Meu querido diário&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$texto2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Meu querido caderno&quot;</span><span style="color: #339933;">;</span>	
<span style="color: #000088;">$percentual</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">similar_text</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$texto1</span><span style="color: #339933;">,</span> <span style="color: #000088;">$texto2</span><span style="color: #339933;">,</span> <span style="color: #000088;">$percentual</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;O percentual de similaridade é: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$percentual</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>A complexidade deste algotimo é O(N**3) aonde N é o tamanho da maior string.</p>
<p>É isso ai, simples e objetivo!</p>
<p>Abraços <img src='http://webmarcos.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2009/05/29/calcular-similaridade-entre-duas-strings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[Javascript] Desabilitando teclas de função (F1, F2…)</title>
		<link>http://webmarcos.net/2009/03/26/javascript-desabilitando-teclas-de-funcao-f1-f2%e2%80%a6/</link>
		<comments>http://webmarcos.net/2009/03/26/javascript-desabilitando-teclas-de-funcao-f1-f2%e2%80%a6/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 15:47:26 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[desabilitar]]></category>
		<category><![CDATA[f1]]></category>
		<category><![CDATA[f2]]></category>
		<category><![CDATA[fx]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[teclas]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=171</guid>
		<description><![CDATA[Meu primo Vedovelli criou um post em seu blog muito interessante, onde explica como desabilitar as teclas de função do teclado ( F1, F2, F3 etc) nos browsers utilizando JQuery. Vale a pena dar uma conferida, pode ser muito útil em sua aplicação. Vai o link: http://www.vedovelli.com.br/?p=719 Abraços,]]></description>
			<content:encoded><![CDATA[<p>Meu primo <a href="http://www.vedovelli.com.br" target="_blank" line="1">Vedovelli </a>criou um post em seu blog muito interessante, onde explica como desabilitar as teclas de função do teclado ( F1, F2, F3 etc) nos browsers utilizando JQuery.</p>
<p>Vale a pena dar uma conferida, pode ser muito útil em sua aplicação.</p>
<p>Vai o link: <a href="http://www.vedovelli.com.br/?p=719" target="_blank" line="1">http://www.vedovelli.com.br/?p=719</a></p>
<p>Abraços, <img src='http://webmarcos.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2009/03/26/javascript-desabilitando-teclas-de-funcao-f1-f2%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Atalhos do Photoshop (5, 6, 7, CS, CS2, CS3, CS4)</title>
		<link>http://webmarcos.net/2009/03/25/atalhos-do-photoshop-5-6-7-cs-cs2-cs3-cs4/</link>
		<comments>http://webmarcos.net/2009/03/25/atalhos-do-photoshop-5-6-7-cs-cs2-cs3-cs4/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 19:55:03 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[atalhos]]></category>
		<category><![CDATA[cs2]]></category>
		<category><![CDATA[cs3]]></category>
		<category><![CDATA[cs4]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=166</guid>
		<description><![CDATA[Bom pessoal, muita gente procura na net sobre os atalhos do photoshop e não é tão facil encontrar, por isso resolvi disponibilizar aqui no blog alguns que eu consegui. Façam bom proveito! Adobe Photoshop CS4 &#8211; PC ou Mac Adobe Photoshop CS3 &#8211; PC ou Mac Adobe Photoshop CS2 &#8211; PC ou Mac Adobe Photoshop [...]]]></description>
			<content:encoded><![CDATA[<p>Bom pessoal, muita gente procura na net sobre os atalhos do photoshop e não é tão facil encontrar, por isso resolvi disponibilizar aqui no blog alguns que eu consegui.<br />
Façam bom proveito!</p>
<p><strong>Adobe Photoshop CS4</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS4_Keyboard_Shortcuts_PC.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a> ou <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS4_Keyboard_Shortcuts_Mac.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> Mac</a></p>
<p><strong>Adobe Photoshop CS3</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS3_Keyboard_Shortcuts_PC.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a> ou <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS3_Keyboard_Shortcuts_Mac.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> Mac</a></p>
<p><strong>Adobe Photoshop CS2</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS2_Keyboard_Shortcuts_PC.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a> ou <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS2_Keyboard_Shortcuts_Mac.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> Mac</a></p>
<p><strong>Adobe Photoshop CS</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS_Keyboard_Shortcuts_PC.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a> ou <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS_Keyboard_Shortcuts_Mac.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> Mac</a></p>
<p><strong>Adobe Photoshop 7</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PS7_Keyboard_Shortcuts.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a><a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS4_Keyboard_Shortcuts_Mac.pdf" target="_blank" line="1"><br />
</a></p>
<p><strong>Adobe Photoshop 6</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PS6_Keyboard_Shortcuts.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a><a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PSCS4_Keyboard_Shortcuts_Mac.pdf" target="_blank" line="1"><br />
</a></p>
<p><strong>Adobe Photoshop 5</strong> &#8211; <a href="http://blog.webmarcos.net/arquivos/photoshop/AtalhosPhotoshop/PS5_Keyboard_Shortcuts.pdf" target="_blank" line="1"><img class="alignnone size-full wp-image-167" title="PDF" src="http://www.webmarcos.net/blog/wp-content/uploads/2009/03/pdf-icon.png" alt="PDF" width="16" height="16" /> PC</a></p>
<p>Espero que seja útil.</p>
<p>Abraços! <img src='http://webmarcos.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2009/03/25/atalhos-do-photoshop-5-6-7-cs-cs2-cs3-cs4/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Forçando a utilização de páginas seguras (SSL) em PHP</title>
		<link>http://webmarcos.net/2009/03/24/forcando-a-utilizacao-de-paginas-seguras-ssl-em-php/</link>
		<comments>http://webmarcos.net/2009/03/24/forcando-a-utilizacao-de-paginas-seguras-ssl-em-php/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 19:04:08 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[paginas seguras]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=160</guid>
		<description><![CDATA[A internet é cheia de espertinhos, e as vezes temos páginas em que devem ser visualizadas em mode seguro. Este script força a visualização da pagina em um protocolo seguro evitando a ação de espertinhos. 1 2 3 4 5 6 &#60;?php if&#40;$_SERVER&#91;'SERVER_PORT'&#93; != '443'&#41; &#123; header&#40;'Location: https://'.$_SERVER&#91;'HTTP_HOST'&#93;.$_SERVER&#91;'REQUEST_URI'&#93;&#41;; exit&#40;&#41;; &#125; ?&#62; Espero ter ajudado, vi [...]]]></description>
			<content:encoded><![CDATA[<p>A internet é cheia de espertinhos, e as vezes temos páginas em que devem ser visualizadas em mode seguro.<br />
Este script força a visualização da pagina em um protocolo seguro evitando a ação de espertinhos.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_PORT'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'443'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
              <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location: https://'</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
              <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
      <span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Espero ter ajudado, vi a dica em: <a href="http://davidwalsh.name" target="_blank" line="1">http://davidwalsh.name</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2009/03/24/forcando-a-utilizacao-de-paginas-seguras-ssl-em-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Criando uma TinyURL com PHP</title>
		<link>http://webmarcos.net/2009/03/01/criando-uma-tinyurl-com-php/</link>
		<comments>http://webmarcos.net/2009/03/01/criando-uma-tinyurl-com-php/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 13:22:50 +0000</pubDate>
		<dc:creator>marcos</dc:creator>
				<category><![CDATA[Dicas]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[tinyurl]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://www.webmarcos.net/blog/?p=155</guid>
		<description><![CDATA[TinyURL é um serviço fantástico. Para aqueles que não sabem o que é TinyURL, TinyURL lhe permite ter uma URL longa como &#8220;http://davidwalsh.name/jquery-link-nudging&#8221; e transformá-lo em &#8220;http://tinyurl.com/67c4se&#8221; . Utilizando o PHP e TinyURL API, você pode criar esses minúsculos URLs na mosca! 1 2 3 4 5 6 7 8 9 10 11 12 13 [...]]]></description>
			<content:encoded><![CDATA[<p>TinyURL é um serviço fantástico. Para aqueles que não sabem o que é TinyURL, TinyURL lhe permite ter uma URL longa como &#8220;http://davidwalsh.name/jquery-link-nudging&#8221; e transformá-lo em &#8220;http://tinyurl.com/67c4se&#8221; .</p>
<p>Utilizando o PHP e TinyURL API, você pode criar esses minúsculos URLs na mosca!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//pega o valor da URL    </span>
<span style="color: #000000; font-weight: bold;">function</span> get_tiny_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span>    
<span style="color: #009900;">&#123;</span>    
    <span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #000088;">$timeout</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>    
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span>CURLOPT_URL<span style="color: #339933;">,</span><span style="color: #0000ff;">'http://tinyurl.com/api-create.php?url='</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span>CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span>CURLOPT_CONNECTTIMEOUT<span style="color: #339933;">,</span><span style="color: #000088;">$timeout</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>    
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>    
<span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #666666; font-style: italic;">//pra testar  </span>
<span style="color: #000088;">$new_url</span> <span style="color: #339933;">=</span> get_tiny_url<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://davidwalsh.name/php-imdb-information-grabber'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
<span style="color: #666666; font-style: italic;">//retornou http://tinyurl.com/65gqpp  </span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$new_url</span></pre></td></tr></table></div>

<p>Espero que tenha sido útil. Vi no http://davidwalsh.name.</p>
<p>Abraços, ótimo domingo a todos!!</p>
]]></content:encoded>
			<wfw:commentRss>http://webmarcos.net/2009/03/01/criando-uma-tinyurl-com-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

