Posted: March 25th, 2010 | Author: mario | Filed under: gossip, research | Tags: ECIR2010, Information Retrieval | No Comments »
We are glad to announce that some members of Lab216 (Zubi and Mario) are attending the ECIR2010 conference in Milton Keynes UK, which is the main European research forum in the field of Information Retrieval.
We’ll be there to follow the latest trends in search systems and indeed we will seize that knowledge to improve our products.
Stick around for more news!
Posted: March 21st, 2010 | Author: alej | Filed under: tutorials | Tags: apache, php, tutorial | 3 Comments »
Ok, so now that we have the database, let’s work a bit in the fronted, with Apache and PHP5. Apache comes already installed in our machine, we just have to start it in the Sharing option of the Control Panel. Check “Web sharing” to start apache and uncheck it to shut it down.

That was easy, wasn’t it? Now we have to enable php in apache’s configuration file, as it comes disabled by default.
$ sudo vim /etc/apache2/httpd.conf
Now let’s navigate to the commented line where php5 is (it’s easy to go there by typing /php5) and uncomment the line (by removing the first # symbol).
Save and quit the file (by typing :wq) and restart apache by unchecking and checking again the checkbox in the sharing option of the control panel, as explained before.

Well, now we should have php5 working in our machine. Let’s check it by creating a simple php file and displaying it:
$ echo “<? phpinfo(); ?>” > ~/Sites/test.php
Now browse to http://localhost/~yourusername/test.php and see all the info php has about you. Do not forget to change yourusername in this example with your real username.

That wasn’t so hard! Now that you have apache+php working, you really should learn to configure them. Read the apache docs and the php docs.
See you around!
Posted: March 19th, 2010 | Author: mario | Filed under: tutorials | Tags: svn, tutorial | 1 Comment »
¿Qué es?
- Control de versiones, permite tener en un servidor centralizado un histórico de todo lo que hemos ido haciendo y quién lo ha hecho.
- Mantiene una copia de todo en el servidor, sirve de backup.
- Sincronización entre varias personas. Todos pueden subir o bajar.
- Automáticamente fusiona los ficheros, salvo que haya conflictos.
- Cada revisión tiene un número. Cada vez que se sube algo se incrementa este número y se le pone a todos los archivos subidos. Los directorios tienen el número del último archivo subido.
Estructura de árbol jerárquico:
- trunk, la última versión de cada proyecto.
- tags, versiones anteriores, ej. kirando_1_0.
- branches, cuando queremos empezar a desarrollar algo o probar sin cargarnos el trunk.
Escenario de uso:
- El proyecto está en el servidor, te lo descargas en una copia local (checkout). La copia local se llama working copy.
- Modificas y pruebas todo lo que quieras.
- Actualizas tu copia local para asegurarte que nadie ha subido nada (update). Si había cambios compruebas que funciona todo y solucionas posibles conflictos.
- Subes (commit).
¿Qué se puede hacer?
- Subir un proyecto, import.
svn import dirlocal urlrepositorio
- Descargarse un proyecto, checkout.
svn checkout http://servidor/trunk/miproyecto (Opcionalmente –username )
- Añadir un fichero a un proyecto, add. (Hay que hacer el add siempre, no vale con crear el fichero).
svn add README
- Cambiar el nombre o mover, move.
svn move README README2
- Borrar un fichero, del.
svn del README
- Actualizar la copia local con la última del servidor. update.
svn update
- Visualizar los cambios de nuestra versión local respecto a la última descargada. status.
svn status
- A significa que se va a añadir el fichero.
- D que se va a borrar.
- C que hay algún tipo de conflicto
- M que se ha modificado desde la última vez
- ? Subversion no tiene constancia de ello. Debemos hacer add para añadirlo o borrar el fichero o ignorarlo.
- Comparar dos versiones del mismo archivo. compare/diff
svn -r 15:17 README (Compara las versiones 15 y 17 del fichero README, si solo se indica una revisión compara con la copia actual.)
- Descartar los cambios actuales y volver a lo último que haya en el servidor. revert
svn revert README
- Indicar que lo que vale es lo mio, y no lo que ha hecho otro. resolved.
svn resolved README
- Ver quién ha sido el último en modificar una determinada línea del código. blame
svn blame README
- 1 mario Hola
- 2 alej Probando
- Ver qué le ha ido ocurriendo a un fichero. log
svn log README
- Revisión | Quién | fecha | Número de líneas que han cambiado | Comentario.
- Crear tags para etiquetar una versión determinada. Ej, kirando_2_0
- Crear ramas independientes, branch
- Unir ramas, merge.
Gestión de conflictos
Si hemos modificado dos el mismo fichero (Readme), ¿como lo arreglo?
svn status lo marca con una C de conflicto y crea 3 ficheros adicionales:
- Readme (Intento de fusión, marca con <<<< y === donde están los conflictos)
- Readme.mine (El mio tal cual lo tenia, working).
- Readme.r4 (La versión que yo me descargué antes de tocar nada, base)
- Readme.r6 (La versión del repositorio que me ha fastidiado, theirs).
Ante ello hay varias opciones:
- Lo mio era lo válido:
svn resolve –accept working Readme
- Lo válido era lo del servidor:
svn revert Readme
- Tengo que mezclarlo a mano.
- Edito el fichero, busco los <<< === y dejo sólo lo que corresponda.
- svn resolve –accept working
¿Cómo lo aplico a mi trabajo? (Buenas prácticas)
- Subir frecuentemente lo que estoy haciendo (Para que los demás lo tengan disponible y haya menos conflictos).
- Probar que lo que voy a subir funciona antes de subirlo. Para que luego cuando se lo descargue otro siempre compile.
- Poner siempre un comentario al subir algo (En consola con -m “Mensaje”). No hace falta contar la vida, pero no dejarlo vacío. Por ejemplo, “Corregido bug en la internacionalización en firefox”, “Primera versión del módulo de gestión de usuarios”, “Añadida validación de noseque”.
Truquillos de la abuela.
- NO usar el explorador de windows o comandos del shell para mover o copiar ficheros. Siempre usar los comandos de SVN.
- svn add, move y del afectan solo a la copia local hasta que hagas el commit.
- Por mucho que nos lo propongamos, siempre nos encontraremos con conflictos.
- Podemos decir que no suba nunca un determinado fichero o directorio con svn ignore. Esto es interesante para ficheros de log, imágenes…
- Podemos añadir propiedades a los ficheros. Por ejemplo le podemos poner un content/type para que al navegar por el repositorio via web tenga ese formato.
- Evitar subir ficheros muy grandes, imágenes, índices,
- Evitar subir ficheros autogenerados, por ejemplo un war o un zip con la aplicación, o binarios compilados de C.
IDEs.
- En eclipse, siempre hemos usado subclipse y funciona bastante bien.
- En windows, tortoisesvn.
Ejemplo
En el .bashrc
export SVN_EDITOR=vim
export REP=file:///Users/mck/svnrepository/
Creo un repositorio:
$ svnadmin create /Users/mck/svnrepository –fs-type fsfs
Creo directorios base
$ svn mkdir -m “Initial structure” $REP/trunk $REP/tags $REP/branches
Añado un proyecto
$ cd
$ mkdir miproj
$ cd miproj
$ touch a b c
$ svn import miproj/ $REP/trunk/miproj (Atención que hay que poner el nombre de carpeta!!)
Me descargo un proyecto
$ cd
$ mkdir projs
$ svn co $REP/trunk/miproj
Hago cambios en mi copia
$ cd miproj
$ echo “hola” > a
$ svn del b
$ touch d
$ svn add d
Veo los cambios que he hecho
$ svn status
M a
D b
A d
? e
Subo los cambios
$ svn commit -m “Reorganization”
Sending a
Deleting b
Adding d
Transmitting file data ..
Committed revision 3.
Referencias:
Posted: March 3rd, 2010 | Author: migumar2 | Filed under: gossip, research | Tags: PhD, text compression | 1 Comment »
We have a new reason to celebrate! After some months of hard work, it is our pleasure to inform that the PhD. researching work of Miguel is starting its final countdown. The final draft of this work (called “New Methods of Word-based Text Compression: Study and Application“) is now being reviewed, so he expects to earn his PhD. in Computer Science in forthcoming weeks..
Congratulations!
Posted: March 1st, 2010 | Author: alej | Filed under: tutorials | Tags: development environment, mysql, tutorial | No Comments »
Let’s start our journey the easy way: with MySQL. First of all we need to download a copy of the MySQL Community Server, preferably in .dmg format, from here. For this tutorial I have selected this one: Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive, the first one. To proceed, we have to register or press the “No thanks” link under the form and select a mirror.
Once we have the dmg file, we mount it (by double clicking it..) and we could see the contents of the package:

To actually install the application, we have to double click the first .pkg file, named something like “mysql-5.1.44-osx10.6-x86_64.pkg” and proceed through the installation. We may be asked our password for administrative purposes.
Now that we have installed mysql, we are provided three ways to start the server:
- The ugly command line, with mysqladmin
- Autostart the server, installing the provided MySQLStartupItem.pkg, but we want to have more control than that..
- And by an individual control “switch” in the preferences panel. Let’s do that, so we are able to start/stop the server whenever we want in an easy way!
So double click in the MySQL.prefPane file and install the panel only for your user (you don’t have a sister who likes programming, do you?). Now, when we want to manipulate the state of the mysql server, we just have to go to this panel and turn it on or off (I personally do it with +space and then typing mysql).

Mind that normally, when manipulating the state of the mysql server we will be requiered administrative priviledges, so we will be asked for our password quite often.
And that’s it, we have installed MySQL Server in our mac… but beware, as the default installation doesn’t provide a password for the root user!
To do so, we need to use the terminal, setting the mysql installation dir in our path and setting a new password for root.
$ echo ‘PATH=$PATH:/usr/local/mysql/bin’ >> ~/.bash_profile
Restart the terminal and then:
$ mysql_secure_installation
Press enter, as root does not have any password right now
Press enter, so we are asked for a new root password
Enter the new root password
Press enter, so we remove the anonymous user
Press enter, so we disallow root login remotely
Press enter, so we remove the test database
Press enter, to reload the privilege tables
And we’re done!
You could test your freshly installed copy of mysql with mysql -uroot -p
Links:
If you run into trouble, maybe this apple guide could help you.
Posted: March 1st, 2010 | Author: alej | Filed under: tutorials | Tags: development environment, index, php, symfony, tutorial | No Comments »
This is the first part of a multi-series of posts regarding the installation and configuration of a fully development environment for symfony, the best PHP framework out there.
This will be oriented to a normal desktop Snow Leopard installation on a mac computer, but other platforms would be explained in further tutorials.
We’re going to need a bunch of things installed for this to work, but we won’t encounter any major problems, I hope:
- Mysql
- Apache + PHP5
- MysqlAdmin
- xDebug+PHPUnit+Pear
- Eclipse
- symfony
- Any other tool to improve our workflow, such us svn, git… suggestions are welcomed.
This post will serve as an index for future chapters, to facilitate access and/or references.