<?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>Punksolid &#187; web</title>
	<atom:link href="http://www.punksolid.com/tag/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.punksolid.com</link>
	<description>Tecnologia, Curiosidades, Sistemas de Informacion y un poco de Religion</description>
	<lastBuildDate>Thu, 18 Aug 2011 13:06:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Busquedas de filtros complejos en CakePHP</title>
		<link>http://www.punksolid.com/busquedas-de-filtros-complejos-en-cakephp/2011/</link>
		<comments>http://www.punksolid.com/busquedas-de-filtros-complejos-en-cakephp/2011/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 11:57:44 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programas]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=644</guid>
		<description><![CDATA[Para comprender la situación mejor, necesitamos ver el screenshot de la vista. Hay varias formas de hacer esto, la mas común es usar la función query de CakePHP para armar la consulta SQL en base a condiciones by (@el_keogh) , está la función find, pero no se pueden poner condiciones dentro, así que lo que [...]]]></description>
			<content:encoded><![CDATA[<p>Para comprender la situación mejor, necesitamos ver el screenshot de la vista.</p>
<p><a href="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2011/07/Selecci%C3%B3n_011.png"><img class="aligncenter size-full wp-image-660" title="Busqueda" src="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2011/08/Selecci%C3%B3n_024.png" alt="" width="687" height="225" /></a></p>
<p>Hay varias formas de hacer esto, la mas común es usar la función query de CakePHP para armar la <a href="http://pastebin.com/XS1rMtr1" target="_blank">consulta SQL en base a condiciones</a> by (<a href="http://twitter.com/el_keogh" target="_blank">@el_keogh)</a> , está la función find, pero no se pueden poner condiciones dentro, así que lo que se puede hacer es armar el array conditions desde afuera de la siguiente forma:</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #666666; font-style: italic;">//Bloque #1 asignacion de variables para comodidad</span>
<span style="color: #000088;">$alumnoid</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cuenta'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$user</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fechaInicio</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Fecha de Inicio'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fechaFin</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Fecha de Fin'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$formadepago</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'forma_de_pago'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$resultado</span><span style="color: #339933;">=</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'resultado'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$conditions</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Bloque #2 Condiciones tabla Alumnos</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nombre'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Alumno.nombre LIKE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nombre'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'apellido_paterno'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Alumno.apellido_paterno LIKE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'apellido_paterno'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'apellido_materno'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Alumno.apellido_materno LIKE'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'apellido_materno'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'%'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//Bloque #3 Condiciones tabla Examenes</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$alumnoid</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.alumno_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$alumnoid</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$user</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.user_id'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #000088;">$user</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//Bloque #4 Condiciones de intervalos de fecha</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fechaInicio</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.created &gt;'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$fechaInicio</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fechaFin</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.created &lt;='</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #000088;">$fechaFin</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' 23:59:59'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$formadepago</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.forma_de_pago'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #000088;">$formadepago</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$resultado</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.resultado'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span><span style="color: #000088;">$resultado</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">//Bloque #5 query</span>
<span style="color: #000088;">$conditions</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Examene.statusid &lt;&gt;'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$examenes</span><span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">paginate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conditions</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h3>Bloque #1 asignación de variables</h3>
<p>En este caso se manejan dos tablas distintas de la base de datos, están relacionadas entre si, Alumnos y Examenes, utilicé asignación de variables para mas comodidad en su manejo, pero no son necesarias.</p>
<h3>Bloque #2 Condiciones de tabla Alumnos</h3>
<p>Las condiciones determinan cuando hay datos en los campos, si no hay datos, no hay condición que aplicar y nada que meter en el array, las primeras tres condiciones pertenecen a la tabla alumnos, de la cual se va a buscar por nombre NO exacto por eso los LIKE y la concatenación del símbolo de porcentaje. Para que esto funcione, las relaciones en el modelo deben estar previamente establecidas.</p>
<h3>Bloque #3 Condiciones de tabla Examenes</h3>
<p>En el segundo bloque ponemos las condiciones de la otra tabla, nada especial ya que los valores de esos campos deben ser exactos.</p>
<h3>Bloque #4 Condiciones de intervalos de fecha</h3>
<p>Para cuando tenemos intervalos de fechas y tenemos el formato en Datetime, es necesario concatenar la hora en la que termina el dia, si no lo hiciéramos contaría hasta la hora 00:00:00 no devolviéndonos los resultados del ultimo dia especificado.</p>
<h3>Bloque #5 Query</h3>
<p>La función paginate, se utiliza casi de la misma manera que un <a href="http://book.cakephp.org/view/1030/Complex-Find-Conditions" title="Complex Find Conditions" target="_blank">find</a> y listo automagicamente cakephp devolverá solo los exámenes de los campos donde se les haya especificado algun dato, notese que este tipo de búsqueda es de tipo AND, o sea cada campo va filtrando aun mas la búsqueda, en lugar de añadir nuevas coincidencias.</p>
<p>Cualquier duda o comentario es bienvenido.<br />
Referencias<br />
<a href="http://book.cakephp.org/view/1030/Complex-Find-Conditions" title="Documentación oficial cakephp" target="_blank">Complex Find Conditions</a><br />
<a href="http://book.cakephp.org/view/164/pagination" target="_blank">Pagination in cakephp</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/busquedas-de-filtros-complejos-en-cakephp/2011/&via=Punksolid&text=Busquedas de filtros complejos en CakePHP&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/busquedas-de-filtros-complejos-en-cakephp/2011/&via=Punksolid&text=Busquedas de filtros complejos en CakePHP&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/busquedas-de-filtros-complejos-en-cakephp/2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Invitar a todos tus amigos de Facebook a un evento.</title>
		<link>http://www.punksolid.com/invitar-a-todos-tus-amigos-de-facebook-a-un-evento/2011/</link>
		<comments>http://www.punksolid.com/invitar-a-todos-tus-amigos-de-facebook-a-un-evento/2011/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 04:17:04 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Redes Sociales]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=622</guid>
		<description><![CDATA[Actualización: Para la fecha 30 de julio de 2011 este método ya no funciona. Pase a ver, Invitar a todos en facebook En internet está plagado de instrucciones para hacerlo, pero como facebook cambia constantemente su funcionamiento, dichas instrucciones dejan de funcionar, está manera recién la probé con éxito sobre Firefox 4. 1. Nos ponemos [...]]]></description>
			<content:encoded><![CDATA[<h3><strong>Actualización</strong>: Para la fecha 30 de julio de 2011 este método ya no funciona. Pase a ver, <a href="http://t.co/dmyJUfF">Invitar a todos en facebook</a></h3>
<p>En internet está plagado de instrucciones para hacerlo, pero como facebook cambia constantemente su funcionamiento, dichas instrucciones dejan de funcionar, está manera recién la probé con éxito sobre Firefox 4.</p>
<p>1. Nos ponemos en la pagina del evento.</p>
<p>2. Seleccionamos el botón de seleccionar invitados de la parque izquierda.</p>
<p>3. En la barra de direcciones donde está la URL, copiamos y pegamos lo siguiente:</p>
<blockquote><p><em>javascript:var elms=document.getElementsByName("checkableitems[]");for(var count=0;count&lt;elms.length;count++){var t = setTimeout("elms["+count+"].click()",100)}</em></p></blockquote>
<p>Luego esperamos unos segundos o minutos según la velocidad de la computadora y el numero de amigos, y damos clic en enviar invitaciones.<em><strong></strong></em></p>
<p><em><strong>Fuente | </strong></em><a href="http://inavegar.es/general/invitar-a-todos-tus-amigos-a-un-evento-nueva-forma">Invitar a todos tus amigos a un evento en Facebook (Nueva forma)</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/invitar-a-todos-tus-amigos-de-facebook-a-un-evento/2011/&via=Punksolid&text=Invitar a todos tus amigos de Facebook a un evento.&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/invitar-a-todos-tus-amigos-de-facebook-a-un-evento/2011/&via=Punksolid&text=Invitar a todos tus amigos de Facebook a un evento.&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/invitar-a-todos-tus-amigos-de-facebook-a-un-evento/2011/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Sistema de Votaciones de Youtube</title>
		<link>http://www.punksolid.com/sistema-de-votaciones-de-youtube/2009/</link>
		<comments>http://www.punksolid.com/sistema-de-votaciones-de-youtube/2009/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 06:42:57 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Rating]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=458</guid>
		<description><![CDATA[Recientemente Youtube publicó en su blog, unos datos interesantes acerca de su sistema de votaciones de videos donde publicó la siguiente gráfica: Análisis Al parecer los usuarios de Youtube solo votan los vídeos que les gustan y como les gustan votan con 5 estrellas, y en menor cantidad votan por 1 estrella los vídeos que [...]]]></description>
			<content:encoded><![CDATA[<p>Recientemente Youtube publicó en su blog, unos datos interesantes acerca de su <a href="http://youtube-global.blogspot.com/2009/09/five-stars-dominate-ratings.html">sistema de votaciones de videos</a> donde publicó la siguiente gráfica:</p>
<div id="attachment_461" class="wp-caption aligncenter" style="width: 410px"><img class="size-full wp-image-461" title="ratings graph" src="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2009/09/ratings-graph.jpg" alt="Grafico de votos de Youtube" width="400" height="137" /><p class="wp-caption-text">Grafico de votos de Youtube</p></div>
<h3>Análisis</h3>
<p>Al parecer los usuarios de Youtube solo votan los vídeos que les gustan y como les gustan votan con 5 estrellas, y en menor cantidad votan por 1 estrella los vídeos que no les gustan, a mi parecer este sistema de votaciones no está funcionando como se esperaba, de hecho yo voto casi todos los vídeos, y rara vez pongo 2, 3 o 4 estrellas.</p>
<h3>Otros servicios</h3>
<p><img class="alignright" title="Facebook rating" src="http://cache0.techcrunch.com/wp-content/uploads/2009/02/picture-73.png" alt="" width="199" height="211" /></p>
<p>En Facebook está el 'Me gusta' lo cual le dá un valor positivo, pero no podemos saber a cuantos usuarios No les gusta, lo cual podría servir para saber que artículos son peores que otros, y no dejarlos empatados con otros que sean parecidos.</p>
<p>También está el caso de la votación de comentarios que es en base 2, positivo o negativo, no hay de otra, pero eso creo tiene un inconveniente, cuando votas positivo ¿que estás votando? el video o ¿estás de acuerdo con lo que dice el video? por ejemplo un video podría hablar datos concisos de un partido político que NO me gusta, entonces no me atrevería a votarlo negativo por que puede ser verídico pero no me gusta.</p>
<h3>Mi propuesta</h3>
<p>No sé si aplique exactamente a youtube, pero a un sistema de contenidos si aplicaría, un sistema de votaciones en base 3, donde sea un voto en contra, un voto a favor y una mención honorífica, donde esta tenga un valor mayor a un voto a favor pero con la característica de <strong>pagar</strong> por votar, sugiriendo un costo de unos centavos.</p>
<p>Talvez pagar suene demasiado complejo, pero una integración con un sistema de pagos no es tan difícil, y por supuesto creo que casi todo el pago por votos de la mención honorífica debería ir al creador del vídeo, eso seria un incentivo financiero, y a su vez un orgullo el hecho de que alguien se atreva a pagar, por un vídeo que tu hiciste.</p>
<p>Ustedes mi ávidos lectores denle like en donde me lean, y luego me dicen ¿que opinan?</p>
<h4>Referencias</h4>
<p>Maestros del Web | <a href="http://www.maestrosdelweb.com/editorial/me-gusta-y-punto/">Me gusta y punto</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/sistema-de-votaciones-de-youtube/2009/&via=Punksolid&text=Sistema de Votaciones de Youtube&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/sistema-de-votaciones-de-youtube/2009/&via=Punksolid&text=Sistema de Votaciones de Youtube&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/sistema-de-votaciones-de-youtube/2009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hacer Visible Desde Internet Mi Localhost En Linux Ubuntu</title>
		<link>http://www.punksolid.com/hacer-visible-desde-internet-mi-localhost-en-linux-ubuntu/2009/</link>
		<comments>http://www.punksolid.com/hacer-visible-desde-internet-mi-localhost-en-linux-ubuntu/2009/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 09:58:28 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Infinitum]]></category>
		<category><![CDATA[redes]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=453</guid>
		<description><![CDATA[Escenario Ubuntu 9.04 Infinitum Router 2 wire Inadyn Dyndns Tutorial rápido Modo desmilitarizado Crear y configurar cuenta Dyndns Configurar programa cliente Tutorial a detalle Dyndns Suponiendo que ya tenemos el locahost jalando, ocupamos un servidor DNS, para eso hay un servicio gratuito de subdominios en www.dyndns.org, ahi creamos una cuenta y la confirmamos en el [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="null"><img class="alignright" title="Dyndns" src="https://www.dyndns.com/images/site/tango/dyndns.gif" alt="" width="238" height="50" /></a>Escenario</h2>
<ul>
<li>Ubuntu 9.04</li>
<li>Infinitum Router 2 wire</li>
<li>Inadyn</li>
<li>Dyndns</li>
</ul>
<h2>Tutorial rápido</h2>
<ol>
<li>Modo desmilitarizado</li>
<li>Crear y configurar cuenta Dyndns</li>
<li>Configurar programa cliente</li>
</ol>
<p><a href="null"><img class="aligncenter" title="Dyndns" src="http://infracom-france.com/blog2/wp-content/uploads/2009/05/ddns.gif" alt="" width="532" height="300" /></a></p>
<ol></ol>
<h2>Tutorial a detalle</h2>
<h3>Dyndns</h3>
<p>Suponiendo que ya tenemos el locahost jalando, ocupamos un servidor DNS, para eso hay un servicio gratuito de subdominios en www.dyndns.org, ahi creamos una cuenta y la confirmamos en el correo electronico.</p>
<p>Nos vamos a la pagina y accesamos con nuestro usuario y contraseña, en la pantalla principal elegimos <em>"Add Host Services"</em> ahi tendremos un formulario donde elegiremos el nombre de nuestro host en mi caso <em>punksolid.ath.cx </em>clickeamos en <em>"Use auto detected IP address 189.186.17.219" </em> y luego <em>"Add To Cart" </em>-&gt; <em>"Next" -&gt; "Activate Services"</em></p>
<p>Desde ahí ya tenemos configurado nuestro dominio en Dyndns, todavia no podemos acceder a la direccion que hayamos elegido.</p>
<h3>Configuración del router</h3>
<p>Primero que nada, con megared no lo podrán hacer visible desde Internet, solo desde otros usuarios de megared, ya que no es posible configurar una computadora con el modo desmilitarizado o DMZ.</p>
<p>La otra opción es con infinitum, entrando a la configuración desde el navegador, para eso, en nuestro firefox u opera escribimos http://home/, y luego en "Ver la red domestica" -&gt; " Modificar la configuración del cortafuegos", esa ultima opción la elegimos sobre la computadora que desees hacer visible, por ultimo escribimos la contraseña en caso de que nos la pida y seleccionamos la opción de "Permitir todas las aplicaciones (modo DMZplus(Zona desmilitarizada))" y Aceptar.</p>
<h3>Configuración de la aplicación cliente</h3>
<p>Se supone que tenemos una ip dinámica y por eso ocupamos una aplicación que le esté diciendo al servidor dns que nuestra ip ha cambiado.</p>
<p>En los repositorios de Ubuntu hay varias aplicaciones ya listas para instalar, este ejemplo será con una aplicación de consola que se llama inadyn para eso escribimos en consola:</p>
<p style="padding-left: 30px;">sudo apt-get install inadyn</p>
<p>Después de instalado ya solo ocupamos un ultimo paso, configurar la aplicación para que se conecte a nuestra cuenta de dyndns, para eso tecleamos en la consola el siguiente formato:</p>
<p>inadyn --username <em>usuario</em> -p <em>contraseña</em> -a punksolid.ath.cx</p>
<p>Y listo. Ya debería de funcionar, y si no funciona solo hay que reconectarse a la red.</p>
<p>Alguna duda o sugerencia, siéntete libre de comentar</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/hacer-visible-desde-internet-mi-localhost-en-linux-ubuntu/2009/&via=Punksolid&text=Hacer Visible Desde Internet Mi Localhost En Linux Ubuntu&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/hacer-visible-desde-internet-mi-localhost-en-linux-ubuntu/2009/&via=Punksolid&text=Hacer Visible Desde Internet Mi Localhost En Linux Ubuntu&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/hacer-visible-desde-internet-mi-localhost-en-linux-ubuntu/2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Como Actualizar un Div con Ajax y CakePHP 1.2</title>
		<link>http://www.punksolid.com/como-actualizar-un-div-con-ajax-y-cakephp-1-2/2009/</link>
		<comments>http://www.punksolid.com/como-actualizar-un-div-con-ajax-y-cakephp-1-2/2009/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 02:01:58 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[Html]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Scriptaculous]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=439</guid>
		<description><![CDATA[Empezaré suponiendo que tienes nociones básicas sobre CakePHP1.2 y sabes hacer de perdida un CRUD. Agregar las librerías javascript Cakephp tiene una buena integración con las librerías javascript de prototype y scriptaculous, las cuales debemos descargarlas primero desde la pagina de descarga de scriptaculous y la de descargas de prototype, la de prototype es un [...]]]></description>
			<content:encoded><![CDATA[<p>Empezaré suponiendo que tienes nociones básicas sobre CakePHP1.2 y sabes hacer de perdida un CRUD.</p>
<h3>Agregar las librerías javascript</h3>
<p>Cakephp tiene una buena integración con las librerías javascript de <a href="http://www.prototypejs.org/">prototype</a> y <a href="http://script.aculo.us/">scriptaculous</a>, las cuales debemos descargarlas primero desde la pagina de <a href="http://script.aculo.us/downloads">descarga de scriptaculous</a> y la de <a href="http://www.prototypejs.org/download">descargas de prototype</a>, la de prototype es un archivo js. Renombrar a prototype.js y ponlo en "app/webroot/js".</p>
<p>La librería de scriptaculous es un archivo .zip que contiene una carpeta src que a su vez contiene muchos archivos js los cuales debemos copiar y ponerlos también en la app/webroot/js.</p>
<h3>Añadir los helpers javascript y ajax al controlador</h3>
<p>Ahora necesitamos agregar los helpers de javascript y de ajax. Una opcion es agregarlos a cada controlador a como la vayamos necesitando o agregarlos al app_controller para que estén disponibles en todos los controladores.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">class AppController extends Controller {
var $helpers = array('Html','Form','Javascript','Ajax');
&nbsp;
}
&lt;h3&gt;Vistas&lt;/h3&gt;
Cada vista que sue javascript debemos añadirle las siguientes etiquetas
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$javascript</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'prototype'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$javascript</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'scriptaculous'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h2&gt;Ajax 3 - testing ajax link and button&lt;/h2&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #000088;">$link_array1</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'controller'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'tweets'</span> <span style="color: #339933;">,</span><span style="color: #0000ff;">'action'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'simple_ajax1_fcn'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">//the function to execute: function ajaxfcn1 in controller tests</span>
        <span style="color: #000088;">$link_array2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'update'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'divout'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ajax</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'this an ajax link'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$link_array1</span><span style="color: #339933;">,</span><span style="color: #000088;">$link_array2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br/&gt;&lt;br/&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;br/&gt;
&lt;div id=&quot;divout&quot;&gt;
the div to update
&lt;/div&gt;</pre></div></div>

<h3>Controlador</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> TweetsController <span style="color: #000000; font-weight: bold;">extends</span> AppController <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Tweets'</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$uses</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>            <span style="color: #666666; font-style: italic;">// prevent cake from looking for a database model</span>
		<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$helpers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Html'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Ajax'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Javascript'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000000; font-weight: bold;">function</span> index<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">function</span> simple_ajax1_fcn<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">autoRender</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;text from ajax call&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/como-actualizar-un-div-con-ajax-y-cakephp-1-2/2009/&via=Punksolid&text=Como Actualizar un Div con Ajax y CakePHP 1.2 &related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/como-actualizar-un-div-con-ajax-y-cakephp-1-2/2009/&via=Punksolid&text=Como Actualizar un Div con Ajax y CakePHP 1.2 &related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/como-actualizar-un-div-con-ajax-y-cakephp-1-2/2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Opera 10 &#8211; Reseña</title>
		<link>http://www.punksolid.com/opera-10-resena/2009/</link>
		<comments>http://www.punksolid.com/opera-10-resena/2009/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 06:13:05 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Reseña]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=433</guid>
		<description><![CDATA[Tengo mas de una semana usando Opera 10, y hasta el momento me ha dejado un buen sabor de boca, las características nuevas que tiene son bastante interesantes, entre las que mas me han gustado son: Opera turbo Sin duda sirve muchísimo para los que se conectan desde redes lentas, acelerando la velocidad bastante, aunque [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2009/09/opera.logo.png"><img class="alignright size-medium wp-image-434" title="opera.logo" src="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2009/09/opera.logo-300x251.png" alt="opera.logo" width="300" height="251" /></a>Tengo mas de una semana usando Opera 10, y hasta el momento me ha dejado un buen sabor de boca, las características nuevas que tiene son bastante interesantes, entre las que mas me han gustado son:</p>
<p><strong>Opera turbo</strong></p>
<p><strong></strong>Sin duda sirve muchísimo para los que se conectan desde redes lentas, acelerando la velocidad bastante, aunque esa característica no es para los que les gusta la calidad en las imágenes, ya que solo hace un escaneo y muestra con muy baja calidad las imágenes, solo para que te des una idea de lo que muestran. Por eso no es una característica que deba usarse siempre.</p>
<p><strong> Reload Page</strong></p>
<p>La mayoría de las paginas en Internet no te muestran un streaming de noticias, pocas usan las bondades del ajax, entonces las paginas dinámicas como <a href="http://twitter.com/punksolid">twitter.com</a> tienes que estarlas recargando manualmente con f5 o cualquier botón. Pues con Opera 10 dando clic derecho sobre la pagina en cuestión tenemos una opción que dice Reload Every -&gt; y podemos elegir entre bastante intervalos de tiempo predeterminados o hacer el propio. Algo que a los que usan la interfaz web de twitter les puede servir mucho.  Y para los que usen firefox alguna vez vi que había un plug in por ahi.</p>
<p><strong>Plugins</strong></p>
<p>Los añadidos en Opera 10 son como los de firefox, solo que aquí parecen ser mas potentes, incluso probé unos para facebook y twitter, que puedes sacarlos del navegador y manejarlos como ventanas independientes, algo así como lo que presume java plus de hacer. Lamentablemente no son tantos como los de firefox, ni tan  variados.</p>
<p><strong> Memoria</strong></p>
<p>Tiene un uso moderado de memoria ram, algo en el que le gana a su competencia firefox, opera al iniciar me gasta unos 150 megas de ram, cuando firefox cerca de los 300. Eso no significa que opera 10 sea ligero, es solo que administra mejor la ram.</p>
<p><strong>Sincronizan de Marcadores</strong></p>
<p>Puedes sincronizar tus marcadores entre todos tus navegadores opera, ya sea para distintas computadoras o tu celular, para eso ocupas una cuenta de opera, que se crea de volada. Esta caracteristica solo seria util para personas que usan muchas computadoras.</p>
<p><strong>Entre otras cosas</strong></p>
<p><strong> </strong>Se ejecuta rápido, tiene un botón donde están las pestañas donde puedes ver el listado de las paginas cerradas recientemente de manera practica. El speed dial es una pagina de inicio muy practica. Etc.</p>
<p><strong> En fin esta es una opción mas que deben probar y si les gusta usarlo diario. El caso es no usar Internet Explorer que no ofrece ninguna ventaja extra.</strong></p>
<p><strong>Referencias</strong></p>
<p><a href="http://www.opera.com/">Opera 10</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/opera-10-resena/2009/&via=Punksolid&text=Opera 10 - Reseña&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/opera-10-resena/2009/&via=Punksolid&text=Opera 10 - Reseña&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/opera-10-resena/2009/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Conectar la placa Arduino con PHP a travez de PHP Serial</title>
		<link>http://www.punksolid.com/conectar-la-placa-arduino-con-php-a-travez-de-php-serial/2008/</link>
		<comments>http://www.punksolid.com/conectar-la-placa-arduino-con-php-a-travez-de-php-serial/2008/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 05:59:12 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=114</guid>
		<description><![CDATA[Este tutorial sirve para conectar Arduino con PHP de manera mas directa sobre windows con XAMPP y la extensión PHP Serial, que prácticamente debería servir para cualquier dispositivo que se quiera conectar al puerto Serial de la computadora, aunque mi prueba es por USB. Guía Rápida Descarga e instala XAMPP. Descarga la extensión y los [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="XAMPP" src="http://www.noticiastech.com/wordpress/wp-content/uploads/2007/07/xammp.jpg" alt="" width="252" height="173" />Este tutorial sirve para conectar Arduino con PHP de manera mas directa sobre windows con XAMPP y la extensión <a href="http://www.easyvitools.com/phpserial/index.html">PHP Serial</a>, que prácticamente debería servir para cualquier dispositivo que se quiera conectar al puerto Serial de la computadora, aunque mi prueba es por USB.</p>
<p><strong>Guía Rápida<br />
</strong></p>
<ol>
<li><a href="http://sourceforge.net/projects/xampp/">Descarga e instala XAMPP</a>.</li>
<li>Descarga la extensión y los archivos de ejemplo de <a href="http://www.easyvitools.com/download/download.html">PHP Serial</a>.</li>
<li>Coloca el *.dll en las librerías de PHP y activalas en el php.ini.</li>
<li>Pon el Xampp en modo CGI.</li>
<li>Conecta y sube código de prueba al Arduino.</li>
<li>Inicia el Apache.</li>
<li>Usa archivo de prueba "sms_list.php" que viene en el paquete de PHP Serial .</li>
<li>Ejecútalo y Suerte.</li>
</ol>
<p><strong>Guía Detallada</strong></p>
<p>Una vez instalado XAMPP en windows descarga la extension y los archivos de <a href="http://www.easyvitools.com/download/download.html">PHP Serial</a> una vez descompreso copia el archivo <strong>php_ser.dll </strong>en la carpeta de extensiones de PHP que usualmente suele ser para PHP5</p>
<p><strong>C:/PHP/ext/</strong></p>
<p>ahora debes buscar el <strong>php.ini </strong>dentro de la carpeta<strong> C:\xampp\php</strong> en el caso de XAMPP y abrirlo con un bloc de notas, aunque recomiendo <a href="http://notepad-plus.sourceforge.net/es/site.htm">NOTEPAD+</a> que es el que uso, y agregar la extencion que copiamos anteriormente, para hacer eso solo debemos agregar la siguiente linea donde están las demas dll, ejemplo:</p>
<p><strong>extension=php_ser.dll</strong></p>
<p>guarda y cierra el php.ini.</p>
<p>si no estas usando XAMPP talvez asi ya puedas utilizarlo, solo reinicia el apache, pero si eres usuario de XAMPP debes configurarlo para que corra como CGI, ya que por default corre como modulo de apache, para cambiar esto debemos:</p>
<ol>
<li>Ir a<strong> C:\xampp\apache\conf\extra/httpd-xampp.conf </strong>y buscar donde estén las siguientes lineas y descomentar las lineas 1 y 2 y comentar la 3.<br />
<em> </em></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;em&gt;<span style="color: #adadad; font-style: italic;">#ScriptAlias /php/ &quot;C:/xampp/php/&quot;</span>
<span style="color: #adadad; font-style: italic;">#Action application/x-httpd-php &quot;/php/php-cgi.exe&quot;</span>
<span style="color: #00007f;">LoadModule</span> php5_module <span style="color: #7f007f;">&quot;C:/xampp/apache/bin/php5apache2.dll&quot;</span>
<span style="color: #00007f;">AddType</span> application/x-httpd-php-source .phps&lt;/em&gt;</pre></div></div>

<p><em> </em></li>
<li>Ir a <em> </em><strong>C:\xampp\apache\conf/httpd.conf </strong>y buscar<strong> </strong><em>&lt;Directory /&gt; </em>y dejarlo como sigue:<em><br />
</em><em> </em></p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;em&gt;Options <span style="color: #0000ff;">FollowSymLinks</span>
<span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">None</span>
<span style="color: #adadad; font-style: italic;">#Order deny,allow</span>
<span style="color: #adadad; font-style: italic;">#Deny from all</span>
&lt;/em&gt;</pre></div></div>

<p><em> </em><br />
<em> </em></li>
</ol>
<p>Ahora si pueden reiniciar el Apache, algo que pude notar es que el tiempo de respuesta es algo lento, si alguien puede mejorarlo que me lo notifique, no sé si es la mejor manera de comunicarlo con PHP en windows, pero eso ya es cuestion de cada quien.</p>
<p><span id="more-114"></span></p>
<p><strong>Codigo Arduino</strong></p>
<p>He tomado el codigo prestado del proyecto de <a href="http://www.j4mie.org/2008/02/15/how-to-make-a-physical-gmail-notifier/">GMAIL_NOTIFIER_LAMP</a> que si la placa recibe el valor "M" enciende el led si recibe "N" lo apaga:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> outPin <span style="color: #339933;">=</span> <span style="color: #0000dd;">13</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Especificamos el pin de salida</span>
<span style="color: #993333;">int</span> mail <span style="color: #339933;">=</span> LOW<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Is there new mail?</span>
<span style="color: #993333;">int</span> val<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Value read from the serial port</span>
&nbsp;
<span style="color: #993333;">void</span> setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
 pinMode<span style="color: #009900;">&#40;</span>outPin<span style="color: #339933;">,</span> OUTPUT<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// sets the digital pin as output</span>
 Serial.<span style="color: #202020;">begin</span><span style="color: #009900;">&#40;</span><span style="color: #0000dd;">19200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 Serial.<span style="color: #202020;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> loop<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// Read from serial port</span>
 <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>Serial.<span style="color: #202020;">available</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
  val <span style="color: #339933;">=</span> Serial.<span style="color: #202020;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  Serial.<span style="color: #202020;">println</span><span style="color: #009900;">&#40;</span>val<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>val <span style="color: #339933;">==</span> <span style="color: #ff0000;">'M'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  mail <span style="color: #339933;">=</span> HIGH<span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>val <span style="color: #339933;">==</span> <span style="color: #ff0000;">'N'</span><span style="color: #009900;">&#41;</span> mail <span style="color: #339933;">=</span> LOW<span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Set the status of the output pin</span>
 digitalWrite<span style="color: #009900;">&#40;</span>outPin<span style="color: #339933;">,</span> mail<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>El Codigo PHP para encendido pueden usar el de ejemplo de PHPSerial, el que lleva por nombre sms_list.php solo recuerden modificar por su puerto COM en mi caso es el COM4 y los baud a 19200 en caso de ser USB.</p>
<p>Suerte!! Cualquier problema lo publican en los comentarios</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=2024186&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=2024186&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/2024186?pg=embed&amp;sec=2024186">Arduino</a> from <a href="http://vimeo.com/user339787?pg=embed&amp;sec=2024186">Punksolid</a> on <a href="http://vimeo.com?pg=embed&amp;sec=2024186">Vimeo</a>.</p>
<h3>Actualización!! (22/Nov/09)</h3>
<p><em>Este articulo fue escrito hace tiempo,  creo que ya cambió la version de <strong>XAMPP </strong>con la que fue probado, e incluso ya salió una nueva version de PHP_Serial en la que ya no se ocupa el modo CGI, segun lo leido en los comentarios, este articulo parece ya no funcionar.</em></p>
<h3>Referencia</h3>
<p><a href="http://www.easyvitools.com/phpserial/php_ser_reference.html">Instrucciones de Instalación y API de PHP Serials (En Ingles)</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/conectar-la-placa-arduino-con-php-a-travez-de-php-serial/2008/&via=Punksolid&text=Conectar la placa Arduino con PHP a travez de PHP Serial &related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/conectar-la-placa-arduino-con-php-a-travez-de-php-serial/2008/&via=Punksolid&text=Conectar la placa Arduino con PHP a travez de PHP Serial &related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/conectar-la-placa-arduino-con-php-a-travez-de-php-serial/2008/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Arduino y PHP en Windows</title>
		<link>http://www.punksolid.com/arduino-y-php-en-windows/2008/</link>
		<comments>http://www.punksolid.com/arduino-y-php-en-windows/2008/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 06:57:48 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[programación]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=110</guid>
		<description><![CDATA[Se me hace raro que en la web oficial de Arduino no venga como conectar la placa Arduino + PHP de manera directa, hay unos métodos a través de proxys o cosas similares, el caso es que lo he logrado implementando la extensión PHPSerials que descargué desde http://www.easyvitools.com/phpserial/index.html, son pocas pero suficientes funciones que permiten [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 208px"><img title="Arduino" src="http://arduino.cc/en/uploads/Main/arduino316.jpg" alt="Foto por Nicholas Zambetti" width="198" height="137" /><img title="Xampp" src="http://janckos.files.wordpress.com/2008/04/xampp_logo.jpg" alt="" width="205" height="181" /><p class="wp-caption-text">Foto por Nicholas Zambetti</p></div>
<p>Se me hace raro que en la <a href="http://www.arduino.cc/playground/Main/InterfacingWithSoftware">web oficial de Arduino</a> no venga como conectar la placa Arduino + PHP de manera directa, hay unos métodos a través de proxys o cosas similares, el caso es que lo he logrado implementando la extensión PHPSerials que descargué desde <a href="http://www.easyvitools.com/phpserial/index.html">http://www.easyvitools.com/phpserial/index.html</a>, son pocas pero suficientes funciones que permiten leer y escribir sobre el puerto serial, bajo windows XP y sobre XAMPP con Arduino USB,los únicos problemas que noté fue la velocidad, y que al parecer la versión de la extensión es solo para estudiantes o algo similar.</p>
<p>Si no puedes lograr la conexion, comentalo y te respondo detalladamente.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/arduino-y-php-en-windows/2008/&via=Punksolid&text=Arduino y PHP en Windows&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/arduino-y-php-en-windows/2008/&via=Punksolid&text=Arduino y PHP en Windows&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/arduino-y-php-en-windows/2008/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Sistemas Operativos en Red</title>
		<link>http://www.punksolid.com/sistemas-operativos-en-red/2008/</link>
		<comments>http://www.punksolid.com/sistemas-operativos-en-red/2008/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 21:29:50 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Exposiciones]]></category>
		<category><![CDATA[acceso remoto]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[red]]></category>
		<category><![CDATA[redes]]></category>
		<category><![CDATA[sistemas operativos]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=10</guid>
		<description><![CDATA[Aqui estan unas diapositivas de mi creación,  acerca de los Network Operating Systems, que son sistemas que funcionan a travéz de la RED. Está basado en el curso de IT Essentials ll de Cisco, en el capitulo 5, y no está ampliamente explicado puesto que las diapositivas son para presentaciones en las cuales la gente está [...]]]></description>
			<content:encoded><![CDATA[<p>Aqui estan unas diapositivas de mi creación,  acerca de los Network Operating Systems, que son sistemas que funcionan a travéz de la RED.</p>
<p>Está basado en el curso de IT Essentials ll de Cisco, en el capitulo 5, y no está ampliamente explicado puesto que las diapositivas son para presentaciones en las cuales la gente está preparada previamente, pero debido a que estas diapositivas estan en creative commons puedes modificarla a tu gusto siempre y cuando pongas un enlace a este sitio.</p>
<p>Indice de las diapositivas:</p>
<ol>
<li>Introducción a los Sistemas Operativos en Red</li>
<li>¿Que es acceso remoto?</li>
<li>Algunos usos del Acceso Remoto</li>
<li>Ejemplo de VNC</li>
<li>Telecommuting</li>
<li>Usuarios Moviles</li>
<li>Emulación de Terminal</li>
<li>Servicios Telnet</li>
<li>Linux</li>
<li>Servicios de Directorios</li>
<li>¿Que es un Servicio de Directorios?</li>
<li>Estandares de Servicios de Directorios</li>
<li>Serivicio de Información de Red (NIS - Network Information Service)</li>
<li>Otros Network Operating Sistems</li>
<li>Correo</li>
<li>Impresión</li>
<li>Compartición de Archivos</li>
<li>Servicios Web</li>
<li>Intranet y Extranet</li>
<li>Servicio de Nombre de Dominio (DNS)</li>
<li>Protocolo de Configuración Dinamica de Host (DHCP)</li>
</ol>
<p><iframe src='http://docs.google.com/EmbedSlideshow?docid=dhb5cxts_883d6z5vqgp&amp;size=l' frameborder='0' width='829' height='650'></iframe></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/sistemas-operativos-en-red/2008/&via=Punksolid&text=Sistemas Operativos en Red&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/sistemas-operativos-en-red/2008/&via=Punksolid&text=Sistemas Operativos en Red&related=José Palazuelos:&lang=en&count=horizontal" class="twitter-share-button">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>]]></content:encoded>
			<wfw:commentRss>http://www.punksolid.com/sistemas-operativos-en-red/2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

