<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>http://lunarlogicpolska.com/</id>
  <title>Lunar Logic Polska Blog</title>
  <updated>2010-05-19T09:26:00Z</updated>
  <link rel="alternate" href="http://lunarlogicpolska.com"/>
  <link rel="self" href="http://lunarlogicpolska.com/atom.xml"/>
  <author>
    <name>Paul Klipp</name>
    <uri>http://lunarlogicpolska.com</uri>
  </author>
  <entry>
    <id>tag:lunarlogicpolska.com,2010-05-19:/blog/2010/05/19/coderack-open-rack-middleware-directory.html</id>
    <title type="html">CodeRack - A warm place to hang your code</title>
    <published>2010-05-19T09:26:00Z</published>
    <updated>2010-05-25T08:49:37Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2010/05/19/coderack-open-rack-middleware-directory.html"/>
    <content type="html">&lt;p&gt;When we organised the &lt;a href="http://coderack.org/"&gt;CodeRack&lt;/a&gt; competition late last year, one of our goals was to promote Rack middleware. Rack provides a minimal, modular
and adaptable interface for developing web applications in Ruby. Middleware in turn provides a means to work with application requests and responses and do all kinds of useful things. The breadth of entries to the competition demonstrates this - from looking up the country of a request by IP (our eventual &lt;a href="http://coderack.org/users/hosiawak/middlewares/36-geoip-country"&gt;winner&lt;/a&gt;), providing a simple request limiter (&lt;a href="http://coderack.org/users/Sutto/middlewares/12-redisrequestlimiter"&gt;special mention&lt;/a&gt;) all the way to the more eccentric (convince a client that your application is running PHP or ASP with &lt;a href="http://coderack.org/users/qoobaa/middlewares/34-karma-chameleon"&gt;this&lt;/a&gt; middleware) and sometimes even &lt;a href="http://coderack.org/users/haruki_zaemon/middlewares/46-rackobama"&gt;satirical&lt;/a&gt; entries. And so we are delighted to now announce the relaunch of the &lt;a href="http://coderack.org/"&gt;CodeRack&lt;/a&gt; site as an open directory of middleware for the whole community.&lt;/p&gt;

&lt;p&gt;The competition entries seed our new directory. It's not intended to  be code repository by any means - we've no desire (or time!) to attempt to reproduce the facilities on GitHub, so we're merely linking to Gists and Git projects. Instead we're focussing on assembling the very best Rack middlewares in one place, where they can be searched, tagged, rated and discussed. We've rolled out the new version of the site true to our lean principles with the very minimum necessary to go live - and we'll be releasing feature enhancements over the coming days and weeks as we complete them. Next will be tagging of middlewares, followed by searching. But we wanted to start promoting the site as soon as possible - for one thing, we don't know of another site that provides such a directory, for another, with more than 100 middlewares in the directory already, the site is a useful resource for us all right now.&lt;/p&gt;

&lt;p&gt;It's possible that we will run a CodeRack competition again in future years, and for now, we've preserved the list of winners, finalists and sponsors on a competition &lt;a href="http://coderack.org/archive"&gt;archive&lt;/a&gt; page. One option that we're considering is to Open Source the code behind the site to encourage more contributors to the development of the directory itself - please let us know if you would be interested in this.&lt;/p&gt;

&lt;p&gt;In the meantime, please spread the word about CodeRack - 'a warm place to hang your code' (all joke credits to &lt;a href="http://www.paulklipp.com/"&gt;Paul Klipp&lt;/a&gt;). We're excited to be involved in promoting a techology that we're such fans of, and we hope that the community will back this venture with enthusiasm, as the directory has the potential to be of great benefit to us all.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2010-03-31:/blog/2010/03/31/like-rats-deserting-the-good-ship-merb-introducing-merb-to-rails3-railtie.html</id>
    <title type="html">Like rats deserting the good ship Merb - introducing merb-to-rails3 railtie</title>
    <published>2010-03-31T11:39:00Z</published>
    <updated>2010-03-31T13:15:39Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2010/03/31/like-rats-deserting-the-good-ship-merb-introducing-merb-to-rails3-railtie.html"/>
    <content type="html">&lt;p&gt;This blog post isn't meant to be a Merb vs Rails discussion, fun though that can sometimes be &#8211; instead we'd like to publicise a small utility library that &lt;a href="http://sickill.net"&gt;Marcin Kulik&lt;/a&gt; and &lt;a href="http://blog.solnic.eu"&gt;Piotr Solnica&lt;/a&gt; have written to help you port a Merb application to Rails 3, by adding several methods from Merb's API to your Rails 3 app. The background to this gem is that Lunar Logic Polska have a mix of deployed applications, some Rails 2, some Merb, and also two distinct camps within the company &#8211; the Merb lovers, and those who have yet to try Merb...&lt;/p&gt;

&lt;p&gt;Merb fans here pointed to better performance and higher productivity. An architecture that was extensible, that avoided "monkey patching", a clean API for plugin development. It's true to say that we have here a small, vocal Merb fanbase, and they have tended to evangelize enough to convert others along the way!&lt;/p&gt;

&lt;p&gt;So whilst some of the team here at LLP are decidedly Merb converts, having looked at the current state of Rails 3 development against Merb, we decided that we would port all of our applications to Rails 3. It seems to us that there is now only very limited development of Merb, and whilst we have recently seen the Merb 1.1 release, this was something we'd been waiting for a year for.  Just a  few months ago the picture was quite different &#8211; but the beta release of Rails 3 changed the landscape dramatically, and prompted our decision. We think that Rails 3 is the future. Indeed, the release notes of Merb 1.1 write that whilst it is intended that Merb should have a future, it is not clear what that future is.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://github.com/LunarLogicPolska/merb-to-rails3"&gt;merb-to-rails3&lt;/a&gt; &lt;a href="http://rubygems.org/gems/merb-to-rails3"&gt;gem&lt;/a&gt; provides proxy methods for Views and Controllers to ease your migration from Merb to Rails 3:&lt;/p&gt;

&lt;p&gt;Controller:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;redirect =&gt; redirect_to&lt;/li&gt;
&lt;li&gt;before =&gt; before_filter&lt;/li&gt;
&lt;li&gt;after =&gt; after_filter&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Controller/View:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;url(name) =&gt; name_path&lt;/li&gt;
&lt;li&gt;resource(...) =&gt; ....._path&lt;/li&gt;
&lt;li&gt;submit =&gt; submit_tag&lt;/li&gt;
&lt;li&gt;css_include_tag =&gt; stylesheet_link_tag&lt;/li&gt;
&lt;li&gt;js_include_tag =&gt; javascript_include_tag&lt;/li&gt;
&lt;li&gt;throw_content(name, ...) =&gt; content_for(name, ...)&lt;/li&gt;
&lt;li&gt;partial =&gt; render :partial&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The gem essentially provides a collection of helper methods that will allow you to get an application up and running, taking care of some of the most frequent exceptions you might encounter, logging warnings to the console that you can deal with at your leisure, and also suggesting alternatives for deprecated methods. Here's an example of console output:&lt;/p&gt;

&lt;script src="http://gist.github.com/349152.js?file=gistfile1.txt"&gt;&lt;/script&gt;


&lt;p&gt;The alternative to using our gem would be to generate a fresh Rails 3 application and deal with exceptions one at a time &#8211; but by providing proxy methods, we aim to at least have the core of a migrated application in a state where it can be worked on largely without exceptions.&lt;/p&gt;

&lt;p&gt;This little gem also allows you to handle Merb-style controller exceptions (ie. &lt;code&gt;raise Forbidden&lt;/code&gt;). You just need to add &lt;code&gt;rescue_from MerbToRails3::ControllerExceptions::Base, :with =&amp;gt; :my_handler&lt;/code&gt; to your ApplicationController. Like this, for example:&lt;/p&gt;

&lt;script src="http://gist.github.com/350231.js?file=gistfile1.rb"&gt;&lt;/script&gt;


&lt;p&gt;In an ideal world, the gem would be all that is needed, but in reality, manual intervention is still required in some instances, as some issues can't be resolved by proxying methods. For example, in deciding how to deal with Merb's behaviour whereby the return value of a controller is the response body returned to the browser. Such differences require human input, and we have intentionally required this, althought we did discuss a rake task that could run regexps over controllers, suggesting replacements as a possible future solution. Consider the example below, contrasting controller behaviour:&lt;/p&gt;

&lt;script src="http://gist.github.com/349158.js?file=gistfile1.rb"&gt;&lt;/script&gt;


&lt;p&gt;Another suggested enhancement would be to create a MerbController class, a subclass of Rails' AbstractController which would handle actions the Merb way &#8211; this could be set as a base class for your Application (controller). It could be argued of course that this is short-termism, as we wouldn't propose attempting to replace the Merb API in Rails 3. Also, whilst we considered converting Merb route definitions to Rails 3 routes, we haven't included that for now, as we decided that this was really a one-time, one-file task"&lt;/p&gt;

&lt;p&gt;There are then some "nice-to-haves" that our gem doesn't provide &#8211; but as ever, we're busy, pragmatic people, who have to balance such decisions with the rest of our workloads! This is Open Source software, and we would encourage any contributions, but in the meantime, we hope that it will be a useful resource for other developers migrating from Merb to Rails 3.&lt;/p&gt;

&lt;p&gt;How to set it up? Just add it to your app's Gemfile:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gem "merb-to-rails3"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and run:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bundle install
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2010-03-29:/blog/2010/03/29/check-your-scripts-with-jslint-on-rails.html</id>
    <title type="html">Check your scripts with JSLint on Rails</title>
    <published>2010-03-29T09:36:00Z</published>
    <updated>2010-03-31T10:34:37Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2010/03/29/check-your-scripts-with-jslint-on-rails.html"/>
    <content type="html">&lt;p&gt;In 2009, I worked on two major projects at Lunar Logic Polska, &lt;a href="http://habitatmap.org"&gt;HabitatMap&lt;/a&gt; and
&lt;a href="http://hapnin.com"&gt;Hapnin&lt;/a&gt;. Both of these involved quite a lot of Javascript code &amp;ndash; to such an extent that sometimes
there was much more complexity and work involved on the Javascript side than on the Rails side.&lt;/p&gt;

&lt;p&gt;When you write so much Javascript code, you need to start taking the language seriously and make sure that you follow
the same kinds of best practices that you do with your Rails code &amp;ndash; otherwise, your Javascript will quickly become
unreadable and difficult to maintain, and the bug count will increase exponentially. In Hapnin, I used the
&lt;a href="http://github.com/relevance/blue-ridge"&gt;Blue Ridge&lt;/a&gt; library, which combines a Javascript testing framework
(Screw.Unit), mocking library (Smoke), Rhino and EnvJs (for testing in the console) in an easy to use Rails plugin.&lt;/p&gt;

&lt;p&gt;There are however some specific kinds of errors that can be detected much easier, automatically, without having to write
any unit tests, and which could be missed completely by the testing suite. Things like a comma at the end of a hash
definition (e.g. &lt;code&gt;{ a: 1, b: 2, }&lt;/code&gt;) &amp;ndash; this would pass any Blue Ridge spec, but would crash the site in Internet
Explorer, or '&lt;code&gt;==&lt;/code&gt;' operator used in a place where '&lt;code&gt;===&lt;/code&gt;' is more appropriate &amp;ndash; which you probably wouldn't find
unless you knew what to look for.&lt;/p&gt;

&lt;p&gt;Luckily, there is a tool that can find these kinds of errors, a tool that most web developers probably have heard about,
but which few of them actually use. It's called &lt;a href="http://www.jslint.com/"&gt;JSLint&lt;/a&gt; and was written by Douglas Crockford 8
years ago.&lt;/p&gt;

&lt;p&gt;I think one of the reasons why Rails developers don't use JSLint often &amp;ndash; apart from not knowing about it, or not
realizing that it can be useful &amp;ndash; is that it isn't as easy to install and use as Rails testing frameworks like
Test::Unit or RSpec. Instead of installing a gem or plugin and calling a rake task, you have to download and install it
manually in the system, or use some other package manager like MacPorts.&lt;/p&gt;

&lt;p&gt;I looked for any Ruby libraries that would wrap JSLint into something more convenient for a Rails developer, but I
couldn't find any &amp;ndash; so I've decided to write one. &lt;a href="http://github.com/psionides/jslint_on_rails"&gt;JSLint on Rails&lt;/a&gt;
is a Rails plugin, and it contains everything you need to check your code with JSLint &amp;ndash; JSLint itself, Rhino
Javascript engine and some Rake tasks; the only thing you may need to install manually is Java JRE (required for running
Rhino), but you probably already have that.&lt;/p&gt;

&lt;p&gt;Here's how you use it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Make sure you have Java installed.&lt;/li&gt;
&lt;li&gt;Install the plugin: &lt;code&gt;./script/plugin&#160;install&#160;git://github.com/psionides/jslint_on_rails.git&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Run the rake task: &lt;code&gt;rake jslint&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Optionally, add &lt;code&gt;rake jslint&lt;/code&gt; to your continuous integration build to make sure it's run automatically.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;When you call &lt;code&gt;rake jslint&lt;/code&gt;, you will get a result like this (if everything goes well):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Running JSLint:

checking public/javascripts/Event.js... OK
checking public/javascripts/Map.js... OK
checking public/javascripts/Marker.js... OK
checking public/javascripts/Reports.js... OK

No JS errors found.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If something is wrong, you will get such results instead:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Running JSLint:

checking public/javascripts/Event.js... 2 errors:

Lint at line 24 character 15: Use '===' to compare with 'null'.
if (a == null &amp;amp;&amp;amp; b == null) {

Lint at line 72 character 6: Extra comma.
},

checking public/javascripts/Marker.js... 1 error:

Lint at line 275 character 27: Missing radix parameter.
var x = parseInt(mapX);


Found 3 errors.
rake aborted!
JSLint test failed.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The plugin has also a configuration file, &lt;code&gt;config/jslint.yml&lt;/code&gt;, which is created for you during the installation. You'll
want to take a look at it, especially to change the &#8220;paths&#8221; and &#8220;exclude_paths&#8221; options that tell it which files to
check &#8211; I'm pretty sure you don't want it to check entire jQuery or Prototype each time, just your own code. You can
also set all &lt;a href="http://www.jslint.com/lint.html#options"&gt;JSLint options&lt;/a&gt; in that file &#8211; I've set the defaults to what I
believed was reasonable, but feel free to tweak them if you disagree. I've also added a few custom options to silence
some types of warnings which I find annoying &amp;ndash; you'll find these at the end of the config file, disabled by
default.&lt;/p&gt;

&lt;p&gt;If you use a different Ruby web framework (e.g. Merb or Sinatra), or you just don't want to use Rails plugins for some
reason, JSLint on Rails can also be used as a plain Ruby gem. To do that, you need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the gem (&lt;code&gt;gem install jslint_on_rails&lt;/code&gt;, or via bundler).&lt;/li&gt;
&lt;li&gt;Include JSLint's tasks in your Rakefile: &lt;code&gt;require 'jslint/tasks'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Also in the Rakefile, set path to your config file: &lt;code&gt;JSLint.config_path = "config/jslint.yml"&lt;/code&gt; (anything you want actually)&lt;/li&gt;
&lt;li&gt;Create a sample config: &lt;code&gt;rake jslint:copy_config&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;After that, you can update your config and run the test with &lt;code&gt;rake jslint&lt;/code&gt;.&lt;/p&gt;

&lt;hr&gt;


&lt;ul&gt;
&lt;li&gt;Project page on GitHub: &lt;a href="http://github.com/psionides/jslint_on_rails"&gt;http://github.com/psionides/jslint_on_rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Original JSLint project page: &lt;a href="http://jslint.com"&gt;http://jslint.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2010-03-03:/blog/2010/03/03/our-first-iphone-app-available-on-appstore.html</id>
    <title type="html">Our first iPhone app available on AppStore</title>
    <published>2010-03-03T14:09:00Z</published>
    <updated>2010-03-08T10:47:32Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2010/03/03/our-first-iphone-app-available-on-appstore.html"/>
    <content type="html">&lt;p&gt;I became interested in iPhone development last winter, when I bought my own iPhone. I wanted to learn how to write iPhone apps, and the best way to learn how to program is to do it &amp;ndash; so I needed to write a first simple application, that I could learn and experiment on. I've decided to write an iPhone client for our &lt;a href="http://rubytime.org"&gt;RubyTime&lt;/a&gt; service; I figured it would save me a few minutes each day if I could enter my activity entries while waiting for a bus on a bus stop instead of doing it in a hurry in the office before I leave (of course, I could also do it using mobile Safari, but it wouldn't be as convenient&amp;hellip; and it wouldn't be so fun!).&lt;/p&gt;

&lt;p&gt;The first version was ready a few months later &amp;ndash; it was able to display recent activities and add new ones. I used and extended the JSON API that Marcin Kulik has earlier created when he was working on his &lt;a href="http://github.com/sickill/rubytime-plasmoid"&gt;RubyTime plasmoid for KDE4&lt;/a&gt;. I showed the app to Paul and he liked it so much that he allowed me to spend almost a month of my working time on improving it and adding new features. I've added support for admin accounts, to let Paul check on his iPhone who was busy and who wasn't, and for client accounts, so that our clients who have iPhones can monitor the progress of their projects. I've also added a search form that finds activities within a certain time range for given projects and users.&lt;/p&gt;

&lt;p&gt;It took a bit longer than expected to bring the application to the point when it can be publicly released, also because we had to make sure that potential users can download a stable version of the server that supports the client app; but the release finally happened last month. I was surprised how fast the application went through the review process &amp;ndash; I had heard stories of apps waiting for weeks or months to get accepted; mine was ready in less than 3 days!&lt;/p&gt;

&lt;p&gt;If you want to try it, iRubyTime is &lt;a href="http://itunes.apple.com/us/app/irubytime/id355303566?mt=8"&gt;available on the AppStore for free&lt;/a&gt;. I've also shared the &lt;a href="http://github.com/psionides/iRubyTime"&gt;source code of the app&lt;/a&gt; on GitHub, so if you're learning Cocoa and iPhone SDK, you can take a look at it and use it as an example or starting point for your own projects.&lt;/p&gt;

&lt;p&gt;I must say that working on your first iPhone application is very difficult at first. It's a completely different experience than working on a Rails webapp &amp;ndash; partially because of the language (ObjC), but also because of different approach and paradigms used in mobile app development, and because of limitations of the phone's hardware. I had to fix hundreds of strange and confusing bugs &amp;ndash; but that means I've also learned a lot, and it will be easier next time.&lt;/p&gt;

&lt;p style="text-align: center;"&gt;
  &lt;img src="/images/posts/iRubyTime_shot.png" style="width: 250px;" alt="iRubyTime screenshot"&gt;
&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2010-02-15:/blog/2010/02/15/mysql-and-mongodb-working-together-in-kanbanery.html</id>
    <title type="html">MySQL and MongoDB working together in Kanbanery</title>
    <published>2010-02-15T12:01:00Z</published>
    <updated>2010-03-11T16:24:24Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2010/02/15/mysql-and-mongodb-working-together-in-kanbanery.html"/>
    <content type="html">&lt;p&gt;An important feature of the &lt;a href="http://kanbanery.com"&gt;Kanban tool&lt;/a&gt; is the logging of project
events, such as changes in task status, from which we generate the
project history. I spoke with &lt;a href="http://sickill.net"&gt;Marcin Kulik&lt;/a&gt; and &lt;a href="http://blog.solnic.eu"&gt;Piotr Solnica&lt;/a&gt; about
their decision to use &lt;a href="http://www.mongodb.org"&gt;MongoDB&lt;/a&gt; for this.&lt;/p&gt;

&lt;p&gt;Several different solutions were considered initially, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; logging to a text file&lt;/li&gt;
&lt;li&gt; logging to the application's MySQL database&lt;/li&gt;
&lt;li&gt; logging to a separate MySQL database&lt;/li&gt;
&lt;li&gt; logging to a different database platform&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The concern when making this decision was to make sure that the value
of logging application events wasn't outweighed by any fall-off in
performance, and having encountered MongoDB being used in similar
contexts, it was investigated as a solution. We didn't need a
transactional data-store - what we needed was fast reads and writes.&lt;/p&gt;

&lt;p&gt;Once we started thinking of using MongoDB, we considered whether to
use &lt;a href="http://github.com/jnunemaker/mongomapper"&gt;MongoMapper&lt;/a&gt;, which is akin to Active Record or &lt;a href="http://datamapper.org"&gt;DataMapper&lt;/a&gt; for
MongoDB, built from scratch. But rather than use this, in the
interests of consistency within our application, we opted for
&lt;a href="http://github.com/solnic/dm-mongo-adapter"&gt;dm-mongo-adapter&lt;/a&gt;, a MongoDB DataMapper Adapter. Piotr Solnica is one
of the authors of dm-mongo-adapter, and its current maintainer, so
obviously we had unrivalled support for any issues we might encounter!
So we were able to be more consistent in using the same abstraction
library for development and testing, and whilst dm-mongo-adapter is
not yet feature complete, it was sufficient for our purposes.&lt;/p&gt;

&lt;p&gt;DataMapper allows you to work with multiple data-stores simultaneausly and have cross-database relations.
We use this setup with MySQL and MongoDB right now. We've created a simple hierarchy of LoggedEvent models that are
persisted in MongoDB and have them associated with other models from MySQL database. If you are wondering how you can
achieve that, here is a simple example showing multiple repository setup in DataMapper:&lt;/p&gt;

&lt;script type="text/javascript" src="http://gist.github.com/320537.js?file=mysql_and_mongodb_example.rb"&gt;&lt;/script&gt;


&lt;p&gt;We have a SingleTableInheritance setup with LoggedEvent as the base class and 3 other subclasses. Each of the subclasses
has a set of additional properties that is specific only to them, not the base class. The big difference between MongoDB
and MySQL in this case is the fact that the latter will store &lt;em&gt;all&lt;/em&gt; the properties for each of the records resulting in
a bigger database size and lower performance. For instance take a look at this example:&lt;/p&gt;

&lt;script type="text/javascript" src="http://gist.github.com/320567.js?file=sti_example.rb"&gt;&lt;/script&gt;


&lt;p&gt;Notice that in MySQL we would have 8 columns whereas in MongoDB we only store the properties that are associated with
specific model. That's why every record in the database has only 6 attributes. Another useful feature is Hash being the
property type (:custom_attributes property in the above example). It's a flexible solution for storing meta-data that
varies between records.&lt;/p&gt;

&lt;p&gt;Piotr &lt;a href="http://gist.github.com/304575"&gt;benchmarked&lt;/a&gt; inserts into a MySQL and a MongoDB using
DataMapper and reported that inserts were more than 20x faster. Both he
and Marcin pointed out that this is measuring the combined performance of
the adapters and the database, and is not a test of each databases underlying speed.&lt;/p&gt;

&lt;p&gt;Piotr's benchmarks seem to confirm that MongoDB and the
dm-mongo-adapter were a good decision for logging application events
in Kanbanery - the solution is very low impact, and one which we  are
very happy with.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2010-01-13:/blog/2010/01/13/my-improvements-on-latest-i18n-gem.html</id>
    <title type="html">My improvements on latest i18n gem</title>
    <published>2010-01-13T10:30:00Z</published>
    <updated>2010-02-15T10:56:08Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2010/01/13/my-improvements-on-latest-i18n-gem.html"/>
    <content type="html">&lt;p&gt;Originally published at &lt;a href="http://blog.knapo.net/2010/1/12/my-improvements-on-latest-i18n-gem"&gt;knapo.net&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In recent weeks I spent a lot of time on i18n stuff in project I currently working on, so I was really happy, after I read Jos&#233; Valim&#8217;s &lt;a href="http://blog.plataformatec.com.br/2009/12/run-i18n-run/article"&gt;article&lt;/a&gt; about new i18n gem, which has been very improved and introduces new features (Thanks Jos&#233; for great article and benchmarks).&lt;/p&gt;

&lt;p&gt;Unfortunately, after few days of using it I noticed a few issues (which I reported on &lt;a href="http://github.com/svenfuchs/i18n/issues"&gt;http://github.com/svenfuchs/i18n/issues&lt;/a&gt;.  They were related to &lt;em&gt;I18n::Backend::Fallbacks&lt;/em&gt;, which handled only translation method, and does not localize, pluralize and &lt;em&gt;:default&lt;/em&gt; option, also &lt;em&gt;I18n:Backend::Fast&lt;/em&gt; threw an exception when there were no translations for locale or one of locale fallbacks. Because I need all these 3 backends, they blocked using new i18n :(&lt;/p&gt; 

&lt;p&gt;Rather than wait until they will be fixed, I forked i18n &lt;a href="http://github.com/knapo/i18n"&gt;http://github.com/knapo/i18n&lt;/a&gt; and fixed them by myself. So, I installed it as a plugin (using braid to easily upgrade its in future):&lt;/p&gt;

&lt;pre&gt;
$ braid add -p git@github.com:knapo/i18n.git
&lt;/pre&gt;

&lt;p&gt;And there&amp;#8217;s a trick (which i18n&amp;#8217;s &lt;span class="caps"&gt;README&lt;/span&gt; hopefully says about) &amp;#8211; to use i18n as a plugin I had to add to my &lt;em&gt;initializers/i18n.rb&lt;/em&gt;  &lt;em&gt;reload_i18n!&lt;/em&gt; method which replaces bundled i18n gem with plugin:&lt;/p&gt;

&lt;pre&gt;
def reload_i18n!
  $:.grep(/i18n/).each { |path| $:.delete(path) }
  I18n::Backend.send :remove_const, "Simple" 
  $: &amp;lt;&amp;lt; Rails.root.join('vendor/plugins/i18n/lib').to_s
end

reload_i18n!
&lt;/pre&gt;

&lt;p&gt;and created my own backend (I preffer that than including all modules to &lt;em&gt;&lt;span class="caps"&gt;I18&lt;/span&gt;::Backend::Simple&lt;/em&gt;)&lt;/p&gt;

&lt;pre&gt;
module I18n
  module Backend
    class Knapo &amp;lt; Simple
      include I18n::Backend::Pluralization
      include I18n::Backend::Fallbacks
      include I18n::Backend::Fast
      include I18n::Backend::InterpolationCompiler
    end
  end
I18n.backend = I18n::Backend::Knapo.new
&lt;/pre&gt;

&lt;p&gt;The only disadvantage of having i18n as a plugin is resetting &lt;em&gt;I18n.load_path&lt;/em&gt;, so all default translations loaded by Rails are being removed, I mean:&lt;/p&gt;

&lt;pre&gt;
actionpack-2.3.5/lib/action_view/locale/en.yml
activesupport-2.3.5/lib/active_support/locale/en.yml
activerecord-2.3.5/lib/active_record/locale/en.yml
&lt;/pre&gt;

&lt;p&gt;But actually it might be a feature for some devs (e.g. me:) ), I copied them into my locales dir to active_support, active_record and action_view subdirs, and have all translations file in one place, and it&amp;#8217;s better to have default (en) Rails ones there to easily compare other locale files with them, and/or edit them.&lt;/p&gt;

&lt;p&gt;I also added extra extensions for &lt;em&gt;I18n&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
  &lt;em&gt;I18n::LoadPath&lt;/em&gt; which makes I18n.load_path more handy:
  &lt;pre&gt;
I18n.load_path = I18n::LoadPath.new(I18n.load_path)
I18n.load_path &amp;lt;&amp;lt; Rails.root.join('locales/pl.yml') # loads single translation file
I18n.load_path &amp;lt;&amp;lt; Rails.root.join('locales') # loads all translation data files in specific directory
I18n.load_path &amp;lt;&amp;lt; Rails.root.join('locales/*.{yml,rb}') # loads all translation data files  by given pattern&lt;/pre&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;em&gt;I18n.wih_locale&lt;/em&gt; which executes block in given locale set
   &lt;pre&gt;
I18n.with_locale("pl-PL") do
  # This code are being executed with pl-PL locale
end&lt;/pre&gt;
  &lt;/li&gt;
   &lt;li&gt;
      Making &lt;em&gt;MissingTranslation&lt;/em&gt; message thrown by &lt;em&gt;I18n.localize&lt;/em&gt; method complete, as previously when translation was missing it returned partial message e.g. for &lt;em&gt;I18n.l Time.now, :format =&amp;gt; :missing&lt;/em&gt; I was getting: &lt;em&gt;translation missing: en, long_ordinal&lt;/em&gt;, what was misleading and now I&amp;#8217;ve got: &lt;em&gt;translation missing: en, time, formats, long_ordinal&lt;/em&gt;
   &lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;p&gt;The only thing I really don&amp;#8217;t like in new i18n is forcing I18n.locale to Symbol &amp;#8211; why? it should absolutely be a String&lt;/p&gt;

&lt;h4&gt;Anyway, thanks to Rails i18n team for great improvements on i18n, and looking forward for fixed issues in next gem version (and Rails3, of course).&lt;/h4&gt;</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2009-11-04:/blog/2009/11/04/dev-talk-on-the-vodaphone-mobile-widget-platform.html</id>
    <title type="html">Dev Talk on the Vodaphone mobile widget platform</title>
    <published>2009-11-04T08:30:00Z</published>
    <updated>2010-01-18T12:59:01Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2009/11/04/dev-talk-on-the-vodaphone-mobile-widget-platform.html"/>
    <content type="html">&lt;p&gt;Maciej gave a presentation today based on his work creating mobile widgets for a client using the Vodaphone mobile widget platform. Here are the slides:&lt;/p&gt;

&lt;iframe src="http://docs.google.com/present/embed?id=df6dg3ks_166fsxx53hg" frameborder="0" width="410" height="342"&gt;&lt;/iframe&gt;</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2009-10-09:/blog/2009/10/09/lunar-logic-polska-launches-coderack-global-coding-contest.html</id>
    <title type="html">Lunar Logic Polska launches CodeRack global coding contest</title>
    <published>2009-10-08T22:45:00Z</published>
    <updated>2010-01-18T12:59:01Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2009/10/09/lunar-logic-polska-launches-coderack-global-coding-contest.html"/>
    <content type="html">&lt;p&gt;CodeRack is a coding contest dreamed up by a group of the Ruby programmers at Lunar Logic Polska who were excited about the possibilities of Rack middleware. The team wants to encourage Ruby developers to explore the possibilities and what better way than to hold a contest? The secondary goal of the contest is to generate a set of open source solutions that will solve real problems and inspire others. Every entry will be released under the MIT open source license.&lt;/p&gt;

&lt;p&gt;Programmers are encouraged to submit contest entries that will be judged based on the cleverness of the application and the elegance of the code. Entries can be submitted at http://www.coderack.org until midnight EST November 15th. Finalists are scheduled to be announced on the 1st of December and public voting will run for one month. The final winners will be announced on the 5th of January.&lt;/p&gt;

&lt;p&gt;The first round of the contest will be judged by an elite panel of judges including Ben Bangert of O'Reilly Media, Chris Wanstrath and PJ Hyett of GitHub, Joshua Peek of 37Signals, Yehuda Katz of Engine Yard and Rails core team member, Ryan Tomayko of Heroku, Core Rails team member Matt Aimonetti, and the Rails Envy team of Gregg Pollack and Jason Seifer.&lt;/p&gt;

&lt;p&gt;Once the finalists have been selected by the panel, the public will vote for the top prize winners.&lt;/p&gt;

&lt;p&gt;Prizes have been donated by Bytemark Hosting, GitHub, Jetbrains, Mindmeister, Freelance Total, Heroku, Rackspace Hosting, Peepcode, BDDCasts, and Zenbe Shareflow. The top prize includes a dedicated quad core server package and is valued at over $3000. Every entrant will receive a credit from bddcasts.com and $30 credit from Heroku. All finalists will receive a package including Zenbe Shareflow subscriptions, a RubyMine license from JetBrains, and five credits from bddcasts.com. Details of all of the prize packages will soon be available on the coderack.org website.&lt;/p&gt;

&lt;p&gt;More information about the contest, including the contest rules, can be found at www.coderack.org.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Rack?&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;The Rack documentation describes it this way:&lt;/p&gt;

&lt;p&gt;"Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call."&lt;/p&gt;</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2009-07-15:/blog/2009/07/15/our-new-planning-poker-cards-are-featured-on-creattica.html</id>
    <title type="html">Our new planning poker cards are featured on Creattica</title>
    <published>2009-07-15T08:00:00Z</published>
    <updated>2010-02-08T11:44:39Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2009/07/15/our-new-planning-poker-cards-are-featured-on-creattica.html"/>
    <content type="html">&lt;p&gt;Creattica is the premium design site, picking only the best examples of design to share. We are very proud that the planning poker cards designed by our own Mariusz Cie&#347;la were featured. &lt;/p&gt;
&lt;p&gt;Planning poker is the way of estimating project iterations in agile project management. The idea behind planning poker is simple. Individual stories are presented for estimation. After a period of discussion, each participant chooses from his own deck the numbered card that represents his estimate of how much work is involved in the story under discussion. All estimates are kept private until each participant has chosen a card. At that time, all estimates are revealed and discussion can begin again.&lt;/p&gt;
&lt;p&gt;Visit the entry on Creattica &lt;a href="http://creattica.com/business-cards/lunar-logic-polska-planning-poker/21834"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;img src="/images/posts/planningpoker.png"&gt;</content>
  </entry>
  <entry>
    <id>tag:lunarlogicpolska.com,2009-07-14:/blog/2009/07/14/comming-soon-breakglass-password-manager.html</id>
    <title type="html">Coming soon - BrokenGlass password manager</title>
    <published>2009-07-14T16:45:00Z</published>
    <updated>2010-02-08T11:44:30Z</updated>
    <link rel="alternate" href="http://lunarlogicpolska.com/blog/2009/07/14/comming-soon-breakglass-password-manager.html"/>
    <content type="html">&lt;p&gt;BrokenGlass was built for our internal use, but we'll shortly be releasing it as an open source project. BrokenGlass is a group password manager based on a simple concept. No one needs to know anything, until they do. When your boss catches you online at 2AM and you're the only one in the company awake and a client's server needs a reboot, what do you do? The sleeping SysAdmin has the data you need but that does you no good. With BrokenGlass, a team can store passwords or any other important data securely, and any employee with an account can access that data, but doing so requires a reason and triggers an email to notify the Admin to tell them who accessed what data and when. Hopefully, you'll never need it, but if it sounds like it might be handy, stay tuned for the release notification. It's the data equivalent of leaving a set of house keys with a neighbor.&lt;/p&gt;
&lt;img src="/images/posts/brokenglass.png"&gt;</content>
  </entry>
</feed>
