Systems | Development | Analytics | API | Testing

Ruby

Predicting the Future With Linear Regression in Ruby

The world is full of linear relationships. When one apple costs $1 and two apples cost $2, it's easy to figure out the price of any number of apples. But what happens when you have 100s of data points? What if your data source is noisy? That's when it's helpful to use a technique called linear regression. In this article Julie Kent shows us how linear regression works, and walks through a practical example in Ruby.

Changing the Approach to Debugging in Ruby with TracePoint

Ruby has always been known for the productivity it brings to its developers. Alongside features such as elegant syntax, rich meta-programming support, etc. that make you productive when writing code, it also has another secret weapon called TracePoint that can help you “debug” faster. In this post, I’ll use a simple example to show you 2 interesting facts I found out about debugging.

Decoupling Ruby: Delegation vs Dependency Injection

We've all worked with tightly-coupled code. If a butterfly flaps its wings in China, the unit tests break. Maintaining a system like this is...unpleasant. In this article, Jonathan Miles dives into the origins of tight-coupling. He demonstrates how you can use dependency injection (DI) to decouple code. Then he introduces a novel decoupling technique based on delegation that can be useful when DI is not an option.

A Rubyist's Introduction to Character Encoding, Unicode and UTF-8

Have you ever dealt with a unicode bug? Where plain text — the substance you work with all day — can no longer be trusted? It can be disorienting to say the least! This article will help prepare you so that the next time that happens you’ll be able to spend less time hyperventilating and more time troubleshooting.

Configurable Ruby Modules: The Module Builder Pattern

In this post, we’ll explore how to create Ruby modules that are configurable by users of our code — a pattern that allows gem authors to add more flexibility to their libraries. Most Ruby developers are familiar with using modules to share behavior. After all, this is one of their main use cases, according to the documentation.