Monday, February 11, 2008

@ Paris



Today I arrived well in Paris and took an extended walk, thanks to Sergiu and Marta, trying to get everything in one day: la Tour Eiffel, le Dome des invalides, le Louvre, la Cathedrale Notre-Dame, Montmartre (impressive at sunset)






Blogged with Flock

Sunday, February 10, 2008

I'm leaving today



Start spreading the news
I'm leaving today
I'm gonna be a part of it
Strasbourg, Strasbourg

I will be leaving in a couple of hours for Strasbourg, with a Paris stop tomorrow. I will be there through the whole spring, for my second semester of master studies, at Université Louis Pasteur. While there, I plan a lot of visits all over France: the XWiki office in Paris, Sergiu and Marta in Lille, fosdem (I know that's actually in Brussels, don't worry) , and a little piece of Germany, no matter where.

The non bright side of the story is that I will miss a lot of things from home: my family, my friends and the places (when I left Iaşi today I couldn't believe it was for 5 months!)

And I hope I will manage to make some time for my blog, too, starting tonight!


Blogged with Flock

Sunday, December 23, 2007

3, 2, 1... GO!



My Christmas break has just started this morning, when I woke up at 5:00 AM to leave to the country side to spend Christmas.
I hope you all have been good kids so that Santa will drop by with nice gifts and lots, lots of sweets!

Meeeeeeeeery Christmas!

Saturday, December 8, 2007

XWiki Iaşi team @ Durău



The last weekend we gathered 'all' the XWiki Iaşi team to go to the mountains, as some sort of goodbye party for JV who left Iaşi this week. Well, 'all' the XWiki team meant, after all, without Marius (who had some school assignments he had to finish until monday) and without Evelina & Cristi who also had some school deadline changed to monday without notice. Finally, the XWiki team was: me, Raluca, Jerome and Jean-Vincent (JV for short) and Petru (who is a xwikier only 'by association').
Friday afternoon was shopping afternoon ('Let's go to the mall, today!'): after a tough negotiation for boots (J and JV wanted the same shoes and are the same size but there weren't 2 pairs available in the shop), and a 'girlie-girl' shopping style from me (3-4-5-6 shops but no boots for me to like :D) we deviced the next day's wake-up plan and went home.
Saturday morning we left Iaşi at 6:00 am and, after a 'niiiiice' 3 hours trip and some sleep (only for some of us) we arrived in Durău: nice fresh air smell and some snow here-and-there. We checked in at the hotel, grabbed something fast to eat and then left for the trip to Fântânele.


From XWiki @ Durău

Once we got there, we had a cup of hot wine, took some pictures with the nice view and, despite the original plan to get to Fântânele, drink, and then return to Durău, decided to go further until we can see the "Izvorul Muntelui" lake and then return.


From XWiki @ Durau

A kind caban dog lead the way towards Dochia caban: he went on and, when we stopped it stopped and returned to see if we all are OK. At 'La morminte' (around 1300m altitude), the path started to be snowy: it was not dangerous (yet) but still, it was a sign that we cannot go further without proper equipment. We went a little further to see the lake, took pictures (to testify that we indeed were there), Raluca gave her share of food to the dog (who was clearly planning to continue the path to Dochia) and then returned to 'La Morminte'. There we had a nice picnic below 0 degrees Celsius with bread and french camembert. We continued our trip back to Durău through Fântânele and then through 'Poiana Viezuri'. In Durău, we had a romanian dinner with 'Tochitura Moldoveneasca' and red wine at the hotel and a very 'personal' interpretation of some famous international songs from the guy at the keyboard in the hotel restaurant.
Although some of us were very sleepy, the night continued with a delightful cards game, romanian Whist and, upon Raluca's request -- who was tempted by the music she heard from outside, with a visit to the 'disco'. And when I say visit, I mean visit, i.e. 30 minutes. The 'disco' was actually a lame 'village club' (you know the kind of club I'm talking about), which made the visit 2 times more fun!


From XWiki @ Durau

The next day, we were supposed to wake up at 6 o'clock so that we can go to 'Duruitoarea' waterfall too. Of course, I only woke up to make a couple of calls to the others and agree that it is better to sleep on and see more about it later, when everybody was up. At 10, we talked about staying some more and leaving Durău in the evening but the unavailability of the bus seats in the evening ruined our plans. The trip ended with a walk around Durău, a visit to the monastery and some more pictures of the surroundings.


From XWiki @ Durau

The trip back was 'spectacular', as usual in Romanian buses (I really need to buy a car!): a lot of people going in and out of the bus, the driver's stops for each one of them, loud conversations, people crushing into each other to fit the size of the bus, and the eternal travelers that know that the bus might be too crowded but never, ever make reservations, etc, etc.
All in all it was a successful outing, and until the next one, we will enjoy the pictures:


Tuesday, November 27, 2007

The book has appeared!




The "Web 2.0 programming" book is now ready to be released in shops: yesterday I have seen (touched and smelled) the final and printed version of the book. The Polirom publishing house has done a great job after all and the result is one we can be proud of. In the book you can read:


  • Andrei Mihaila's chapter about load balancing in web clusters


  • Sabin Buraga's chapter about JavaScript programming. Sabin is also the coordinator of the volume, i.e. the one that 'directed' the whole process of writing and publishing the book.


  • Ciprian Amariei and Andreea Pantescu's chapter on collaborative code review


  • My chapter on web recommendations using microformats


  • Cati (Ecaterina Valica)'s great chapter on mashup applications




You can find more details about the book either on the blog dedicated to the book (where you will be able to comunicate with the authors and the other readers), on the presentation page of the book, or on the polirom website.

Saturday, November 17, 2007

What have I been doing in the past few months?




Yes, it's been a long break and, as you already assume, here comes a (long) post with a bulleted list of all that happened in the mean time and deserves to be mentioned:


  • First of all (I've been trying to write this for a while now) I started working for XWiki Iasi. We are a team of 9 people but only 7 of us are in Iasi and only 5 of us are Iasi employees: Sergiu and Marta are in France for studies, Jerome and Jean-Vincent are employees from the Paris office that came in Iasi to help setup the team here. The romanian team is made of: Evelina, Raluca, Cristi, Marius and me, closely collaborating with the big french team in Paris.
    I must mention that this is my first job and I'm learning things as they happen: the development process of a big project, the teamwork, the communication, the skills, getting used to "doing only one thing" (as opposed to school where I was doing a different thing everyday, writing code in 3 different programming languages at the same time, learning and trying new technologies, banging the head against the wall for all these reasons but enjoying every minute of it). Still, XWiki is a nice place to do "more-than-one-thing": there are various areas where you can spread your work if you want and creativity is encouraged.
    We also had a nice XWiki Iasi launch party in october where we invited a lot of friends (some pictures can be found on picasaweb).
    I also learned that cultural barriers are no barriers at all and all it takes is just a little time to get used... (a subject that deserves a post of its own...)


  • Second of all, I started the master courses at infoiasi that compensate the "doing-only-one-thing" at work. Not too many opinions on this yet, besides the shock that, after trying for 2 years (the final years) to teach us how to write code and how to look at things from the practical side, they are now going back to the theoretical side (that gave us nightmares in the first 2 years at the faculty) and expect us to understand everything and agree... I know, it is supposed to be like that and it is OUR job to put the two together, etc, etc, but it is a little hard to bear anyway...


  • Third, I started my classes at the faculty: I am teaching web technologies laboratories to the fourth year students. This whole "getting on the other side" experience is very interesting on its own and deserves a full post, too (maybe I'll do it, just maybe). I can say that I am having a lot of fun teaching, although you should probably get some opinions from my students too...


  • Fourth of all, I wrote a chapter about web recommendations using microformats embedded data for the "Web 2.0 Programming" book (in Romanian) to appear at Polirom. While doing this, I finally finalized the Java Firefox extension example that I talked about in the last post, realized that it's incredibly hard to talk about some things you are very familiar with while trying to be clear enough and explain that stuff to someone who potentially does not know a thing about them, and also learned how valuable good feedback is! The blog dedicated to the book is at http://webpro20.blogspot.com/, designated for communication with the readers of the book, so feel free!


Thursday, October 11, 2007

Java Firefox Extension



I know, you won't find this as the first search result on Google, but anyway...

Because I promised some (many) posts ago and because recently I found the time to create a decent example (actually, I HAD to find the time), here's the long waited demo of a Java Firefox extension, i. e. Firefox extension that uses Java code. I first got this idea from Simile's Piggybank extension, and then I got their example from http://simile.mit.edu/wiki/Java_Firefox_Extension. I found that to be quite complicated so I created a new one, simpler (and optimized in some points) and, I think, easier to understand.
I assume you are familiar with the Firefox extension development. If you're not, have a look at http://developer.mozilla.org/en/docs/Extensions.
What we already have in Firefox:


  • LiveConnect

  • that allows us to connect to Java code from javascript code. We can write stuff like var x = new java.lang.String("test") and x will hold a reference to a Java object. We can then call all x's functions from javascript and get the results back. We can not send javascript objects other than numbers (integer, double), strings and arrays to Java. I mean, we can, but we'll get a JSObject object which is kind of empty and useless (no functions, no members).


  • XPCOM

  • that allows us to build a COM-like component for Firefox, platform independent (because it is written in javascript).


We will create a XPCOM component that will use LiveConnect to get to the Java code.

Why can't we do it only with LiveConnect? Because XPCOM allows a single instantiation of the component through all the browser instances (shared). Now you decide for yourself why you might need that (I personally needed it because I had some native libraries loaded by the Java code and I had to be sure that happenned only once since I would get an error otherwise).
And it's pretty cool to learn how to do both the Java access and the XPCOM.
Now get the code from this temporary deposit (change extension in xpi and drag it to a Firefox window to install) and follow me:
Any XPCOM component must implement an interface, at least nsISupports, which is the most general so that it can be managed by the Firefox component manager. The trick is that we don't need any function from the interface, we will get the javascript object that implements the interface and call its functions, so we should implement an interface with no functions at all -- we can create our own (like simile's example does) and go through all the mess of compiling the idl file in a xpt interface definition file or we can simply implement nsISupports.
Once that is done (see the GreeterComponent.js file in /components) we can simply call:


Components.classes["@lucaa.students.info.uaic.ro/je-greeter;1"]
.getService(Components.interfaces.nsISupports);

to get an instance to our component ("@lucaa.students.info.uaic.ro/je-greeter;1" is the component's contract id, specified in the implementation).

But what's the trick to access the Java code? One might say that we have LiveConnect's java object and that is enough. Well, not quite, since our own classes ar not loaded and we can not access them. We need to load them dynamically through our own class loader (this is done by the component upon initialization):

var greeterURL = new this._java.io.File(greeterJarLocation.path).toURL();
//create the classLoader
var classLoader = new this._java.net.URLClassLoader([greeterURL]);
//get an instance of the GreetingGenerator through reflection
var greetingGeneratorClass = this._java.lang.Class.forName(
"ro.uaic.info.students.lucaa.je.GreetingGenerator",
true, classLoader);
this._greeter = greetingGeneratorClass.newInstance();

Then, the call to the java functions of the GreetingGenerator can be simply done through:

this._greeter.generateGreeting()

Remember that the java LiveConnect object is not provided by default to the components environment and we must pass it from the calling code, upon initializing the wrappedJSObject of the component:

//get a component
var greetComponent = Components.classes["@lucaa.students.info.uaic.ro/je-greeter;1"]
.getService(Components.interfaces.nsISupports);
//initialize the wrappedJSObject
greetComponent.wrappedJSObject.initialize(java, true);

In the example, the GreetingGenerator class in Java holds a counter incremented by each call to the generateGreeting function. Go to the Tools menu, the "Greet!" menu item and get your greeting. Now open a new browser instance and do the same. The counter goes on, as a sign that it's the exact same object called.

Starting from this, you can do all sorts of stuff: you've just created yourself an unique entrypoint in the Java code, making sure that if you have configurations to set up, servers to start, etc, etc, those will happen exactly once.

Happy coding!