Friday 28 April 2017

J'adore Femen

Years ago, when I first knew about Femen, I got quite interested on them, but I have to admit that it was more due to the nice view of young women in topless protesting histerically on the streets that because of their feminist agenda. Of course I consider men and women should have equal rights, but living at that time in one of the few parts of Westen Europe where Islam basically did not (and hopefully still does not) exist, I used to think that these equal rights were a reallity (and indeed in some cases: child custody after divorce, parity rules, positive discrimination... women had more rights than men). At the same time, I understood that Ukraine was a much more conservative (backwards) society, and sure things were different, but anyway I was more interested in their "topless attitude" :-)

At the same time, for my Western European mind it was odd that these feminists would protest "with almost no clothes". For me the main problem for women was their reduction to sexual objects and all the social pressure that comes with it (look beautiful and sexy or be a freak and a loser), so showing their almost naked bodies to defend the women's cause seemed contradictory to me. Of course it was a way to gather (a lot of) attention, but anyway it seemed odd and dubious to me.

Over time their protests became more and more interesting. They were confronting the (radical) Orthodox church and the Islamists! At one point one of their main members cut down a cross in Kiev. Over years I've become less and less critical to Christianity (if people need a religion to fill their spiritual needs better that they chose Western style "humanist" Christianity rather than "humanophobic" Islam...) but the ultra-conservative Eastern Europe Orthodox Church (homophobic, nationalistic...) is a different story, so I almost entered in ecstasy with that video :-D

After this the activist Inna Shevchenko, had to search for refuge in France (Tu es la bienvenue chez nous!!!), where she has developed the Femen branch. Their actions in France (at least the main ones I'm aware of) have been corageous and praiseworthy, confronting Islamists and the FN likewise. Seeing 3 bare breasted women burn a salafist flag in front of the Great Mosque of Paris was almost orgasmic to me! With this action they moved from activists to heroines.

I had not thought much of them in the last years, until I read a pretty intesting interview in Charlie Hebdo on the occasion of the release of a book written by 2 of their members, Inna and a French Madeimoselle, "Anatomie de l'oppresion", dealing with the oppresion exerted by religions over women

"A radical and enraged essay, a lawsuit for 'blows and wounds' against religions" - Coco, Charlie Hebdo

In these last years in France I've seen to what extent (one form of) Islam is trying to destroy our freedoms and our mixed society. How it asks its followers to keep away from the infidels prompting them to live in a separate, medieval community until the day they manage to conquer the whole country. How it despises women turning them into worthless objects. There are neighbourhoods in Paris where a normal Arab woman will be insulted (at the least) for not wearing a scarf and will not be allowed into a bar!!! (This form of) Islam is the biggest enemy of humanity, and of women in particular. So suddenly, I've realised how powerful a weapon against these medieval beasts the naked body of a rebellious woman is. It represents all what they hate and fear, a proud woman, shameful, corageous and ready to kick their fucking, hairy balls. In a sense we are back in the 60's, when women would wear a mini-skirt as a symbol of freedom and rebellion against the moral rules of conservative society. This made them dangerous and scary rather than weak objects. Femen has managed to turn the female body into a very threatening object, into a weapon, at a time when because of the reIslamisation of the population of the "quartiers populaires" and the arrival of more Islamist invaders, this is more necessary than ever. We need this courage and determination in both women and men to defend our society and freedoms from the horrors of radical Islam or Nationalism. Notice that Femen's headquarters in Paris have been attacked by neonazis. It's interesting that these bold aryan warriors attack a feminist centre but don't have the bollocks to attack a Salafist indoctrination centre (aka radical mosque) or the conferences of that anti-white, anti-French group of criminals and proto-terrorists kwnon as Les indigenes de la Republique.

I learnt in the interview that a few years ago some designers were inspired by Inna Shevchenko to create a new stamp representing Marianne.

It makes pretty much sense. Almost 2 centuries separate the amazing representation of Marianne (the French republic) in the canvas by Delacroix, "La Liberté guidant le peuple (Liberty leading the Peope)" from the Femen protesters, but one can see in them the modern incarnation of Marianne.

So Femen, please, continue to kick the balls of bearded medieval fascist ("Niqab ta mére - Fuck your mother") and new style nationalists as hard as you can! Vive la République laïque!

Friday 21 April 2017

Http.sys update

Things have changed a bit since I wrote about self hosted web applications in .net and http.sys 4 years ago, so I'll write a short update.

In the past your (Microsoft based) self-hosting options were based on HttpListener, that relies on the powerful http.sys kernel driver. As you can read here we have now 2 alternatives for Asp.Net core. If we still want to leverage http.sys we'll be using the WebListener embeddable server. This is the evolution (it started as a fork) of the HttpListener. Notice that WebListener has been created just to take advantage of http.sys (by means of the HTTP Server API), so it is only available for Windows, it will not be ported to Linux. If you want to run your application on both platforms you should use the other alternative, Kestrel. Time ago the the Mono folks implemented HttpListener for Linux, which made much sense at that time as there was not any other alternative component, but with the multiplatform Kestrel there's no need to port WebListener.

There's an important general difference between Unix and Windows regarding ports. In Unix you need to be root in order to listen on a port below 1024 (a privileged port), but this limitation does not exist in Windows. So when running kestrel on Linux you'll have to be careful to use a port above 1024 (unless you want to run kestrel as root, that is not a particularly good idea).

On the other side, if using WebListener you'll also be have to be careful about ports and permissions, though this is due to how the underlying http.sys works. This kernel driver is the one that listens for http connections, and your WebListener application has to register with it (hey, listen on this port and redirect anything with this url prefix to me) so that it redirects the incoming connections to your application. If you are running your application as admin you'll be able to register on any port, but if you are not admin things can get a bit more complicated. Registering your application with http.sys for ports under 1024 is protected, so for a non admin user to be allowed to do so you will first have to configure http.sys giving the user permissions on that port/url. It's what you do with the netsh http add urlacl command.

When using Kestrel on Windows there are situations where you still need to be aware of http.sys, particularly if you are trying to run Kestrel on port 80. On some occasions this port will be already taken by http.sys, so if kestrel tries to listen on that port you will get an error. Notice that Kestrel is totally unaware of http.sys, so it does not try to register with http.sys, it just directly tries to take the port. As far as I know http.sys is loaded into (kernel) memory by Windows at start up (as many other drivers), but it will not start to listen on any port until a process asks for it. This is how it looks on my home machine.

Http.sys is loaded into memory and it has a couple of kernel threads running (Process Explorer shows these under a fictitious "system" process. If you check the TCP/IP connections for that pseudo-process you'll see that the http port is not taken, so I have no problem to start another web server on that port.

However, on my office laptop I can see that port 80 is taken by the "system" pseudo-process (hence, it had to be http.sys who is taking it). So some process that I'm not aware of has asked http.sys to listen on that port. In a situation like this, if we need port 80 for another Web Server not relying on http.sys, the best we can do is to disable http.sys as explained here.

Don't be confused by the use of sc to unload it. Http.sys is not a "normal" service (notice that you will not see it displayed on services.msc), but one kind of drivers (like http.sys) can be installed and loaded/unloaded through the sc service interface. This in the end calls into the CreateService function in advapi32.dll, passing as parameter the SERVICE_KERNEL_DRIVER value. So in a sense we could consider these drivers as "Kernel services".

Friday 14 April 2017

Overriding Extension Methods

The other day I found that there is a proposal to add "multiple inheritance of behaviour" to C#, by means of allowing you to add "implemented methods" to interfaces. This is basically what was done in Java 8 with "default methods". I talked about them some years ago.

So far we could get a limited taste of this by means of Extension Methods (as you know this has been the way to extend IEnumerable with all the Linq methods). So, what's the difference with default methods?

Extension Methods are a bit more like a hack. They are like a limited form of the object expansion (monkey patching) that you do in JavaScript (when you assign a new method to a [[prototype]] or the object itself. I say limited cause there is a main problem with it. It's a static, compile-time artifact, hence it can not be overridden. I mean, let's say I have this code:


interface IPerson
{
 String Name {get;set;}
}



static class PersonExtensions
{
 public static string SaySomething(this IPerson person)
 {
  return "Hello, I am " + person.Name;
 }
}



So I have an IPerson interface and we sort of expand it by adding the SaySomething extension method. The problem here is that if I have a French class were that method is redefined (it's not properly overriden, as it is not part of the interface itself, just an extension), if I use the interface, I will continue to call the extension method rather than the overriden one. The compiler just sees an interface and a method call not directly in the contract, but in the extension, and statically binds that call to the extension method. With default methods in Java we would get the dynamic behaviour.


public class French: IPerson
{
 public string Name {get; set;}

 public French(string name)
 {
  this.Name = name;
 }

 public string SaySomething()
 {
    return "Bonjour, je suis " + this.Name;
 
 }

}



IPerson iP = new French("Charlie");

Console.WriteLine(iP.SaySomething());
// prints "Hello, I am..."
//it calls the extension method (PersonExtensions.SaySomething) rather than French.SaySomething

Could we do something to "fix" this with extension methods? Well, I can think of a rather ugly hack, but it could come handy. We would have to include in those extension methods that we want to make overridable the code that checks if type for the specific instance that we receive in this call is redefining the method. Something like this (just a POC, I'm not checking parameters, only the method name):

 static class PersonExtensions
{
    
 public static string SaySomethingOverridable(this IPerson person)
 {
    
  if (person.GetType().GetMethod("SaySomethingOverridable") != null)
  {
   dynamic aux = person;
   return aux.SaySomething();
  }
  else
  {
   return "Hello, I am " + person.Name; 
  }
 }
}

IPerson iP = new French("Charlie");
            
//this one goes through the Extension method that contains the type checking and allows the overriding
//so it prints "Bonjour, je suis..."        
Console.WriteLine(iP.SaySomethingOverridable());

Saturday 8 April 2017

La Tour d'Occitanie

A few weeks ago the great project was revealed, Toulouse should boast a 150 meters skyscrapper around 2022. The project is absolutely beautiful. A vegetalized tower, a "spiraling garden" overlooking the lovely Canal du Midi, the Central Train Station and a revamped promenade (I refuse to call it "Ramblas" as the city council does, this is proud and beautiful France, not Catalonia...). Furthermore, it'll be the entry point to TESO (Toulouse Euro SudOuest), the future business district surrounding the train station. As someone that pretty loves modern, high quality, high rise buildings, I'm pretty excited with this project, though I'm afraid there will be many obstacles on its way (but it has already overcome a good deal of them!).

This project is conceived as a very much needed signal of architectural modernity in an open and prosperous city in which the mediocre architecture of the last 60 years has not lived up to the beautiful constructions of its past. It's a way to put the image of Toulouse (in modern architectonic terms) in line with those of Lille or Marseille (or even Lyon, but this gorgeous city plays at a different level, it's really like a small Paris). Each of these cities has at least one modern and beautiful "skyscrapper" (in France more than 100 ms can be considered like that) and is building a new one: the existing CGA-CGM tower and the new La Marseillaise tower conceived by Jean Nouvel in Marseille, the existing EuraLille towers and a new planned tower to host some administrative offices, the beautiful Tour Incity in Lyon (that also has some more planned)

In general the local reactions to this announcement have been quite positive, which has been rather surprising for a city so conservative when it comes to architecture, and infested by the kind of stupid "ecolos" that basically are against everything and still think that high-rise buildings damage the environment, when it's absolutely the contrary, modern high-rises are the most environment friendly kind of construction. The socialist party (in the opposition) has embraced the idea, and reminded us that it was them who included in the PLU (urban plan) the possiblity of building a 100 meters tower in Montaudran Aerospace (unfortunately for the moment promoters do not seem to be interested in this project, the crazy French security laws that apply to new buildings higher than 60 meters make them so expensive that only projects in very sought-after areas can be carried out). Many people see this like me, as a necessary architectural signal that will put Toulouse at the level it deservers

As for the negative reactions that we can read online, we have several types. Some of them are totally respectable. Some people do not like high-rise buildings due to their own personal sens of aesthetics. OK, I accept that, each one has a sense of aesthetics, I love gothic but I don't like renaissance that much, I love dark clothes and hate clear ones... So I love (well done) high-rises, but others don't. But most of the negative reactions are so fucking stupid...

  • Who's going to pay?. Well, it's not due to host any public institution, only private entities (Hotel, offices and appartments). It's private inverstors who are in charge of the project, the city council is not putting a single euro. On the other side, the roof top with amazing views over the city (and the Pyrenees in days of high visibility!) will be open to the public. So well, we are getting for free an architectonic landmark that will help to put the city on the spotligt and a public space like no other one in all of Southern France. Seems like a deal to me :-)
  • They better invest the money in improving people's quality of life. As I've said this is 100% private investment, so up to you to try to convince the promoters to invest their money in setting new bike lanes or public parks, I guess they'll consider people's smile and gratitude as a more than enough return of investment...
  • It does not match with the architecture of the city Oh, yes, that's true, it's what usually happens when something completely new is done, it's different from the rest. I guess the first wooden hut would feel pretty "unfitting" to the folks living in caves, and the same later with the first stone houses, the first glass windows and so on. If all these "experts in urban planning" and "ecolos" of today had lived centuries ago gothic cathedrals would have never been built because they didn't fit with the existing buildings and being so high and slim made them look like "phallic symbols"...

The main and recurrent complain (and I fully agree with such complain) is the English name, Occitanie Tower. This is France, and there is absolutely no reason to use an English name for something called to be a symbol of "notre ville". It's clear that Tour d'Occitanie makes much more sense. In Paris, you delight your eyes contemplating Notre Dame, not Our Lady. Furthermore, with the Brexit it's time to rethink the role of the English language in the European Union.