AgileAndArt

The Art Improving Agile Software Development

Browsing Posts tagged Programming

O modelo de Dojo que estamos acostumados é o Dojo Randori, aquele em que temos uma dupla programando (o piloto e o co-piloto) e um telão para mostrar para o resto da plateia o código que está sendo feito. A cada 5 ou 7 minutos o co-piloto ocupa o lugar do piloto e alguém da plateia ocupa o lugar do co-piloto. No Randori, todo desenvolvimento é sempre feito usando TDD.

O Dojo Kake é uma modalidade diferente de Coding Dojo. No Kake, nós temos sempre duas ou mais duplas trabalhando simultaneamente. As duplas podem resolver o mesmo problema em linguagens diferentes ou problemas diferentes. Os turnos continuam sendo de 7 minutos, porém a plateia NÃO PODE ficar olhando a dupla programar. A ideia é sentar para programar sem ter a menor noção do que estava acontecendo antes. É uma simulação da vida real: você chega para trabalhar num projeto que já começou, tem código legado. O seu par deve conseguir te explicar o que foi feito até então e vocês precisam avançar com o código. Depois de 7 minutos, o seu par sai e agora fica com você a responsabilidade de explicar para o próximo o que foi feito e continuar resolvendo o problema. Algumas regras do Kake Dojo:

  • Dois ou mais computadores, dependendo da quantidade de participantes
  • Turnos de 7 minutos
  • TDD, baby steps, refatorações continuam sendo obrigatórios
  • Divertir-se é obrigação: bater papo, contar piadas, cantar uma música, jogar video game, vale TUDO, menos olhar os outros programando
  • Comida durante toda a sessão (pizza, sanduíche de metro ou jantar gourmet)
  • No final fazemos uma retrospectiva usando a técnica dos 6 chapéus

Algumas cenas do último Dojo Kake que realizamos em 2009 podem ser vistas no vídeo:

Vamos fazer um Dojo Kake na próxima 3a. feira, dia 17 de agosto as 20h. Quem estiver interessado em participar, mande um e-mail para mim: danicuki arroba gmail ponto com.

This weekend I was working at the first Random Hack of Kindess mundial edition. There were 4 people in our team and we worked on a project called Urban Fact (Fato Urbano in Portuguese). The main idea of this project is to emphasize GOOD orBAD facts in your city. If you see someone throwing the garbage over the streets, just take a picture and post it on twitter using #urbanfact hashtag (or #fatourbano). This picture automatically  goes to the project website, where people can vote, comment and share with friends.

For the solution, we used Rails for the web interface, MySql as database and Python for the backend twitter collector. We also used Google Maps API to automatically generate the map with all entries. All code is available at my github account. We hosted the website in a Locaweb Cloud Server.

Our project earned the 2nd best project prize!

Visit my flickr account to see the pictures of this event.

Last month, at QCON, I was in a great talk about functional programming languages (like Haskell) and their benefits to the Art world. The title of the talk was “How Functional Programmers can
Help, Inspire, or even Be Artists”. First of all I’d like to emphasize that all good programmers are artists, and as Richard Gabriel said 6 years ago, we programmers should be trained like artists. This is the major problem of our Computer Science Courses.

We all know artificial intelligence and computer tools are getting better and better. Right know we can easily produce things like this video:

In his talk, Prof. Paul Hudak also showed the examples of how we can do image animation using functional programming. The project he described was the Functional Reactive Animation (FRAN). All these things are not really new, but now that functional languages are returning to the main stream, those are the things that begin to appear. With tools like FRAN, an animation can be made as easy as this:

 growFlower u = buttonMonitor u `over`           stretch (grow u) flower

grow u = sizewheresize = 1 + atRate rate urate = bSign u

Of course if you don’t know functional programming this is strange and difficult, but just think about an application which enlarges and shrinks an image when you press right or left mouse button. Think that this application can be written in those 6 code lines above.

Another application for functional programming is music. I recently acquired my MacBook last week I used Garage Band software for the first time. It is amazing what one can do with music software. I’ve already played with Fruit Loops Studio (my favorite), Sony SoundForge (great too) and who don’t remember one of the first DJ software called MixMan.

But the focus of Paul’s presentation wasn’t in using tools, but in how you can build wonderful tools with less lines of code, just because functional programming were made for this kind of application. He showed an example of his Haskore project, a nice way to compose music using the Haskell functional language. You specify the program in terms of WHAT to do, not HOW to do it.

The design goals of the Haskore project are:

  • Simplicity, expressiveness, generality and performance
  • Real-time sound synthesis
  • Transparency
  • Good for signal processing, algorithmic composition and interactive applications

A small example of how you can write a song using Haskore. Here is the language definition for notes:

type Octave = Int
type Dur = Rational
type Pitch = (PitchClass, Octave)
data PitchClass = Cff | Cf | C | Dff | Cs | Df | Css | D | Eff | Ds
data PitchClass = Cff | Cf | C | Dff | Cs | Df | Css | D | Eff | Ds
| Ef | Fff | Dss | E | Es | Ff | F | Gff | Ess | Fs | Gf | Fss | G
| Aff | Gs | Af | Gss | A | Bff | As | Bf | Ass | B | Bs | Bss
data Prim a = Note Dur a | Rest Dur

So, a prim(itive) can be defined as

  • a note with a Picth (class + octave) and a duration (expressed as a real number)
  • or a rest with a duration (silence)

For example:

Note (1/4) (C,4) :: Prim Pitch – it is a Middle C quarter note

The music is defined as a sequence of primitive notes, or notes played in parallel:

data Music a = Primitive (Prim a) –primitive note or rest
| Music a :+: Music a –sequential composition
| Music a :=: Music a –parallel composition
| Modify Control (Music a) –modifier

This is just a little example, the language is much more complete, you can even define performance and interpretation using the language.

Ok, all these geek things are great and we love it. But I still have some doubts about how the most rooted concepts of creativity can be applied to these computational tools. I mean, I love music and I feel it when I listen to it, I feel it when I play the guitar with my band. I really don’t know how this tools can contribute to produce human interaction. Of course one can go home and program a nice music using Haskore, or do a couple of clicks in Garage Band to produce a pre-factoried song. This is wonderful, people can produce things that they could not some time ago. But what about the old fashion music composition? Will people in future have to know something about the pentagram and how to write a sheet?

To fill a song I need to close my eyes. To compose something in my piano I just close my eyes and play what comes, don’t know from where. Is there any computer tool that I can use with closed eyes? Or am I wrong and closing eyes isn’t necessary?

Professor Paul ends his talk telling us about an computacional application for dance. It is like a pentagram like represantation of steps and body movements. All right! Now you can formally define a dance script and send it to a robot and he will do a nice job, dancing.

My final question is: what is the robot feeling while he is in his perfect dance defined by an algorithm?

Switch to our mobile site