Douglas Drumond Kayama

  • pt
  • About

Posts

November 14, 2012

Evernote Hackathon Brazil

Last weekend (Nov 10–11), Evernote held the second edition of Evernote Hackathon Brazil. It was my first 24H hackathon and it was very exciting. I had participated in two hackathons before, but the doors were shut down at night.

The trip

The hackathon was held in São Paulo city at Academia Wayra, a startup incubator located in a very cool building with a nice view. It was the first time Pinheiros river looked nice. Edited: fixed river name.

read more
November 8, 2012

Migrating and pruning repos

Recently I had to put a folder from my app repository into a separate repository on its own. The easiest way was just git init a new repo, copy the directory and git commit it, but I would lose all history up until the move. After fiddling with git and Stack Overflow, I found the solution.

Suppose the structure is like this:

All-in-one repo:
* server
    * code.go
    * code2.go
* iOS
    * code.m
    * code.h
* Android
    * src
        * com
            * cafelinear
                * myapp
                    * Code.java
                    * Code2.java

We want to move the server code into its own repo, so, final result will be like this:

read more
November 6, 2012

Replacing in bash without sed

Bash has built-in substitution. For simple tasks it’s easier than piping through sed:

text="hello world"
echo ${text/hello/ohayou}   # prints ohayou world

Be aware that just the first word is changed:

text="hello world hello"
echo ${text/hello/ohayou}   # prints ohayou world hello

To change all instances of a world, prepend the search pattern with another slash:

text="hello world hello"
echo ${text//hello/ohayou}   # prints ohayou world ohayou

Notice there are two slashes before hello, one as the separator and one prepending it.

read more
April 3, 2010

Eigenclass

In Ruby, there’s the concept of eigenclasses, or singleton classes. These are classes implicitly defined when attaching methods to a single instance.

From Wikipedia:

Ruby is object-oriented: every data type is an object, including classes and types which many other languages designate as primitives (such as integers, booleans, and “nil”). Every function is a method. Named values (variables) always designate references to objects, not the objects themselves. Ruby supports inheritance with dynamic dispatch, mixins and singleton methods (belonging to, and defined for, a single instance rather than being defined on the class).

read more
February 28, 2010

The Coffee Song

Frank Steinhoff suggested this Sinatra’s song. It’s about coffee and Brazil and it would have arise in a coffee talk at IMECC’s coffee room.

Way down among brazilians
Coffee beans grow by the billions
So they’ve got to find those extra cups to fill
They’ve got an awful lot of coffee in Brazil
You can’t get cherry soda’cause they’ve got to sell that quota
And the way things are I’ll bet they never will
They’ve got a zillion tons of coffee in Brazil

read more
February 28, 2010

A romance of many dimensions

Editor’s note:This is a guest post from Luciana Takata.

Last week I read for the second time Flatland − a romance of many dimensions (Edwin A. Abbot, 1884). No matter how many times I read this book I guess I’ll never stop finding it interesting.

In Flatland, its inhabitants − triangles, squares, pentagons and other two-dimensional geometrical figures − can only move to right, left, forward, backward or its composed directions. Up or down simply don’t exist. That’s what a square, inhabitant of Flatland, was used to. Its beliefs (and life) completely change when a sphere comes out of (apparently) nowhere and presents to the ignorant square the third dimension and throw it into the unimaginable space of three dimensions.

read more
February 25, 2010

Problem solving, artificial intelligence and computational linear algebra

When students come to computer science, it’s hard to motivate them to learn fundamental mathematics subjects such as linear algebra and numerical calculus. In this post I intend to spark this motivation through AI and sketch a method (and some variations) to solve optimization problems.

It’s hard to define AI. We know what artificial means, but what about intelligence? Russel and Norvig [1] present us four approaches to AI: systems that think like humans, systems that think rationally, systems that act like humans and systems that act rationally. Let’s focus on last one, systems that act rationally. What that means? It means a rational agent acts so as to achieve the best outcome, i.e., find the optimal solution.

read more
February 23, 2010

Engineering Paradise

Edit: this is another restored old post.

This is old, but I think it’s so funny and propelling to study I feel I must share it.

This video was made by a colleague, John Cohn, at IBM as a contest for choosing best video to encourage young people to go into engineering and computer science. He made it for fun, since he couldn’t take part at contest as he was organizing it, but he felt it would be good to create something to use as example. Since engineering and computer science are deeply related to math, it fits in here as well. He’s an “IBM Fellow, Mad Scientist and cast member of Discovery Channel’s post-apocalyptic survival show ‘The Colony’”. And he has great taste for shirts :)

read more
  • ««
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • »
  • »»
© Douglas Drumond Kayama 2025