ninajansen.dk

ninajansen.dk header image 1

Entries Tagged as 'ruby'

Introducing Cloud: an open-source ruby wordcloud generator

april 23rd, 2009 · Comments

I’ve just put out a new gem “cloud” that I’ve been working with on and off for the past few months. You can find it on github, it’s called ninajansen-cloud. I’ve also made a repository with examples which you can also find on github ninajansen-cloud_examples.
My motivation for this gem is that I love making wordclouds [...]

[Read more →]

Tags: cloud · gem · github · ruby

Cool complicated logic trick: use eval

november 3rd, 2008 · Comments

So I am working on an application where I have an array where I need to the sum of the values of members of the array, if they fulfill certain conditions. It looks like this:
if !A and !B
array.each do {|a| if (some condition) sum += a }
if A and !B
array.each do {|a| if (some other [...]

[Read more →]

Tags: eval · logic · ruby