<?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; Programación</title>
	<atom:link href="http://bicosyes.com/category/programacion/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>Code Monkey like Fritos</title>
		<link>http://bicosyes.com/code-monkey-like-fritos/</link>
		<comments>http://bicosyes.com/code-monkey-like-fritos/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 20:01:55 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[LOL]]></category>
		<category><![CDATA[Programación]]></category>
		<category><![CDATA[acustic]]></category>
		<category><![CDATA[code monkey]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[song]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=922</guid>
		<description><![CDATA[Until now I've never heard about this song, about a code monkey, funny and nice at the same time. The same songwriter, Jonathan Coulton, has a lot more of similar (geek) songs. Awesome.


Code Monkey get up get coffee
Code Monkey go to job
Code Monkey have boring meeting with boring manager Rob
Rob say Code Monkey very diligent
but [...]]]></description>
			<content:encoded><![CDATA[<p>Until now I've never heard about this song, about a code monkey, funny and nice at the same time. The same songwriter, <a href="http://en.wikipedia.org/wiki/Jonathan_Coulton">Jonathan Coulton</a>, has a lot more of similar (geek) songs. Awesome.</p>
<div class="center"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/7s8S7QxpjeY&hl=es_ES&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/7s8S7QxpjeY&hl=es_ES&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></div>
<blockquote><p>
Code Monkey get up get coffee<br />
Code Monkey go to job<br />
Code Monkey have boring meeting with boring manager Rob<br />
Rob say Code Monkey very diligent<br />
but his output stink<br />
his code not functional or elegant<br />
what do Code Monkey think<br />
Code Monkey think maybe manager want to write goddamn login page himself<br />
Code Monkey not say it out loud<br />
Code Monkey not crazy just proud</p>
<p>Code Monkey like Fritos<br />
Code Monkey like Tab and Mountain Dew<br />
Code Monkey very simple man<br />
with big warm fuzzy secret heart<br />
Code Monkey like you<br />
Code Monkey like you</p>
<p>Code Monkey hang around at front desk<br />
tell you sweater look nice<br />
Code Monkey offer buy you soda<br />
bring you cup bring you ice<br />
you say no thank you for the soda cause<br />
soda make you fat<br />
anyway you busy with the telephone<br />
no time for chat</p>
<p>Code Monkey have long walk back to cubicle<br />
he sit down pretend to work<br />
Code Monkey not thinking so straight<br />
Code Monkey not feeling so great</p>
<p>Code Monkey like Fritos<br />
Code Monkey like Tab and Mountain Dew<br />
Code Monkey very simple man<br />
with big warm fuzzy secret heart<br />
Code Monkey like you<br />
Code Monkey like you a lot</p>
<p>Code Monkey have every reason<br />
to get out this place<br />
Code Monkey just keep on working<br />
to see your soft pretty face<br />
Much rather wake up eat a coffee cake<br />
Take bath, take nap<br />
This job fulfilling in creative way<br />
such a load of crap<br />
Code Monkey think someday he have everything even pretty girl like you<br />
Code Monkey just waiting for now<br />
Code Monkey say someday, somehow</p>
<p>Code Monkey like Fritos<br />
Code Monkey like Tab and Mountain Dew<br />
Code Monkey very simple man<br />
with big warm fuzzy secret heart<br />
Code Monkey like you<br />
Code Monkey like you</p></blockquote>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=922&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/code-monkey-like-fritos/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>boost::asio, synchronous read with timeout</title>
		<link>http://bicosyes.com/boostasio-synchronous-read-with-timeout/</link>
		<comments>http://bicosyes.com/boostasio-synchronous-read-with-timeout/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 20:48:25 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[boost]]></category>
		<category><![CDATA[boost::asio]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=833</guid>
		<description><![CDATA[The boost::asio (which means asynchronous input/output) library, is quite powerful library for asynchronous i/o, but it could be a bit difficult at first to figure out how to do a normal synchronous read. So, as a reminder for my future-me, and for you, this snippet it'll be very useful to accomplish that. Probably there will [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong><a href="http://www.boost.org/doc/libs/1_40_0/doc/html/boost_asio.html">boost::asio</a></strong> (which means asynchronous input/output) library, is quite powerful library for asynchronous i/o, but it could be a bit difficult at first to figure out how to do a normal <strong>synchronous</strong> read. So, as a reminder for my future-me, and for you, this snippet it'll be very useful to accomplish that. Probably there will be another ways for doing that, but this is how I managed to do it:</p>
<pre class="cpp"><span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> boost::<span style="color: #00eeff;">asio</span>;
<span style="color: #0000ff;">using</span> <span style="color: #0000ff;">namespace</span> boost::<span style="color: #0000dd;">system</span>;
<span style="color: #0000ff;">using</span> boost::<span style="color: #00eeff;">optional</span>;
&nbsp;
ip::<span style="color: #00eeff;">tcp</span>::<span style="color: #00eeff;">socket</span> _socket; <span style="color: #ff0000;">// it could be another kind of socket, not only ip::tcp</span>
&nbsp;
<span style="color: #ff0000; font-style: italic;">/**
 * Dumb function to be used as handler argument and save the error_code
 * into a pointer
 *
 * e.g.: boost::bind( &amp;set_result, some_pointer, _1 )
 */</span>
<span style="color: #0000ff;">void</span> set_result<span style="color: #000000;">&#40;</span> optional&lt;error_code&gt;* a, error_code b <span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  a-&gt;reset<span style="color: #000000;">&#40;</span> b <span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #339900;">#define TIMEOUT 60</span>
<span style="color: #ff0000; font-style: italic;">/**
 * it uses _socket
 * if timeout happends throw a system_error exception
 */</span>
template&lt;typename MutableBufferSequence&gt;
optional&lt;error_code&gt; read_with_timeout<span style="color: #000000;">&#40;</span>
    <span style="color: #0000ff;">const</span> MutableBufferSequence&amp; buffer
  <span style="color: #000000;">&#41;</span> throw<span style="color: #000000;">&#40;</span> system_error <span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
  optional&lt;error_code&gt; timer_result;
  optional&lt;error_code&gt; read_result;
&nbsp;
  deadline_timer timer<span style="color: #000000;">&#40;</span> _socket.<span style="color: #00eeff;">io_service</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
  timer.<span style="color: #00eeff;">expires_from_now</span><span style="color: #000000;">&#40;</span> seconds<span style="color: #000000;">&#40;</span>TIMEOUT<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;
  timer.<span style="color: #00eeff;">async_wait</span><span style="color: #000000;">&#40;</span> boost::<span style="color: #00eeff;">bind</span><span style="color: #000000;">&#40;</span>&amp;set_result, &amp;timer_result, _1<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;
&nbsp;
  boost::<span style="color: #00eeff;">asio</span>::<span style="color: #00eeff;">async_read</span><span style="color: #000000;">&#40;</span>
      _socket,
      buffer,
      boost::<span style="color: #00eeff;">asio</span>::<span style="color: #00eeff;">transfer_at_least</span><span style="color: #000000;">&#40;</span> buffer_size_helper<span style="color: #000000;">&#40;</span>buffer<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,
      boost::<span style="color: #00eeff;">bind</span><span style="color: #000000;">&#40;</span> &amp;set_result, &amp;read_result, _1 <span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#41;</span>;
&nbsp;
  _socket.<span style="color: #00eeff;">io_service</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #00eeff;">reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
  <span style="color: #0000ff;">while</span> <span style="color: #000000;">&#40;</span> _socket.<span style="color: #00eeff;">io_service</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #00eeff;">run_one</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>
  <span style="color: #000000;">&#123;</span>
    <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span> read_result <span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
      timer.<span style="color: #00eeff;">cancel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0000ff;">else</span> <span style="color: #0000ff;">if</span> <span style="color: #000000;">&#40;</span> timer_result <span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
      _socket.<span style="color: #00eeff;">cancel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
      throw system_error<span style="color: #000000;">&#40;</span>
          error_code<span style="color: #000000;">&#40;</span> errc::<span style="color: #00eeff;">timed_out</span>, get_generic_category<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#41;</span>;
    <span style="color: #000000;">&#125;</span>
  <span style="color: #000000;">&#125;</span>
  <span style="color: #0000ff;">return</span> read_result;
<span style="color: #000000;">&#125;</span>
&nbsp;</pre>
<p>I hope it will be useful, have fun.</p>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=833&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/boostasio-synchronous-read-with-timeout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to know, in ruby, which methods have been added and by whom?</title>
		<link>http://bicosyes.com/how-to-know-in-ruby-which-methods-have-been-added-and-by-whom/</link>
		<comments>http://bicosyes.com/how-to-know-in-ruby-which-methods-have-been-added-and-by-whom/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 19:50:37 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[method_added]]></category>
		<category><![CDATA[monkeypatching]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=885</guid>
		<description><![CDATA[If you are not very careful, monkeypatching could be very harmful. One thing to remember is that you should never override a method to add funcionality, for those kind of thinks you must use alias chain method pattern, a safer way of doing that. 
For the rest of the monkeypatching, i.e. add new methods, you [...]]]></description>
			<content:encoded><![CDATA[<p>If you are not very careful, monkeypatching could be very harmful. One thing to remember is that you should <strong>never</strong> override a method to <strong>add</strong> funcionality, for those kind of thinks you must use <em>alias chain method pattern</em>, a safer way of doing that. </p>
<p>For the rest of the <em>monkeypatching</em>, i.e. add new methods, you could debug them really easy with something like this:</p>
<pre class="ruby"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#9966CC; font-weight:bold;">Class</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> method_added<span style="color:#006600; font-weight:bold;">&#40;</span>method_name<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{method_name} added to #{self}, callstack:&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#CC0066; font-weight:bold;">caller</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span>|line| <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>#{line}&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre>
<p>You can always add more code to filter by class or by method's name. Let's see an example:</p>
<pre class="ruby">$ more example.<span style="color:#9900CC;">rb</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'date'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'time'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#9966CC; font-weight:bold;">Class</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> method_added<span style="color:#006600; font-weight:bold;">&#40;</span>method_name<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#9966CC; font-weight:bold;">if</span> %w<span style="color:#006600; font-weight:bold;">&#40;</span>method_added<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9966CC; font-weight:bold;">include</span>? method_name.<span style="color:#9900CC;">to_s</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;#{method_name} added to #{self}, callstack:&quot;</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#CC0066; font-weight:bold;">caller</span>.<span style="color:#9900CC;">map</span><span style="color:#006600; font-weight:bold;">&#123;</span>|line| <span style="color:#996600;">&quot;<span style="color:#000099;">\t</span>#{line}&quot;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;<span style="color:#000099;">\n</span>&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Time</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> to_date
      <span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">ordinal</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">year</span>, <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">yday</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Date</span>
   <span style="color:#9966CC; font-weight:bold;">def</span> to_time
      <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">parse</span> <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">to_s</span>
   <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#996600;">&quot;to_date not working&quot;</span> <span style="color:#9966CC; font-weight:bold;">unless</span>
   <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">to_date</span> == <span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">today</span>
<span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#996600;">&quot;to time not working&quot;</span> <span style="color:#9966CC; font-weight:bold;">unless</span>
   <span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span>.<span style="color:#9900CC;">to_date</span>.<span style="color:#9900CC;">to_time</span> == <span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">today</span>.<span style="color:#9900CC;">to_time</span></pre>
<p>The output will be:</p>
<pre>$ ruby example.rb
to_date added to Time, callstack:
	example.rb:13
to_time added to Date, callstack:
	example.rb:19</pre>
<p>Nice, isn't it?. Remember to be carefull with your monkeypatching, with great power comes great responsibility, it's just a tool, neither magic nor the panacea.</p>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=885&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/how-to-know-in-ruby-which-methods-have-been-added-and-by-whom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A new gem: rubygems is it jruby?</title>
		<link>http://bicosyes.com/a-new-gem-rubygems-is-it-jruby/</link>
		<comments>http://bicosyes.com/a-new-gem-rubygems-is-it-jruby/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 18:30:11 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[JRuby]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[rubygems-isitjruby]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=864</guid>
		<description><![CDATA[A few days ago after seeing this tweet, I've decided to migrate the gem rubygems-isit19 to jruby. Thanks to this, when you install another gem you'll be able to read about compability of this gem with jruby, the information is fetched from isitjruby.com website.
Once you have installed the gem you will have two main features, [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago after seeing <a href="http://twitter.com/jruby/status/3431143889">this tweet</a>, I've decided to migrate the gem <em><a href="http://seattlerb.rubyforge.org/rubygems-isit19/"><strong>rubygems-isit19</strong></a></em> to <strong><a href="http://jruby.org">jruby</a></strong>. Thanks to this, when you install another gem you'll be able to read about compability of this gem with jruby, the information is fetched from <a href="http://isitjruby.com/"><strong>isitjruby.com</strong></a> website.</p>
<p>Once you have installed the gem you will have two main features, it's easier if I just show you. First the messages when you install gems:</p>
<pre class="bash">&nbsp;
$ jgem <span style="color: #c20cb9; font-weight: bold;">install</span> daemons
&nbsp;
daemons <span style="color: #000000;">1.0</span><span style="color: #000000;">.10</span> probably might not work, blaxter says <span style="color: #000000;">1.0</span> fails
Update http://isitjruby.com/daemons with your experiences!
&nbsp;
Successfully installed daemons<span style="color: #000000;">-1.0</span><span style="color: #000000;">.10</span>
<span style="color: #000000;">1</span> gem installed
$ jgem <span style="color: #c20cb9; font-weight: bold;">install</span> cucumber
&nbsp;
cucumber <span style="color: #000000;">0.3</span><span style="color: #000000;">.97</span> might work, <span style="color: #000000;">100</span>% say <span style="color: #000000;">0.3</span><span style="color: #000000;">.11</span><span style="color: #000000;">.3</span> works on jruby
Update http://isitjruby.com/cucumber with your experiences!
&nbsp;
Successfully installed cucumber<span style="color: #000000;">-0.3</span><span style="color: #000000;">.97</span>
<span style="color: #000000;">1</span> gem installed
$ jgem <span style="color: #c20cb9; font-weight: bold;">install</span> faker
&nbsp;
faker <span style="color: #000000;">0.3</span><span style="color: #000000;">.1</span> is <span style="color: #000000;">100</span>% verified jruby
Update http://isitjruby.com/faker with your experiences!
&nbsp;
Successfully installed faker<span style="color: #000000;">-0.3</span><span style="color: #000000;">.1</span>
<span style="color: #000000;">1</span> gem installed
&nbsp;</pre>
<p>And also we have an explicit gem command:</p>
<pre class="bash">&nbsp;
$ jgem isitjruby faker
faker <span style="color: #000000;">0.3</span><span style="color: #000000;">.1</span>:    http://isitjruby.com/faker
    Blaxter says <span style="color: #000000;">0.3</span><span style="color: #000000;">.1</span> works on GNU/Linux
        it works perfectly, and it passes all <span style="color: #7a0874; font-weight: bold;">test</span>.
$ jgem isitjruby daemons
daemons <span style="color: #000000;">1.0</span><span style="color: #000000;">.10</span>:    http://isitjruby.com/daemons
    blaxter says <span style="color: #000000;">1.0</span> fails on GNU/Linux
        Daemons use fork, jruby doesn<span style="color: #ff0000;">'t support fork, so it doesn'</span>t work and
        never will
&nbsp;</pre>
<p>And that's it. <a href="http://github.com/blaxter/rubygems-isitjruby/tree/master">The code is on github</a> be free of fork me or open any issues. The important thing is populate with relevant information <a href="http://isitjruby.com">isitjruby.com</a> for benefit of all jruby community. Oh I forgot to tell you <strong>how to install it</strong>, very easy, I've uploaded the gem to <a href="http://gemcutter.org/gems/rubygems-isitjruby">gemcutter</a> so you can install it with something like</p>
<pre>$ jgem install rubygems-isitjruby -s http://gemcutter.org</pre>
<p>It's also in github, but I think (and I hope) gemcutter will be the next rubyforge, so better gemcutter <img src='http://bicosyes.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=864&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/a-new-gem-rubygems-is-it-jruby/feed/</wfw:commentRss>
		<slash:comments>1</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>Visualización de la documentación de todas las gemas instaladas</title>
		<link>http://bicosyes.com/visualizacion-de-la-documentacion-de-todas-las-gemas-instaladas/</link>
		<comments>http://bicosyes.com/visualizacion-de-la-documentacion-de-todas-las-gemas-instaladas/#comments</comments>
		<pubDate>Sun, 31 May 2009 12:55:10 +0000</pubDate>
		<dc:creator>blaxter</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bdoc]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[rdoc]]></category>

		<guid isPermaLink="false">http://bicosyes.com/?p=835</guid>
		<description><![CDATA[La documentación de las gemas de ruby se genera a partir del código fuente mediante rdoc. Después de eso puedes optar por ver individualmente cada una o usar gem server.
Para poder mejorar todo esto podemos usar par de útiles herramientas: (1) la plantilla para rdoc, hanna; y (2)bdoc como alternativa a gem server para visualizar [...]]]></description>
			<content:encoded><![CDATA[<p>La documentación de las gemas de ruby se genera a partir del código fuente mediante rdoc. Después de eso puedes optar por ver individualmente cada una o usar <a href="http://rubygems.org/read/chapter/18">gem server</a>.</p>
<p>Para poder mejorar todo esto podemos usar par de útiles herramientas: (1) la plantilla para rdoc, <strong><a href="http://github.com/mislav/hanna/tree/master">hanna</a></strong>; y (2)<a href="http://manalang.com/archives/2009/03/29/introducing-bdoc-a-better-gem-doc-browser/"><strong>bdoc</strong></a> como alternativa a gem server para visualizar la documentación.</p>
<p><strong>Hanna</strong> es una plantilla para rdoc que mejora notablemente el formato por defecto. Podemos ver la diferencia fácilmente, por ejemplo, en la documentación de rspec con <a href="http://rspec.rubyforge.org/rspec/1.1.11/">el formato típico</a> <em>vs</em> <a href="http://rspec.rubyforge.org/rspec/1.2.6/">la documentación hecha con hanna</a>. La instalación es simple:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem sources -a http://gems.github.com
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> mislav-hanna</pre>
<p>Para que a partir de ahora se generar la documentación con esta plantilla, puede añadir a tu <em>.gemrc</em> la siguiente línea:</p>
<pre>rdoc: --inline-source --line-numbers --template=hanna</pre>
<p>Y para convertir la documentación de todas tus gemas instaladas, puedes hacer algo como esto:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem list | <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span> | <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> hanna --gems</pre>
<p>Por otro lado, gracias a <strong>bdoc</strong> podremos navegar fácilmente entre todas las documentaciones.</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> manalang-bdoc
$ bdoc</pre>
<p><a href="http://bicosyes.com/wp-content/uploads/2009/05/bdoc.jpg"><img src="http://bicosyes.com/wp-content/uploads/2009/05/bdoc-300x157.jpg" alt="bdoc" title="bdoc" width="300" height="157" class="aligncenter size-medium wp-image-836" /></a><br />
Ejecutando <em>bdoc</em> se nos abrirá en nuestro navegador por defecto listo para poder leer la documentación y poder movernos fácilmente entre las diferentes gemas (y versiones). Muy útil.</p>
<img src="http://bicosyes.com/?ak_action=api_record_view&id=835&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://bicosyes.com/visualizacion-de-la-documentacion-de-todas-las-gemas-instaladas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

