Sunday, 7 February 2016

Some Recent Films

These last weeks I've gone to the cinema to watch some films, so I thought I would write some short comments here.

  • Carol. Seems like this film has got pretty good reviews, and here in France it's been displayed both by "blockbuster cinemas" and by Art et essai cinemas
  • . A dramatic "lesbian love story" in the 50's in USA seemed not particularly appealing to me, but well, I felt like going to the cinema, and the spoken English/French subtitles is just what I look for these days. I got what I expected, an entertaining film, but that I will forget in a few weeks and that probably I won't watch again. Of course, Rooney Mara and particularly Cate Blanchett (yes, I love mature beauty) make the film more interesting than it would be otherwise.
  • The Hateful Eight. First of all, I'm not at all a Tarantion fan. I can say with no shame at all that for me he's just one more "action films director". I went to watch this film because I felt like going to the cinema and it was an easy choice, for sure it would not delight me, but at least would entertain me. It ended up being right like that. Probably the story is more exciting than average (I like how he made the "racial problem" a constant all over the film, it's pretty interesting bearing in mind that such problem is still present in USA society), but I really miss the presence of some beautiful female character.
  • A Second Chance. This is an excellent film. Though the main character is a policeman it's more a drama than a crime film. Harsh and intense, if I had watched it on my laptop I think it would have fallen in that limited category of films that I watch in one go. I can not think of many films which title expresses so well what the film is about. The whole story revolves around a second chance for a child, but it will end up as a second chance for a mother. When it finished I thought that the style reminded me a lot of other films (specially Brothers by a Danish film director that I used to follow until a few years ago. So right, this is the last work by Susanne Bier. I absolutely recommend to watch all her filmography.

I've watched these films in ABC (in its 50th anniversary) and Utopia, the 2 Art et Essai cinemas (cinemas more focused on independent films) here in Toulouse (along with la Cinémathèque). I've watched them in original version with French subtitles (pretty needed for the Danish film or for Tarantino's, cause I barely could undertand a word of the English accents in that film). My spoken French is still null, but have no problems reading ("Je peux lire le français sans problème"). Unfortunately, French films are not screened with subtitles (quite odd, I would expect some more respect for people with hearing disabilities), so there is a good bunch of films that I've had to miss, these are 3 of the main ones that come to mind:

  • Tête baissée, a thriller/drama set in Bulgaire and Marseille, maphia, human traffic... seems pretty interesting.
  • Les Chevaliers blancs tells the story of the Zoe's Arch charity controversy in Chad.
  • Timbuktu revolves around the monstruosities perpetrated by Islamist during the occupation of this ancient city in Mali.

Sunday, 24 January 2016

.NET 4.6 and Roslyn

When comparing .NET and Java there used to be a small difference that I considered as an advantage on the .NET side. The JRE does not come with the Java compiler, so even for writing a helloWorld program you'll need to install the JDK. On the other side, the .NET framework used to be installed with the csc and vbc compilers (they are in C:\Windows\Microsoft.NET\Framework64\v4.0.30319 along with the framework assemblies), so you can open a text editor and start to code.

This has changed a bit with .NET 4.6. You still will find a C# compiler in the framework folder, but the crazy thing is that that is not the new, C# 6, Roslyn based compiler. If you run it you'll see this message:

So where is the brand new cool compiler? The shocking answer is, nowhere, the so important Roslyn, on which Microsoft spent like 5 or more years is not part of the Framework, you'll have to install it separately. It'll get installed by Visual Studio 2015 (Community version also, of course) here: %ProgramFiles(x86)%\MSBuild\14.0\bin, but if you don't want to go through the lengthy installation (I've never understood why Visual Studio is such a monster, it takes much longer to install that installing a full OS like Ubuntu, while installing SharpDevelop takes like 2 minutes) you can just install the nuget package (it's mentioned here). By the way, Roslyn is now named The .NET Compiler Platform. Notice that you don't need Visual Studio to install nuget packages, hopefully you can just get the command-line utility (nuget.exe binary) from here.

So, why would Microsoft decide to keep the new compilers away from the framework? I assume they want to keep the standard Framework slim (apart from the "ultra slim" .NET core). Then, why didn't they also remove the old compilers? Well, the reason why the comilers have been a part of the runtime since its early beginnings is because one part of the base library makes use of them, CodeDom. When you use the CodeDom to create code at runtime, it ends up calling the (classic) csc compiler executable (sure it's strange, even when the old compiler is native code, not managed code, I would say that the normal approach would be to have its logic in a dll and have CodeDom call it via PInvoke). Notice that the 2 main view engines for ASP.NET, Razor and aspx, both use CodeDom to compile the views, so removing the compiler from the runtime would break the CodeDom, breaking pretty important existing code (imagine that if after installing .NET 4.6 on a Server all the Web Apps installed there would stop working!!!

So I guess Microsoft kept the old compilers to avoid breaking code but did not include the new ones (which would involve all the Rosly assemblies) to prevent the runtime from getting fatter. The old consequence is that if you add C# 6 features in your views, they will fail to compile at runtime unless that you specify that you are using an updated version of the CodeDom that uses Roslyn rather than the old compilers, CodeDom Providers for .NET Compiler Platform. It is explained here. The astonishing thing is that when passing these assemblies through ILSpy, they do not seem to reference the Roslyn assemblies (Microsoft.CodeAnalysis.dll and so on):

So I would say they are calling running the (new) compiler .exe. Roslyn offers to us a managed API acting as a compiler as a service, so why the hell these new CodeDom providers would need to run the binaries???
Honestly, I have no idea.

Friday, 22 January 2016

Sessions and Logon Sessions

At some point in the past (quite a while ago) I had read something that gave me the impression that (in the Windows OS) Sessions and Logon Sessions were not the same, but had not found any conclusive information on it. The other day the doubt came up again, and this time I came across this excellent answer in StackOverflow that finally sheds light on the subject, and yes, Sessions and Logon Sessions are different things.

As they mention there, in too many occasions Microsoft itself uses the terms arbitrarily, making it all pretty confusing. Reelaborating a bit what the guy says in his answer, we have:

Main Sessions. These are the Session 0 where the Windows Services run, and the other interactive sessions that you can open on one machine, either by login on the machine lying on your desktop (either being the initial user or by the fast switch user option) or by using remote desktops. These are the Sessions that have Windows Stations, Desktops and so on...

Logon Session. This is mainly a security concept. Everytime a user provides its credentials (by loging to the machine, calling CreateProcesAs from your code...) a Logon Session and a primary Access Token are created. The Access Token points to the Logon Session. Notice that when a process creates another process the child receives a copy of the parent's Access Token, that's how we end up with multiple access tokens that point to the same logon session.
If you launch ProcessExplorer and check the Security Tab in one Process properties, you'll see this:

I assume that information there comes from the Primary Access Token for that process. You can see there both the Session and the Logon Session. A Logon Session is associated to a Session. When you do a new interactive logon on a machine (directly, RD, Fast user switch), a new Session and a new Logon Session (associated to it) are created. If you set a Service to run under a certain user account, you'll see that when the service is started a new Logon Session is created and gets associated to Session 0.
If you do Run As as the same user twice to run 2 applications, each Run As will create a different Logon session and Access Token. Those Logon Sessions will be associated to the session from which you did the Run As

Running SysInternal's logonSessions.exe will show you all the logon sessions on your machine. If you run it with the -p option, you'll see all the processes running in that Logon Session.

To summarize: Each process runs with its own Primary Access Token. An Access Token is linked to a Logon Sessions, and we'll have many Processes/Access Tokens linked to a same Logon Session. A Logon Session is linked to a Session, and we'll have many Logon Sessions assigned to the same Session.

Sunday, 17 January 2016

Lille

I have to admit that before I moved to France I hardly had any notion about a city called Lille, just "one more middle size French city up in the north". Once here, I found out that if we consider its Urban area or Metropolitan area, its population is right before Toulouse in the ranking of French cities (the city proper is much smaller), making it the fourth after Paris, Lyon and Marseille. Bearing in mind that so far any French city with more than 20.000 inhabitants that I've been to is is well worth the visit (you'll always have a Hotel de Ville, Prefecture, Palais de Justice and Cathedral to delight your eyes), Lille had to be good place for a weekend. As it's a bit far for going by train I delayed it quite a bit, but last weekend I finally made it there (thanks Easyjet!)

Obviously I had done some reading about the city before going there, and it looked pretty promising, but reality quite exceeded my expectations. Lille does not belong to that group of "small Paris like" French cities like Lyon, Nantes or Bordeaux, it goes in the group of "very unique" French cities, like Toulouse, Marseille and Nice.

The main point to take into account is that Lille lies in what is called French Flanders a part of the historical county of Flanders that nowadays belongs to France. It's pretty curious, it would be easier to imagine a "French Wallonia", but well, Brussels was originally a Flemish city, and it's now mainly French speaking... so it's not so unique. Adding to confusion, it seems that this "French Flanders" area has one part that originally spoke Flemish and another (Lille goes there) that initially spoke Picard (a Romance language). The thing is that with its Flemish past, Lille looks absolutely like a Belgian city Anwerp, Ghent or Brussels. Indeed, having been in all of these beautiful cities, I would say that Lille features the most impressive architectonic ensemble of all of them. The "old Flemish" buildings, like the Vieille Bourse, are amazing, but the "neo Flemish" ones, like the Chambre de Commerce have not lowered the bar.

At the end of last century, faced with the decline of their tradicional industries: coal and textiles, local politicians decided to foster the services sector, and they absolutely succeeded, managing to create a huge economical hub just in between of Paris and Brussels. One of the main milestones in conducting this transformation into the service sector was the Creation of EuraLille, the biggest business district in France after La Défense in Paris and La Part-Dieu in Lyon. This district is a real delight for anyone into modern architecture. It's not too impressive in terms of height (120 meters for the tallest building), but the architectonic features are really remarkable and make wandering around the area a real pleasure. I'd really love to see the projected TESO (Toulouse EuroSudOuest) district to become something similar.

Lille can be a bit disconcerting in terms of population. The city proper is only 230.000 inhabitants, the urban area, that includes several cities (Roubaix, Tourcoing, Villeneuve...) of around 80.000, grows to more than 1 million, and then the metropolitan area, that includes several Belgian cities grows to more than 2 millions. Furthermore, less than 40 kilometers away to each side you'll find 2 more metropolitan areas, each of around 1/2 million: Douai/Lens, and Valenciennes, so it's a heavily urban area, resembling the Rhine_Ruhr in Germany, the Flemish Diamond in Belgium, or the Randstad in the Netherlands. Notice that the 4 areas are part of the Blue Banana, the discontinuous corridor of urbanisation in Western Europe.

Last December, the FN was sadly on the verge of winning the regional elections in Nord-Pas de Calais-Picardie. One of the "start measures" that these bastards want to carry out is taking France out of the EU. Obviously the idea is sickening and ridiculous, but in a city with a metropolitan area that crosses the border into Belgium, the "idea" is just senseless.

Wednesday, 30 December 2015

The Fall of Constantinople

The other day, when talking about how islamofascists (salafist scum and so on) are destroying the French society (and the Syrian, Libanese, Egyptian, Tunisian, British, Belgian... societies) I had to listen once again one of those demented comments coming from "the collaborationist left" that always finds a way to justify whatever atrocity perpetrated by perverted, fundamentalist "muslims". This time the argument was based on the horrors of colonialism, so it seems that the bad doings during colonial times justifies that someone that has been living in France (and taking advantage of some parts of the French system: social aids, heath system... and rejecting others: educational system, cultural centers...) during all his life decides to join a sect of sociopaths and spread their sickness by preaching (and using) hate and violence against anyone that does not adhere to their sickening interpretation of the world.

I am fed up with this view where "the old" Europeans should be blamed for everything, and where the "new Europeans", the people from the old colonies that are now a proud an essential part of our societies should consider themselves as "traitors". The past is the past, and of course it needs to be known and used to understand the present, but not to justify everything.

This said, I'm going to enter the game for a few minutes, I'm going to talk about the horrors of colonialism, but another kind of colonialism, the one that "the collaborationist left" seems to forget or to be ignorant of. Europe has suffered different invasions over centuries, let's name some of them:

Regarding the Ottomans it would be interesting to note that their invasion still continues today. Just think about the city currently known as Istambul, its part lying on European soil used to be known as Constantinople, and during the times of Bizantium it was one of the great (or maybe the greatest) European cities. Then the Turks came, invaded, looted and murdered... and they have never been asked to decolonize and return the city to Greece... the big Turkish city is one of the greatest reminders of to what extent Turkey is not our alley, but just the contrary.

There's an imposing and beautiful painting in Toulouse's Augustins Museum by the Orientalist painter Benjamin Constant, The Entry of Mahomet II into Constantinople that gives us an exceptional glimpse into the tragic and painful day when the Ottoman hordes entered the magnificent Byzantine city.

Wednesday, 23 December 2015

Structural Typing and Dynamic Languages

The other day I read for the first time about Structural Typing. Nothing particularly revolutionary, but interesting anyway. It tends to be defined as a sort of Compile-time duck-typing for static languages. Scala seems to be the most "mainstream" language implementing this feature.

Duck typing is one of the basis of dynamic languages. You don't consider that an object is suitable for an action depending on a strict contract like its type, but in a much more relaxed "having whatever methods I need" kind of contract. Structural typing allows us to indicate those methods that we require that an object sports. The advantage of this over directly grouping those methods in an interface is that as we are not forcing classes to implement an interface we can apply it to existing classes without modification, the compiler we'll provide the safety by checking that the class really has those methods.

I think being able to define a set of methods that an object needs to have could be a useful addtion to duck typing in dynamic languages. Let me explain:


function doSomething(ob1){
ob1.method1();
//do something more
ob1.method2();
}

In the above case, we could receive an object that has method1, but not method2 (it's a "partial duck" not a "full duck"), so our doSomething function would not fail until it calls to method2. Depending on what this code really does, running it only partially would be useless or even dangerous (so that we could need some sort of rollback)

So it could be interesting to have something like this:


function hasMethods(ob1, methodNames){
//returns boolean
}

function doSomething(ob1){
if (hasMethods(ob1, ["method1", "method2"])){
ob1.method1();
//do something more
ob1.method2();
}
}

Saturday, 19 December 2015

YellowKorner

I think YellowKorner is an absolutely amazing place for anyone that is into photography, or just into beauty. I first came across one store of this publisher of Artistic Photography here in Toulouse and I was just delighted by the exquisite pieces of photography that I found there. In a city that sports a pretty good offer of Museums and galleries, YellowKorner ranks at the highest position in my podium of cultural references.

Talking about the art centres of "ma ville", Toulouse features one of the oldest public places in the world dedicated to photography, Le château d’eau. They usually have on display 2 different exhibitions for around 2 months. So far I've been in some of these exhibitions and they were OK, but not particularly interesting. However, this spring I attended to a really good one taking place in the cute, imposing (the exterior is rather reminiscent of Albi's Sainte Cécile) and just revamped Couvent des Jacobins. It was a selection of works in the château d’eau collection, intendend to celebrate its 40th anniversary, and some of the pieces were really remarkable.

Over time, I've come across YellowKorner branches in many other French cities: Paris, Montpellier, Aix en Provence... and today checking their web site I've found that they have shops in many other countres, even in Asia. I really recommend you to take a look at their list of locations, so that next time you visit a city hosting one, you don't miss to pay a visit. The works on sale change enough to make it well worth to pay a visit to a YellowKorner establishment at least once every 2 months.