Black Bytes » Programming http://www.blackbytes.info Ruby Programming Tutorials Thu, 24 Sep 2015 17:01:59 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.8 N-gram Analysis for Fun and Profit http://www.blackbytes.info/2015/09/ngram-analysis-ruby/ http://www.blackbytes.info/2015/09/ngram-analysis-ruby/#comments Mon, 14 Sep 2015 15:24:13 +0000 http://www.blackbytes.info/?p=2202 What would you do if you are given a big collection of text and you want to extract some meaning out of it? A good start is to break up your text into n-grams. In the fields of computational linguistics and probability, an n-gram is a contiguous sequence of n items from a given sequence […]

The post N-gram Analysis for Fun and Profit appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/09/ngram-analysis-ruby/feed/ 0
Recursion and Memoization in Ruby http://www.blackbytes.info/2015/08/ruby-recursion-and-memoization/ http://www.blackbytes.info/2015/08/ruby-recursion-and-memoization/#comments Mon, 17 Aug 2015 16:26:51 +0000 http://www.blackbytes.info/?p=2156 Have you ever wondered if there is an alternative to iteration? Well I have good news for you: there is, and it’s called recursion. Recursive functions are those that keep calling themselves until they hit an end goal (also known as the base case). The idea is that after each function call we make some […]

The post Recursion and Memoization in Ruby appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/08/ruby-recursion-and-memoization/feed/ 6
Static Analysis in Ruby http://www.blackbytes.info/2015/08/static-analysis-in-ruby/ http://www.blackbytes.info/2015/08/static-analysis-in-ruby/#comments Sun, 02 Aug 2015 15:52:50 +0000 http://www.blackbytes.info/?p=2122 If you want to know something about your source code, like the name and line number of all your methods, what do you do? Your first idea might be to write a regexp for it, but what if I told you there is a better way? Static analysis is a technique you can use when […]

The post Static Analysis in Ruby appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/08/static-analysis-in-ruby/feed/ 0
Debugging your Ruby Programs http://www.blackbytes.info/2015/07/ruby-debugging/ http://www.blackbytes.info/2015/07/ruby-debugging/#comments Sun, 12 Jul 2015 14:20:53 +0000 http://www.blackbytes.info/?p=2018 How often does your program do exactly what you want the first time around? Many times our programs won’t work like you expect, so we have to use the art of debugging ruby to help us finding out why. You may be familiar with the following error message: [crayon-560467f423c5c831333627/] As you know, this means that […]

The post Debugging your Ruby Programs appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/07/ruby-debugging/feed/ 8
Using Ruby Threads http://www.blackbytes.info/2015/07/ruby-threads/ http://www.blackbytes.info/2015/07/ruby-threads/#comments Mon, 06 Jul 2015 13:30:29 +0000 http://www.blackbytes.info/?p=1954 Using ruby threads you can make your applications do multiple things at the same time, making it faster. In MRI (Matz’s Ruby Interpreter) you will only benefit from threads in i/o bound applications. This limitation exists because of the GIL (Global Interpreter Lock), alternative Ruby interpreters like JRbuy or Rubinius can take full advantage of […]

The post Using Ruby Threads appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/07/ruby-threads/feed/ 0