<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4800026411398402386</id><updated>2026-02-26T10:49:39.308-08:00</updated><category term="Ruby e Rails"/><category term="Noticias"/><category term="Java"/><category term="JSF"/><category term="Opinião"/><category term="Acessibilidade"/><category term="Jboss Seam"/><category term="Off-Topic"/><title type='text'>Casa Open</title><subtitle type='html'>O Casa Open é um blog sobre tecnologia, tendo seu maior foco na linguagem de programação Ruby e no framework Ruby on Rails</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-2281905005935651617</id><published>2023-10-24T11:32:00.007-07:00</published><updated>2023-10-24T12:45:03.087-07:00</updated><title type='text'>SOLICITUD DE BORRADO DE CUENTA Y DATOS</title><content type='html'>&lt;p&gt;Si desea eliminar sus datos de las aplicaciones de Sport Place, envíe un correo electrónico a sportplaceargentina@gmail.com&amp;nbsp;informando su dirección de correo electrónico registrada para que podamos tomar las medidas necesarias.&lt;/p&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/2281905005935651617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/2281905005935651617'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2023/10/solicitud-de-borrado-de-cuenta-y-datos.html' title='SOLICITUD DE BORRADO DE CUENTA Y DATOS'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-7256300284799642700</id><published>2013-02-07T15:49:00.000-08:00</published><updated>2013-09-27T18:01:38.362-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Jboss Seam"/><category scheme="http://www.blogger.com/atom/ns#" term="JSF"/><title type='text'>O que ganho usando Jboss Seam?</title><content type='html'>&lt;i&gt;&lt;b&gt;Texto direcionado a usuários do JSF 1.2 tratando do uso do Jboss Seam 2.x.&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para quem não conhece, o Seam é um&amp;nbsp;framework destinado ao desenvolvimento WEB criado pelo mesmo criador do Hibernate, Gavin King, e que tem como um de seus principais objetivos facilitar a integração entre&amp;nbsp;JSF e EJB3.&lt;br /&gt;
&lt;br /&gt;
Muitos são os ganhos obtidos pelo uso do Seam, dentre estes irei me ater aos seguintes:&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Menos XMLs&lt;/li&gt;
&lt;li&gt;Requisições por GET&lt;/li&gt;
&lt;li&gt;Facilidade na utilização de ComboBox&lt;/li&gt;
&lt;li&gt;Injeção de Dependências via anotações&lt;/li&gt;
&lt;li&gt;Facilidade no envio de e-mails&lt;/li&gt;
&lt;li&gt;Agendamento de tarefas&lt;/li&gt;
&lt;li&gt;URL user friendly&lt;/li&gt;
&lt;li&gt;Suporte a transações&lt;/li&gt;
&lt;li&gt;Integração com Groovy, Hibernate, Spring, entre outros&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Para não estender muito, neste post irei falar dos três primeiros. Falarei dos demais em posts futuros.&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;1. Menos XMLs&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
O Seam diminui a utilização de XML em vários aspectos, como por exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1.1. Navegação&lt;/b&gt;&lt;br /&gt;
Usando apenas o JSF 1.2, a navegação entre páginas deve ser definida via XML, no arquivo&amp;nbsp;faces-config.xml, e usada por meio de um método no Managed Bean que retorne um String de saída configurada no faces-config.xml. Conforme o exemplo abaixo:&lt;br /&gt;
&lt;br /&gt;
faces-config.xml:&lt;br /&gt;
&lt;pre class=&quot;brush: xml; gutter: false;  toolbar: false;&quot;&gt;&amp;lt;navegation-rule&amp;gt;
&amp;nbsp; &amp;lt;from-view-id&amp;gt;/person/people.xhtml&amp;lt;/from-view-id&amp;gt; 
&amp;nbsp; &amp;lt;navegation-case&amp;gt; 
&amp;nbsp; &amp;nbsp; &amp;lt;from-outcome&amp;gt;edit&amp;lt;/from-outcome&amp;gt; 
&amp;nbsp; &amp;nbsp; &amp;lt;to-view-id&amp;gt;/person/edit.xhtml&amp;lt;/to-view-id&amp;gt; 
&amp;nbsp; &amp;lt;/navegation-case&amp;gt; 
&amp;lt;/navegation-rule&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
Managed Bean:&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;public String editPeople() {
&amp;nbsp; return &quot;edit&quot;;
}
&lt;/pre&gt;
&lt;br /&gt;
Com o Seam, isso pode ser feito de forma mais simples, apenas retornando o nome da página no&amp;nbsp;método do Managed Bean.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;public String editPeople() {
&amp;nbsp;&amp;nbsp; return &quot;/person/edit.xhtml&quot;;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;1.2 Registro de Managed Beans&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Para que cada Managed Bean seja utilizado nas views do JSF é necessário que este esteja registrado no faces-config.xml, como mostrado abaixo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml; gutter: false;  toolbar: false;  highlight: [6, 7,8,9,10]&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
  &amp;lt;faces-config version=&quot;1.2&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot;
    xmlns:xi=&quot;http://www.w3.org/2001/XInclude&quot;
    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;htt      p://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&quot;&amp;gt;

  &amp;lt;managed-bean&amp;gt;
    &amp;lt;managed-bean-name&amp;gt;people&amp;lt;/managed-bean-name&amp;gt;
    &amp;lt;managed-bean-class&amp;gt;br.com.People&amp;lt;/managed-bean-class&amp;gt;
    &amp;lt;managed-bean-scope&amp;gt;request&amp;lt;/managed-bean-scope&amp;gt;
  &amp;lt;/managed-bean&amp;gt;

&amp;lt;/faces-config&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
Com o Seam, basta que o bean seja declarado como um componente do Seam, por meio da anotação @Name. Deste modo, o bean passar a ser gerenciado pelo Seam. Ou seja, além de ser um Managed Bean, também é um Seam Component.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;@Name(&quot;people&quot;)
public class&amp;nbsp;People {
&amp;nbsp; //...
}&lt;/pre&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;br /&gt;
&lt;b&gt;2.&amp;nbsp;Requisições por GET&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; O JSF 1.2 não lida bem com parâmetros GET. Não que seja impossível &quot;capturar&quot; tais parâmetros, mas é trabalhoso e não natural. Veja o seguinte exemplo que apresenta uma forma recuperar o parâmetro &quot;id&quot; passado por GET no bean:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;String id = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(&quot;id&quot;)); &amp;nbsp; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
O Seam facilita muito esse trabalho fazendo &quot;bind&quot; dos parâmetros GET por meio da anotação&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;@RequestParameter:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;@RequestParameter
private Long id = null;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;3. Facilidade na utilização de ComboBox&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;   Imagine a seguinte situação: você pretende apresentar ao usuário um ComboBox com as regiões do Brasil onde cada região possui um id e um nome. Para você, é importante saber o id da região escolhida pelo usuário. Para o usuário, é importante escolher a região pelo nome, não pelo id.&lt;br /&gt;
Para resolver isso no JSF é necessário criar um mapa que contenha os nomes e os ids semelhante a esse:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;public class MostraRegioes {

&amp;nbsp; public Map&amp;lt;String, Regioes&amp;gt; getRegioes(){
&amp;nbsp; &amp;nbsp; Map&amp;lt;String, Regioes&amp;gt; regioes = new HashMap&amp;lt;String, Regioes&amp;gt;();
&amp;nbsp; &amp;nbsp; for(Regioes r : Regioes.values()) {
&amp;nbsp; &amp;nbsp; &amp;nbsp; regioes.put(r.getNome(), 1);
&amp;nbsp; &amp;nbsp; }
&amp;nbsp; &amp;nbsp; return regioes;
&amp;nbsp; }

}

&lt;/pre&gt;
&lt;br /&gt;
E usá-lo da seguinte forma:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml; gutter: false;  toolbar: false;&quot;&gt;&amp;lt;h:selectOneMenu&amp;gt;
&amp;nbsp; &amp;lt;f:selectItems value=&quot;#{MostraRegioes.regioes}&quot;/&amp;gt;
&amp;lt;/h:selectOneMenu&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
O que não é produtivo quando temos um sistema com muitos combos. Pois teríamos que fazer um método &amp;nbsp;(convertendo de lista ou Array para um mapa ou List&amp;lt;SelectItems&amp;gt;) &amp;nbsp;para cada combo. Felizmente o Seam ajuda nisso com o componente &amp;lt;s:selectItems /&amp;gt; que faz binding com uma lista/array comum. Veja:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: xml; gutter: false;  toolbar: false;&quot;&gt;&amp;lt;h:selectOneMenu&amp;gt;
&amp;nbsp; &amp;lt;s:selectItems value=&quot;#{MostraRegioes.regioes}&quot;
&amp;nbsp; &amp;nbsp; var=&quot;regiao&quot; label=#{regiao.nome}&quot;/&amp;gt;
&amp;lt;/h:selectOneMenu&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;display: none;&quot;&gt;
&lt;a href=&quot;http://www.guj.com.br/java/220439-qual-a-diferenca-do-jsf12-para-jsf20&quot;&gt;http://www.guj.com.br/java/220439-qual-a-diferenca-do-jsf12-para-jsf20&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.guj.com.br/java/266058-com-o-jee-6-o-que-justifica-o-uso-do-jboss-seam&quot;&gt;http://www.guj.com.br/java/266058-com-o-jee-6-o-que-justifica-o-uso-do-jboss-seam&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.guj.com.br/java/250717-jsf---parametros-via-get-resolvido&quot;&gt;http://www.guj.com.br/java/250717-jsf---parametros-via-get-resolvido&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/7256300284799642700/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2013/02/vatangens-seam.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7256300284799642700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7256300284799642700'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2013/02/vatangens-seam.html' title='O que ganho usando Jboss Seam?'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-7347142932334778696</id><published>2013-01-22T14:44:00.000-08:00</published><updated>2013-09-27T18:39:06.982-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JSF"/><title type='text'>Criando validadores personalizados no JSF</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;validador-jsf&quot; border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4HsWgxoSiBNb8O_Hk6TbkIfUT5KBIQeK6f77TWFI2T3jFxA05nMjadUiftpDVNV2jOcePa0aoU_Ie0tXQkovpQA9_qb6l2wvu3dnwZJnzkYCvocQCQ17omD9oa5N_F9CIRKYPWvFvKQ/s320/validador-jsf.jpg&quot; width=&quot;320&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Cortando as introduções e indo direto ao assunto, no JSF você pode trabalhar com &amp;nbsp;dois grupos de validadores de dados: os existentes (que são fornecidos pelo JSF) e os personalizados (que são os criados por você). Os existentes validam algumas características de dados, tais como: tamanho de campos, limites, entre outras. Mas, como é de se esperar, várias características não são abrangidas. Em vista disso, a possibilidade de criar validadores personalizados é uma boa saída fornecida pelo JSF.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Criando um validador&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Criar um validador em JSF é simples. Para tal, basta sobrescrever o método validade(), por meio de uma classe que estenda a interface javax.faces.validator.Validator, e registrá-lo no contexto do JSF. Vejamos um exemplo de validação de e-mail.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;1. Criando o validador&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;public void validateEmail(FacesContext context, UIComponent toValidate, Object value) {
  String email = (String) value;
  if (email.indexOf(&#39;@&#39;) == -1) {
   ((UIInput) toValidate).setValid(false);
   FacesMessage message = new FacesMessage(&quot;Invalid Email&quot;);
   context.addMessage(toValidate.getClientId(context), message);
  }
 }

&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;2. Registrando o validador&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Para registrar o validador, basta indicá-lo no Faces-config, conforme o exemplo abaixo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;&lt;validator&gt;
 &amp;lt;h:inputText id=&quot;email&quot; value=&quot;#Bean.user.email}&quot;
  validator=&quot;#{validateEmail}&quot; required=&quot;true&quot;/&amp;gt;
&lt;validator-class&gt;
 &lt;/validator-class&gt;
&lt;/validator&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;3. Usando o validador&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Tendo criado e registrado o validador, basta usa-lo por meio do marcador &amp;lt;f:validator .../&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;&lt;h:inputtext id=&quot;email&quot; required=&quot;true&quot; validator=&quot;#{validateEmail}&quot; value=&quot;#Bean.user.email}&quot;&gt;
&lt;/h:inputtext&gt;
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/7347142932334778696/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2013/01/criando-validadores-personalizados-jsf.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7347142932334778696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7347142932334778696'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2013/01/criando-validadores-personalizados-jsf.html' title='Criando validadores personalizados no JSF'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhU4HsWgxoSiBNb8O_Hk6TbkIfUT5KBIQeK6f77TWFI2T3jFxA05nMjadUiftpDVNV2jOcePa0aoU_Ie0tXQkovpQA9_qb6l2wvu3dnwZJnzkYCvocQCQ17omD9oa5N_F9CIRKYPWvFvKQ/s72-c/validador-jsf.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-3567511788189614279</id><published>2012-12-28T04:36:00.002-08:00</published><updated>2013-09-27T18:39:25.814-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JSF"/><title type='text'>Ciclo de vida JSF</title><content type='html'>Um dos fundamentos de maior relevância do JSF é seu ciclo de vida que se dá entre requisição e &amp;nbsp;resposta do servidor de aplicação. São vários os motivos da existência deste ciclo, dentre estes, temos:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Manter o&amp;nbsp;&lt;b&gt;controle de estado &lt;/b&gt;dos componentes de interface&lt;b&gt;;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Alinhar &lt;b&gt;ouvintes de eventos&lt;/b&gt; com seus respectivos eventos;&lt;/li&gt;
&lt;li&gt;Controle de &lt;b&gt;navegação&lt;/b&gt; entre páginas, que deve ser realizado pelo servidor;&lt;/li&gt;
&lt;li&gt;Permitir que &lt;b&gt;validações e conversões&lt;/b&gt; sejam realizadas no lado do servidor.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Indo direto ao assunto, o ciclo de vida do JSF se divide em 6 fases (veja a figura abaixo), que são:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4800026411398402386#fase1&quot;&gt;&lt;b&gt;Fase 1&lt;/b&gt;: Restore View (Restauração da Visão)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4800026411398402386#fase2&quot;&gt;&lt;b&gt;Fase 2&lt;/b&gt;: Apply Request Values (Aplicar Valores da Requisição)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4800026411398402386#fase3&quot;&gt;&lt;b&gt;Fase 3&lt;/b&gt;: Process Validation (Processar as Validações)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4800026411398402386#fase4&quot;&gt;&lt;b&gt;Fase 4&lt;/b&gt;: Update Model Values (Atualizar Valores de Modelo)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4800026411398402386#fase5&quot;&gt;&lt;b&gt;Fase 5&lt;/b&gt;: Invoke Application (Invocar Aplicação)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4800026411398402386#fase6&quot;&gt;&lt;b&gt;Fase 6&lt;/b&gt;: Render Response (Renderizar a Resposta)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;Ciclo devida JSF&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdiLLeEse6aCeisFDysEZqQxkzmJUCDVoQvVg4XRyQd3u4_kPrpbjTZPKAsqR5BQ8tlOoDYOCyrBkurGTUdc3ywfDD7jQAc_yiaKAjWCMZHQethF1ci_aAIW7Ji2SKiE6XIdfSGY7CCug/s1600/fases+JSF.gif&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td alt=&quot;Ciclo de vida do JSF&quot; class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Ciclo de vida do JSF&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Vejamos agora o que acontece em cada uma.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div id=&quot;fase1&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fase 1: Restore View (Restauração da Visão)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
A partir de uma requisição proveniente do servlet FacesServlet, é identificado qual visão está sendo requisitada por meio do ID desta que é determinado pelo nome da página JSP. Tendo identificado a página, esta é salva no FacesContext (caso ainda não tenha sido salva) e sua respectiva árvore de componentes é construída.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;fase2&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fase 2: Apply Request Values (Aplicar Valores da Requisição)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Nesta fase, cada componente da visão, criado ou recuperado, passa a ter o seu valor. Nesse contexto, existem algumas diferenças ocasionadas pelo valor do atributo &quot;immediate&quot; em cada componente:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;immediate = false&lt;/b&gt;: Neste caso, que é o padrão, os valores são apenas convertidos para o tipo apropriado. Se o valor é um Integer, é convertido para Integer.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;immediate = true&lt;/b&gt;: Os valores são convertidos e validos.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;fase3&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fase 3: Process Validation (Processar as Validações)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Esta é a primeira manipulação de eventos do ciclo, aqui serão executadas as validações definidas pelo servidor em cada componente. Não existindo valores inválidos, o ciclo segue para a Fase 4. Existindo, uma mensagem de erro será gerada (adicionada ao contexto do Faces, FacesContext) e o componente é marcado como inválido. Neste caso, o ciclo segue para a Fase 6 (Renderizar a resposta).&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;fase4&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fase 4: Update Model Values (Atualizar Valores de Modelo)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Os valores enviados pela requisição e validados pela fase 3, são atualizados em seus respectivos atributos contidos nos backings beans, onde somente as propriedades enviadas são atualizadas. É importante dizer que, mesmo após a fase de validação, fase 3, os valores enviados podem estar inválidos a nível de negócio ou a nível de conversão de tipos, o que pode ser verificado pelo próprio bean.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;fase5&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fase 5: Invoke Application (Invocar Aplicação)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Nesta fase, os valores dos componentes da requisição, estão validados convertidos e disponíveis nos backings beans. Assim a aplicação tem os insumos necessários para aplicar a lógica de negócio.&lt;br /&gt;
Outro fator importante dessa fase, é o direcionamento do usuário de acordo com as submissões realizadas pelo mesmo. Por exemplo, se ouve sucesso no processamento dos dados enviados, o usuário é redirecionado para uma determinada página, se não, permanece na mesma página.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;fase6&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Fase 6: Render Response (Renderizar a Resposta)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
O processo o Renderizar a Resposta consiste na apresentação da página referente ao resultado da aplicação ao usuário. Neste contexto existem três possibilidades:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Caso seja&amp;nbsp;a&amp;nbsp;primeira requisição da página: Os componentes associados são criados e associados a visão;&lt;/li&gt;
&lt;li&gt;Caso seja a primeira submissão: Os componentes são traduzidos para o HTML;&lt;/li&gt;
&lt;li&gt;Caso tenha ocorrido algum erro:&amp;nbsp;Existindo os marcadores &amp;lt;f:message /&amp;gt; ou &amp;lt;f:messages /&amp;gt;&amp;nbsp;na página, os erros são exibidos ao usuário.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;Visão Geral&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
No desenvolvimento em JSF existem dois perfis diferentes de desenvolvedores: os que desenvolveram aplicações JSF e os que desenvolveram componentes. No primeiro perfil, as fases de maior foco são a 2, 3, 4 e 5. Já no segundo, são a 1 e 6, que estão mais relacionadas a&amp;nbsp;árvore de componentes no lado do servidor e de componentes da visão. Sendo assim podemos agrupar as fases da seguinte forma:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Fases focadas no desenvolvimento&amp;nbsp;de aplicações JSF&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Fase 2&lt;/b&gt;: Apply Request Values (Aplicar Valores da Requisição)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Fase 3&lt;/b&gt;: Process Validation (Processar as Validações)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Fase 4&lt;/b&gt;: Update Model Values (Atualizar Valores de Modelo)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Fase 5&lt;/b&gt;: Invoke Application (Invocar Aplicação)&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Fases focadas no desenvolvimento&amp;nbsp;de componentes de visão&lt;/b&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Fase 1&lt;/b&gt;: Restore View (Restauração da Visão)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Fase 6&lt;/b&gt;: Render Response (Renderizar a Resposta)&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/3567511788189614279/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2012/12/ciclo-de-vida-jsf.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/3567511788189614279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/3567511788189614279'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2012/12/ciclo-de-vida-jsf.html' title='Ciclo de vida JSF'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdiLLeEse6aCeisFDysEZqQxkzmJUCDVoQvVg4XRyQd3u4_kPrpbjTZPKAsqR5BQ8tlOoDYOCyrBkurGTUdc3ywfDD7jQAc_yiaKAjWCMZHQethF1ci_aAIW7Ji2SKiE6XIdfSGY7CCug/s72-c/fases+JSF.gif" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-5817759423970764225</id><published>2012-12-17T13:12:00.001-08:00</published><updated>2013-09-27T18:41:36.282-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JSF"/><title type='text'>O padrão MVC segundo o JSF</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;O que MVC?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
O padrão MVC, de modo geral, divide uma aplicação em três camadas: modelo, visão e controle. A visão é responsável por apresentar a interface ao usuário. O modelo, pela representação dos objetos do negócio e fornecimento de acesso aos dados do negócio. E o controle define o comportamento da aplicação interpretando as ações de modo a realizar as devidas chamadas ao modelo. De modo simplificado, é dito que o controle fornece uma ligação entre visualização e modelo.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Esse padrão contribui para uma melhor separação de tarefas em uma equipe de desenvolvedores. Pois, tendo a aplicação separada por camadas, é mais fácil direcionar pessoas com habilidades diferentes para se concentrarem em partes diferentes do código.&lt;br /&gt;
&lt;br /&gt;
Veja o diagrama abaixo&amp;nbsp;que demostra a relação entre modelo, visão e controle onde as linhas sólidas indicam associação direta e as tracejadas indicam associação indireta.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;img alt=&quot;Diagrama do modelo MVC&quot; border=&quot;0&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/ModelViewControllerDiagram2.svg/220px-ModelViewControllerDiagram2.svg.png&quot; /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;O que é JSF?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
O JavaServer Faces (JSF), é uma especificação do framework MVC Java&amp;nbsp;padrão&amp;nbsp;que tem como principal objetivo simplificar a construção de componentes de interface gráfica para aplicações web.&lt;br /&gt;
&lt;br /&gt;
Desenvolvido pela&amp;nbsp;&amp;nbsp;Java Community Process (JCP), tem como uma de suas características mais relevantes a presença do modelo de componentes, semelhante ao que acontece no desenvolvimento Desktop. Essa orientação tende a facilitar o reuso pois, além dos vários componentes já existentes, é possível criar novos componentes.&lt;br /&gt;
&lt;br /&gt;
Outras características marcantes são a existência de validadores e conversores de dados (facilitando a manipulação de tais), navegabilidade entre páginas oferecida por arquivos de configuração, suporte a internacionalização, entre outras.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;MVC no JSF&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
No&amp;nbsp;JavaServer Faces, o controle fica por conta de um servlet chamado Faces Servlet, por arquivos de configuração (ex.: faces-config.xml), pelos Backing Beans e pelos validadores e conversores. O Faces&amp;nbsp;Servlet&amp;nbsp;se designa a receber requisições, encaminhá-las ao modelo e enviar as respectivas repostas. Os arquivos de configuração são responsáveis por definirem a navegação entre páginas e o mapeamento de ações. Já os validadores e conversores permitem um maior controle sobre os dados que serão enviados. Importante ressaltar que, mesmo sendo referenciados nas páginas, os conversores e validadores fazem parte do processamento de eventos, logo também fazem parte do controlador e não da visão.&lt;br /&gt;
&lt;br /&gt;
O modelo é constituído por classes de entidade e de negócio, que por sua vez, recebem dados da camada de visualização e executam regras pertinentes ao negócio.&lt;br /&gt;
&lt;br /&gt;
Já a visualização, remete ao que o usuário vê, ou seja: a interface - páginas JSP e kits renderizadores (HTML, WML, XML, etc.). Mas, como o JSF se utiliza de componentes, pode se dizer que esta é composta por uma hierarquia de componentes organizados.&lt;br /&gt;
&lt;br /&gt;
De modo simplificado, o MVC em aplicações web é distribuído da seguinte forma:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Visão&lt;/b&gt;:&lt;br /&gt;
• Componentes UI em páginas JSP/XHTML&lt;br /&gt;
• Kits renderizadores (HTML, WML, XML, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Controlador&lt;/b&gt;:&lt;br /&gt;
• Faces Servlet (Front Controller)&lt;br /&gt;
• Backing Bean (Page Controller ou Modelo)&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Modelo&lt;/b&gt;:&lt;br /&gt;
•&amp;nbsp;entidades e regras de negócio&lt;br /&gt;
• Objetos gerais da aplicação (dados, etc.)&lt;br /&gt;
&lt;br /&gt;
&lt;!--

Deseja aprofundar no assunto? Recomendo os seguintes links:

&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.guj.com.br/java/72237-jsf-x-mvc&quot;&gt;http://www.guj.com.br/java/72237-jsf-x-mvc&lt;/a&gt;&amp;nbsp;( importante)&lt;br /&gt;
&lt;a href=&quot;http://blog.pucp.edu.pe/item/4825/model-view-controler-jsf&quot;&gt;http://blog.pucp.edu.pe/item/4825/model-view-controler-jsf&lt;/a&gt;&lt;br /&gt;
imagem&amp;nbsp;&lt;a href=&quot;http://download.ultradownloads.com.br/wallpaper/169119_Papel-de-Parede-Quebra-cabeca_1600x1200.jpg&quot;&gt;http://download.ultradownloads.com.br/wallpaper/169119_Papel-de-Parede-Quebra-cabeca_1600x1200.jpg&lt;/a&gt;&lt;/div&gt;
--&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/5817759423970764225/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2012/12/jsf-mvc.html#comment-form' title='5 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/5817759423970764225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/5817759423970764225'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2012/12/jsf-mvc.html' title='O padrão MVC segundo o JSF'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-3206785087774065116</id><published>2012-11-07T15:44:00.001-08:00</published><updated>2013-09-27T18:44:06.913-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Removendo acentos de String no Java</title><content type='html'>Você programa a mais de um mês? Se sim, é provável que já precisou retirar acentos de um String. Para isso, existe a forma feia, chata e antipática de fazer (que por sinal é a que mais vejo) e a forma bonita e elegante (que raramente vejo).&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;Forma feia, chata e antipática&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;public String removeAcentos (String string){  
      string = string.replaceAll(&quot;[ÂÀÁÄÃ]&quot;,&quot;A&quot;);  
      string = string.replaceAll(&quot;[âãàáä]&quot;,&quot;a&quot;);  
      string = string.replaceAll(&quot;[ÊÈÉË]&quot;,&quot;E&quot;);  
      string = string.replaceAll(&quot;[êèéë]&quot;,&quot;e&quot;);  
      string = string.replaceAll(&quot;ÎÍÌÏ&quot;,&quot;I&quot;);  
      string = string.replaceAll(&quot;îíìï&quot;,&quot;i&quot;);  
      string = string.replaceAll(&quot;[ÔÕÒÓÖ]&quot;,&quot;O&quot;);  
      string = string.replaceAll(&quot;[ôõòóö]&quot;,&quot;o&quot;);  
      string = string.replaceAll(&quot;[ÛÙÚÜ]&quot;,&quot;U&quot;);  
      string = string.replaceAll(&quot;[ûúùü]&quot;,&quot;u&quot;);  
      string = string.replaceAll(&quot;Ç&quot;,&quot;C&quot;);  
      string = string.replaceAll(&quot;ç&quot;,&quot;c&quot;);   
      string = string.replaceAll(&quot;[ýÿ]&quot;,&quot;y&quot;);  
      string = string.replaceAll(&quot;Ý&quot;,&quot;Y&quot;);  
      string = string.replaceAll(&quot;ñ&quot;,&quot;n&quot;);  
      string = string.replaceAll(&quot;Ñ&quot;,&quot;N&quot;);  
      return string;  
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&amp;nbsp;Forma bonita e elegante&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: java; gutter: false;  toolbar: false;&quot;&gt;public static String removeAcentos(String string) {
    if (string != null){
        string = Normalizer.normalize(string, Normalizer.Form.NFD);
        string = string.replaceAll(&quot;[^\\p{ASCII}]&quot;, &quot;&quot;);
    }
    return string;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
PS. Na verdade existem várias formas de fazer isso.</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/3206785087774065116/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2012/11/removendo-acentos-java.html#comment-form' title='4 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/3206785087774065116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/3206785087774065116'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2012/11/removendo-acentos-java.html' title='Removendo acentos de String no Java'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-4078223775378397890</id><published>2012-04-13T11:03:00.000-07:00</published><updated>2013-09-27T18:42:10.009-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Acessibilidade"/><title type='text'>Por que devo estudar Acessibilidade Digital?</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Ao se falar em acessibilidade logo 
vem a mente a palavra acesso. E realmente acesso tem tudo a ver com 
acessibilidade. Mas, o que se pode entender por acessibilidade? Quais 
são suas primícias? Seus benefícios? Por que profissionais de TI devem estudá-la? É 
exatamente em respostas a essas perguntas que esse texto é direcionado.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIdMwUunz1qUXtW_lemq8aE-huhUpvkCnqC44Hj_EyNk8SI3GsZ9xmgDM3KT-qK8wEIZFIRHX25iTTBUSoUbvbFErUeUlF8RYjKK_CKIi1FA_m0uYumpaJjLv-lVPEvcvxZALOVt6n6dY/s1600/charles_chaplin.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Imagem do Chaplin caido com a bengala na mão e de patins&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIdMwUunz1qUXtW_lemq8aE-huhUpvkCnqC44Hj_EyNk8SI3GsZ9xmgDM3KT-qK8wEIZFIRHX25iTTBUSoUbvbFErUeUlF8RYjKK_CKIi1FA_m0uYumpaJjLv-lVPEvcvxZALOVt6n6dY/s1600/charles_chaplin.jpg&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;Imagem do Chaplin &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;caído &lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;com a bengala na mão e de patins&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;O que é Acessibilidade Digital?&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Primeiramente é importante dizer que Acessibilidade está relacionada em fornecer condição para utilização, com segurança e autonomia, total ou assistida, dos espaços, mobiliários e equipamentos urbanos, das edificações, dos serviços de transporte, dos dispositivos, sistemas e meios de comunicação e informação, por qualquer pessoa. De forma análoga, Acessibilidade Digital remete a Acessibilidade no ambiente virtual sendo que Acessibilidade na Web significa que qualquer pessoa, utilizando qualquer tipo de tecnologia de navegação - navegadores gráficos, textuais, especiais para sistemas de computação móvel, etc. - deve ser capaz de visitar e interagir com qualquer site, compreendendo inteiramente as informações nele apresentadas. (DIAS, Cláudia. Usabilidade na Web - criando portais mais acessíveis. RJ: Alta Books, 2003). Em sua concepção inicial, acessibilidade estava ligada a indivíduos portadores de deficiência, entretanto sua amplitude tem se estendido a qualquer barreira que possa&amp;nbsp;inviabilizar&amp;nbsp;o acesso a qualquer pessoa. Diante disso, vejamos agora alguns dos motivos que impelem o estudo da acessibilidade por parte dos&amp;nbsp;profissionais de TI.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Grande número de pessoas com deficiência&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Segundo o IBGE (Instituto Brasileiro de Geografia e Estatística) por meio do censo realizado no ano 2000 a população brasileira possui 14,5% de portadores de deficiência. Destes, 48,1% (que constituem 16,6 milhões) são deficientes visuais e 150 mil se declaram cegos, 27,1% com deficiência física, 16,6% com deficiência mental e 8,2% com deficiência auditiva.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Maior visibilidade no Google&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
É de conhecimento que diversos buscadores, dentre eles o Google, levam em consideração a organização do conteúdo das páginas web. Por exemplo, se uma página apresenta imagens sem texto alternativos (tag alt), conteúdo não estruturado de acordo com o grau de importância (tags title, h1,h2,h3..), frames sem página alternativa (através do elemento &quot;noframe&quot;) e etc, essa página tende a ser classificada com menor relevância em comparação a outra que segue os padrões de acessibilidade. Ou seja, uma boa acessibilidade também contribui para uma boa visibilidade em sistemas de busca.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Valorização da cauda longa&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Não é intuito deste texto o aprofundamento no estudo da Cauda Longa mas, de forma simplificada, podemos dizer que Cauda Longa remete a força das minorias. Considerando que um pequeno grupo insolado tende a não ser muito relevante, em relação ao todo. Entretanto um conjunto de pequenos grupos possui uma relevância significativa. Esse conceito ganhou força com a expansão da internet e é baseado nisto que muitas lojas virtuais estão se sobressaindo (a Amazon.com é uma prova disso), pois também disponibilizam produtos dedicados as minorias. Mas o que quero dizer com isto? Quero dizer que se você atender somente a população de deficientes auditivos talvez seu retorno não seja expressivo, mas atendendo a população de deficientes auditivos, visuais, físicos... a probabilidade de retorno expressivo pode crescer consideravelmente.&lt;span style=&quot;font-size: large;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgve8Rf3MlZv_O4Oghe3akyyXntUfGY5gGrpdWJOKZKUPktEoIXyX5SaOEEKQ-g0JJeK3im3e2KnjmaSPIYep_lG7dc-TNJCbMYL1OnPX04xW0BlpaCwdVgNaEsQuEIy3C6XOfi-yhW-zg/s1600/cauda_longa.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Gráfico da calda longa&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgve8Rf3MlZv_O4Oghe3akyyXntUfGY5gGrpdWJOKZKUPktEoIXyX5SaOEEKQ-g0JJeK3im3e2KnjmaSPIYep_lG7dc-TNJCbMYL1OnPX04xW0BlpaCwdVgNaEsQuEIy3C6XOfi-yhW-zg/s1600/cauda_longa.jpg&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;Imagem retirada do artigo &quot;O que é Web 2.0?&quot; acessado em&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;http://www.divulgardinheiro.com/divulgar-gratis-internet/internet-marketing/o-que-e-web-2-0/&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Conformidade com o decreto de lei 5296&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
O Decreto-lei 2596 de 2 de dezembro de 2004, também conhecido como Lei de Acessibilidade, tem por finalidade regulamentar o atendimento a indivíduos com deficiência em diversos aspectos, dentre estes o de comunicação e informação. Sendo que portais e sites da administração pública são obrigados a se tornarem acessíveis para o uso das pessoas portadoras de deficiência visual. Logo, se você trabalha em projetos web para o governo, estes projetos devem ser acessíveis.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Proteção contra processos&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
O primeiro caso oficial de processo motivado por acessibilidade digital foi direcionado ao&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #fafaea; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Arial, Verdana, sans-serif; font-size: 14px; line-height: 21px; text-align: left; text-indent: 42px;&quot;&gt;Comitê de Organização dos Jogos Olímpicos de Sydney. Na ocasião&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;en&quot; style=&quot;background-color: #fafaea; font-family: &#39;Trebuchet MS&#39;, Trebuchet, Arial, Verdana, sans-serif; font-size: 14px; line-height: 21px; text-align: left; text-indent: 42px;&quot; xml:lang=&quot;en&quot;&gt;Bruce Lindsay Maguire processou o comitê pela falta de acessibilidade em seu site. Fato é que atualmente v&lt;/span&gt;ários países possuem leis específicas que tratam a questão da acessibilidade: na Inglaterra existe a DDA, nos EUS a ADA e a Seção 508, e na Austrália a DDA. Assim sendo, seguir os padrões de acessibilidade reduz significavelmente o risco de eventuais processos.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Conclusão&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A acessibilidade digital tem ganhado força nos últimos anos e tudo leva a  crer que este é um caminho sem volta. P&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;articularmente&lt;/span&gt;&amp;nbsp;acredito que, de forma semelhante ao crescimento das políticas de sustentabilidade, salvo as devidas proporções, acessibilidade&amp;nbsp;chegará a um patamar de&amp;nbsp;relevância&amp;nbsp;significante. De modo que é&amp;nbsp;impraticável&amp;nbsp;ignorar as&amp;nbsp;consequências&amp;nbsp;e implicações que tão assunto sugere.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/4078223775378397890/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2012/04/porque-estudar-acessibilidade-digital.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/4078223775378397890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/4078223775378397890'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2012/04/porque-estudar-acessibilidade-digital.html' title='Por que devo estudar Acessibilidade Digital?'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIdMwUunz1qUXtW_lemq8aE-huhUpvkCnqC44Hj_EyNk8SI3GsZ9xmgDM3KT-qK8wEIZFIRHX25iTTBUSoUbvbFErUeUlF8RYjKK_CKIi1FA_m0uYumpaJjLv-lVPEvcvxZALOVt6n6dY/s72-c/charles_chaplin.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-223724582856480952</id><published>2011-02-11T04:13:00.000-08:00</published><updated>2013-09-27T18:48:11.467-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Noticias"/><title type='text'>Você &quot;vai&quot; ao Ruby Masters Conf?</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;a href=&quot;http://rubymastersconf.com/&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Ruby Masters Conf - Edição 2011&quot; height=&quot;175&quot; src=&quot;http://rubymastersconf.com/images/banner-02.png&quot; title=&quot;Ruby Masters Conf - Edição 2011&quot; width=&quot;270&quot; /&gt;&lt;/a&gt; &lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A Ruby Masters Conf foi uma das iniciativas mais legais que vi&amp;nbsp;recentemente&amp;nbsp;na comunidade Ruby. Ela se trata de um conjunto de palestras &amp;nbsp;que serão transmitidas on-line nos dias 25 e 26 de fevereiro de 2011 onde toda a renda será revertida para dois projetos: o &lt;a href=&quot;http://rubyinstaller.org/&quot;&gt;RubyInstaller&lt;/a&gt; - &amp;nbsp;que é uma ferramenta usada para instalar o ambiente necessário para o Ruby no Windows - e o&amp;nbsp;&lt;a href=&quot;http://modrails.com/&quot;&gt;Passenger&lt;/a&gt;&amp;nbsp;- que mudou a forma da comunidade&amp;nbsp;administrar um cluster de Mongrels ou gerenciar processos FastCGI.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para participar, basta fazer sua inscrição no&amp;nbsp;&lt;a href=&quot;http://rubymastersconf.com/&quot;&gt;RubyMastersConf.com&lt;/a&gt;&amp;nbsp;por um valor&amp;nbsp;simbólico&amp;nbsp;acima de R$35,00. Após a inscrição, é só esperar por ótimas palestras de pessoas muito conceituadas no mundo Ruby, como por exemplo:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://akitaonrails.com/&quot;&gt;Fábio Akita&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://davidchelimsky.net/&quot;&gt;David Chelimsky&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cassiomarques.wordpress.com/&quot;&gt;Cássio Marques&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://fabiokung.com/&quot;&gt;Fábio Kung&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
E ai? Nos &quot;encontraremos&quot; na Ruby Masters Conf?&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&quot;&quot; class=&quot;youtube-player&quot; frameborder=&quot;0&quot; height=&quot;349&quot; src=&quot;http://www.youtube.com/embed/2RQKUEFLtcM&quot; title=&quot;YouTube video player&quot; type=&quot;text/html&quot; width=&quot;425&quot;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Saiba&amp;nbsp;mais visitando o site&amp;nbsp;&lt;a href=&quot;http://rubymastersconf.com/&quot;&gt;RubyMastersConf.com&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/223724582856480952/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2011/02/voce-vai-ao-ruby-masters-conf.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/223724582856480952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/223724582856480952'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2011/02/voce-vai-ao-ruby-masters-conf.html' title='Você &quot;vai&quot; ao Ruby Masters Conf?'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/2RQKUEFLtcM/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-7157807009793454455</id><published>2011-01-27T09:40:00.000-08:00</published><updated>2013-09-27T18:48:37.741-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Noticias"/><title type='text'>Um ano de Casa Open</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIsM9y4radQC_q_OrE-qQDzbXNFimskhsLpctUrKxUBrFDrpcvbuqoZfpq01RDzlIdaHesDJEfqXaUasGPT_2vV6BnXgpr70txpfsf4yuQAdIxORa5NBZTCHy4nCXp5nONrgVvVjmJl8g/s1600/1%252Bano%252BCasaOpen.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Imagem mostrando o número 1&quot; border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIsM9y4radQC_q_OrE-qQDzbXNFimskhsLpctUrKxUBrFDrpcvbuqoZfpq01RDzlIdaHesDJEfqXaUasGPT_2vV6BnXgpr70txpfsf4yuQAdIxORa5NBZTCHy4nCXp5nONrgVvVjmJl8g/s400/1%252Bano%252BCasaOpen.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Este é um dia muito especial para mim pois há um ano atrás o primeiro post,&amp;nbsp;intitulado&amp;nbsp;&lt;a href=&quot;http://www.casaopen.com.br/2010/01/ruby-on-rails-vs-java.html&quot;&gt;Ruby on Rails vs Java&lt;/a&gt;, do blog, que antigamente chamava-se railsopen.blogspot.com, foi ao ar. Desde então, muita coisa mudou: alterei o layout, o domínio (veja esse &lt;a href=&quot;http://www.casaopen.com.br/2010/03/de-casa-nova.html&quot;&gt;post&lt;/a&gt;)... mas o que permanece é o foco: &lt;b&gt;Ruby e Rails&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Sim, aprendi&amp;nbsp;muito, errei alguns vezes, conhece pessoas e cresci. Bom, mas para comemorar essa data especial separei os 10 artigos mais lidos deste primeiro ano do &lt;a href=&quot;http://www.casaopen.com.br/&quot;&gt;Casa Open&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/03/explore-o-mundo-em-360-graus.html&quot;&gt;Explore o mundo em 360 graus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/01/arquivos-em-ruby.html&quot;&gt;Arquivos em Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/01/documentacao-ruby-on-rails.html&quot;&gt;Documentação Ruby on Rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/02/graficos-em-rails-css-graphs.html&quot;&gt;Gráficos no Rails - CSS Graphs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/02/e-mail-para-varios-destinatarios.html&quot;&gt;E-mail para vários destinatários&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/02/traduzir-calendario.html&quot;&gt;Traduzindo datas no Rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/03/operador-ternario-e-ruby.html&quot;&gt;Operador ternário e Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/09/tipagem-em-ruby.html&quot;&gt;Tipagem em Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/12/sockets-em-ruby.html&quot;&gt;Sockets em Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.casaopen.com.br/2010/01/ruby-on-rails-vs-java.html&quot;&gt;Ruby on Rails vs Java&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Também não poderia deixar de agradecer aos leitores, aos que fazem comentários, aos assinantes do &lt;a href=&quot;http://feeds.feedburner.com/casaopen&quot;&gt;feed&lt;/a&gt;, os seguidores do &lt;a href=&quot;http://twitter.com/samuel_vinicius&quot;&gt;twitter&lt;/a&gt; e a todos que de alguma forma fazem o blog evoluir. Obrigado!</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/7157807009793454455/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2011/01/um-ano-de-casa-open.html#comment-form' title='1 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7157807009793454455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7157807009793454455'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2011/01/um-ano-de-casa-open.html' title='Um ano de Casa Open'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIsM9y4radQC_q_OrE-qQDzbXNFimskhsLpctUrKxUBrFDrpcvbuqoZfpq01RDzlIdaHesDJEfqXaUasGPT_2vV6BnXgpr70txpfsf4yuQAdIxORa5NBZTCHy4nCXp5nONrgVvVjmJl8g/s72-c/1%252Bano%252BCasaOpen.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-6069395451566752134</id><published>2011-01-05T02:12:00.000-08:00</published><updated>2013-09-27T18:44:21.657-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Os railers e suas músicas</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;Em quase todos os grandes eventos de Ruby e Rails estamos tendo o privilegio imensurável de desfrutarmos do talento musical dos railers. Como sou uma boa pessoa, não irei privá-lo destes momentos inusitados...&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;...deixando de lado a ironia, realmente é muito bom ouvir música nos eventos e as que você verá nos próximos vídeos são ótimas!&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Regaae do Node&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 12px;&quot;&gt;Apresentado na RubyConf Brasil 2010.&lt;br /&gt;
By &lt;a href=&quot;http://www.twitter.com/danicuki&quot;&gt;@danicuki&lt;/a&gt;, &lt;a href=&quot;http://www.twitter.com/luizfaias&quot;&gt;@luizfaias&lt;/a&gt;, &lt;a href=&quot;http://www.twitter.com/ucoaaa&quot;&gt;@ucoaaa&lt;/a&gt;&amp;nbsp;e&amp;nbsp;&lt;a href=&quot;http://www.twitter.com/andrefaria&quot;&gt;@andrefaria&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;object alt=&quot;Vídeo da música Regaae do Node&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/VY67k6NHfTs?fs=1&amp;amp;hl=pt_BR&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
&lt;embed src=&quot;http://www.youtube.com/v/VY67k6NHfTs?fs=1&amp;amp;hl=pt_BR&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Melô do Teste Automatizado e Samba do Akita&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 12px;&quot;&gt;Melô do Teste Automatizado e Samba do Akita apresentado no Rails Summit 2009 por Daniel Cukier&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;object alt=&quot;Vídeo da música Melô do Teste Automatizado e Samba do Akita&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/4T4Yw9hctfc?fs=1&amp;amp;hl=pt_BR&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
&lt;embed src=&quot;http://www.youtube.com/v/4T4Yw9hctfc?fs=1&amp;amp;hl=pt_BR&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial, sans-serif; font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h1 id=&quot;watch-headline-title&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #333333; font-size: 1,8333em; font-weight: bold; height: 1,1363em; line-height: 1,1363em; margin-bottom: 5px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 1,1363em; outline-color: initial; outline-style: initial; outline-width: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;span class=&quot;&quot; dir=&quot;ltr&quot; id=&quot;eow-title&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 22px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Forro do Elomar&quot;&gt;Forro do Elomar&lt;/span&gt;&lt;/h1&gt;
&lt;div&gt;
&lt;span class=&quot;&quot; dir=&quot;ltr&quot; id=&quot;eow-title&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Forro do Elomar&quot;&gt;Forro do Elomar no Oxente Rails em 2010&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;object alt=&quot;Vídeo da música Forro do Elomar&quot; height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/uhFXtA2ngeo?fs=1&amp;amp;hl=pt_BR&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;
&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;
&lt;embed src=&quot;http://www.youtube.com/v/uhFXtA2ngeo?fs=1&amp;amp;hl=pt_BR&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;
&lt;/object&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/6069395451566752134/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2011/01/os-railers-e-suas-musicas.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/6069395451566752134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/6069395451566752134'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2011/01/os-railers-e-suas-musicas.html' title='Os railers e suas músicas'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-1009697804687752358</id><published>2010-12-26T04:43:00.000-08:00</published><updated>2013-09-27T18:44:40.594-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Noticias"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Retrospectiva 2010</title><content type='html'>Antes de qualquer coisa desejo,&amp;nbsp;sinceramente,&amp;nbsp;a todos os leitores um ótimo 2011. Que seja um ano excelente&amp;nbsp;profissionalmente&amp;nbsp;e pessoalmente. Me vejo também no dever de agradecê-los pelas críticas, elogios e pelos comentários - são eles que me dão forças para continuar.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Salvo os devidos agradecimentos, vamos ao que interessa.&amp;nbsp;Este foi um ótimo ano pra mim e para o blog Casa Open. Foi o ano de estreia do Blog, e tudo que é novo, é especial. Mas para evitar o muito falar, vejam um resumo sobre os artigos mais interessantes - segundo os meus olhos - que aqui foram publicados.&lt;br /&gt;
&lt;br /&gt;
Janeiro&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/01/ruby-on-rails-vs-java.html&quot;&gt;Ruby on Rails vs Java&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/01/arquivos-em-ruby.html&quot;&gt;Arquivos em Ruby&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Fevereiro&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/02/graficos-em-rails-css-graphs.html&quot;&gt;Gráficos no Rails - CSS Graphs&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/02/traduzir-calendario.html&quot;&gt;Traduzindo datas no Rails&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/02/lendo-urls-no-ruby.html&quot;&gt;Lendo URL&#39;s no Ruby&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Março&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/03/operador-ternario-e-ruby.html&quot;&gt;Operador ternário e Ruby&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/03/working-with-rails-ultrapassa-marca-de.html&quot;&gt;Working with Rails ultrapassa a marca de 17000 programadores&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Abril&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/04/tarefas-em-background-delayed-job.html&quot;&gt;Tarefas em background - delayed job&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/04/precedencia-em-operadores-logicos.html&quot;&gt;Precedência em operadores lógicos&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Maio&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/04/precedencia-em-operadores-logicos.html&quot;&gt;Interpretador Ruby Online&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Junho&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/06/em-qual-ambiente-estamos.html&quot;&gt;Em qual ambiente estamos?&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Julho&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/07/project-euler-1.html&quot;&gt;Project Euler #1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/07/teste-suas-expressoes-regulares-online.html&quot;&gt;Teste suas expressões regulares na web&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Agosto&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/08/progzoonet-comparando-as-linguagens-de.html&quot;&gt;progzoo.net: Comparando as linguagens de programação&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Setembro&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/09/retirando-excecao-invalidauthenticityto.html&quot;&gt;Retirando a exceção InvalidAuthenticityToken&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/09/tipagem-em-ruby.html&quot;&gt;Tipagem em Ruby&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Outubro&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/10/respostas-http.html&quot;&gt;Respostas HTTP&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/10/rubyconf-brasil.html&quot;&gt;RubyConf Brasil 2010&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Novembro&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/11/captura-de-codigo-ascii-no-ruby.html&quot;&gt;Captura de código &amp;nbsp;ASCII no Ruby&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Dezembro&lt;br /&gt;
&lt;a href=&quot;http://www.casaopen.com.br/2010/12/sockets-em-ruby.html&quot;&gt;Sockets em Ruby&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
No mais, tenham um bom final de ano e um 2011 melhor ainda!</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/1009697804687752358/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/12/retrospectiva-2010.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/1009697804687752358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/1009697804687752358'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/12/retrospectiva-2010.html' title='Retrospectiva 2010'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-747926512786391771</id><published>2010-12-15T05:49:00.000-08:00</published><updated>2013-09-27T18:45:36.725-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Sockets em Ruby</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhknpjEe9_6RxSO3VdRKNy4n74B17pbjA4JQH0DPCKF3Px_8Ndvkcr0WamuF0I31Kx9kgDrnuZq_T-FMulEaDLxMeK-O4TKp_rk7zTx9yIXk7VqUenr3zkyxPg1Lraqs53BNlFu-t0_UJ4/s1600/Sockets%252BRuby.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Foto de uma tomada ligada na fonte de energia&quot; border=&quot;0&quot; height=&quot;266&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhknpjEe9_6RxSO3VdRKNy4n74B17pbjA4JQH0DPCKF3Px_8Ndvkcr0WamuF0I31Kx9kgDrnuZq_T-FMulEaDLxMeK-O4TKp_rk7zTx9yIXk7VqUenr3zkyxPg1Lraqs53BNlFu-t0_UJ4/s400/Sockets%252BRuby.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Este é primeiro de vários artigos que irei publicar sobre Sockets em Ruby. Mas antes de qualquer coisa, é conveniente dizer &lt;b&gt;o que são Sockets:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;A grosso modo, são as extremidades de um canal de comunicação bidirecional. Ou seja, você pode utilizar Sockets para fazer comunicação entre processos de uma maquina, entre maquinas diferentes e entre processos de maquinas diferentes.&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;O que iremos fazer?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Como este é o primeiro  artigo sobre o tema, pretendo ir direto ao ponto, mostrando, de forma simples, como implementar uma aplicação Cliente-Servidor. Nesta aplicação o cliente envia uma mensagem para o servidor e este responde. Sendo a comunicação entre cliente e servidor realizada via Socket através do protocolo TCP.&lt;br /&gt;
Então, sem mais delongas, vamos aos códigos:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Servidor&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;# file server.rb
require &#39;socket&#39; 

server = TCPServer.open(3001)  # Abre socket em escuta na porta 3001  
loop { # o servidor nunca morre, fica sempre executando
  client = server.accept      # aceita conexão do cliente
  msg_cliente = client.recvfrom( 10000 ) # recebe mensagem - 10000 bytes - do cliente

  puts  &quot;Mensagem do cliente: #{msg_cliente}&quot; # imprime a mensagem do cliente no servidor
  client.puts &quot;Ola cliente eu, o servidor, recebi sua mensagem&quot; #envia uma mensagem ao cliente    
  client.close # fecha conexão
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Cliente&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;# file client.rb
require &#39;socket&#39;

server = TCPSocket.open(&#39;localhost&#39;, 3001) # conecta ao servidor na porta 3001
server.puts &quot;Ola servidor eu, o cliente, estou enviando uma mensagem&quot; # envia mensagem para o servidor

resp = server.recvfrom( 10000 ) # recebe a mensagem -10000 bytes - do servidor
puts resp

server.close # Fecha a conexão com o servidor
&lt;/pre&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Como rodar a aplicação?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Primeiro salve o código do servidor em um arquivo .rb - por exemplo server.rb - e execute o arquivo - ruby server.rb. Neste ponto o servidor está esperando a conexão de um cliente. Agora salve o código do cliente de forma análoga e execute em outro terminal de modo que cliente e servidor sejam rodados ao mesmo tempo. A partir de então o cliente envia uma mensagem ao servidor e o servidor responde.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;Conclusões&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Este é um exemplo simples do que pode ser feito com Sockets, espero que te ajude em algo.&lt;br /&gt;
&lt;br /&gt;
Referência&lt;br /&gt;
&lt;a href=&quot;http://www.tutorialspoint.com/ruby/ruby_socket_programming.htm&quot;&gt;http://www.tutorialspoint.com/ruby/ruby_socket_programming.htm&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/747926512786391771/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/12/sockets-em-ruby.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/747926512786391771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/747926512786391771'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/12/sockets-em-ruby.html' title='Sockets em Ruby'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhknpjEe9_6RxSO3VdRKNy4n74B17pbjA4JQH0DPCKF3Px_8Ndvkcr0WamuF0I31Kx9kgDrnuZq_T-FMulEaDLxMeK-O4TKp_rk7zTx9yIXk7VqUenr3zkyxPg1Lraqs53BNlFu-t0_UJ4/s72-c/Sockets%252BRuby.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-2739632112968636183</id><published>2010-11-30T04:24:00.000-08:00</published><updated>2013-09-27T18:51:29.206-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Captura de código  ASCII no Ruby</title><content type='html'>Existem vários modos para capturar os código ASCII dos caracteres em Ruby, vejamos alguns deles:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;puts ?R, ?u, ?b, ?y&lt;/pre&gt;
&lt;pre class=&quot;cod&quot;&gt;puts &quot;R&quot;[0], &quot;u&quot;[0], &quot;b&quot;[0], &quot;y&quot;[0]&lt;/pre&gt;
&lt;pre class=&quot;cod&quot;&gt;&quot;Ruby&quot;.each_byte { |x| p x}&lt;/pre&gt;
&lt;br /&gt;
Mas se você&amp;nbsp;preferir fazer o caminho inverso, este método resolve:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;&amp;nbsp;puts 82.chr, 117.chr, 98.chr, 121.chr&lt;/pre&gt;
&lt;br /&gt;
Referência:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://en.wikibooks.org/wiki/Ruby_Programming/ASCII&quot;&gt;http://en.wikibooks.org/wiki/Ruby_Programming/ASCII1&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/2739632112968636183/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/11/captura-de-codigo-ascii-no-ruby.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/2739632112968636183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/2739632112968636183'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/11/captura-de-codigo-ascii-no-ruby.html' title='Captura de código  ASCII no Ruby'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-993796589947148370</id><published>2010-10-31T18:39:00.000-07:00</published><updated>2013-09-27T18:49:08.288-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Noticias"/><title type='text'>RubyConf Brasil</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyUmy-YLFDEEhPQtr5HtldvaX2xYhj5jb67PK6mCfhhOuT5Cvil6oj6HhChmgS0fwXxXhbKeBwOXer0aMNcNvYFatNZNELfxgMYaYDBSvKU6OgYtbzwbKst1HpPg2Irlrg5G0jprNTYno/s1600/Imagem0962.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyUmy-YLFDEEhPQtr5HtldvaX2xYhj5jb67PK6mCfhhOuT5Cvil6oj6HhChmgS0fwXxXhbKeBwOXer0aMNcNvYFatNZNELfxgMYaYDBSvKU6OgYtbzwbKst1HpPg2Irlrg5G0jprNTYno/s400/Imagem0962.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Dois dias intensos de Ruby em São Paulo onde mais de 700 pessoas tiveram o privilegio de conhecer um pouco mais deste mundo que a muitos fascinam. Por lá estive e deixo aqui alguns dos meus pensamentos sobre o evento.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
A RubyConf Brasil foi algo que realmente vai deixar saudades, um evento onde pessoas de peso marcaram presença, onde o nível dos palestrantes e palestras foram altíssimos. Estes fatos, sem dúvida, deixam a comunidade cada dia mais orgulhosa de se e dos seus feitos.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3lRruNIKsLHe2WYnbA7tFq-ybsxcBKN8MP2gN_5wfFUVFtAEwk_uRHFjaViBBGw0wPoxp4YZUT-n79hZwU9IawflPcW69fI_rCEbOkKJyB2rUDPsr6rngjZcjXR4MrRt_MJeWxw79qwM/s1600/Imagem0972.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3lRruNIKsLHe2WYnbA7tFq-ybsxcBKN8MP2gN_5wfFUVFtAEwk_uRHFjaViBBGw0wPoxp4YZUT-n79hZwU9IawflPcW69fI_rCEbOkKJyB2rUDPsr6rngjZcjXR4MrRt_MJeWxw79qwM/s200/Imagem0972.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Eu e muitos mineiros fomos. Se você foi, garanto que viu alguém com a camisa do grupo &lt;a href=&quot;http://railsmg.org/&quot; target=&quot;_blank&quot;&gt;Rails-MG&lt;/a&gt;. Nisto agradeço ao Gabriel Sobrinho - &lt;a href=&quot;http://www.twitter.com/sobrinho&quot; target=&quot;_blank&quot;&gt;@sobrinho&lt;/a&gt;, que arrumou uma correria para disponibilizar as camisas à todos integrantes do grupo.&lt;br /&gt;
&lt;br /&gt;
Como disse anteriormente, o nível das palestras foi sensacional, mas dentre estas irei falar especialmente de três:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;palestra: Desenvolvimento de Aplicações Sociais com Rails&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Carlos Brando falou sobre suas experiências no desenvolvimento de aplicações para software social em sistemas como Open Social - Orkut - e FaceBook. Ele mostrou uma forma prática, produtiva e sustentável para desenvolver aplicações sociais em Rails. Sendo a única coisa ruim a notícia de que o framework &amp;nbsp;que facilita o desenvolvimento destas aplicações que o Carlos anda trabalhando não terá o código fonte aberto, pois foi vendido.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Palestra: Integrando o iPhone com Ruby on Rails + Geração de gráficos com Ruby on Rails&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Essa palestra realmente me impressionou, Pedro Franceschi, de apenas 13 anos que já impactou o mundo dos iPhones - desbloqueando vários deles, mostrou que idade não é documento palestrando sobre seus conhecimentos em RoR.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht_uTQocEsjEKN1vDiB9U27qr3t70xa7RRhNt2FurUGO5MrFnLGVki_JkT2beto_ktHag3t01XenWgVxHn_9KSyXDqdnlm3hDYFENRqPYxyDpVm7Z2_gPIFIiWSnXgDvVlrHQW_h7U25A/s1600/Imagem0968.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht_uTQocEsjEKN1vDiB9U27qr3t70xa7RRhNt2FurUGO5MrFnLGVki_JkT2beto_ktHag3t01XenWgVxHn_9KSyXDqdnlm3hDYFENRqPYxyDpVm7Z2_gPIFIiWSnXgDvVlrHQW_h7U25A/s200/Imagem0968.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Palestra: JRuby: O Melhor dos Dois Mundos&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Charles Nutter, mostrou de modo prático como integrar o mundo Java e Ruby. Um ótimo ponto dessa palestra foram as demonstrações desta integração, como por exemplo o uso de bibliotecas gráficas do Java no Ruby, e o humor de Charles.&lt;br /&gt;
&lt;br /&gt;
Esta foi a primeira, de muitas, RubyConf Brasil. Deixo minhas gratificações a todos que contribuíram para o evento em especial ao &lt;a href=&quot;http://akitaonrails.com/&quot; target=&quot;_blank&quot;&gt;Fabio Akita&lt;/a&gt; e aos patrocinadores: &lt;a href=&quot;http://www.gonow.com.br/&quot; target=&quot;_blank&quot;&gt;Go Now&lt;/a&gt;, &lt;a href=&quot;http://www.thoughtworks.com/&quot; target=&quot;_blank&quot;&gt;thoughtworks&lt;/a&gt;, &lt;a href=&quot;http://www.caelum.com.br/&quot;&gt;Caelum&lt;/a&gt;, &lt;a href=&quot;http://www.engineyard.com/&quot; target=&quot;_blank&quot;&gt;Engine Yard&lt;/a&gt;, &lt;a href=&quot;http://www.paypal.com.br/&quot; target=&quot;_blank&quot;&gt;Pay Pal&lt;/a&gt;&amp;nbsp;e &lt;a href=&quot;http://www.infoq.com/br/&quot; target=&quot;_blank&quot;&gt;Infoq&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Mural RubyConf Brasil&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN1O9kfETkPpSo1oEzOswuGth2ezxzRi7BS70GCNBSKeA5e1tTlsJiwv6vgHyrhRwomomN2bIHByXnK_IvWe1Z5DDVkCgJmFkQ1o3iIH-AGmeHhxQGv5NHSTS9Oak6f8z1Xr9_UMj0NpY/s800/Imagem0971.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN1O9kfETkPpSo1oEzOswuGth2ezxzRi7BS70GCNBSKeA5e1tTlsJiwv6vgHyrhRwomomN2bIHByXnK_IvWe1Z5DDVkCgJmFkQ1o3iIH-AGmeHhxQGv5NHSTS9Oak6f8z1Xr9_UMj0NpY/s400/Imagem0971.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzZjy4MlD4u3G1iLSRhMC4qGMS9BuDNvKLX4sq-JY2v9TIyao7FTUopadnrL3N1atVu4PdEstcP8j_L1pwzGLTbPeNmFr47e7fKxbbiab0khZ_YQk2uY8ibZhJB4oytQ75kn_xW7ufBH8/s1600/Imagem0973.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzZjy4MlD4u3G1iLSRhMC4qGMS9BuDNvKLX4sq-JY2v9TIyao7FTUopadnrL3N1atVu4PdEstcP8j_L1pwzGLTbPeNmFr47e7fKxbbiab0khZ_YQk2uY8ibZhJB4oytQ75kn_xW7ufBH8/s400/Imagem0973.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/993796589947148370/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/10/rubyconf-brasil.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/993796589947148370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/993796589947148370'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/10/rubyconf-brasil.html' title='RubyConf Brasil'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyUmy-YLFDEEhPQtr5HtldvaX2xYhj5jb67PK6mCfhhOuT5Cvil6oj6HhChmgS0fwXxXhbKeBwOXer0aMNcNvYFatNZNELfxgMYaYDBSvKU6OgYtbzwbKst1HpPg2Irlrg5G0jprNTYno/s72-c/Imagem0962.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-8524680557042519180</id><published>2010-10-25T05:39:00.000-07:00</published><updated>2013-09-27T18:49:59.804-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Respostas HTTP</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;Quando fazemos uma requisição na Web, o servidor busca o que está sendo requisitado e envia uma resposta para quem fez a requisição. Esta resposta pode ser dos seguintes tipos:&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; font-size: 12px; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; font-size: 12px; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;1XX: informativas;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; font-size: 12px; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot;&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;2XX: indicam sucesso;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;3XX: referem-se a um redirecionamento;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;4XX: indicam erros ocorridos no cliente;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;5XX:&amp;nbsp;indicam erros no servidor.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; font-size: 12px; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Mas como obter estas respostas através do Ruby? O seguinte código responde à essa pergunta:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; font-size: 12px; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: arial, &#39;bitstream vera sans&#39;, helvetica, sans-serif; line-height: 19px; white-space: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;require &#39;net/http&#39; 
&amp;nbsp; resposta = Net::HTTP.get_response(URI.parse(&quot;http://www.casaopen.com.br/&quot;))
&amp;nbsp; puts resposta.code&amp;nbsp; # retorna qual foi a resposta a requisição HTTP. Ex: 200, 400...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Mas como você não quer problemas caso a URL os tenha, isso ajuda:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;require &#39;net/http&#39; 
begin
&amp;nbsp; resposta = Net::HTTP.get_response(URI.parse(&quot;http://www.casaopen.com.br/&quot;))
&amp;nbsp; puts resposta.code&amp;nbsp; # retorna qual foi a resposta a requisição HTTP. Ex: 200, 400...
rescue =&amp;gt; ret&amp;nbsp;&amp;nbsp; # TimeoutError #&amp;nbsp; Net::HTTP.SocketError,
&amp;nbsp; puts&amp;nbsp; &quot;Erro: #{resposta}&quot;
end&amp;nbsp;&amp;nbsp; &lt;/pre&gt;
&lt;br /&gt;
Para maiores informações, veja a documentação do &lt;a href=&quot;http://ruby-doc.org/core/classes/Net/HTTP.html&quot; target=&quot;_blank&quot;&gt;Ruby&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/8524680557042519180/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/10/respostas-http.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/8524680557042519180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/8524680557042519180'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/10/respostas-http.html' title='Respostas HTTP'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-6279974170607701688</id><published>2010-09-23T17:25:00.000-07:00</published><updated>2013-09-27T18:50:09.356-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Tipagem em Ruby</title><content type='html'>Cada linguagem de programação tem sua forma de lidar com tipos, por exemplo: C é uma linguagem estaticamente tipada, pois o tipo da variável é definido em tempo de compilação. O que pode ser visto no seguinte exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;&amp;nbsp;&amp;nbsp;char a= &#39;a&#39;;
&lt;/pre&gt;
&lt;br /&gt;
No entanto, Ruby é dinamicamente, implicitamente e fortemente tipada. Vejamos o que cada um destes adjetivos significam:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Dinamicamente tipada&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Quer dizer que, a cada interação, o tipo é verificado. Isso fica claro no seguinte exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;x = 100
(1..4).each{ x = x * 100 ; &amp;nbsp;puts &quot;#{ x.class} #{x}&quot; &amp;nbsp;}
&lt;/pre&gt;
&lt;br /&gt;
Que gera o resultado:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;Fixnum 10000
Fixnum 1000000
Fixnum 100000000
Bignum 10000000000
&lt;/pre&gt;
&lt;br /&gt;
Como podemos ver a variável x começa como Fixnum e conforme aumenta passa para Bignum sem a necessidade de uma conversão.&lt;br /&gt;
&lt;br /&gt;
Essa característica gera vários pontos positivos na linguagem, tais como:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Diminui a verbosidade, pois não há a necessidade de fazer conversões;&lt;/li&gt;
&lt;li&gt;Tende a facilitar a vida do programador pois não há a preocupação com conversões.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
Mas neste contexto nem tudo são flores, vejamos os pontos negativos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A linguagem tende a ser mais lenta, em tempo de execução, devido ao fato de que, a cada interação, o tipo ser verificado;&lt;/li&gt;
&lt;li&gt;Pode confundir o programador pois o mesmo pode não saber exatamente com quais tipos está tratando.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Implicitamente tipada&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Continuando no mesmo exemplo, quando fizemos x = 100 não precisamos declarar o tipo de x. Ou seja, não foi necessário fazer algo como: Fixnum x = 100. Isso acontece pelo fato do Ruby detectar o tipo de cada variável em tempo de execução. Uma boa analogia para este fenômeno é pensar nas variáveis como se fossem caixas fechadas e seus dados como fitas coloridas onde o interpretador abre a caixa e verifica as cores das fitas.&lt;br /&gt;
&lt;br /&gt;
Novamente, os pontos positivos e negativos são muito semelhantes aos relacionados a tipagem dinâmica. Veja:&lt;br /&gt;
&lt;br /&gt;
Positivos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Diminui a verbosidade, pois não há a necessidade de fazer declarações.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
Negativos:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A linguagem tende a ser mais lenta pois o tipo é verificado em tempo de execução de acordo com a analogia das caixas e fitas;&lt;/li&gt;
&lt;li&gt;Pode confundir o programador pois o mesmo pode não saber exatamente com quais tipos está tratando já que não existe a declaração dos mesmos.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Fortemente tipada&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Este é um conceito confuso, mas uma boa forma de explica-lo é dizendo que &amp;nbsp;todas as variáveis devem ter um tipo - ou seja: fazer parte de uma classe no caso do Ruby - e que &amp;nbsp;cada tipo segue a risca seu contrato. Por exemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;a = 100
b = &quot;Ruby on Rails&quot;
a + b

TypeError: String can&#39;t be coerced into Fixnum
&amp;nbsp;&amp;nbsp; &amp;nbsp;from (irb):54:in `+&#39;
&amp;nbsp;&amp;nbsp; &amp;nbsp;from (irb):54
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Como você notou, em Ruby não podemos somar um String com Fixnum pois essa operação não está no contrato da classe String e Fixnum.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
De fato, o assunto não acaba por aqui, existem alguns materiais na Web e em Livros sobre isso. Em vista disso, e no intuito de incentivar a pesquisa, deixo algumas referencias e até a próxima!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.codecommit.com/blog/ruby/adding-type-checking-to-ruby&quot;&gt;codecommit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.rubyfleebie.com/ruby-is-dynamically-and-strongly-typed/&quot;&gt;rubyfleebie&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
P.S. Os tipos em Ruby na verdade são classes, ou seja: não existem tipos primitivos e sim objetos que pertencem a classes. Ex.:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;a = 1 # a pertence a classe Fixnum
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/6279974170607701688/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/09/tipagem-em-ruby.html#comment-form' title='9 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/6279974170607701688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/6279974170607701688'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/09/tipagem-em-ruby.html' title='Tipagem em Ruby'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-6395532953630243579</id><published>2010-09-09T07:22:00.000-07:00</published><updated>2012-12-18T16:07:56.490-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Retirando a exceção InvalidAuthenticityToken</title><content type='html'>&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Já tentou enviar formulários fora da sua aplicação? Se sim, certamente você teve problemas!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Esses problemas se devem ao fato de que o Rails 2 insere o campo “authenticity_token” nos formulários no intuito de não permitir envios de forms por terceiros.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;Mas se desejar receber tais envios basta colocar:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;self.allow_forgery_protection = false
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;no controller desejado.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/6395532953630243579/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/09/retirando-excecao-invalidauthenticityto.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/6395532953630243579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/6395532953630243579'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/09/retirando-excecao-invalidauthenticityto.html' title='Retirando a exceção InvalidAuthenticityToken'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-9122008174429546054</id><published>2010-08-17T07:12:00.000-07:00</published><updated>2010-08-17T07:12:58.330-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Noticias"/><title type='text'>progzoo.net: Comparando as linguagens de programação</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot; target=&quot;_blank&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;O&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://progzoo.net/&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;progzoo.net&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;é um ótimo site que mostra códigos com o mesmo&amp;nbsp;propósito&amp;nbsp;em linguagens diferentes - Java, C#, C++, Perl, PHP, Python, Ruby, VB. O site fornece exemplos tais como o&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;Hello World, Convert to Number, Read Text File, Sum an Array&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span style=&quot;font-style: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;entre outros.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;font-style: normal; font-weight: medium; margin-bottom: 0cm; orphans: 2; widows: 2;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;E, puxando a sardinha para o Ruby, é impressionante o quanto ele é mais conciso do que a maiorias das outras linguagens.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Times New Roman&#39;; font-size: large;&quot;&gt;Sem dúvida vale a pena conferir o &lt;a href=&quot;http://progzoo.net/&quot; target=&quot;_blank&quot;&gt;site&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/9122008174429546054/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/08/progzoonet-comparando-as-linguagens-de.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/9122008174429546054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/9122008174429546054'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/08/progzoonet-comparando-as-linguagens-de.html' title='progzoo.net: Comparando as linguagens de programação'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-1405754788089832680</id><published>2010-07-28T06:12:00.000-07:00</published><updated>2012-12-27T04:48:00.799-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Teste suas expressões regulares online</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRNboYWXR77owOgN_73-jMc9XzAa3zDW5cHQWdf0fKJ0ODfckvAFffKAPmhFDRV82eBtY0V2RaxkdvJvkJkstGFYFyPCtAnzIP3V-VwBh94d69EgOnsC9DQR4Pzw6bSaXhyphenhyphen0rSOu1S-Ng/s1600/RegexBuddy.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blanck&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRNboYWXR77owOgN_73-jMc9XzAa3zDW5cHQWdf0fKJ0ODfckvAFffKAPmhFDRV82eBtY0V2RaxkdvJvkJkstGFYFyPCtAnzIP3V-VwBh94d69EgOnsC9DQR4Pzw6bSaXhyphenhyphen0rSOu1S-Ng/s200/RegexBuddy.gif&quot; width=&quot;200&quot; alt=&quot;testador expressão regular Ruby&quot;/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;Vai uma dica de um ótimo site, o &lt;a href=&quot;http://rubular.com/&quot; target=&quot;_blanck&quot;&gt;Rubular&lt;/a&gt;. Com ele você testa suas expressões regulares em Ruby de forma pratica e rápida e ainda pode adquirir um link de seus testes.&lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;western&quot; style=&quot;margin-bottom: 0cm;&quot;&gt;Veja um exemplo: &lt;a href=&quot;http://rubular.com/r/tgTEBeNhzz&quot; target=&quot;_blanck&quot;&gt;http://rubular.com/r/tgTEBeNhzz&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/1405754788089832680/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/07/teste-suas-expressoes-regulares-online.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/1405754788089832680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/1405754788089832680'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/07/teste-suas-expressoes-regulares-online.html' title='Teste suas expressões regulares online'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRNboYWXR77owOgN_73-jMc9XzAa3zDW5cHQWdf0fKJ0ODfckvAFffKAPmhFDRV82eBtY0V2RaxkdvJvkJkstGFYFyPCtAnzIP3V-VwBh94d69EgOnsC9DQR4Pzw6bSaXhyphenhyphen0rSOu1S-Ng/s72-c/RegexBuddy.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-9108632213925965000</id><published>2010-07-16T05:57:00.001-07:00</published><updated>2013-09-28T06:00:55.604-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Project Euler #1</title><content type='html'>O &lt;a href=&quot;http://projecteuler.net/&quot; target=&quot;_new&quot;&gt;Projeto Euler&lt;/a&gt; foi iniciado por Colin Hughes (aka Euler) em outubro de 2001 e consiste em diversos problemas que envolvem matemática e computação, sendo que alguns são possíveis resolver sem o uso da computação e outros não. Segundo a descrição do projeto, este teve como principal motivação oferecer uma plataforma para que mentes curiosas mergulhem em áreas desconhecidas.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Salvo as devidas explicações, irei começar a resolver alguns problemas, de preferência em Ruby, e postar as soluções aqui. &lt;br /&gt;
&lt;br /&gt;
Então... vamos ao &lt;a href=&quot;http://projecteuler.net/index.php?section=problems&amp;amp;id=1&quot; target=&quot;_new&quot;&gt;problema 1&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Descrição&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.&lt;br /&gt;
Find the sum of all the multiples of 3 or 5 below 1000.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Solução&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;sum = 0
(1..999).each { |x| sum += x if x%3 == 0 or x%5 == 0 }
puts sum
&lt;/pre&gt;
&lt;br /&gt;
ou&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;sum = (0..999).inject {|aux, n| ( n%3 == 0 or n%5 == 0 ) ? aux + n  : aux }
p sum
&lt;/pre&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-large;&quot;&gt;Resposta&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
233168</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/9108632213925965000/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/07/project-euler-1.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/9108632213925965000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/9108632213925965000'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/07/project-euler-1.html' title='Project Euler #1'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-5333184765843276801</id><published>2010-07-08T13:51:00.000-07:00</published><updated>2013-09-28T06:01:20.735-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Doc da sua aplicação Rails</title><content type='html'>Já experimentou o comando rake doc:app ?&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;rake doc:app
&lt;/pre&gt;
&lt;br /&gt;
Ele cria uma doc semelhante a documentação do &lt;a href=&quot;http://ruby-doc.org/core/&quot;&gt;Ruby&lt;/a&gt;&amp;nbsp;com todos os arquivos, classes e métodos  da sua sua aplicação no diretório /doc/app/ .&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Bom, mas existem muitos outros comandos interessantes, para conhecê-los basta rodar:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;rake -T


rake db:abort_if_pending_migrations        # Raises an error if there are pending migrations
rake db:charset                            # Retrieves the charset for the current environment&#39;s database
rake db:collation                          # Retrieves the collation for the current environment&#39;s database
rake db:create                             # Create the database defined in config/database.yml for the current RAILS_ENV
rake db:create:all                         # Create all the local databases defined in config/database.yml
rake db:drop                               # Drops the database for the current RAILS_ENV
rake db:drop:all                           # Drops all the local databases defined in config/database.yml
rake db:fixtures:identify                  # Search for a fixture given a LABEL or ID.
rake db:fixtures:load                      # Load fixtures into the current environment&#39;s database.
rake db:migrate                            # Migrate the database through scripts in db/migrate and update db/schema.rb ...
rake db:migrate:down                       # Runs the &quot;down&quot; for a given migration VERSION.
rake db:migrate:redo                       # Rollbacks the database one migration and re migrate up.
rake db:migrate:reset                      # Resets your database using your migrations for the current environment
rake db:migrate:up                         # Runs the &quot;up&quot; for a given migration VERSION.
rake db:reset                              # Drops and recreates the database from db/schema.rb for the current environm...
rake db:rollback                           # Rolls the schema back to the previous version.
rake db:schema:dump                        # Create a db/schema.rb file that can be portably used against any DB support...
rake db:schema:load                        # Load a schema.rb file into the database
rake db:seed                               # Load the seed data from db/seeds.rb
rake db:sessions:clear                     # Clear the sessions table
rake db:sessions:create                    # Creates a sessions migration for use with ActiveRecord::SessionStore
rake db:setup                              # Create the database, load the schema, and initialize with the seed data
rake db:structure:dump                     # Dump the database structure to a SQL file
rake db:test:clone                         # Recreate the test database from the current environment&#39;s database schema
rake db:test:clone_structure               # Recreate the test databases from the development structure
rake db:test:load                          # Recreate the test database from the current schema.rb
rake db:test:prepare                       # Check for pending migrations and load the test schema
rake db:test:purge                         # Empty the test database
rake db:version                            # Retrieves the current schema version number
rake doc:app                               # Build the RDOC HTML Files
rake doc:clobber_app                       # Remove rdoc products
rake doc:clobber_plugins                   # Remove plugin documentation
rake doc:clobber_rails                     # Remove rdoc products
rake doc:guides                            # Generate Rails guides
rake doc:plugins                           # Generate documentation for all installed plugins
rake doc:plugins:brazilian-rails           # Generate documentation for the brazilian-rails plugin
rake doc:plugins:human_attribute_override  # Generate documentation for the human_attribute_override plugin
rake doc:plugins:jrails                    # Generate documentation for the jrails plugin
rake doc:plugins:paperclip                 # Generate documentation for the paperclip plugin
rake doc:plugins:will_paginate             # Generate documentation for the will_paginate plugin
rake doc:rails                             # Build the RDOC HTML Files
rake doc:reapp                             # Force a rebuild of the RDOC files
rake doc:rerails                           # Force a rebuild of the RDOC files
rake gems                                  # List the gems that this rails application depends on
rake gems:build                            # Build any native extensions for unpacked gems
rake gems:build:force                      # Force the build of all gems
rake gems:install                          # Installs all required gems.
rake gems:refresh_specs                    # Regenerate gem specifications in correct format.
rake gems:unpack                           # Unpacks all required gems into vendor/gems.
rake gems:unpack:dependencies              # Unpacks all required gems and their dependencies into vendor/gems.
rake jrails:install:javascripts            # Installs the jQuery and jRails javascripts to public/javascripts
rake jrails:update:javascripts             # Copies the jQuery and jRails javascripts to public/javascripts
rake log:clear                             # Truncates all *.log files in log/ to zero bytes
rake middleware                            # Prints out your Rack middleware stack
rake notes                                 # Enumerate all annotations
rake notes:custom                          # Enumerate a custom annotation, specify with ANNOTATION=WTFHAX
rake notes:fixme                           # Enumerate all FIXME annotations
rake notes:optimize                        # Enumerate all OPTIMIZE annotations
rake notes:todo                            # Enumerate all TODO annotations
rake paperclip:clean                       # Cleans out invalid attachments.
rake paperclip:refresh                     # Refreshes both metadata and thumbnails.
rake paperclip:refresh:metadata            # Regenerates content_type/size metadata for a given CLASS (and optional ATTA...
rake paperclip:refresh:thumbnails          # Regenerates thumbnails for a given CLASS (and optional ATTACHMENT).
rake rails:freeze:edge                     # Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0
rake rails:freeze:gems                     # Lock this application to the current gems (by unpacking them into vendor/ra...
rake rails:template                        # Applies the template supplied by LOCATION=/path/to/template
rake rails:unfreeze                        # Unlock this application from freeze of gems or edge and return to a fluid u...
rake rails:update                          # Update both configs, scripts and public/javascripts from Rails
rake rails:update:application_controller   # Rename application.rb to application_controller.rb
rake rails:update:configs                  # Update config/boot.rb from your current rails install
rake rails:update:generate_dispatchers     # Generate dispatcher files in RAILS_ROOT/public
rake rails:update:javascripts              # Update your javascripts from your current rails install
rake rails:update:scripts                  # Add new scripts to the application script/ directory
rake routes                                # Print out all defined routes in match order, with names.
rake secret                                # Generate a crytographically secure secret key.
rake stats                                 # Report code statistics (KLOCs, etc) from the application
rake test                                  # Run all unit, functional and integration tests
rake test:benchmark                        # Run tests for benchmarkdb:test:prepare / Benchmark the performance tests
rake test:functionals                      # Run tests for functionalsdb:test:prepare / Run the functional tests in test...
rake test:integration                      # Run tests for integrationdb:test:prepare / Run the integration tests in tes...
rake test:plugins                          # Run tests for pluginsenvironment / Run the plugin tests in vendor/plugins/*...
rake test:profile                          # Run tests for profiledb:test:prepare / Profile the performance tests
rake test:recent                           # Run tests for recentdb:test:prepare / Test recent changes
rake test:uncommitted                      # Run tests for uncommitteddb:test:prepare / Test changes since last checkin ...
rake test:units                            # Run tests for unitsdb:test:prepare / Run the unit tests in test/unit
rake time:zones:all                        # Displays names of all time zones recognized by the Rails TimeZone class, gr...
rake time:zones:local                      # Displays names of time zones recognized by the Rails TimeZone class with th...
rake time:zones:us                         # Displays names of US time zones recognized by the Rails TimeZone class, gro...
rake tmp:cache:clear                       # Clears all files and directories in tmp/cache
rake tmp:clear                             # Clear session, cache, and socket files from tmp/
rake tmp:create                            # Creates tmp directories for sessions, cache, sockets, and pids
rake tmp:pids:clear                        # Clears all files in tmp/pids
rake tmp:sessions:clear                    # Clears all files in tmp/sessions
rake tmp:sockets:clear                     # Clears all files in tmp/sockets

&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/5333184765843276801/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/07/doc-da-sua-aplicacao-rails.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/5333184765843276801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/5333184765843276801'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/07/doc-da-sua-aplicacao-rails.html' title='Doc da sua aplicação Rails'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-3096594015671460754</id><published>2010-06-30T06:16:00.000-07:00</published><updated>2013-09-28T06:01:53.245-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Em qual ambiente estamos?</title><content type='html'>Já teve a necessidade de saber em qual ambiente de trabalho - production, development, test e  etc - você está? Acredito que sim! Logo segue algumas dicas para saber isso:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;if Rails.env == &#39;development&#39;
  puts &#39;Estamos no development&#39;
elsif Rails.env == &#39;production&#39;
  puts &#39;Estamos no production&#39;
end
&lt;/pre&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
Ou:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;puts &#39;Estamos no development&#39; if Rails.env.development? 
puts &#39;Estamos no production&#39; if Rails.env.production? 
puts  &#39;Estamos no test&#39; if Rails.env.test?  
puts  &#39;Estamos no whatever&#39; if Rails.env.whatever?
&lt;/pre&gt;
&lt;br /&gt;
Ou usando a variável de ambientes RAILS_ENV:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;if RAILS_ENV == &#39;development&#39;
  puts &#39;Estamos no development&#39;
elsif RAILS_ENV == &#39;production&#39;
  puts &#39;Estamos no production&#39;
end
&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/3096594015671460754/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/06/em-qual-ambiente-estamos.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/3096594015671460754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/3096594015671460754'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/06/em-qual-ambiente-estamos.html' title='Em qual ambiente estamos?'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-7828768418180630456</id><published>2010-06-04T10:48:00.000-07:00</published><updated>2013-09-28T06:02:49.691-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Wallpaper Ruby on Rails</title><content type='html'>Estava procurando um papel de parede novo e olhe o que encontrei:&lt;br /&gt;
[ P.S. basta clicar nas fotos para ser redirecionado aos devidos sites ]&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.flickr.com/photos/encyte/56883622/&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzghh9syHw71t7z2rUZGrNsXatMKnanQvmiD4cCwXlt9iPE6Ej1gdOj9qOfVkMX5GvngeE50B3Dx0XdF8lY9QsWZEIAh9scpcXEAPaIpP1KjQHk3JpLqPNMsjBigVgsQKFcf6-2elApsk/s200/56944752_0ddecad0f8.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.wallpaperpimper.com/Rails-wallpaper-106833&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;150&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYtowK4eTW0r2osDGCsstIPkntsAf7MQQqZTa1e73mJQTiUReuI1W467uVzhE6HeHAFaCa2df9ifwgjmWf-GkFWuSJQ0LKkrQKICJy672OihuNn9JsoWlbUpb9JsfY9yc1V_daru2ezbg/s200/Rails_wallpaper.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.rubyinside.com/advent2006/other1920.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh97abNiuKjOZYxU9OnWyuxPdabLa0QLQmWXdagc0pOb_AtRJuwgvvXmNHJGT4XkXSAycZ9VAGRhSomEvA2ooKT6gNCmgDuM4DnUuR0KP4gPeEQekfTgMmT7SBDpQ9uOgDGEKGfwl9hwUw/s200/papel_de_parede_ruby_rails.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.rubyinside.com/advent2006/24-wallpapers.html&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiygUlLWmVeUydxZdEJgFB1imlpdM1P9QwVYm-JpZUxZ9jI-f6CmzidAyrTAU2sB7n1s2FG95rhGbLDnkluAcnruDdRZaZpMyynHonhxfL315SEOyL3OI9jSiWRudrD7M2s-y26JOPkJs4/s200/wallpaper_rails.jpg&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/7828768418180630456/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/06/wallpaper-ruby-on-rails.html#comment-form' title='0 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7828768418180630456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/7828768418180630456'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/06/wallpaper-ruby-on-rails.html' title='Wallpaper Ruby on Rails'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzghh9syHw71t7z2rUZGrNsXatMKnanQvmiD4cCwXlt9iPE6Ej1gdOj9qOfVkMX5GvngeE50B3Dx0XdF8lY9QsWZEIAh9scpcXEAPaIpP1KjQHk3JpLqPNMsjBigVgsQKFcf6-2elApsk/s72-c/56944752_0ddecad0f8.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-8169040719343584892</id><published>2010-05-13T09:52:00.000-07:00</published><updated>2012-11-07T15:50:28.889-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Interpretador Ruby Online</title><content type='html'>Já passou pela experiência de querer executar  algum algoritmo mas estava sem o devido  interpretador ou compilador? Certamente sim! Mas nessas horas o site &lt;a href=&quot;http://codepad.org/&quot; target=&quot;_blank&quot;&gt;CodePad&lt;/a&gt; é uma ótima saída, com ele você pode interpretar/compilar código fonte de várias linguagens tais com: Ruby, PHP, C, C++, Haskell, Lua, Ocaml, Perl e outras. Além disso, ele disponibiliza o seu código juntamente com a respectiva saída através de uma url curta de forma semelhante as usadas no Twitter.&lt;br /&gt;
Sem dúvida esses fatores apontam o CodPad como uma boa maneira para mostrar,&amp;nbsp; de forma rápida,&amp;nbsp; um código simples para alguém. &lt;br /&gt;
&lt;br /&gt;
Interessou? Então entre no &lt;a href=&quot;http://codepad.org/&quot; target=&quot;_blank&quot;&gt;site&lt;/a&gt; e/ou veja como é o seu &lt;a href=&quot;http://codepad.org/about&quot; target=&quot;_blank&quot;&gt;funcionamento&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
P.S. Fiz alguns testes em Ruby e em todos tive sucesso, veja um deles &lt;a href=&quot;http://codepad.org/QrVXq8oj&quot; target=&quot;_blank&quot;&gt;http://codepad.org/QrVXq8oj&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/8169040719343584892/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/05/interpretador-ruby-online.html#comment-form' title='6 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/8169040719343584892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/8169040719343584892'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/05/interpretador-ruby-online.html' title='Interpretador Ruby Online'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4800026411398402386.post-4535497583847925373</id><published>2010-04-30T06:41:00.000-07:00</published><updated>2013-09-28T06:03:30.287-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby e Rails"/><title type='text'>Precedência em operadores lógicos</title><content type='html'>Antes de qualquer coisa, veja os seguintes códigos e seus respectivos retornos:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;true and false #=&amp;gt; false
true &amp;amp;&amp;amp; false #=&amp;gt; false
&lt;/pre&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;true or false #=&amp;gt; true
true || false #=&amp;gt; true
&lt;/pre&gt;
&lt;br /&gt;
Em vista disso, logo vem a pergunta: Qual a diferença entre &quot;and&quot; e &quot;&amp;amp;&amp;amp;&quot; e entre &quot;or&quot; e &quot;||&quot;?&lt;br /&gt;
A resposta é simples, &quot;&amp;amp;&amp;amp;&quot; e &quot;||&quot; possuem maior precedência que &quot;and&quot; e &quot;or&quot;. Sendo que o &quot;&amp;amp;&amp;amp;&quot; possui maior precedência que o &quot;||&quot; e o &quot;and&quot; possui a mesma precedência que &quot;or&quot;. Veja alguns exemplos:&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;true or false and false #=&amp;gt; false
&lt;/pre&gt;
&lt;br /&gt;
Neste caso o código é resolvido da esquerda para a direita, ou seja: primeiro o &quot;or&quot; e em seguida o &quot;and&quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: ruby; gutter: false;  toolbar: false;&quot;&gt;true or false &amp;amp;&amp;amp; false #=&amp;gt; true
&lt;/pre&gt;
&lt;br /&gt;
Como o &quot;&amp;amp;&amp;amp;&quot; possui maior precedência ele é resolvido primeiramente e depois o &quot;or&quot;.</content><link rel='replies' type='application/atom+xml' href='http://www.casaopen.com.br/feeds/4535497583847925373/comments/default' title='Postar comentários'/><link rel='replies' type='text/html' href='http://www.casaopen.com.br/2010/04/precedencia-em-operadores-logicos.html#comment-form' title='2 Comentários'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/4535497583847925373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4800026411398402386/posts/default/4535497583847925373'/><link rel='alternate' type='text/html' href='http://www.casaopen.com.br/2010/04/precedencia-em-operadores-logicos.html' title='Precedência em operadores lógicos'/><author><name>Samuel Vinícius</name><uri>http://www.blogger.com/profile/18247509515584222197</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrRoNmKBBOxf63GB76wnQGuxylLNHrwMC0GdvH4xqwGl54rpUupu2cInKp3uSW3OrVL_wnFgZBF5j7_oqkuJ0fq6jFA3urcNeehtpTPuaskYXd-b-VqzOwLNKDdQ8Tzzc/s220/IMG_20130910_120601.jpg'/></author><thr:total>2</thr:total></entry></feed>