<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-3068224110259204298</id><updated>2009-10-13T00:12:05.558-07:00</updated><title type='text'>Panamá Post</title><subtitle type='html'>La Web especializada para el Desarrollo Web de Panamá</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default?start-index=26&amp;max-results=25'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>58</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-9196726118960082762</id><published>2008-06-05T06:52:00.000-07:00</published><updated>2008-06-05T06:53:47.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nuevo'/><title type='text'>Nueva dirección del Blog de PanamaPost</title><content type='html'>Hola amigos que tal. Desde ayer tengo nuevo blog. Para los interesados la nueva dirección es &lt;a href="http://danilo04.accionasolutions.net"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;http://danilo04.accionasolutions.net&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-9196726118960082762?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/9196726118960082762/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=9196726118960082762&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/9196726118960082762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/9196726118960082762'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/06/nueva-direccin-del-blog-de-panamapost.html' title='Nueva dirección del Blog de PanamaPost'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-4996585568520527385</id><published>2008-06-02T08:23:00.000-07:00</published><updated>2008-06-02T20:45:18.253-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cakephp'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Problemas con find('list') y generateList deprecado en CakePHP 1.2</title><content type='html'>La verdad a la hora de crear un arreglo de opciones para una lista (select en HTML) tuve problemas ya que en la versión 1.2 de CakePHP la función &lt;span style="font-weight: bold;"&gt;generateList&lt;/span&gt; está deprecada.&lt;br /&gt;&lt;br /&gt;Bueno la primera opción que ví fue la de utilizar la función &lt;span style="font-weight: bold;"&gt;find('list')&lt;/span&gt;, pero los resultados no fueron los más deseados. Buscando en los grupos de cake tratando de encontrar alguna sintaxis específica para esta función me encontré con otra solución, que aquí les dejo:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;2.    $foo &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;Usuario&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;TipoUsuario&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;find&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'all'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;3.    $tipo_usuarios &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;Set&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;combine&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$foo&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'{n}.TipoUsuario.id'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'{n}.TipoUsuario.nombre'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;4.    &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;//Si ese objeto tiene una relacion por ejemplo de $belongsTo con el modelo&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;5.    &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;//actual, por ejmplo Usuario con TipoUsuario podemos setear directamente&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;6.    &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;//la lista con la siguiente funcion&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;7.    $this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;set&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;compact&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tipo_usuarios'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;));&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Actualización&lt;br /&gt;&lt;/span&gt;Con el aporte que hizo José Lorenzo Rodrígues en sus comentarios la otra opción con la función find('list') quedaria así:&lt;br /&gt;&lt;span dir="ltr"&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;code&gt;&lt;span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;Usuario&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;TipoUsuario&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;displayField =&lt;/span&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;'nombre'&lt;/span&gt;;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;    $tipo_usuarios &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this-&gt;Usuario-&gt;TipoUsuario-&gt;find(&lt;span style="color: rgb(204, 0, 0);"&gt;'list'&lt;/span&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;//Si ese objeto tiene una relacion por ejemplo de $belongsTo con el modelo&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;//actual, por ejmplo Usuario con TipoUsuario podemos setear directamente&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;//la lista con la siguiente funcion&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;    $this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;set&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;compact&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tipo_usuarios'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-4996585568520527385?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/4996585568520527385/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=4996585568520527385&amp;isPopup=true' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/4996585568520527385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/4996585568520527385'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/06/problemas-con-findlist-y-generatelist.html' title='Problemas con find(&apos;list&apos;) y generateList deprecado en CakePHP 1.2'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-8035912731619266728</id><published>2008-05-30T11:25:00.000-07:00</published><updated>2008-06-01T19:10:33.045-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cakephp'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Funciones deprecadas o con otras opciones CakePHP 1.2</title><content type='html'>Estuve viendo un poco y leyendo la documentación y me encuentro con algunas funciones deprecadas o que cambiaron de la version 1.2 de CakePHP con respecto a la 1.1.&lt;br /&gt;&lt;br /&gt;Les dejo la lista:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Todas las que manejaban forms con el helper html se pasaron al helper form. Pueden ver los cambios en este blog de &lt;a href="http://tortaphp.blogspot.com/2007/11/el-form-helper.html"&gt;La Torta en PHP&lt;/a&gt; en donde lo explican bien.&lt;/li&gt;&lt;li&gt;También la función que utilizabamos para generar listas para los campos &lt;span style="font-weight: bold;"&gt;select &lt;/span&gt;en html llamada &lt;span style="font-weight: bold;"&gt;generateList()&lt;/span&gt; está deprecada. Ahora se utiliza &lt;span style="font-weight: bold;"&gt;find('list')&lt;/span&gt;.&lt;br /&gt;&lt;pre class="php"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;$this&lt;/span&gt;-&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;Post&lt;/span&gt;-&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;Categoria&lt;/span&gt;-&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;find&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"list"&lt;/span&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;)&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(102, 204, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Otra es la función &lt;span style="font-weight: bold;"&gt;findCount &lt;/span&gt;que no estoy seguro si está deprecada pero ahora podemos utilizar &lt;span style="font-weight: bold;"&gt;find('count')&lt;br /&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this-&gt;Post&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;find&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'count'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'conditions' &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'Post.comments_count' &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'&lt;&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;));&lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;La función &lt;span style="font-weight: bold;"&gt;findAll &lt;/span&gt;ahora podemos utilizar &lt;span style="font-weight: bold;"&gt;find('all')&lt;/span&gt; para suplantar esta función.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this-&gt;Post&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;find&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'all'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'limit' &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;15&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;Bueno estas son una pequeña lista que encontré en diferentes blogs y también en algunos proyectos que estoy haciendo.&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-8035912731619266728?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/8035912731619266728/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=8035912731619266728&amp;isPopup=true' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/8035912731619266728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/8035912731619266728'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/funciones-deprecadas-cakephp-12.html' title='Funciones deprecadas o con otras opciones CakePHP 1.2'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-6592306260514653405</id><published>2008-05-29T07:16:00.000-07:00</published><updated>2008-05-29T07:24:44.139-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cakephp'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Nuevo Sitio CakePHP-es</title><content type='html'>El domingo 1 de junio se llevará a cabo una discusión en el irc de cakephp-es. Los temas a discutir serán orientados al nuevo sitio de cakephp-es.&lt;br /&gt;&lt;br /&gt;Esperamos que estén presentes la mayoría de los seguidores de este gran framework que nos ayuda cada día en nuestras labores.&lt;br /&gt;&lt;br /&gt;La Reunión se llevará a cabo desde las 20 horas (UTC/GMT -5, hora de Panamá).&lt;br /&gt;&lt;br /&gt;Para ingresar al irc tienes que ir al servidor freenode.net y el canal es #cakephp-es&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-6592306260514653405?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/6592306260514653405/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=6592306260514653405&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/6592306260514653405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/6592306260514653405'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/nuevo-sitio-cakephp-es.html' title='Nuevo Sitio CakePHP-es'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-3295998847583348459</id><published>2008-05-26T06:31:00.000-07:00</published><updated>2008-05-26T06:42:41.874-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Nueva versión Ajax Webmail DIMP y Horde 3.2</title><content type='html'>Después de 30 meses de desarrollo, la gente de Horde Projects ha lanzado la última versión de sus productos Horde 3.2, DIMP 1.0, Horde Groupware 1.1, y otras aplicaciones.&lt;br /&gt;&lt;br /&gt;Esta versión incluye varios cambios, dentro de lo que se encuentran:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Mejora en el perfomance a travéz  de todas las aplicaciones, espcialmente a nivel de base de datos y sobre IMAP.&lt;/li&gt;&lt;li&gt;Soporte para sincronización estable a travéz de &lt;a href="http://wiki.horde.org/SyncHowTo"&gt;SyncML&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Javascript no obstrusivo, mejorando la interfaz.&lt;/li&gt;&lt;li&gt;Soporte WebDAV.&lt;/li&gt;&lt;li&gt;Notes encyption.&lt;/li&gt;&lt;li&gt;Subtareas y estimación del tiempo en tareas&lt;/li&gt;&lt;/ul&gt;La verdad me complace mucho saber que este proyecto halla actualizado su webmail. Mi universidad en particular usa este webmail, y a pesar de que se comporta bien, la interfaz de usuario se quedaba corta a nivel de los últimos webmail que están en el mercado.&lt;br /&gt;También podrán encontrar algunos &lt;a href="http://www.horde.org/webmail/screenshots/"&gt;screenshots&lt;/a&gt; de la aplicación.&lt;br /&gt;&lt;br /&gt;Fuente en inglés: &lt;a href="http://janschneider.de/news/35/322"&gt;http://janschneider.de/news/35/322&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-3295998847583348459?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/3295998847583348459/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=3295998847583348459&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/3295998847583348459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/3295998847583348459'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/nueva-versin-ajax-webmail-dimp-y-horde.html' title='Nueva versión Ajax Webmail DIMP y Horde 3.2'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-5724074565941488586</id><published>2008-05-23T09:59:00.001-07:00</published><updated>2008-05-23T10:03:59.040-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cakephp'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Proyecto CakePHP Extensions</title><content type='html'>Estuve pensando en estos días en crear un proyecto en el cual se hiciera una recopilación de las extensiones que la comunidad ha creado para cakephp. Actualmente cree un proyecto (http://www.assembla.com/wiki/show/cake_extensions) en el cual se tiene un repositorio svn para guardar todas las extensiones.&lt;br /&gt;&lt;br /&gt;La persona que desee colaborar en esta iniciativo me puede escribir a mi email &lt;span style="font-weight: bold;"&gt;danilo.dope at gmail dot com&lt;/span&gt; o en el irc freenode canal #cakephp-es.&lt;br /&gt;&lt;br /&gt;Actualmente estaba trabajando en un helper para mootools y estaba empezando un componente para picasa.&lt;br /&gt;&lt;br /&gt;Bueno espero les guste la idea, y ya saben, el que quiera participar solo me avisa.&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-5724074565941488586?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/5724074565941488586/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=5724074565941488586&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5724074565941488586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5724074565941488586'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/proyecto-cakephp-extensions.html' title='Proyecto CakePHP Extensions'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-5975409031421424460</id><published>2008-05-19T11:49:00.000-07:00</published><updated>2008-05-19T11:54:15.671-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='pear'/><title type='text'>Código estándar en PHP</title><content type='html'>El siguiente post que encontré nos muestra algunas reglas para escribir código estándar en php según los estándares que propone PEAR. Pueden ver esta información &lt;a href="http://dotpress.wordpress.com/2007/03/29/pear-estandares-de-desarrollo-para-php/"&gt;http://dotpress.wordpress.com/2007/03/29/pear-estandares-de-desarrollo-para-php/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-5975409031421424460?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/5975409031421424460/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=5975409031421424460&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5975409031421424460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5975409031421424460'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/cdigo-estndar-en-php.html' title='Código estándar en PHP'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-6282954440856067416</id><published>2008-05-09T09:27:00.001-07:00</published><updated>2008-05-09T09:45:29.151-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Función en Drupal 5.x para setear mensaje</title><content type='html'>Para setear un mensaje general la api de drupal nos ofrece una función. Esta función es &lt;span style="font-weight: bold;"&gt;drupal_set_message&lt;/span&gt;. Puede ser utilizada dentro de nuestros módulos para efectuar un mensaje al sistema.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;Sintáxis&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;array&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt; drupal_set_message($message = null, $type = 'status', $repeat = true)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Parámetros&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;$message: mensaje que vamos a mandar para que la función lo coloque.&lt;/li&gt;&lt;li&gt;$type: es el tipo de mensaje. Tiene las siguientes opciones:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;'status'&lt;/li&gt;&lt;li&gt;'warning'&lt;/li&gt;&lt;li&gt;'error' --&gt; normalmente color rojo&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;$repeat: si es &lt;span style="font-weight: bold;"&gt;false&lt;/span&gt; el mensaje no se repetirá.&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Código&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1.    &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;?php&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;br /&gt;2.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;drupal_set_message&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$message &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;NULL&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$type &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'status'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$repeat &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;TRUE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;3.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$message&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;4.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (!isset(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;])) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;5.          $_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] = array();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;6.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;7.   &lt;br /&gt;8.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (!isset(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$type&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;])) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;9.          $_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$type&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] = array();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;10.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;11.   &lt;br /&gt;12.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$repeat &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;|| !&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;in_array&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$message&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$type&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;])) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;13.          $_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$type&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;][] = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$message&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;14.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;15.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;16.   &lt;br /&gt;17.      &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// messages not set when DB connection fails&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;18.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return isset(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;]) ? &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_SESSION&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'messages'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] : &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;NULL&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;19.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;20.    ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fuente: &lt;/span&gt;&lt;a href="http://api.drupal.org/api/function/drupal_set_message"&gt;http://api.drupal.org/api/function/drupal_set_message&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-6282954440856067416?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/6282954440856067416/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=6282954440856067416&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/6282954440856067416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/6282954440856067416'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/funcin-en-drupal-5x-para-setear-mensaje.html' title='Función en Drupal 5.x para setear mensaje'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-930411632183554576</id><published>2008-05-08T14:29:00.000-07:00</published><updated>2008-05-09T09:42:07.767-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Función hook_access Drupal 5.x</title><content type='html'>El hook &lt;span style="font-weight: bold;"&gt;access &lt;/span&gt;dentro del api drupal 5.x para el desarrollo de módulos nos ayuda a definir los permisos de acceso (por ejemplo para crear un tipo de nodo). La cuenta administrativa (con id #1 en la tabla) no tendrá problema para pasar por los permisos de acceso de cualquier módulo. Si no se define este hook para un módulo que defina un tipo de dato, todos los controles de acceso fallarán y sólo el administrador o los usuarios que tengan el permiso  "administrar nodos" podrán verlos.&lt;br /&gt;&lt;br /&gt;Parámetros:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$op&lt;/span&gt;: es la operación a realizar. Por ejemplo:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;create&lt;/li&gt;&lt;li&gt;delete&lt;/li&gt;&lt;li&gt;update&lt;/li&gt;&lt;li&gt;delete&lt;/li&gt;&lt;li&gt;view&lt;/li&gt;&lt;/ul&gt;Valor de &lt;span style="font-weight: bold;"&gt;return&lt;br /&gt;&lt;/span&gt;Se retorna &lt;span style="font-weight: bold;"&gt;true &lt;/span&gt;si la acción se puede realizar, de lo contrario, se retorna &lt;span style="font-weight: bold;"&gt;false.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Ej.&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1.    &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;br /&gt;2.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;hook_access&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;3.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;global &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;4.  &lt;br /&gt;5.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;== &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'create'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;6.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;user_access&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'create stories'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;7.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;8.  &lt;br /&gt;9.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;== &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'update' &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;|| &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;== &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'delete'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;10.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;user_access&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'edit own stories'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) &amp;amp;&amp;amp; (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$user&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;uid &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;== &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$node&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;uid&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;11.          &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;TRUE&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;12.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;13.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;14.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;15.    ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span style="font-weight: bold;"&gt;Fuente: &lt;/span&gt;&lt;a href="http://drupa.org/api/function/hook_access/5"&gt;http://drupa.org/api/function/hook_access/5&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-930411632183554576?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/930411632183554576/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=930411632183554576&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/930411632183554576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/930411632183554576'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/funcin-hookaccess-drupal-5x.html' title='Función hook_access Drupal 5.x'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-6586776461413897953</id><published>2008-05-08T14:24:00.001-07:00</published><updated>2008-05-09T09:41:33.095-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='poo'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Presentación sobre Programación Orientada a Objetos - Conceptos y su uso en php</title><content type='html'>Aquí les dejo una presentación que realizé para mi curso de php. Más adelante agrego los ejemplos.&lt;br /&gt;&lt;br /&gt;&lt;div style="width:425px;text-align:left" id="__ss_379955"&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=programacionorientadaobjetos-1209500901783291-9"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=programacionorientadaobjetos-1209500901783291-9" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;&lt;a href="http://www.slideshare.net/?src=embed"&gt;&lt;img src="http://static.slideshare.net/swf/logo_embd.png" style="border:0px none;margin-bottom:-5px" alt="SlideShare" /&gt;&lt;/a&gt; | &lt;a href="http://www.slideshare.net/danilo_04/programacion-orientada-objetos-379955?src=embed" title="View 'Programacion Orientada Objetos' on SlideShare"&gt;View&lt;/a&gt; | &lt;a href="http://www.slideshare.net/upload?src=embed"&gt;Upload your own&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-6586776461413897953?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/6586776461413897953/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=6586776461413897953&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/6586776461413897953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/6586776461413897953'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/presentacin-sobre-programacin-orientada.html' title='Presentación sobre Programación Orientada a Objetos - Conceptos y su uso en php'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-7080503328713440090</id><published>2008-05-08T14:14:00.000-07:00</published><updated>2008-05-09T09:42:26.280-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='drupal'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Custom URL's en Drupal 5.x</title><content type='html'>Para cambiar el estilo las url's de nuestro sitio en drupal (por ejemplo www.example.com/node/14 a www.example.com/articulo/14) tenemos una función que nos puede ayudar.&lt;br /&gt;&lt;br /&gt;Esta función es &lt;span style="font-weight: bold;"&gt;custom_url_rewrite&lt;/span&gt;. A continuación les dejo un ejemplo de modificar la url con &lt;span style="font-weight: bold;"&gt;node &lt;/span&gt;por &lt;span style="font-weight: bold;"&gt;articulo&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;1.    &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;br /&gt;2.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;custom_url_rewrite&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$result&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$path&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;3.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;== &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'alias'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;4.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;preg_match&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'|^node/(.*)|'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$path&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$matches&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;5.          &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'articulo/'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$matches&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;6.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;7. &lt;br /&gt;8.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;9.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$op &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;== &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'source'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;10.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;preg_match&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'|^articulo(/.*)|'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$path&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$matches&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;11.          &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'node'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$matches&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;12.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;13. &lt;br /&gt;14.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;15.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$result&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;16.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;17.    ?&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Donde si el parámetro $op es 'source' quiere decir que hay que traducirla para el código y si es 'alias' se hace la traducción para la url.&lt;br /&gt;&lt;br /&gt;Esta función se guarda en el archivo &lt;span style="font-weight: bold;"&gt;settings.php &lt;/span&gt;de nuestro sitio (por ejemplo &lt;span style="font-weight: bold;"&gt;ejemplo/sites/default/settings.php)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Saludos ...    &lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-7080503328713440090?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/7080503328713440090/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=7080503328713440090&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/7080503328713440090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/7080503328713440090'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/05/custom-urls-en-drupal-5x.html' title='Custom URL&apos;s en Drupal 5.x'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-4047268457664423292</id><published>2008-04-25T06:46:00.000-07:00</published><updated>2008-04-25T06:49:00.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql mysql'/><title type='text'>Presentación sobre SQL - Conceptos</title><content type='html'>Aquí les dejo con una presentación que hice para un Curso de PHP que estoy impartiendo. El fin es explicar los principales conceptos del lenguajes SQL.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="width: 425px; text-align: left;" id="__ss_364085"&gt;&lt;object style="margin: 0px;" height="355" width="425"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=cursosqlconceptos-1208753367688832-9"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=cursosqlconceptos-1208753367688832-9" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="355" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size: 11px; font-family: tahoma,arial; height: 26px; padding-top: 2px;"&gt;&lt;a href="http://www.slideshare.net/?src=embed"&gt;&lt;img src="http://static.slideshare.net/swf/logo_embd.png" style="border: 0px none ; margin-bottom: -5px;" alt="SlideShare" /&gt;&lt;/a&gt; | &lt;a href="http://www.slideshare.net/danilo_04/curso-sql-conceptos?src=embed" title="View 'Curso Sql -  Conceptos' on SlideShare"&gt;View&lt;/a&gt; | &lt;a href="http://www.slideshare.net/upload?src=embed"&gt;Upload your own&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;Saludos...&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-4047268457664423292?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/4047268457664423292/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=4047268457664423292&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/4047268457664423292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/4047268457664423292'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/presentacin-sobre-sql-conceptos.html' title='Presentación sobre SQL - Conceptos'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-7354158064674771311</id><published>2008-04-22T08:41:00.000-07:00</published><updated>2008-05-08T14:40:42.503-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='benchmarking'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>mysql_num_rows vs. SQl  - SELECT COUNT(*)</title><content type='html'>Haciendo una paginación para un proyecto me dió la curiosidad de verificar cuál método es más efectivo para contar el total de registros. Bueno a pesar de ser obvio que con sql count(*) sería más rápido, me propuse hacer las pruebas y estos fueron los resultados:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Prueba con SELECT COUNT(*) FROM tabla&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Fecha: 22/04/2008 11:35:17 am&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Test con count(*) - registros = 44069&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;Tiempo &lt;span style="color: rgb(0, 0, 153);"&gt;0.00441598892212&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;segundos&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Prueba mysql_num_rows&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;Fecha: 22/04/2008 11:35:21 am&lt;br /&gt;Test con mysql_affected_rows - registros = 44069&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tiempo &lt;span style="color: rgb(0, 0, 153);"&gt;59.3658621311&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0);"&gt;segundos&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;Código fuente de la prueba:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1.    &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;br /&gt;2.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;require(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'../benchmark.php'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;3.    $caso &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'mysql'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;4.    $file &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'../var/bench_databasecount.txt'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;5.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;try{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;6.        Benchmark&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;startBenchmark&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;7.        $conn &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mysql_connect&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'localhost'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'root'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'pannet1'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;8.        mysql_select_db&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'test'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$conn&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;9.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;switch(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$caso&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;){&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;10.            &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;case &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'count'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;11.                    $sql &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"SELECT COUNT(*) as contador FROM tabla"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;12.                    $rs &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mysql_query&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$sql&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$conn&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;13.                    $count &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mysql_fetch_array&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$rs&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;14.                    Benchmark&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;pushLog&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'Test con count - registros = '&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$count&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'contador'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;].&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;15.            &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;break;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;16.            &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;case &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'mysql'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;:&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;17.                    $sql &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"SELECT * FROM tabla"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;18.                    $rs &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mysql_query&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$sql&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$conn&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;19.                    $count &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mysql_num_rows&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$rs&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;20.                    Benchmark&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;pushLog&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'Test con mysql_affected_rows - registros = '&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$count &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;"\n"&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;21.            &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;break;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;22.&lt;br /&gt;23.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;24.        Benchmark&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;endBenchmark&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$file&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;25.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;echo &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'Termino'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;26.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}catch(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;Exception $e&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;){&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;27.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$e&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;getMessage&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;28.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;29.    ?&gt;&lt;br /&gt;&lt;/span&gt;30.&lt;br /&gt;31.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusión&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;A las personas que todavía realizan las paginaciones con &lt;span style="font-weight: bold;"&gt;mysql_num_rows&lt;/span&gt;,  preferiblemente usen sql (función COUNT(*)).&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-7354158064674771311?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/7354158064674771311/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=7354158064674771311&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/7354158064674771311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/7354158064674771311'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/mysqlnumrows-vs-sql-select-count.html' title='mysql_num_rows vs. SQl  - SELECT COUNT(*)'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-1041180527752862281</id><published>2008-04-15T13:42:00.000-07:00</published><updated>2008-05-09T09:40:52.750-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='poo'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Patrón Singleton en PHP</title><content type='html'>Les dejo un ejemplo del patrón singleton aplicado en php. Es bien útil para manejar las conexiones a la base de datos.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;1.  &lt;span style="color: rgb(0, 0, 153);"&gt;&amp;lt;?php  &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;&lt;br /&gt;2.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;class &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;DB &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;3.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;private static &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_singleton&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;4.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;private &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_connection&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;5.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;private function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;__construct&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;()&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;6.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;7.        $this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;_connection &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;mysql_connect&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;8.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;9.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;public static function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;getInstance&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;()&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;10.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;11.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;if (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;is_null &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_singleton&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)) {&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;12.          self&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_singleton &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= new &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;DB&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;13.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;14.        &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$_singleton&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;15.      &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;16.    &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;17.    $db &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;DB&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;::&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;getInstance&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;();&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;18.&lt;br /&gt;19.    ?&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-1041180527752862281?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/1041180527752862281/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=1041180527752862281&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/1041180527752862281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/1041180527752862281'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/patrn-singleton-en-php.html' title='Patrón Singleton en PHP'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-2475281262789133969</id><published>2008-04-10T07:36:00.000-07:00</published><updated>2008-04-10T07:50:45.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Sound Juicer para extracción de música</title><content type='html'>Ubuntu trae una herramienta muy buena para la extracción de música en los cd's. Se llama Sound Juicer. Para poder guardar las canciones en formato mp3 se necesita bajar el paquete&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;b&gt;gstreamer0.10-plugins-ugly-multiverse.&lt;br /&gt;#: sudo aptitude install &lt;/b&gt;&lt;b&gt;gstreamer0.10-plugins-ugly-multiverse.&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;Después debes entrar Sound Juicer y buscar las opciones en &lt;b&gt;Editar -&gt; Preferencias -&gt; Editar Perfiles.&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;Debes agregar un nuevo perfil con los siguientes datos:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Nombre: Calidad de CD mp3 optimo&lt;/li&gt;&lt;li&gt;Descripción del perfil: Calidad de mp3 a 190 kbs&lt;/li&gt;&lt;li&gt;Pipeline de Gstreamer: audio/x-raw-int,rate=44100,channels=2 ! lame name=enc bitrate=192 mode=Stereo&lt;/li&gt;&lt;li&gt;Extensión: mp3&lt;/li&gt;&lt;li&gt;Seleccionar el checkbox que dice ¿Está activo?&lt;/li&gt;&lt;/ul&gt;Con esto debes tener la opción para guardar tus canciones en formato mp3.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fuente: &lt;a href="http://www.guia-ubuntu.org/index.php?title=Sound_Juicer"&gt;Guía Ubuntu - Sound Juicer&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Saludos ...&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-2475281262789133969?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/2475281262789133969/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=2475281262789133969&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/2475281262789133969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/2475281262789133969'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/sound-juicer-para-extraccin-de-msica.html' title='Sound Juicer para extracción de música'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-1695868354257787706</id><published>2008-04-08T07:22:00.000-07:00</published><updated>2008-04-08T07:28:11.260-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bluetooth'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Problemas con mi celular y el bluetooth de mi laptop en Ubuntu Linux</title><content type='html'>Algunas veces había intentado pegar mi celular (Sony Erickson w300) a mi laptop (Dell XPS 1330), pero me salía un error de que no podía realizar la conexión (&lt;em&gt;obex://[–]...)&lt;/em&gt; . Para resolver este problema se debe instalar un paquete llamado &lt;strong&gt;&lt;a href="http://blogs.gnome.org/jamesh/2007/01/03/gnome-vfs-obexftp-01-released/"&gt;gnome-vfs-obexftp&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;#: sudo aptitude install &lt;/strong&gt;&lt;strong&gt;gnome-vfs-obexftp&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Bueno espero les ayuden en algo...&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fuente: &lt;/span&gt;&lt;a href="http://www.davidsuarez.es/?p=472"&gt;http://www.davidsuarez.es/?p=472&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-1695868354257787706?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/1695868354257787706/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=1695868354257787706&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/1695868354257787706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/1695868354257787706'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/problemas-con-mi-celular-y-el-bluetooth.html' title='Problemas con mi celular y el bluetooth de mi laptop en Ubuntu Linux'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-2811793460847620033</id><published>2008-04-06T09:45:00.001-07:00</published><updated>2008-04-06T09:47:05.055-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='robotica'/><title type='text'>Peleas de Robots</title><content type='html'>Buscando videos sobre Lego Mindstorms me encuentro con un video bastante cómico de una pelea de dos robots. Éstos robots son bastante ágiles y uno de ellos llega a dar hasta un mortal jajaja. Aquí les dejo con el video:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;object height="355" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/wqy1bDf9fVo&amp;amp;hl=en"&gt;&lt;param name="wmode" value="transparent"&gt;&lt;embed src="http://www.youtube.com/v/wqy1bDf9fVo&amp;amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-2811793460847620033?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/2811793460847620033/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=2811793460847620033&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/2811793460847620033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/2811793460847620033'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/peleas-de-robots.html' title='Peleas de Robots'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-4765008205248060452</id><published>2008-04-04T07:33:00.000-07:00</published><updated>2008-04-04T07:38:24.618-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='searchengine'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='sphinx'/><title type='text'>Problemas con mysql instalando sphinx en Ubuntu Linux</title><content type='html'>Instalando &lt;a href="http://www.sphinxsearch.com"&gt;sphinx&lt;/a&gt; (search engine) en mi máquina del trabajo (Dell Optilex gx520 Ubuntu Gusty 7.10), me topo con un problema relacionado con mysql. Me aperece que no encuentra las librerías de mysql y me aconseja que instale el paquete &lt;span style="font-weight: bold;"&gt;mysql-devel&lt;/span&gt;. Buscando en google me doy cuenta que en ubuntu el paquete no se llama mysql-devel, sino  &lt;span style="font-weight: bold;"&gt;libmysql++-dev.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;Instalando este paquete, no tendrás problemas para compilar el sphinx en tu máquina con ubuntu. Claro ántes debes tener instalado mysql en tu máquina.&lt;br /&gt;&lt;br /&gt;Espero les ayude en algo si llegan a tener este problema.&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-4765008205248060452?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/4765008205248060452/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=4765008205248060452&amp;isPopup=true' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/4765008205248060452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/4765008205248060452'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/problemas-con-mysql-instalando-sphinx.html' title='Problemas con mysql instalando sphinx en Ubuntu Linux'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-5483114159481610589</id><published>2008-04-03T21:44:00.000-07:00</published><updated>2008-04-04T06:20:06.108-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='robotica'/><category scheme='http://www.blogger.com/atom/ns#' term='universidad'/><title type='text'>Primer Lego MindStorms en la clase de Robótica</title><content type='html'>Este semestre nos toca la materia de Robótica. Una materia bastante interesante y que ha despertado cierto interés por parte mía y de unos amigos. En las primeras clases estamos aprendiendo lo básico, pero viendo algunos videos en youtube, nos ha llamado más aún la atención lo que se puede hacer con estos juguetes.&lt;br /&gt;&lt;br /&gt;Aquí les dejo con un video (de mi celular, no muy buena resolución jeje) del primer robot que armamos en la clase.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-8159f0feeea06b05" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.blogger.com/img/videoplayer.swf?videoUrl=http%3A%2F%2Fvp.video.google.com%2Fvideodownload%3Fversion%3D0%26secureurl%3DqAAAADbdx0ctBZ6r0jjgHMEoxabAM7jngDZ6nGVFq6fzeOKkH6k7hkTRwtrbqSOa66vWNW3YacE23-INK-TtFsAcDIFpjYIvrSJuWJ2fBR0_BD0Pg5vMFXAgwLfgsNGS3kfNsl74RBLrXCWbVDWM8j62dNkOcUUlKrt7BRHNuA4EdvftOh3rzd0fH-X0_n_iG3i3Qk2JS-tYCJP3MnT9tOFIWcZYzx1WqPyS4qB3RGdqkl08%26sigh%3DDsi2wgm7ByBikgOfTpyNb4y_2UU%26begin%3D0%26len%3D86400000%26docid%3D0&amp;amp;nogvlm=1&amp;amp;thumbnailUrl=http%3A%2F%2Fvideo.google.com%2FThumbnailServer2%3Fapp%3Dblogger%26contentid%3D8159f0feeea06b05%26offsetms%3D5000%26itag%3Dw320%26sigh%3DglKafhn-5mz1JrKmZW17UcPy9hM&amp;amp;messagesUrl=video.google.com%2FFlashUiStrings.xlb%3Fframe%3Dflashstrings%26hl%3Den"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;embed width="320" height="266" src="http://www.blogger.com/img/videoplayer.swf?videoUrl=http%3A%2F%2Fvp.video.google.com%2Fvideodownload%3Fversion%3D0%26secureurl%3DqAAAADbdx0ctBZ6r0jjgHMEoxabAM7jngDZ6nGVFq6fzeOKkH6k7hkTRwtrbqSOa66vWNW3YacE23-INK-TtFsAcDIFpjYIvrSJuWJ2fBR0_BD0Pg5vMFXAgwLfgsNGS3kfNsl74RBLrXCWbVDWM8j62dNkOcUUlKrt7BRHNuA4EdvftOh3rzd0fH-X0_n_iG3i3Qk2JS-tYCJP3MnT9tOFIWcZYzx1WqPyS4qB3RGdqkl08%26sigh%3DDsi2wgm7ByBikgOfTpyNb4y_2UU%26begin%3D0%26len%3D86400000%26docid%3D0&amp;amp;nogvlm=1&amp;amp;thumbnailUrl=http%3A%2F%2Fvideo.google.com%2FThumbnailServer2%3Fapp%3Dblogger%26contentid%3D8159f0feeea06b05%26offsetms%3D5000%26itag%3Dw320%26sigh%3DglKafhn-5mz1JrKmZW17UcPy9hM&amp;amp;messagesUrl=video.google.com%2FFlashUiStrings.xlb%3Fframe%3Dflashstrings%26hl%3Den" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-5483114159481610589?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=8159f0feeea06b05&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/5483114159481610589/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=5483114159481610589&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5483114159481610589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5483114159481610589'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/primer-lego-mindstorm-en-la-clase-de.html' title='Primer Lego MindStorms en la clase de Robótica'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-697985460896250028</id><published>2008-04-02T08:06:00.000-07:00</published><updated>2008-04-02T08:20:16.707-07:00</updated><title type='text'>Clase en php para filtrar texto</title><content type='html'>Cuando creamos un foro por ejemplo nos vemos en la necesidad de crear filtros para malas palabras. La siguiente clase se encarga de filtrar texto dependiendo de un arreglo de palabras que estén definidas con anterioridad.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Código:&lt;br /&gt;&lt;code&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;span style="color: rgb(0, 0, 187);"&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;/**&lt;br /&gt; * WordFilter&lt;br /&gt; * Class for censoring words in text&lt;br /&gt; * @access public&lt;br /&gt; * @package SPLIB&lt;br /&gt; */&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;class &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;WordFilter &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;{&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;/**&lt;br /&gt;    * An array of words to censor&lt;br /&gt;    * @access private&lt;br /&gt;    * @var array&lt;br /&gt;    */&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;var &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWords&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;/**&lt;br /&gt;    * WordFilter constructor&lt;br /&gt;    * Randomly generates strings to censor words with&lt;br /&gt;    * @param array an array of words to filter&lt;br /&gt;    * @access public&lt;br /&gt;    */&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;WordFilter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWords&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)&lt;br /&gt;       {&lt;br /&gt;          &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;badWords &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= array();&lt;br /&gt;          &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;srand&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;((float)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;microtime&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;() * &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;1000000&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;          &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$censors &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'$'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'@'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'#'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'*'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;          foreach (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWords &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;as &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;preg_quote&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$replaceStr &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;''&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$size &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;strlen&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;            for (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$i &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$i &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$size&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$i&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;++) {&lt;br /&gt;              &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;shuffle&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$censors&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;              &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$replaceStr &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;.= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$censors&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;];&lt;br /&gt;            }&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;badWords&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;] = &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$replaceStr&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;          }&lt;br /&gt;       }&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;/**&lt;br /&gt;         * Searches for bad words in text and censors them&lt;br /&gt;         * @param string text to filter&lt;br /&gt;         * @return string the filtered text&lt;br /&gt;         * @access public&lt;br /&gt;         */&lt;br /&gt;       &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;function &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;filter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;)&lt;br /&gt;       {&lt;br /&gt;          foreach (&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$this&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;badWords &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;as &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;=&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$replaceStr&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;) {&lt;br /&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;preg_replace&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'/' &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWord &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;. &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'/i'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$replaceStr&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;,&lt;br /&gt;                                 &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;          }&lt;br /&gt;          return &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;       }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// An array of words to replace&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWords &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= array(&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tubby'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'tubbies'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;, &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'byebye'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Include the word file with the list of bad words&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$wordFilter &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= new &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;WordFilter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$badWords&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// $text simulates some data from the database&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(221, 0, 0);"&gt;'byebye!'&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 128, 0);"&gt;// Filter the words&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text &lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;= &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$wordFilter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;-&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;filter&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;);&lt;br /&gt;echo &lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;$text&lt;/span&gt;&lt;span style="color: rgb(0, 119, 0);"&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 187);"&gt;?&gt;&lt;/span&gt; &lt;/span&gt; &lt;/code&gt;&lt;br /&gt;&lt;/blockquote&gt;           &lt;br /&gt;Fuente: Libro The PHP Anthology, Volumen II.&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-697985460896250028?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/697985460896250028/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=697985460896250028&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/697985460896250028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/697985460896250028'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/04/clase-en-php-para-filtrar-texto.html' title='Clase en php para filtrar texto'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-8977631965754976473</id><published>2008-03-31T10:49:00.000-07:00</published><updated>2008-04-02T08:06:37.661-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='games'/><category scheme='http://www.blogger.com/atom/ns#' term='enemy territory'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Problema de audio con Wolfenstein ET en linux</title><content type='html'>Bueno para los que instalaron Wolfesntein Enemy Territory en linux (en mi caso la distribución Ubuntu) y el audio del juego no se escucha, pueden probar la solución que les dejo. Es la siguiente:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Como usuario root ejecutas la siguiente línea de comando:&lt;br /&gt;#: echo "et.x86 0 0 direct" &gt;&gt; /proc/asound/card0/pcm0p/oss&lt;/li&gt;&lt;li&gt;Si queremos guardar esos cambios, debemos ejecutar lo siguiente:&lt;br /&gt;#: nano /etc/rc.local y agregamos la línea  echo "et.x86 0 0 direct" &gt;&gt; /proc/asound/card0/pcm0p/oss&lt;/li&gt;&lt;/ul&gt;Fuente: &lt;a href="http://blogdrake.net/node/3047"&gt;http://blogdrake.net/node/3047&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-8977631965754976473?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/8977631965754976473/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=8977631965754976473&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/8977631965754976473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/8977631965754976473'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/03/problema-de-audio-con-wolfenstein-et-en.html' title='Problema de audio con Wolfenstein ET en linux'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-5411347395906447979</id><published>2008-03-14T13:58:00.000-07:00</published><updated>2008-03-14T14:05:08.639-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Desinstalar Aplicaciones compiladas en Linux</title><content type='html'>Normalmente utilizo apt para instalar mis aplicaciones en linux (en mi caso utilizo Ubuntu). Pero hay aplicaciones que no se encuentran en los repositorios de paquetes  y por esto hay casos en los que debemos compilar código.&lt;br /&gt;&lt;br /&gt;Normalmente la instalación de una aplicación sería:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;./configure&lt;/li&gt;&lt;li&gt;make&lt;/li&gt;&lt;li&gt;make install //Como usuario root&lt;/li&gt;&lt;/ul&gt;Para poder desinstalar debemos tener el código fuente con el que compilamos y seguir los siguientes pasos:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;   ./configure&lt;/li&gt;&lt;li&gt;make uninstall&lt;/li&gt;&lt;/ul&gt;Si no funcione verificar en el archivo &lt;span style="font-weight: bold;"&gt;Makefile&lt;/span&gt; si existe alguna directiva de Unistall.&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-5411347395906447979?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/5411347395906447979/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=5411347395906447979&amp;isPopup=true' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5411347395906447979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5411347395906447979'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/03/desinstalar-aplicaciones-compiladas-en.html' title='Desinstalar Aplicaciones compiladas en Linux'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-1581808887837506550</id><published>2008-03-11T07:00:00.000-07:00</published><updated>2008-03-11T11:25:29.217-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='benchmarking'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Benchmark a tu sitios con ApacheBench en Linux</title><content type='html'>Si tu sitio u aplicación está alojada en un servidor que corre sobre apache, entonces podemos hacer un &lt;a href="http://es.wikipedia.org/wiki/Benchmark"&gt;Benchmark&lt;/a&gt; para verificar el tiempo de respuesta de nuestra aplicación, gracias a la aplicación ApacheBench.&lt;br /&gt;&lt;br /&gt;Este aplicación nos ayuda para hacer benchmark de aplicaciones hechas en php por ejemplo u otro tipo de aplicaciones, ya que podemos medir el tiempo de respuesta de nuestra app.&lt;br /&gt;&lt;br /&gt;Ahora les coloco un ejemplo de su uso:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Entramos a la consola y colocamos:&lt;br /&gt;#: ab -c 10 -t 60 http://example.org/productos.php&lt;/li&gt;&lt;li&gt;Para llamar a la aplicación utilizamos el comando &lt;span style="font-weight: bold;"&gt;ab&lt;/span&gt;; explico los parámetros:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;-c: este parámetro indica el número de clientes con el cual se va a llevar a cabo el test.&lt;/li&gt;&lt;li&gt;-t: indica el tiempo durante el cual se va a llevar a cabo el test. Este tiempo es en segundos.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;Además de esos parámetros que pueden ser de utilidad para nuestras benchmark a servidores apache. Compruebe introduciendo &lt;span style="font-weight: bold;"&gt;ab man&lt;/span&gt; para obtener más información.&lt;br /&gt;&lt;br /&gt;Espero puedan mejorar los procesos de sus aplicaciones utilizando esta herramienta para medir su rendimiento.&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-1581808887837506550?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/1581808887837506550/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=1581808887837506550&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/1581808887837506550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/1581808887837506550'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/03/benchmark-tu-sitios-con-apachebench-en.html' title='Benchmark a tu sitios con ApacheBench en Linux'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-5030105985656686958</id><published>2008-03-06T06:24:00.000-08:00</published><updated>2008-03-06T06:40:04.513-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cakephp'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Problemas con bindable y paginate en CakePHP</title><content type='html'>Últimamente tuve un poco de problemas con los binds y la función paginate de la nueva versión de el marco de trabajo cakephp, la 1.2.&lt;br /&gt;&lt;br /&gt;Mi problema surgía cuando quería buscar todos los posts que estuvieran asociados a un tag específico, pero sólo quería traer la relación que el post tenía con Usuario y no la relación con Comentarios. Buscando por ahí me encuentra con una respuesta del Sr. &lt;a href="http://www.cricava.com/blogs/index.php?blog=6&amp;amp;title=modelizing_habtm_join_tables_in_cakephp_&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1"&gt;Mariano Iglesias&lt;/a&gt;, que dice que la función paginate rehace las relaciones (por esta razón cualquiera unbindModel no funcionaría). En este &lt;a href="http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings"&gt;enlace&lt;/a&gt; se puede encontrar información sobre el behavior &lt;span style="font-weight: bold;"&gt;Bindable&lt;/span&gt;. En mi caso la solución fue la siguiente:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Creo app_model.php y le agrego:&lt;br /&gt; &lt;span style="font-style: italic;"&gt;var $actsAs = array('Bindable');&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;El método en el controlador post quedó así:&lt;br /&gt;&lt;span style="font-style: italic;"&gt;function tag($id = null){&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        if (!$id) {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;            $this-&gt;Session-&gt;setFlash(__('Invalid Tag.', true));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;            $this-&gt;redirect(array('action'=&gt;'index'));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        $this-&gt;layout = 'blog';&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;//        $this-&gt;Post-&gt;unbindModel(array('hasMany' =&gt; array('TrackPost', 'Comentario'), 'hasAndBelongsToMany' =&gt; array('Tag')));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        $this-&gt;Post-&gt;restrict(false, 'Usuario');&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        /*$this-&gt;Post-&gt;bindModel(array('hasAndBelongsToMany' =&gt; array('Tag' =&gt; array(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                        'joinTable' =&gt; 'posts_tags',&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                        'foreignKey' =&gt; 'post_id',&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                        'associationForeignKey' =&gt; 'tag_id',&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                        'unique' =&gt; false,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                        'conditions' =&gt; 'Tag.id = '.$id)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;                                                    )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;         ));*/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        $this-&gt;Post-&gt;Tag-&gt;recursive = 2;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        $this-&gt;set('existSession', $this-&gt;existSession());&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        //$this-&gt;set('posts', $this-&gt;Post-&gt;Tag-&gt;find(array('Tag.id' =&gt; $id)));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        $this-&gt;set('posts', $this-&gt;paginate('Tag', array('Tag.id' =&gt; $id)));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;        $this-&gt;Post-&gt;resetBindable(true);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Lo interesante está en las siguientes líneas:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;$this-&gt;Post-&gt;restrict(false, 'Usuario'); &lt;/span&gt;: esta línea restringe a que Post solo tengo relación con &lt;span style="font-weight: bold;"&gt;Usuario &lt;/span&gt;y el parámetro false hace que todos los cambios que haz hecho de relaciones sean permanentes.&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic;"&gt;$this-&gt;Post-&gt;resetBindable(true); &lt;/span&gt;: reseteo las relaciones para que funcionen como estaban.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;Bueno con esto resolví mi problema. Saludos ...&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-5030105985656686958?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/5030105985656686958/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=5030105985656686958&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5030105985656686958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/5030105985656686958'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/03/problemas-con-bindable-y-paginate-en.html' title='Problemas con bindable y paginate en CakePHP'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3068224110259204298.post-739592636785128782</id><published>2008-03-03T12:07:00.000-08:00</published><updated>2008-03-03T12:18:56.556-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='cakephp'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Cakephp relación HBTM personalizada</title><content type='html'>Trabajando con CakePHP me encuentro en el manual el típico ejemplo de una relación de muchos a muchos (ejemplo de la relación de posts y tags).&lt;br /&gt;&lt;br /&gt;Según la documentación se debe crear un campo select multiple para colocar los tags aquí. Este método no me gustó mucho y decidí hacerlo al estilo de el bloguer de Google, o sea, separar los tags por compas en un campo tipo &lt;span style="font-weight: bold;"&gt;text&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Mi solución consiste en buscar en la base de datos si los tags que el usuario introdujo existen, de no existir los inserto y obtengo su id. En el modelo post agregué el método &lt;span style="font-weight: bold;"&gt;beforeSave&lt;/span&gt;. Aquí les dejo el código:&lt;br /&gt;&lt;blockquote&gt;public function beforeSave(){&lt;br /&gt;        if ($this-&gt;data['Tag']['tags'] != ''){ //Campo $form-&gt;input('Tag/tags')&lt;br /&gt;            $tags = explode(',', $this-&gt;data['Tag']['tags']);&lt;br /&gt;            foreach($tags as $tag){&lt;br /&gt;                $tag = trim($tag);&lt;br /&gt;                $tag_find = $this-&gt;Tag-&gt;findByTagname($tag);&lt;br /&gt;                if ($tag_find){&lt;br /&gt;                    $tag_id = $tag_find['Tag']['id'];&lt;br /&gt;                }else{&lt;br /&gt;                    $tag_ins = array('Tag' =&gt; array('tagname' =&gt; $tag));&lt;br /&gt;                    $this-&gt;Tag-&gt;save($tag_ins);&lt;br /&gt;                    $tag_id = $this-&gt;Tag-&gt;getLastInsertID();&lt;br /&gt;                }&lt;br /&gt;                $this-&gt;data['Tag']['Tag'][] = (string) $tag_id;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        unset($this-&gt;data['Tag']['tags']);&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Para el caso de la acción de editar, coloqué este código en el método:&lt;br /&gt;&lt;blockquote&gt;if (empty($this-&gt;data)) {&lt;br /&gt;            $this-&gt;data = $this-&gt;Post-&gt;read(null, $id);&lt;br /&gt;            foreach($this-&gt;data['Tag'] as $tag){&lt;br /&gt;                $tags[] = $tag['tagname'];&lt;br /&gt;            }&lt;br /&gt;            $tags = implode(', ', $tags);&lt;br /&gt;            $this-&gt;set('tags', $tags);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Y en la vista&lt;br /&gt;echo $form-&gt;input('Tag/tags', array('label' =&gt; 'Tags separados por coma', 'type' =&gt; 'text', 'value' =&gt; $tags));&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;Listo, de esta manera utilizamos la relación de muchos a muchos en cakephp, pero a nuestra manera.&lt;br /&gt;&lt;br /&gt;Saludos ...&lt;br /&gt;&lt;blockquote style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;span style="color: rgb(153, 153, 153);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Panamá Post - Desarrollo Web en Panamá&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3068224110259204298-739592636785128782?l=panamapost.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://panamapost.blogspot.com/feeds/739592636785128782/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=3068224110259204298&amp;postID=739592636785128782&amp;isPopup=true' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/739592636785128782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3068224110259204298/posts/default/739592636785128782'/><link rel='alternate' type='text/html' href='http://panamapost.blogspot.com/2008/03/cakephp-relacin-hbtm-personalizada.html' title='Cakephp relación HBTM personalizada'/><author><name>Danilo Domínguez P.</name><uri>http://www.blogger.com/profile/14922986321315562316</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='00082519215057487278'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>