Ruby-Kafka, async_producer and large messages - buffer overflow issue

Waiting for a new project (I am so excited about a new one!) is a good time to go back to recent problems. (Un)fortunately some time ago me and my colleague noticed problems on the one of our production servers. After a few hours we discovered the reason. There were two things - our lack of knowledge and a little bug in ruby-kafka gem. Debugging was really fun, so I decided to describe it. _config.yml

Read More

Multiprocessing in Ruby

The most common way to use concurrency in Ruby is to use Threads, but do you heard about multiprocessing that allows as to parallel execution?

Read More

K-Nearest neighbors algorithm - the first step to Machine Learning?

Machine Learning is like a magic word now - for sure you have heard something cool about it, a lot of developers tried to build some models using ready to use libraries like scikit-learn, but still some of us are affraid of it. But do you know that you can implement your first ML algorithm for your own. I read some time ago, not sure where, that k-Nearest neighbors is the first what you should try if you are interesting in ML. _config.yml

Read More

Quick class preview from rails console

One think I really like in Rubymine is that it knows where are classes are and thanks to that we can move to them with one click. After moving to VIM I installed vim-definitive plugin that adds this future. Unfortunatelly, it doesn’t work with ruby gems, we can go to definitions in project, but not to gems.

Read More

ActiveRecord find_or_create_by and concurrency - how to handle it?

ActiveRecord provides a bunch of useful methods. One of them is a find_or_create_by which is cool, because it avoids using IF statement. Unfortunately, as in life, everything that is easy to use, isn’t always optimal. Under certain conditions, we may encounter some problems. Sometimes, even though it will work on one thread well, doesn’t mean it will be working correctly on parallel.

Read More

Vim 8.0 vs Mojave

If you’re using VIM, you have probably noticed, that after update to Mojave your VIM has some problems..

Read More

Form Objects on Rails

Form objects separated into a new classes are great for separating views from business logic. They are especially useful when we update one model, for example user details, on a few steps.

Read More