Today's episode demonstrates a technique for speeding up the process of sorting some collections.
Tag: containers
Episode #170: Hash Merge
Today's episode covers an incredibly handy capability of Ruby's hashes that I didn't know about until recently.
Episode #168: Enumerable Internals
In this very special episode, guest chef Pat Shaughnessy takes us on a whirlwind tour of the Ruby internals that make the Enumerable#all? method tick.
Episode #165: Refactor Tapas::Queue
In previous episodes, we got the Tapas::Queue class under test, using a couple of different thread-testing techniques. Now that it has tests, it's time to refactor. The steps of this …
Episode #160: Reduce Redux
Today we revisit the Enumerable#reduce method, addressing some viewer feedback about seed values as well as exploring a novel application of reduce for traversing data structures.
Episode #159: Array Set Operations
Sometimes we'd like to treat Ruby arrays like sets, in which each item is unique. Today's dish shows how!
Episode #156: Array New with James Edward Gray II
Today, special guest chef James Edward Gray II hosts, and shows us a thing or two about generating arrays pre-filled with values!
Episode #150: Stats
Sooner or later you'll need to generate statistics from a collection. In this episode, we look at how to produce min, max, sum, average, median, and standard deviation from a …
Episode #149: Sum
Today's episode takes on a simple task--summing up a list of numbers--and uses it to demonstrate both the Enumerable#reduce method as well as Symbol#to_proc.