<?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>Creations.cl &#187; informática</title>
	<atom:link href="http://www.creations.cl/tag/informatica/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.creations.cl</link>
	<description>Programación y algo más...</description>
	<lastBuildDate>Sat, 10 Dec 2011 06:50:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Especificaciones</title>
		<link>http://www.creations.cl/2009/11/especificaciones/</link>
		<comments>http://www.creations.cl/2009/11/especificaciones/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 13:13:51 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[computación]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[informática]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=1064</guid>
		<description><![CDATA[Sé que muchos programadores se sentirán identificados con esta carta.
¿Qué pasaría si en vez de programadores fueramos arquitectos?, unos dirán que sólo es el cambio de carrera, pero ¿y si ahora le agregamos que los jefes nos explican el problema y sus requerimientos de la misma en como la informan a los programadores?
Estimado Sr. Arquitecto:
Por [...]]]></description>
			<content:encoded><![CDATA[<p>Sé que muchos programadores se sentirán identificados con esta carta.</p>
<p>¿Qué pasaría si en vez de programadores fueramos arquitectos?, unos dirán que sólo es el cambio de carrera, pero ¿y si ahora le agregamos que los jefes nos explican el problema y sus requerimientos de la misma en como la informan a los programadores?</p>
<p><em><strong>Estimado Sr. Arquitecto:</strong></em><br />
Por favor diseñe y construya una casa para mi. No estoy muy seguro de lo que necesito, así que tendrá que usar su imaginación. Mi casa debería tener entre dos y cuarenta y cinco dormitorios. Simplemente asegúrese de que todo esté pensado de forma que sea sencillo añadir o quitar dormitorios. Cuando<br />
me traiga los modelos, tomaré la decisión sobre lo que quiero. Además, tráigame un resumen de los costes para cada configuración de manera que pueda elegir una de ellas de manera arbitraria.<br />
Tenga en cuenta que la nueva casa debe costar bastante menos que la casa en la que estoy viviendo ahora. Pero asegúrese, de todas formas, de que corrige todas las deficiencias que existen en mi casa actual (el suelo de la cocina vibra cuando ando por el, y las paredes no tienen suficiente aislamiento).<br />
Mientras diseña, tenga en cuenta que quiero mantener los costes de mantenimiento lo mas bajos posibles. Esto significará la incorporación de materiales mas costosos coste como el aluminio, la fibra de vidrio o el vinilo. (Si elige no considerar el aluminio, prepárese para explicar su decisión en todo detalle.)<br />
Por favor asegúrese de que se utilicen las prácticas mas modernas de diseño y lo último de lo último en materiales a la hora de construir la casa, ya que deseo poder presumir de haber utilizado las mas actuales ideas y métodos. Tenga en cuenta, de todas formas, que la cocina debería diseñarse para acomodar, entre otras cosas, mi nevera Gibson del 52.<br />
Para asegurarse de que esté construyendo la casa de manera correcta para toda la familia, contacte con cada uno de mis hijos e hijas, y también con mis nueros y nueras. Mi suegra tendrá también bastantes cosas que decir sobre como debería diseñarse la casa, ya que nos visita al menos una vez al<br />
año. Asegúrese de que considera cada una de las opciones que le propongan cuidadosamente y asegúrese también de elegir la decisión acertada. Yo, de cualquier forma, siempre tendré la última palabra y podré rectificar cualquier elección que tome.<br />
Por favor no me moleste con los pequeños detalles de momento. Su trabajo es desarrollar una idea general del diseño de la casa: captar la idea. Este momento, por ejemplo, no es el apropiado para elegir el color de la alfombra.<br />
En cualquier caso, recuerde que a mi esposa le gusta el azul.<br />
Además, no se preocupe aún de adquirir los materiales necesarios para construir la casa. Su prioridad es la de desarrollar planos detallados y especificaciones. De todas formas, una vez que yo apruebe esos planos, espero que la casa esté construida en 48 horas.<br />
Aunque esté diseñando esta casa específicamente para mí, tenga en cuenta que antes o después tendré que venderla a otra persona. De manera que debería ser atrayente para una gran variedad de compradores potenciales. Por favor<br />
asegúrese antes de que finalice los planos de que halla un consenso sobre las características de la casa entre la población de la zona. Le aconsejo que eche un vistazo a la casa que mi vecino se construyó el año pasado. Nos encanta. Tiene bastantes características que también queremos en nuestra nueva casa, especialmente la piscina de 75 pies. Aplicando la ingeniería de<br />
manera cuidadosa, creo que no tendrá dificultades en añadirlo al diseño final sin que tenga ningún impacto en el coste.<br />
Por favor prepare un conjunto completo de modelos. No es necesario por ahora que prepare el diseño real, dado que solo queremos los modelos para calcular los costes de la obra. Tenga en cuenta, de todas formas, que usted será el responsable de cualquier incremento en el precio debido a cambios posteriores en el diseño.<br />
¡Debería estar emocionado por trabajar en un proyecto tan interesante como este! Poder utilizar las últimas técnicas y materiales y el que le den tanta libertad en sus diseños es algo que no ocurre muy a menudo. Contacte conmigo tan pronto como sea posible con una lista completa de sus ideas y sus planes.</p>
<p>*Postdata:* Mi esposa acaba de decirme que no está de acuerdo con algunas de las instrucciones que le doy en esta carta. Como arquitecto, es su responsabilidad el resolver estas diferencias entre mi esposa y yo. Yo ya lo he intentado en el pasado y fui incapaz de conseguirlo. Si no puede hacer frente a esta responsabilidad, tendré que contratar a otro arquitecto.</p>
<p>*PostPostdata:* Quizás lo que necesite ni tan si quiera sea una casa, sino una caravana. Por favor aconséjeme lo mas pronto posible si ese es el caso..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/11/especificaciones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programación para gente común.</title>
		<link>http://www.creations.cl/2009/11/programacion-para-gente-comun/</link>
		<comments>http://www.creations.cl/2009/11/programacion-para-gente-comun/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 12:34:45 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[computación]]></category>
		<category><![CDATA[informática]]></category>
		<category><![CDATA[Programación]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=1061</guid>
		<description><![CDATA[Muchas veces habrán escuchado a un programador/desarrollador mencionar que la aplicación se pegó porque entró en un &#8220;loop&#8221; , pero ¿qué demonios es un loop?. Se los podría explicar de mil maneras distintas pero mejor pensemos en un caso que se acerque a la vida común.
Para  quien no conoce el concepto de loop,  es un [...]]]></description>
			<content:encoded><![CDATA[<p>Muchas veces habrán escuchado a un programador/desarrollador mencionar que<strong> la aplicación se pegó porque entró en un &#8220;loop&#8221;</strong> , pero ¿qué demonios es un loop?. Se los podría explicar de mil maneras distintas pero mejor pensemos en un caso que se acerque a la vida común.</p>
<p><span style="font-family: Verdana; color: #632423; font-size: medium;"><span style="font-size: 13.5pt; color: #632423; font-family: Verdana;" lang="ES-CL">Para  quien no conoce el concepto de loop,  es un término que crearon los informáticos para definir un enrredo de los tantos que han creado y para lo cual no tienen una explicación sencilla para aclarar el problema.</span></span><span style="font-family: Verdana; color: #632423; font-size: x-small;"><span style="font-size: 10pt; color: #632423; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; color: #632423; font-size: medium;"><span style="font-size: 13.5pt; color: #632423; font-family: Verdana;" lang="ES-CL">Bueno, haciendo poco esfuerzo mental trataré de explicarles en pocas palabras este famoso término.</span></span><span style="font-family: Verdana; color: #632423; font-size: x-small;"><span style="font-size: 10pt; color: #632423; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; color: #632423; font-size: medium;"><span style="font-size: 13.5pt; color: #632423; font-family: Verdana;" lang="ES-CL">Se dice que un programa de computación <strong><span style="font-weight: bold;">&#8220;entró en un</span></strong> <strong><span style="font-weight: bold;">LOOP&#8221;</span></strong> como cuando ocurre la siguiente situación:</span></span><span style="font-family: Verdana; color: #632423; font-size: x-small;"><span style="font-size: 10pt; color: #632423; font-family: Verdana;" lang="ES-CL"><br />
</span></span><span style="font-family: Verdana; color: #632423; font-size: medium;"><span style="font-size: 13.5pt; color: #632423; font-family: Verdana;" lang="ES-CL"> </span></span><span style="font-family: Verdana; color: #632423; font-size: x-small;"><span style="font-size: 10pt; color: #632423; font-family: Verdana;" lang="ES-CL"><br />
</span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El <strong><span style="font-weight: bold;">director</span></strong> llama a su secretaria y le dice:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"><br />
</span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL"> </span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"><br />
</span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Señorita<span style="color: #1f497d;"><span style="color: #1f497d;"> </span></span>Vanessa: Tengo un seminario en Argentina por una semana y quiero que me acompañe para que</span></span><span style="font-family: Verdana; font-size: x-small;"></span></p>
<p class="MsoNormal" style="margin-bottom: 12pt;"><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">conozca a mis socios. Haga los preparativos del viaje&#8230;</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">La secretaria llama al marido:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Oye Juan &#8211; Voy a viajar al exterior con el director por una semana. Cuidate, querido.</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"><br />
</span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El marido llama a la amante:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Leonor, mi tesoro &#8211; La bruja va a viajar al exterior por una semana, vamos a pasarnos esta semana juntos, mi reina&#8230;</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">La amante llama al niño a quien le da clases particulares:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Juanito &#8211; Tengo mucho trabajo la próxima semana. No tienes que venir a clases&#8230;</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El niño llama a su abuelo:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Tata &#8211; La próxima semana no tengo clases, mi profesora estará ocupada. ¡Vamos a pasar la semana juntos!</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El abuelo (<strong><em><span style="color: #943634;"><span style="font-weight: bold; color: #943634; font-style: italic;">que es el </span></span><span style="color: #1f497d;"><span style="color: #1f497d;">mismo </span></span><span style="color: #943634;"><span style="color: #943634;">director de esta historia</span></span></em></strong>) llama a la secretaria:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Señorita Vanessa venga rápido &#8211; Suspenda el viaje, voy a  pasar la próxima semana con mi nieto que hace un año no veo, por lo que no vamos a participar en el Seminario. Cancele el viaje y el hotel.</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">La secretaria llama al marido:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Pucha guatónnnnn &#8211; El huevón del director cambió de idea y acaba de cancelar el viaje, se me agüó el viaje.</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El marido llama a la amante:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Amorcito disculpe &#8211; No podremos pasar la próxima semana juntos, el viaje de la gueona de mi mujer fue cancelado.</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">La amante llama al niño de las clases particulares:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Juanito &#8211; Cambié de planes: esta semana le voy a dar clases como siempre.</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El niño llama al abuelo:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Putas abuelo, la vieja de mi profesora me dijo que esta semana tengo clases.  Discúlpame, no voy a poder hacerte compañía.</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">El abuelo, es decir <strong><span style="font-weight: bold;">el director</span></strong>, llama nuevamente a la secretaria:</span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><span style="font-family: Verdana; font-size: medium;"><span style="font-size: 13.5pt; font-family: Verdana;" lang="ES-CL">Señorita Vanessa &#8211; Mi nieto me acaba de decir que no va a poder estar conmigo esta semana porque tiene clases. Así que continúe con los preparativos del viaje al seminario<span style="color: #1f497d;"><span style="color: #1f497d;"> …</span></span></span></span><span style="font-family: Verdana; font-size: x-small;"><span style="font-size: 10pt; font-family: Verdana;" lang="ES-CL"></p>
<p></span></span><strong><span style="font-family: Verdana; color: #632423; font-size: medium;"><span style="font-weight: bold; font-size: 13.5pt; color: #632423; font-family: Verdana;" lang="ES-CL">¿Queda claro ahora lo que es un &#8220;LOOP&#8221; ?</span></span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/11/programacion-para-gente-comun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Internet Explorer continúa perdiendo usuarios</title>
		<link>http://www.creations.cl/2009/05/internet-explorer-continua-perdiendo-usuarios/</link>
		<comments>http://www.creations.cl/2009/05/internet-explorer-continua-perdiendo-usuarios/#comments</comments>
		<pubDate>Mon, 11 May 2009 16:49:20 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Anuncios]]></category>
		<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[computación]]></category>
		<category><![CDATA[informática]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[navegadores]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=919</guid>
		<description><![CDATA[Segun nueva informacion sobre el uso de navegadores de internet, el navegador Internet Explorer (IE) de Microsoft, se mantiene en un ritmo de perdida de usuarios que lo llevara de ser el navegador dominante en todo el mundo a una cuota de mercado de menos del 50 por ciento en 2011.
IE perdio el 0.7 por [...]]]></description>
			<content:encoded><![CDATA[<h4 style="text-align: center;">Segun nueva informacion sobre el uso de navegadores de internet, el navegador Internet Explorer (IE) de Microsoft, se mantiene en un ritmo de perdida de usuarios que lo llevara de ser el navegador dominante en todo el mundo a una cuota de mercado de menos del 50 por ciento en 2011.</h4>
<p><img class="alignright" src="http://www.misnoticiasdetecnologia.com/wp-content/uploads/ie7-200x300.jpg" alt="" width="200" height="300" />IE perdio el 0.7 por ciento del mercado de usuarios de internet en el mes de Abril, mes en el que finalizo con el 66.1 por ciento de usuarios globales, llegando asi a un nuevo minimo de acuerdo a un estudio de Net Applications Inc.</p>
<p>Al igual que en Marzo, la penetracion de Internet Explorer en Abril no fue suficiente para detener la caida de la cuota global del navegador. Si bien IE8 vio impulsada su cuota de mercado en 2.2 por ciento, IE7 perdio 2 opr ciento y el decaido IE6 perdio 0.8 por ciento.</p>
<p>Si bien las ganancias en cantidad de usuarios de IE8 originalmente fueron a costa de IE7, el estudio de mercado de Net Applications muestra tambien que los usuarios de IE6 estan comenzando a actualizar sus navegadores: el porcentaje del 0.8 del mes pasado fue mayor que el 0.6 por ciento de Marzo.</p>
<p>Microsoft recientemente comenzo a ofrecer IE8 a usuarios de IE6 y de IE7 Actualizaciones Automaticas, factor que seguramente tuvo su parte en la acelerada caida de los navegadores mas antiguos de Microsoft.</p>
<p>Como de costumbre, los navegadores rivales salen ganando con las perdidas de Internet Explorer.</p>
<p>Mozilla Firefox por ejemplo, incremento su cuota de mercado en 0.4 por ciento en Abril para finalizar el mes con 22.5 por ciento de los usuarios, mientras que Chrome de Google gano un 0.2 por ciento llegando al 1.4 por ciento del mercado.</p>
<p>El navegador Safari de Apple, mientras tanto, experimento una disminucion de 0.02 por ciento al finalizar Abril con un 8.2 por ciento de los usuarios de navegadores.</p>
<p><img class="alignleft" src="http://www.misnoticiasdetecnologia.com/wp-content/uploads/firefox-3-5-beta-4.jpg" alt="" width="250" height="187" />En los ultimos 12 meses Firefox ha ganado un promedio de 0.4 por ciento cada mes, con lo que si se mantiene esta tendencia, el navegador de codigo abierto de Mozilla alcanzaria la marca del 25 por ciento de cuota de mercado para fines de Noviembre de 2009.</p>
<p>En contrapartida, IE ha perdido un promedio de 0.7 por ciento de usuarios en los ultimos 12 meses y, al menos que MIcrosoft haga algo, Internet Explorer perdera su mayoria absoluta y caera por debajo del 50 por ciento del mercado en algun momento del mes de Mayo de 2011.</p>
<p>Con respecto a Chrome de Google, el cual se mantiene como aplicacion exclusiva para PCs basadas en Windows, tuvo en Abril su mayor incremento desde Diciembre.</p>
<p>Lo que podria hacer a Chrome un rival poderoso para Firefox y Safari seria la posibilidad de que Google llegara a acuerdos con fabricantes de computadoras para instalar el navegador en nuevas PCs. Segun la gente de Net Applications Inc., esto tendria un gran impacto, pero hasta que eso suceda, no se esperan grandes ganancias para Chrome.</p>
<p>Fuente: <a title="Lo vi en..." href="http://www.misnoticiasdetecnologia.com/internet-explorer-continua-perdiendo-usuarios.htm" target="_blank">misnoticiasdetecnologia</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/05/internet-explorer-continua-perdiendo-usuarios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>¿Precisión o potencia? procesadores probabilísticos</title>
		<link>http://www.creations.cl/2009/02/%c2%bfprecision-o-potencia-procesadores-probabilisticos/</link>
		<comments>http://www.creations.cl/2009/02/%c2%bfprecision-o-potencia-procesadores-probabilisticos/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 19:22:58 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[informática]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=534</guid>
		<description><![CDATA[Un estudio de un profesor de la Rice University en Houston (EE.UU.) ha revelado que sacrificando parte de la precisión de los cálculos realizados en un procesador se podría hacer que el rendimiento se multiplicara por siete. Obviamente existen escenarios en los que la precisión de los cálculos es vital en el buen resultado final, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Un estudio de un profesor de la Rice University en Houston (EE.UU.) ha revelado que sacrificando parte de la precisión de los cálculos realizados en un procesador se podría hacer que el rendimiento se multiplicara por siete. Obviamente existen escenarios en los que la precisión de los cálculos es vital en el buen resultado final, pero hay otros casos en los que la idea de la computación probabilista podría ser aplicada.</strong></p>
<p>Este profesor de la Universidad Rice en Houston dio una conferencia San Francisco en la cual <a href="http://www.chron.com/disp/story.mpl/metropolitan/6252697.html" target="_blank">anunció los resultados </a>de las primeras pruebas de sus chips de computación probabilista. Estos procesadores <strong>sacan provecho del sacrificio de la precisión y los errores aleatorios en los cálculos</strong>, haciéndolos  funcionar siete veces más rápido que cualquier desarrollo actual consumiendo además tan sólo 1/30 de la electricidad necesaria en otros casos.</p>
<div class="MultiBoxHelp" id="MultiBoxHelp"><a href="http://www.rutschmann.biz" title="powered by Wordpress Multibox Plugin v1.3.5" target="_blank"><img src="http://www.creations.cl/wp-content/plugins/wordpress-multibox-plugin/images/help.png" alt="powered by Wordpress Multibox Plugin v1.3.5" title="powered by Wordpress Multibox Plugin v1.3.5"></a></div>
<p><a href="http://www.creations.cl/wp-content/uploads/2009/02/amd-roadmap-2009-2.jpg"  class="wmp" id="wmp2"><img class="aligncenter size-full wp-image-537" style="border: 1px solid black; padding: 2px; background-color: #AAD;" title="amd-roadmap-2009-2" src="http://www.creations.cl/wp-content/uploads/2009/02/amd-roadmap-2009-2.jpg" alt="amd-roadmap-2009-2" width="403" height="307" /></a></p>
<p>Krishna Palem, el responsable de esta investigación, comentó que &#8220;<em>los resultados fueron mucho mejores de lo que esperábamos</em>&#8220;. Este investigador prevé que sus chips podrían formar parte de dispositivos móviles en menos de una década. Aunque la mayoría de las pruebas <strong>no se pueden traducir en aplicaciones prácticas</strong> para de que puede haber escenarios en los que este tipo de computación si que sea útil.</p>
<p>Por ejemplo, al calcular un balance bancario de 13.000,81 euros es mucho más importante el &#8220;13&#8243; que el &#8220;81&#8243;. Así, producir una respuesta de 13.000,57 euros está mucho más cerca la respuesta correcta que producir una respuesta de 57.000,81 euros. Obviamente la tecnología de Palem no será muy útil en misiones espaciales, pero <strong>sí que tendría una gran utilidad en aplicaciones como el streaming de música o vídeo en dispositivos móviles</strong>, según sus comentarios, ya que dicho tipo de escenarios la precisión no es vital en un resultado aceptable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/02/%c2%bfprecision-o-potencia-procesadores-probabilisticos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WesternDigital lanza HDD de 2TB</title>
		<link>http://www.creations.cl/2009/01/westerndigital-lanza-hdd-de-2tb/</link>
		<comments>http://www.creations.cl/2009/01/westerndigital-lanza-hdd-de-2tb/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 13:20:12 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Tecnología]]></category>
		<category><![CDATA[disco duro]]></category>
		<category><![CDATA[informática]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=188</guid>
		<description><![CDATA[


Si 2 TeraBytes.
Anunciado hace apenas dos semanas, la marca Western Digital ya lo puso a la venta alrededor del mundo. Se trata del nuevo disco duro Caviar Green con una, nada de pequeña, capacidad de 2 TeraBytes, lo que le permite presumir de haberse convertido en el primer sistema de almacenaje interno en ofrecer 2.048 [...]]]></description>
			<content:encoded><![CDATA[<p><span id="noteContainer"><span id="noteContainer">
<div class="MultiBoxHelp" id="MultiBoxHelp"><a href="http://www.rutschmann.biz" title="powered by Wordpress Multibox Plugin v1.3.5" target="_blank"><img src="http://www.creations.cl/wp-content/plugins/wordpress-multibox-plugin/images/help.png" alt="powered by Wordpress Multibox Plugin v1.3.5" title="powered by Wordpress Multibox Plugin v1.3.5"></a></div>
<p><a href="http://www.creations.cl/wp-content/uploads/2009/01/wd2gb.jpg"  class="wmp" id="wmp4"><img class="alignright size-full wp-image-189" style="border: 1px solid black; paddnig: 2px;spacing: 2px;" title="wd2gb" src="http://www.creations.cl/wp-content/uploads/2009/01/wd2gb.jpg" alt="wd2gb" width="400" height="263" /></a></span></span></p>
<p>Si 2 TeraBytes.</p>
<p><span id="noteContainer">Anunciado hace apenas dos semanas, la marca <strong>Western Digital</strong> ya lo puso a la venta alrededor del mundo. Se trata del nuevo disco duro <strong>Caviar Green</strong> con una, nada de pequeña, capacidad de 2 TeraBytes, lo que le permite presumir de haberse convertido en el primer sistema de almacenaje interno en ofrecer <strong>2.048 gigabytes</strong> para almacenar todo <span style="text-decoration: line-through;">tu porno</span> lo que se te ocurra.</span></p>
<p>Pese a lo que podría esperarse de una maquina semejante, el consumo de energía no se convierte en un obstáculo ya que reduce su gasto hasta en un 40% haciendo uso de tecnologías propias de la marca, según señala Europa Press.</p>
<p>Su precio, al menos en Estados Unidos, es de US$299, unos 180.000 pesos chilenos.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/01/westerndigital-lanza-hdd-de-2tb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GWT : Google Web Toolkit</title>
		<link>http://www.creations.cl/2009/01/gwt-google-web-toolkit/</link>
		<comments>http://www.creations.cl/2009/01/gwt-google-web-toolkit/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 01:22:00 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[informática]]></category>
		<category><![CDATA[j2ee]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=161</guid>
		<description><![CDATA[Como muchos saben hace un par de meses que estoy trabajando con GWT, lo que significa Google Web Toolkit, así que me decidí a escribir un poco sobre este tema, si bien esste blog ha sido concebido como una ayuda para la porgramación, se ha ido llenando de humor y anécdotas, si bien también era [...]]]></description>
			<content:encoded><![CDATA[<p>Como muchos saben hace un par de meses que estoy trabajando con GWT, lo que significa Google Web Toolkit, así que me decidí a escribir un poco sobre este tema, si bien esste blog ha sido concebido como una ayuda para la porgramación, se ha ido llenando de humor y anécdotas, si bien también era uno de los objetivos de este proyecto, empezaremos a equilibrar un poco la balanza.</p>
<div class="MultiBoxHelp" id="MultiBoxHelp"><a href="http://www.rutschmann.biz" title="powered by Wordpress Multibox Plugin v1.3.5" target="_blank"><img src="http://www.creations.cl/wp-content/plugins/wordpress-multibox-plugin/images/help.png" alt="powered by Wordpress Multibox Plugin v1.3.5" title="powered by Wordpress Multibox Plugin v1.3.5"></a></div>
<p><a href="http://code.google.com/webtoolkit/"></a><a href="http://www.creations.cl/wp-content/uploads/2009/01/gwt.png"  class="wmp" id="wmp6"><img class="alignleft size-full wp-image-163" style="border: 1px solid black; padding: 2px; spaccing: 2px;" title="gwt" src="http://www.creations.cl/wp-content/uploads/2009/01/gwt.png" alt="gwt" width="97" height="51" /></a>Google Web Toolkit es una herramienta de desarrollo AJAX de Google destinada a desarrolladores Java. Las aplicaciones web (tanto GUI -Graphical User Interface- como RPC -Remote Procedure Call-) se escriben en Java usando el API GWT. Después los archivos Java se compilan en archivos JavaScript compactos, ofuscados y específicos del navegador. Un pequeño código de carga en JavaScript determina que archivos de script específico del navegador se deben utilizar dependiendo del navegador cliente. La librería API está licenciada bajo licencia Apache 2.0.</p>
<p><span id="more-161"></span></p>
<p>La principal fuente de documentación de GWT se encuentra en la <a href="http://code.google.com/webtoolkit/documentation/">página de documentación oficial</a> aunque también existen varios tutoriales en la web:</p>
<ul>
<li><a href="http://www-128.ibm.com/developerworks/library/j-ajax4/">Ajax for Java developers: Exploring the Google Web Toolkit</a></li>
<li><a href="http://today.java.net/lpt/a/301">Kickstarting Google Web Toolkit on the Client Side</a></li>
<li><a href="http://blogs.zdnet.com/Burnette/?p=122">Getting started with Google Web Toolkit (GWT)</a></li>
<li><a href="http://www.xml.com/pub/a/2006/07/12/google-web-toolkit-ajax-java-ant-xml.html">Google Web Toolkit</a></li>
<li><a href="http://www.onjava.com/pub/a/onjava/2006/05/31/working-with-google-web-toolkit.html">Working with the Google Web Toolkit</a></li>
<li><a href="http://google.wikia.com/wiki/Google_Web_Toolkit">Google Web Toolkit</a></li>
<li><a href="http://google.wikia.com/wiki/Jump_Start_Your_AJAX_Development_with_the_Google_Web_Toolkit">Jump Start Your AJAX Development with the Google Web Toolkit</a></li>
<li><a href="http://angel.hurtado.googlepages.com/tutorialgwt">Tutorial GWT</a></li>
</ul>
<p>Además, las novedades de la herramienta se van presentando en <a href="http://googlewebtoolkit.blogspot.com/">el blog oficial</a>.</p>
<p>Existe algún soporte en varios editores, aunque de momento bastante limitado.</p>
<p>Para el editor <a href="http://www.eclipse.org/">Eclipse</a>, existen varios plugins:</p>
<ul>
<li><a href="http://www.googlipse.com/">Googlipse</a>:  De momento bastante limitado</li>
<li><a href="http://code.google.com/p/gwt-tooling/">GWT Tooling</a>:  Basado en el anterior e incorpora alguna mejora</li>
<li><a href="http://www.wirelexsoft.com/VistaFei.html">VistaFei</a>: Aunque lo venden como un editor completo, se trata de un Eclipse con varios plug-ins desarrollados por ellos (no se pueden descargar independientemente, pero es posible aislarlos de una versión completa para incorporarlo posteriormente a una versión del eclipse ya instalada). Incorpora un editor visual. El problema actual de este editor es que cada vez que se regenera una pantalla desde el editor, se reemplaza completamente el código.</li>
<li><a href="http://www.instantiations.com/gwtdesigner/">GWT Designer</a></li>
</ul>
<p>Para el editor <a href="http://www.jetbrains.com/idea/">IntelliJ</a> tenemos:</p>
<ul>
<li><a href="http://www.jetbrains.net/confluence/display/IDEADEV/GWT+Studio+plugin">GWT Studio</a></li>
</ul>
<p>También hay disponibles varios componentes desarrollados por terceras partes para añadir a los que trae por defecto el framework. Algunos sitios que los recopilan son:</p>
<ul>
<li><a href="http://gwt.components.googlepages.com/">GWT Component Library</a></li>
<li><a href="http://gwt-widget.sourceforge.net/">GWT Widget Library</a></li>
<li><a href="http://jwc.sourceforge.net/cgi-bin/bin/view/Main/WebHome">JWC &#8211; Java Web Components</a></li>
</ul>
<p>Aunque la idea que propone la herramienta parece bastante interesante, a la hora de crear una aplicación nos podemos encontrar con algunos problemas:</p>
<ul>
<li>La documentación está muy restringida a sencillos ejemplos pero sin dar mucha información para realizar aplicaciones completas (incluso se comenta que en Google liberaron una parte muy pequeña de los componente que realmente utilizan para sus aplicaciones).</li>
<li><del datetime="2007-01-10T17:06:38+00:00"></del>Desde el 12 de Diciembre del 2006 el compilador de <a href="http://googlewebtoolkit.blogspot.com/2006/12/gwt-13-release-candidate-is-100-open_12.html">GWT es Open Source</a></li>
<li>Es difcil encontrar errores cuando la aplicación simplemente no arranca ya que la ejecución de la misma, en desarrollo, está “oculta” en unas clases lanzadoras de Google.</li>
<li>Todos los archivos deben estar codificados en UTF-8 para que salgan los mensajes correctamente.</li>
<li>La conversión de código Java a JavaScript hace que la carga de la página pueda ser algo mas lenta aunque la ejecución, una vez cargada, será más rápida (siempre dependiendo de la potencia de la máquina del cliente).</li>
</ul>
<p><strong>Algunas aplicaciones de ejemplo</strong></p>
<ul>
<li><a href="http://code.google.com/webtoolkit/documentation/examples/">Google Web Toolkit Example Applications</a>: Sencillas aplicaciones de ejemplo oficiales.</li>
<li><a href="http://octagonsoftware.com/home/mark/gwthangman/">GWT Hangman</a>: Juego del ahorcado realizado por Mark Roth</li>
<li><a href="http://www.gpokr.com/">Gpokr</a>: Juego de poker animado</li>
<li><a href="http://www.mynetimages.com/">myNetImages</a>: Sitio de compartición de fotografías desarrollado usando Google Web toolkit.</li>
<li><a href="http://s2.lodgon.com/ajax/LodgonDemo.html">RSS Reader</a>: Aplicación básica de lectura de RSS.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/01/gwt-google-web-toolkit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generador de Rut y Validador</title>
		<link>http://www.creations.cl/2009/01/generador-de-rut-y-validador/</link>
		<comments>http://www.creations.cl/2009/01/generador-de-rut-y-validador/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 18:34:46 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[generador de rut]]></category>
		<category><![CDATA[informática]]></category>
		<category><![CDATA[j2ee]]></category>
		<category><![CDATA[rut]]></category>
		<category><![CDATA[verificador de rut]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=63</guid>
		<description><![CDATA[Muchos han esatdo buscando  una forma de validar si un RUT es válido o no, pero también hay muchos que necesitan probar sus aplicaciones y están usando sus propios RUTs, pero ¿qué pasa cuando necesitas hacer una prueba masivamente?, acá te traigo la solución...
El primer método te devolverá un char con el texto del dígito [...]]]></description>
			<content:encoded><![CDATA[<p>Muchos han esatdo buscando  una forma de validar si un RUT es válido o no, pero también hay muchos que necesitan probar sus aplicaciones y están usando sus propios RUTs, pero ¿qué pasa cuando necesitas hacer una prueba masivamente?, acá te traigo la solución...</p>
<p><span id="more-63"></span>El primer método te devolverá un char con el texto del dígito verificador al RUT que se recibe por parámetro, pero, ¿por qué devuelve char?, fácil, el dígito verificador puede ser una "K", por lo que se devuelve como código ASCII del carácter correspondiente.</p>
<p>Por ejemplo</p>
<div class="igBar"><span id="ljava-5"><a href="#" onclick="javascript:showPlainTxt('java-5'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-5">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>char<span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;color:#800000;">45</span> <span style="color: #808080; font-style: italic;">//- eso corresponde a cero 0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#40;</span>char<span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;color:#800000;">75</span> <span style="color: #808080; font-style: italic;">//- eso corresponde a K </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Acá el método que me devuelve el Dígito Verificador.</p>
<div class="igBar"><span id="ljava-6"><a href="#" onclick="javascript:showPlainTxt('java-6'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-6">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> char obtieneDV<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> rut<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> m = <span style="color: #cc66cc;color:#800000;">0</span>, s = <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>; rut != <span style="color: #cc66cc;color:#800000;">0</span>; rut /= <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">s = <span style="color: #66cc66;">&#40;</span>s + rut % <span style="color: #cc66cc;color:#800000;">10</span> * <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">9</span> - m++ % <span style="color: #cc66cc;color:#800000;">6</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> % <span style="color: #cc66cc;color:#800000;">11</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> <span style="color: #66cc66;">&#40;</span>char<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>s != <span style="color: #cc66cc;color:#800000;">0</span> ? s + <span style="color: #cc66cc;color:#800000;">47</span> : <span style="color: #cc66cc;color:#800000;">75</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>El método es super sencillo, pero necesitamos probarlo. Para esto vamos a hacer un for que me genere números al azar que haremos pasar por RUTs y obtendremos el dígito verificador que corresponda, si bien, muchos de estos RUTs no serán reales, sí serán validos y nos servirtán para testear nuestra aplicación.</p>
<div class="igBar"><span id="ljava-7"><a href="#" onclick="javascript:showPlainTxt('java-7'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-7">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> metodoCualquiera<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i=<span style="color: #cc66cc;color:#800000;">0</span>; i&amp;lt;<span style="color: #cc66cc;color:#800000;">100</span>; i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> rut = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AMath+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">Math</span></a>.<span style="color: #006600;">random</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>*<span style="color: #cc66cc;color:#800000;">30000000</span>+<span style="color: #cc66cc;color:#800000;">10000000</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">GWT.<span style="color: #006600;">log</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"RUT :"</span>+<a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a>.<span style="color: #006600;">valueOf</span><span style="color: #66cc66;">&#40;</span>rut<span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">"-"</span>+obtieneDV<span style="color: #66cc66;">&#40;</span>rut<span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">null</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a>.<span style="color: #006600;">valueOf</span><span style="color: #66cc66;">&#40;</span>rut<span style="color: #66cc66;">&#41;</span>+<span style="color: #ff0000;">"-"</span>+obtieneDV<span style="color: #66cc66;">&#40;</span>rut<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> char obtieneDV<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> rut<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> m = <span style="color: #cc66cc;color:#800000;">0</span>, s = <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>; rut != <span style="color: #cc66cc;color:#800000;">0</span>; rut /= <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">s = <span style="color: #66cc66;">&#40;</span>s + rut % <span style="color: #cc66cc;color:#800000;">10</span> * <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">9</span> - m++ % <span style="color: #cc66cc;color:#800000;">6</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> % <span style="color: #cc66cc;color:#800000;">11</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> <span style="color: #66cc66;">&#40;</span>char<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>s != <span style="color: #cc66cc;color:#800000;">0</span> ? s + <span style="color: #cc66cc;color:#800000;">47</span> : <span style="color: #cc66cc;color:#800000;">75</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Así tendremos una consola con 100 RUTs totalmente válidos y útiles al momento de hacer testing.</p>
<p>Para los que también necesiten un validador de RUT.</p>
<p>Este método es parecido al anterior, sólo que recibe un parámetro má, el DV, así calcula el DV que corresponde al RUT introducido y lo compara con el DV que nosotros le proporcionamos, nos devolverá un "true" en caso de ser iguales y un "false" en caso de no corresponder.</p>
<div class="igBar"><span id="ljava-8"><a href="#" onclick="javascript:showPlainTxt('java-8'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-8">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> verificarRut<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> rut, char dv<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #993333;">int</span> m = <span style="color: #cc66cc;color:#800000;">0</span>, s = <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span>; rut != <span style="color: #cc66cc;color:#800000;">0</span>; rut /= <span style="color: #cc66cc;color:#800000;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">s = <span style="color: #66cc66;">&#40;</span>s + rut % <span style="color: #cc66cc;color:#800000;">10</span> * <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;color:#800000;">9</span> - m++ % <span style="color: #cc66cc;color:#800000;">6</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> % <span style="color: #cc66cc;color:#800000;">11</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">return</span> dv == <span style="color: #66cc66;">&#40;</span>char<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>s != <span style="color: #cc66cc;color:#800000;">0</span> ? s + <span style="color: #cc66cc;color:#800000;">47</span> : <span style="color: #cc66cc;color:#800000;">75</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/01/generador-de-rut-y-validador/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>java[arrays]</title>
		<link>http://www.creations.cl/2009/01/javaarrays/</link>
		<comments>http://www.creations.cl/2009/01/javaarrays/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 12:30:23 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[Programación]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[informática]]></category>
		<category><![CDATA[j2ee]]></category>
		<category><![CDATA[lista]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=47</guid>
		<description><![CDATA[Veremos como pasar de una lista a un array, el codigo es relativamente sencillo, veamos el ejemplo::
TEXTO PLANO
JAVA:




private String&#91;&#93; textosLista;


&#160;


//Debido al ejemplo asumiremos que el ArrayList tiene datos


private ArrayList textos_array;


&#160;


public void trasformar&#40;&#41;&#123;


textosLista= &#40;String&#91;&#93;&#41;textos_array.toArray&#40;new String&#91;textos_array.size&#40;&#41;&#93;&#41;;


&#160;


//Acá simplemente lo recorremos


&#160;


for&#40;int i=0;i&#60;textosLista.length;i++&#41;&#123;


System.out.println&#40;textosLista&#91;i&#93;&#41;;


&#125;


&#125; 






]]></description>
			<content:encoded><![CDATA[<p>Veremos como pasar de una lista a un array, el codigo es relativamente sencillo, veamos el ejemplo::</p>
<div class="igBar"><span id="ljava-10"><a href="#" onclick="javascript:showPlainTxt('java-10'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVA:</span>
<div id="java-10">
<div class="java">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> textosLista;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//Debido al ejemplo asumiremos que el ArrayList tiene datos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?q=allinurl%3AArrayList+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">ArrayList</span></a> textos_array;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> trasformar<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">textosLista= <span style="color: #66cc66;">&#40;</span><a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>textos_array.<span style="color: #006600;">toArray</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?q=allinurl%3AString+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">String</span></a><span style="color: #66cc66;">&#91;</span>textos_array.<span style="color: #006600;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">//Acá simplemente lo recorremos</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #b1b100;">for</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i=<span style="color: #cc66cc;color:#800000;">0</span>;i&lt;textosLista.<span style="color: #006600;">length</span>;i++<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.google.com/search?q=allinurl%3ASystem+java.sun.com&amp;bntl=1"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">&#40;</span>textosLista<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2009/01/javaarrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redireccionamiento</title>
		<link>http://www.creations.cl/2008/11/redireccionamiento/</link>
		<comments>http://www.creations.cl/2008/11/redireccionamiento/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 20:00:12 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[informática]]></category>

		<guid isPermaLink="false">http://www.creations.cl/?p=27</guid>
		<description><![CDATA[Hoy realizaré mi segundo aporte real a la humanidad, les enseñaré unas cuantas formas de redireccionar a otro sitio web.
1° Mediante HTML Usando el elemento META inmediatamente
&#60;html&#62;
&#60;head&#62;
&#60;meta http-equiv="acci" content="segundos"; url="www.creations.cl"/&#62;
&#60;/head&#62;

&#60;body&#62;
&#60;/body&#62;
&#60;/html&#62;
2° Mediante HTML Usando el elemento META con temporizador

&#60;html&#62; 
&#60;head&#62; 
&#60;meta http-equiv="Refresh" content="5;url=www.creations.cl"&#62; 
&#60;/head&#62;
&#60;body&#62; 
&#60;p&#62;Sitio no disponible serás redireccionado en cinco segundos.&#60;/p&#62;
&#60;/body&#62; 
&#60;/html&#62;

3° Mediante JavaScript Con temporizador
&#60;html&#62; 
&#60;head&#62; 
&#60;script type="text/javascript"&#62; 
function redir(){ 
  window.locationf="http://www.creations.cl"; 
}  
setTimeout ("redir()", 10000); //tiempo expresado en milisegundos 
&#60;/script&#62; 
&#60;/head&#62; 
&#60;body&#62; 
&#60;p&#62; Espere por favor, será redireccionado en 10 segundos.&#60;/p&#62; 
&#60;/body&#62; 
&#60;/html&#62;
4° Mediante JavaScript De Forma Inmediata
&#60;body&#62; 
&#60;script type="text/javascript"&#62; 
window.location="http://www.creations.cl"; 
&#60;/script&#62; 
&#60;/body&#62;
5° [...]]]></description>
			<content:encoded><![CDATA[<p>Hoy realizaré mi segundo aporte real a la humanidad, les enseñaré unas cuantas formas de redireccionar a otro sitio web.</p>
<p><strong>1° Mediante HTML</strong> Usando el elemento META inmediatamente</p>
<pre class="codigo">&lt;html&gt;
&lt;head&gt;
&lt;meta http-equiv="acci" content="segundos"; url="www.creations.cl"/&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><strong>2° Mediante HTML</strong> Usando el elemento META con temporizador</p>
<pre class="codigo">
<span class="html__tag_start">&lt;html</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;head</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;meta</span> <span class="html__attr_name">http-equiv</span>=<span class="html__attr_value">"Refresh"</span> <span class="html__attr_name">content</span>=<span class="html__attr_value">"5;url=www.creations.cl"</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_end">&lt;/head&gt;</span>
<span class="html__tag_start">&lt;body</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;p</span><span class="html__tag_start">&gt;</span>Sitio no disponible serás redireccionado en cinco segundos.&lt;/p&gt;
<span class="html__tag_end">&lt;/body&gt;</span> 
<span class="html__tag_end">&lt;/html&gt;
</span></pre>
<p><strong>3° Mediante JavaScript</strong> Con temporizador</p>
<pre class="codigo"><span class="html__tag_start">&lt;html</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;head</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;script</span> <span class="html__attr_name">type</span>=<span class="html__attr_value">"text/javascript"</span><span class="html__tag_start">&gt;</span> 
<span class="javascript__operator">function</span> redir()<span class="javascript__brace">{</span> 
  window.locationf=<span class="javascript__string">"http://www.creations.cl"</span>; 
<span class="javascript__brace">}</span>  
setTimeout (<span class="javascript__string">"redir()"</span>, <span class="javascript__num">10000</span>); <span class="javascript__sl_comment">//tiempo expresado en milisegundos</span> 
<span class="html__tag_end">&lt;/script&gt;</span> 
<span class="html__tag_end">&lt;/head&gt;</span> 
<span class="html__tag_start">&lt;body</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;p</span><span class="html__tag_start">&gt;</span> Espere por favor, será redireccionado en 10 segundos.<span class="html__tag_end">&lt;/p&gt;</span> 
<span class="html__tag_end">&lt;/body&gt;</span> 
<span class="html__tag_end">&lt;/html&gt;</span></pre>
<p><strong>4° Mediante JavaScript</strong> De Forma Inmediata</p>
<pre class="codigo"><span class="html__tag_start">&lt;body</span><span class="html__tag_start">&gt;</span> 
<span class="html__tag_start">&lt;script</span> <span class="html__attr_name">type</span>=<span class="html__attr_value">"text/javascript"</span><span class="html__tag_start">&gt;</span> 
window.location=<span class="javascript__string">"http://www.creations.cl"</span>; 
<span class="html__tag_end">&lt;/script&gt;</span> 
<span class="html__tag_end">&lt;/body&gt;</span></pre>
<p><strong>5° Mediante PHP</strong></p>
<pre class="codigo">&lt;?php 
header ("Location: http://www.creations.cl"); 
?&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2008/11/redireccionamiento/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP[DAO]::Data Access Object</title>
		<link>http://www.creations.cl/2008/08/phpdaodata-access-object/</link>
		<comments>http://www.creations.cl/2008/08/phpdaodata-access-object/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 04:08:20 +0000</pubDate>
		<dc:creator>Ancelot</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[base de datos]]></category>
		<category><![CDATA[DAO]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[informática]]></category>
		<category><![CDATA[Orientación a objetos]]></category>
		<category><![CDATA[PEAR]]></category>

		<guid isPermaLink="false">http://fullmoon.webcindario.com/?p=9</guid>
		<description><![CDATA[El DAO, Data Access Object por sus siglas en inglés, corresponde a un patrón de diseño que tiene como proposito abstraer al software cliente del acceso a los datos o de la fuente de almacenamiento, y que solo se centre en los datos que necesite.
Este patrón de diseño nace de la necesidad de gestionar diversas [...]]]></description>
			<content:encoded><![CDATA[<p>El DAO, Data Access Object por sus siglas en inglés, corresponde a un patrón de diseño que tiene como proposito abstraer al software cliente del acceso a los datos o de la fuente de almacenamiento, y que solo se centre en los datos que necesite.</p>
<p>Este patrón de diseño nace de la necesidad de gestionar diversas fuentes de datos, aunque su uso se extiende al problema de encapsular no sólo la fuente de datos, sino que además mantiene oculta la forma en que se accede a los datos. Se trata de hacer que el software cliente se concentre en los datos que necesita y no se preocupe de cómo ni de dónde obtiene los datos.</p>
<p>El DAO realiza la implementacion del mecanismo para acceder a la fuente de datos, sea esta una base de datos, archivos externos, etc... Los componentes de negocio que tratan con el DAO utilizan un interface simple expuesto por el DAO para sus clientes. El DAO oculta completamente los detalles de implementación de la fuente de datos a sus clientes. Como el interface expuesto por el DAO no cambia cuando cambia la implementación de la fuente de datos subyacente, este patrón permite al DAO adaptarse a diferentes esquemas de almacenamiento sin que esto afecte a sus clientes o componentes de engocio. Esencialmente, el DAO actúa como un adaptador entre el componente y la fuente de datos.</p>
<p><img class="imgpost" src="wp-content/uploads/DAO.png" alt="" width="540" /></p>
<p>Bueno, para que todo esto quede un poco más claro, voy a poner un ejemplo práctico sencillo para que se puedan formar una idea de como funciona. Si bien este patrón de diseño se puede aplicar a diversos lenguajes de programación, pondré el ejemplo en PHP, donde manipularemos datos de un <strong>"Usuario"</strong>, no nos preocuparemos de la interfaz gráfica, sólo del manejo de datos.</p>
<p><strong>[ UsuarioVO.php ]</strong> Clase usada para transportar informacion</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'UsuarioVO.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> UsuarioVO</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$id</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$nombre</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$rut</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$username</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$bcryptpass</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$mail</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$region</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$sexo</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$telefono</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#0000FF;">$descripcion</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p><strong>[ UsuarioDAO.php ]</strong> Interface donde declaramos los metodos disponibles</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">interface UsuarioDAO</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> guardar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$usuario_vo</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> buscarId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> buscarCampo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$campo</span>, <span style="color:#0000FF;">$valor</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<strong>[ Usuario_DB_DAO.php ]</strong> La clase que hace todo el trabajo</p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'UsuarioDAO.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'UsuarioVO.php'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'DB.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Usuario_DB_DAO implements UsuarioDAO</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">private <span style="color:#0000FF;">$conexion</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> __construct<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// vamos a conectarnos...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&amp;gt;conexion =</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DB::<span style="color:#006600;">connect</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"mysql://root@localhost/mibase"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;setFetchMode<span style="color:#006600; font-weight:bold;">&#40;</span>DB_FETCHMODE_ASSOC<span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>DB::<span style="color:#006600;">isError</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$this</span>-&amp;gt;conexion<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print"><span style="color:#000066;">print</span></a> <span style="color:#FF0000;">"Fallo la conexion!"</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print"><span style="color:#000066;">print</span></a> <span style="color:#FF0000;">"Error : "</span> .</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;getMessage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/print"><span style="color:#000066;">print</span></a> <span style="color:#FF0000;">"Detalles Error : "</span> .</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;getUserInfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/exit"><span style="color:#000066;">exit</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> guardar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$usuario_vo</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">//&nbsp; tenemos 2 casos.... insertar y actualizar</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;id == <span style="color:#000000; font-weight:bold;">null</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&amp;gt;insertar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$usuario_vo</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">else</span> <span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$this</span>-&amp;gt;actualizar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$usuario_vo</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">private <span style="color:#000000; font-weight:bold;">function</span> insertar<span style="color:#006600; font-weight:bold;">&#40;</span>UsuarioVo <span style="color:#0000FF;">$usuario_vo</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql</span> = <span style="color:#FF0000;">"INSERT INTO usuarios "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"(id, nombre, rut, username, bcryptpass,"</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"mail, region, sexo, telefono, descripcion) "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">" VALUES "</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">" (?, ?, ? , ?, ? , ? , ?,&nbsp; ?, ?, ?); "</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Antes de continuar vamos a obtener el nuevo id</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Como estamos usando DB vamos a usar el mecanismo</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// propio de DB para obtener el id.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;id = <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;nextId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"usuarios"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$datos</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;id,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;nombre,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;rut,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;username,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;bcryptpass,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;mail,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;region,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;sexo,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;telefono,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;descripcion <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span> = <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;prepare<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span> =&amp;amp; <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;execute<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span>,<span style="color:#0000FF;">$datos</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>PEAR::<span style="color:#006600;">isError</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$resultado</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Falló la insercion en la BD '</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$resultado</span>-&amp;gt;getMessage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Detalles Error : "</span> .</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span>-&amp;gt;getUserInfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">private <span style="color:#000000; font-weight:bold;">function</span> actualizar<span style="color:#006600; font-weight:bold;">&#40;</span>UsuarioVo <span style="color:#0000FF;">$usuario_vo</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql</span> = <span style="color:#FF0000;">"UPDATE usuarios SET "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"nombre = ? , "</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"rut = ? , "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"username = ? , "</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"bcryptpass = ? , "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"mail = ? , "</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"region = ? , "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"sexo = ? , "</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"telefono = ? , "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"descripcion = ?&nbsp; "</span>.</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"WHERE "</span>.</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF0000;">"id = ? ;"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Antes de continuar vamos a obtener el nuevo id</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Como estamos usando DB vamos a usar el mecanismo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// propio de DB para obtener el id.</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$datos</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;nombre,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;rut,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;username,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;bcryptpass,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;mail,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;region,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;sexo,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;telefono,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;descripcion,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;id <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span> = <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;prepare<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span> =&amp;amp; <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;execute<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span>,<span style="color:#0000FF;">$datos</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>PEAR::<span style="color:#006600;">isError</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$resultado</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Falló la modificación en la BD '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$resultado</span>-&amp;gt;getMessage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Detalles Error : "</span> .</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span>-&amp;gt;getUserInfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> buscarId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql</span> = <span style="color:#FF0000;">"SELECT * FROM usuarios WHERE id = ?"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span> = <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;prepare<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span> =&amp;amp; <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;execute<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>PEAR::<span style="color:#006600;">isError</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$resultado</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Falló la modificación en la BD '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$resultado</span>-&amp;gt;getMessage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Detalles Error : "</span> .</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span>-&amp;gt;getUserInfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">else</span> <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fila</span> =&amp;amp; <span style="color:#0000FF;">$resultado</span>-&amp;gt;fetchRow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span> = <span style="color:#000000; font-weight:bold;">new</span> UsuarioVO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;id = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'id'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;nombre = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'nombre'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;rut = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'rut'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;username = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'username'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;bcryptpass = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'bcryptpass'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;mail = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'mail'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;region = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'region'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;sexo = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'sexo'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;telefono = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'telefono'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;descripcion = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'descripcion'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#0000FF;">$usuario_vo</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Si hubo un error, o no encontramos nada...</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">public <span style="color:#000000; font-weight:bold;">function</span> buscarCampo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$campo</span>, <span style="color:#0000FF;">$valor</span><span style="color:#006600; font-weight:bold;">&#41;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$sql</span> = <span style="color:#FF0000;">"SELECT * FROM usuarios WHERE $campo = ?"</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span> = <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;prepare<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$sql</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span> =&amp;amp; <span style="color:#0000FF;">$this</span>-&amp;gt;conexion-&amp;gt;execute<span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$preparedStatement</span>,<span style="color:#0000FF;">$valor</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>PEAR::<span style="color:#006600;">isError</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$resultado</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Falló la modificación en la BD '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$resultado</span>-&amp;gt;getMessage<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"Detalles Error : "</span> .</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$resultado</span>-&amp;gt;getUserInfo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> . <span style="color:#FF0000;">""</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#000000; font-weight:bold;">null</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$respuesta</span> = <a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">while</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$fila</span> =&amp;amp; <span style="color:#0000FF;">$resultado</span>-&amp;gt;fetchRow<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span> = <span style="color:#000000; font-weight:bold;">new</span> UsuarioVO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;id = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'id'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;nombre = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'nombre'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;rut = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'rut'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;username = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'username'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;bcryptpass = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'bcryptpass'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;mail = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'mail'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;region = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'region'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;sexo = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'sexo'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;telefono = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'telefono'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$usuario_vo</span>-&amp;gt;descripcion = <span style="color:#0000FF;">$fila</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'descripcion'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$respuesta</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF;">$usuario_vo</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">return</span> <span style="color:#0000FF;">$respuesta</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Bien, ahora ya tenemos listas las clases que necesitamos para manipular nuestro usuario (los datos del usuario, no es que cumplamos es sueño de todo HelpDesk). Ahora solo nos falta alguien que necesite agregar, actualizar o borrar informacion del usuario.</p>
<p><strong>Alguien que necesite ingresar un usuario...</strong></p>
<p><strong>[ InsertarUsuario.php ]</strong> Clase que insertará un usuario</p>
<div class="igBar"><span id="lphp-21"><a href="#" onclick="javascript:showPlainTxt('php-21'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-21">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'usuarioVO.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'Usuario_DB_DAO.php'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// para probar, necesitamos crear un usuarioVO</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span> = <span style="color:#000000; font-weight:bold;">new</span> UsuarioVO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;id = <span style="color:#000000; font-weight:bold;">null</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;nombre = <span style="color:#FF0000;">'Juan Lopez'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;rut = <span style="color:#FF0000;">'3-5'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;username = <span style="color:#FF0000;">'juanito'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;mail = <span style="color:#FF0000;">'juan.lopez@mimail.com'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;region = <span style="color:#CC66CC;color:#800000;">13</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;telefono = <span style="color:#FF0000;">'98765432'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;sexo = <span style="color:#CC66CC;color:#800000;">1</span>; <span style="color:#FF9933; font-style:italic;">// 1 hombre, 2 mujer!</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;descripcion = <span style="color:#FF0000;">'Ejecutivo joven, baila salsa'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;bcryptpass = <span style="color:#FF0000;">'erwrwesdsdfsdfsdksd'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Y necesitamos un dao...</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dao</span> = <span style="color:#000000; font-weight:bold;">new</span> Usuario_DB_DAO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dao</span>-&amp;gt;guardar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$vo</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Terminamos!'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<strong>Alguien que modifique un usuario...</strong></p>
<p><strong>[ ModificarUsuario.php ]</strong> Modificaremos un campo del usuario.</p>
<div class="igBar"><span id="lphp-22"><a href="#" onclick="javascript:showPlainTxt('php-22'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-22">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'usuarioVO.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'Usuario_DB_DAO.php'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dao</span> = <span style="color:#000000; font-weight:bold;">new</span> Usuario_DB_DAO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span> = <span style="color:#0000FF;">$dao</span>-&amp;gt;buscarId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Terminamos la busqueda'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span>-&amp;gt;descripcion = <span style="color:#0000FF;">$vo</span>-&amp;gt;descripcion. <span style="color:#FF0000;">'Probando modificar'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dao</span>-&amp;gt;guardar<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$vo</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Terminamos!'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<strong>Buscaremos usuarios que cumplan un cierto filtro o requisito...</strong></p>
<p><strong>[ BuscarCampo.php ]</strong> Buscaremos por un campo en específico.</p>
<div class="igBar"><span id="lphp-23"><a href="#" onclick="javascript:showPlainTxt('php-23'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-23">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'usuarioVO.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'Usuario_DB_DAO.php'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dao</span> = <span style="color:#000000; font-weight:bold;">new</span> Usuario_DB_DAO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// buscamos a los hombres.</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$lista</span> = <span style="color:#0000FF;">$dao</span>-&amp;gt;buscarCampo<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'sexo'</span>, <span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Hay '</span>. <a href="http://www.php.net/count"><span style="color:#000066;">count</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$lista</span><span style="color:#006600; font-weight:bold;">&#41;</span>. <span style="color:#FF0000;">' hombres registrados'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Terminamos!'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
<strong>Una simple búsqueda por ID, y listaremos todos sus valores...</strong></p>
<p><strong>[ BuscarPorID.php ]</strong> Buscaremos por un ID.</p>
<div class="igBar"><span id="lphp-24"><a href="#" onclick="javascript:showPlainTxt('php-24'); return false;">TEXTO PLANO</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-24">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'usuarioVO.php'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span> <span style="color:#FF0000;">'Usuario_DB_DAO.php'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$dao</span> = <span style="color:#000000; font-weight:bold;">new</span> Usuario_DB_DAO<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$vo</span> = <span style="color:#0000FF;">$dao</span>-&amp;gt;buscarId<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC66CC;color:#800000;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// Obs tratamos el objeto como un arreglo</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$vo</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$llave</span> =&amp;gt; <span style="color:#0000FF;">$valor</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">"$llave : $valor "</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'Terminamos la busqueda'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">?&amp;gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p>
Ya, terminamos este simple ejemplo de como funciona el DAO, espero esté redactado de forma clara y comprensible.</p>
<p>Toda crítica o comentario será bienvenida...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.creations.cl/2008/08/phpdaodata-access-object/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

