<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>auraham</title>
	<atom:link href="http://auraham.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://auraham.wordpress.com</link>
	<description>mi chocoblog n_n&#039;</description>
	<lastBuildDate>Wed, 25 Jan 2012 21:57:57 +0000</lastBuildDate>
	<language>es</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='auraham.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>auraham</title>
		<link>http://auraham.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://auraham.wordpress.com/osd.xml" title="auraham" />
	<atom:link rel='hub' href='http://auraham.wordpress.com/?pushpress=hub'/>
		<item>
		<title>C/C++ Punteros</title>
		<link>http://auraham.wordpress.com/2012/01/13/cc-punteros/</link>
		<comments>http://auraham.wordpress.com/2012/01/13/cc-punteros/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 21:07:49 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c/c++]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=688</guid>
		<description><![CDATA[El siguiente programa muestra el valor de una variable entera y su dirección en memoria. Filed under: C#, c/c++<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=688&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>El siguiente programa muestra el valor de una variable entera y su dirección en memoria.</p>
<p><pre class="brush: cpp;">
/*
| Programa 1 c
| Muestra el valor de la variable n
| y su direccion
|
| gcc ejemplo_1.cpp -o salida
|
| Salida:
| n = 75
| &amp;n = 0xbfc4250c
|
| Notas:
| En la linea 
|	printf(&quot;&amp;n= %p \n&quot;, &amp;n);
| Se utiliza %p para imprimir la direccion del puntero, 
| en este caso, la direccion de n
*/

#include &lt;stdio.h&gt;

int main()
{
	int n = 75;
	printf(&quot;n = %d \n&quot;, n);
	printf(&quot;&amp;n= %p \n&quot;, &amp;n);

	return 0;
}
</pre></p>
<p><pre class="brush: cpp;">
/*
| Programa 1 c++
| Muestra el valor de la variable n
| y su direccion
|
| g++ ejemplo_1.cpp -o salida
|
| Salida:
| n = 75
| &amp;n = 0xbfd283fc
|
| Notas:
| La forma correcta de incluir la libreria es
| #include &lt;iostream&gt;
| no
| #include &lt;iostream.h&gt;
|
| Recuerda, cout solo se puede usar si incluyes iostream
*/

#include &lt;iostream&gt;

using namespace std;

int main()
{
	int n = 75;
	cout&lt;&lt;&quot;n = &quot;&lt;&lt;n&lt;&lt;endl;
	cout&lt;&lt;&quot;&amp;n = &quot;&lt;&lt;&amp;n&lt;&lt;endl;

	return 0;
}
</pre></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/c/'>C#</a>, <a href='http://auraham.wordpress.com/category/cc/'>c/c++</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/688/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/688/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/688/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=688&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2012/01/13/cc-punteros/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>How to select rows in a time interval in sql server</title>
		<link>http://auraham.wordpress.com/2012/01/02/how-to-select-rows-in-a-time-interval-in-sql-server/</link>
		<comments>http://auraham.wordpress.com/2012/01/02/how-to-select-rows-in-a-time-interval-in-sql-server/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 06:45:06 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=677</guid>
		<description><![CDATA[Happy new year to all! This will be my first post for this year. Recently, I was looking for a way to select rows in a time interval. After looking, I found this blog with a lot of examples and then, I ran to execute them in sqlcmd. Here are my tests, I hope these [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=677&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Happy new year to all! This will be my first post for this year. Recently, I was looking for a way to select rows in<br />
a time interval. After looking, I found this <a href="http://pratchev.blogspot.com/2007/04/dates-and-date-ranges-in-sql-server.html" title="zen of sql" target="_blank">blog</a> with a lot of examples and then, I ran to execute them in sqlcmd. Here are my tests, I hope these are useful.</p>
<p><strong>Current time</strong><br />
<pre class="brush: sql;">
select current_timestamp
go
-- output
2012-01-02 00:51:22.660
</pre></p>
<p><strong>DATEADD</strong><br />
Returns a specified date with the number interval (signed integer) added to a specified datepart of that date.</p>
<p><code>DATEADD(datepart, number, date)</code></p>
<p>Some dateparts are year (yy, yyyy), month (m,mm), day (d,dd), hour (hh), minute (mi,n), second (ss,s), millisecond (ms), etc.</p>
<p>Get years<br />
<pre class="brush: sql;">
SELECT DATEADD(YEAR, -1, CURRENT_TIMESTAMP) AS previous_year,
DATEADD(YEAR,0,CURRENT_TIMESTAMP) AS present_year
DATEADD(YEAR,1,CURRENT_TIMESTAMP) AS next_year
GO

-- output
2011-01-02 01:10:24.733 -- previous year
2012-01-02 01:10:24.733 -- present year
2013-01-02 01:10:24.733 -- next year
</pre></p>
<p>More info:<br />
<a href="http://pratchev.blogspot.com/2007/04/dates-and-date-ranges-in-sql-server.html" target="_blank">Zen of SQL</a><br />
<a href="http://msdn.microsoft.com/en-us/library/ms186819.aspx" target="_blank">Date and Time functions (Transact-SQL)</a></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/sql-server/'>SQL Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/677/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/677/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/677/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=677&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2012/01/02/how-to-select-rows-in-a-time-interval-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>Los números de 2011</title>
		<link>http://auraham.wordpress.com/2011/12/31/los-numeros-de-2011/</link>
		<comments>http://auraham.wordpress.com/2011/12/31/los-numeros-de-2011/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 01:44:39 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=675</guid>
		<description><![CDATA[Los duendes de las estadísticas de WordPress.com prepararon un reporte para el año 2011 de este blog. Aqui es un extracto Un teleférico de San Francisco puede contener 60 personas. Este blog fue visto por 2.100 veces en 2011. Si el blog fue un teleférico, se necesitarían alrededor de 35 viajes para llevar tantas personas. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=675&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Los duendes de las estadísticas de WordPress.com prepararon un reporte para el año 2011 de este blog.</p>
<div style="background:url('/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg') no-repeat center center;height:300px;"></div>
<p>Aqui es un extracto</p>
</p>
<blockquote><p>Un teleférico de San Francisco puede contener  60 personas.  Este blog fue visto por <strong>2.100</strong> veces en 2011.  Si el blog fue un teleférico, se necesitarían alrededor de 35 viajes para llevar tantas personas.</p></blockquote>
<p><a href="/2011/annual-report/">Haz click para ver el reporte completo.</a></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/general/'>General</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/675/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/675/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/675/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=675&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/12/31/los-numeros-de-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>todo list</title>
		<link>http://auraham.wordpress.com/2011/12/17/todo-list/</link>
		<comments>http://auraham.wordpress.com/2011/12/17/todo-list/#comments</comments>
		<pubDate>Sat, 17 Dec 2011 07:49:28 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[todo_list]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=664</guid>
		<description><![CDATA[Programación VHDL Hace unos meses escuché el concepto por primera vez. Si mal no recuerdo, Benjamín programaba en vhdl para su proyecto de maestría. Se trataba de un perro robot. En ese momento me pareció interesante. Leer El libro del dragón En el verano tuve la oportunidad de conocer a un doctor en una estancia. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=664&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<ul>
<strong>Programación VHDL</strong><br />
Hace unos meses escuché el concepto por primera vez. Si mal no recuerdo, Benjamín programaba en vhdl para su proyecto de maestría. Se trataba de un perro robot. En ese momento me pareció interesante.
</ul>
<ul><div id="attachment_668" class="wp-caption aligncenter" style="width: 329px"><a href="http://auraham.files.wordpress.com/2011/12/compiler_large.gif"><img src="http://auraham.files.wordpress.com/2011/12/compiler_large.gif" alt="" title="compiler_large" width="319" height="475" class="size-full wp-image-668" /></a><p class="wp-caption-text">El libro del dragón</p></div><strong>Leer El libro del dragón</strong><br />
En el verano tuve la oportunidad de conocer a un doctor en una estancia. Entre muchas otras cosas, nos habló sobre el <a href="http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools" title="libro del dragón" target="_blank">libro del dragón</a>. En realidad el libro se llama Compilers:Principles, techniques, and tools, pero se le conoce de esta forma por su portada, un caballero medieval frente a un dragón rojo.
</ul>
<ul>
<strong>Más programación</strong><br />
¿Qué son los punteros a funciones?<br />
¿Cómo funciona el stack y el heap?<br />
¿scala, scheme, haskell, lenguajes funcionales?<br />
¿usar android y c para saltar la maquina virtual y acceder al hardware del telefono?
</ul>
<ul><strong>Paradigmas y algoritmos</strong><br />
Distancias de edicion (en programación dinámica)<br />
Colonia de hormigas<br />
algoritmo matrimonios estables o perfectos
</ul>
<ul>
<a href="http://auraham.files.wordpress.com/2011/12/bioloid_02.gif"><img src="http://auraham.files.wordpress.com/2011/12/bioloid_02.gif" alt="" title="Bioloid_02" width="720" height="447" class="aligncenter size-full wp-image-671" /></a><br />
<strong>Bioloid</strong><br />
No soy fan de la robótica, pero ver un robot como este es fascinante y más cuando funciona bien.
</ul>
<ul><strong>How to design programs</strong><br />
El <a href="http://www.htdp.org/" title="site" target="_blank">título</a> lo dice todo.
</ul>
<br />Filed under: <a href='http://auraham.wordpress.com/category/todo_list/'>todo_list</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/664/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/664/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/664/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=664&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/12/17/todo-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>

		<media:content url="http://auraham.files.wordpress.com/2011/12/compiler_large.gif" medium="image">
			<media:title type="html">compiler_large</media:title>
		</media:content>

		<media:content url="http://auraham.files.wordpress.com/2011/12/bioloid_02.gif" medium="image">
			<media:title type="html">Bioloid_02</media:title>
		</media:content>
	</item>
		<item>
		<title>C# y Excel: Cómo leer un rango de celdas</title>
		<link>http://auraham.wordpress.com/2011/11/10/c-y-excel-como-leer-un-rango-de-celdas/</link>
		<comments>http://auraham.wordpress.com/2011/11/10/c-y-excel-como-leer-un-rango-de-celdas/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 06:07:31 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=657</guid>
		<description><![CDATA[Fuente: CSharp DotNetPerls Filed under: C#<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=657&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: cpp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Excel = Microsoft.Office.Interop.Excel;

namespace my_excel
{
    class Program
    {
        static void Main(string[] args)
        {
            // archivo de entrada
            string file = &quot;libro.xls&quot;;
            string dir = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            string xlsFilePath = Path.Combine(dir, file);

            read_file(xlsFilePath);

            Console.ReadKey();
            
            
        }

        public static void read_file(string xlsFilePath)
        {
            if (!File.Exists(xlsFilePath))
                return;

            Excel.Application xlApp;
            Excel.Workbook xlWorkBook;
            Excel.Worksheet xlWorkSheet;
            Excel.Range range;
            var misValue = Type.Missing;//System.Reflection.Missing.Value;

            // abrir el documento
            xlApp = new Excel.ApplicationClass();
            xlWorkBook = xlApp.Workbooks.Open(xlsFilePath, misValue, misValue,
                misValue, misValue, misValue, misValue, misValue, misValue,
                misValue, misValue, misValue, misValue, misValue, misValue);

            // seleccion de la hoja de calculo
            // get_item() devuelve object y numera las hojas a partir de 1
            xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);

            // seleccion rango activo
            range = xlWorkSheet.UsedRange;


            // leer las celdas
            int rows = range.Rows.Count;
            int cols = range.Columns.Count;


            for (int row = 1; row &lt;= rows; row++)
            {
                for (int col = 1; col &lt;= cols; col++)
                {

                    // lectura como cadena
                    string str_value = (range.Cells[row, col] as Excel.Range).Value2.ToString();

                    // conversion
                    int int_value = Convert.ToInt32(str_value, 10);

                    Console.WriteLine(&quot;string:{0}&quot;, str_value);
                    Console.WriteLine(&quot;int:{0}&quot;, int_value);
                }


            }


            // cerrar
            xlWorkBook.Close(false, misValue, misValue);
            xlApp.Quit();

            // liberar
            releaseObject(xlWorkSheet);
            releaseObject(xlWorkBook);
            releaseObject(xlApp);

        }


        public static void releaseObject(object obj) 
        {
            try
            {
                System.Runtime.InteropServices.Marshal.ReleaseComObject(obj);
                obj = null;
            }
            catch (Exception ex)
            {
                Console.WriteLine(&quot;Unable to release the object(object:{0})&quot;, obj.ToString());
            }
            finally 
            {
                obj = null;
                GC.Collect();
            }
        }
    }
}

</pre></p>
<p>Fuente:<br />
<a href="http://csharp.net-informations.com/excel/csharp-read-excel.htm" title="csharp" target="_blank">CSharp</a><br />
<a href="http://www.dotnetperls.com/excel" title="dot net perls" target="_blank">DotNetPerls</a></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/c/'>C#</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/657/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/657/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/657/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=657&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/11/10/c-y-excel-como-leer-un-rango-de-celdas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>Python: Cifrado por sustitución simple monoalfabética ó Cifrado César</title>
		<link>http://auraham.wordpress.com/2011/10/02/python-cifrado-por-sustitucion-simple-monoalfabetica-o-cifrado-cesar/</link>
		<comments>http://auraham.wordpress.com/2011/10/02/python-cifrado-por-sustitucion-simple-monoalfabetica-o-cifrado-cesar/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 21:58:59 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[cifrado]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=642</guid>
		<description><![CDATA[El cifrado de César es un tipo de cifrado simple que se basa en el uso de un sólo alfabeto, por lo regular, ordenado. Se emplea una llave para realizar la sustitución. Por ejemplo, si la llave vale 1 y el mensaje es &#8216;A&#8217;, entonces, el mensaje cifrado será &#8216;B&#8217;, y así sucesivamente. A diferencia [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=642&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>El cifrado de César es un tipo de cifrado simple que se basa en el uso de un sólo alfabeto, por lo regular, ordenado. Se emplea una llave para realizar la sustitución. Por ejemplo, si la llave vale 1 y el mensaje es &#8216;A&#8217;, entonces, el mensaje cifrado será &#8216;B&#8217;, y así sucesivamente. </p>
<p>A diferencia de otros algoritmos, como el de Vigenére, se emplea una sola llave para cifrar todo el mensaje.</p>
<p>Para saber más sobre el método de César, este es un libro excelente <a href="http://www.hxmel.com/Book/book.htm" title="Cryptography Decrypted" target="_blank">Cryptography Decrypted</a></p>
<p><strong>Implementación</strong><br />
Vamos a crear cuatro funciones para el algoritmo:</p>
<ul>
<li>get_alphabet()</li>
<li>get_index()</li>
<li>crypt()</li>
<li>decrypt()</li>
</ul>
<p>La función get_alphabet() devolverá una lista con todos los elementos del alfabeto y otros, como números lo que se desee agregar.<br />
<pre class="brush: python;">
def get_alphabet():
	&quot;&quot;&quot;Devuelve una lista con mayusculas, minuscula, numeros y un espacio&quot;&quot;&quot;
	alphabet = []

	# mayusculas:65-90
	for i in range(65,91):
		alphabet.append(chr(i))

	# minusculas:97-122
	for i in range(97,123):
		alphabet.append(chr(i))

	# numeros
	for i in range(10):
		alphabet.append(str(i))

	# espacio
	#alphabet.append(&quot; &quot;)

	return alphabet

</pre></p>
<p>La función get_index() se usa para validar la llave. En nuestro caso el alfabeto consta de 62 elementos (length), por lo que nuestro índice máximo (max_index) dentro de la lista es de 61 y el índice mínimo (min_index) es 0. Para que un índice sea válido, debe estar en este rango. </p>
<p>En teoría, el algoritmo sólo sirve para un cierto valor de llaves. En un alfabeto de 25 elementos, habrá un máximo de 25 llaves distintas, ya que después se repetirán los valores, es decir, si la llave vale 26, producirá el mismo cifrado que la llave con valor de 1.</p>
<p><pre class="brush: python;">
def get_index(index = 0, length = 0):
	&quot;&quot;&quot;Devuelve un indice valido dentro de un rango, evitando desbordamiento&quot;&quot;&quot;
	
	min_index = 0			# indice minimo
	max_index = length - 1		# indice maximo = longitud - 1

	while True:
		
		# index excede el limite superior
		if index &gt; max_index:
			index -= length

		# index es menor al limite inferior
		elif index &lt; min_index:
			index += length
			
		# index es valido
		else:
			break

	return index
</pre></p>
<p>La función crypt() recibe dos parámetros, el mensaje a cifrar y la llave. Inicia con la declaración de variables. Enseguida, recorre cada letra del mensaje. Si la letra se encuentra dentro de alphabet, se devolverá su índice dentro de la lista. Sino es así, letter no existe dentro de alphabet, provocando una excepción y continuando con la siguiente letra.</p>
<p>La sustitución se realiza de esta forma. Se incrementa index el valor de key y se guarda en move. Si move no fuese un índice válido se evaluará con get_index(). Por ejemplo, si move vale 63 excede el valor de max_index, por lo que se devolverá 1.</p>
<p>Por último se agrega el elemento de alphabet en la posición move al crypted.</p>
<p><pre class="brush: python;">
def crypt(message = &quot;&quot;, key = 0):
	&quot;&quot;&quot;Cifra un mensaje usando sustitucion&quot;&quot;&quot;
	
	crypted = &quot;&quot;			# mensaje cifrado

	alphabet = get_alphabet()	# alfabeto
	length = len(alphabet) 		# longitud del alfabeto
	index = 0			# indice de la letra en el alfabeto

	for letter in message:

		# se obtiene el indice de letter dentro de alphabet, si existe
		try:		
			index = alphabet.index(letter)	# indice dentro del alfabeto
		except:
			print &quot;No existe %s en el alfabeto&quot; % (letter,)
			continue


		# se obtiene la nueva posicion, evitando desbordamiento
		move = index + key		# nueva posicion
		move = get_index(move,length)	
	
		# debug
		if debug:
			print &quot;move %d&quot;%(move,)

		crypted += alphabet[move]	# agrega la letra al mensaje cifrado

		#debug
		if debug:
			print &quot;%s = %s&quot; % (alphabet[index],alphabet[move])

	return crypted
</pre></p>
<p>La función decrypt() es similar a la anterior, pero en lugar de incrementar el valor de key, se decrementa.</p>
<p><pre class="brush: python;">
def decrypt(message = &quot;&quot;, key = 0):
	&quot;&quot;&quot;Decifra un mensaje usando sustitucion&quot;&quot;&quot;
	
	decrypted = &quot;&quot;			# mensaje decifrado

	alphabet = get_alphabet()	# alfabeto
	length = len(alphabet)		# longitud del alfabeto
	index = 0

	for letter in message:

		try:
			index = alphabet.index(letter)	# indice dentro del alfabeto
		except:
			print &quot;No existe %s en el alfabeto&quot; % (letter,)
			continue		

		move = index - key		# nueva posicion
		move = get_index(move,length)

		# debug
		if debug:
			print &quot;move %d&quot;%(move,)


		decrypted += alphabet[move]	# agrega al mensaje decifrado
		
		#debug
		if debug:
			print &quot;%s = %s&quot; % (alphabet[index],alphabet[move])

	return decrypted
</pre></p>
<p>Por último, este es todo el código. Al final, se manda llamar la función crypted() y se imprime el mensaje cifrado.</p>
<p><pre class="brush: python;">
#!/usr/bin/python

debug = False

# Cifrado por sustitucion

def get_alphabet():
	&quot;&quot;&quot;Devuelve una lista con mayusculas, minuscula, numeros y un espacio&quot;&quot;&quot;
	alphabet = []

	# mayusculas:65-90
	for i in range(65,91):
		alphabet.append(chr(i))

	# minusculas:97-122
	for i in range(97,123):
		alphabet.append(chr(i))

	# numeros
	for i in range(10):
		alphabet.append(str(i))

	# espacio
	#alphabet.append(&quot; &quot;)

	return alphabet
	

def get_index(index = 0, length = 0):
	&quot;&quot;&quot;Devuelve un indice valido dentro de un rango, evitando desbordamiento&quot;&quot;&quot;
	
	min_index = 0			# indice minimo
	max_index = length - 1		# indice maximo = longitud - 1

	while True:
		
		# index excede el limite superior
		if index &gt; max_index:
			index -= length

		# index es menor al limite inferior
		elif index &lt; min_index:
			index += length
			
		# index es valido
		else:
			break

	return index	




def crypt(message = &quot;&quot;, key = 0):
	&quot;&quot;&quot;Cifra un mensaje usando sustitucion&quot;&quot;&quot;
	
	crypted = &quot;&quot;			# mensaje cifrado

	alphabet = get_alphabet()	# alfabeto
	length = len(alphabet) 		# longitud del alfabeto
	index = 0			# indice de la letra en el alfabeto

	for letter in message:

		# se obtiene el indice de letter dentro de alphabet, si existe
		try:		
			index = alphabet.index(letter)	# indice dentro del alfabeto
		except:
			print &quot;No existe %s en el alfabeto&quot; % (letter,)
			continue


		# se obtiene la nueva posicion, evitando desbordamiento
		move = index + key		# nueva posicion
		move = get_index(move,length)	
	
		# debug
		if debug:
			print &quot;move %d&quot;%(move,)

		crypted += alphabet[move]	# agrega la letra al mensaje cifrado

		#debug
		if debug:
			print &quot;%s = %s&quot; % (alphabet[index],alphabet[move])

	return crypted


def decrypt(message = &quot;&quot;, key = 0):
	&quot;&quot;&quot;Decifra un mensaje usando sustitucion&quot;&quot;&quot;
	
	decrypted = &quot;&quot;			# mensaje decifrado

	alphabet = get_alphabet()	# alfabeto
	length = len(alphabet)		# longitud del alfabeto
	index = 0

	for letter in message:

		try:
			index = alphabet.index(letter)	# indice dentro del alfabeto
		except:
			print &quot;No existe %s en el alfabeto&quot; % (letter,)
			continue		

		move = index - key		# nueva posicion
		move = get_index(move,length)

		# debug
		if debug:
			print &quot;move %d&quot;%(move,)


		decrypted += alphabet[move]	# agrega al mensaje decifrado
		
		#debug
		if debug:
			print &quot;%s = %s&quot; % (alphabet[index],alphabet[move])

	return decrypted


# inicio
print &quot;Cifrado por sustitucion&quot;
print &quot;Mensaje:&quot;
message = raw_input()

print &quot;Llave:&quot;
key = int(raw_input())

# mensaje cifrado
crypted = crypt(message,key)
print crypted
	
</pre></p>
<p>Ejemplos<br />
<pre class="brush: bash;">
# key = 1
auraham@machine:~/projects/python$ python -i cifrar_sustitucion.py 
Cifrado por sustitucion
Mensaje:
hola
Llave:
1
ipmb
</pre></p>
<p><pre class="brush: bash;">
# key = 62, tiene el mismo efecto de key = 0, es decir, no cifra
auraham@machine:~/projects/python$ python -i cifrar_sustitucion.py 
Cifrado por sustitucion
Mensaje:
hola
Llave:
62
hola

</pre></p>
<p><pre class="brush: python;">
# key = 63, tiene el mismo efecto que key = 1
auraham@machine:~/projects/python$ python -i cifrar_sustitucion.py 
Cifrado por sustitucion
Mensaje:
hola
Llave:
63
ipmb

</pre></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/cifrado/'>cifrado</a>, <a href='http://auraham.wordpress.com/category/python/'>python</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/642/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=642&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/10/02/python-cifrado-por-sustitucion-simple-monoalfabetica-o-cifrado-cesar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>Python: Mutables</title>
		<link>http://auraham.wordpress.com/2011/09/30/python-mutables/</link>
		<comments>http://auraham.wordpress.com/2011/09/30/python-mutables/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 05:35:09 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=638</guid>
		<description><![CDATA[Fuente: Python para todos Filed under: python<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=638&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: python;">
#!/usr/bin/python

# Mutables e inmutables (personal)
# Las listas y los diccionarios son mutables porque es posible modificar sus elementos
# aun despues de haber sido definidos

# definicion
lista = [1,2,3]
print lista

# modificacion
lista[0] = &quot;modificado&quot;
print lista

# definicion
dic = {&quot;uno&quot;:1, &quot;dos&quot;:2}
print dic

# modificacion
dic[&quot;uno&quot;] = &quot;modificado&quot;
print dic

# Las tuplas en cambio, son inmutables, ya que no es posible modificar sus elementos
# despues de hacer sido definidos

# definicion
tupla = (1,2,3)
print tupla

# no se podra modificar y mostrara este error
# TypeError: 'tuple' object does not support item assigment
tupla[0] = &quot;no se puede modificar, mostrando un error&quot;
</pre></p>
<p><a href="http://mundogeek.net/tutorial-python/" title="python para todos">Fuente:<br />
Python para todos</a></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/python/'>python</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/638/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/638/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/638/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=638&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/09/30/python-mutables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>Python: Funciones</title>
		<link>http://auraham.wordpress.com/2011/09/30/python-funciones/</link>
		<comments>http://auraham.wordpress.com/2011/09/30/python-funciones/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 05:31:10 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=634</guid>
		<description><![CDATA[Fuente Python para todos Filed under: python<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=634&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: python;">
#!/usr/bin/python 

# Funciones
# Una funcion es un fragmento de codigo con un nombre asociado
# que realiza una serie de tareas y devuelve un valor.
# 
# Un procedimiento es similar a la funcion, pero no devuelve valor.
# 
# En Python no existen los procedimientos, ya que cuando no se especifica
# un valor de retorno, se devuelve None
# 
# def function_name(params):
#	&quot;&quot;&quot;docstring&quot;&quot;&quot;
#	...
# 
# Para mostrar la ayuda de la funcion, el docstring, usa
# help(function_name)
# 
# Para salir usa q
# 


def mi_funcion(param1, param2):
	&quot;&quot;&quot;imprime dos valores&quot;&quot;&quot;
	print param1
	print param2


# Mostrar ayuda
help(mi_funcion)

# Llamada a la funcion
# 1
# 2
print &quot;llamada a la funcion&quot;
mi_funcion(1,2)

# Para no cerrar el interprete al terminar el programa, usa
#	python -i script.py
# 
#
# Valores por defecto
# Cuando se manda llamar una funcion se debe pasar el numero 
# de parametros de acuerdo a la declaracion de la funcion, sino se mostrara
# un error. Por ejemplo, al pasar solo un parametro, se mostrara
# TypeError: mi_funcion() takes exactly 2 arguments (1 given)
#
# Se puede evitar eso colocando valores por defecto en los parametros
def otra_funcion(param1 = &quot;param1&quot;, param2 = &quot;param2&quot;):
	print param1
	print param2

# Llama a la funcion con solo un parametro
# un parametro
# param2
print &quot;parametros por defecto&quot;
otra_funcion(&quot;un parametro&quot;)


# Cambio de orden
# Es posible cambiar el orden de los valores en los parametros
# indicando el nombre del parametro al momento de llamar a la funcion
# 
# param 2
# param 1
print &quot;cambio de orden&quot;
otra_funcion(param2 = &quot;param 1&quot;, param1 = &quot;param 2&quot;)


# Multiples parametros
# Se pueden pasar un numero variable de argumentos antecediendo un *
# al parametro en la definicion
# Se crea una tupla llamada parametros en la funcion indefinidos
def funcion_lista(*parametros):
	for item in parametros:
		print item

# Llamada a la funcion
# 1
# 2
# 3
# 4
print &quot;lista de parametros&quot;
funcion_lista(1,2,3,4)

# Tambien es posible usar ** antes de la definicion del parametro
# creando un diccionario. Al momento de llamar a la funcion se deben
# pasar los valores en pares, (key, value) para cada elemento del diccionario
# 
# Para mostrar los valores (y no las llaves) del diccionario se usa la el metodo items()
def funcion_diccionario(**params):
	for item in params.items():
		print item

# Llamada a la funcion
print &quot;diccionario de parametros&quot;
funcion_diccionario(param1 = &quot;param 1&quot;, param2 = &quot;param 2&quot;, param3 = &quot;param 3&quot;)
</pre></p>
<p>Fuente<br />
<a href="http://mundogeek.net/tutorial-python/" title="python para todos" target="_blank">Python para todos</a></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/python/'>python</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/634/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/634/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/634/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=634&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/09/30/python-funciones/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>Python: Condicional</title>
		<link>http://auraham.wordpress.com/2011/09/30/python-condicional/</link>
		<comments>http://auraham.wordpress.com/2011/09/30/python-condicional/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 05:29:09 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=632</guid>
		<description><![CDATA[Filed under: python<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=632&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: python;">
#!/usr/bin/python

# condicional

cadena = &quot;arenita&quot;

if cadena == &quot;arenita&quot;:
	print(&quot;es una ardilla&quot;)	# es una ardilla
elif cadena == &quot;bob&quot;:
	print(&quot;es una esponja&quot;)
else:
	print(&quot;mmmm no se que es :p&quot;)

# A if C else B
# se evalua C y devuelve 
# A si es correcto
# B si no es correcto
numero = 10
par = True if (numero %2 == 0) else False

print(numero)		# True
</pre></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/python/'>python</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/632/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/632/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=632&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/09/30/python-condicional/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
		<item>
		<title>Python: Diccionarios</title>
		<link>http://auraham.wordpress.com/2011/08/26/python-diccionarios/</link>
		<comments>http://auraham.wordpress.com/2011/08/26/python-diccionarios/#comments</comments>
		<pubDate>Sat, 27 Aug 2011 02:44:38 +0000</pubDate>
		<dc:creator>auraham</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://auraham.wordpress.com/?p=628</guid>
		<description><![CDATA[Filed under: python<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=628&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><pre class="brush: python;">
#!/usr/bin/python

# Diccionarios
# O tambien matrices asociativas, contienen pares de la forma {key:value}

d = {&quot;bob&quot;:&quot;esponja&quot;,&quot;patricio&quot;:&quot;estrella&quot;,&quot;calamardo&quot;:&quot;tentaculos&quot;}
print(d)		# {'bob':'esponja','patricio':'estrella','calamardo':'tentaculos'}

# Donde key es cualquier valor inmutable, como numeros, cadenas, boleanos, tuplas
# pero no listas o diccionarios, los cuales son mutables.
#
# NOTA PERSONAL: Las tuplas no son mutables porque una vez definidas no se pueden modificar 
# sus elementos. Las listas y diccionarios son mutables porque se pueden modificar sus elementos
# aun despues de ser definidos. Vease mutables.py
#
# Esto es asi porque los diccionarios se implementan como tablas hash
# y cuando se inserta un nuevo par key:value se calcula el hash de key para
# despues encontrarlo rapidamente.
# Si se cambiara el valor de key, tambien cambiaria el hash, por lo que no se podria
# encontrar el par

# para acceder a los elementos no se usa un indice (porque no estan ordenados)
# sino que se usa el valor de key dentro del operador []
print(d[&quot;bob&quot;])		# esponja

# al igual que las listas, (pero no las tuplas, pag 26)
# se pueden editar con el operador []
d[&quot;bob&quot;] = False
print(d[&quot;bob&quot;])		# False

# pero no se puede usar slicing, entre otras cosas, debido a que
# los diccionarios no son secuencias, sino mappings (mapeados o asociaciones)



# Recorrido de un diccionario
# Se puede usar el ciclo for in de varias formas, dependiendo de lo que se
# se desee usar, la llave o el valor 
dic = {&quot;key_1&quot;:1,&quot;key_2&quot;:2,&quot;key_3&quot;:3}

# Mostrar solo llaves
# Se recorre de manera normal
print &quot;Mostrar solo llaves&quot;
for item in dic:
	print item		# key_1

# Mostrar el par de llave y valor
# Para recuperar el valor, se usa el metodo items(), propio 
# de los diccionarios, el cual devuelve una tupla por cada par 
print &quot;Mostra llaves y valores&quot;
for item in dic.items():
	print item		# ('key_1',1)
	print type(item)	# &lt;type 'tuple'&gt;
	print &quot;key:&quot; + item[0] + &quot;,value:&quot; + str(item[1])
</pre></p>
<br />Filed under: <a href='http://auraham.wordpress.com/category/python/'>python</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/auraham.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/auraham.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/auraham.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/auraham.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/auraham.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/auraham.wordpress.com/628/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/auraham.wordpress.com/628/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/auraham.wordpress.com/628/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=auraham.wordpress.com&amp;blog=2874609&amp;post=628&amp;subd=auraham&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://auraham.wordpress.com/2011/08/26/python-diccionarios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f3d23592d5efd1a25410c7d2f0d7f5c6?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">auraham</media:title>
		</media:content>
	</item>
	</channel>
</rss>
