<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>My kemenworld...</title>
	<atom:link href="http://kementeus.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kementeus.wordpress.com</link>
	<description>To mock or not to mock...</description>
	<lastBuildDate>Mon, 31 Mar 2008 23:53:05 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='kementeus.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/a5b6db2bc1d6e75ae5b28cd2467a3055?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>My kemenworld...</title>
		<link>http://kementeus.wordpress.com</link>
	</image>
			<item>
		<title>The blog is dead&#8230; Long life the blog!!!</title>
		<link>http://kementeus.wordpress.com/2008/03/31/the-blog-is-dead-long-life-the-blog/</link>
		<comments>http://kementeus.wordpress.com/2008/03/31/the-blog-is-dead-long-life-the-blog/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 23:53:05 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/03/31/the-blog-is-dead-long-life-the-blog/</guid>
		<description><![CDATA[Bueno, ante una triste noticia, nuevamente me cambio de blog  , WordPress ha sido bueno hasta ahora, pero buscando un poco más de flexibilidad he decidido levantar un nuevo espacio usando BlogEngine.Net (yep, si en su mayoría escribo de .Net porqué no usar una plataforma en .Net?). Seguiré blogeando de lo que me gusta, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=94&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Bueno, ante una triste noticia, nuevamente me cambio de blog <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> , WordPress ha sido bueno hasta ahora, pero buscando un poco más de flexibilidad he decidido levantar un nuevo espacio usando BlogEngine.Net (yep, si en su mayoría escribo de .Net porqué no usar una plataforma en .Net?). Seguiré blogeando de lo que me gusta, de lo que me interesa y de lo que quiero seguir anotando para acordarme más tarde.</p>
<p>Los espero en mi nuevo espacio (<a href="http://www.cristianprieto.com">http://www.cristianprieto.com</a>), no se si seguiré haciendo crossposting a este espacio así que mejor hagan un update a sus marcadores y a sus RSS feeds.</p>
<p>The blog is dead&#8230; Long life the blog!!!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/94/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/94/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=94&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/03/31/the-blog-is-dead-long-life-the-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Quake 4 y la mandibula gigante flotante&#8230;</title>
		<link>http://kementeus.wordpress.com/2008/03/24/quake-4-y-la-mandibula-gigante-flotante/</link>
		<comments>http://kementeus.wordpress.com/2008/03/24/quake-4-y-la-mandibula-gigante-flotante/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 03:54:26 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[game]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/03/24/quake-4-y-la-mandibula-gigante-flotante/</guid>
		<description><![CDATA[No suelo publicar sobre esto, pero hace unas horas jugando Quake 4 en el level en que peleas con el boss del Network Security Installation (creo que es el level 29) me topé con esto algo extraño después de aniquilarlo:
&#160;
Alguien tiene idea de que rayos es eso? (ojo, las llamas supongo que son las de [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=93&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>No suelo publicar sobre esto, pero hace unas horas jugando Quake 4 en el level en que peleas con el boss del Network Security Installation (creo que es el level 29) me topé con esto algo extraño después de aniquilarlo:</p>
<p>&nbsp;<a title="weird quake network security boss bug" href="http://www.flickr.com/photos/21103633@N00/2356186221/"><img alt="weird quake network security boss bug" src="http://static.flickr.com/2400/2356186221_b2cd598cf3.jpg" border="0"></a></p>
<p>Alguien tiene idea de que rayos es eso? (ojo, las llamas supongo que son las de los propulsores que usaba el Boss y luego de eliminado siguen funcionando!)</p>
<p>&nbsp;</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/quake4" rel="tag">quake4</a>,<a href="http://technorati.com/tags/game" rel="tag">game</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/93/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/93/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=93&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/03/24/quake-4-y-la-mandibula-gigante-flotante/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>

		<media:content url="http://static.flickr.com/2400/2356186221_b2cd598cf3.jpg" medium="image">
			<media:title type="html">weird quake network security boss bug</media:title>
		</media:content>
	</item>
		<item>
		<title>WebSVN sin Enscript&#8230; (Pygments!!!)</title>
		<link>http://kementeus.wordpress.com/2008/03/18/websvn-sin-enscript-pygments/</link>
		<comments>http://kementeus.wordpress.com/2008/03/18/websvn-sin-enscript-pygments/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 21:43:45 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/03/18/websvn-sin-enscript-pygments/</guid>
		<description><![CDATA[Aunque esta un poco fuera de lo habitual y se que tengo que continuar con mi serie sobre estructuras bien formadas, esto es algo que anoto para que no se me vuelva a olvidar. Como muchos saben suelo usar Subversion para el control de código fuente (o sea como SCM), aunque no es del todo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=92&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Aunque esta un poco fuera de lo habitual y se que tengo que continuar con mi serie sobre estructuras bien formadas, esto es algo que anoto para que no se me vuelva a olvidar. Como muchos saben suelo usar Subversion para el control de código fuente (o sea como SCM), aunque no es del todo mi agrado usar Subersion no me queda mucho por escoger en mi oficina, bueno, de eso no se trata el post.</p>
<p><span id="more-92"></span></p>
<p>Algunos quizás sepan que hay webapps para poder ver los repositorios de <a href="http://subversion.tigris.org">Subversion</a> en el browser y así revisar nuestro repositorio, algunos de ellos son <a href="http://trac.edgewall.org">Trac</a> (que es más que un simple repo browser), <a href="http://www.viewcv.org">ViewCV</a> y <a href="http://websvn.tigris.org">WebSVN</a> (este último en PHP y usado por su simpleza para ver repositorios en SVN), aquí en la oficina usamos WebSVN para la colección de repositorios, pero si hay algo que irrita de WebSVN es su total incapacidad para resaltar texto en C# o VB.net.</p>
<p>WebSVN no resalta el código en estos lenguajes debido a que depende de <a href="http://www.codento.com/people/mtr/genscript/">Enscript</a> para el resaltado de texto; enscript no posee archivos de sintaxis para C# o VB.net (realmente si tiene para C# pero es realmente malo, nisiquiera resalta palabras claves como namespace o partial). Recuerdo que en la oficina un día aburridos hicimos un paster en Python usando <a href="http://www.pylonshq.org">Pylons</a> y para resaltar texto empleamos <a href="http://www.pygments.org">Pygments</a>, una excelente framework de resaltado de código fuente. Pygments puede usar la línea de comandos para resaltar texto mediante pygmentize así que decidí reemplazar el segmento de código en WebSVN que resalta el código y que en vez de enscript usara pygmentize.</p>
<p>Revisando el código de WebSVN fue algo dificil, el código es algo enmarañado, algo así al estilo de programadores de PHP a quienes les encanta ver acumulaciones de if en el código fuente, bueno, por lo menos no mezclaban HTML con PHP, algo es algo. Luego de revisar el código di como cambiar el resaltado a pygments y resaltar código en VB.net y C#.</p>
<p>En su instalación de WebSVN agreguen soporte para C# y VB.net modificando el archivo <em>include/setup.php</em>, busquen la línea que reza:</p>
<div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre style="width:100%;">
<div><span style="color:#800080;">$extEnscript</span><span style="color:#000000;"> </span><span style="color:#000000;">=</span><span style="color:#000000;"> </span><span style="color:#0000FF;">array</span><span style="color:#000000;"> </span><span style="color:#000000;">=</span><span style="color:#000000;">
(
    </span><span style="color:#000000;">'</span><span style="color:#000000;">.ada</span><span style="color:#000000;">'</span><span style="color:#000000;">   </span><span style="color:#000000;">=&gt;</span><span style="color:#000000;"> </span><span style="color:#000000;">'</span><span style="color:#000000;">ada</span><span style="color:#000000;">'</span><span style="color:#000000;">,</span><span style="color:#000000;">
</span></div>
</pre>
</div>
<p>Y agreguen donde quieran (claro, antes que cierre la declaración del arreglo) lo siguiente:</p>
<p><div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre style="width:100%;">
<div><span style="color:#000000;">   </span><span style="color:#000000;">'</span><span style="color:#000000;">.cs</span><span style="color:#000000;">'</span><span style="color:#000000;">  </span><span style="color:#000000;">=&gt;</span><span style="color:#000000;"> </span><span style="color:#000000;">'</span><span style="color:#000000;">csharp</span><span style="color:#000000;">'</span><span style="color:#000000;">,</span><span style="color:#000000;">
   </span><span style="color:#000000;">'</span><span style="color:#000000;">.vb</span><span style="color:#000000;">'</span><span style="color:#000000;">  </span><span style="color:#000000;">=&gt;</span><span style="color:#000000;"> </span><span style="color:#000000;">'</span><span style="color:#000000;">vbnet</span><span style="color:#000000;">'</span><span style="color:#000000;">,</span></div>
</pre>
</div>
<p>Luego de eso cambiemos de enscript a pygmentize, primero instalemos Pygments, esto es un paso simple (tomando en cuenta que instalaron WebSVN), la <a href="http://www.pygments.org/docs">documentación</a> esta en el sitio de Pygments.</p>
<p>Ahora busquemos el archivo <em>include/svnlook.php</em> y lleguemos a la línea que reza lo siguiente:</p>
<p><div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre style="width:100%;">
<div><span style="color:#800080;">$config</span><span style="color:#000000;">-&gt;</span><span style="color:#000000;">enscript</span><span style="color:#000000;">.</span><span style="color:#000000;">&quot;</span><span style="color:#000000;"> --language=html</span><span style="color:#000000;">&quot;</span><span style="color:#000000;">.</span><span style="color:#000000;">
(</span><span style="color:#800080;">$l</span><span style="color:#000000;"> </span><span style="color:#000000;">?</span><span style="color:#000000;"> </span><span style="color:#000000;">&quot;</span><span style="color:#000000;">--color --pretty-print=</span><span style="color:#800080;">$l</span><span style="color:#000000;">&quot;</span><span style="color:#000000;"> </span><span style="color:#000000;">:</span><span style="color:#000000;"> </span><span style="color:#000000;">&quot;&quot;</span><span style="color:#000000;">)</span><span style="color:#000000;">.</span><span style="color:#000000;">&quot;</span><span style="color:#000000;"> -o - | </span><span style="color:#000000;">&quot;</span><span style="color:#000000;">.</span></div>
</pre>
</div>
<p>En mi instalación particular de WebSVN esta en la <em>línea 584</em> aproximadamente. Ahora cambiemosla por algo mas simple: (ya sea comentando la anterior o borrandola)</p>
<p><div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre style="width:100%;">
<div><span style="color:#000000;">&quot;</span><span style="color:#000000;">pygmentize -f html -l </span><span style="color:#000000;">&quot;</span><span style="color:#000000;"> </span><span style="color:#000000;">.</span><span style="color:#000000;"> </span><span style="color:#800080;">$l</span><span style="color:#000000;"> </span><span style="color:#000000;">.</span><span style="color:#000000;"> </span><span style="color:#000000;">&quot;</span><span style="color:#000000;"> -O noclasses=1,style=colorful</span><span style="color:#000000;">&quot;</span><span style="color:#000000;">);</span></div>
</pre>
</div>
<p>Listo, ahora WebSVN resaltará el código usando Pygments y no tendrá problemas con nuestro VB.net o C#, simple no?</p>
<div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/php" rel="tag">php</a>,<a href="http://technorati.com/tags/websvn" rel="tag">websvn</a>,<a href="http://technorati.com/tags/subversion" rel="tag">subversion</a>,<a href="http://technorati.com/tags/pygments" rel="tag">pygments</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/92/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/92/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/92/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/92/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/92/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=92&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/03/18/websvn-sin-enscript-pygments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight en Opera!!!</title>
		<link>http://kementeus.wordpress.com/2008/03/12/silverlight-en-opera/</link>
		<comments>http://kementeus.wordpress.com/2008/03/12/silverlight-en-opera/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 19:01:04 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[opera]]></category>
		<category><![CDATA[silverlight]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/03/12/silverlight-en-opera/</guid>
		<description><![CDATA[Cómo muchos recordaran soy &#8220;algo fanático&#8221; de Opera (el browser) y también muchos ya habrán escuchado de Silverlight, también recordaran que Microsoft anunció soporte para multibrowser y multiplataforma (actualmente funciona en Windows y Mac, tanto en Internet Explorer, Firefox y Safari) y en Linux Icaza y sus amigos estan trabajando en Moonlight para brindar soporte [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=91&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Cómo muchos recordaran soy &#8220;algo fanático&#8221; de <a href="http://www.opera.com">Opera</a> (el browser) y también muchos ya habrán escuchado de Silverlight, también recordaran que Microsoft anunció soporte para multibrowser y multiplataforma (actualmente funciona en Windows y Mac, tanto en Internet Explorer, Firefox y Safari) y en Linux <a href="http://tirania.org/blog/index.html">Icaza</a> y sus amigos estan trabajando en <a href="http://www.mono-project.com/Moonlight">Moonlight</a> para brindar soporte en Linux (algo que a lo que veo va bastante avanzado). Recuerdo también en la primera presentación de Silverlight en el Mix07 la imagen del <a href="http://download.microsoft.com/download/f/2/e/f2ecc2ad-c498-4538-8a2c-15eb157c00a7/SL_Map_FinalNET.png">poster</a> (el cual tengo en la oficina) donde aparece Opera como uno de los browsers soportados, pero que si hasta el sol de hoy no he visto que nativamente funcione Silverlight en Opera como si nada. Cada vez que tengo que ver un demo me veo en la obligación de abrir mi IE7 más cercano para verlo.</p>
<p><span id="more-91"></span></p>
<p>Según estube leyendo y averiguando, realmente el modelo de plugin de Opera es muy similar al de Netscape, por lo que sus plugins son compatibles en cierta manera, esto es aprovechado por Opera para usar los plugins de Flash, Quicktime y similares. Qué pasó entonces con Silverlight? si hay para Mozilla Firefox porqué no para Opera?, sigo leyendo y me doy cuenta que en realidad el problema radica en el script de activación de Silverlight (un JS que detecta el browser y toma las acciones correspondientes) y aunque &#8220;teóricamente&#8221; debería funcionar con Opera, este no esta en la lista. Sigo buscando en internet y encuentro <a href="http://blog.crazyboomerang.com/2007/12/silverlight-in-opera.html">esto</a>, un fanático de Opera escribe un UserScript (una facilidad que tiene Opera, puedes decirle que cada vez que abra una página ejecute un script) que se encarga de modificar el script de Silverlight para que &#8220;haga compatible&#8221; Opera. Lo único que hay que hacer es lo siguiente:</p>
<ul>
<li><a href="http://www.microsoft.com/silverlight/">Instalar Silverlight</a></li>
<li>Irse a la carpeta dónde se instaló Silverlight (Program Files\Microsoft Silverlight)</li>
<li>Copiar su contenido a la carpeta de plugins de Opera (Program Files\Opera\program\plugins)</li>
<li>Bajar este <a href="http://www.microsoft.com/silverlight/">userscript</a> y copiarlo hacia la carpeta de tus userscripts (yo lo copie hacia Users\cristian\App Data\Roaming\Opera\profiles\Silverlight) y uso Vista Business</li>
<li>Reiniciar Opera y <a href="http://www.vertigo.com/downloads/Simon/">probar</a>!!!</li>
</ul>
<p>Entra a tu sitio Silverlight favorito y prueba, hago la aclaración, Opera esta trabajando en hacer su browser más compatible con Silverlight, espero que eso lo logré para la versión 9.5, actualmente uso la 9.26 y con algunos sitios TRUENA después de unos momentos, porqué? no tengo idea&#8230;. Lo importante es que con otros funciona sin muchos problemas, fuera de los que se mencionan en este <a href="http://blog.crazyboomerang.com/2007/12/silverlight-in-opera.html">post</a>.</p>
<p>Saludos y espero que les sirva este post a mas de alguien!</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/silverlight%20opera" rel="tag">silverlight opera</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=91&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/03/12/silverlight-en-opera/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Multiples archivos de configuraci&#243;n</title>
		<link>http://kementeus.wordpress.com/2008/03/03/multiples-archivos-de-configuracin/</link>
		<comments>http://kementeus.wordpress.com/2008/03/03/multiples-archivos-de-configuracin/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 15:37:23 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[.net framework]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/03/03/multiples-archivos-de-configuracin/</guid>
		<description><![CDATA[Hace un rato alguien me preguntó el caso específico en el cual el necesitaba separar la configuración del archivo del resto del archivo de configuración (sea web.config o app.config), y no sabía como hacerlo con la EntLib. Bueno, realmente es una facilidad que no solamente tiene la EntLib sino la configuración de la aplicación y [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=90&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hace un rato alguien me preguntó el caso específico en el cual el necesitaba separar la configuración del archivo del resto del archivo de configuración (sea web.config o app.config), y no sabía como hacerlo con la EntLib. Bueno, realmente es una facilidad que no solamente tiene la EntLib sino la configuración de la aplicación y permite dividir el archivo de configuración en varios archivos independientes, es lo equivalente a hacer un include de un archivo externo al archivo de configuración.</p>
<p><span id="more-90"></span></p>
<p>Para hacerlo es realmente sencillo, el archivo de inclusión NO necesita tener la extensión .config o llamarse de una manera en especial, pero es recomendable ya que así Visual Studio sabe que tipo de archivo es al momento de editarlo. Por ejemplo, guardemos la cadena de conexión en un archivo separado del resto:</p>
<p>
<div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre style="width:100%;">
<div><span style="color:#0000FF;">&lt;?</span><span style="color:#FF00FF;">xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; </span><span style="color:#0000FF;">?&gt;</span><span style="color:#000000;">
</span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">configuration</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
  </span><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">connectionStrings </span><span style="color:#FF0000;">file</span><span style="color:#0000FF;">=&quot;connection.config&quot;</span><span style="color:#FF0000;"> </span><span style="color:#0000FF;">/&gt;</span><span style="color:#000000;">
  </span><span style="color:#008000;">&lt;!--</span><span style="color:#008000;"> aqui va el resto de cosas que vamos a configurar </span><span style="color:#008000;">--&gt;</span><span style="color:#000000;">
</span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">configuration</span><span style="color:#0000FF;">&gt;</span></div>
</pre>
</div>
<p>Y el archivo externo (connection.config) tendría la siguiente forma:</p>
<p><div class="wlWriterSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre style="width:100%;">
<div><span style="color:#0000FF;">&lt;</span><span style="color:#800000;">connectionStrings</span><span style="color:#0000FF;">&gt;</span><span style="color:#000000;">
</span><span style="color:#008000;">&lt;!--</span><span style="color:#008000;"> aqui van la cadena de conexion configurada </span><span style="color:#008000;">--&gt;</span><span style="color:#000000;">
</span><span style="color:#0000FF;">&lt;/</span><span style="color:#800000;">connectionStrings</span><span style="color:#0000FF;">&gt;</span></div>
</pre>
</div>
<p>Solamente noten la limitante, el archivo externo debe tener como encabezado o nodo raíz el nodo referente en el archivo principal de conexión, eso involucra primeramente que nuestro archivo externo no debe comenzar con el familiar xml descriptor tag. Intersante no?</p>
<div class="wlWriterSmartContent" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/programming" rel="tag">programming</a>,<a href="http://technorati.com/tags/.net%20framework" rel="tag">.net framework</a>,<a href="http://technorati.com/tags/asp.net" rel="tag">asp.net</a>,<a href="http://technorati.com/tags/configuration" rel="tag">configuration</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/90/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/90/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=90&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/03/03/multiples-archivos-de-configuracin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Enterprise Library 3.1 en Visual Studio 2008 (Error al instalar)</title>
		<link>http://kementeus.wordpress.com/2008/03/03/enterprise-library-31-en-visual-studio-2008-error-al-instalar/</link>
		<comments>http://kementeus.wordpress.com/2008/03/03/enterprise-library-31-en-visual-studio-2008-error-al-instalar/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 01:04:46 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[.net framework]]></category>
		<category><![CDATA[EntLib]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/03/03/enterprise-library-31-en-visual-studio-2008-error-al-instalar/</guid>
		<description><![CDATA[Para alguno de ustedes que tengan una copia reciente de Visual Studio 2008 y hayan instalado el release de Febrero 2008 de GAT/GAX para Visual Studio 2008, quizás se hayan topado con la sorpresa al tratar de instalar la EntLib3.1 de Mayo 2007 que no los dejaba, dejando solamente un críptico error con código 2869 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=89&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Para alguno de ustedes que tengan una copia reciente de Visual Studio 2008 y hayan instalado el release de Febrero 2008 de GAT/GAX para Visual Studio 2008, quizás se hayan topado con la sorpresa al tratar de instalar la EntLib3.1 de Mayo 2007 que no los dejaba, dejando solamente un críptico error con código <strong>2869</strong> y dos ventanas sin ningun mensaje. Claro como el agua verdad?, bueno, el error es al parecer debido al GAT de Febrero, la forma más simple y sencilla de arreglarlo es dandole uncheck a las opciones de la AppBlock Factory GP y al Sign GP, con eso no tendremos las factories para hacer nuestros propios AppBlocks, pero al menos tendremos la EntLib <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/89/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/89/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/89/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/89/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/89/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=89&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/03/03/enterprise-library-31-en-visual-studio-2008-error-al-instalar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Ya sale la Enterprise Library 4.0!</title>
		<link>http://kementeus.wordpress.com/2008/02/28/ya-sale-la-enterprise-library-40/</link>
		<comments>http://kementeus.wordpress.com/2008/02/28/ya-sale-la-enterprise-library-40/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 04:48:16 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[.net framework]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[noticias]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/02/28/ya-sale-la-enterprise-library-40/</guid>
		<description><![CDATA[Grigori Melnik, el arquitecto y program manager para la Enterprise Library y del grupo de Patterns and Practices ya anunció la fecha oficial de salida de la Enterprise Library 4.0 (por lo menos la CTP) y la release final de Unity, el IoC de Microsoft con capacidad para integrarse con otros IoC como Sprint.NET y [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=88&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Grigori Melnik, el arquitecto y program manager para la Enterprise Library y del grupo de Patterns and Practices ya anunció la fecha oficial de salida de la Enterprise Library 4.0 (por lo menos la CTP) y la release final de Unity, el IoC de Microsoft con capacidad para integrarse con otros IoC como <a href="http://www.springframework.net/">Sprint.NET</a> y <a href="http://www.castleproject.org/container/index.html">Windsor</a>. Según estoy leyendo para el 15 de Marzo (release de Unity y del CTP de la EntLib4) esta versión de la EntLib no poseerá integración con Unity, sino hasta la versión final a finales de Abril. Los dejo con la noticia original en este <a href="http://blogs.msdn.com/agile/archive/2008/02/27/entlib-unity-roadmap.aspx">link</a>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/88/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/88/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=88&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/02/28/ya-sale-la-enterprise-library-40/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Copiando archivos en Windows Vista, porqu&#233; tan lento?</title>
		<link>http://kementeus.wordpress.com/2008/02/25/copiando-archivos-en-windows-vista-porqu-tan-lento/</link>
		<comments>http://kementeus.wordpress.com/2008/02/25/copiando-archivos-en-windows-vista-porqu-tan-lento/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 01:22:39 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/02/25/copiando-archivos-en-windows-vista-porqu-tan-lento/</guid>
		<description><![CDATA[Recuerdo que a finales del año pasado cuando hablaba sobre generalidades de Windows Vista programming (un tema que como muchos se dieron cuenta me encanta  ) alguien preguntó: &#8220;El transaction File System de Vista tiene que ver algo con el lento copiado de archivos de Windows Vista?&#8221;. Bueno, aunque he leído uno que otro [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=87&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recuerdo que a finales del año pasado cuando hablaba sobre generalidades de Windows Vista programming (un tema que como muchos se dieron cuenta me encanta <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ) alguien preguntó: &#8220;El transaction File System de Vista tiene que ver algo con el lento copiado de archivos de Windows Vista?&#8221;. Bueno, aunque he leído uno que otro poco sobre Vista Internals realmente en la red he encontrado todo tipo de explicaciones sobre el lento copiado de Windows Vista.</p>
<p><span id="more-87"></span></p>
<p>Soy franco al decirles que nada de lo que había leído sobre la velocidad de copiado de Windows Vista me había convencido, fue hasta cuando encontré hace ya varios días <a href="http://blogs.technet.com/markrussinovich/archive/2008/02/04/2826167.aspx">esta entrada</a> de Mark Russinovich (de la reputación de <a href="http://www.sysinternals.com">Sysinternals</a>) sobre las mejoras de copiado de archivos en el Vista Service Pack 1, y junto con ella la explicación del porqué en el pre-SP1 es tan lento. </p>
<p>En realidad leyendo el artículo me di cuenta que NO es que Windows XP sea más rápido copiando el archivo, simplemente al ser no cachada la copia del archivo el Explorer ignora la copia del archivo y destruye el cuadro de diálogo antes de que realmente el archivo sea copiado. Interesante no?</p>
<p>Aun no corro el SP1 de Vista, pero creanme que con joyas técnicas como estas estoy impaciente por instalarlo!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/87/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/87/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=87&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/02/25/copiando-archivos-en-windows-vista-porqu-tan-lento/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Clases y estructuras bien formadas, Parte II</title>
		<link>http://kementeus.wordpress.com/2008/02/24/clases-y-estructuras-bien-formadas-parte-ii/</link>
		<comments>http://kementeus.wordpress.com/2008/02/24/clases-y-estructuras-bien-formadas-parte-ii/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 01:10:43 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[.net framework]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/02/24/clases-y-estructuras-bien-formadas-parte-ii/</guid>
		<description><![CDATA[En la última entrega estubimos hablando de igualdad entre clases y como afectaba nuestra concepción de objetos, usamos para eso una clase simple con una coordenada en el espacio. Hoy modificaremos un poco la clase y usaremos una clase para identificar un número imaginario, recuerdan? aquellos números (también llamados &#8220;complejos&#8221;) donde existe una raíz imaginaria [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=86&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>En la última entrega estubimos hablando de igualdad entre clases y como afectaba nuestra concepción de objetos, usamos para eso una clase simple con una coordenada en el espacio. Hoy modificaremos un poco la clase y usaremos una clase para identificar un número imaginario, recuerdan? aquellos números (también llamados &#8220;complejos&#8221;) donde existe una raíz imaginaria o compleja que representa o explica que su potencia de dos es igual a menos 1 (para mayor info tenemos a nuestra amiga <a href="http://en.wikipedia.org/wiki/Complex_number">Wikipedia</a>) <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Nuevamente les recalco que las matemáticas no fueron mi fuerte, así que pido perdon a aquellos expertos que encuentren errores conceptuales en el artículo <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> , bueno, comencemos donde quedamos la última vez.</p>
<p><span id="more-86"></span></p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">using</span> System;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> <span style="color:#0000ff;">namespace</span> BlogExamples.WellFormedStructures</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> ComplexNumber : IEquatable&lt;ComplexNumber&gt;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>         <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">readonly</span> <span style="color:#0000ff;">int</span> _complexPart;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>         <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">readonly</span> <span style="color:#0000ff;">int</span> _realPart;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         <span style="color:#0000ff;">public</span> ComplexNumber(<span style="color:#0000ff;">int</span> realPart, <span style="color:#0000ff;">int</span> complexPart)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>             _realPart = realPart;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>             _complexPart = complexPart;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> RealPart</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>             get { <span style="color:#0000ff;">return</span> _realPart; }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> ComplexPart</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>             get { <span style="color:#0000ff;">return</span> _complexPart; }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">bool</span> Equals(ComplexNumber other)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>             <span style="color:#0000ff;">return</span> (_complexPart.Equals(other.ComplexPart) &amp;&amp; _realPart.Equals(other.RealPart));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  31:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">bool</span> <span style="color:#0000ff;">operator</span> ==(ComplexNumber complex1, ComplexNumber complex2)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  32:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  33:</span>             <span style="color:#0000ff;">return</span> complex1.Equals(complex2);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  34:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  35:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  36:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">bool</span> <span style="color:#0000ff;">operator</span> !=(ComplexNumber complex1, ComplexNumber complex2)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  37:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  38:</span>             <span style="color:#0000ff;">return</span> !(complex1 == complex2);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  39:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  40:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  41:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">int</span> GetHashCode()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  42:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  43:</span>             <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">string</span>.Format(<span style="color:#006080;">"{0}|{1}"</span>, _realPart, _complexPart).GetHashCode();</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  44:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  45:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  46:</span> }</pre>
</div>
</div>
<p>Bien, seguimos bajo la premisa que todo esto es solo como ejemplo verdad? si, si, si, más de alguien me dirá que hay una &#8220;mejor&#8221; forma de hacerlo pero lo único que quiero es explicar esto, ok?. Continuando con el ejemplo una simple unidad de prueba que comprobaría si todo funciona bien sería algo así:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">using</span> NUnit.Framework;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> <span style="color:#0000ff;">using</span> NUnit.Framework.SyntaxHelpers;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> <span style="color:#0000ff;">namespace</span> BlogExamples.WellFormedStructures.Fixtures</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     [TestFixture]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> ComplexNumberFixture</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>         [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestGetPropertiesCorrectly()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span>             ComplexNumber complex = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span>             Assert.That(complex.RealPart, Is.EqualTo(1));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span>             Assert.That(complex.ComplexPart, Is.EqualTo(0));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>         [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestEqualsWorks()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span>             ComplexNumber complex01 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  21:</span>             ComplexNumber complex02 = <span style="color:#0000ff;">new</span> ComplexNumber(0, 1);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  22:</span>             ComplexNumber complex03 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  23:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  24:</span>             Assert.That(complex01.Equals(complex02), Is.False);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  25:</span>             Assert.That(complex01.Equals(complex03), Is.True);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  26:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  27:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  28:</span>         [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  29:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestEqualOperatorWorks()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  30:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  31:</span>             ComplexNumber complex01 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  32:</span>             ComplexNumber complex02 = <span style="color:#0000ff;">new</span> ComplexNumber(0, 1);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  33:</span>             ComplexNumber complex03 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  34:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  35:</span>             Assert.That(complex01 == complex02, Is.False);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  36:</span>             Assert.That(complex01 == complex03, Is.True);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  37:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  38:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  39:</span>         [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  40:</span>         <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestNotEqualOperatorWorks()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  41:</span>         {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  42:</span>             ComplexNumber complex01 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  43:</span>             ComplexNumber complex02 = <span style="color:#0000ff;">new</span> ComplexNumber(0, 1);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  44:</span>             ComplexNumber complex03 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  45:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  46:</span>             Assert.That(complex01 != complex02, Is.True);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  47:</span>             Assert.That(complex01 != complex03, Is.False);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  48:</span>         }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  49:</span>     }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  50:</span> }</pre>
</div>
</div>
<p>Soy fanático de <a href="http://www.nunit.org">NUnit</a>, así que si más de alguien no entiende sería bueno que buscara en internet algo de info para ponerse al día (obviamente para correr la unidad de prueba ejemplo necesitas tener NUnit instalado verdad?). </p>
<h3>Qué pasó con valores nulos?</h3>
<p>Alguien precavido podrá notar que hay una condición que no estamos tomando en cuenta en nuestras pruebas, qué pasaría si uno de los valores de igualdad fuera nulo? Veamos entonces, agreguemos una prueba en la cual &#8220;esperaríamos&#8221; que si uno de los miebros es Null simplemente retorne false:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestEqualNullIsFalse()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     ComplexNumber complex01 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 0);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     ComplexNumber complex02 = <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     Assert.That(complex01.Equals(complex02), Is.False);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span> }</pre>
</div>
</div>
<p>Puff, no lo esperabamos! nuestra prueba falla!!!, analicemos un poco nuestro código. Inmediatamente alguien precavido dirá: &#8220;podemos agregar un simple if(other == null) return false; y resolveremos totalmente el asunto, pero lo que no contamos es que <em>ya hemos hecho un overload del operador</em> !=, esto nos pone en serios aprietos, ¿cómo podríamos hacer para probar la igualdad a nulo sin usar nuestro operador ya hecho?, claro! usemos el casting al padre de todos los objetos, <strong>Object</strong></p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#cc6633;">#region</span> IEquatable&lt;ComplexNumber&gt; Members</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">bool</span> Equals(ComplexNumber other)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     <span style="color:#0000ff;">if</span>((<span style="color:#0000ff;">object</span>) other != <span style="color:#0000ff;">null</span>)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>         <span style="color:#0000ff;">return</span> (_imaginaryPart.Equals(other.ImaginaryPart) &amp;&amp; _realPart.Equals(other.RealPart));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">false</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span> <span style="color:#cc6633;">#endregion</span></pre>
</div>
</div>
<p>Y si al comparar el extremo izquierdo en nuestro operador sobrecargado de igualdad se pasa un elemento nulo? bien arreglemos eso también:</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">bool</span> <span style="color:#0000ff;">operator</span> ==(ComplexNumber complex1, ComplexNumber complex2)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>    <span style="color:#0000ff;">if</span> ((<span style="color:#0000ff;">object</span>) complex1 == <span style="color:#0000ff;">null</span>) <span style="color:#0000ff;">return</span> ((<span style="color:#0000ff;">object</span>) complex2 == <span style="color:#0000ff;">null</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     <span style="color:#0000ff;">return</span> complex1.Equals(complex2);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span> }</pre>
</div>
</div>
<p>Agreguemos una prueba mas a nuestra <em>fixture</em></p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestEqualOperatorNullWorks()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     ComplexNumber complex01 = <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     ComplexNumber complex02 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 1);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     Assert.That(complex01 == complex02, Is.False);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     Assert.That(complex02 == complex01, Is.False);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span> }</pre>
</div>
</div>
<h3>Operadores binarios simples</h3>
<p>Bien, como lo que nos interesa es representar un número complejo no sería un número si no podríamos operar en el cual número que debería ser, bien, más de alguien dirá: &#8220;implementemos un método llamado Add que sirva para añadir, Substract para substraer y así sucesivamente&#8221;. Bien, hagamos eso, veamos que resulta.</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> <span style="color:#0000ff;">public</span> ComplexNumber AddComplex(ComplexNumber number)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span>     <span style="color:#0000ff;">if</span>(number == <span style="color:#0000ff;">null</span>)</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>         <span style="color:#0000ff;">throw</span> <span style="color:#0000ff;">new</span> ArgumentNullException(<span style="color:#006080;">"number"</span>, <span style="color:#006080;">"Parameter should not being null"</span>);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>         </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">new</span> ComplexNumber(_realPart + number.RealPart, _imaginaryPart + number.ImaginaryPart);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span> }</pre>
</div>
</div>
<p>Por supuesto que <em>debemos</em> implementar el respectivo test de nuestro método</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestAddComplexNumber()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span>     ComplexNumber complex01 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 1);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     ComplexNumber complex02 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 2);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>     ComplexNumber complex03 = complex01.AddComplex(complex02);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>     Assert.That(complex03.RealPart, Is.EqualTo(2));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span>     Assert.That(complex03.ImaginaryPart, Is.EqualTo(3));</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span> }</pre>
</div>
</div>
<p>Fácil no?, de igual manera podemos hacer overload de otros operadores matemáticos como -, *, /, % (algo que por tiempo y espacio no haremos, pero en el código de muestra ya incluyo). Para asegurarnos que todo esta bien intentemos un último caso, en el que los miembros sean nulos.</p>
<div>
<div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   1:</span> [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   2:</span> [ExpectedException(<span style="color:#0000ff;">typeof</span>(ArgumentNullException))]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   3:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestAddComplexNumberNull()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   4:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   5:</span>     ComplexNumber complex01 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 1);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   6:</span>     ComplexNumber complex02 = <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   7:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   8:</span>     ComplexNumber complex03 = complex01.AddComplex(complex02);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">   9:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  10:</span> }</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  11:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  12:</span> [Test]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  13:</span> [ExpectedException(<span style="color:#0000ff;">typeof</span>(ArgumentNullException))]</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  14:</span> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">void</span> TestAddComplexNumberOperatorNull()</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  15:</span> {</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  16:</span>     ComplexNumber complex01 = <span style="color:#0000ff;">null</span>;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  17:</span>     ComplexNumber complex02 = <span style="color:#0000ff;">new</span> ComplexNumber(1, 2);</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  18:</span>&nbsp; </pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  19:</span>     ComplexNumber complex03 = complex01 + complex02;</pre>
<pre style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"><span style="color:#606060;">  20:</span> }</pre>
</div>
</div>
<p>Bien, hasta aquí llegamos hoy, para la próxima entrega tocaremos el uso de operadores unarios y un par de cositas más, mientras tanto pueden bajar la solución completa con los ejemplos en este <a href="http://www.box.net/shared/ju0i6e60ws">link</a>. Como siempre cualquier pregunta o sugerencia estamos a un comment o post de distancia. Saludos! </p>
<p><a href="http://kementeus.wordpress.com/2008/02/13/clases-y-estructuras-bien-formadas-parte-i/">Parte I</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/86/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/86/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=86&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/02/24/clases-y-estructuras-bien-formadas-parte-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
		<item>
		<title>Mis diapositivas del NHibernate</title>
		<link>http://kementeus.wordpress.com/2008/02/21/mis-diapositivas-del-nhibernate/</link>
		<comments>http://kementeus.wordpress.com/2008/02/21/mis-diapositivas-del-nhibernate/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 04:37:24 +0000</pubDate>
		<dc:creator>kementeus</dc:creator>
				<category><![CDATA[.net framework]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[charlas]]></category>

		<guid isPermaLink="false">http://kementeus.wordpress.com/2008/02/21/mis-diapositivas-del-nhibernate/</guid>
		<description><![CDATA[Luego de mucho hablar y con el tiempo restringido terminamos exitosamente de conocer nhibernate por encimita, había mucho que hablar y muy poco tiempo, como siempre los invito a que se lean la documentación y como siempre experimenten, tomen un su proyecto mascota y comienzen a experimentar, no hay mejor forma de aprender  

Junto [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=85&subd=kementeus&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Luego de mucho hablar y con el tiempo restringido terminamos exitosamente de conocer <a href="http://www.nhibernate.org">nhibernate</a> por encimita, había mucho que hablar y muy poco tiempo, como siempre los invito a que se lean la documentación y como siempre experimenten, tomen un su proyecto mascota y comienzen a experimentar, no hay mejor forma de aprender <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><span id="more-85"></span></p>
<p>Junto con las diapositivas incluyo el código que usé para ejemplos, recuerden que usé Northwind para explicar relaciones!. Bien <a href="http://www.box.net/shared/qu1x51e88g">aquí</a> esta mi diapositiva y <a href="http://www.box.net/shared/ghu5pa204c">aquí</a> mis ejemplos.</p>
<p>Como siempre cualquier consulta estamos a un correo o comment de distancia.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kementeus.wordpress.com/85/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kementeus.wordpress.com/85/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kementeus.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kementeus.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kementeus.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kementeus.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kementeus.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kementeus.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kementeus.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kementeus.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kementeus.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kementeus.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kementeus.wordpress.com&blog=463376&post=85&subd=kementeus&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://kementeus.wordpress.com/2008/02/21/mis-diapositivas-del-nhibernate/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e873c95a976d9ca1bf89f9cf140ab945?s=96&#38;d=identicon" medium="image">
			<media:title type="html">kementeus</media:title>
		</media:content>
	</item>
	</channel>
</rss>