Black Bytes | RSS Feed http://www.blackbytes.info Ruby Programming Tutorials Fri, 01 Jul 2016 03:12:19 +0000 en-US hourly 1 http://wordpress.org/?v=4.3.5 Building Your Own Linux Tools with Ruby: A Practical Guide http://www.blackbytes.info/2016/06/linux-tools-with-ruby/ http://www.blackbytes.info/2016/06/linux-tools-with-ruby/#comments Mon, 27 Jun 2016 19:14:34 +0000 http://www.blackbytes.info/?p=2921 Tools like ps, top & netstat are great, they give you a lot of information about what’s going on your system. But how do they work? Where do they get all their information from? In this post we will recreate three popular Linux tools together. You are going to get a 2×1 meal, learn Ruby […]

The post Building Your Own Linux Tools with Ruby: A Practical Guide appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/06/linux-tools-with-ruby/feed/ 6
Ruby Ranges: How Do They Work? http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/ http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/#comments Tue, 14 Jun 2016 15:56:50 +0000 http://www.blackbytes.info/?p=2906 Have you ever wondered how ranges work in Ruby? Even if you haven’t, isn’t it fun to discover how things work under the hood? That’s exactly what I’m going to show you in this post. Understanding Ranges Just as a reminder, this is what a Ruby range looks like: [crayon-5776202670377253093985/] The parenthesis are not necessary […]

The post Ruby Ranges: How Do They Work? appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/06/ruby-ranges-how-do-they-work/feed/ 5
5 Useful Examples From The Ruby Standard Library http://www.blackbytes.info/2016/05/ruby-standard-library/ http://www.blackbytes.info/2016/05/ruby-standard-library/#comments Mon, 16 May 2016 14:31:00 +0000 http://www.blackbytes.info/?p=2847 The Ruby Standard Library is a series of modules & classes that come with Ruby but are not part of the language itself. These classes offer a variety of utilities like Base64 encoding, prime number generation & DNS resolution. In this article I’m going to show you 5 of these classes with useful examples. Unique […]

The post 5 Useful Examples From The Ruby Standard Library appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/05/ruby-standard-library/feed/ 0
How to Generate Weighted Random Numbers http://www.blackbytes.info/2016/05/weighted-random-numbers/ http://www.blackbytes.info/2016/05/weighted-random-numbers/#comments Tue, 03 May 2016 16:50:30 +0000 http://www.blackbytes.info/?p=2808 Random numbers usually follow what we call a ‘uniform distribution’, meaning that there is the same chance that any of the numbers is picked. But if you want some numbers to be picked more often than others you will need a different strategy: a weighted random number generator. Some practical applications include: the loot table […]

The post How to Generate Weighted Random Numbers appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/05/weighted-random-numbers/feed/ 2
Metaprogramming in The Wild http://www.blackbytes.info/2016/04/metaprogramming-in-the-wild/ http://www.blackbytes.info/2016/04/metaprogramming-in-the-wild/#comments Mon, 11 Apr 2016 14:09:06 +0000 http://www.blackbytes.info/?p=2751 You may have read about Ruby metaprogramming before & maybe you have used it in some of your projects, but how are some of the most popular open-source projects making use of this feature? Find out in this post! Rails Example Rails makes heavy use of metaprogramming, so it’s a good place to start looking. […]

The post Metaprogramming in The Wild appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/04/metaprogramming-in-the-wild/feed/ 0