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

<channel>
	<title>Gustavo Peiretti</title>
	<atom:link href="http://gustavopeiretti.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gustavopeiretti.com</link>
	<description>Desarrollo de Software</description>
	<lastBuildDate>Tue, 15 May 2012 14:14:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Leer una DBF con Java</title>
		<link>http://gustavopeiretti.com/2012/leer-una-dbf-con-java/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=leer-una-dbf-con-java</link>
		<comments>http://gustavopeiretti.com/2012/leer-una-dbf-con-java/#comments</comments>
		<pubDate>Tue, 15 May 2012 14:14:59 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[dbf]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1530</guid>
		<description><![CDATA[Me encontré con la necesidad de leer un archivo de tipo &#8220;dbf&#8221; (dBase) y buscando un poco encontre esta librería que me resolvio el problema. http://dans-dbf-lib.sourceforge.net/ El jar lo puedes descargar desde http://sourceforge.net/projects/dans-dp-lib/files/ A modo de ejemplo alcanza con observar esta clase&#8230; import nl.knaw.dans.common.dbflib.Field; import nl.knaw.dans.common.dbflib.IfNonExistent; import nl.knaw.dans.common.dbflib.Record; import nl.knaw.dans.common.dbflib.Table; import nl.knaw.dans.common.dbflib.Type; &#160; /** * &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2012/leer-una-dbf-con-java/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Me encontré con la necesidad de leer un archivo de tipo &#8220;dbf&#8221; (dBase) y buscando un poco encontre esta librería que me resolvio el problema.  http://dans-dbf-lib.sourceforge.net/<br />
El jar lo puedes descargar desde http://sourceforge.net/projects/dans-dp-lib/files/</p>
<p>A modo de ejemplo alcanza con observar esta clase&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.knaw.dans.common.dbflib.Field</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.knaw.dans.common.dbflib.IfNonExistent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.knaw.dans.common.dbflib.Record</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.knaw.dans.common.dbflib.Table</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.knaw.dans.common.dbflib.Type</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Read DBF File
 * @author Gustavo
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ReadDBF <span style="color: #000000; font-weight: bold;">implements</span> IRead <span style="color: #009900;">&#123;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> read<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> fileToRead, IRecordData rec<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		Table table <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Table<span style="color: #009900;">&#40;</span>fileToRead<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			table.<span style="color: #006633;">open</span><span style="color: #009900;">&#40;</span>IfNonExistent.<span style="color: #006633;">ERROR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			List<span style="color: #339933;">&lt;</span>Field<span style="color: #339933;">&gt;</span> fields <span style="color: #339933;">=</span> table.<span style="color: #006633;">getFields</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			Iterator<span style="color: #339933;">&lt;</span>Record<span style="color: #339933;">&gt;</span> iterator <span style="color: #339933;">=</span> table.<span style="color: #006633;">recordIterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span>iterator.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				Record record <span style="color: #339933;">=</span> iterator.<span style="color: #006633;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">final</span> Map<span style="color: #339933;">&lt;</span>String, Object<span style="color: #339933;">&gt;</span> m <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;</span>String, Object<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Field</span> field <span style="color: #339933;">:</span> fields<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
					<span style="color: #003399;">Object</span> value<span style="color: #339933;">;</span>
					<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">LOGICAL</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						value <span style="color: #339933;">=</span> record.<span style="color: #006633;">getBooleanValue</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">NUMBER</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						value <span style="color: #339933;">=</span> record.<span style="color: #006633;">getNumberValue</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">CHARACTER</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						value <span style="color: #339933;">=</span> record.<span style="color: #006633;">getStringValue</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">DATE</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						value <span style="color: #339933;">=</span> record.<span style="color: #006633;">getDateValue</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">FLOAT</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						value <span style="color: #339933;">=</span> record.<span style="color: #006633;">getNumberValue</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">GENERAL</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						value <span style="color: #339933;">=</span> record.<span style="color: #006633;">getStringValue</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">BINARY</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #666666; font-style: italic;">// no implementado</span>
						value <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">PICTURE</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #666666; font-style: italic;">// no implementado</span>
						value <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Type.<span style="color: #006633;">MEMO</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getType</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #666666; font-style: italic;">// no implementado</span>
						value <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">Exception</span><span style="color: #009900;">&#40;</span>
								<span style="color: #0000ff;">&quot;No se reconoce el tipo de dato para el campo &quot;</span>
										<span style="color: #339933;">+</span> field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
					m.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>field.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				rec.<span style="color: #006633;">data</span><span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">finally</span> <span style="color: #009900;">&#123;</span>
			table.<span style="color: #006633;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// siempre cerrar!!</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>La clase la tengo definida en un bean de Spring, por eso implementa la una interfaz IRead que tienen solo el método <em>read(File fileToRead, IRecordData rec)</em></p>
<p>Con JUnit hago una prueba&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">service.IRead</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">service.IRecordData</span><span style="color: #339933;">;</span>
&nbsp;
@RunWith<span style="color: #009900;">&#40;</span>SpringJUnit4ClassRunner.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
@ContextConfiguration<span style="color: #009900;">&#40;</span>locations <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;/application-context.xml&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestReadDBF <span style="color: #009900;">&#123;</span>
&nbsp;
	@BeforeClass
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Autowired
	@Qualifier<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;readFile&quot;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #000000; font-weight: bold;">private</span> IRead readFile<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// bean de Spring</span>
&nbsp;
&nbsp;
	@Test 
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> simpleTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		readFile.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;c://test/fileDBFTest.dbf&quot;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> IRecordData<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			@Override
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> data<span style="color: #009900;">&#40;</span>Map<span style="color: #339933;">&lt;</span>String, Object<span style="color: #339933;">&gt;</span> m<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				Set<span style="color: #339933;">&lt;</span>Entry<span style="color: #339933;">&lt;</span>String, Object<span style="color: #339933;">&gt;&gt;</span> dataSet <span style="color: #339933;">=</span> m.<span style="color: #006633;">entrySet</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>Entry<span style="color: #339933;">&lt;</span>String, Object<span style="color: #339933;">&gt;</span> value <span style="color: #339933;">:</span> dataSet<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">print</span><span style="color: #009900;">&#40;</span>value.<span style="color: #006633;">getKey</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; : &quot;</span> <span style="color: #339933;">+</span> value.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
							<span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; | &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;--------&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@AfterClass
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> endClazz<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// ...</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2012/leer-una-dbf-con-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tu página Web para tu Negocio</title>
		<link>http://gustavopeiretti.com/2012/tu-pagina-web-para-tu-negocio/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=tu-pagina-web-para-tu-negocio</link>
		<comments>http://gustavopeiretti.com/2012/tu-pagina-web-para-tu-negocio/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 20:00:01 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[PaginasWeb]]></category>
		<category><![CDATA[Servicios]]></category>
		<category><![CDATA[SitiosWeb]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1475</guid>
		<description><![CDATA[Puedo ayudarte para que tengas tu Sitio Web completo para tu negocio. No dudes en consultar cualquier inquietud. Páginas web para Tu Negocio o Servicio a muy buen precio. Atractivas y con excelente alcance para que tengas un lugar en Internet donde puedas destacar aún mas tus productos y servicios. Incluyen diseño, hosting y dominio. &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2012/tu-pagina-web-para-tu-negocio/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<blockquote><p>Puedo ayudarte para que tengas tu Sitio Web completo para tu negocio. No dudes en <a title="Contacto" href="http://gustavopeiretti.com/contacto/">consultar </a>cualquier inquietud.</p></blockquote>
<p>Páginas web para Tu Negocio o Servicio a muy buen precio. Atractivas y con excelente alcance para que tengas un lugar en Internet donde puedas destacar aún mas tus productos y servicios.<br />
Incluyen diseño, hosting y dominio.<br />
Páginas con 3 secciones (Inicio, Productos y Servicios, y formulario de Contacto) desde $ 300 pago único anual.<br />
Página de ejemplo <a href="http://tunegocioesinternet.com.ar/">http://tunegocioesinternet.com.ar/</a></p>
<h2>Tu Negocio o Servicios tendrán mayor alcance…</h2>
<p style="text-align: center;"><img class="aligncenter  wp-image-1453" title="alcance" src="http://gustavopeiretti.com/blog/wp-content/uploads/2012/04/alcance.jpg" alt="" width="512" height="342" /></p>
<p>Un sitio Web proyecta una imagen profesional y de confianza sobre tu negocio…<br />
Promueve la comunicación y fidelización con tus clientes…<br />
Es un importante potenciador de otros medios de comunicación…<br />
Es un medio económico en relación a otros…<br />
Permanece Full Time las 24 hs. los 365 días del año…<br />
Es una ventaja que aumenta tu competitividad por sobre otros…</p>
<h2>Destaca tus productos y servicios…</h2>
<p style="text-align: center;"><img class="aligncenter  wp-image-1456" title="destacar" src="http://gustavopeiretti.com/blog/wp-content/uploads/2012/04/destacar.jpg" alt="" width="512" height="342" /></p>
<p>Tu propia página te ayudará a destacar los productos y servicios que ofreces, aumentando su atracción para tus actuales y futuros clientes. Lograrás que tus productos resulten más interesantes para tus clientes, creando el deseo de tenerlos por sobre otros de la competencia.</p>
<h2>Tu Propio Sitio aumenta la confianza de tus clientes…</h2>
<p style="text-align: center;"><img class="aligncenter  wp-image-1460" title="confianza" src="http://gustavopeiretti.com/blog/wp-content/uploads/2012/04/confianza.jpg" alt="" width="512" height="342" /></p>
<p>Hoy todos consultamos en Google cuando queres ampliar nuestra información sobre un producto antes de adquirirlo. Tu negocio debe estar en Internet.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2012/tu-pagina-web-para-tu-negocio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Generar Codigo QR</title>
		<link>http://gustavopeiretti.com/2012/java-generar-codigo-qr/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-generar-codigo-qr</link>
		<comments>http://gustavopeiretti.com/2012/java-generar-codigo-qr/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 14:01:03 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Barcode]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1376</guid>
		<description><![CDATA[Como siempre, nada es mejor que un ejemplo&#8230; Aquí utilizo las librerías provistas por http://code.google.com/p/zxing/ Este simple ejemplo contiene dos metodos, uno para crear una imagen con el QR a partir de un texto y otro para leer el QR desde la imagen. Necesitamos qrcodegen.jar y qrcodegen2.jar &#160; &#160; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2012/java-generar-codigo-qr/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Como siempre, nada es mejor que un ejemplo&#8230;</p>
<p>Aquí utilizo las librerías provistas por http://code.google.com/p/zxing/</p>
<p>Este simple ejemplo contiene dos metodos, uno para crear una imagen con el QR a partir de un texto y otro para leer el QR desde la imagen.</p>
<p>Necesitamos qrcodegen.jar y qrcodegen2.jar</p>
<p>&nbsp;</p>
<p><span id="more-1376"></span></p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.awt.image.BufferedImage</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.FileInputStream</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.ByteBuffer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.CharBuffer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.charset.Charset</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.nio.charset.CharsetEncoder</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.imageio.ImageIO</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.BinaryBitmap</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.LuminanceSource</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.Result</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.client.j2se.BufferedImageLuminanceSource</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.client.j2se.MatrixToImageWriter</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.common.BitMatrix</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.common.HybridBinarizer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.qrcode.QRCodeReader</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.zxing.qrcode.QRCodeWriter</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * QRSample Sample Code Using http://code.google.com/p/zxing/
 *
 * @author peiretti
 *
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestQRCode <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        TestQRCode qr <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TestQRCode<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">File</span> f <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">File</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;c://tmp/qrCode.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">String</span> text <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;All you need is love, love. Love is all you need. Beatles&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            qr.<span style="color: #006633;">generateQR</span><span style="color: #009900;">&#40;</span>f, text, <span style="color: #cc66cc;">300</span>, <span style="color: #cc66cc;">300</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;QRCode Generated: &quot;</span> <span style="color: #339933;">+</span> f.<span style="color: #006633;">getAbsolutePath</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">// QRCode Generated: c:\tmp\qrCode.png</span>
&nbsp;
            <span style="color: #003399;">String</span> qrString <span style="color: #339933;">=</span> qr.<span style="color: #006633;">decoder</span><span style="color: #009900;">&#40;</span>f<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Text QRCode: &quot;</span> <span style="color: #339933;">+</span> qrString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">// Text QRCode: All you need is love, love. Love is all you need. Beatles</span>
&nbsp;
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Exception</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">File</span> generateQR<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> file, <span style="color: #003399;">String</span> text, <span style="color: #000066; font-weight: bold;">int</span> h, <span style="color: #000066; font-weight: bold;">int</span> w<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        Charset charset <span style="color: #339933;">=</span> Charset.<span style="color: #006633;">forName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ISO-8859-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        CharsetEncoder encoder <span style="color: #339933;">=</span> charset.<span style="color: #006633;">newEncoder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> b <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        ByteBuffer bbuf <span style="color: #339933;">=</span> encoder.<span style="color: #006633;">encode</span><span style="color: #009900;">&#40;</span>CharBuffer.<span style="color: #006633;">wrap</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        b <span style="color: #339933;">=</span> bbuf.<span style="color: #006633;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003399;">String</span> data <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span>b, <span style="color: #0000ff;">&quot;ISO-8859-1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// get a byte matrix for the data</span>
        BitMatrix matrix <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
        QRCodeWriter writer <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> QRCodeWriter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        matrix <span style="color: #339933;">=</span> writer.<span style="color: #006633;">encode</span><span style="color: #009900;">&#40;</span>data, com.<span style="color: #006633;">google</span>.<span style="color: #006633;">zxing</span>.<span style="color: #006633;">BarcodeFormat</span>.<span style="color: #006633;">QR_CODE</span>, w, h<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #666666; font-style: italic;">// matrix = generateVCardQRCode(null, &quot;H&quot;);</span>
        MatrixToImageWriter.<span style="color: #006633;">writeToFile</span><span style="color: #009900;">&#40;</span>matrix, <span style="color: #0000ff;">&quot;PNG&quot;</span>, file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> file<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> decoder<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> file<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #003399;">FileInputStream</span> inputStream <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">FileInputStream</span><span style="color: #009900;">&#40;</span>file<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">BufferedImage</span> image <span style="color: #339933;">=</span> ImageIO.<span style="color: #006633;">read</span><span style="color: #009900;">&#40;</span>inputStream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// convert the image to a binary bitmap source</span>
        LuminanceSource source <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BufferedImageLuminanceSource<span style="color: #009900;">&#40;</span>image<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        BinaryBitmap bitmap <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> BinaryBitmap<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> HybridBinarizer<span style="color: #009900;">&#40;</span>source<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// decode the barcode</span>
        QRCodeReader reader <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> QRCodeReader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        Result result <span style="color: #339933;">=</span> reader.<span style="color: #006633;">decode</span><span style="color: #009900;">&#40;</span>bitmap<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#40;</span>result.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getBytes</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;UTF8&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2012/java-generar-codigo-qr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JUnit: test Parametrizados</title>
		<link>http://gustavopeiretti.com/2012/junit-test-parametrizados/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=junit-test-parametrizados</link>
		<comments>http://gustavopeiretti.com/2012/junit-test-parametrizados/#comments</comments>
		<pubDate>Sun, 11 Mar 2012 15:53:00 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JUnit]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1346</guid>
		<description><![CDATA[Me encuentro seguido con la necesidad de realizar pruebas pasando a mis test case ciertos parametros. Este simple ejemplo  permite ver como JUnit lo resuelve. Para esto debes anotar la clase con @RunWith(Parameterized.class) import java.util.ArrayList; import java.util.List; &#160; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; &#160; /** * Ejemplo de test Parametrizado &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2012/junit-test-parametrizados/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Me encuentro seguido con la necesidad de realizar pruebas pasando a mis test case ciertos parametros.<br />
Este simple ejemplo  permite ver como JUnit lo resuelve.<br />
Para esto debes anotar la clase con @RunWith(Parameterized.class)</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Assert</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.runner.RunWith</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.runners.Parameterized</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.runners.Parameterized.Parameters</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * Ejemplo de test Parametrizado
 * Ejecutar un test que reciba dos parametros y los compare en tres oportunidades
 * @author Gustavo Peiretti
 *
 */</span>
@RunWith<span style="color: #009900;">&#40;</span>Parameterized.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestExampleParameterized <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> string1<span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> string2<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Cada parametro sera cargado con los valores devueltos por {@link #data()}
     * @param s1
     * @param s2
     */</span>
    <span style="color: #000000; font-weight: bold;">public</span> TestExampleParameterized<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> s1, <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">String</span> s2<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">string1</span> <span style="color: #339933;">=</span> s1<span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">string2</span> <span style="color: #339933;">=</span> s2<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Parametros que seran utilizados para instanciar el test
     * @return
     * @throws Exception
     */</span>
    @Parameters
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">List</span> data<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> <span style="color: #003399;">Exception</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399;">List</span> datos <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        datos.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span>  <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;A&quot;</span>, <span style="color: #0000ff;">&quot;A&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        datos.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;B&quot;</span>, <span style="color: #0000ff;">&quot;BX&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        datos.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #0000ff;">&quot;C&quot;</span>, <span style="color: #0000ff;">&quot;C&quot;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">return</span> datos<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #008000; font-style: italic; font-weight: bold;">/**
     * Ejecuta el test tantas veces como datos existan en {@link #data()}
     */</span>
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testComparar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Evaluando: &quot;</span><span style="color: #339933;">+</span> string1 <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; = &quot;</span> <span style="color: #339933;">+</span> string2 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">Assert</span>.<span style="color: #006633;">assertTrue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No son iguales &quot;</span> <span style="color: #339933;">+</span> string1 <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; != &quot;</span> <span style="color: #339933;">+</span> string2, string1 <span style="color: #339933;">==</span> string2 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2012/junit-test-parametrizados/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problemas habituales en la determinación de los Requerimientos de Software</title>
		<link>http://gustavopeiretti.com/2011/problemas-habituales-requisitos-software/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=problemas-habituales-requisitos-software</link>
		<comments>http://gustavopeiretti.com/2011/problemas-habituales-requisitos-software/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 18:27:12 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1143</guid>
		<description><![CDATA[Las actividades de recopilación de requisitos constituyen uno  de los factores más importantes para el éxito de todo software. En ella debemos comprometernos, junto con el cliente, en la selección adecuada de las necesidades, distinguiendo entre lo que el usuario desea y lo que el usuario realmente necesita, a fin de lograr determinar el alcance &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2011/problemas-habituales-requisitos-software/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><strong><span style="text-decoration: underline;"><img class="alignright size-full wp-image-1176" title="Requerimientos" src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/11/requerimientos.jpg" alt="" width="310" height="387" /></span></strong>Las actividades de recopilación de requisitos constituyen uno  de los factores más importantes para el éxito de todo software. En ella debemos comprometernos, junto con el cliente, en la selección adecuada de las necesidades, distinguiendo entre lo que el usuario desea y lo que el usuario realmente necesita, a fin de lograr determinar el alcance preciso y el costo de desarrollo; entendiéndose por costo a la suma de tiempo, recursos y cualquier otro elemento necesario para cumplimentar el requerimiento.</p>
<p>Destaco estos problemas habituales que suelen hallarse en la obtención de los requisitos, quizás por ser los más recurrentes:</p>
<p>-Inexactitudes o incorrecta descripción del problema a resolver, el usuario no tiene claro lo que necesita, la especificación de los objetivos es ambigua.<br />
-Se omiten factores asociados que también tendrán impacto durante el cambio; la determinación de la propagación del cambio es difícil de determinar.<br />
-Validaciones no previstas, ya sea por parte del usuario o del analista, que luego se transformaran en mantenimientos posteriores en etapas productivas.<br />
-Problemas en la identificación de las personas afectadas por el cambio que deben ser involucradas.<br />
-Desconocimiento del usuario sobre los procesos básicos de desarrollo de software impidiendo que entienda el porqué de los costos, sobre todo los asociados a tiempos; o del analista en el esclarecimiento del mismo.<br />
-Cambios de improviso luego de que el alcance ha sido determinado.<br />
-La visión del usuario respecto a procesos similares que pueden ser &#8216;copiados&#8217; en el nuevo software, subestimando el trabajo.<br />
-Uso excesivo de negativas por parte del analista provocando mayores presiones del usuario para lograr lo que él desea.<br />
-Uso de vocabulario técnico del analista en disonancia con el vocabulario conocido por el cliente.<br />
-Falta de documentación y prototipos que permitan una validación concreta del usuario sobre el avance del proceso de desarrollo.</p>
<p>La petición del cliente  es en general el punto de partida de la construcción del software por lo debemos promover que sea el cliente el que escriba en forma general el Requerimiento inicial ya que esto lo lleva a clarificar sus ideas para la determinación de las necesidades. El analista debe acompañarlo con entrevistas, cuestionarios, observación y revisión de estos documentos, para luego pasar a la confección de la documentación técnica.</p>
<p>“Los requisitos del sistema no siempre se puede afirmar totalmente de antemano porque el usuario no los conoce de antemano.  Afirmar lo contrario es ignorar el hecho de que el propio proceso de desarrollo cambia la percepción del usuario de lo que es posible, aumenta sus conocimientos del  entorno de la aplicación e incluso a menudo cambia el entorno por sí mismo”.  Daniel McCracken</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2011/problemas-habituales-requisitos-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Desarrollo de Software: ¿cuándo son útiles los prototipos?</title>
		<link>http://gustavopeiretti.com/2011/desarrollo-prototipos/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=desarrollo-prototipos</link>
		<comments>http://gustavopeiretti.com/2011/desarrollo-prototipos/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 13:29:13 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1001</guid>
		<description><![CDATA[No es errado decir que muchas empresas, principalmente aquellas que no están orientadas al desarrollo de software carecen en sus departamentos de desarrollo de métodos que combinen calidad y tiempos de entrega. En general suelen tener privilegio los tiempos y recursos asociados a la venta comercial por sobre la capacidad de los departamentos de sistemas &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2011/desarrollo-prototipos/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-1138" title="Prototipos" src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/07/prototipos.jpg" alt="" width="339" height="226" /></p>
<p>No es errado decir que muchas empresas, principalmente aquellas que no están orientadas al desarrollo de software carecen en sus departamentos de desarrollo de métodos que combinen calidad y tiempos de entrega. En general suelen tener privilegio los tiempos y recursos asociados a la venta comercial por sobre la capacidad de los departamentos de sistemas para darles soporte.</p>
<p>Aquí es cuando resulta complicado identificar y obtener, de los usuarios de las aplicaciones, los requisitos detallados y la salida esperada de los procesos.  Es en estos casos cuando es bueno trabajar con prototipos que sirvan como mecanismo para la identificación detallada de los requisitos a cumplir por el software.</p>
<p>Entendemos por prototipo a cualquier elemento ‘tangible’ que se elabora para comprender mejor el proyecto o parte de un proyecto.</p>
<p>Los prototipos nos ayudaran además a  definir el alcance del proyecto cuando este no está claro y será además un elemento visible para medir su avance. A su vez los desarrolladores tendrán mayor certeza de que los algoritmos de procesamiento están descriptos según lo esperado.</p>
<p>Otro aspecto importante es comprender que con los prototipos nos aseguramos de darle a nuestro cliente un feedback de lo que hemos entendido y de lo que pretendemos trasladar al desarrollo. También lo comprometemos con la correcta definición y calidad del producto final.  Es común encontrarse con requerimientos que trasladan deseos personales por sobre necesidades reales y que luego se transforman en aplicaciones que no responden al negocio.</p>
<p>Hay que apoyarse en estas premisas al definir un prototipo:</p>
<ul>
<li>Tiempo: el cliente tiene poco tiempo.</li>
<li>Terminología: el cliente no entiende de términos      informáticos, los desarrolladores no de términos comerciales. El prototipo      hace de interlocutor entre ambas visiones.</li>
<li>Simplicidad: El cliente desea productos que resuelvan su      problema y no que lo compliquen. El prototipo acorta la distancia entre la      imaginación del cliente y su real necesidad.</li>
<li>Compromiso: El cliente debe sentirse participe y      comprometido. El prototipo ayuda fuertemente en esto al permitir al      cliente avalar lo que estamos por desarrollar.</li>
<li>Económico: un prototipo debe llevar poco tiempo, pues su      descarte no debe significar un alto costo</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2011/desarrollo-prototipos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como Cambiar el Idioma de Mozilla Firefox</title>
		<link>http://gustavopeiretti.com/2011/cambiar-idioma-mozilla-firefox/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cambiar-idioma-mozilla-firefox</link>
		<comments>http://gustavopeiretti.com/2011/cambiar-idioma-mozilla-firefox/#comments</comments>
		<pubDate>Thu, 19 May 2011 18:50:51 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=1026</guid>
		<description><![CDATA[Debes buscar la versión del release  y el sistema que tienes instalado y por último dentro de xpi el paquete del idioma que deseas, para mi ejemplo será es-AR.xpi Esto lo haces aquí  http://releases.mozilla.org/pub/mozilla.org/firefox/releases/ Al finalizar te pedirá reiniciar, puedes obviarlo y continuar con lo que sigue. Pondremos en la barra de navegación about:config y &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2011/cambiar-idioma-mozilla-firefox/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Debes buscar la versión del release  y el sistema que tienes instalado y por último dentro de xpi el paquete del idioma que deseas, para mi ejemplo será es-AR.xpi</p>
<p>Esto lo haces aquí  http://releases.mozilla.org/pub/mozilla.org/firefox/releases/</p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/05/firefox_language_pack.jpg" alt="" /></p>
<p>Al finalizar te pedirá reiniciar, puedes obviarlo y continuar con lo que sigue.</p>
<p>Pondremos en la barra de navegación about:config y prometes que serás cuidadoso, adelante…<br />
<img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/05/firefox_language_pack2.jpg" alt="" /></p>
<p>Luego buscamos <strong>general.useragent.locale</strong> modificando su valor por el mismo que hemos instalado antes, en mi ejemplo es-AR<br />
<img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/05/firefox_language_pack3.jpg" alt="" /></p>
<p>Reinicias Firefox y deberías tener tu Firefox traducido al idioma que elegiste.</p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/05/firefox_language_pack4.jpg" alt="" width="640" height="83" /></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2011/cambiar-idioma-mozilla-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cambiar el User-agent de tu navegador Mozilla Firefox</title>
		<link>http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cambiar-user-agent-de-firefox</link>
		<comments>http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 08:49:02 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Lenguajes]]></category>
		<category><![CDATA[Util]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=979</guid>
		<description><![CDATA[Podrías querer cambiar el User-agent de tu Mozilla para &#8216;engañar&#8217; a tu aplicación web haciéndole creer que estas accediendo desde un dispositivo móvil y así probar aspectos como el diseño. El User-agent es el encabezado de la petición http que identifica el nombre de la aplicación, la versión, sistema operativo, etc., que esta accediendo. Por &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Podrías querer cambiar el User-agent de tu Mozilla para &#8216;engañar&#8217; a tu aplicación web haciéndole creer que estas accediendo desde un dispositivo móvil y así probar aspectos como el diseño.</p>
<p>El User-agent es el encabezado de la petición http que identifica el nombre de la aplicación, la versión, sistema operativo, etc., que esta accediendo.</p>
<p>Por ejemplo el User-agent para Mozilla Firefox corriendo sobre Windows  sería algo así:<br />
Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2</p>
<p>Para el Opera Mini corriendo sobre un BlackBerry:<br />
Opera/9.80 (BlackBerry; Opera Mini/5.1.22303/22.387; U; en) Presto/2.5.25 Version/10.54</p>
<p>Si quieres modificar el User-agent en Mozilla instala este complemento:<br />
<a href="https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/" target="_blank">User-agent Switcher</a></p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/user_agent_switcher_3.jpg" alt="" width="397" height="396" /></p>
<p>Esta página contiene una lista de user-agent que te puede servir <a href="http://www.useragentstring.com/" target="_blank">http://www.useragentstring.com/</a></p>
<p>Por ejemplo, vamos a modificar el user-agent para &#8216;hacerle creer&#8217; a Google que esta corriendo en un Opera Mini sobre un movil BlackBerry</p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/google_movil_blackberry.jpg" alt="" width="512" height="198" /></p>
<p>Google Móvil<br />
<img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/google_movil.jpg" alt="" /></p>
<p>Encabezado User-agent de la petición</p>
<p><img src="http://gustavopeiretti.com/blog/wp-content/uploads/2011/01/google_movil_blackberry_2.jpg" alt="" width="512" height="76" /></p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2011/cambiar-user-agent-de-firefox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Formula PAGOPRIN de Excel en Java</title>
		<link>http://gustavopeiretti.com/2010/pagoprin-excel-en-java/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pagoprin-excel-en-java</link>
		<comments>http://gustavopeiretti.com/2010/pagoprin-excel-en-java/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 23:00:25 +0000</pubDate>
		<dc:creator>Gustavo</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=943</guid>
		<description><![CDATA[Cálculo de la formula PAGOPRIN de Excel implementada en Java. La formula básica es esta (saldoCapital * tasa) * (1 / (Math.pow(1 + tasa, plazo &#8211; cuotaActual + 1) &#8211; 1)); Va un ejemplo: &#160; public class TestCalcularAmortizacion &#123; &#160; public static void main&#40;String&#91;&#93; args&#41; &#123; &#160; double deuda = 1000d; int plazo = 12; &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2010/pagoprin-excel-en-java/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Cálculo de la formula PAGOPRIN de Excel implementada en Java.<br />
La formula básica es esta<br />
(saldoCapital * tasa) * (1 / (Math.pow(1 + tasa, plazo &#8211; cuotaActual + 1) &#8211; 1));</p>
<p>Va un ejemplo:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestCalcularAmortizacion <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">double</span> deuda <span style="color: #339933;">=</span> 1000d<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">int</span> plazo <span style="color: #339933;">=</span> <span style="color: #cc66cc;">12</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">double</span> tasa <span style="color: #339933;">=</span> 2.20d <span style="color: #339933;">/</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003399;">List</span> resultado <span style="color: #339933;">=</span> calcular<span style="color: #009900;">&#40;</span>deuda, plazo, tasa<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>CalculoDatos calculoDatos <span style="color: #339933;">:</span> resultado<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            <span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cuota: &quot;</span> <span style="color: #339933;">+</span>  calculoDatos.<span style="color: #006633;">cuota</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; - Saldo Capital: &quot;</span> <span style="color: #339933;">+</span> calculoDatos.<span style="color: #006633;">saldoCapital</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; - Amort.Cap.: &quot;</span> <span style="color: #339933;">+</span> calculoDatos.<span style="color: #006633;">amortizacionCapital</span> <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot; - Interes: &quot;</span> <span style="color: #339933;">+</span> calculoDatos.<span style="color: #006633;">interes</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">// resultado...</span>
            <span style="color: #666666; font-style: italic;">// Cuota: 1 - Saldo Capital: 1000.0 - Amort.Cap.: 73.72488492849683 - Interes: 22.000000000000004</span>
            <span style="color: #666666; font-style: italic;">// Cuota: 2 - Saldo Capital: 926.2751150715031 - Amort.Cap.: 75.34683239692382 - Interes: 20.378052531573072</span>
            <span style="color: #666666; font-style: italic;">// Cuota: 3 - Saldo Capital: 850.9282826745793 - Amort.Cap.: 77.00446270965618 - Interes: 18.72042221884075</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399;">List</span> calcular<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">double</span> deuda, <span style="color: #000066; font-weight: bold;">int</span> plazo, <span style="color: #000066; font-weight: bold;">double</span> tasa<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #003399;">List</span> calculos <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">double</span> saldoCapitalAnterior <span style="color: #339933;">=</span> 0d<span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">double</span> amortizacionCapitalAnterior <span style="color: #339933;">=</span> 0d<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> cuotaActual <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> cuotaActual <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;=</span> plazo<span style="color: #339933;">;</span> cuotaActual<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
            CalculoDatos calculoDatos <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TestCalcularAmortizacion<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #000000; font-weight: bold;">new</span> CalculoDatos<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            calculoDatos.<span style="color: #006633;">cuota</span> <span style="color: #339933;">=</span> cuotaActual<span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cuotaActual <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                calculoDatos.<span style="color: #006633;">saldoCapital</span> <span style="color: #339933;">=</span> deuda<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                calculoDatos.<span style="color: #006633;">saldoCapital</span> <span style="color: #339933;">=</span> saldoCapitalAnterior <span style="color: #339933;">-</span> amortizacionCapitalAnterior<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
&nbsp;
            <span style="color: #666666; font-style: italic;">// ---</span>
            <span style="color: #666666; font-style: italic;">// FORMULA PAGOPRIN llevada a Java</span>
            <span style="color: #666666; font-style: italic;">// ---</span>
            calculoDatos.<span style="color: #006633;">amortizacionCapital</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>calculoDatos.<span style="color: #006633;">saldoCapital</span> <span style="color: #339933;">*</span> tasa<span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">Math</span>.<span style="color: #006633;">pow</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">+</span> tasa, plazo <span style="color: #339933;">-</span> cuotaActual <span style="color: #339933;">+</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">// --</span>
            calculoDatos.<span style="color: #006633;">interes</span> <span style="color: #339933;">=</span> calculoDatos.<span style="color: #006633;">saldoCapital</span> <span style="color: #339933;">*</span> tasa<span style="color: #339933;">;</span>
&nbsp;
            calculos.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>calculoDatos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            saldoCapitalAnterior <span style="color: #339933;">=</span> calculoDatos.<span style="color: #006633;">saldoCapital</span><span style="color: #339933;">;</span>
            amortizacionCapitalAnterior <span style="color: #339933;">=</span> calculoDatos.<span style="color: #006633;">amortizacionCapital</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">return</span> calculos<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">class</span> CalculoDatos <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">int</span> cuota<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">double</span> saldoCapital<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">double</span> amortizacionCapital<span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066; font-weight: bold;">double</span> interes<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2010/pagoprin-excel-en-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Decir NO</title>
		<link>http://gustavopeiretti.com/2010/decir-no/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=decir-no</link>
		<comments>http://gustavopeiretti.com/2010/decir-no/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 23:00:00 +0000</pubDate>
		<dc:creator>Gustavo Peiretti</dc:creator>
				<category><![CDATA[Productividad]]></category>
		<category><![CDATA[pensamientos]]></category>

		<guid isPermaLink="false">http://gustavopeiretti.com/?p=926</guid>
		<description><![CDATA[Pueden ser muchos los motivos por los cuales no decimos NO cuando queremos decirlo. Por temor a la respuesta o al enojo&#8230; Por conformar al otro&#8230;. Por intentar cumplir con las expectativas de otros&#8230; Por sentirse capaz de todo&#8230; Por compromiso&#8230; Por evitar un conflicto&#8230; Por sentirse culpable&#8230; Es tan fuerte la ansiedad que nos &#8230; </p><p><a class="more-link block-button" href="http://gustavopeiretti.com/2010/decir-no/">Continuar leyendo &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Pueden ser muchos los motivos por los cuales no decimos NO cuando queremos decirlo.</p>
<p style="text-align: center;"><img class="aligncenter" title="Decir NO" src="http://gustavopeiretti.com/blog/wp-content/uploads/2010/11/decirNo.jpg" alt="" width="266" height="199" /></p>
<p>Por temor a la respuesta o al enojo&#8230;<br />
Por conformar al otro&#8230;.<br />
Por intentar cumplir con las expectativas de otros&#8230;<br />
Por sentirse capaz de todo&#8230;<br />
Por compromiso&#8230;<br />
Por evitar un conflicto&#8230;<br />
Por sentirse culpable&#8230;</p>
<p>Es tan fuerte la ansiedad que nos puede provocar decir un &#8216;NO&#8217;  que cedemos ante la demanda de otros, aún sabiendo que nos perjudica en nuestras actividades personales.<br />
Solemos comprometernos en cosas que no queremos o que no estamos en condiciones de cumplir y que nos quitan tiempo para aquello que nos hemos propuesto.</p>
<p>No es que debamos rechazar y decir NO a todo. Se trata de reconocer lo que realmente deseamos sin ser afectados por esta ansiedad; estando seguros de nosotros mismos porque <span style="text-decoration: underline;">elegimos</span> con criterio.</p>
<p>Es posible que nos estemos preguntando ¿Por qué estoy haciendo esto si realmente no lo deseo? ¿Por qué no tengo tiempo para hacer mis cosas y las que me propongo?</p>
<p>¿Cuántas veces dijiste SI y te quedaste luego pensando en que hubiera sido mejor haber dicho NO?</p>
<p>Intenta antes de responder &#8216;escuchar a tus sentidos&#8217; reconociendo si respondes por alguna emoción asociada con la ansiedad;  observa si se trata de un impulso por dar una respuesta afirmativa o si es que realmente lo deseas.<br />
Te será muy útil crear el hábito de utilizar alguna frase que te entregue algo más de tiempo.  Si dudas no respondas de inmediato y  di algo tan simple como &#8220;te respondo en un ratito&#8221; o &#8220;deja que lo piense&#8221;&#8230; puede servirte.</p>
<p>Piensa en positivo, recuerda que al decir NO estás permitiéndote decirte SI a ti mismo para cumplir con objetivos que te has propuesto como positivos o productivos en tu labor diaria.  ¿Cuáles? Piénsalo…</p>
]]></content:encoded>
			<wfw:commentRss>http://gustavopeiretti.com/2010/decir-no/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

