<?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/"
	>

<channel>
	<title>{ Radamanthys }</title>
	<atom:link href="http://radamanthys.homelinux.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://radamanthys.homelinux.org</link>
	<description>echte männer nicht klicken</description>
	<pubDate>Fri, 24 Apr 2009 01:47:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Obtener un arreglo sin valores duplicados</title>
		<link>http://radamanthys.homelinux.org/?p=169</link>
		<comments>http://radamanthys.homelinux.org/?p=169#comments</comments>
		<pubDate>Fri, 24 Apr 2009 01:43:45 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=169</guid>
		<description><![CDATA[Buscando la forma mas simple de generar un arreglo a partir de otro, pero sin tomar en cuenta los valores repetidos de este ultimo, siempre me topaba con  array_unique().

print_r&#40;array_unique&#40;$orders&#41;&#41;;


Array
&#40;
    &#91;0&#93; =&#62; 135
    &#91;2&#93; =&#62; 136
    &#91;3&#93; =&#62; 138
&#41;

Que si bien es cierto, me devolvia un [...]]]></description>
			<content:encoded><![CDATA[<p>Buscando la forma mas simple de generar un arreglo a partir de otro, pero sin tomar en cuenta los valores repetidos de este ultimo, siempre me topaba con  array_unique().</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000066;">print_r</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">array_unique</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$orders</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000066;">Array</span>
<span style="color: #66cc66;">&#40;</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">135</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">136</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">138</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Que si bien es cierto, me devolvia un arreglo con valores unicos, aun me faltaba regenerar el indice(necesitaba que iniciara de 0 en incrementara en 1).</p>
<p>Al final, me tope con esta <a href="http://www.php.net/manual/es/function.array-unique.php#85320">forma</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000066;">print_r</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">array_keys</span><span style="color: #66cc66;">&#40;</span><span style="color: #000066;">array_count_values</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$orders</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Donde $orders es un arreglo compuesto de la sgte. forma:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #0000ff;">$orders</span> = <span style="color: #000066;">array</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'135'</span>, <span style="color: #ff0000;">'135'</span>, <span style="color: #ff0000;">'136'</span>, <span style="color: #ff0000;">'138'</span>, <span style="color: #ff0000;">'138'</span>, <span style="color: #ff0000;">'138'</span>, <span style="color: #ff0000;">'136'</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Lo que sucede aqui, es que array_count_values($orders) me duvuelve un arreglo, con un <strong>indice</strong>, el cual sera cada valor encontrado en $orders y su correspondiente <strong>valor</strong> sera la cantidad de ocurriencias encontradas, es decir:</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000066;">Array</span>
<span style="color: #66cc66;">&#40;</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">135</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">2</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">136</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">2</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">138</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">3</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Posteriormente, le paso este nuevo arreglo a array_keys(), quien me generara otro nuevo arreglo, con indice numerico, inicializado a partir de cero, que incrementara en 1, y su valor seria cada clave(indice) del arreglo pasado como paremetro (lo que realmente necesitaba).</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000066;">Array</span>
<span style="color: #66cc66;">&#40;</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">135</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">136</span>
    <span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span> =&gt; <span style="color: #cc66cc;">138</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=169</wfw:commentRss>
		</item>
		<item>
		<title>Howto: Instalar Sibu en memoria flash USB</title>
		<link>http://radamanthys.homelinux.org/?p=163</link>
		<comments>http://radamanthys.homelinux.org/?p=163#comments</comments>
		<pubDate>Fri, 20 Feb 2009 17:22:45 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=163</guid>
		<description><![CDATA[
cstrife, miembro desarrollador de Sibu ha creado un tuto, sobre como instalar Sibu Ubuntu en una memoria flash USB. Para seguir este metodo se necesita cargar el Live DVD de Sibu(recomendablemente la version 2.0.2).
El tuto esta disponible en formato odt y pdf para descarga :
 sibu_instalacion_usb.odt ( 1.3 MB ).
 sibu_instalacion_usb.pdf ( 741.3 KB ).
Mas [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://radamanthys.homelinux.org/wordpress/images/howto-sibu_usb.png"><img title="sibu" alt="sibu" src="http://radamanthys.homelinux.org/wordpress/images/thumbnail/tb_howto-sibu_usb.png" border="0" /></a></div>
<p><em><strong>cstrife</strong></em>, miembro desarrollador de Sibu ha creado un tuto, sobre como instalar Sibu Ubuntu en una memoria flash USB. Para seguir este metodo se necesita cargar el Live DVD de Sibu(recomendablemente la version 2.0.2).</p>
<p>El <em>tuto</em> esta disponible en formato odt y pdf para descarga :</p>
<p><a href="http://sibu.homelinux.org/wp-content/sibu_instalacion_usb.odt"> sibu_instalacion_usb.odt ( 1.3 MB )</a>.</p>
<p><a href="http://sibu.homelinux.org/wp-content/sibu_instalacion_usb.pdf"> sibu_instalacion_usb.pdf ( 741.3 KB )</a>.</p>
<p><strong>Mas Informacion:</strong><br />
<a target="_blank" title="sibu" href="http://sibuwiki.homelinux.org/index.php/Instalaci%C3%B3n_de_Sibu_Ubuntu#Instalaci.C3.B3n_en_memoria_flash_USB">http://sibuwiki.homelinux.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=163</wfw:commentRss>
		</item>
		<item>
		<title>Obteniendo la cantidad de digitos de un numero entero</title>
		<link>http://radamanthys.homelinux.org/?p=158</link>
		<comments>http://radamanthys.homelinux.org/?p=158#comments</comments>
		<pubDate>Sun, 15 Feb 2009 22:39:27 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=158</guid>
		<description><![CDATA[Asi podemos sacar la cantidad de digitos de un numer entero, sin contar el signo(puesto que lo evaluamos en funcion del valor absoluto).

int idig&#40;const int _int&#41;
&#123;
int i;
int d;
int n;
&#160;
   i = 1;
   d = 1;
&#160;
   /* solo nos interesa el valor absoluto */
   if &#40;_int &#60; 0&#41;
	n [...]]]></description>
			<content:encoded><![CDATA[<p>Asi podemos sacar la cantidad de digitos de un numer entero, sin contar el signo(puesto que lo evaluamos en funcion del valor absoluto).</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #993333;">int</span> idig<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">int</span> _int<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #993333;">int</span> i;
<span style="color: #993333;">int</span> d;
<span style="color: #993333;">int</span> n;
&nbsp;
   i = <span style="color: #cc66cc;">1</span>;
   d = <span style="color: #cc66cc;">1</span>;
&nbsp;
   <span style="color: #808080; font-style: italic;">/* solo nos interesa el valor absoluto */</span>
   <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>_int &lt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
	n = <span style="color: #66cc66;">&#40;</span>_int * <span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #b1b100;">else</span>
	n = _int;
&nbsp;
    <span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>n &gt;= <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span> * i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
    <span style="color: #66cc66;">&#123;</span>
	i = <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span> * i<span style="color: #66cc66;">&#41;</span>;
	d = <span style="color: #66cc66;">&#40;</span>d + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">return</span> d;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p><img src="http://radamanthys.homelinux.org/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=158</wfw:commentRss>
		</item>
		<item>
		<title>Sibu 2.0 v1 disponible para descarga</title>
		<link>http://radamanthys.homelinux.org/?p=154</link>
		<comments>http://radamanthys.homelinux.org/?p=154#comments</comments>
		<pubDate>Sun, 15 Feb 2009 22:19:20 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=154</guid>
		<description><![CDATA[
Se anuncia que ya esta disponible para descarga la version 2.0 v1 013009 de la distribucion costarricense Sibu.
La imagen del DVD Live(984 MB) de Sibu lo pueden bajar desde la seccion de descargas, el enlace directo es sibu-2.0-013009.iso.
La distribucion puede cargarse en modo Live o instalarse en el disco duro del modo tradicion al igual [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://radamanthys.homelinux.org/wordpress/images/pet_sibu.png"><img title="sibu" alt="sibu" src="http://radamanthys.homelinux.org/wordpress/images/thumbnail/tb_pet_sibu.png" border="0" /></a></div>
<p>Se anuncia que ya esta disponible para descarga la version 2.0 v1 013009 de la distribucion costarricense Sibu.</p>
<p>La imagen del DVD Live(984 MB) de Sibu lo pueden bajar desde la seccion de <a target="_blank" href="http://sibu.homelinux.org/index.php/descargas" title="descargas">descargas</a>, el enlace directo es <a target="_blank" href="http://www.pz.una.ac.cr/arturo/sibu-2.0-013009.iso" title="sibu 2.0 013009 (984 MB)">sibu-2.0-013009.iso</a>.</p>
<p>La distribucion puede cargarse en modo Live o instalarse en el disco duro del modo tradicion al igual que Ubuntu.</p>
<p><strong>Mas Informacion:</strong><br />
<a target="_blank" title="sibu" href="http://sibu.homelinux.org/index.php/sibu">http://sibu.homelinux.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=154</wfw:commentRss>
		</item>
		<item>
		<title>Busqueda y reemplazo de cadenas en C</title>
		<link>http://radamanthys.homelinux.org/?p=150</link>
		<comments>http://radamanthys.homelinux.org/?p=150#comments</comments>
		<pubDate>Fri, 13 Feb 2009 20:14:12 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[C/C++]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=150</guid>
		<description><![CDATA[
/*
 * Copyright (C) 2009 Moisés Brenes, http://mbrenes.blogspot.com
 *  
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/*
 * Copyright (C) 2009 Moisés Brenes, http://mbrenes.blogspot.com
 *  
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * Any non-GPL usage of this software or parts of this software is strictly
 * forbidden.
 */</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* @ shakka
 *
 * blog &gt; mbrenes.blogspot.com
 * web &gt; radamanthys.homelinux.org
 * mail &gt; moises.brenes@gmail.com
 */</span></pre></div></div>

<pre>
</pre>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
&nbsp;
<span style="color: #993333;">void</span> strReplace<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">char</span> *search, <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> *replace, <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> *from, <span style="color: #993333;">char</span> *to<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #993333;">char</span> *pstr;
<span style="color: #993333;">char</span> *buffer;
<span style="color: #993333;">int</span> top;
<span style="color: #993333;">int</span> i;
<span style="color: #993333;">int</span> j;
<span style="color: #993333;">int</span> k;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>search == <span style="color: #000000; font-weight: bold;">NULL</span> || replace == <span style="color: #000000; font-weight: bold;">NULL</span> || from == <span style="color: #000000; font-weight: bold;">NULL</span> || <span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>search<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> || <span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>replace<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> || <span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>from<span style="color: #66cc66;">&#41;</span> &lt; <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		strcpy<span style="color: #66cc66;">&#40;</span>to, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #66cc66;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #66cc66;">&#123;</span>
		buffer = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span> malloc<span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>from<span style="color: #66cc66;">&#41;</span> * <span style="color: #993333;">sizeof</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		k = <span style="color: #cc66cc;">0</span>;
		strcpy<span style="color: #66cc66;">&#40;</span>to, from<span style="color: #66cc66;">&#41;</span>;
		pstr = strstr<span style="color: #66cc66;">&#40;</span>to, search<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>pstr != <span style="color: #000000; font-weight: bold;">NULL</span> <span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			k = <span style="color: #66cc66;">&#40;</span>k + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			j = <span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>to<span style="color: #66cc66;">&#41;</span> - strlen<span style="color: #66cc66;">&#40;</span>pstr<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			strncpy<span style="color: #66cc66;">&#40;</span>buffer, to, j<span style="color: #66cc66;">&#41;</span>;
			buffer<span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\0</span>'</span>;
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>replace<span style="color: #66cc66;">&#41;</span> &gt; strlen<span style="color: #66cc66;">&#40;</span>search<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
				buffer = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span> realloc<span style="color: #66cc66;">&#40;</span>buffer, <span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>from<span style="color: #66cc66;">&#41;</span> + <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span>strlen<span style="color: #66cc66;">&#40;</span>replace<span style="color: #66cc66;">&#41;</span> - strlen<span style="color: #66cc66;">&#40;</span>search<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> * k<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> * <span style="color: #993333;">sizeof</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			j = <span style="color: #66cc66;">&#40;</span>j + strlen<span style="color: #66cc66;">&#40;</span>replace<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			strncat<span style="color: #66cc66;">&#40;</span>buffer, replace, strlen<span style="color: #66cc66;">&#40;</span>replace<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			buffer<span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\0</span>'</span>;
&nbsp;
			i = strlen<span style="color: #66cc66;">&#40;</span>search<span style="color: #66cc66;">&#41;</span>;
			top = strlen<span style="color: #66cc66;">&#40;</span>pstr<span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>i &lt; = top<span style="color: #66cc66;">&#41;</span>
			<span style="color: #66cc66;">&#123;</span>
				buffer<span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span> = pstr<span style="color: #66cc66;">&#91;</span>i<span style="color: #66cc66;">&#93;</span>;
&nbsp;
				i = <span style="color: #66cc66;">&#40;</span>i + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
				j = <span style="color: #66cc66;">&#40;</span>j + <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
&nbsp;
			buffer<span style="color: #66cc66;">&#91;</span>j<span style="color: #66cc66;">&#93;</span> = <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\0</span>'</span>;
&nbsp;
			strcpy<span style="color: #66cc66;">&#40;</span>to, buffer<span style="color: #66cc66;">&#41;</span>;
			pstr = strstr<span style="color: #66cc66;">&#40;</span>to, search<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	free<span style="color: #66cc66;">&#40;</span>buffer<span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Esta funcion busca la cadena pasada como parametro(const char *search) y reemplaza(const char *replace) todas las ocurrencias encontradas. Cada quien es responsable en reservar suficiente espacio a la cadena resultante(char *to) para el volcado de la cadena original(const char *from) modificada con sus respectivos reemplazados, si estos fueran encontrados, de lo contrario la cadena <i>to</i> se devolvera vacia(no NULL).</pre>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=150</wfw:commentRss>
		</item>
		<item>
		<title>Cargar un Gtk TextView con informacion de un fichero</title>
		<link>http://radamanthys.homelinux.org/?p=144</link>
		<comments>http://radamanthys.homelinux.org/?p=144#comments</comments>
		<pubDate>Thu, 05 Feb 2009 18:57:40 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[C/C++]]></category>

		<category><![CDATA[GTK+]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=144</guid>
		<description><![CDATA[
Esta en una forma de mostrar la informacion contenido en un archivo a este tipo de widget.
Vamos al codigo.
Entre las librerias necesarias acudo a las del sistema: types.h y stat.h para comprobar el tamaño del stream de entrada.

/* standard */
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;
#include &#60;string.h&#62;
&#160;
/* linux */
#include &#60;sys/types.h&#62;
#include &#60;sys/stat.h&#62;
&#160;
/* gtk+ */
#include &#60;gtk/gtk.h&#62;

La funcion encargada de manejar el [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://radamanthys.homelinux.org/wordpress/images/gtktview.png"><img title="gtk text view" alt="gtk text view" src="http://radamanthys.homelinux.org/wordpress/images/thumbnail/tb_gtktview.png" border="0" /></a></div>
<p>Esta en una forma de mostrar la informacion contenido en un archivo a este tipo de widget.</p>
<p>Vamos al codigo.</p>
<p>Entre las librerias necesarias acudo a las del sistema: types.h y stat.h para comprobar el tamaño del <i>stream</i> de entrada.</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/* standard */</span>
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* linux */</span>
<span style="color: #339933;">#include &lt;sys/types.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/stat.h&gt;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* gtk+ */</span>
<span style="color: #339933;">#include &lt;gtk/gtk.h&gt;</span></pre></div></div>

<p>La funcion encargada de manejar el evento.</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #993333;">void</span> on_button_clicked<span style="color: #66cc66;">&#40;</span>GtkWidget *widget, gpointer data<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
FILE *file;
<span style="color: #993333;">char</span> *path = <span style="color: #ff0000;">&quot;/home/shakka/Desktop/fichero.txt&quot;</span>;
<span style="color: #993333;">char</span> *buffer;
<span style="color: #993333;">struct</span> stat f_stat;
GtkTextBuffer *t_buffer;
GtkWidget *view;
&nbsp;
<span style="color: #808080; font-style: italic;">/*
 * process file 
 */</span>
	file = fopen<span style="color: #66cc66;">&#40;</span>path, <span style="color: #ff0000;">&quot;r&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* get file properties */</span>
	stat<span style="color: #66cc66;">&#40;</span>path, &amp;f_stat<span style="color: #66cc66;">&#41;</span>;	
&nbsp;
	<span style="color: #808080; font-style: italic;">/* get data amount */</span>
	buffer = <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span> malloc <span style="color: #66cc66;">&#40;</span>f_stat.<span style="color: #202020;">st_size</span> * <span style="color: #993333;">sizeof</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">char</span> *<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* get stream */</span>
	fread<span style="color: #66cc66;">&#40;</span>buffer, <span style="color: #cc66cc;">1</span>, f_stat.<span style="color: #202020;">st_size</span>, file<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	fclose<span style="color: #66cc66;">&#40;</span>file<span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;">/* 
 * end process file
 */</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/* for manipulate a private widget */</span>
	view = GTK_WIDGET<span style="color: #66cc66;">&#40;</span>data<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* set widget data */</span>	
	t_buffer = gtk_text_view_get_buffer<span style="color: #66cc66;">&#40;</span>GTK_TEXT_VIEW <span style="color: #66cc66;">&#40;</span>view<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	gtk_text_buffer_set_text<span style="color: #66cc66;">&#40;</span>t_buffer, buffer, f_stat.<span style="color: #202020;">st_size</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Cuerpo principal de la aplicacion.</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #808080; font-style: italic;">/*
 * main app.
 */</span>
<span style="color: #993333;">int</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> argc, <span style="color: #993333;">char</span> **argv<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #808080; font-style: italic;">/* main window */</span>
GtkWidget *window;
<span style="color: #808080; font-style: italic;">/* widgets */</span>
GtkWidget *c_fixed;
GtkWidget *g_button;
GtkWidget *s_window;
GtkWidget *t_view;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* init */</span>
	gtk_init<span style="color: #66cc66;">&#40;</span>&amp;argc, &amp;argv<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	window = gtk_window_new<span style="color: #66cc66;">&#40;</span>GTK_WINDOW_TOPLEVEL<span style="color: #66cc66;">&#41;</span>;
	gtk_window_set_position<span style="color: #66cc66;">&#40;</span>GTK_WINDOW<span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>, GTK_WIN_POS_CENTER<span style="color: #66cc66;">&#41;</span>;
	gtk_window_set_title<span style="color: #66cc66;">&#40;</span>GTK_WINDOW<span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;GtkTextView &gt;&gt;&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* setting */</span>
	c_fixed = gtk_fixed_new<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
	s_window = gtk_scrolled_window_new<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	g_button = gtk_button_new_with_label<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Open File&quot;</span><span style="color: #66cc66;">&#41;</span>;
	t_view = gtk_text_view_new<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* packing */</span>
	gtk_container_add<span style="color: #66cc66;">&#40;</span>GTK_CONTAINER <span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>, c_fixed<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	gtk_fixed_put<span style="color: #66cc66;">&#40;</span>GTK_FIXED<span style="color: #66cc66;">&#40;</span>c_fixed<span style="color: #66cc66;">&#41;</span>, s_window, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	gtk_fixed_put<span style="color: #66cc66;">&#40;</span>GTK_FIXED<span style="color: #66cc66;">&#40;</span>c_fixed<span style="color: #66cc66;">&#41;</span>, g_button, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	gtk_widget_set_size_request<span style="color: #66cc66;">&#40;</span>s_window, <span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">98</span><span style="color: #66cc66;">&#41;</span>;	
	gtk_widget_set_size_request<span style="color: #66cc66;">&#40;</span>g_button, <span style="color: #cc66cc;">400</span>, <span style="color: #cc66cc;">42</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	gtk_container_add<span style="color: #66cc66;">&#40;</span>GTK_CONTAINER <span style="color: #66cc66;">&#40;</span>s_window<span style="color: #66cc66;">&#41;</span>, t_view<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* events */</span>
	g_signal_connect<span style="color: #66cc66;">&#40;</span>G_OBJECT <span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">&quot;delete_event&quot;</span>, G_CALLBACK <span style="color: #66cc66;">&#40;</span>gtk_main_quit<span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
	g_signal_connect<span style="color: #66cc66;">&#40;</span>G_OBJECT <span style="color: #66cc66;">&#40;</span>g_button<span style="color: #66cc66;">&#41;</span>,<span style="color: #ff0000;">&quot;clicked&quot;</span>, G_CALLBACK <span style="color: #66cc66;">&#40;</span>on_button_clicked<span style="color: #66cc66;">&#41;</span>, G_OBJECT <span style="color: #66cc66;">&#40;</span>t_view<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* render */</span>
	gtk_widget_show_all<span style="color: #66cc66;">&#40;</span>window<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">/* run */</span>	
	gtk_main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Mas informacion: <a href="http://library.gnome.org/devel/gtk/unstable/GtkTextView.html">http://library.gnome.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=144</wfw:commentRss>
		</item>
		<item>
		<title>MikeM’s Site te regala este paquete</title>
		<link>http://radamanthys.homelinux.org/?p=141</link>
		<comments>http://radamanthys.homelinux.org/?p=141#comments</comments>
		<pubDate>Mon, 19 Jan 2009 04:21:57 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=141</guid>
		<description><![CDATA[
Gracias a Radicaled me he visto envuelto en este meme .
Realizado por mikems-site.
Para empezar el año con buen pie, he decidido llevar a cabo una iniciativa que tiene su precedente en esta que tomó Forat hace casi un año. Voy a regalar el paquete que véis en la foto. ¿Qué hay dentro?, pues debo deciros [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://radamanthys.homelinux.org/wordpress/images/pkg_meme.png"><img title="meme" alt="meme" src="http://radamanthys.homelinux.org/wordpress/images/thumbnail/tb_pkg_meme.png" border="0" /></a></div>
<p>Gracias a Radicaled me he visto envuelto en este meme <img src="http://radamanthys.homelinux.org/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_razz.gif" alt="" />.</p>
<p>Realizado por <a href="http://www.mikemsite.com/wordpress/sin-categoria/mikems-site-te-regala-este-paquete/">mikems-site</a>.</p>
<blockquote><p>Para empezar el año con buen pie, he decidido llevar a cabo una iniciativa que tiene su precedente en esta que tomó Forat hace casi un año. Voy a regalar el paquete que véis en la foto. ¿Qué hay dentro?, pues debo deciros que es algo que seguramente utilizáis todos los días y que tal vez necesitéis renovar.</p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="text">&gt;&gt; 1. Deberéis publicar un post enlazando esta entrada,
con el título MikeM’s Site te regala este paquete.
&nbsp;
&gt;&gt; 2. Para difundir el sorteo deberéis invitar a modo de Meme
a 5 blogs para participar en el concurso.
&nbsp;
&gt;&gt; 3. Y por último deberéis dejar un comentario en esta entrada
para que pueda revisarlos y apuntaros a la lista.</pre></div></div>

<p>En cuanto al segundo punto:</p>
<p><a href="http://calex788.blogspot.com/">blog de calex78</a> | <a href="http://gnu-haldrik.blogspot.com/">blog de haldrik</a> | <a href="http://artzneo.blogspot.com/">blog de artzneo</a> | <a href="http://chacognulinux.blogspot.com/">blog de chaco</a> | <a href="http://www.maty1206linuxeando.com/">blog de marvin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=141</wfw:commentRss>
		</item>
		<item>
		<title>Error al compilar squashfs 3.3 para kernel 2.6.28</title>
		<link>http://radamanthys.homelinux.org/?p=139</link>
		<comments>http://radamanthys.homelinux.org/?p=139#comments</comments>
		<pubDate>Mon, 19 Jan 2009 04:02:36 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[C/C++]]></category>

		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=139</guid>
		<description><![CDATA[De momento hay varias incompatibilidades entre algunos modulos, como el de SquashFS (version del paquete en Sid, 1:3.3-7), en especial este.
m-a -t -v build squashfs

...
/usr/bin/make -C /lib/modules/2.6.28-amd64/source M=/usr/src/modules/squashfs modules
make[2]: Entering directory `/usr/src/linux-2.6.28'
  CC [M]  /usr/src/modules/squashfs/inode.o
/usr/src/modules/squashfs/inode.c: In function ‘squashfs_export_iget’:
/usr/src/modules/squashfs/inode.c:659: error: implicit declaration of function ‘d_alloc_anon’
/usr/src/modules/squashfs/inode.c:659: warning: assignment makes pointer from integer without a cast
/usr/src/modules/squashfs/inode.c: [...]]]></description>
			<content:encoded><![CDATA[<p>De momento hay varias incompatibilidades entre algunos modulos, como el de <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=squashfs-source;dist=unstable">SquashFS</a> (version del paquete en Sid, 1:3.3-7), en especial <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509771">este</a>.</p>
<p><strong>m-a -t -v build squashfs</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text">...
/usr/bin/make -C /lib/modules/2.6.28-amd64/source M=/usr/src/modules/squashfs modules
make[2]: Entering directory `/usr/src/linux-2.6.28'
  CC [M]  /usr/src/modules/squashfs/inode.o
/usr/src/modules/squashfs/inode.c: In function ‘squashfs_export_iget’:
/usr/src/modules/squashfs/inode.c:659: error: implicit declaration of function ‘d_alloc_anon’
/usr/src/modules/squashfs/inode.c:659: warning: assignment makes pointer from integer without a cast
/usr/src/modules/squashfs/inode.c: In function ‘init_inodecache’:
/usr/src/modules/squashfs/inode.c:2210: warning: passing argument 5 of ‘kmem_cache_create’ from incompatible pointer type
make[3]: *** [/usr/src/modules/squashfs/inode.o] Error 1
make[2]: *** [_module_/usr/src/modules/squashfs] Error 2
make[2]: Leaving directory `/usr/src/linux-2.6.28'
make[1]: *** [binary-modules] Error 2
make[1]: Leaving directory `/usr/src/modules/squashfs'
make: *** [kdist_build] Error 2
BUILD FAILED!
...</pre></div></div>

<p>Removieron o cambiaron de nombre algunas funciones como <strong>d_alloc_anon()</strong>, similar me sucede con los modulos aufs y unionfs.</p>
<p>Mas informacion: <a href="http://packages.qa.debian.org/s/squashfs.html">http://packages.qa.debian.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=139</wfw:commentRss>
		</item>
		<item>
		<title>Diferencia al cargar un ComboBox / ComboBoxEntry</title>
		<link>http://radamanthys.homelinux.org/?p=132</link>
		<comments>http://radamanthys.homelinux.org/?p=132#comments</comments>
		<pubDate>Fri, 19 Dec 2008 14:28:01 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[Debian]]></category>

		<category><![CDATA[GTK+]]></category>

		<category><![CDATA[Glade]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=132</guid>
		<description><![CDATA[Estoy usando Glade para armar las interfaces de usuario y en cierto momento necesite cargar un widget {Gtk} ComboBox y en otro un ComboBoxEntry a partir de una lista que tenia preparada.
Para comenzar, la diferencia entre estos 2 controles estriba en que, si bien es cierto ambos permiten al usuario seleccionar algun item a partir [...]]]></description>
			<content:encoded><![CDATA[<p>Estoy usando Glade para armar las interfaces de usuario y en cierto momento necesite cargar un widget {Gtk} <a href="http://www.pygtk.org/docs/pygtk/class-gtkcombobox.html">ComboBox</a> y en otro un <a href="http://www.pygtk.org/docs/pygtk/class-gtkcomboboxentry.html">ComboBoxEntry</a> a partir de una lista que tenia preparada.</p>
<p>Para comenzar, la diferencia entre estos 2 controles estriba en que, si bien es cierto ambos permiten al usuario seleccionar algun <em>item</em> a partir de la una lista desplegable, el segundo tambien permite(al usuario) ingresar un nuevo item como si de un <em>textbox</em> se tratara, cosa que el primero no. </p>
<p>Al codigo, tengo una lista(variable llamada <strong>parts</strong>) la cual tengo que pasarla a un objeto gtk.ListStore.</p>

<div class="wp_syntax"><div class="code"><pre class="python">	model = gtk.<span style="color: black;">ListStore</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#41;</span>
&nbsp;
	<span style="color: #ff7700;font-weight:bold;">for</span> j <span style="color: #ff7700;font-weight:bold;">in</span> parts:
		model.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>j<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Ahora, cargo el widget del XML que genera Glade:</p>

<div class="wp_syntax"><div class="code"><pre class="python"><span style="color: #808080; font-style: italic;">#self?, si, es porque lo tengo en una clase xD</span>
	cboDevice = <span style="color: #008000;">self</span>.<span style="color: black;">glade</span>.<span style="color: black;">get_widget</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;cboDevice&quot;</span><span style="color: black;">&#41;</span>
	cboDevice.<span style="color: black;">set_model</span><span style="color: black;">&#40;</span>model<span style="color: black;">&#41;</span></pre></div></div>

<p>Ahora, he aqui la diferencia del ultimo paso:</p>
<p>Cargar un ComboBoxEntry:</p>

<div class="wp_syntax"><div class="code"><pre class="python">	cboDevice.<span style="color: black;">set_text_column</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Cargar un ComboBox:</p>

<div class="wp_syntax"><div class="code"><pre class="python">	cell = gtk.<span style="color: black;">CellRendererText</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
	cboDevice.<span style="color: black;">pack_start</span><span style="color: black;">&#40;</span>cell, <span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
	cboDevice.<span style="color: black;">add_attribute</span><span style="color: black;">&#40;</span>cell, <span style="color: #483d8b;">'text'</span>, <span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Codigo completo de la funcion(metodo) que carga el ComboBoxEntry y retorna la cantidad de elementos.</p>

<div class="wp_syntax"><div class="code"><pre class="python">	<span style="color: #ff7700;font-weight:bold;">def</span> setListDevice<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
		parts = getListDevice<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
		model = gtk.<span style="color: black;">ListStore</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#41;</span>
		items = <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>parts<span style="color: black;">&#41;</span>
&nbsp;
		<span style="color: #ff7700;font-weight:bold;">for</span> j <span style="color: #ff7700;font-weight:bold;">in</span> parts:
			model.<span style="color: black;">append</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span>j<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
		cboDevice = <span style="color: #008000;">self</span>.<span style="color: black;">glade</span>.<span style="color: black;">get_widget</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;cboDevice&quot;</span><span style="color: black;">&#41;</span>
		cboDevice.<span style="color: black;">set_model</span><span style="color: black;">&#40;</span>model<span style="color: black;">&#41;</span>
		cboDevice.<span style="color: black;">set_text_column</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
&nbsp;
		<span style="color: #ff7700;font-weight:bold;">return</span> items</pre></div></div>

<p>Mas informacion: <a href="http://www.pygtk.org/reference.html">http://www.pygtk.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=132</wfw:commentRss>
		</item>
		<item>
		<title>Probando Kohi desde Subversion</title>
		<link>http://radamanthys.homelinux.org/?p=127</link>
		<comments>http://radamanthys.homelinux.org/?p=127#comments</comments>
		<pubDate>Tue, 16 Dec 2008 18:56:04 +0000</pubDate>
		<dc:creator>shakka</dc:creator>
		
		<category><![CDATA[C/C++]]></category>

		<category><![CDATA[Debian]]></category>

		<category><![CDATA[Kohi]]></category>

		<guid isPermaLink="false">http://radamanthys.homelinux.org/?p=127</guid>
		<description><![CDATA[
Si bien es suficiente con solo descargar(solo la libreria y la cabecera) e instalarlo(por si mismo) para utilizar kohi, el hecho de utilizarlo desde subversion facilita(ya que este trae instalador, desinstalador) el utilizarlo y de paso mantenerlo actualizado a la ultima version.
Pasos de como usarlo desde Subversion:
$ svn checkout http://kohi.googlecode.com/svn/trunk/ kohi-read-only
$ cd kohi-read-only
# make install
Para [...]]]></description>
			<content:encoded><![CDATA[<div align="center"><a href="http://radamanthys.homelinux.org/wordpress/images/kohi_test.png"><img title="kohi" alt="kohi" src="http://radamanthys.homelinux.org/wordpress/images/thumbnail/tb_kohi_test.png" border="0" /></a></div>
<p>Si bien es suficiente con solo descargar(solo la libreria y la cabecera) e instalarlo(por si mismo) para utilizar kohi, el hecho de utilizarlo desde <a title="kohi sources" href="http://code.google.com/p/kohi/source/browse/#svn/trunk">subversion</a> facilita(ya que este trae instalador, desinstalador) el utilizarlo y de paso mantenerlo actualizado a la ultima version.</p>
<p>Pasos de como usarlo desde Subversion:</p>
<p><b>$ svn checkout http://kohi.googlecode.com/svn/trunk/ kohi-read-only</b></p>
<p><b>$ cd kohi-read-only</b></p>
<p><b># make install</b></p>
<p>Para actualizarlo, solo se dirigen al directorio <i>cd kohi-read-only</i></p>
<p><b>$ svn checkout http://kohi.googlecode.com/svn/trunk/ kohi-read-only</b></p>
<p>He aqui una muestra de como usarlo(este fichero fuente [main.c] es de prueba, y se descarga desde subversion para comprobar que funciona) :</p>

<div class="wp_syntax"><div class="code"><pre class="c"><span style="color: #339933;">#include &quot;kohi.h&quot;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
<span style="color: #808080; font-style: italic;">/* This initializes some properties
   of the console 
 */</span>
 textbackground<span style="color: #66cc66;">&#40;</span>BLUE<span style="color: #66cc66;">&#41;</span>;
 textcolor<span style="color: #66cc66;">&#40;</span>YELLOW<span style="color: #66cc66;">&#41;</span>;
 clrscr<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
 gotoxy<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000066;">printf</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Kohi library<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
 gotoxy<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span>,<span style="color: #cc66cc;">11</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000066;">printf</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&gt;&gt; press any key to exit &quot;</span><span style="color: #66cc66;">&#41;</span>;
 getch<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/* This reset properties
   of the console
 */</span> 
 textbackground<span style="color: #66cc66;">&#40;</span>RESET_COLOR<span style="color: #66cc66;">&#41;</span>;
 textcolor<span style="color: #66cc66;">&#40;</span>RESET_COLOR<span style="color: #66cc66;">&#41;</span>;
 clrscr<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; 
&nbsp;
<span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span>;
<span style="color: #66cc66;">&#125;</span></pre></div></div>

<p>Compilamos y probamos el ejemplo.</p>
<p><b>$ gcc -o my_app main.c -I/usr/local/include/ -L/usr/local/lib/ -lkohi</b></p>
<p><b>$ ./my_app</b></p>
<p>De paso, estoy trabajando en agregar nuevas funciones, asi que cualquier duda, sugerencia o reporte favor hacerla a la <a title="kohi issues" href="http://code.google.com/p/kohi/issues/list">pagina del proyecto</a>.</p>
<p>Mas Informacion: <a target="_blank" title="kohi" href="http://code.google.com/p/kohi/wiki/FromSources">http://code.google.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://radamanthys.homelinux.org/?feed=rss2&amp;p=127</wfw:commentRss>
		</item>
	</channel>
</rss>
