Sunday, 25 September 2011

From Resistance to Revolt

After several attempts over the last years, finally last month I managed to find for download the 2 CDs that make up the whole discography of one of my favorite hardcore bands of the 90's, Manifesto.

One million thanks to this blog for making them both available for download here

  • Un mundo que ganar, unas cadenas que perder (A world to be won, some chains to be broken)

  • De la Resistencia a la Revolución (From Resistance to Revolt).


Manifesto was a socialist hardcore band from Barcelona, active I think roughly between 1994 and 1999. Most of their work should be classified as what at the time we called New School Hardcore (I've been so cut off from that scene in the last decade that I don't know if this term is still much in use), something in the vein of Earth Crisis, but their best songs (well, at least my total favorites) are some very fast tracks that appeared in their 7 inch "El arte de la insurrección", rather reminiscents of Man Lifting Banner. These songs also have some of their best lyrics.

Some of their uncompromising socialist (of course we're talking about Marxism/Communism..., not about socialdemocracy) statements are now more relevant and up to date than ever, even when I rather disagree with all the "class fight" stuff (just because on the contrary, it seems like a pretty outdated concept in our world of Megacorporations, outsourcings...)

My favorite song in terms of sound is also my favorite one in terms of lyrics, "En este Sistema/In this System"
Here's my broken translation from Spanish:

Free Market, economic anarchy, cut after cut. Accumulate is the new Bible. Production that ignores human needs. Profit is their only sacred law. Health System, Education System, social services. Always questiones, always under attack. We have no control over what we create. We can't decide what to use it for. Judges, parliament, structures designed in this System. Army, Police, created to protect their profits. In this System we ever lose.

As you can see, in our current Europe, where all sort of funding cuts are being conducted, those lyrics seem more relevant than ever, and make us realize how the foundations of our Western civization (universal health system, education system) seem to crumble.



A fun note now, the cover for this CD seems a bit odd for such a political band. I mean,Casa Milá is a superb building, but neither the building nor the architect have any political significance, so how does it match with the Socialist ideology of the band?. Well, it's pretty fun, one of the band members told us back in time that there was a huge demonstration due to pass by the building, so they hired a photographer to take a pic from one of the buildings across the street. The thing is that they got too late and the demonstration had already passed... but anyway they took the picture of the empty street and used it for the cover :-)

Lyrics for "De la Resistencia a la Revolución":



Saturday, 24 September 2011

Destructuring Assignment

I've been keen of Rhino since the first time I knew about it, many years ago. At that time JavaScript was not by far the popular language that it's now, and being able to run a JavaScript shell and do some of your normal coding tasks with it was not in most people's agenda (for example just think that 95% of the WSH samples that you find on the net are VB instead of JavaScript).

Today I paid a visit to their site to see if there was something new, and to my delight I found version 1.7R3 there. I immediately jumped to the "What's new" section, and from there to the JavaScript 1.8 section. And there I found one of those brilliant ideas that once you come across them think how it is that humanity has lived for so long without them :-)
Changes in destructuring for..in

I've known the concept of destructuring assignment since the times I used to do some Python coding, it's a simple and powerful idea that I though only applied to function returns and swapping values

var [a, b] = function(){
return ["val1", "val2"];
};


so when I found this destructuring for..in thing it really caught my eye. I was not completely sure of what it mean, so I've done a couple of tests, and it's amazing, you can write code that elegant like this:


var ar = ["a", "b", "c"];
for (var [i,v] in ar){
print (i + ": " + v );
}

var ob = {
name: "Iyan",
age: 30
};
for (var [k,v] in ob){
print (k + ": " + v );
}


If you change "print" for "console.log" and try it in firebug you'll see that it works fine for objects (second sample) but not for arrays (first sample), which appears odd to me as this seems to be part of JavaScript 1.8 and modern versions of Firefox seem to implement it...

Update, 2012/11/25 With the functional style additions to ES5, both cases above can be easily rewritten with the new forEach method in the Array object:

var ar = ["a", "b", "c"];
ar.forEach(function(item, index){
console.log (index + ": " + item );
});
 
var ob = {
name: "Iyan",
age: 30
};
Object.keys(ob).forEach(function(key){
console.log(key + " : " + ob[key]);
});

Sunday, 4 September 2011

Passing Anonymous Types as parameters

It's been a long while since my last C# post, so time for a short one.
Some days ago, I'm not sure why, it came back to my mind a question done by a colleague some months ago "hey, I can't pass Anonymous Types to another method?" and my simple answer, "no, you can't".

Well, my answer was rather simplified and outdated, what I really meant was that you can't pass Anonymous types around in a useful way. As the type is anonymous, when you pass it to another method, all you can put in the signature is Object, so in order to get access to any of its properties you would have to use Reflection, and that's verbose and slow.

public static void PrintPersonAnonymous(object p)
{
PropertyInfo propName = p.GetType().GetProperty("Name");
string name = (string)(propName.GetValue(p, null));
Console.WriteLine(name);
}

PrintPersonAnonymous(new
{
Name = "Iyan",
Age = 40
});


Hopefully, with C# 4.0 things are much better. You can declare the parameter as dynamic in the method signature, and then you can access its properties normally. The only problem is that the access is still done via Reflection, but it's the compiler who generates the code instead of you.

public static void PrintPersonDynamic(dynamic p)
{
string name = p.Name;
Console.WriteLine(name);
}

PrintPersonDynamic(new
{
Name = "Iyan",
Age = 40
});



Of course, we all know that dealing with Dynamic objects can be pretty fast if we're using objects that take care themselves of the property access - method invocation by implementing IDynamicMetaObjectProvider, like for example ExpandoObject does.

With what I've just said, an idea comes to mind, converting an anonymous type into a ExpandoObject, something that is pretty trivial (probably the most interesting thing here is that we can get access to a Property of the ExpandoObject using its string name by leveraging that it implements IDictionary<String,Object>)


public static dynamic AnonymousToDynamic(object ob)
{
IDictionary d = new ExpandoObject();
foreach(PropertyInfo property in ob.GetType().GetProperties())
{
d[property.Name] = property.GetValue(ob, null);
}
return d as dynamic;
}


This way we can convert our anonymous object to an ExpandoObject to improve performance.

The source code

Ah, while writing this I found this post where they explain a rather different approach to this same problem.



Saturday, 27 August 2011

Looting begins (in the name of democracy)

While his fate is unknown at this point (public or hidden retirement, being taken on trial, being behaded by the "rebels" with the smiling approval of the "civilized" world...), what is clear now is that Gaddafi is over.

What a beautiful world, thousands of peoples have been murdered by NATO bombs and the NATO sponsored "rebels", the infrastructures of a modern country completly destroyed (and waiting for reconstruction, what a yummi cake!), a harsh division of the country between pro and anti-"rebels" that sure will burden the country for many years... but hey, they've got ridden of the dictator and democracy is waiting. Once again the Global powers have done their duty, spreading democracy and freedom to one more "dark corner" of the world. "Freedom", a pretty depreciated concept.

For Global powers Freedom means Democracy, and that's pretty easy to understand, Democracy nowadays is such a convenient form of government... it's the easiest way to keep masses "happpy", silent, calm and conform. There's not better way to prevent someone from seeking something than making him believe that he already has it. "You're free", you're allowed to choose your government, you're allowed to represent you community by entering the political system, and bla, bla, bla...
Yes, you're allowed to choose between the political parties, but only those that the Global powers fund, you're free to choose between the different lies spread by the Mass Media owned by the Global powers, you're free to receive decent education and decent medical care if you can afford it...

It wouldn't have to be that way, sure democracy could be a good system of government, but the problem is that in the last decades, every new place that has been "awarded" with democracy has received it with one more extra gift, "Brutal Capitalism". Yes, since a long while Democracy comes hand in hand with Neoliberlism and capitalism, so Democracy has turned out being a poisoned gift for so many countries.
Take a look at Soviet Union, is the average Russian better now (not being able to send his kids to the University, spending half of his income in the rent of a dilapidated flat...) than in the Soviet times?, take a look at Serbia, take a look at Ukraine or Romania, think about those young Eastern women forced to leave their country (so democratic now) to sell their bodies in some mafia owned brothel in one of our so democratic countries...

If democracy is so important for "our leaders" it's odd that it has taken them 40 years to come to the realization that Libya should be democratized by any means (like Irak...), and it's even more strange that Syrians do not deserve that brilliant fate (or what to say about Somalia, where if Islamists had been wiped out and a functional government established it would be a bit easier now to deal with the current famine)...
Of course, there's a clear difference, profit, or let's put it clear booty. Same as Iraq was, Lybia is a wealthy country, and as such, a highly desirable prey for global capitalism. It's not just taking over the oil deposits, it's the reconstruction process. How many millions will be spent in rebuilding all the infrastrutures destroyed by the NATO forces? Libya has a huge flow of petrodollars, so let's suck it dry!

There's an important point to notice about the NATO war on Libya:
Contrary to what happened with Iraq, there's been hardly any visible opposition to this war among the different "progressist" groups in the Western world. Sounds odd, cause I still have fresh in my mind the images of the huge demonstrations against the invasion of Iraq... So what?, well, Global Powers learned a lesson from the "Weapons of Mass Deception" thing. For many people solidarity is above fear, so trying to terrorize people with an imminent threat (biological weapons, nuclear weapons, terrorism...) does not work when they know that the "remedy" to that unlikely threat means dragging millions of people into the very certain horrors of war. But there's an easy workaround, let's put the victims on our side. Let's create a group of "freedom fighters" (the so called "rebels") and let's say that these honorable freedom advocates are being slaughtered by the dictator (yes, that's true, Gaddafi was getting rid of the "rebels" with violence, as he had always done, but the same violence that they had started off with). The trap is ready, and most "progressist" Westerns will take the bait, who could oppose the helpful actions of the "Keepers of peace" trying to help "freedom fighters" and civilians against the awful dictator...?
There's been no questioning among the mass, few people seemed to care about who the "rebels" are, about what would come next if they seized power... Well, the "rebels" are a mix of Radical Islamist (wahhabists, salafists... all that scum that hates us, Westerns, so much), monarchists, some progressist pro-Western Lybians (but don't worry, they'll have little to say in the future government, probably as the Iranian Ayatolah did with the Communists after the "Islamic Revolution", they'll get smashed by the "beardies") and finally, a wide group of opportunists initially on Gaddafi's side that switched sides as they realized that the Regime had little to do against all the NATO machinery...

Please, watch these videos for some insight into this:
http://rt.com/usa/news/al-qaeda-libya-commander-escobar-269/
http://rt.com/usa/news/pepe-escobar-libya-iraq-132/


Well, at least we can think of the positive things of this senseless destruction:
the economies of those more involved in this shameless war: France, USA, UK, Spain... will get a boost with all the contracts to sign to rebuild Lybia. Anyway, sure they'll tell us that boost is not enough to stop the cutbacks to the Education System, Health System... well underway in most of Europe...
I bet it'll take just a few months to have the first Hollywood Blockbuster telling the story of the "heroes of Tripoli"...

World of shit... well, I better end this here and go to sleep...

Friday, 19 August 2011

Riots in UK

I truly admire this man since the first time someone (thanks Gus!) sent me a link to one of his videos: Free Speech in Eurabia. Ever since I regularly check his web to catch up with his new videos, and I've never been disappointed, just the contrary, such is my admiration that I've even "paid him a beer" via Paypal.

Even living in the country that is undergoing probably the sharpest process of Islamization in Europe, he's not afraid to fiercely criticize Radical Islam, unveiling the facts of this demonic threat with an astonishing sense of humor. Hopefully, he does not stop there, and also attacks Radical Christians, brainless "suicidal leftists" and NeoNazis alike (by the way, it's fun to notice, reafirming how trendy and brainless these shitheads are, that while now most NeoNazis tend to be antiIslam, just a few years ago they used to be rather proIslam)
We could consider Pat a Heroe of Western liberties, someone that with each of his speeches reminds us that we have a responsability to keep and improve this our civilization, one that our ancestors built by rebelling against feudal lords, kings, bishops and dictators, and that we can't remain with our arms folded, prisoners of "Political Correctness" while a bunch of illiterate zealots attempt to destroy it.

This time Pat is particularly angry (and it's not surprising, my feelings, being someone that has only been to Britain as a visitor, were also really strong in view of the shameful events happening last week), and he does a glorious speech against all those lame, ungrateful bastards that tried to terrify and bring to its kneels a whole society.
I absolutely share his views and I think to know enough about England to be pretty certain that most of those vandals were not "victims of society" like some "PC media" try to portray them, but just the contrary, lazy bastards living off this society, taking advantage of all sort of social aid: housing, wages...
the others are just hooligans or normal idiots wanting to feel bad an rebellious.

Something interesting in this episode of violence and that I think is rather specific to UK is the lack of power on the Police side. I'm not talking about the lack of materials (thought I have to admit that not being allowed to carry guns really shocked me), but about the inability to properly confront criminals cause any sort of physical "contact" with them would almost certainly end up with the policemen in court.
That's not the same here, just the contrary (and that's not for good either, cause in Asturies-Spain policemen are known for their violence and impunity, mainly when they act against workers or left wing people).
What I think is common to all of Europe (at least to all those countries living under the Political Correctness Dictatorship) is that common citizens are not allowed to defend themselves. Confronting a criminal, either a common street robber, a NeoNazi or a Latin Gang (both equally stupid and xenophobic) or someone entering your home and attacking you and your family, is not allowed in any way in our weak societies where any sort of self defense causing any harm to your aggressor would end up in serious problems for you. If you're lucky, that will just mean paying a huge compensation to the criminal (and a bitter feeling of helplessness on your side), but that well could end up for you in a prison sentence much more severe than anyone ever served by your attacker.

Shit, all this absurdity is sickening, so no better way to sort it that finishing this write up with some sentences by Pat Condell that ever manage to make me smile:

Multicultural fascism
PC totalitarianism
Post Imperialist Guilt
Islam dominates, not integrates
pathetic, pompous human vermin

Friday, 12 August 2011

Technology Radar

After reading the Thoughtworks Technology Radar for July I could not help dropping a few lines to praise this statement:

GWT is a reasonable implementation of a poor
architectural choice. GWT attempts to hide many of
the details of the web as a platform by creating desktop
metaphors
in Java and generating JavaScript code to
implement them. First, in many ways, JavaScript is
more powerful and expressive than Java, so we
suspect that the generation is going in the wrong
direction
. Secondly, it is impossible to hide a complex
abstraction difference like that from event-driven
desktop to stateless-web without leaky abstraction
headaches eventually popping up
. Third, it suffers from
the same shortcomings of many elaborate frameworks,
where building simple, aligned applications is quick and
easy, building more sophisticated but not supported
functionality is possible but difficult, and building
the level of sophistication required by any non-trivial
application becomes either impossible or so difficult
it isn’t reasonable.


Wow, even never having done any development with GWT I think I can fully endorse those claims without fear of being wrong. When I first heard of GWT some years ago I thought it was a huge step back.
My boss in one of my first development projects was a real "guru", a visionary that had developed an impressive RIA framework in the early 2000's, using tons of beautiful Object Oriented JavaScript (both on the client and on the classic ASP server), CSS, Active X (it was for intranet applications that only needed to run on IE), an excellent debug console and tons of XHR (at that time JSON was almost unknown, so it was sending/receiving needlessly verbose XML). The first versions even used iFrames instead of XHR.
Well, I'm telling all this because thanks to that (and to an old o'reilly JavaScript book where I first read about prototypes) I've been pretty aware of the power of JavaScript and client side coding from rather early, and that's why GWT smelled like crap to me since the first moment.
Translating Java to JavaScript seemed absolutely ridiculous to me (I could even say insulting), and it can only be justified by wanting to do life easy to sloppy programmers that are not willing to learn a new language and paradigm. It appears to me a terrible mistake, similar to the error of keeping VB around by morphing it into VB.Net, instead of forcing developers to learn the beauty of C#...

The idea of hiding the Web particularities under a "desktop metaphor" was first implemented in Asp.Net WebForms, and I would say that with terrible results (don't get me wrong, it can be OK for some kind of applications, but not for the kind of applications that we need today, well, hopefully now we have the almighty Asp.Net MVC) that were hardly improved with the addition of "Update panels". Shit, I remember the pain of trying to make some basic JavaScript DOM manipulation in an Asp.Net 2.0 Web application (with tons of update panels, puff...) that we developed 4 years ago... the hacks that we had to devise to work around all the limitations imposed by "the Web as the Desktop" nightmare...

Web Developers have had excellent DOM, Ajax, effects, "language enrichment" libraries since a long while (jQuery, mootools, dojo...), so what we now need are JavaScript frameworks pushing and helping us to write more maintainable JavaScript intensive applications. It seems like backbone.js and JavaScriptMVC could be good steps in that direction. Unfortunately I haven't had a chance to play a bit with them, but I'm longing to get my hands dirty with them :-)

Saturday, 6 August 2011

Centurion

The last work by the almighty Neil Marshall is, as one could expect, another masterpiece.
From my review of The Descent 2, it's clear that I love both installments of The Descent.
As for Doomsday, I've been about to write a review several times, but in the end I've never got to it, the thing is that is an amazing film drawing from different excellent influences, though maybe it's a too crazy mix at times and probably I would have dismissed a few parts.

Centurion will keep you stuck to your screen for 90 minutes. The story is pretty interesting, more if like me you're pretty interested in history, early inhabitants of Europe, the Atlantic Arc...
It wisely uses one of the possible explanations to the disappearance of the Roman Ninth Legion as background for a story of escape, revenge and survival. If you add to it the stunning Scottish landscapes, the Picts (the misterious ancestors of the Scottish people that were able to put to halt the (until then) unstoppable advance of the Roman empire (not even my ancestors had managed to stop them), and the captivating beauty of Olga Kurylenko you have a sure winner.

The general feeling can seem similar to Van Diemens Land or even Valhalla Rising, but I prefer Centurion over these films.

Well, I think I need some sleep, so nothing more to write here, just watch it!