lunes, 20 de diciembre de 2010

PLOP Loops Over PLOP

Quines, like JAPHS, are great hobbies for us, little riddle-solvers.
Here are the 3 most amazing quines I found lately.

third order quine . And here's a SO post discussing a bit about it

ruby rotating earth quine

The new kid on the block. Judge yourself.

For those who didn't bother to google or wikisearch, here's a quine guide

And here, a lisp quine that shows the greatness of simplicity.

((lambda (x) (list x (list 'quote x)))
'(lambda (x) (list x (list 'quote x))))

PS: This post is under 'mis cosas' (personal) tag, because there's much more than programming involved in the mind process to understand these things. So yes, quines are a cool concept even IRL.

sábado, 18 de diciembre de 2010

Text Driven Development

As I already posted, I got a new job in Barcelona, doing mostly apps in Rails (particularly ubiquo, cms)

Luckily, the company is pro-gnu, so I can use linux with all my usual configs. Using ratpoison in a double screen is an awesome experience.

For the moment I lived between the two worlds (gnome vs ratpoison) because I'm continuously asking things to more experienced people, and they usually want to use the mouse when they are on my computer. And I haven't configured everything yet.


Last week, I was assigned a project and was given a 100+ pages document with the functional analysis of the project. First thing to do was reading it and making good outlines of it to create a mental model of the program.

I decided to use emacs org-mode to do the outlinings, and probably the TODOs and Schedules. IT's pretty neat, and doing everything with text files gives me a kind of relief, that everything is under control. In fact, that's one of the things that gets on my nerves about pharo. Being able to use your well known tools in a synergic way is great (IMHO)


After that, I created an UML class diagram.
"We use argouml" someone said. Well, argouml has improved amazingly since the last time I tried it, but honestly, for me it doesn't cut. It has some kind of code generator (for java) and some design-critics, that seem cool enough to use it, but given that the web development constrains you to use minimal oop features, I could not listen to the design-lint.

After finishing the damn UML, I looked for other tools that could do pretty UML diagrams from ascii. And they do exist. Great! I'll try to use them the next time. I think plantuml is a fairly good option and, guess what? you can integrate it in emacs.


On the other side, on wednesday, I did a talk at about pharo regexes. The slides where presented in a terminal, in plain ASCII, using a small app borrowed from fxn. Btw, the talk went pretty well. Very informal and kind of simple for people versed in regexes (smalltalk regexes do not have any special unique feature but the opposite, a bit simple IMO), but I think maybe 30% of the people didn't know about regexes and used them just copypasting, so I extended my talk to touch some more theoric side, and in the end, I think everyone learned something.

Btw, if you feel like implementing a regex engine for smalltalk, you can get ideas from this paper. A good read IMHO

jueves, 2 de diciembre de 2010

HAHA! You're not regular anymore!1

Via HN I saw praprog released another magazine, this one fully dedicated to ruby (What a coincidence! :) )

I skimmmed all the articles but paying more attention to a couple of them:

One of them talk about new features of Ruby 1.9.2. It seems ruby is getting faster and faster on every release (a good thing since speed is one of the major 'problems' I had read about ruby).

Another place where it has improved is on the regex side. Now ruby regexes allow named captures (feature added to perl in 5.10 IIRC), and recursive regexes (The not-so-regular regexes are here) there are some flags like /x /g and /k, that let you reference captures more easily than plain old \1, \2 ...

All in all, quite cool stuff that makes me feel a bit more at (perl) home.

Unfortunately, I couldn't practice with rails yet. I did some progress on ruby koans though. A busy week in Tenerife.