Mike's Blog

Passing on knowledge about software development and other related technologies.

Ruby Posts

Statistics In Ruby

With users demanding more sophisticated dashboards and reports in this ocean of Data Science and Artificial Intelligence I thought it would be prudent to review how to calculate some basic statistical functionality in Ruby. First, let me point out all the code shown below should work with Ruby 2.7 and above. All the examples are in IRB. I am not here to write your code, but I do want to show you how to do the math in Ruby. Let's get started!

Calculating the Average (Mean)
Unfortunately, Ruby does not provide a native method to generate an average (mean) v... Continue reading

Ruby 3.0 - Promises Delivered

After five years of hard work by the core language team, Ruby 3.0 was released on Christmas 2020 with better performance and other features for this high-level general-purpose programming language.

Why am I writing a review six months later? I wanted to get plenty of "hands-on" time with the new version before commenting on it. Let's get going...

Ruby 3.0 was developed with a focus on better performance, concurrency, and typing and achieved its goal of being 3x faster than the performance of Ruby 2.0. That 3x speed-up is when making use of the new Ruby 3.0 J... Continue reading

Getting Started With Ruby Arrays For Beginners

What exactly is an Array?

Arrays are objects (remember everything is an object in Ruby) that can store multiple values such as numbers or strings. Simplified, an array is a collection or list of things. Arrays are generally used to hold a collection of data that needs to be displayed or manipulated by your program. Their data can come from any source, user input, databases, or computed values. In Ruby (like many other languages), arrays are ordered, integer-indexed collections of any type object. This means that each element in an array is associated with and referred to by an ... Continue reading

What is Foreman and when should I use it?

Many times when writing complex ruby applications or using frameworks (like Rails, Sinatra, or others) you end up having several processes that have to be running during development to allow it to run such as web services, message queues, or some other type of process. Foreman allows you to manage these different processes under one management gem. Foreman uses a file called Procfile.

Getting Started

First, let's setup the Procfile. A Procfile is a list that contains a name to identify the process and the command used by the system to run it. Foreman ... Continue reading

Speak Up!

My favorite projects are when I get to find a solution to small problems for clients and solve them quickly for them. I had a client that needed some Text To Speech (TTS) capabilities on a small Linux system in their shipping department. Easy enough right? After a little research, I found a really simple open-source code example of TTS that someone had posted that would work on Windows, Linux, and a Mac and written in Ruby.

While this post is old, I have updated the example code to work with Ruby 2.7. I did a bit of refactoring and customizing ended up with a pretty cool little ... Continue reading