<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bicosyes - since evermore... &#187; tips</title>
	<atom:link href="http://bicosyes.com/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://bicosyes.com</link>
	<description></description>
	<lastBuildDate>Sat, 06 Mar 2010 20:03:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mostrar notificaciones emergentes desde la consola</title>
		<link>http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/</link>
		<comments>http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 14:20:21 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[bashrc]]></category>
		<category><![CDATA[d-bus]]></category>
		<category><![CDATA[notificaciones]]></category>
		<category><![CDATA[notify]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[ubutu]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=894</guid>
		<description><![CDATA[A veces es útil mostrar algún tipo de notificación gráfica para informarte, por ejemplo, de cuándo se ha terminado una tarea. Las notificaciones emergentes de Ubuntu, añadidas hace un par de versiones, son una muy buena opción.
Dos opciones, (1) instalarnos esta librería de perl libnet-dbus-perl, y nos ponemos esta función en nuestro ~/.bashrc
function notify&#40;&#41;
&#123;
  [...]]]></description>
			<content:encoded><![CDATA[<p>A veces es útil mostrar algún tipo de notificación gráfica para informarte, por ejemplo, de cuándo se ha terminado una tarea. <a href="https://wiki.ubuntu.com/NotifyOSD">Las notificaciones emergentes de Ubuntu</a>, añadidas hace un par de versiones, son una muy buena opción.</p>
<p>Dos opciones, (1) instalarnos esta librería de perl <em>libnet-dbus-perl</em>, y nos ponemos esta función en nuestro <em>~/.bashrc</em></p>
<pre class="bash"><span style="color: #000000; font-weight: bold;">function</span> notify<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #c20cb9; font-weight: bold;">perl</span> -e <span style="color: #ff0000;">&quot;use Net::DBus; my <span style="color: #000099; font-weight: bold;">\$</span>sessionBus = Net::DBus-&gt;session; my <span style="color: #000099; font-weight: bold;">\$</span>notificat
ionsService = <span style="color: #000099; font-weight: bold;">\$</span>sessionBus-&gt;get_service('org.freedesktop.Notifications'); my <span style="color: #000099; font-weight: bold;">\$</span>n
otificationsObject = <span style="color: #000099; font-weight: bold;">\$</span>notificationsService-&gt;get_object('/org/freedesktop/Notifi
cations', 'org.freedesktop.Notifications'); my <span style="color: #000099; font-weight: bold;">\$</span>notificationId; <span style="color: #000099; font-weight: bold;">\$</span>notificationI
d = <span style="color: #000099; font-weight: bold;">\$</span>notificationsObject-&gt;Notify(shift, 0, '', '$1', '$2', [], {}, -1);&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre>
<pre>$ notify foooooooo baaarrr</pre>
<p><a href="http://bicosyes.com/wp-content/uploads/2009/11/notify.png"><img src="http://bicosyes.com/wp-content/uploads/2009/11/notify.png" alt="notify" title="notify" width="357" height="204" class="aligncenter size-full wp-image-895" /></a></p>
<p>El primer parámetro es el título y el segundo el contenido. </p>
<p>Otra forma (2) todavía más fácil es instalarnos el paquete <em>libnotify-bin</em>, el cual contiene el binario <em>notify-send</em> que hace justamente esto. Probablemente la primera solución nos servirá para cualquier distro, mientras que la segunda solo en debian, ubuntu y derivados. Ambas funcionan exactamente igual y sin problemas.</p>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=894&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/mostrar-notificaciones-emergentes-desde-la-consola/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>C++, cadenas multilínea de forma clara</title>
		<link>http://bicosyes.com/c-cadenas-multilinea-de-forma-clara/</link>
		<comments>http://bicosyes.com/c-cadenas-multilinea-de-forma-clara/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 14:05:05 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[multiline]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=846</guid>
		<description><![CDATA[Según el estándar c++98 (sección 2.13.4) las cadenas literales tienen como propiedad que durante el análisis léxico del código fuente (la primera fase que realiza el compilador, convirtiendo texto de entrada a tokens y símbolos) se concatenarán cadenas adyacentes.
In translation phase 6 (2.1), adjacent narrow string literals are concatenated and adjacent wide string literals are [...]]]></description>
			<content:encoded><![CDATA[<p>Según el <a href="http://en.wikipedia.org/wiki/ISO/IEC_14882#Language_standard">estándar c++98</a> (sección 2.13.4) las cadenas literales tienen como propiedad que durante el análisis léxico del código fuente (la primera fase que realiza el compilador, convirtiendo texto de entrada a tokens y símbolos) se concatenarán cadenas adyacentes.</p>
<blockquote><p>In translation phase 6 (2.1), adjacent narrow string literals are concatenated and adjacent wide string literals are concatenated. </p></blockquote>
<p>Esto viene a decir que podemos partir nuestras cadenas en cualquier momento sin poner ningún signo de concatenación entre ellas, de esta forma:</p>
<pre class="cpp">&nbsp;
<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> s1* = <span style="color: #666666;">&quot;dum&quot;</span> <span style="color: #666666;">&quot;de&quot;</span> <span style="color: #666666;">&quot;dum&quot;</span>;
<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> s2* = <span style="color: #666666;">&quot;dum&quot;</span>
                 <span style="color: #666666;">&quot;de&quot;</span>
                 <span style="color: #666666;">&quot;dum&quot;</span>
;</pre>
<p>Lo cual viene realmente bien para formar código bien indentado y formateado, pues aunque también podemos usar "\" para saltar de línea, el texto a continuación no puede estar indentado pues significaría incluir esos espacios/tabuladores en la cadena que estamos definiendo. Y lo realmente interesante es que todo esto está en la propia definición del lenguaje, no es ninguna ayuda concreta del compilador, a los ojos del programa todas las siguientes definiciones son idénticas:</p>
<pre class="cpp">&nbsp;
<span style="color: #339900;">#include &lt;string&gt;</span>
<span style="color: #339900;">#include &lt;iostream&gt;</span>
&nbsp;
<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> * cmp<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> *s1, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> *s2 <span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000ff;">int</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> * s1 = <span style="color: #666666;">&quot;My spoon is too big&quot;</span>
                      <span style="color: #666666;">&quot;My spoon is TOO BIG&quot;</span>
                      <span style="color: #666666;">&quot;I AM A BANANA&quot;</span>;
    <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> * s2 = <span style="color: #666666;">&quot;My spoon is too big<span style="color: #666666; font-weight: bold;">\</span>
My spoon is TOO BIG<span style="color: #666666; font-weight: bold;">\</span>
I AM A BANANA&quot;</span>;
    <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> * s3 = <span style="color: #000000;">&#40;</span> std::<span style="color: #00eeff;">string</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;My spoon is too big&quot;</span><span style="color: #000000;">&#41;</span> +
                        std::<span style="color: #00eeff;">string</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;My spoon is TOO BIG&quot;</span><span style="color: #000000;">&#41;</span> +
                        std::<span style="color: #00eeff;">string</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;I AM A BANANA&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>.<span style="color: #00eeff;">c_str</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
    std::<span style="color: #0000dd;">cout</span> &lt;&lt; <span style="color: #666666;">&quot;s1 and s2 are &quot;</span> &lt;&lt; cmp<span style="color: #000000;">&#40;</span> s1, s2 <span style="color: #000000;">&#41;</span> &lt;&lt; std::<span style="color: #00eeff;">endl</span>;
    std::<span style="color: #0000dd;">cout</span> &lt;&lt; <span style="color: #666666;">&quot;s1 and s3 are &quot;</span> &lt;&lt; cmp<span style="color: #000000;">&#40;</span> s1, s3 <span style="color: #000000;">&#41;</span> &lt;&lt; std::<span style="color: #00eeff;">endl</span>;
    std::<span style="color: #0000dd;">cout</span> &lt;&lt; <span style="color: #666666;">&quot;s2 and s3 are &quot;</span> &lt;&lt; cmp<span style="color: #000000;">&#40;</span> s2, s3 <span style="color: #000000;">&#41;</span> &lt;&lt; std::<span style="color: #00eeff;">endl</span>;
&nbsp;
    <span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> * cmp<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> *s1, <span style="color: #0000ff;">const</span> <span style="color: #0000ff;">char</span> *s2 <span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#123;</span>
    <span style="color: #0000ff;">while</span><span style="color: #000000;">&#40;</span> *s1 &amp;&amp; *s2 &amp;&amp; *s1++ == *s2++ <span style="color: #000000;">&#41;</span>;
    <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> *s1 != *s2 <span style="color: #000000;">&#41;</span> || <span style="color: #000000;">&#40;</span> *s1 || *s2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>
        <span style="color: #0000ff;">return</span> <span style="color: #666666;">&quot;different&quot;</span>;
    <span style="color: #0000ff;">return</span> <span style="color: #666666;">&quot;equal&quot;</span>;
<span style="color: #000000;">&#125;</span></pre>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">c++</span> const_char_declaration_sample.<span style="color: #c20cb9; font-weight: bold;">cpp</span> &amp;&amp; ./a.out
s1 and s2 are equal
s1 and s3 are equal
s2 and s3 are equal</pre>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=846&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/c-cadenas-multilinea-de-forma-clara/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Añadir soporte de links spotify en firefox</title>
		<link>http://bicosyes.com/anadir-soporte-de-links-spotify-en-firefox/</link>
		<comments>http://bicosyes.com/anadir-soporte-de-links-spotify-en-firefox/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 16:05:13 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[spotify]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=706</guid>
		<description><![CDATA[Quien dice spotify, podría decir ed2k o el protocolo que vuesa merced guste. El proceso siempre es el mismo:

Abrir about:config en firefox
Añadir par de booleanos (valores lógicos):

network.protocol-handler.external.spotify a true
network.protocol-handler.warn-external.spotify a false

Añadir una cadena network.protocol-handler.app.spotify con valor /usr/bin/spotify
Crear un ejecutable (en este caso en /usr/bin/spotify y teniendo en cuenta dónde lo instalamos anteriormente)
&#160;
#!/bin/sh
exec wine &#34;C:\Program Files\Spotify\spotify.exe&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Quien dice <em>spotify</em>, podría decir <em>ed2k</em> o el protocolo que vuesa merced guste. El proceso siempre es el mismo:</p>
<ol>
<li>Abrir <em>about:config</em> en firefox</li>
<li>Añadir par de booleanos (valores lógicos):
<ul>
<li><em>network.protocol-handler.external.spotify</em> a true</li>
<li><em>network.protocol-handler.warn-external.spotify</em> a false</li>
</ul>
<li>Añadir una cadena <em>network.protocol-handler.app.spotify</em> con valor <em>/usr/bin/spotify</em></li>
<li>Crear un ejecutable (en este caso en <em>/usr/bin/spotify</em> y teniendo en cuenta dónde lo instalamos anteriormente)
<pre class="bash">&nbsp;
<span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">exec</span> wine <span style="color: #ff0000;">&quot;C:<span style="color: #000099; font-weight: bold;">\P</span>rogram Files<span style="color: #000099; font-weight: bold;">\S</span>potify<span style="color: #000099; font-weight: bold;">\s</span>potify.exe&quot;</span> /uri <span style="color: #ff0000;">&quot;$@&quot;</span></pre>
</li>
</ol>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=706&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/anadir-soporte-de-links-spotify-en-firefox/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

