<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title></title>
	<atom:link href="http://hugolnx.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hugolnx.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 May 2011 13:51:52 +0000</lastBuildDate>
	<language>pt-br</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hugolnx.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title></title>
		<link>http://hugolnx.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://hugolnx.wordpress.com/osd.xml" title="" />
	<atom:link rel='hub' href='http://hugolnx.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Migrando para http://hugolnx.com</title>
		<link>http://hugolnx.wordpress.com/2011/05/26/migrando-para-httphugolnx-com/</link>
		<comments>http://hugolnx.wordpress.com/2011/05/26/migrando-para-httphugolnx-com/#comments</comments>
		<pubDate>Thu, 26 May 2011 13:45:10 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=97</guid>
		<description><![CDATA[Olá pessoal, esse é meu ultimo post aki no wordpress. Como não gostava de varias limitações do wordpress então decidi criar meu proprio blog usando rails 3(http://hugolnx.com), partir de agora todos os meus posts serão nele e pretendo em breve apagar este aqui. Caso você esteja seguindo o feed, pode seguir este agora: http://hugolnx.com/feed.rss obrigado<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=97&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Olá pessoal, esse é meu ultimo post aki no wordpress.<br />
Como não gostava de varias limitações do wordpress então decidi criar meu proprio blog usando rails 3(<a href="http://hugolnx.com">http://hugolnx.com</a>), partir de agora todos os meus posts serão nele e pretendo em breve apagar este aqui.</p>
<p>Caso você esteja seguindo o feed, pode seguir este agora: <a href="http://hugolnx.com/feed.rss">http://hugolnx.com/feed.rss</a></p>
<p>obrigado</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=97&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2011/05/26/migrando-para-httphugolnx-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>
	</item>
		<item>
		<title>Cores Opacas com CSS3</title>
		<link>http://hugolnx.wordpress.com/2010/10/10/cores-opacas-com-css3/</link>
		<comments>http://hugolnx.wordpress.com/2010/10/10/cores-opacas-com-css3/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 21:26:51 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[html css css3 cor cores opaca opacidade transparencia alpha rgba]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=89</guid>
		<description><![CDATA[Introdução Olá a todos novamente =D Nesse pequeno post, irei mostrar um recurso novo provindo do CSS3, as cores opacas. &#160; Cores Comuns Como muitos sabem, no CSS2 existiam 2 maneiras de declarar uma cor: Através do código hexadecimal&#8230; &#60;p style="background-color: #ff0000;"&#62;Testando Fundo Vermelho&#60;/p&#62; Ou através do padrão RGB&#8230; &#60;p style="background-color: rgb(255,0,0);"&#62;Testando Fundo Vermelho&#60;/p&#62; Os [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=89&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Introdução</h1>
<p>Olá a todos novamente =D<br />
Nesse pequeno post, irei mostrar um recurso novo provindo do CSS3, as cores opacas.</p>
<p>&nbsp;</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Cores Comuns</h1>
<p>Como muitos sabem, no CSS2 existiam 2 maneiras de declarar uma cor:</p>
<p>Através do código hexadecimal&#8230;</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border:2px solid #36f;padding:10px;">&lt;p style="background-color: #ff0000;"&gt;Testando Fundo Vermelho&lt;/p&gt;</pre>
<p>Ou através do padrão RGB&#8230;</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border:2px solid #36f;padding:10px;">&lt;p style="background-color: rgb(255,0,0);"&gt;Testando Fundo Vermelho&lt;/p&gt;</pre>
<p>Os dois exemplos acima resultariam em&#8230;</p>
<p style="background-color:#f00;">Testando Fundo Vermelho</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';"></h1>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Cores Opacas</h1>
<p>Diferente do CSS2, o CSS3 nos permite utilizar o padrão RGBA(Red Green Blue Alpha), sendo o canal Alpha um valor de 0-1(0 = totalmente transparente) indicando a opacidade da cor&#8230;</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border:2px solid #36f;padding:10px;">&lt;p style="background-color: rgba(255,0,0,0.5);"&gt;Testando Fundo Parcialmente Vermelho&lt;/p&gt;</pre>
<p>Resultando em&#8230;</p>
<p style="background-color:rgba(255,0,0,0.5);">Testando Fundo Parcialmente Vermelho</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';"></h1>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Concluindo</h1>
<p>Bem, descobri isso quando estava codificando um projeto da caelum, foi util como cor de fundo de uma popup <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
Com um pouco mais de imaginação e da pra usar de maneiras mais úteis <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Espero ter ajudado xD</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';"></h1>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Referências</h1>
<p><a href="http://www.criarweb.com/artigos/cores-rgba-em-css3.html">http://www.criarweb.com/artigos/cores-rgba-em-css3.html</a></p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';"></h1>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Contato</h1>
<p><strong>Twitter:</strong> <a href="http://twitter.com/Hugolnx">http://twitter.com/Hugolnx</a><br />
<strong>Github:</strong> <a href="http://github.com/HugoLnx">http://github.com/HugoLnx</a><br />
<strong>Email:</strong> hugo.roque@caelum.com.br<br />
<strong>Celular:</strong> 8641-1271</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=89&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2010/10/10/cores-opacas-com-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>
	</item>
		<item>
		<title>Retrospectiva DevInRio 2010</title>
		<link>http://hugolnx.wordpress.com/2010/10/10/retrospectiva-devinrio-2010/</link>
		<comments>http://hugolnx.wordpress.com/2010/10/10/retrospectiva-devinrio-2010/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 20:39:28 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[Evento]]></category>
		<category><![CDATA[Retrospectiva]]></category>
		<category><![CDATA[devinrio 2010 retrospectiva evento desenvolvedor rio carioca palestra]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=83</guid>
		<description><![CDATA[Visão Geral O Evento aconteceu no Hotel Guanabara que fica no cruzamento entre a Presidente Vargas e a Rio Branco. Em geral eu gostei muito mesmo tinha muita gente, muitas palestras boas, os coffee-breaks foram muito bons também. Só faltou mais espaço no salão do 4º andar, que em algumas palestras não coube todo mundo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=83&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Visão Geral</h1>
<p>O Evento aconteceu no Hotel Guanabara que fica no cruzamento entre a Presidente Vargas e a Rio Branco. Em geral eu gostei muito mesmo tinha muita gente, muitas palestras boas, os coffee-breaks foram muito bons também. Só faltou mais espaço no salão do 4º andar, que em algumas palestras não coube todo mundo que queria assistir.</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Mas falando das palestras que eu assisti&#8230;</h1>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">HTML 5 e as novas JS APIs &#8211; Leonardo Balter</h3>
<p>Essa foi uma das palestras onde algumas pessoas não puderam assistir devido à falta de espaço. Apesar de corrida, a palestra deu uma visão geral do HTML5, apresentando alguns recursos muito interessantes através de exemplos bem elaborados.<br />
<a href="http://www.slideshare.net/leobalter/apis-do-html-5">Slides Aqui</a></p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">NodeJS, a performance que eu sempre quis ter &#8211; Emerson Macedo</h3>
<p>Gostei muito desta palestra, o palestrante soube apresentar muito bem o Node, que até então era pouco conhecido. Muitos gráficos comparativos foram utilizados, além de figuras ilustrativas, tornando a palestra ainda mais interessante e mostrando a potencialidade deste novo recurso. Ao final da palestra foi apresentado o <a href="http://nodecasts.org/">NodeCasts</a>, website criado pelo próprio Emerson, onde ele irá postar screencasts sobre o NodeJS a cada 1 ou 2 semanas.<br />
<a href="http://www.slideshare.net/emerleite/devinrio-2010-nodejs">Slides Aqui</a></p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Coding Dojo + Open Space</h3>
<p>Não foi bem uma palestra e sim um dojo no estilo do que é realizado semanalmente em vários locais do rio pelo <a href="http://dojorio.wordpress.com/">Coding Dojo Rio</a>. Foi bem interessante, porém seria muito melhor com um tempo superior à 30min. xP</p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Transformando idéias em negócios rentáveis &#8211; Rafael Lima</h3>
<p>Outra palestra extremamente boa também, ampliou muito minha visão empreendedora. A apresentação da trajetória profissional percorrida pelo palestrante tornou a palestra muito interessante.<br />
<a href="http://www.slideshare.net/rafael_lima/transformando-ideias-em-negocios-rentaveis">Slides Aqui</a></p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Uma Visão do Mundo Ruby &#8211; Fábio Akita</h3>
<p>Apesar de não mostrar uma linha de código, a palestra foi muito boa. Nela, Akita mostra uma boa parte da história do ruby/rails de forma muito dinâmica. Apresentando importantes/interessantes figuras e acontecimentos do mundo ruby/rails, além de vídeos muito interessantes.<br />
<a href="http://www.slideshare.net/akitaonrails/dev-in-rio-uma-viso-do-mundo-ruby">Slides Aqui</a></p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';"><span style="text-decoration:line-through;">Por que eu sou fanático por testes e você é um bundão &#8211; Sylvestre Mergulhão &amp; Henrique Andrade</span></h3>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Teatro &#8220;Precisa-se de Desenvolvedor&#8221; &#8211; Andre Fonseca &amp; Sylvestre Mergulhão</h3>
<p>Acabou por ocorrer um imprevisto e a palestra agendada não foi realizada, porém um teatro improvisado foi feito por André Fonseca e Sylvestre Mergulhão, onde a platéia inteira caiu na gargalhada. xD<br />
<span style="color:red;"><strong>Não Encontrei o Vídeo</strong></span></p>
<p><span style="color:red;"><strong><br />
</strong></span></p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Arquitetura: cansado da mesmice? &#8211; Guilherme Silveira</h3>
<p>Infelizmente quando cheguei no salão a palestra já estava no final. Porém o que eu entendi do que vi foi interessante, falando da importância de uma boa arquitetura para possibilitar a integração entre sistemas, entre outros.<br />
<a href="http://www.slideshare.net/guilhermecaelum/arquitetura-chega-de-mesmice-542577">Slides Aqui</a></p>
<p><span style="color:red;"><strong><br />
</strong></span></p>
<h3 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Fuja da Escravidão, antes que ela te alcance &#8211; Vinícius Teles</h3>
<p>Outra palestra muito interessante sobre empreendedorismo e que amadureceu muito minha visão profissional. Através de histórias muito interessantes e sábias palavras, o palestrante conseguiu passar a mensagem que  planejava.<br />
<a href="http://www.slideshare.net/viniciusteles/fuja-da-escravido-antes-que-ela-te-alcance-4261724">Slides Aqui</a></p>
<p>&nbsp;</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Conclusão</h1>
<p>Após as palestras foi realizado um #horaextra no mesmo local de sempre(rua do ouvidor número não faço idéia xD). O encontro foi muito divertido, uma pena eu ter que sair cedo(voltar pra anchieta num é mole não xD). E foi isso que rolou, se quiser saber mais&#8230; lamento, deveria ter ido.</p>
<p><img src="http://forum.nintendoblast.com.br/users/1311/21/76/18/smiles/871559.gif" alt="Manolo Face" /><br />
Mas quem quiser ver uma casquinha de como foi pode ver <a href="http://galeria.tapajos.me/fotos/5526226344440434529/2/18/5526228655501104706/p#subnavigation">as fotos</a>.</p>
<p>&nbsp;</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Índice De Todas as Palestras</h1>
<p><strong>Sala 1:</strong><a href="http://www.slideshare.net/turicas/construindo-robs-com-software-e-hardware-livres"><br />
Arduino: construindo robôs com software e hardware livres &#8211; Álvaro Justen</a></p>
<p><a href="http://www.slideshare.net/henriquebastos/empreendendo-uma-comunidade-de-sucesso"> Empreendendo uma comunidade de sucesso &#8211; Henrique Bastos</a></p>
<p><a href="http://www.slideshare.net/rafael_lima/transformando-ideias-em-negocios-rentaveis"> Transformando idéias em negócios rentáveis &#8211; Rafael Lima</a></p>
<p><a href="http://www.slideshare.net/akitaonrails/dev-in-rio-uma-viso-do-mundo-ruby"> Uma Visão do Mundo Ruby &#8211; Fábio Akita</a></p>
<p><a href="http://www.slideshare.net/teamware/desmistificando-agile-scrum-presentation"> Desmistificando Scrum &amp; Agile &#8211; Juan Bernabó</a></p>
<p><span style="text-decoration:line-through;"><a> Por que eu sou fanático por testes e você é um bundão &#8211; Sylvestre Mergulhão &amp; Henrique Andrade</a></span></p>
<p><a href="http://www.slideshare.net/viniciusteles/fuja-da-escravido-antes-que-ela-te-alcance-4261724"> Fuja da Escravidão, antes que ela te alcance &#8211; Vinícius Teles</a></p>
<p>&nbsp;</p>
<p><strong>Sala2</strong></p>
<p><a href="http://www.slideshare.net/leobalter/apis-do-html-5"> HTML 5 e as novas JS APIs &#8211; Leonardo Balter</a></p>
<p><a href="http://www.slideshare.net/emerleite/devinrio-2010-nodejs"> NodeJS &#8211; a performance que eu sempre quis ter &#8211; Emerson Macedo</a></p>
<p><a href="http://www.slideshare.net/hisamu/symfony-php-pra-gente-grande"> Symfony &#8211; OO PHP para gente grande &#8211; Luã de Souza</a></p>
<p><a href="http://www.slideshare.net/caikesouza/refactoring-5412194"> Refactoring &#8211; Porque apenas fazer funcionar não é o suficiente &#8211; Caike Souza</a></p>
<p><a href="http://www.slideshare.net/guilhermecaelum/arquitetura-chega-de-mesmice-5425777"> Arquitetura: cansado da mesmice? &#8211; Guilherme Silveira</a></p>
<p><span style="color:#ff0000;">Testes unitários em JavaScript: usar ou não usar mock? &#8211; Márcio Santana</span></p>
<p><span style="color:#ff0000;"><br />
</span></p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Contato</h1>
<p><strong>Twitter:</strong> <a href="http://twitter.com/Hugolnx">http://twitter.com/Hugolnx</a><br />
<strong>Github:</strong> <a href="http://github.com/HugoLnx">http://github.com/HugoLnx</a><br />
<strong>Email:</strong> hugo.roque@caelum.com.br<br />
<strong>Celular: </strong>8641-1271</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=83&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2010/10/10/retrospectiva-devinrio-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>

		<media:content url="http://forum.nintendoblast.com.br/users/1311/21/76/18/smiles/871559.gif" medium="image">
			<media:title type="html">Manolo Face</media:title>
		</media:content>
	</item>
		<item>
		<title>Comparação entre floats</title>
		<link>http://hugolnx.wordpress.com/2010/07/20/comparacao-entre-floats/</link>
		<comments>http://hugolnx.wordpress.com/2010/07/20/comparacao-entre-floats/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 01:48:43 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[Programação]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[comparacao]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[precisão]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=48</guid>
		<description><![CDATA[Introdução Olá a todos novamente =D Pra variar um pouco, nesse post eu não vou falar de JRuby, vou falar de um problema que eu tive hoje quando estava trabalhando no meu projeto Ondas2.0 e que eu gostei da solução.xD Desvendando o Problema Não vou explicar o problema que eu tive, é meio que difícil [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=48&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Introdução</h1>
<p>Olá a todos novamente =D<br />
Pra variar um pouco, nesse post eu não vou falar de JRuby, vou falar de um problema que eu tive hoje quando estava trabalhando no meu projeto <a href="http://github.com/HugoLnx/Ondas-2.0">Ondas2.0</a> e que eu gostei da solução.xD</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Desvendando o Problema</h1>
<p>Não vou explicar o problema que eu tive, é meio que difícil de explicar, mas vou explicar a solução através do problema descrito <a href="http://forum.rubyonbr.org/forums/1/topics/2447">neste tópico</a> que eu acabei &#8220;esbarrando&#8221; quando procurava a solução para o meu problema.<br />
No tópico o Neves mostra um problema que meu deixou um pouco confuso, de acordo com ele isso ocorreria&#8230;</p>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border:2px solid #36f;padding:20px;">1.8 == (1.8/3)*3<br />
=&gt; false</p>
<p>É claro, tive que testar isso, e para minha surpresa, realmente dava false xD<br />
Logo após testar, vi a resposta do Akita&#8230;</p>
<blockquote><p>&#8220;Comparação de Floating Point é historicamente problemático, como você disse, por toda a área de computação.<br />
Portanto não se faz comparação de equivalência (==) entre floats. O que se faz é a diferença entre floats e daí você garante que ele está abaixo do nível de precisão que você precisa.&#8221;</p></blockquote>
<p>Quando eu li isso, meu primeiro impulso foi testar o seguinte&#8230;</p>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border:2px solid #36f;padding:20px;">1.8 &#8211; (1.8/3)*3<br />
=&gt; 2.22044604925031e-016</p>
<p>Algo me dizia que não iria dar 0.0 só não sabia por que xD<br />
Mas depois de ver o resultado do teste eu entendi, vi o &#8220;e-016&#8243; que significa &#8220;vezes 10 elevado à -16&#8243; e percebi que em algum momento, alguma parte decimal era perdida lá na casa do inferno(a 16ª casa para ser mais exato) xD</p>
<p>Pesquisando <a href="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm">um pouco mais</a> percebi que não eram incomuns esses problemas com floats, e comecei a trabalhar numa solução para o meu problema.<br />
Então eu pensei em abrir a classe Float e adicionar um método eh_igual? que receberia por parâmetro a float que seria comparada e um número que indicaria a precisão da comparação em casas decimais.<br />
Ou seja, eu queria que se isso ocorresse&#8230;</p>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border:2px solid #36f;padding:20px;">1.0.eh_igual?(1.0, 1)<br />
=&gt; true<br />
&#8212;<br />
1.0.eh_igual?(1.01, 1) # precisão de 1 casa decimal,<br />
#logo quando a 2ª diferencia, ele considera como igual<br />
=&gt; true<br />
&#8212;<br />
1.0.eh_igual?(1.09,1)<br />
=&gt; true<br />
&#8212;<br />
1.0.eh_igual?(1.1, 1)<br />
=&gt; false<br />
&#8212;<br />
1.0.eh_igual?(1.01, 2)<br />
=&gt; false<br />
&#8212;<br />
1.0.eh_igual?(1.001, 2)<br />
=&gt; true<br />
&#8212;<br />
1.8.eh_igual?((1.8/3)*3, 1)<br />
=&gt; true<br />
&#8212;<br />
1.8.eh_igual?((1.8/3)*3, 15)<br />
=&gt; true<br />
&#8212;<br />
1.8.eh_igual?((1.8/3)*3, 16)<br />
=&gt; false</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Resolvendo o Problema</h1>
<p>A melhor maneira que eu encontrei de fazer isso, seria, diminuindo uma float da outra, e testando se o modulo do resultado era maior que 0 e menor que &#8220;10 elevado à precisão negativa&#8221;. Ou seja, se eu quero comparar 10.0 com 10.1, eu faria&#8230;<br />
10.0 &#8211; 10.1 = -0.1 ( módulo de -0.1 = 0.1 )<br />
&#8230;nesse momento entra a precisão&#8230; &#8220;um décimo de diferença é pequeno o suficiente para que eu o desconsidere?&#8221;<br />
se a precisão for 1, a resposta será sim, caso fosse maior que isso a resposta seria não.<br />
E assim eu implementei&#8230;</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border:2px solid #36f;padding:10px;">class Float
  def eh_igual?(outra_float,precisao=5)
    (self - outra_float).abs.between?(0,10 ** -precisao)
  end
end</pre>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Concluindo</h1>
<p>Esse foi um problema que eu até gostei de resolver, pode até ser algo trivial para muitos, mas para alguns não deve ser, então não custa nada postar.xD<br />
Se alguém souber um modo melhor de fazer isso eu adoraria que me mandasse um email, ou algo assim.<br />
Qualquer dúvida, conselho, sugestão, chingamento, etc, contate através de um dos meios abaixo.<br />
Espero ter ajudado xD</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Fontes</h1>
<p><a href="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm">http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm</a><br />
<a href="http://forum.rubyonbr.org/forums/1/topics/2447">http://forum.rubyonbr.org/forums/1/topics/2447</a></p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Contato</h1>
<p><strong>Twitter:</strong> <a href="http://twitter.com/Hugolnx">http://twitter.com/Hugolnx</a><br />
<strong>Github:</strong> <a href="http://github.com/HugoLnx">http://github.com/HugoLnx</a><br />
<strong>Email:</strong> hugo.roque@caelum.com.br<br />
<strong>Celular:</strong> 8641-1271</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=48&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2010/07/20/comparacao-entre-floats/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>
	</item>
		<item>
		<title>Importando bytecodes para sua aplicação JRuby</title>
		<link>http://hugolnx.wordpress.com/2010/07/18/importando-bytecodes-para-sua-aplicacao-jruby/</link>
		<comments>http://hugolnx.wordpress.com/2010/07/18/importando-bytecodes-para-sua-aplicacao-jruby/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 02:51:05 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bytecode]]></category>
		<category><![CDATA[compilador]]></category>
		<category><![CDATA[compilar]]></category>
		<category><![CDATA[importar]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Java Virtual Machine]]></category>
		<category><![CDATA[javac]]></category>
		<category><![CDATA[jruby]]></category>
		<category><![CDATA[jrubyc]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=38</guid>
		<description><![CDATA[Introdução Olá a todos xD Após tanto tempo sem postar nada aqui estou eu de novo, postando mais uma coisinha sobre JRuby, importando bytecodes para uma aplicação JRuby. Primeiramente, temos que lembrar que trataremos de dois &#8220;tipos&#8221; de bytecodes aqui, o que é gerado pelo javac apartir de um .java, e o gerado pelo jrubyc [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=38&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Introdução</h1>
<p>Olá a todos xD<br />
  Após tanto tempo sem postar nada aqui estou eu de novo, postando mais uma coisinha sobre JRuby, importando bytecodes para uma aplicação JRuby.<br />
  Primeiramente, temos que lembrar que trataremos de dois &#8220;tipos&#8221; de bytecodes aqui, o que é gerado pelo javac apartir de um .java, e o gerado pelo jrubyc apartir de um .rb.</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">O Tutorial</h1>
<h2 style="color:#24f;font-weight:bold;font-family:'Segoe Print';">Importando um bytecode criado pelo jruby</h2>
<p>  Para importar um bytecode que foi criado a partir de um arquivo .rb utilizamos o já manjado require.</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:10px;">require 'path do bytecode'</pre>
<p>Obs.: Lembre-se de retirar a extensão do arquivo (.class), o certo seria fazer algo como &#8230;</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:10px;">require 'app/funcionario'</pre>
<p>&#8230; e não &#8230;</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:10px;">require 'app/funcionario.class'</pre>
<p>&#8230; o arquivo não será encontrado.</p>
<h2 style="color:#24f;font-weight:bold;font-family:'Segoe Print';">Importando bytecodes Java</h2>
<p>  Para importar classes Java utilizamos o método java_import, porém devemos ter o cuidado de antes requerer a biblioteca &#8220;java&#8221; que tem esse método.<br />
  Existem algumas fenomenos interessantes de serem destacadas ao importarmos um bytecode Java, por isso vamos criar uma classe Pessoa em Java e importar ela para dentro do JRuby.<br />
Primeiramente criaremos a classe Pessoa no java:</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:10px;">// Pessoa.java
public class Pessoa {
	private String nome;

	public Pessoa(String meuNome) {
		this.nome = meuNome;
	}

	public void setNome(String novoNome) {
		this.nome = novoNome;
	}

	public String getNome(){
		return this.nome;
	}

	public void seMostra(){
		System.out.println(this.getNome());
	}
}</pre>
<p>Agora iremos compilar o código fonte com o javac utilizando:</p>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:20px;">javac Pessoa.java</p>
<p>Teremos então o arquivo Pessoa.class. Vamos criar um arquivo testando_jruby.rb onde iremos testar essa classe:</p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:10px;"># testando_jruby.rb
require 'java' # o java_import faz parte desta biblioteca
java_import 'Pessoa' # Lembrando que no caso da classe
                            # estar num pacote, é necessário
                            # botar o nome completo da classe.

pessoa = Pessoa.new 'Hugo Roque'

# Observe que o nome do método no código Java é
# seMostra, porém o JRuby faz um alias para
# todos os métodos passando-os de Camelcase para
# Underscore case.
# Obs.: o método seMostra ainda existe.
pessoa.se_mostra 

# Observe que ao criarmos um setter
# para o nome(setNome), o JRuby criou
# o método nome= automaticamente.
# Obs.: Os métodos setNome e set_nome
# continuam existindo.
pessoa.nome = 'Nico Steppat' 

# Observe que ao criarmos um getter
# para o nome(getNome), o JRuby criou
# o método nome automaticamente
# Obs.: Os métodos getNome e get_nome
# continuam existindo.
puts pessoa.nome</pre>
<p>Ao executarmos isto, teremos como saida:</p>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:20px;">Hugo Roque<br />
Nico Steppat</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Concluindo</h1>
<p>Em breve, espero conseguir botar esse material na apostila RR-71 da caelum. =D</p>
<p>Qualquer dúvida, conselho, sugestão, chingamento, etc, contate através de um dos meios abaixo.<br />
Espero ter ajudado xD</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Créditos</h1>
<p><a href="http://kenai.com/projects/jruby/pages/Home">http://kenai.com/projects/jruby/pages/Home</a></p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Contato</h1>
<p><b>Twitter:</b> <a href="http://twitter.com/Hugolnx">http://twitter.com/Hugolnx</a><br />
<b>Github:</b> <a href="http://github.com/HugoLnx">http://github.com/HugoLnx</a><br />
<b>Email:</b> hugo.roque@caelum.com.br<br />
<b>Celular:</b> 8641-1271</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=38&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2010/07/18/importando-bytecodes-para-sua-aplicacao-jruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>
	</item>
		<item>
		<title>Compilando código JRuby para .class e rodando na JVM</title>
		<link>http://hugolnx.wordpress.com/2010/06/08/compilando-codigo-jruby-para-class-e-rodando-na-jvm/</link>
		<comments>http://hugolnx.wordpress.com/2010/06/08/compilando-codigo-jruby-para-class-e-rodando-na-jvm/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 04:31:11 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[JRuby]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[jruby java ruby compilar compilador JVM Java Virtual Machine]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=25</guid>
		<description><![CDATA[Introdução Olá a todos, como meu primeiro post útil oficial, irei mostrar como podemos, através do jruby, compilar nosso arquivo .rb para um .class, e depois faze-lo rodar direto na JVM. Compilando Vou utilizar esse código no exemplo&#8230; # /example.rb require 'java' java_import javax.swing.JFrame java_import javax.swing.JPanel java_import java.awt.Color java_import java.awt.BorderLayout java_import java.awt.Graphics java_import java.awt.Graphics2D java_import [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=25&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Introdução</h1>
<p>Olá a todos, como meu primeiro post útil oficial, irei mostrar como podemos, através do jruby, compilar nosso arquivo .rb para um .class, e depois faze-lo rodar direto na JVM.</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Compilando</h1>
<p>Vou utilizar esse código no exemplo&#8230; </p>
<pre style="background-color:white;font-family:'Lucida Console';display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:10px;">
# /example.rb
require 'java'

java_import javax.swing.JFrame
java_import javax.swing.JPanel

java_import java.awt.Color
java_import java.awt.BorderLayout
java_import java.awt.Graphics
java_import java.awt.Graphics2D
java_import java.awt.geom.Rectangle2D
java_import java.awt.geom.Line2D

class MyJPanel &lt; JPanel
	def paint_component(g)
		size = self.size
		g.color = Color::RED
		rc = Rectangle2D::Double.new(10,
                  10,
                  size.width - 20,
                  size.height - 20)
		g.fill rc
		g.color = Color::WHITE
		line = Line2D::Double.new(20,20,size.width,size.height)
		g.draw line
		g.draw_string &#039;This is a test!&#039;,100,150
	end
	alias paintComponent paint_component
end
frame = JFrame.new
frame.set_size(300,300)
frame.default_close_operation = JFrame::EXIT_ON_CLOSE
mp = MyJPanel.new
frame.content_pane.add(mp,BorderLayout::CENTER)
frame.visible = true
</pre>
<p>&#8230;que também está disponível no github(comentado) através do link&#8230;<br />
<a href="http://github.com/HugoLnx/JRuby-e-Swing-e-Grafico/blob/master/no_jruby.rb">http://github.com/HugoLnx/JRuby-e-Swing-e-Grafico/blob/master/no_jruby.rb</a></p>
<p>O JRuby vem com um compilador &#8220;rb to class&#8221; seu nome é jrubyc.<br />
Para compilar um arquivo .rb você deve escrever no console(no windows)&#8230;</p>
<p></br>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:20px;">jruby -S jrubyc example.rb</p>
<p></br></p>
<p>Pelo que eu li, em linux somente o jrubyc bastaria, porém não testei, no caso seria&#8230;</p>
<p></br>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:20px;">jrubyc example.rb</p>
<p></br></p>
<p>Ele dará uma mensagem dizendo q foi compilado para .class e pronto, seu código jruby está compilado em um .class, porém ele não roda na JVM igual a outros programas java, e isso se dá pelas características dinâmicas do ruby. </p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Rodando o .class</h1>
<p>Como foi dito antes, simplesmente escrever&#8230;</p>
<p></br>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:20px;">java example</p>
<p></br></p>
<p>&#8230;não vai funcionar, para que tudo funcione na perfeita paz do senhor (xD), é necessário que se &#8220;importe&#8221; o .jar do jruby, que pode ser baixado pelo link&#8230; <a href="http://jruby.org/download">http://jruby.org/download</a> (ele é o ultimo item, &#8220;JRuby x.x.x Complete.jar&#8221;). Aqui eu renomeei esse arquivo para &#8220;jruby.jar&#8221;. bote esse arquivo na mesma pasta que o seu .class e escreva&#8230; </p>
<p></br>
<p style="background-color:black;color:#36f;font-family:'Lucida Console';font-weight:bold;display:inline-block;border-color:#36f;border-style:solid;border-width:2px;padding:20px;">java -jar jruby.jar exemplo.class</p>
<p></br></p>
<p>&#8230; sim, é necessário ter o &#8220;.class&#8221; no final.<br />
Fazendo isso, tudo irá rodar perfeitamente =D</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Concluindo</h1>
<p>Qualquer dúvida, conselho, sugestão, chingamento, etc, contate através<br />
de um dos meios abaixo.xD<br />
Espero ter ajudado xD</p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Créditos</h1>
<p><a href="http://leandrosilva.com.br/2008/08/14/executar-jruby-a-partir-do-java/">http://leandrosilva.com.br/2008/08/14/executar-jruby-a-partir-do-java/</a><br />
<a href="http://kenai.com/projects/jruby/pages/JRubyCompiler">http://kenai.com/projects/jruby/pages/JRubyCompiler</a><br />
<a href="http://www.mouseoverstudio.com/blog/2008/08/29/interpretando-ruby-e-outras-linguagens-de-script-dentro-da-plataforma-java/">http://www.mouseoverstudio.com/blog/2008/08/29/interpretando-ruby-e-outras-linguagens-de-script-dentro-da-plataforma-java/</a></p>
<h1 style="color:#36f;font-weight:bold;font-family:'Segoe Print';">Contato</h1>
<p><b>Twitter:</b> <a href="http://twitter.com/Hugolnx">http://twitter.com/Hugolnx</a><br />
<b>Github:</b> <a href="http://github.com/HugoLnx">http://github.com/HugoLnx</a><br />
<b>Google:</b> <a href="http://www.google.com/profiles/hugoLnx">http://www.google.com/profiles/hugoLnx</a><br />
<b>Email:</b> hugolnx@gmail.com<br />
<b>Blog:</b> <a href="http://hugolnx.wordpress.com">http://hugolnx.wordpress.com</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=25&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2010/06/08/compilando-codigo-jruby-para-class-e-rodando-na-jvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>
	</item>
		<item>
		<title>Olá a todos xD</title>
		<link>http://hugolnx.wordpress.com/2010/06/07/ola-a-todos-xd/</link>
		<comments>http://hugolnx.wordpress.com/2010/06/07/ola-a-todos-xd/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 00:55:46 +0000</pubDate>
		<dc:creator>hugolnx</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hugolnx.wordpress.com/?p=9</guid>
		<description><![CDATA[Olá, bem vindos ao meu blog, criei ele depois que o anderson leite quase me deu uma surra por eu não ter. xD Tentarei sempre postar algo que eu esteja fazendo(principalmente de ruby xD), ou notícias que eu ache interessante, ou seja,  tudo que eu estiver sabendo pretendo informar por aqui.=D Hoje não dará tempo, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=9&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Olá, bem vindos ao meu blog, criei ele depois que o <a title="Anderson Leite" href="http://andersonleiteblog.wordpress.com/" target="_blank">anderson leite</a> quase me deu uma surra por eu não ter. xD</p>
<p>Tentarei sempre postar algo que eu esteja fazendo(principalmente de ruby xD), ou notícias que eu ache interessante, ou seja,  tudo que eu estiver sabendo pretendo informar por aqui.=D</p>
<p>Hoje não dará tempo, mas vo ver se logo amanhã posto uma tutorial de como compilar o arquivo .rb(em jruby) para um arquivo .class e roda-lo direto na JVM.xD</p>
<p>Enfim.. Por hoje é isso, espero que gostem do que eu postar aqui.xD</p>
<p>Obrigado e até mais =D</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hugolnx.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hugolnx.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/hugolnx.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/hugolnx.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hugolnx.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hugolnx.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hugolnx.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hugolnx.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hugolnx.wordpress.com&amp;blog=14070661&amp;post=9&amp;subd=hugolnx&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://hugolnx.wordpress.com/2010/06/07/ola-a-todos-xd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/edc49c0f3c5b5e50e7e2c8ade6d3d21b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hugolnx</media:title>
		</media:content>
	</item>
	</channel>
</rss>
