<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>A Foo walks into a Bar...</title>
    <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar</link>
    <description>exploring the diverse world of programming - blog by Pavel Shved</description>
    <item>
      <title>Logging in Expressive Languages</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/78</link>
      <description>&lt;!-- pi 559 --&gt;&lt;p&gt;This article belongs to a wide class "I-was-bored-while-on-a-plane" of blog posts, articles, and discoveries.   It explains a pattern that helps in making your logging easier, "assign-log-return".  It makes logging intermediate values more clean, which becomes especially important in expressive, semi-functional languages, such as Ruby and OCaml.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/78"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/78</guid>
      <pubDate>2012-05-12 20:44:50 UTC</pubDate>
    </item>
    <item>
      <title>Counting Visits Efficiently with "Wide Caching"</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/77</link>
      <description>&lt;!-- pi 552 --&gt;&lt;p&gt;During the work on the fast Ruby on Rails forum engine, I found out that the major factor that makes the performance degrade under high load is activity tracking.  It made the site work with 4 times lower throughput (~10 visits instead of ~40).&lt;/p&gt;
&lt;p&gt;I quickly realized that I tracked activity in a very slow manner: each visit invoked an &lt;span class="fixedWidth"&gt;INSERT&lt;/span&gt; into a MySQL database table.  I carried out several experiments, and came out with a generic pattern how to record the activity data into the database without inserting a row at each request.&lt;/p&gt;
&lt;p&gt;In this post I reinvent a lot of wheels, and explain how and why they were invented during the pursuit for a fast site visit counter.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/77"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/77</guid>
      <pubDate>2012-04-05 21:42:46 UTC</pubDate>
    </item>
    <item>
      <title>Ruby on Rails Errors and Solutions</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/76</link>
      <description>&lt;!-- pi 545 --&gt;&lt;p&gt;It so happened, that I have performed a considerable amount of Ruby on Rails programming during the latest several months, both at work and for fun.&lt;/p&gt;
&lt;p&gt;During this, I encountered a myriad of strange errors and subtleties in the Rails framework.  At some point, I realized that I should start writing them down, so that I won't have to spend a lot of time finding solutions to the problems I have already tackled.  It also should help others to learn by saving the time it would take to google for the solution, or to find it out by stepping through the framework code.&lt;/p&gt;
&lt;p&gt;In this post, I have so far collected about 20 subtle issues.  I'm going to keep populating this post with more stuff I'm going to encounter.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/76"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/76</guid>
      <pubDate>2012-03-10 20:11:52 UTC</pubDate>
    </item>
    <item>
      <title>Optimizing Massive Data Views in Ruby on Rails</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/75</link>
      <description>&lt;!-- pi 540 --&gt;&lt;p&gt;I love Ruby as a language, and Ruby on Rails as a framework.  However, when I was developing my last two web applications (out of... two), I encountered performance problems.   The reason was my lack of experience, I guess, and some shortcomings in the older Rails versions.&lt;/p&gt;
&lt;p&gt;This post describes the efforts I made to make a forum engine I was developing faster.  I was developing a clone of another web forum, written in C++. The time it took to display several thousands of messages in the original C++ engine was about several milliseconds.  However, for my Rails clone, it took 32 seconds to do the same thing.&lt;/p&gt;
&lt;p&gt;Having gotten angry by this slowness, I attacked Rails, and managed to decrease this time to 0.3-0.4 seconds.  In this post, I tell you how.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/75"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/75</guid>
      <pubDate>2012-02-19 18:38:20 UTC</pubDate>
    </item>
    <item>
      <title>A Visit to the Computer History Museum</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/74</link>
      <description>&lt;!-- pi 532 --&gt;&lt;p&gt;A couple of weeks ago I visited the Computer History Museum in Mountain View, California.  In this very short post, I share a couple of photos from there.  I also saw another solution from &lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/tagged/Penn&amp;Paper%27s"&gt;Penn&amp;Paper's&lt;/a&gt; there!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/74"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/74</guid>
      <pubDate>2012-01-28 19:28:48 UTC</pubDate>
    </item>
    <item>
      <title>The Most Stupid Mistake You Can Make with Ruby</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/73</link>
      <description>&lt;!-- pi 522 --&gt;&lt;p&gt;Out of many generic fuck-ups a programmer can make when coding, there is a Ruby-specific one I made today.  It has a Ruby specific syntax, but I traced its origins to a good old bugs that was encountered by &lt;/p&gt;
&lt;p&gt;In this post, I make a short overview of how small typos in code affect our programs.  Then, I tell about the mistake I made, and about a new piece of syntax in Ruby 1.9 that could aid in avoiding it, but fails at this.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/73"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/73</guid>
      <pubDate>2012-01-10 20:40:51 UTC</pubDate>
    </item>
    <item>
      <title>Relativity of Simultaneity in Distributed Computing</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/72</link>
      <description>&lt;!-- pi 518 --&gt;&lt;p&gt;In this post I apply some phenomena described by the Special Theory of Relativity in physics to distributed computing, namely, the "Relativity of Simultaneity" paradox.&lt;/p&gt;
&lt;p&gt;The concept in distributed computing that made me think about this metaphor is &lt;b&gt;quiescent consistency&lt;/b&gt;, and the motivation of its actual usage in real-world systems.&lt;/p&gt;
&lt;p&gt;In this post, I describe these two concepts, explain how they're interconnected, and also share some thoughts why computing is not as simple as STR in physics.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/72"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/72</guid>
      <pubDate>2011-12-26 21:00:44 UTC</pubDate>
    </item>
    <item>
      <title>Typical Janitor's Failures</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/71</link>
      <description>&lt;!-- pi 512 --&gt;&lt;p&gt;Here and there I encounter and hear about various problems with plain removing files from a filesystem.  Inspired by an incident happened at work today, in this post I'll describe four of them.  These are double-remove in Chromium, permission trap in Linux, unlinking instead of removing, and a classical fuck-up with removing your sensitive files.
&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/71"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/71</guid>
      <pubDate>2011-11-21 21:28:05 UTC</pubDate>
    </item>
    <item>
      <title>Do not use Btrfs!</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/70</link>
      <description>&lt;!-- pi 505 --&gt;&lt;p&gt;Btrfs is a new Linux file system that has been included into kernel for more than a year, and it even became a default file system for MeeGo, a mobile Linux distribution.&lt;/p&gt;
&lt;p&gt;However, my experience demonstrates that at the current state of art the decision to use Btrfs is premature.  In this post I tell about my sad experience with Btrfs both at home and at work.  &lt;/p&gt;
&lt;p&gt;So if you considered using  Btrfs, please, make sure you realize all the shortcomings, and that they are mitigated in the further development of the file system... if it's possible at all.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/70"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/70</guid>
      <pubDate>2011-11-13 20:27:58 UTC</pubDate>
    </item>
    <item>
      <title>Ruby-ran-off-the-Rails</title>
      <link>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/69</link>
      <description>&lt;!-- pi 497 --&gt;&lt;p&gt;The lack of my website availability at the beginning of the week was caused by a software update, which involved an unnoticed error.  What the error was, and how come I didn't notice it is what this somewhat boring post is about.&lt;/p&gt;
&lt;p&gt;I also show how I set up my Apache to show the maintenance message, and to wake the website up after a software update has been completed.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/69"&gt;Read full post at coldattic.info &gt;&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <guid>http://coldattic.info/shvedsky/pro/blogs/a-foo-walks-into-a-bar/posts/69</guid>
      <pubDate>2011-10-21 18:42:10 UTC</pubDate>
    </item>
  </channel>
</rss>

