Meiga 0.2.1 released

July 2nd, 2009

This is a minor release that includes a couple of bug fixes that will make Meiga to properly work on Fedora systems and also to work with those routers exposing a WANPPPConnection by UPnP instead of a WANIPConnection.

As always, you can download it from http://meiga.igalia.com. This time a new package for Ubuntu Jaunty on amd64 is also available for users having that architecture.

Meiga talk at Guadec-ES scheduled

July 1st, 2009

The final schedule for Guadec-ES has been published. The talk “Meiga: compartiendo contenidos de forma ligera desde el escritorio” will be given on Thursday July 9th from 11:00 to 12:00.

El horario final para la Guadec-ES acaba de publicarse. La charla “Meiga: compartiendo contenidos de forma ligera desde el escritorio” será impartida el Jueves 9 de Julio de 11:00 a 12:00.

Simple HTTP server in Python

June 29th, 2009

Reading blog comments about Meiga out there, I’ve found one particularly interesting. Python has an embedded HTTP server that can serve the current directory from a given port. It can be instanced for port 8282 simply issuing this command:

  python -m SimpleHTTPServer 8282

The funny thing is that… it works on the N810 also!

More info about SimpleHTTPServer here.

Meiga 0.2.0 released + talk at Guadec ES

June 19th, 2009

A new version of the Meiga tool has been released. The new features in this version are:

  • File and share ordering
  • Port from libglade to GtkBuilder. Special thanks to Javier Jardón (torkiano) for his contribution.
  • Log showing in gui
  • Automatic refresh
  • Fixed bug: forbid empty or /rss share names
  • Spanish and galician translations

It can be downloaded from the project main page.

Meiga screenshot (log)

Moreover, the talk about Meiga presented for Guadec ES has been accepted. Don’t miss it if you’re going to take part in Guadec/GuadecES/aKademy and feel curious about this new tool.

Curiosities about parameters and variable declarations in Javascript

June 15th, 2009
  1. <html>
  2. <body>
  3.  
  4. <script type="application/javascript;version=1.7">
  5.  
  6. function f1(parameter) {
  7.  alert(parameter);
  8. }
  9.  
  10. function f2(parameter) {
  11.  alert(parameter);
  12.  let parameter = "value";
  13. }
  14.  
  15. f1("hello");
  16. f2("hello");
  17.  
  18. </script>
  19.  
  20. </body>
  21. </html>

Continuing with the “Curiosities” serie, today I bring another one: Javascript doesn’t take too well the definition of a variable with the same name as a function parameter. If you do this, the parameter is lost.

Copy the code to a local file and try it yourself… Surprisingly, the second alert will print “undefined”.

Meiga 0.1.0 released

June 3rd, 2009

As presented on my last post, I’ve been working in Meiga, a lightweight content sharing tool for the desktop.

What you could find these days in the git repository was a beta. I’ve been working last days in the final details and now it’s ready to be released. Here it is:



http://meiga.igalia.com

There you will find packages for Ubuntu Hardy, Intrepid and Jaunty, as well as a link to the source code.

I hope you to enjoy it as much as I’ve enjoyed writing it. Of course, comments and improvement suggestions for next versions are welcome. :)

Meiga: lightweight content sharing from the desktop

May 29th, 2009

No, this time I’m not going to talk about the wonderful new Igalia office opening party, nor about the Igalia summit that we’re going to have this weekend in a hotel near Santiago de Compostela. This time I’m going to talk about a new free software project I’ve been working on to take advantage of the paid hackfest ours that our company provides us. Ladies and gentlemen, I’m proud to present the Meiga project to you.

As all of you already know, the current trend in the Internet is to publish contents in centralized servers to be shared to other people. Nevertheless, sometimes it’s handy for users to be able to serve their own contents directly from their desktops in a convenient way (instead of using a pendrive, for instance). Why bothering about publishing your contents if you can share them directly from your desktop to the LAN or even to the whole Internet?

To satisfy this need we’ve created Meiga, a tool that makes possible to share selected local directories via web. But that’s only the beginning. In fact, the ultimate goal of the project is to serve as a common publishing point for other desktop applications, such as the file manager, picture viewers or music players.

Meiga is lightweight, easy to use, network friendly and also application friendly. It’s written in a mix of Vala and pure C code, using existing Gnome technologies to perform its tasks: libsoup is used as a simpler alternative to fat web servers, libgupnp is in charge of doing port redirections if the network router supports UPnP, and DBUS exposes a public API to allow the GUI and third party applications to control what is served. Some advanced publishing features are already implemented, like the feed server that can render an RSS view of a given directory.

From the educational point of view, the source code of this project is a live example of Vala technology usage: pure Vala programming, different alternatives to interface Vala with pure C code (using Vapi files or running a child executable program) or the usage of a “programmable context” to handle sequentiation of asynchronous operations. An autotools based build system completes the set of interesting features. This system uses a Vapi file to pass configuration parameters from the config.h to the Vala program. Finally, some additional rule files allow the building of a Debian package, the last step to make the program available to final users in a convenient way.

Meiga is free software. It’s released under GPL 2.0 and can be downloaded just typing:

git clone http://git.igalia.com/meiga.git

Curiosities about using closures in loops in Javascript

April 2nd, 2009

Just execute this code in your browser and find the ten differences between the two loops:

  1. <html>
  2. <body>
  3. <script type="application/javascript;version=1.7">
  4.  
  5. let funs = {};
  6. let msg = "";
  7.  
  8. for (let i = 0; i < 10; i++) {
  9.   funs[i] = function() {
  10.     msg += "i = " + i + "\n";
  11.   }
  12. }
  13.  
  14. for (let i = 0; i < 10; i++) funs[i]();
  15.  
  16. alert("Without redeclaration: \n"+msg);
  17.  
  18. msg = "";
  19. for (let i = 0; i < 10; i++) {
  20.   let idx = i;
  21.   funs[i] = function() {
  22.     msg += "i = " + idx + "\n";
  23.   }
  24. }
  25.  
  26. for (let i = 0; i < 10; i++) funs[i]();
  27.  
  28. alert("With redeclaration: \n"+msg);
  29.  
  30. </script>
  31. </body>
  32. </html>

As you can see, the i variable works as if it was declared outside the loop, so it’s reused inside it. Thus, if you use it inside a closure, all the closures share the same reference and can see the changes produced during the iterations.

However, in the second loop a new fresh local variable is defined for each iterations, so the values aren’t shared among the closures.

Shell Scripting notes

November 7th, 2008

Eight years ago, back in 2000, I was decided to learn shell scripting. I found the Bourne Shell Programming book by Robert P. Sayle a very good way to start, so I began my way through it, reading the concepts, making the exercises and taking advantage the opportunity to write a sort of personal notes (in Spanish) using LyX (a text processor I liked very much at the moment).

Some time later I submitted the notes to the GPUL mailing list and they were posted at the research groups page. Unfortunately, there’s no way to access the notes from there, because a disk failure and the website revamping got them lost. It’s a pity, because not even the Internet Archive preserves a copy of them.

Those notes have a symbolic value for me. They served as a basis for later bash scripting courses I taught and, after many changes and adaptations, are still the main inspiration for the shell scripting slides used in the Caixanova Free Software Master.

For that reason, today I did a bit of computer archaeology and searched through my old backups until I found it. Now that this material is back, I want to share it with all of you:

Enjoy it!




Spanish version / versión en español:

Hace ocho años, allá por el 2000, me decidí a aprender shell scripting. Descubrí que el libro Bourne Shell Programming de Robert P. Sayle era una muy buena forma de empezar, así que inicié mi camino a través de él, leyendo los conceptos, haciendo ejercicios y aprovechando la oportunidad para escribir una especie notas personales (en español) usando LyX (un procesador de textos que me gustaba mucho en aquel momento).

Algún tiempo después envié las notas a la lista de correo de GPUL y fueron publicadas en la página de grupos de investigación. Por desgracia, no hay forma de acceder a las notas desde allí, porque un fallo de disco y la remodelación del sitio web hicieron que se perdieran. Es una pena, porque ni siquiera el Internet Archive guarda una copia de ellas.

Esas notas tienen un valor simbólico para mi. Sirvieron como base para cursos posteriores de scripting bash que impartí y, tras muchos cambios y adaptaciones, son aún la inspiración principal para las transparencias de shell scripting usadas en el Master de Software Libre de Caixanova.

Por esa razón, hoy hice un poco de arqueología informática y estuve buscando en mis viejos backups hasta que lo encontré. Ahora que este material ha reaparecido, quiero compartirlo con todos vosotros:

  • Notas sobre Shell Scripting (versión PDF): bash.pdf
  • Notas sobre Shell Scripting (archivo con versiones LyX, tex, ps y HTML): articulo_scripting.tgz

Disfrutadlo!

A new pet

November 3rd, 2008

Today I’ve received a brand new elePHPant. Will it survive in the hard ecosystem of my table? For the moment, it seems to be happy…


Bad Behavior has blocked 219 access attempts in the last 7 days.