Our Blogs
Even more powerful Goolge Visualizations for Ruby on Rails
Ok, now you can easily implement a Google Visualization API data source on rails. But… are you still using javascript to render them? Well, you don’t need to do that anymore. Now rgviz-rails supports a pretty simple and powerful way to do it. In your views templates you now have an rgviz function. You use [...]
Careful when using mutable types as default arguments in Python
As an intermezzo in the blog posts regarding my thesis, I’d like to point out an unexpected (or at least, unexpected for me) behaviour in Python’s way of constructing default arguments. Suppose we have the following python class MyClass, with an initializer with a default list parameter: class MyClass: def __init__(self, list=[]): self.list = list [...]
Powerful Google Visualizations for Ruby on Rails
So we have this project in Ruby on Rails where we keep track of the amount of infected and death cases of several diseases in cross-border locations. Now we need to do some visualizations with all those reports, like showing the amount of infected cases in each location for a given disease. We analyzed several [...]
Partitioned Graph Coloring
Before going into how to solve the partitioned graph coloring problem using integer linear programming (which is the goal of my thesis), I thought it would be a good idea to actually explain what is the partitioned graph coloring problem (or PCP from now on). Graphs and partitions First of all, graphs. Formally, a graph [...]
What is Linear Programming
Despite being able to simply provide a link to wikipedia’s already excellent article on Linear Programming, I wanted to provide a short introduction in order to present what I am doing exactly on my thesis in a future article. Linear Programming is best described as a technique, in which we want to maximize or minimize [...]
Making a thesis 2.0
Continuing with the tradition started by Beta two years ago here in Manas, I am now dedicating all my efforts to finish my thesis in order to obtain my MSc degree in Computer Science at FCEN-UBA. Having started it a few months ago, Manas generously started sponsoring my work in May, so I can deal [...]
Building an application to track expenses in one hour using GeoChat
Whenever one of our team member travels to another country we tell her to track expenses like food, transportation and accomodation so that later that money can be refunded. Each of us does it in a different way: we write it in a notes application in a cellphone, or in a text file in our [...]
Install the RMagick gem in the painless way with Homebrew
Introduction
Disclaimer: this section is just happy talking, if you want to get right to the beef, skip it and go right to the beef.
Yesterday was a sad day for me. It wasn’t meant to be like that.
I began the day with the intention of setting up a development environment for this amazing RoR application I’ll [...]
Quick way to test many values in ruby
Many times we end up having similar tests: same logic but different inputs and expected outputs. For example, suppose we need to test our brand new sqrt function:
test "sqrt 1" do
assert_equals 1, sqrt(1)
end
test "sqrt 4" do
assert_equals 2, sqrt(4)
end
test "sqrt 9" do
assert_equals 3, sqrt(9)
end
Here we are dupplicating code, since “assert_equals [...]
Deleting children with accepts_nested_attributes_for in Rails
On the previous post I wrote a few lines on the basic usage of the accepts_nested_attributes_for method in rails models. I strongly recommend reading that post before this one if you haven’t. Although there is a standard way for deleting items, there is few information on how to deal with them on the model or [...]