<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tiago Silva</title>
	<atom:link href="http://www.tiagosilva.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tiagosilva.eu</link>
	<description></description>
	<lastBuildDate>Mon, 30 Aug 2010 08:56:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Something about this interesting class: the ThreadPoolExecutor (of course this is Java)</title>
		<link>http://www.tiagosilva.eu/programming/something-about-this-interesting-class-the-threadpoolexecutor-of-course-this-is-java/</link>
		<comments>http://www.tiagosilva.eu/programming/something-about-this-interesting-class-the-threadpoolexecutor-of-course-this-is-java/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 08:55:08 +0000</pubDate>
		<dc:creator>Tiago Silva</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java SE]]></category>

		<guid isPermaLink="false">http://www.tiagosilva.eu/?p=73</guid>
		<description><![CDATA[Since I found very little books covering this Java marvel, I decided to write myself something about it. This pool has all the mechanisms you need to manage and execute runnable objects, internally it has a ThreadFactory, that you can also provide, and turns your runnable objects into Threads, executing them through an Executor but [...]]]></description>
			<content:encoded><![CDATA[<p>Since I found very little books covering this Java marvel, I decided to write myself something about it.<span id="more-73"></span></p>
<p>This pool has all the mechanisms you need to manage and execute runnable objects, internally it has a ThreadFactory, that you can also provide, and turns your runnable objects into Threads, executing them through an Executor but offering pooling, queueing and a very accurate concurrent execution priority. So, what is a ThreadPoolExecutor, it’s nothing less than an Executor plus a ThreadFactory using a BlockingQueue for Runnable objects! Of course it offers some neat features to control all the internal running threads but the main pluses are that you don’t need to build such thread pool, because it already exists!</p>
<p>What do you need to have you objects running inside a ThreadPoolExecutor?</p>
<p>They only need to <span style="text-decoration: underline;">implement the Runnable interface</span>, forcing you to have a <span style="text-decoration: underline;">public void run(){}</span> method in your class!</p>
<p>This pool is great for network connection handlers, because it offers an incredible consistency when re-using the idle threads already created.</p>
<p>In future articles I will teach you how to build a small, yet powerful, multi-threaded, http web server using the ThreadPoolExecutor.</p>
<p>Until then, have in mind that Java runs in all major operative systems!</p>
<p>It is open source and is here for longer than many of you!</p>
<p>Have fun coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiagosilva.eu/programming/something-about-this-interesting-class-the-threadpoolexecutor-of-course-this-is-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validação de Número de Documento do Cartão de Cidadão (Versão 1.0 &#8211; Jan. 2010) em Java SE [PT]</title>
		<link>http://www.tiagosilva.eu/it-security/validacao-de-numero-de-documento-do-cartao-de-cidadao-versao-1-0-jan-2010-em-java-se-pt/</link>
		<comments>http://www.tiagosilva.eu/it-security/validacao-de-numero-de-documento-do-cartao-de-cidadao-versao-1-0-jan-2010-em-java-se-pt/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 14:01:25 +0000</pubDate>
		<dc:creator>Tiago Silva</dc:creator>
				<category><![CDATA[Cartão do Cidadão]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.tiagosilva.eu/?p=53</guid>
		<description><![CDATA[O código de autenticação de numero de documento do cartão de cidadão em Java. Já existia o mesmo em C# .Net, achei pertinente criar uma versão em Java SE. Espero que seja útil para alguém. public class CCValidator { public static boolean ValidateNumeroDocumentoCC(String numeroDocumento) throws Exception { int sum = 0; boolean secondDigit = false; [...]]]></description>
			<content:encoded><![CDATA[<p>O código de autenticação de numero de documento do cartão de cidadão em Java. Já existia o mesmo em C# .Net, achei pertinente criar uma versão em Java SE. Espero que seja útil para alguém.</p>
<pre class="brush: java; highlight: [10, 25];">public class CCValidator
{
     public static boolean ValidateNumeroDocumentoCC(String numeroDocumento) throws Exception
     {
          int sum = 0;
          boolean secondDigit = false;

          if (numeroDocumento.length() != 12) {
               throw new Exception("Tamanho inválido para número de documento.");
          }

          for (int i = numeroDocumento.length() - 1; i &gt;= 0; --i)
          {
               int valor = getNumberFromChar(numeroDocumento.charAt(i));

               if (secondDigit)
               {
                    valor *= 2;
                    if (valor &gt; 9)
                    {
                         valor -= 9;
                    }
               }

          sum += valor;
          secondDigit = !secondDigit;
     }

return (sum % 10) == 0;
}

public static int getNumberFromChar(char letter) throws Exception
{
     switch (letter)
     {
          case '0':
               return 0;
          case '1':
               return 1;
          case '2':
               return 2;
          case '3':
               return 3;
          case '4':
               return 4;
          case '5':
               return 5;
          case '6':
               return 6;
          case '7':
               return 7;
          case '8':
               return 8;
          case '9':
               return 9;
          case 'A':
               return 10;
          case 'B':
               return 11;
          case 'C':
               return 12;
          case 'D':
               return 13;
          case 'E':
               return 14;
          case 'F':
               return 15;
          case 'G':
               return 16;
          case 'H':
               return 17;
          case 'I':
               return 18;
          case 'J':
               return 19;
          case 'K':
               return 20;
          case 'L':
               return 21;
          case 'M':
               return 22;
          case 'N':
               return 23;
          case 'O':
               return 24;
          case 'P':
               return 25;
          case 'Q':
               return 26;
          case 'R':
               return 27;
          case 'S':
               return 28;
          case 'T':
               return 29;
          case 'U':
               return 30;
          case 'V':
               return 31;
          case 'W':
               return 32;
          case 'X':
               return 33;
          case 'Y':
               return 34;
          case 'Z':
               return 35;
          }

          throw new Exception("Valor inválido no número de documento.");
     }
}
</pre>
<p>Caso tenham alguma necessidade especifica sobre o cartão de cidadão aproveitem e comentem!<br />
O meu comentário sobre o cartão do cidadão é que, embora seja um cartão que contem um micro-controlador que corre uma <em>Java Virtual Machine</em>, ou seja, é um <em>Smart Card</em> bastante avançado e robusto, os comandos para invocar as funções internas, para obter os dados públicos por ex., ainda é um mistério, ou seja, embora seja um produto para uso publico, onde está a informação para comunicar a baixo nível com o próprio cartão?</p>
<p>Para um cartão extremamente seguro não compreendo o porquê de tanto secretismo. O cartão nem permite a escrita por entidades não autorizadas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiagosilva.eu/it-security/validacao-de-numero-de-documento-do-cartao-de-cidadao-versao-1-0-jan-2010-em-java-se-pt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uma visita ao Professor Doutor André Zúquete! [PT]</title>
		<link>http://www.tiagosilva.eu/it-security/uma-visita-ao-professor-doutor-andre-zuquete/</link>
		<comments>http://www.tiagosilva.eu/it-security/uma-visita-ao-professor-doutor-andre-zuquete/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 19:10:06 +0000</pubDate>
		<dc:creator>Tiago Silva</dc:creator>
				<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[IT Security]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.tiagosilva.eu/?p=40</guid>
		<description><![CDATA[Depois de uma interessante palestra dedicada à criptografia, em especial à importância dos vectores de inicialização nas cifras síncronas, no modo CBC (encadeamento do bloco da cifra) e como os dados de dos vectores de inicialização devem ser geridos, muito por necessidade da criação do formato (ou estrutura) dos ficheiros encriptados pelo meu programa de [...]]]></description>
			<content:encoded><![CDATA[<p>Depois de uma interessante palestra dedicada à criptografia, em especial à importância dos vectores de inicialização nas cifras síncronas, no modo CBC (encadeamento do bloco da cifra) e como os dados de dos vectores de inicialização devem ser geridos, muito por necessidade da criação do formato (ou estrutura) dos ficheiros encriptados pelo meu programa de criptografia baseado no algoritmo Rijndael e que segue o standard AES (por defeito com chaves de 256 bits ou 32 octetos) o Professor Doutor André Zúquete e eu acabamos por terminar a nossa conversa com o autógrafo de um exemplar do seu livro intitulado “Segurança em Redes Informáticas – 2ª Edição Aumentada”. Aproveito para informar que já saiu a 3ª edição do mesmo, a editora é a FCA.</p>
<p style="text-align: center;"><a href="http://www.tiagosilva.eu/wp-content/uploads/2010/06/Segurança_Em_Redes_Informáticas_2ª_Edição_Aumentada-Autografado.jpg"><img class="size-medium wp-image-44 aligncenter" title="Segurança_Em_Redes_Informáticas_2ª_Edição_Aumentada-Autografado" src="http://www.tiagosilva.eu/wp-content/uploads/2010/06/Segurança_Em_Redes_Informáticas_2ª_Edição_Aumentada-Autografado-300x207.jpg" alt="" width="300" height="207" /></a></p>
<p style="text-align: left;"><a href="http://www.tiagosilva.eu/wp-content/uploads/2010/06/Segurança_Em_Redes_Informaticas_2a_Edição_Aumentada-Autografado.jpg"><br />
</a>Aproveito para dar os parabéns pela 3ª edição, agora de 2010, que prova que realmente temos excelentes peritos em segurança de redes informáticas em Portugal e também os meus sinceros agradecimentos pessoais pela atenção oferecida.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiagosilva.eu/it-security/uma-visita-ao-professor-doutor-andre-zuquete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The search for the best tea!</title>
		<link>http://www.tiagosilva.eu/tea-tasting/the-search-for-the-best-tea/</link>
		<comments>http://www.tiagosilva.eu/tea-tasting/the-search-for-the-best-tea/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 20:54:14 +0000</pubDate>
		<dc:creator>Tiago Silva</dc:creator>
				<category><![CDATA[Tea Tasting]]></category>
		<category><![CDATA[Tea]]></category>

		<guid isPermaLink="false">http://www.tiagosilva.eu/?p=33</guid>
		<description><![CDATA[Dear readers, I’m posting this article to gather your personal opinions, for you to share your favourite tea blendings and brands. For an answer I just need, at least, the brand and blending names plus flavour and fragrance descriptions! Please remember that this article is about tea and not herbal infusions, the plant in question [...]]]></description>
			<content:encoded><![CDATA[<p>Dear readers,</p>
<p>I’m posting this article to gather your personal opinions, for you to share your favourite tea blendings and brands. For an answer I just need, at least, the brand and blending names plus flavour and fragrance descriptions! Please remember that this article is about tea and not herbal infusions, the plant in question is Camellia Sinensis.</p>
<p>Instead of telling the brand and blending names, if the described blending is your own, <span style="text-decoration: underline;">please share the recipe</span> too!</p>
<p>I look forward to see your feedback!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiagosilva.eu/tea-tasting/the-search-for-the-best-tea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Joomla! vs WordPress</title>
		<link>http://www.tiagosilva.eu/website-related/joomla-vs-wordpress/</link>
		<comments>http://www.tiagosilva.eu/website-related/joomla-vs-wordpress/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 23:57:10 +0000</pubDate>
		<dc:creator>Tiago Silva</dc:creator>
				<category><![CDATA[Website Related]]></category>
		<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.tiagosilva.eu/?p=19</guid>
		<description><![CDATA[After learning a little about the Joomla! framework, of how components, modules, plug-ins, templates and language packs work, I decided to learn something new, what should it be? Well, I needed my web page working faster and with a blog look. After spending lots of time changing the Joomla! looks, I started to wonder if [...]]]></description>
			<content:encoded><![CDATA[<p>After learning a little about the <a href="http://www.joomla.org/about-joomla.html" target="_blank">Joomla!</a> framework, of how components, modules, plug-ins, templates and language packs work, I decided to learn something new, what should it be?</p>
<p><span id="more-19"></span></p>
<p>Well, I needed my web page working faster and with a blog look. After spending lots of time changing the <a href="http://www.joomla.org/about-joomla.html" target="_blank">Joomla!</a> looks, I started to wonder if I was on the right path. I knew <a href="http://wordpress.org/" target="_blank">WordPress</a>, but little, so, I did some research and I found that it’s not just about any blogging platform, but also a great web development framework that already had good <a href="http://en.wikipedia.org/wiki/Javascript">JavaScript</a> code, like the great <a href="http://jquery.org/about">jQuery</a> <a href="http://en.wikipedia.org/wiki/API">API</a>, in its guts!</p>
<p>I have nothing against <a href="http://www.joomla.org/about-joomla.html" target="_blank">Joomla!</a>, I&#8217;m simply changing to <a href="http://wordpress.org/" target="_blank">WordPress</a> to learn more about its powers and abilities. Just for starters, I went to the <a href="http://wordpress.org/" target="_blank">WordPress</a> website and I enjoyed seeing that one of their goals is to keep the code light and simple, yet powerful, giving us developers a huge playground and keeping simple enough for all folks.</p>
<p>Have this in mind: if you’re searching for an open web development platform, <a href="http://www.joomla.org/about-joomla.html" target="_blank">Joomla!</a> has lots of features right out of the box, but it also has an complex code structure, while <a href="http://wordpress.org/" target="_blank">WordPress</a> is simple and has an light code structure.</p>
<p>In my case, I found that I like <a href="http://wordpress.org/" target="_blank">WordPress</a> simplicity and that with some <a href="http://en.wikipedia.org/wiki/Html">HTML</a>, <a href="http://en.wikipedia.org/wiki/Php">PHP</a> and <a href="http://en.wikipedia.org/wiki/Css">CSS</a> knowledge I can also use <a href="http://wordpress.org/" target="_blank">WordPress</a> almost the way I used <a href="http://www.joomla.org/about-joomla.html" target="_blank">Joomla!</a>.</p>
<p>It’s basically up to you! Both are good and powerful web development platforms.</p>
<p>In simple terms, if your final work must look something like a blogging platform, my advice is to use <a href="http://wordpress.org/" target="_blank">WordPress</a> because that’s what <a href="http://wordpress.org/" target="_blank">WordPress</a> is! While <a href="http://www.joomla.org/about-joomla.html" target="_blank">Joomla!</a> is a good <a href="http://en.wikipedia.org/wiki/Content_management_system">CMS</a> that can also became or have an blogging system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tiagosilva.eu/website-related/joomla-vs-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
