DGPLUG ‘Linkography’

Folks, Summer ends, and with it dgplug Summer Training is coming to it’s end as well. I know, it’s sad, but hey, what about all this huge knowledge, all these invaluable advice these guys gave us? The guest sessions, the motivation? Sometimes it’s even scary when you look at all the links you bookmarked to leave them for later, and you wonder when… wait.
I was too nervous, too exited, couldn’t even breathe, I was about to install Fedora! And I forgot to backup my bookmarks. All gone (as always, not a backup friend here). Luckily, this evening I had nothing more to do, so I came with a solution: To write a script that would sweep all sessions’ logs for links capable of being an interesting read, creating a sort of linkography, for my and anyone who happens to read this blog.

I’ve written a small Flask app to view all the links and search through them. A lot of these links are garbage, not really interesting, I’ve filtered the most obvious non-interesting links, but didn’t want to waste too much time on it. Feel free to report any broken or useless link!

DGPLUG ‘Linkography’ site: dgplugbiblio.arnauorriols.com

Github links:

Sweep script: https://github.com/JCaselles/dgplugbiblio-webapp/blob/master/link_searcher.py

Flask app: https://github.com/JCaselles/dgplugbiblio-webapp

Advertisements

Catalonia, behold.

Let me go a little off topic here. Don’t panic, I won’t dig into politics much often in this blog, but I think recent events deserve at least some mention.

Though internationally remembered for some other events, in Catalonia September 11 is a very special date. It’s the national day, when (oddly enough) we celebrate the defeat against the spanish bourbon troops at the siege of Barcelona back in 1714. Generally it had been a relaxed, festive day, with a couple of institutional memorial events in the morning and some doubtfully worth catalan pop bands playing in the evening.

Catalan people have commonly felt diverse from Spain. An underlying independence feeling has always been present among the population, though common sense had dispelled it in the surface, —usually. Recent events (I make myself oblivious of any possible bias in the previous link’s content), which objectively can, at least, be referred as insulting, have exacerbated this mood in the society to levels never seen before, making one guess there might be no way back. Even more, spanish government has not helped in calming people down, their haughtiness only making everything worse.

The history changed its course three years ago, on July 9. A very discredited Constitutional Court ruled partially against a new Statute of Autonomy for Catalonia already approved by the Spanish Parliament. The Catalan outrage took form as the most massive rally ever held in Catalonia, —yet. More than 1 million people went out of their homes in an extraordinary and peaceful mood, something that have depicted this movement ever since.

From then, many more actions have been carried out. Particularly, last year’s September 11 became a turning point regarding this festivity’s mood; an even more crowded demonstration took place in the streets of Barcelona, this time with an unequivocally pro-independence manifesto. 1.5 million people embraced openly the secessionist claim, again in a democratic, festive spirit. Most of all, I want to stress the extraordinary hope and cohesion this movement is generating throughout the whole catalan society.

Setting aside my personal political opinion, which is indeed non of you business, —and which may not be what you are first guessing, I can only be amazed at how this outrage is being handled in such a respectful way, never loosing sight of what we most want, that is an inclusive, diverse and extremely respectful society. And the most admirable example of this is the last claim action on this year’s September 11: A complete human chain that crossed the whole catalan country from south to north, an extremely complex event, where, though only 400.000 were needed, up to 1.6 million people were organized to perfection to hold their hands at 17:14 and connect the 480 km that constitute the length of Catalonia.

Again, I just found it worth to make a “brief” mention (it took a little longer at the end) of these, I think, special events, and let you know a bit of this little, curious country that is Catalonia. I may have failed to explain you every corner of our reality, but you are, of course, most welcome to come and discover it for yourself  : )

See you around.

JQuery animations and stop()

Jquery animations are tricky to implement without flaws. You’ll face a lot of trouble trying to achieve an smooth and coherent animation, specially when using multiple animations on user interaction. Usually the most standard solution when facing animation issues is to use stop() function. Generically, it will stop the current animation on progress, if any. You’ll use it when the user prompts  another animation before having the current one finished yet:

<button class="moveright">Move right</button>
<button class="moveleft">Move left</button>
<div id="square" style="background-color:green; position:relative; 
                           width:50px; height:50px"></div>

<script>
$('.moveright').click(function () {
    $('#square').stop().animate({
        right: "-=100px"
    });
});

$('.moveleft').click(function () {
    $('#square').stop().animate({
        right: "+=100px"
    });
});
</script>

See the result

Usually, though, this approach is not enough. Imagine an scenario where you have a concatenation of animations in a given event, say a mouse click. When another click queries for another animation:

  1. Without stop(), it will wait until the current animation and those in the queue are finished and only then the new ones will proceed.
  2. With stop(), it will stop the current animation, AND continue with the other animations in the queue. And only then the new ones will proceed.

This behavior is usually not welcome, as when you have an animation as a reaction for an user event, the user expects this reaction to happen at the moment, and smoothly (and, of course, the user is not patient, you can’t ask him to wait for the current animation to finish 🙂 ). Then is when reading stop() documentation comes into play:

It admits 2 arguments: clearQueue and jumpToEnd. Both default to false, therefore stop() means stop(false, false). When ClearQueue = true, it will not only stop the ongoing animation, but will discard all the other animations waiting their turn in the queue. It’s important to recall that all animations such as fadein() fadeout(), animate()… when called when another animation is being performed, are added to the queue (by default named “fx”) waiting their turn in FIFO order. Therefore, when stop(true, false) is called, whichever queued animations will not be performed and the new one will be fired immediately. This is the most basic feature of this function when you need a quick reaction at any user action, as this ensures this reaction to be instant.

Queue functionality in JQuery is useful in multiple ways, but when working with event-animation it’s almost always a hassle you have to deal with. “clearQueue” is the argument that will help you with that. Generally it would be enough, but sometimes you’ll need to think over the second argument of stop(), jumpToEnd. Depending on the nature of the user interaction and the animation used, you’ll need to figure out whether or not to use it. If false, the animation will stop and the object animated will remain at whichever place it was when stopped. If true, it will jump instantaneously to it’s animation’s final position. This is important, because in our situation this will tell where the next animation is starting from. Generally though, stop(true, true) will not be the best answer, as it will most definitely kill any smoothness you were willing to achieve.

Check the case which drew me to write this post in this script file of my personal web http://www.arnauorriols.com

Enjoing the power of the open source Community at its best.

It’s been four weeks now. About 30 students sharing every evening a dusty channel on IRC since 22th June to listen from kushal, mbuf, souradeep and all the staff of Dgplug, all the goods they happen to offer. We sit, quietly, read patiently, and ask questions in a religiously strict order. In return, we get tonnes of knowledge, countless literature, and a thorough practice on what we all most believe: The libre knowledge, the community cooperation, the common development; in short, all the goods of the Free Open Source Software world.

Dgplug is a little Linux community of the indian city of Durgapur. As they state in their website, its foundation was animated by a bunch of “few small brains grouped together to populate Linux in the locality”. These small brains are actually very reputed people, mostly Fedora volunteers, who since 2004 try to contribute to his city with his knowledge and the libre values. More about them, here.

We attend at which this year will be the 6th Summer Training Course of Dgplug. They started in 2008 as a free, open course aimed to bring all who wanted the oportunity to be involved in FOSS, contact with important guests of varied areas, and most important, to learn. The main learning topic is Python language, of which our main teacher Kushal Das is an expert, and is just about to finish his book Python for You and Me, which I commend everyone to read. We are also taught about html, Linux administration, and projects contribution. The final goal is to prepare people to be on the path for contribute and become involved on this valuable society, and we couldn’t be more excited.

For those of you who are interested on participate, take a look at dgplug.org, read previous logs (of all lectures down to 2008!), take a look on what is talked about in the planet or just drop into the IRC channel, #dgplug.

With this I declare this blog inaugurated . My name is Arnau Orriols, at your service. Stay tuned for any update on Dgplug, FOSS, or anything the computing world,

I’ll be around.