Es como preparar robar un casino. Todo tiene que ir rodao.
Pero aquí estas más solo que la one.
El crono está en marcha.
Mañana imprimo, finde de estudio, el lunes examen, el miercoles entrego, y el siguiente presento.
Estoy de algoritmos genéticos hasta donde pueda estar uno.
Para motivarme ya escuho musica para robar casinos.
En dos semanas, finikitao. Y a volver a lo de antes: Musiquita los martes, frikismo los miercoles, cervecitas, futbolines, ensayos.... Hasta que me vuelva a cansar de casi todo.
Solo falta que aparezca Julia Roberts en el último momento. Y nos piramos a México. O donde sea.
jueves, 14 de enero de 2010
martes, 12 de enero de 2010
resolve git merge conflicts
My first experience merging non trivial merges on git went ok, but I didn't wrote down the steps, so I already forgot them.
Here's a quick summary of the steps to follow (my second non automatic merge).
git user manual explains how to do it fairly well. Of course, you can search on stackoverflow for user help. Many use rebase to "flatten" the branch history. That's up to you. Myself, I'm not confident enough to use those smart commands (Although git fans say that rebase is a git killer feature).
Here's a quick summary of the steps to follow (my second non automatic merge).
git pullThis pulls new updates to your local repo /working directory and notifies you there are conflicts that couldn't be automatically merged.
git mergetoolOpens your favourite $EDITOR with a 3-vertical panel split. Showing you local, merge and remote buffers. Edit the file and clean it.
git add fileWithConflictGit knows what you're trying to do, so it will write the "merged from github...." for you.
git commit
git user manual explains how to do it fairly well. Of course, you can search on stackoverflow for user help. Many use rebase to "flatten" the branch history. That's up to you. Myself, I'm not confident enough to use those smart commands (Although git fans say that rebase is a git killer feature).
domingo, 10 de enero de 2010
Banish mouse pointer on emacs
In ratpoison and stumpwm, there's a 'banish' command that exiles the mouse pointer to a corner of the screen. It's quite useful when you don't want the mouse to distract you or clobber the text you are writing.
In ratpoison, you only have to execute the command :banish, and it will move the cursor. You can bind it to a shortcut (for me it's 'c-t B').
emacs has a more sophisticated way to do it, and you can automate it to banish the cursor only when your typing is getting close to the mouse pointer, or just when you start typing in a buffer.
the function is namend mouse-avoidance-mode, and accepts some diferent symbol arguments: banish, exile, jump, animate, cat-and-mouse or proteus.
I chose banish because it's the simplest and most determinist. The "problem" there is that the mouse moves to the top-right corner, and when the active buffer is an erc buffer, the mouse is over the channel topic line, and a tooltip is displayed, distracting me. If I could only change the position where the mouse gets moved to....

Hey, it's emacs, so you can rewrite nearly all functions. Browsing through the mouse-avoidance-mode code, you can see the function that tells emacs where to place the mouse is
mouse-avoidance-banish-destination.
Just redefine it in your .emacs file like
and you're done. Now the mouse gets placed 1 line below the title line, so no tooltip window gets displayed.
If you're a seasoned emacser, this will say nothing to you, but for me, it's my first emacs 'hack', so I'm very happy it was so easy to do.
Some time ago I did some kind of modification to emacs, but was basically assisted by davazp.
In ratpoison, you only have to execute the command :banish, and it will move the cursor. You can bind it to a shortcut (for me it's 'c-t B').
emacs has a more sophisticated way to do it, and you can automate it to banish the cursor only when your typing is getting close to the mouse pointer, or just when you start typing in a buffer.
the function is namend mouse-avoidance-mode, and accepts some diferent symbol arguments: banish, exile, jump, animate, cat-and-mouse or proteus.
I chose banish because it's the simplest and most determinist. The "problem" there is that the mouse moves to the top-right corner, and when the active buffer is an erc buffer, the mouse is over the channel topic line, and a tooltip is displayed, distracting me. If I could only change the position where the mouse gets moved to....

Hey, it's emacs, so you can rewrite nearly all functions. Browsing through the mouse-avoidance-mode code, you can see the function that tells emacs where to place the mouse is
mouse-avoidance-banish-destination.
Just redefine it in your .emacs file like
and you're done. Now the mouse gets placed 1 line below the title line, so no tooltip window gets displayed.
If you're a seasoned emacser, this will say nothing to you, but for me, it's my first emacs 'hack', so I'm very happy it was so easy to do.
Some time ago I did some kind of modification to emacs, but was basically assisted by davazp.
viernes, 8 de enero de 2010
bibtex is too smart for me
I've been struggling for some minutes with an error when compiling a bibtex file (the LaTeX bibliography system).
The error reads like:
The trick was changing
----------
Update
The lazyweb returned me a clarification about all that mess. In fact, the "proper" way to insert the authors of a bibliography entry is spliting different authors with "and", no matter if it's the last or not, and commas are used to separate surnames and names.
So you can forget everything before this "update".
Thanks D.A. for the tip.
The error reads like:
Too many commas in name 1 of "Abhishek Verma, Xavier Llora, Roy H. Campbell, David E. Goldberg" for entry VLCG09Well, after scratching my head and a few change-compile-fail-swear loops, I found out that bibtex notices the "and" token and the commas in the author tag.
The trick was changing
author="Abhishek Verma, Xavier Llora, Roy H. Campbell, David E. Goldberg",to
author="Abhishek Verma, Xavier Llora, Roy H. Campbell and David E. Goldberg",It's cool that bibtex knows so much about correct formating, but... yeah, maybe it's too smart for me.
----------
Update
The lazyweb returned me a clarification about all that mess. In fact, the "proper" way to insert the authors of a bibliography entry is spliting different authors with "and", no matter if it's the last or not, and commas are used to separate surnames and names.
So you can forget everything before this "update".
Thanks D.A. for the tip.
sábado, 2 de enero de 2010
Live blog
Estamos ahora mismo a 2 de enero, y son poco más de las 10:00.
Me he levantado tan temprano, siendo sábado post-resaca de fin de año, porqué he tenido que ir a buscar un paquete a correos. La notificacion ponía: 2 paquetes de USA. Todo cuadra, porqué había comprado 2 libros (Smalltalk-80: The language, y C++ programming language, el Stroustrup) hace poco, y estaba esperando que llegaran.
Pues bien. Llego a correos, y mientras me esperaba, eso que no tienes nada mejor que hacer que intentar buscar tu paquete de entre todos los que ves en las estanterías. Grandes, pequeños, cajas, etc..... Hasta hay una caja envuelta con papel rosa, y ositos, que serà de algun chaval/a al que le mandan un regalo por correo. (Los reyes magos tambien pueden utilizar correos, no?)
Pues atención... en una esquina hay una etiqueta con un nombre,...
Me he levantado tan temprano, siendo sábado post-resaca de fin de año, porqué he tenido que ir a buscar un paquete a correos. La notificacion ponía: 2 paquetes de USA. Todo cuadra, porqué había comprado 2 libros (Smalltalk-80: The language, y C++ programming language, el Stroustrup) hace poco, y estaba esperando que llegaran.
Pues bien. Llego a correos, y mientras me esperaba, eso que no tienes nada mejor que hacer que intentar buscar tu paquete de entre todos los que ves en las estanterías. Grandes, pequeños, cajas, etc..... Hasta hay una caja envuelta con papel rosa, y ositos, que serà de algun chaval/a al que le mandan un regalo por correo. (Los reyes magos tambien pueden utilizar correos, no?)
Pues atención... en una esquina hay una etiqueta con un nombre,...
RAICIÑO!!!!!
!!!!! COMORRRR????! Esto huele a gallegada... sigo buscando en las etiquetas... Beceiro...
Joder, vaya cracks, yo riéndome sólo, y la peña mirandome...y llega mi turno... le doy la notificación a la tía, y mientras me buscaba los paquetes de USA. Me los da, y yo le digo:
-Creo que eso de ahí tambien es mío.
- Ah sí, toma... Firma aquí, y aquí, y aquí, y aquí, y aquí, y pon tu dni aquí y aquí y aquí...
Total, ya estoy en casa y no lo he abierto aún.
Ya sí.
Una hoja de papel y una caja de alcohol. En la hoja, guiños sin parar. Qué habrá en la caja..nosé podría ser un barco, o una caja. Sí, podría ser una caja. Sabes que siempre hemos querido una caja (*).
Creo que ha sido la primera sorpresa del año, y estoy sin palabras. El subidón de la sorpresa. Luego llamaré a eric (jack sparragow) y se lo cuento. No va a dar crédito. Ni hipotecário ni del outro.
Solo puedo decir: Gracias por todo....e veña jas!
Y como ya he dicho en algun otro lado:
Mis mejores deseos para quien se lo merezca, y quien no, pues que le den porsaco, hoy, en 2011, y en 2100, aquí en pekín y en pokón.
(*) guiño Padre de familia(guiño, guiño), si no entiendes nada, no t preocupes....
Joder, vaya cracks, yo riéndome sólo, y la peña mirandome...y llega mi turno... le doy la notificación a la tía, y mientras me buscaba los paquetes de USA. Me los da, y yo le digo:
-Creo que eso de ahí tambien es mío.
- Ah sí, toma... Firma aquí, y aquí, y aquí, y aquí, y aquí, y pon tu dni aquí y aquí y aquí...
Total, ya estoy en casa y no lo he abierto aún.
Ya sí.
Una hoja de papel y una caja de alcohol. En la hoja, guiños sin parar. Qué habrá en la caja..nosé podría ser un barco, o una caja. Sí, podría ser una caja. Sabes que siempre hemos querido una caja (*).
Creo que ha sido la primera sorpresa del año, y estoy sin palabras. El subidón de la sorpresa. Luego llamaré a eric (jack sparragow) y se lo cuento. No va a dar crédito. Ni hipotecário ni del outro.
Solo puedo decir: Gracias por todo....e veña jas!
Y como ya he dicho en algun otro lado:
Mis mejores deseos para quien se lo merezca, y quien no, pues que le den porsaco, hoy, en 2011, y en 2100, aquí en pekín y en pokón.
(*) guiño Padre de familia(guiño, guiño), si no entiendes nada, no t preocupes....
miércoles, 30 de diciembre de 2009
startup lessons
Y combinator (Paul Graham's company, and hacker news hoster) publishes a list with links that talk about startups. Many of them are Graham's past articles (worth reading nonetheless).
I've quickly scanned the list, and some of the articles linked, and it seems quite interesting, so worth pointing it here.
As I don't have anything else to add, I'll just post an image I saw yesterday at #perl6 channel @freenode. It's funny and, maybe can add information if you are deciding what language will you base your startup on.

It's a pity there's no perl there.
I've quickly scanned the list, and some of the articles linked, and it seems quite interesting, so worth pointing it here.
As I don't have anything else to add, I'll just post an image I saw yesterday at #perl6 channel @freenode. It's funny and, maybe can add information if you are deciding what language will you base your startup on.

It's a pity there's no perl there.
martes, 29 de diciembre de 2009
Binary search and dumb compression in Common Lisp
In my quest to learn lisp, I've been alternating scheme and common lisp readings and lectures.
I find scheme really enlightening, but quite difficult to write in it. Maybe it's because I haven't officially reached the set! chapter in SICP, and I still find difficult to write (so) functional code.
The point is that I finished this book and then, I started Paul Graham's ANSI Common Lisp. I've been really enjoying this reading, because it shows you interesting things (from an experienced programmer point of view) from the very beginning.
During the first 3 or 4 chapters, threre are some code examples, that I've tried to write on my own (maybe grasping a bit on graham's code when I got stuck, but well)
First, here's a compress/decompress lists lisp code. When entered a list like (0 0 0 1 2 1 1 0 4 4), compress returns a list of atoms or lists themselves, that contain the number of repetitions and the value to repeat: ((3 0) 1 2 (2 1) 0 (2 4)) . It's nice to see that at such low level point, being able to ask for a type of a given element gives us enough power to code this in a very simple way. I don't even want to think how I'd code it in java/c++.
Decompress does obviously the reverse operation
The binary search is just what its name says. Does a binary recursive search on an already sorted vector (array of 1 x N dimension).
I'm getting very fond of 'cond'. It takes the best things of both if and switch/case worlds. A switch-case like syntax, with powerful conditionals (not just comparing with '=')
That's all for now. Sorry for the crappy gists code listings. it seems github doesn't know much about common lisp (syntax nor indenting).
Btw, I've received my SICP copy in dead-tree format, so I'll probably spend some time with scheme when I finish Ansi Common Lisp.
I find scheme really enlightening, but quite difficult to write in it. Maybe it's because I haven't officially reached the set! chapter in SICP, and I still find difficult to write (so) functional code.
The point is that I finished this book and then, I started Paul Graham's ANSI Common Lisp. I've been really enjoying this reading, because it shows you interesting things (from an experienced programmer point of view) from the very beginning.
During the first 3 or 4 chapters, threre are some code examples, that I've tried to write on my own (maybe grasping a bit on graham's code when I got stuck, but well)
First, here's a compress/decompress lists lisp code. When entered a list like (0 0 0 1 2 1 1 0 4 4), compress returns a list of atoms or lists themselves, that contain the number of repetitions and the value to repeat: ((3 0) 1 2 (2 1) 0 (2 4)) . It's nice to see that at such low level point, being able to ask for a type of a given element gives us enough power to code this in a very simple way. I don't even want to think how I'd code it in java/c++.
Decompress does obviously the reverse operation
The binary search is just what its name says. Does a binary recursive search on an already sorted vector (array of 1 x N dimension).
I'm getting very fond of 'cond'. It takes the best things of both if and switch/case worlds. A switch-case like syntax, with powerful conditionals (not just comparing with '=')
That's all for now. Sorry for the crappy gists code listings. it seems github doesn't know much about common lisp (syntax nor indenting).
Btw, I've received my SICP copy in dead-tree format, so I'll probably spend some time with scheme when I finish Ansi Common Lisp.
Suscribirse a:
Entradas (Atom)