<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4889084301582708309</atom:id><lastBuildDate>Sat, 05 Oct 2024 01:58:33 +0000</lastBuildDate><category>ruby</category><category>python</category><category>combinatoria</category><category>factorial</category><category>maximo comun divisor</category><category>mcd</category><category>puppy linux</category><title>From Gustavo</title><description></description><link>http://fromgus.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4889084301582708309.post-2821552032555220289</guid><pubDate>Sat, 05 Mar 2011 18:56:00 +0000</pubDate><atom:updated>2011-03-05T15:57:02.405-03:00</atom:updated><title>Pagina web en blogger</title><description>Algo que faltaba a blogger era la posibilidad de agregar páginas, además de posts. Podemos tener hasta 10 páginas. Para configurarlo, ir a Creacion de entradas -&gt; Editar páginas.</description><link>http://fromgus.blogspot.com/2011/03/pagina-web-en-blogger.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4889084301582708309.post-2952822570332502187</guid><pubDate>Thu, 18 Jun 2009 11:11:00 +0000</pubDate><atom:updated>2009-06-18T15:39:20.418-03:00</atom:updated><title>Resolve problemas en un par de lineas de codigo, sin usar recursividad.</title><description>La idea de este blog es ir mostrando algunos problemas de programación y resolverlos en pocas lineas. Sobre todo voy a usar Python y Ruby. Algunos problemas, muestran formulas y algoritmos de algebras.
A la derecha, buscá el tema que te interese en las etiquetas(labels).</description><link>http://fromgus.blogspot.com/2009/06/resolve-problemas-en-un-par-de-lineas.html</link><author>noreply@blogger.com (Unknown)</author></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4889084301582708309.post-8107939946984702639</guid><pubDate>Fri, 29 May 2009 19:21:00 +0000</pubDate><atom:updated>2009-05-29T16:26:57.086-03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">puppy linux</category><category domain="http://www.blogger.com/atom/ns#">ruby</category><title>Instalando Ruby en Puppy Linux</title><description>(metodo testeado en maquina virtual con virtualbox)&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: red;&quot;&gt;Configurando y compilando Ruby desde Source Code&lt;/div&gt;
&lt;br /&gt;
Primero necesitas bajar devx_412.sfs (desde repositorios de puppy) al mismo directorio de pup_save.2fs y reiniciar la maquina&lt;br /&gt;
Obs: tiene que existir el pup_save si no hiciste full install de puppy.&lt;br /&gt;
&lt;br /&gt;
Antes de instalar ruby: &lt;br /&gt;
proba en la shell&lt;br /&gt;
make + enter (si no dice command not found), segui adelante&lt;br /&gt;
&lt;br /&gt;
Despues que probaste que va a funcionar &quot;make&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;0. bajas la version (recommended ) &lt;a href=&quot;http://www.ruby-lang.org/en/downloads/&quot;&gt;http://www.ruby-lang.org/en/downloads/&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;a directorio /root (el primero que ves cuando haces clic en la casita)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;1. Abris una  consola.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;2. Cambias directorio a Ruby package. (donde esta el archivo que bajaste)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;3. Untar el package:&lt;br /&gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;tar -xvf ruby-1.9.1.tar.gz&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;o hace clic en el paquete y busca el boton de extraer&lt;br /&gt;
&amp;nbsp;&amp;nbsp;4. Cambias al directorio creado por el package.&lt;br /&gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;cd ruby-1.9.1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;5.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;./configure --host=i486-pc-linux-gnu  (atencion al punto antes /configure...)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;6. &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;make CFLAGS=&quot;-march=i486 -mtune=i686&quot;&lt;br /&gt;
 &amp;nbsp;&amp;nbsp;7.  make install&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;FIN !!!!&lt;br /&gt;
 &lt;br /&gt;
 Paciencia para cada paso, espera que la maquina trabaje hasta que te devuelva el cursos, tomate un coffee o hace otra cosa.&lt;br /&gt;
 Proba irb + enter&lt;br /&gt;
 Y en Geany (clic en notas) elegi new Ruby Source file, borra todo y escribis&lt;br /&gt;
 puts &quot;hola ruby&quot; y presionas F5 o clic en Execute.&lt;br /&gt;
 Listo, tenes ruby. &lt;br /&gt;</description><link>http://fromgus.blogspot.com/2009/05/instalando-ruby-en-puppy-linux.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4889084301582708309.post-6698916117217797954</guid><pubDate>Wed, 27 May 2009 11:37:00 +0000</pubDate><atom:updated>2009-09-26T12:34:27.918-03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">maximo comun divisor</category><category domain="http://www.blogger.com/atom/ns#">mcd</category><category domain="http://www.blogger.com/atom/ns#">ruby</category><title>Maximo Comun Divisor</title><description>&lt;div&gt;Calculo del MCD usando el algoritmo de Euclides&lt;/div&gt;
&lt;div&gt;&lt;p&gt;Ej: el maximo comun divisor entre 6 y 10:
mcd(6:10) = mcd(10:6) = mcd(6:4) = mcd(4:2) = mcd(2:0).
Se calcula el MCD con el resto de dividir el valor absoluto del mayor por el menor,
y nos quedamo con el resto de la division y el valor menor que teníamos&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;color:red;&quot;&gt;Ruby: &lt;/span&gt;
&lt;/p&gt;
&lt;span style=&quot;;font-size:130%;color:blue;&quot;  &gt;#a,b numeros enteros no nulos&lt;/span&gt;
&lt;div style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;
&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;def&lt;/span&gt; mcd(a,b)&lt;/div&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt; d = a.abs, b.abs &lt;/span&gt;&lt;span style=&quot;;font-size:130%;color:blue;&quot;  &gt;#[a.abs, b.abs]&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt; while&lt;/span&gt; d.min != 0&lt;/span&gt;
&lt;/div&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt; d = d.min,
d.max%d.min&lt;/span&gt;
&lt;/div&gt;
&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-left: 40px;&quot;&gt;&lt;span style=&quot;color: rgb(153, 0, 0);font-size:130%;&quot; &gt; end&lt;/span&gt;
&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: rgb(102, 102, 204);font-size:130%;&quot; &gt;&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;end&lt;/span&gt;

&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;puts&lt;/span&gt; mcd(6,10)&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;/span&gt;
&lt;/div&gt;</description><link>http://fromgus.blogspot.com/2009/05/maximo-comun-divisor.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4889084301582708309.post-6288414936346329570</guid><pubDate>Tue, 26 May 2009 11:20:00 +0000</pubDate><atom:updated>2009-06-09T09:25:42.691-03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">combinatoria</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">ruby</category><title>Combinatoria</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&amp;amp;eq=%5Cbinom%20%7B9%7D%20%7B3%7D%20%3D%20%5Cbinom%20%7B9%7D%20%7B9-3%7D%20%3D%20%5Cfrac%7B9%21%7D%7B6%21%203%21%7D%20%3D%20%5Cfrac%7B7x8x9%7D%7B1x2x3%7D&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; cursor: pointer; width: 229px; height: 40px;&quot; src=&quot;http://www.sitmo.com/gg/latex/latex2png.2.php?z=100&amp;amp;eq=%5Cbinom%20%7B9%7D%20%7B3%7D%20%3D%20%5Cbinom%20%7B9%7D%20%7B9-3%7D%20%3D%20%5Cfrac%7B9%21%7D%7B6%21%203%21%7D%20%3D%20%5Cfrac%7B7x8x9%7D%7B1x2x3%7D&quot; alt=&quot;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Ruby:&lt;/span&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;#combinatorio (9,3) n,k&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;c = 9,3 &lt;br /&gt;
c &amp;lt;&amp;lt; c[0]-c[1]&lt;/span&gt; #--&amp;gt; [9,3,6]
&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;# 7*8*9/(1*2*3) en una linea
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;r = (c.sort[1]+1..c.max).&lt;span
style=&quot;color: rgb(153, 0, 0);&quot;&gt;inject&lt;/span&gt;{|a,b| a*b}/(1..c.min).&lt;span
style=&quot;color: rgb(153, 0, 0);&quot;&gt;inject&lt;/span&gt;{|c,d| c*d}
&lt;br /&gt;
&lt;span style=&quot;color: rgb(153, 0, 0);&quot;&gt;puts&lt;/span&gt; r
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;en una linea el combinatorio
(9,6) = &lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;(7..9).&lt;span
style=&quot;color: rgb(153, 0, 0);&quot;&gt;inject&lt;/span&gt;{|a,b| a*b}/(1..3).&lt;span
style=&quot;color: rgb(153, 0, 0);&quot;&gt;inject&lt;/span&gt;{|c,d| c*d}&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;explicacion:&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;c es una lista [9,3] despues
agregamos (&amp;lt;&amp;lt;)la diferencia (9-3) y nos queda &lt;br /&gt;
c = [9,3,6] c.sort
--&amp;gt; [3,6,9] ; &lt;br /&gt;
c.sort[1]+1 --&amp;gt; 7 ; nos queda (7..9)&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;inject: esta funcion usa dos
variables |a,b| en a acumula el resultado y &lt;br /&gt;
con b va recorriendo una
lista de numeros desde el segundo elemente hasta el ultimo. &lt;br /&gt;
--&amp;gt;
(7*8)*9)&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;------------- ~ ---------------&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Python&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; a,b,i = 1,1,1
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; for x in range(6+1,9+1):
&lt;br /&gt;
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
a = a*x
&lt;br /&gt;
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
b,i = b*i, i+1
&lt;br /&gt;
...
&lt;br /&gt;
&amp;gt;&amp;gt;&amp;gt; a/b
&lt;br /&gt;
84
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;------------- ~ ---------------&lt;br /&gt;
&lt;br /&gt;</description><link>http://fromgus.blogspot.com/2009/05/combinatoria.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4889084301582708309.post-1698154545752447959</guid><pubDate>Mon, 25 May 2009 20:10:00 +0000</pubDate><atom:updated>2009-05-28T19:58:21.206-03:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">factorial</category><category domain="http://www.blogger.com/atom/ns#">python</category><category domain="http://www.blogger.com/atom/ns#">ruby</category><title>Factorial</title><description>&lt;span style=&quot;color: rgb(51, 204, 0); font-size: 130%;&quot;&gt;&lt;span
style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Ruby:&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;
#factorial de 8&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;(1..8).&lt;/span&gt;&lt;span
style=&quot;color: rgb(204, 0, 0);&quot;&gt;inject&lt;/span&gt;&lt;span
style=&quot;color: rgb(0, 0, 0);&quot;&gt;{|x,y| x*y}&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
Python 2.5:
&lt;span style=&quot;color: rgb(255, 255, 102);&quot;&gt;&lt;span
style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;
def fact(x):&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; a = 1&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(1,x+1):&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = a*i&lt;/span&gt;
&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return a&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 255, 51); font-size: 130%;&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
Python 2.6:&lt;/span&gt;&lt;span style=&quot;font-size: 130%;&quot;&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 255, 102); font-size: 130%;&quot;&gt; &lt;span
style=&quot;color: rgb(0, 0, 0);&quot;&gt;import math&lt;/span&gt;&lt;/span&gt;&lt;span
style=&quot;font-size: 130%;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-size: 130%;&quot;&gt;&lt;br /&gt;
math.factorial(8)&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;</description><link>http://fromgus.blogspot.com/2009/05/factorial.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item></channel></rss>