Tag Archives: code

Binary Search Revisited

As ubiquitous as it is, the standard binary search algorithm can still be further optimized by using bit operations to iterate through its sorted list, in place of arithmetic. Admittedly, this is primarily an academic discussion, since the code improvement does not decrease the logarithmic complexity of the standard algorithm. Nevertheless, a well-developed programming intuition [...]
Posted in code, programming | Also tagged | 3 Comments

Cascading, TF-IDF, and BufferedSum (Part 1)

Introduction A common technique in MapReduce is to input a group of records, calculate a value from that group, and emit each record with the new value attached. While this is easy to do in raw MR jobs, the solution in Cascading is not very obvious. This tutorial introduces a new operation to Cascading called [...]
Posted in big-data | Also tagged , | 1 Comment

Interval – a ruby library for musical interval arithmetic

Interval interval is a tiny library that provides simple musical note pitch and interval arithmetic. It is intended to do one thing: given a pitch add (or subtract) an interval and give the resulting pitch. Observe: p = Interval::Pitch.from_string("c") i = Interval::Interval.from_string("M3") p2 = p + i p2.to_short_name # => "e"   i.to_s # => [...]
Posted in music | Also tagged , | Leave a comment