Grill.rb 2016 – Poland’s first outdoor conference review

grillrbIt’s about time to summarize some of the conferences that I’ve recently attended to. This post will be about Grill.rb that organizers claim to be “Poland’s first outdoor conference”. I was quite skeptical about that claim, but after I couldn’t find any other Poland’s outdoor conferences, I must admit that :).

And as many “first of a kind” conferences, this one was quite intimate. 60 attendees, 6 talks, open space, lightning talks, 35 kg of meet and a huge amount of great attitude.

Location

Day 1

On Saturday, we had a great weather. More than 30 Celsius degrees and gentle breeze. Anders Hill was definitely a great choice – peaceful and quiet place, with some trees giving us a bit of shadow to hide from the sun.

20160625_191809

Day 2

Organizers on Facebook called it the “Dungeon.rb” and I couldn’t agree more. The weather was not too kind for us the next day and we had to move to an indoor location. But even then, you could still feel the outdoor, “non commercial” vibe.

13495094_1705525553034950_1080983640665734947_n

Speakers/presentations/talks

One could say, that 6 presentations for 2 days is not enough. And it would be true, if it wasn’t for the Poland vs Switzerland game, barbecue time, open space and some other activities that were presented. If you ask me, I would say, that it was well-balanced. Especially, that it was suppose to be an outdoor, chill conference, not the “most professional, top knowledge !!!1111oneone” IT event ever. It’s not that it didn’t have pro talks ;), it’s more that its main goal was to provide a solid technical base in an open and friendly environment, where one could easily talk with one another. Think of it as a constant 2 day afterparty ;)

I’ve enjoyed all the talks and what strikes me is that more and more speakers seem to notice and speak about software quality (even when their talks are not directly related to it). I believe that it is a great trend. Achieving (at least) a decent quality is really important and unfortunately especially unexperienced programmers don’t see huge advantages that they gain reaching a certain point. The most interesting talk for me, was Krzysztof’s Tarnowski “Functional programming in Ruby”. It showed a different approach that aims to solve some of the Ruby programmers issues with an Erlang/Elixir approach.

If you’re interested in more details about the talks, ping organizers, hopefully they will publish presentations at some point, because it is definitely worth reviewing them, if you haven’t attended.

Open space – freedom of choice

What if you could propose a subject on which all the attendees can discuss? What if many people would do that, and you could pick about what you want to talk with others? This is exactly what happened during the 1st day. 3 groups, 3 topics, 3 rounds. Open Source gems vs Law and licences, ReactJS + Rails, Code Quality, DDD and many more. The only downside is that you cannot attend more than 1 at the same time. The more people, the more points of view you can see and understand. Great idea and great execution.

Food/grill

See for yourself :-) Yummy!

13497982_1705825163004989_5415868372842741787_o

Organization

It is hard to describe something that is good. There were only minor things that I could whine about, but it didn’t change my  perception of the whole conference so I consider  them irrelevant. Good job, guys!

Summary

Was it worth attending? Yes! Definitely yes! Was it good? Even more. Does the outdoor approach fits into IT conferences? I would say, that we need way more people with that approach (and attitude) than indoor, strict meetings. IT community is a community of people with open minds, and I feel that we integrate and feel way better in this type of environment, than inside of tiny, dark rooms with only projectors light.

18
Jul 2016
POSTED BY
POSTED IN Education Other Ruby
DISCUSSION 0 Comments

Ruby on Rails, Mysql2::Error: Incorrect string value: ‘\xF0\x9F\x99\x82’ and Specified key was too long; max key length is 767 bytes

If you get error like this one:

Mysql2::Error: Incorrect string value: '\xF0\x9F\x99\x82'

it means that you use verion of Mysql with settings that does not support full Unicode. Changing that in Ruby on Rails should be fairly simple:

class ChangeEncoding < ActiveRecord::Migration[5.0]
  def change
    config = Rails.configuration.database_configuration
    db_name = config[Rails.env]["database"]
    collate = 'utf8mb4_polish_ci'
    char_set = 'utf8mb4'

    execute("ALTER DATABASE #{db_name} CHARACTER SET #{char_set} COLLATE #{collate};")

    ActiveRecord::Base.connection.tables.each do |table|
      execute("ALTER TABLE #{table} CONVERT TO CHARACTER SET #{char_set} COLLATE #{collate};")
    end
  end
end

However you might encounter following error:

Specified key was too long; max key length is 767 bytes

767 bytes is the stated prefix limitation for InnoDB tables.

To fix that you need to:

  • Update your database.yml file
  • Upgrade to MySQL 5.7 or edit your my.cnf  to enable innodb_large_prefix
  • Change row format to DYNAMIC
  • Alter the database and all the tables using Ruby on Rails migration

Database.yml

You need to change your encoding and collation for ActiveRecord:

production:
  encoding: utf8mb4
  collation: utf8mb4_polish_ci

MySQL my.cnf

Edit my.cnf and add following lines:

innodb_large_prefix=on
innodb_file_format=barracuda
innodb_file_per_table=true

DYNAMIC row format

If you don’t do this, you will probably (if you have enough indexes) end up with this error:

767 bytes is the stated prefix limitation for InnoDB tables

To change row format, you need to run following query for each table:

ALTER TABLE table_name ROW_FORMAT=DYNAMIC;

However, you don’t need to do this manually – below you will find a Ruby on Rails migration that will do everything that is required to make things going.

Complex migration to set everything as it should be in the MySQL database

class ChangeEncoding < ActiveRecord::Migration[5.0]
  def change
    config = Rails.configuration.database_configuration
    db_name = config[Rails.env]["database"]
    collate = 'utf8mb4_polish_ci'
    char_set = 'utf8mb4'
    row_format = 'DYNAMIC'

    execute("ALTER DATABASE #{db_name} CHARACTER SET #{char_set} COLLATE #{collate};")

    ActiveRecord::Base.connection.tables.each do |table|
      execute("ALTER TABLE #{table} ROW_FORMAT=#{row_format};")
      execute("ALTER TABLE #{table} CONVERT TO CHARACTER SET #{char_set} COLLATE #{collate};")
    end
  end
end

After you run this migration, everything should work fine.

02
Jun 2016
POSTED BY
POSTED IN Default
DISCUSSION 0 Comments