<?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; programación</title>
	<atom:link href="http://www.punksolid.com/tag/programacion/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>Autocompletar con scriptaculous</title>
		<link>http://www.punksolid.com/autocompletar-con-scriptaculous/2011/</link>
		<comments>http://www.punksolid.com/autocompletar-con-scriptaculous/2011/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 14:08:23 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Prototype]]></category>
		<category><![CDATA[Scriptaculous]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=671</guid>
		<description><![CDATA[Lo que vamos a hacer es un cuadro search box como el google suggest, que a diferencia de este, no haremos una petición ajax al servidor ya que tendremos los valores precargados en una variable javascript, útil cuando los registros son pocos y estáticos. Reconozco que a estas alturas medio mundo usa jquery, pero como [...]]]></description>
			<content:encoded><![CDATA[<p>Lo que vamos a hacer es un cuadro search box como el google suggest, que a diferencia de este, no haremos una petición ajax al servidor ya que tendremos los valores precargados en una variable javascript, útil cuando los registros son pocos y estáticos.<br />
Reconozco que a estas alturas medio mundo usa jquery, pero como persona de escaso conocimiento en el área, para el propósito me sirvió prototype y scriptaculous.</p>
<p>Lo primero que tenemos que hacer es <a href="http://script.aculo.us/downloads" target="_blank">descargar scriptaculous</a>, y extraemos todos los js dentro de una carpeta javascripts.</p>
<p>El siguiente paso es crear el archivo css.css para darle un diseño bonito al recuadro de opciones que aparecerán conforme vayamos escribiendo, el código de css.css es</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.autocomplete</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">250px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#888</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.autocomplete</span> ul <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.autocomplete</span> ul li<span style="color: #6666ff;">.selected</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ffb</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
div<span style="color: #6666ff;">.autocomplete</span> ul li <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">list-style-type</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>El tercer paso es crear el archivo autocompletar.html donde incluiremos los javascripts de prototype y scriptaculous, automáticamente se incluirán todas las dependencias.</p>
<p>&nbsp;</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot; src=&quot;javascripts/prototype.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;javascripts/scriptaculous.js?load=effects,controls&quot;&gt;
&lt;/script&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #003366; font-weight: bold;">var</span> bandsList <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
  <span style="color: #3366CC;">'ABBA'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'AC/DC'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Aerosmith'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'America'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Bay City Rollers'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Black Sabbath'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Boston'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'David Bowie'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Can'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'The Carpenters'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Crass'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Deep Purple'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'The Doobie Brothers'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Eagles'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Fleetwood Mac'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Haciendo Punto en Otro Son'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Heart'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Iggy Pop and the Stooges'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Journey'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Judas Priest'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'KC and the Sunshine Band'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Kiss'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Kraftwerk'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Led Zeppelin'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Lindisfarne (band)'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Lipps, Inc'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Lynyrd Skynyrd'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Pink Floyd'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Queen'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Ramones'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'REO Speedwagon'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Rhythm Heritage'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Rush'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Sex Pistols'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Slade'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Steely Dan'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Stillwater'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Styx'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Supertramp'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Sweet'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Three Dog Night'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'The Village People'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Wings (fronted by former Beatle Paul McCartney)'</span><span style="color: #339933;">,</span>
  <span style="color: #3366CC;">'Yes'</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
   window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003366; font-weight: bold;">new</span> Autocompleter.<span style="color: #660066;">Local</span><span style="color: #009900;">&#40;</span>
        <span style="color: #3366CC;">'bands_from_the_70s'</span><span style="color: #339933;">,</span>
        <span style="color: #3366CC;">'band_list'</span><span style="color: #339933;">,</span>
        bandsList<span style="color: #339933;">,</span>
        <span style="color: #009900;">&#123;</span>ignoreCase<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span>
&lt;body&gt;
&lt;p&gt;
  &lt;label for=&quot;bands_from&quot;&gt;Your favorite rock  band from the 70's:&lt;/label&gt;
  &lt;br /&gt;
  &lt;input id=&quot;bands_from_the_70s&quot; autocomplete=&quot;off&quot; size=&quot;40&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;
&lt;/p&gt;
&nbsp;
&lt;div class=&quot;autocomplete&quot; id=&quot;band_list&quot; style=&quot;display:none&quot;&gt;&lt;/div&gt;</pre></div></div>

<p>&nbsp;</p>
<p>Y listo ya con eso debemos tener un textbox con sugerencias.</p>
<p><strong>Enlaces</strong></p>
<p><a href="http://madrobby.github.com/scriptaculous/autocompleter-local/" target="_blank">Autocompleter.Local</a> para ver los parámetros aceptados.</p>
<p><a href="http://jonisalonen.com/2011/crazy-fast-ajax-search-suggest-in-cakephp-using-browser-cache/" target="_blank">Ajax search suggest with cakephp</a></p>
<p><a href="http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=scriptaculous_51" target="_blank">Ejemplo simple autocomplete.local</a></p>
<h2></h2>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/autocompletar-con-scriptaculous/2011/&via=Punksolid&text=Autocompletar con scriptaculous&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/autocompletar-con-scriptaculous/2011/&via=Punksolid&text=Autocompletar con scriptaculous&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/autocompletar-con-scriptaculous/2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>cakephp-instaweb</title>
		<link>http://www.punksolid.com/cakephp-instaweb/2011/</link>
		<comments>http://www.punksolid.com/cakephp-instaweb/2011/#comments</comments>
		<pubDate>Thu, 12 May 2011 08:12:43 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Ubuntu 10.10]]></category>
		<category><![CDATA[Ubuntu 11.04]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=636</guid>
		<description><![CDATA[cakephp-instaweb server es un webserver pequeño con todas las configuraciones necesarias para desarrollar en cakephp, no necesitas instalar todo el entorno php. Funciona igual al django-runserver, solo en la terminal te colocas en la carpeta de la aplicación, corres el comando y listo, tendrás tu app funcionando en http://localhost.com:3000 Si usas Ubuntu 10.10 y cakephp [...]]]></description>
			<content:encoded><![CDATA[<p><strong><img class="alignright" title="Cakephp" src="http://cakephp.org/img/new.png" alt="cakephp" width="134" height="132" />cakephp-instaweb</strong> server es un webserver pequeño con todas las configuraciones necesarias para desarrollar en cakephp, no necesitas instalar todo el entorno php. Funciona igual al django-runserver, solo en la terminal te colocas en la carpeta de la aplicación, corres el comando y listo, tendrás tu app funcionando en http://localhost.com:3000</p>
<p>Si usas Ubuntu 10.10 y cakephp 1.3.8 te marcará un error</p>
<blockquote>
<h3>CGI Script Error</h3>
<h3>Premature end of script headers.</h3>
</blockquote>
<p>Si instalaste cakephp-instaweb desde los repositorios de maverick se habrá instalado la versión 0.4.X, el error anterior se soluciona con la versión mas nueva 0.5-1 para instalarlo primero debes desinstalar completamente el cakephp-instaweb y luego <a href="https://launchpad.net/ubuntu/natty/amd64/cakephp-instaweb/0.5-1">descargar el .deb desde launchpad para Ubuntu Natty</a>, no causa conflicto alguno.</p>
<p>Con eso se habrá solucionado el problema.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/cakephp-instaweb/2011/&via=Punksolid&text=cakephp-instaweb&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/cakephp-instaweb/2011/&via=Punksolid&text=cakephp-instaweb&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/cakephp-instaweb/2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Como imprimir en impresora (Miniprinter) desde Python en Linux</title>
		<link>http://www.punksolid.com/como-imprimir-en-impresora-miniprinter-desde-python-en-linux/2011/</link>
		<comments>http://www.punksolid.com/como-imprimir-en-impresora-miniprinter-desde-python-en-linux/2011/#comments</comments>
		<pubDate>Sat, 09 Apr 2011 22:08:43 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Autotransportes]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=626</guid>
		<description><![CDATA[Como en muchas otras cosas, apenas soy un novato y hay muchas formas de hacer lo que expongo en el titulo, está podría no ser la mejor, pero es una de ellas y por supuesto gracias a @Jorgekbw3 que encontró la solución: Después de haber instalado la impresora en cuestión y haberla colocado como predeterminada [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 310px"><img title="Via MrTopf" src="http://farm3.static.flickr.com/2202/2050489689_f986cb33f3.jpg" alt="" width="300" height="272" /><p class="wp-caption-text">Via MrTopf</p></div>
<p>Como en muchas otras cosas, apenas soy un novato y hay muchas formas de hacer lo que expongo en el titulo, está podría no ser la mejor, pero es una de ellas y por supuesto gracias a <a href="http://twitter.com/jorgekbw3" target="_blank">@Jorgekbw3</a> que encontró la solución:</p>
<p>Después de haber instalado la impresora en cuestión y haberla colocado como predeterminada con el administrador de impresoras, ya debe ser accesible a impresión con el comando</p>
<blockquote><p>lp texto.txt</p></blockquote>
<p>Bajo ese principio accesaremos al sistema desde python con</p>
<blockquote><p>import os</p></blockquote>
<blockquote><p>printer=os.popen('lpr','w')</p></blockquote>
<blockquote><p>printer.write('texto')</p></blockquote>
<blockquote><p>printer.close()</p></blockquote>
<p>Y eso es todo.</p>
<p>Probado con Ubuntu 10.10, Python 2.6 y Miniprinter Epson TM-T88V</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/como-imprimir-en-impresora-miniprinter-desde-python-en-linux/2011/&via=Punksolid&text=Como imprimir en impresora (Miniprinter) desde Python en Linux&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-imprimir-en-impresora-miniprinter-desde-python-en-linux/2011/&via=Punksolid&text=Como imprimir en impresora (Miniprinter) desde Python en Linux&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-imprimir-en-impresora-miniprinter-desde-python-en-linux/2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Entorno de desarrollo para Symbian en Linux</title>
		<link>http://www.punksolid.com/entorno-de-desarrollo-para-symbian-en-linux/2010/</link>
		<comments>http://www.punksolid.com/entorno-de-desarrollo-para-symbian-en-linux/2010/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 05:23:32 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[Pys60]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Sincronizacion]]></category>
		<category><![CDATA[Symbian]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=546</guid>
		<description><![CDATA[Recientemente he tenido interés en desarrollar una aplicación para móviles symbian con Python for S60 tambien conocido como Pys60, cabe mencionar que soy novato en esto y no tengo idea de como la mayoria de los desarrolladores tienen configurado su entorno. En el articulo anterior expliqué como Conectar Nokia 5530 por bluetooth y RFComm para desarrollo en Python en [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Symbian Nokia Python" src="http://t1.gstatic.com/images?q=tbn:ANd9GcTYlfvFl8B-cu_Wh9rDItTrMcbvELmwXXOcXoEIEgFiYfDETjA&amp;t=1&amp;usg=__f-89iDuooYntA9AKX7w186G6tuU=" alt="Symbian Nokia Python" width="160" height="154" />Recientemente he tenido interés en desarrollar una aplicación para móviles symbian con Python for S60 tambien conocido como Pys60, cabe mencionar que soy novato en esto y no tengo idea de como la mayoria de los desarrolladores tienen configurado su entorno.</p>
<p>En el articulo anterior expliqué como <a href="http://www.punksolid.com/conectar-nokia-5530-por-bluetooth-y-rfcomm-para-desarrollo-en-python-en-ubuntu-10-04/2010/">Conectar Nokia 5530 por bluetooth y RFComm para desarrollo en Python en Ubuntu 10.04</a> pero al funcionar en la consola de linux no es practico estar viendo o estar ejecutando el codigo al vuelo, así que expongo lo que creo es una mejor manera.</p>
<p>También descarté usar el emulador de symbian para Windows (tristemente no hay emulador para linux, y no parece que vaya haber pronto) ya que parece lento y pienso que si vamos a batallar lo mismo correr el script en el emulador que en el mismo celular ¿que mejor que hacerlo en el celular?.</p>
<h3>Interprete Python para Symbian</h3>
<p>Para que una aplicacion hecha en python funcione en el celular de manera comercial necesita elaborarse un paquete .sis, de otra manera si intentas ejecutar un .py lo va a leer como archivo de texto, para eso se ocupa el interprete Python (Python_2.0.0.sis)  y el PythonScriptShell(PythonScriptShell_2.0.0_3_2.sis) eso se descarga desde <a href="https://garage.maemo.org/projects/pys60/">https://garage.maemo.org/projects/pys60/</a> (PythonForS60_2.0.0.tar.gz) ambos se encuentran en el directorio /PythonForS60/PyS60Dependencies/.  Pasan los archivos al celular y los ejecutan en el siguiente orden Python primero y despues el PythonScriptShell.</p>
<h3>Conexion PC - Celular</h3>
<p>Ubuntu linux viene preparado para conectar por bluetooth y tener acceso a los archivos para eso vamos a dar en el icono de bluetooth y 'Configurar un dispositivo nuevo', seguimos los pasos indicados en el que tendremos que proporcionar la clave provista por ubuntu desde el celular.</p>
<p>Despues de emparejar el celular ocupamos saber la direccion de la carpeta a la que tiene acceso el interprete python, que suele ser /data/python, para eso vamos a entrar desde el navegador de archivos dando clic en el icono de bluetooth de nuevo y luego, examinar los archivos en el dispositivo, buscamos el directorio de python y una vez ahí veremos varios archivos .py de demostracion, estamos en la carpeta correcta, ahora presionamos las teclas Ctrl + L para saber la direccion y nos debe aparecer algo similar a esto en la parte superior</p>
<blockquote><p>obex://[00:BD:3A:70:9B:EB]/E:/data/python</p></blockquote>
<div id="attachment_548" class="wp-caption aligncenter" style="width: 620px"><a href="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2010/09/Pantallazo-2.png"><img class="size-full wp-image-548 " title="Barra de direcciones" src="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2010/09/Pantallazo-2.png" alt="Nautilus" width="610" height="374" /></a><p class="wp-caption-text">En la barra de direcciones después de presionar Ctrl + L estará la dirección que necesitaremos mas adelante.</p></div>
<h3>Sincronizacion</h3>
<p>Suponiendo que la carpeta del proyecto y todo el entorno python ya lo tenemos instalado en la computadora, procederemos a hacer una sincronizacion, para eso utilizo el programa <a href="http://live.gnome.org/Conduit">Conduit</a> que es bastante practico, ligero, eficiente y lo podemos descargar desde los repositorios, nosotros solo utilizaremos sincronizacion de una direccion entre carpetas, primero arrastramos una 'Carpeta' desde 'Files and Folders' hacia la derecha le damos clic derecho al elemento y luego en 'Configure Item' , seleccionamos la carpeta donde tenemos nuestro proyecto, dejando desmarcadas las opciones avanzadas presionamos cerrar, luego añadimos otra carpeta del lado derecho de la carpeta que recien creamos y ponemos la direccion obtenida en el paso de Conexion PC - Celular dando clic donde está el icono del lapiz.</p>
<p>Despues de eso ya está configurado todo, pero para eficiencia daremos clic derecho sobre la linea negra que une las dos carpetas y nos vamos a 'Sincronization Options' y luego en 'Always Up to Date' con eso en cuanto guardemos el archivo empezará la sincronizacion, que apenas tarda algunos segundos.</p>
<div id="attachment_547" class="wp-caption aligncenter" style="width: 576px"><a href="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2010/09/Pantallazo-1.png"><img class="size-full wp-image-547 " title="Conduit" src="http://www.punksolid.com/blog/wordpress/wp-content/uploads/2010/09/Pantallazo-1.png" alt="Programa para sincronizacion Conduit" width="566" height="433" /></a><p class="wp-caption-text">Así debería quedar después de la configuración explicada.</p></div>
<p>Y eso es todo, si tienes alguna duda o crees que hace falta algo puedes dejarlo en los comentarios.</p>
<h4>Enlaces</h4>
<p><a href="http://mobilenin.com/pys60/how_to_write_a_pys60_script.php">How to write a python for Series 60 script and test it</a></p>
<p><a href="https://garage.maemo.org/projects/pys60/">Pys60 Actualizado</a></p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/entorno-de-desarrollo-para-symbian-en-linux/2010/&via=Punksolid&text=Entorno de desarrollo para Symbian en Linux&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/entorno-de-desarrollo-para-symbian-en-linux/2010/&via=Punksolid&text=Entorno de desarrollo para Symbian en Linux&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/entorno-de-desarrollo-para-symbian-en-linux/2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conectar Nokia 5530 por bluetooth y RFComm para desarrollo en Python en Ubuntu 10.04</title>
		<link>http://www.punksolid.com/conectar-nokia-5530-por-bluetooth-y-rfcomm-para-desarrollo-en-python-en-ubuntu-10-04/2010/</link>
		<comments>http://www.punksolid.com/conectar-nokia-5530-por-bluetooth-y-rfcomm-para-desarrollo-en-python-en-ubuntu-10-04/2010/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 11:36:46 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Nokia 5530]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ubuntu 10.04]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=541</guid>
		<description><![CDATA[Primero que nada la mejor documentacion está en ingles en el wiki de desarrollo de Nokia http://wiki.opensource.nokia.com/projects/PyS60_Bluetooth_console Este entorno ha funcionado en Ubuntu 10.04 con un Nokia 5530 y el python 2.0.0 de symbian. Instalar librerias Las librerias necesarias son 'hcitool' para encontrar el dispositivo 'sdptool' y 'sdpd' para registrar los puertos seriales que se [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Logo python" src="http://upn303.co.cc/files/images/python-logo.png" alt=" " width="199" height="196" />Primero que nada la mejor documentacion está en ingles en el wiki de desarrollo de Nokia <a href="http://wiki.opensource.nokia.com/projects/PyS60_Bluetooth_console">http://wiki.opensource.nokia.com/projects/PyS60_Bluetooth_console</a></p>
<p>Este entorno ha funcionado en <strong>Ubuntu 10.04</strong> con un <strong>Nokia 5530</strong> y el python 2.0.0 de symbian.</p>
<h3>Instalar librerias</h3>
<p>Las librerias necesarias son</p>
<div id="_mcePaste">
<ul>
<li>'<strong>hcitool</strong>' para encontrar el dispositivo</li>
<li>'<strong>sdptool</strong>' y '<strong>sdpd</strong>' para registrar los puertos seriales que se van a utilizar</li>
<li>'<strong>rfcomm</strong>' para emular el puerto serial sobre bluetooth</li>
<li>''<strong>screen</strong>" para empezar a mandar datos por terminal</li>
</ul>
</div>
<h3>Instrucciones</h3>
<p>Conectar el adaptador bluetooth y luego en la consola escribir:</p>
<blockquote><p>$ hciconfig reset</p></blockquote>
<p>Luego comprobar que el dispositivo se instaló o lo detectó bien</p>
<blockquote><p>$ hcitool dev</p></blockquote>
<p>Registrar el puerto serial (usar el canal 2. Por alguna razon, el canal 1 y 3 puede no funcionar la conexion)</p>
<blockquote><p>$ sdptool add --channel=2 SP</p></blockquote>
<p>Ahora poner el canal en escucha</p>
<blockquote><p>$ rfcomm listen rfcomm2 2</p></blockquote>
<p>Ahora asegurarte que el bluetooth en tu celular esté encendido, e ir a la aplicacion de Python y luego en las opciones seleccionar <strong>Bluetooth Console</strong>. Seleccionar los dispositivos disponibles ( en mi caso <strong>default host</strong>), si la operación es exitosa deberias ver lo siguiente en tu consola.</p>
<blockquote><p>Waiting for conection on channel 2</p>
<p>Connection from 00:00:00:00:00:00 to /dev/rfcomm2</p>
<p>Press CTRL-C for hangup</p></blockquote>
<p>Ahora abre otra terminal y escribe:</p>
<blockquote><p>$ screen /dev/rfcomm2</p></blockquote>
<p>Eso sería todo, la consola se debería poner limpia y ya deberias poder empezar a escribir tu codigo en python.</p>
<p>Happy Coding</p>
<h3 style="font-size: 1.17em;">Enlaces</h3>
<p><a href="http://wiki.opensource.nokia.com/projects/PyS60_Bluetooth_console">PyS60 Bluetooth console</a></p>
<h3><span style="font-weight: normal;"><a href="http://crschmidt.net/blog/archives/11/bluetooth-console/">Bluetooth Console</a></span></h3>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/conectar-nokia-5530-por-bluetooth-y-rfcomm-para-desarrollo-en-python-en-ubuntu-10-04/2010/&via=Punksolid&text=Conectar Nokia 5530 por bluetooth y RFComm para desarrollo en Python en Ubuntu 10.04&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-nokia-5530-por-bluetooth-y-rfcomm-para-desarrollo-en-python-en-ubuntu-10-04/2010/&via=Punksolid&text=Conectar Nokia 5530 por bluetooth y RFComm para desarrollo en Python en Ubuntu 10.04&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-nokia-5530-por-bluetooth-y-rfcomm-para-desarrollo-en-python-en-ubuntu-10-04/2010/feed/</wfw:commentRss>
		<slash:comments>1</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>Configurar Eclipse Para Colorear Sintaxis De Los Archivos .CTP de CakePHP</title>
		<link>http://www.punksolid.com/configurar-eclipse-para-colorear-sintaxis-de-los-archivos-ctp-de-cakephp/2009/</link>
		<comments>http://www.punksolid.com/configurar-eclipse-para-colorear-sintaxis-de-los-archivos-ctp-de-cakephp/2009/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 08:12:56 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=416</guid>
		<description><![CDATA[CakePHP 1.2 maneja las vistas con una extensión .CTP lo cual hace que no puedas ver coloreado los archivos, que son en esencia HTML y PHP combinado. Para solucionar esto debemos hacer lo siguiente en el Eclipse: Window -&#62; Preferences -&#62; General -&#62; Content Type -&#62; Text Y en el recuadro seleccionamos donde dice HTML, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="null"><img class="alignright" title="Eclipse Logo" src="http://widyaperwira.files.wordpress.com/2009/01/large_eclipse_logo.jpg" alt="" width="180" height="180" /></a>CakePHP 1.2 maneja las vistas con una extensión .CTP lo cual hace que no puedas ver coloreado los archivos, que son en esencia HTML y PHP combinado.</p>
<p>Para solucionar esto debemos hacer lo siguiente en el Eclipse:</p>
<p>Window -&gt; Preferences -&gt; General -&gt; Content Type -&gt; Text</p>
<p>Y en el recuadro seleccionamos donde dice HTML, al hacer esto, un poco mas abajo está el botón Add y después de presionarlo escribimos *.ctp y damos aceptar.</p>
<p>Ahora así como seleccionamos HTML seleccionaremos PHP Source File, y añadimos de la misma forma.</p>
<p>Damos aceptar dos veces, y automáticamente los nuevos archivos que abras aparecerán coloreados.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/configurar-eclipse-para-colorear-sintaxis-de-los-archivos-ctp-de-cakephp/2009/&via=Punksolid&text=Configurar Eclipse Para Colorear Sintaxis De Los Archivos .CTP de 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/configurar-eclipse-para-colorear-sintaxis-de-los-archivos-ctp-de-cakephp/2009/&via=Punksolid&text=Configurar Eclipse Para Colorear Sintaxis De Los Archivos .CTP de 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/configurar-eclipse-para-colorear-sintaxis-de-los-archivos-ctp-de-cakephp/2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enviar archivo a travez de bluetooth y python en linux ubuntu</title>
		<link>http://www.punksolid.com/enviar-archivo-a-travez-de-bluetooth-y-python-en-linux-ubuntu/2009/</link>
		<comments>http://www.punksolid.com/enviar-archivo-a-travez-de-bluetooth-y-python-en-linux-ubuntu/2009/#comments</comments>
		<pubDate>Sun, 03 May 2009 01:45:19 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[Aplicaciones]]></category>
		<category><![CDATA[Bluetooth]]></category>
		<category><![CDATA[programación]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=364</guid>
		<description><![CDATA[Primero que nada para empezar a trabajar ocupamos las herramientas, para eso necesitamos tener instalado la librería lightblue para python esto lo podemos lograr con sudo apt-get install lightblue también hay otras librerias que se necesitan pero seguramente ya las tienes instaladas. Ahora ya solo corre la consola de python, abre una terminal escribe python [...]]]></description>
			<content:encoded><![CDATA[<p>Primero que nada para empezar a trabajar ocupamos las herramientas, para eso necesitamos tener instalado la librería lightblue para python esto lo podemos lograr con</p>
<p>sudo apt-get install lightblue</p>
<p>también hay otras librerias que se necesitan pero seguramente ya las tienes instaladas.</p>
<p>Ahora ya solo corre la consola de python, abre una terminal escribe python y listo.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> lightblue
lightblue.<span style="color: black;">finddevices</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;"># devolverá la mac y nombre de los dispositivos detectados</span>
lightblue.<span style="color: black;">findservices</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#devolverá la mac, canal y protocolo de comunicacion disponibles de los dispositivos,  yo usé el canal 9 que dice OBEX Object Push</span>
cliente = lightblue.<span style="color: black;">obex</span>.<span style="color: black;">OBEXClient</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'00:1A:DC:8C:51:2D'</span>,<span style="color: #ff4500;">9</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#creamos la variable con la direccion mac y el canal del dispositivo</span>
cliente.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#nos conectamos al dispositivo nos aparecerá una respuesta como esta </span>
<span style="color: #808080; font-style: italic;">#&lt;OBEXResponse reason='OK' code=0x20 (0xa0) headers={}&gt;</span>
putresponse = cliente.<span style="color: black;">put</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">&quot;name&quot;</span>: <span style="color: #483d8b;">&quot;b.txt&quot;</span><span style="color: black;">&#125;</span>, <span style="color: #008000;">file</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;b.txt&quot;</span>, <span style="color: #483d8b;">'rb'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #808080; font-style: italic;">#especificamos que le enviamos al cliente</span>
cliente.<span style="color: black;">disconnect</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Y listo con eso abremos enviado un archivo de nota al teléfono en mi caso  ya estaba como amistoso, desconozco si se puede con dispositivos desconocidos o como será la respuesta.</p>
<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/enviar-archivo-a-travez-de-bluetooth-y-python-en-linux-ubuntu/2009/&via=Punksolid&text=Enviar archivo a travez de bluetooth y python 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/enviar-archivo-a-travez-de-bluetooth-y-python-en-linux-ubuntu/2009/&via=Punksolid&text=Enviar archivo a travez de bluetooth y python 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/enviar-archivo-a-travez-de-bluetooth-y-python-en-linux-ubuntu/2009/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Select o SelectTag en CakePhp 1.2</title>
		<link>http://www.punksolid.com/select-o-selecttag-en-cakephp-12/2009/</link>
		<comments>http://www.punksolid.com/select-o-selecttag-en-cakephp-12/2009/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 06:16:47 +0000</pubDate>
		<dc:creator>Punksolid</dc:creator>
				<category><![CDATA[programación]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.punksolid.com/?p=347</guid>
		<description><![CDATA[Me confundí un poco a la hora de ocupar un selectTag en cakephp 1.2,  y al buscar no lo encontré rapido, viendo la API me funcionó de la siguiente manera. select(Nombre,$options(array)) echo $form-&#62;select&#40;'tipocuenta',array&#40;0=&#62;'Cuenta Corriente',1=&#62;'Cuenta de Ahorros'&#41;&#41;; TweetTweet]]></description>
			<content:encoded><![CDATA[<p>Me confundí un poco a la hora de ocupar un selectTag en cakephp 1.2,  y al buscar no lo encontré rapido, viendo la API me funcionó de la siguiente manera.<br />
select(Nombre,$options(array))</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #000088;">$form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">select</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tipocuenta'</span><span style="color: #339933;">,</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Cuenta Corriente'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'Cuenta de Ahorros'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<div style="float: right; margin-left: 10px;"><a href="http://twitter.com/share?url=http://www.punksolid.com/select-o-selecttag-en-cakephp-12/2009/&via=Punksolid&text=Select o SelectTag en 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/select-o-selecttag-en-cakephp-12/2009/&via=Punksolid&text=Select o SelectTag en 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/select-o-selecttag-en-cakephp-12/2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

