Sunday, 20 September 2015

Eritrea

Regardless of my interest in geography, history and social issues, I have to admit that my knowledge about Eritrea was pretty low. I knew the basis: Horn of Africa, independent after Italian rule and a war against Ethiopia, an "Italian style" capital, and well, what sadly you have to assume about mainly any African country, it's poor.

It seems like the second biggest group of refugees in the current humanitarian crisis are Eritreans, for example the shocking refugees camp that existed between last summer and this summer in central Paris under one of those beautiful overground metro tracks was basically populated by Eritreans, Sudanese and Ethiopians. So this woke up my interest in the country and made me go in search of some information.

It's very complicated to get a full idea of how the situation is there. The vision that most western media and governments promote is that Eritrea is a very poor and horrible repressive state. This article and this BBC documentarystand on that side. On the contrary, I found 2 fascinating documentaries, "A nation in isolation" and "Behind the Crisis"", that portrait a quite better image. Probably there's truth on both parts. On one side the goverment has made the economy, the health and educational systems improve and move forward, but is paranoid about dissidents and rules with an iron fist. Well, in a continent where hunger, AIDS and lack of education are so common, overcoming them at the expense of some personal freedoms does not seem such a bad deal to me...

I'll try to continue to learn about the country, cause apart from this intriguing/worrying political situation, there are some facts that make it quite interesting, for example:

  • Roughly half of the population is Christian and half of the population is muslim and they live together without friction. Churches and Mosques stand close to each other without a problem.
  • There are 9 main ethnic groups in the country, and again, there seem to be no conflicts among them.
  • Asmara is a sort of masterpiece of Italian modernist architecture.
  • Assab, the city with probably the most horrible weather in the planet (almost no rain, annual mean average temperature of almost 31 degrees and very high humidty. Notice that this contrasts with Asmara, that has rather pleasant climate.
  • During their heroic fight for independence against Ethiopia, the Eritreans were considered the best guerrilla army in the world.

Friday, 18 September 2015

Bordeaux

Bordeaux, "la belle endormie" (the sleeping beauty) is a really beautiful city. It's a little more than 2 hours far from Toulouse by train (and you can leverage a deal and get a return ticket for 30 euros, les samedis de intercité), so I have gone there in a good bunch of occasions. An easy an effective way to describe the city is to label it as a small Paris. I pretty enjoy the architectural change between Toulouse and Bordeaux. Toulouse architecture is amazing, but it does not follow the archetypical French style (the same happens with Marseille), on the contrary, Bordeaux is right what you would expect of a French city (in architectural terms) if your reference is Paris (indeed, Hausmann used Bordeaux as a model for transforming Paris). By the way, Lyon and Nantes are other 2 "very French" cities (well, Lyon is just incredible).

In my last day trip there I came across a few "different" images of the city that have prompted this post, so here they go:

Bordeaux will be connected to Paris by high speed train (LGV) in 2017, which means a travel time of 2 hours (meaning that Toulouse will be little more than 4 hours far from Paris! as we wait for the not yet confirmed LGV extension between Bordeaux and Toulouse). As a consequence the St Jean station is undergoing some important renovation and expansion works. The renovation of the beautiful and classy ceilings involves this astonishing scaffolding:

Le Garonne river flows really, really wide through Bordeaux (it's already pretty wide in Toulouse), and there are 2 modern bridges (Pont d'Aquitaine and the vertical lift bridge Pont Jacques Chaban-Delmas) that seemed to be worth a visit. In the end I didn't find them particularly remarkable, but on my path there by tram I spotted a couple of places that deserved a short stop. In the docklands area (area where the Italian fascist regime set up a submarine base) I came across this astonishing piece of Street Art:

Walking north from there I found quite a few painted walls, this piece quite caught my eye, as it is reminiscent of the amazing ROA

And from there I got to an amazing area that seemed a bit like copy-pasted from Berlin, Les vivres de l'art (beautiful memories of the courtyard of the sadly extinct Tachelles):

Sunday, 30 August 2015

Some films I've watched this year

In the last year my rate of film watching has quite decreased, so I have hardly posted any reviews. Anyway, there are a few rather interesting films that deserve at least a short mention here. Here it goes:

  • The East. I watched this excellent film 1 year ago, but never found the time to do a full review. It tells the story of a group of eco-fighters and the "spy" that infiltrates them. It stars the "indie diva"Brit Marling and the so cute Ellen Page. It's no wonder that the eco-militant thing reminded me of 12 Monkeys, one of my all-time favourite films.

  • The Captive. I watched this film early this year in Toulouse ABC cinemas. I quite liked it, it's slow but thrilling, with a broken narrative that makes it difficult at some moments to fully follow the story (maybe this is also because I watched it in English with French subtitles). I guess it's loosely inspired by Natascha_Kampusch's story.

  • We need to talk about Kevin. Wow, quite a shocking film. If you don't have kids and do not plan to do so, this is a nice story to reinforce you in your positions, and will be pretty handy to recommend it to your parents if they ever get a bit tiresome with the "you are not making us grandparents" kind of disappointed complaints :-)

  • Ex Machina. Best science-fiction film in a long while. A software developer performing a Turing test and falling in love with the target... well, something like that could have come up from my head! By the end of the film you'll be in love (or at least pretty horny) with the I.A.

  • La ninha de Fuego. It seems like this film has gained quite attention and pretty good reviews in France (I watched it last week in Utopia cinemas, and it was also on display in ABC cinemas). Slow and intense, it suggests but hides, making your imagination flow and leaving you with some open questions. I love how sexual domination is used as one of the main ingredients of the story, but no sex is shown (other than a nude image of the main female character, a tortured "femme fatale". This kind of strange story slightly reminded me of Almodovar's The skin I live in.

Monday, 24 August 2015

Solidarite Toulouse - Kurdistan

This last Saturday I came across a demonstration of the Kurdish community in Toulouse against ISIS and their sponsor the Turkish islamo-nationalist government. Indeed I think this demo was prompted by the last brutal attacks and repression exercised by the Turkish fascist state: bombing of Kurdish freedom fighters and civilians, the delivery of Kurdish prisoners to a certain death and torture in hands of Al-Nusra, the rape, torture and murder of a Kurdish female fighter... and the list goes on and on and on. Not that my French language skills are sky rocketing, but once joined to the demo I managed to chant some slogans like:

  • Erdogan assasin!
  • Daesh (ISIS) Terrorists!
  • Kurdistan libre!
  • Solution politique pour le Kurdistan

Obviously I took some pictures:



The organizers were handing out to the passers by an interesting pamphlet explaining this new chapter of Turkish dirty war and violence against the Kurds.







BOYCOTT TURKEY!!!!!!!!

Friday, 21 August 2015

Cyprus

I think many people don't know that Cyprus is a divided (invaded) country, and its capital Nicosia is the last remaining divided big city (along with Jerusalem). Though I quite knew about this situation, watching a few documentaries [1] and [2] on this topic last weekend has really infuriated me. Sure this is fostered by the visceral hate that I have developed lately for Turkey (as a state): the permanent neglect of the Armenian, Assyrian and Greek genocides, their ongoing joint venture to perpetrate a Kurdish genocide and destroy any kind of coexistence among religions (Syria...)

The passivity of the international community towards the Turkish invasion of Cyprus and the ensuing murdering and looting is shocking, not only at that time, but particularly now. With Cyprus being a member of the EU, the whole EU should exercise a hard boycott on Turkey, damaging their economy as badly as possible, putting them to the corner to force their complete withdrawal from Cyprus and strong economic compensations. The EU has just done so with different actors and without a real reason. I'm talking about the economic sanctions to Russia because of the conflict with Ukraine. I've already said it before, basically I don't give a shit about any of those 2 countries. In my eyes they are probably the 2 most xenophobic, utranationalist, racist and homophobic societies in the world (yes, sure, I'm judging them as a whole, it goes without saying that sure there are normal Russian and Ukrainian individuals that abhor their societies as much as I do), so I don't think we should spend any effort with them. Anyway, the alleged "Russian invasion" of Eastern Ukraine can not be compared in anyway to what happened in Cyprus. Russia is supposed to have entered into a territory where most of the population is of Russian descent, while the percentage of Turks in Norther Cyprus before the invasion was pretty lower. Likewise, so called "progressive" forces in Europe seem never tired of remembering us about the drama of the Palestinians, but stay oblivious to the drama of Kurds, yazidis or Eastern Christians being slaughtered by ISIS and the collaborationist Turkish government.

Hopefully I think in the last years the idea of Turkey joining the EU has been losing momentum, and indeed, I think it's just impossible. In principle all EU member states have to agree on a new country entering the Union, and obviously Cyprus will never agree, and I assume that Greece either. I had always opposed to the idea on cultural and historical basis, now it's purely that I can't consider Turkey a civilized country.

As a curiosity, I'll have to admit that Turkey seems to have done one good action in these years regarding this island, they have constructed a rather unique undersea pipe to carry water to the chronically water deficient island (to the Turkish occupied side, of course

We can all wish that with the rising tensions in Turkey (I think they could be on the verge of a civil war between islamo-nationalist scum on one side and Kurds and left-wing Turks on the the other side), some Left-wing Kurdish or Turkish fighter will make justice and get us rid of the current Turkish Fuhrer, that vicious torturer and murderer called Erdogan.

Saturday, 15 August 2015

Bytecodes, ASTs and so on

These pieces of news: [1], [2] and [3] about WebAssembly have made a pretty intereting read. It's not that I am interested in using it, I think 99% of web development projects will continue to be done in an every day more powerful and beautiful JavaScript, but the concept is pretty interesting since a technical stand point.

Being able to write high performance code for the web so that game engines can run smoothly on the browser is cool, but as I've said, I guess few people will ever need it. Having your Browser Virtual Machine running for a same "application" two parsers (one for JavaScript and one for WebAssembly) compiling to a common bytecode language is cool, but nothing new (you've been able since a long while to mix Python and Ruby into a C# application, and the same for Java). What is funny is that in the CLR and the JVM the first citizens were the static, "low level" languages (C#, Java...), and then the dynamic and more feature filled languages (Python, JavaScript, Groovy) were added as second citizens, for the web it has been right the contrary path.

What I find really interesting is that the code written in this "binary format for the web" is not bytecodes, in the sense that is not a set of instructions for a stack based (CLR, standard JVM) or registers based (Dalvik) Virtual Machine, but a bit upper level, a binary representation of an Abstract Syntax Tree (AST). Does this ring a bell? Well, it's just what is done with the DLR languages, that are compiled at runtime into a DLR AST that will be then transformed into .Net bytecodes.

The main performance advantage offered by WebAsm over JavaScript is that parsing this binary AST into bytecodes is way faster than parsing JavaScript. Though quite unrelated, my mind established a link between this and JerryScript, a JavaScript engine for small embedded devices. In the article they explain how they managed to make this engine fit into just 64KBs of memory:

From the perspective of IoT, we only focused on memory footprint.

JerryScript is a pure interpreter in contrast with multi-stage adaptive JIT engines today. So it has no overhead for storing compiled code. Even the parser doesn’t store AST. It produces bytecode line-by-line directly from the source code. For data representation, objects in JerryScript are optimized for size. JerryScript is using compressed pointers, bytecode blocks with fixed size, a pre-allocated object pool and multiple representation of Number objects to achieve both standard compliance and memory optimization. We will keep continue to reduce the memory footprint in various ways.

Friday, 7 August 2015

WPF vs WinForms

I don't like WPF. I've ever found it complex and overarchitectured, with a rather steep learning curve (and most times the VS designer does not seem able to draw effectively a XAML form) . For thin client applications a HTML5 SPA using your favorite JavaScript Framework/toolkit is usually more than enough. For thick clients sometimes is also enough. For those that it's not and for purely client applications you can try some of the HTML5 and node combinations discussed here. Anyway, for business line applications, Windows client applications are still needed and demanded. For those cases, I still would prefer to avoid WPF and stick to Windows Forms, and seems like I'm not the only one.

Sure there are many horribly architectured Windows Forms applications out there, just a continuation of the classical vb5 and vb6 nightmares. Obviously that's not Windows Forms fault, and many people have been developing pretty well desinged WinForms applications. The use of MVC (well, indeed I think it is MVP) demonstrated here is quite similar to what I've used in the few WinForms projects I've worked on.

With this in mind, the other day I was wondering if there is really any advantage in using WPF over WinForms. The resulting "research" did not give me conclusive answers, but made me refresh my poor knowledge of how Windows GUI applications work.

Apart from XAML, the recommended patterns and the new controls, under the covers the main evolution from WinForms to WPF is that WPF uses Direct X for rendering while WinForms uses GDI. DirectX can discharge this drawing to the Graphic Card, while GDI will do it in your CPU. This means that WPF drawing should be much faster that WinForms drawing. However, in principle WPF objects are more heavy than WinForms objects (in .Net terms). You can read more about it in these interesting StackOverflow posts [1] and [2]

One interesting point raised there is:

That being said, if you have a LOT of controls, WPF can actually outperform Windows Forms by a fair amount. In Windows Forms, each control requires a separate window handle, and receives its own message sets. With a lot of controls, this can actually slow things down pretty dramatically.

So in "Windows terms" WPF controls are lighter. But, what does this window handle and messages thing mean?

The most essential feature of any Windows GUI application (either .Net or native) is the existence of a Message Loop. The main thread in your windows application runs in a loop waiting for messages (a click, a timer, a refresh...) and when a message is received it will pass it to the code (Windows Procedure) associated to the affected Window. The notion of what a Window is at that level is quite important. At this level a Window (a Win32 Window) is not just your "normal Window" (with is blue title bar, close button...) but also controls like buttons, combo boxes, edits... you can see it here. They are created with the CreateWindow Win32 function, that is how under the covers WinForms, classic vb, MFC,... create their controls.

Both WinForms and WPF are based on the Windows message loop (it's created and kept hidden from you by Application.Run), but WinForms works much closer to the Win32 reality. Underneath it uses the CreateWindow function in user32.dll for creating most of its controls. In turn, user32 uses GDI for drawing these controls. From here:

User32.dll is a core windows dll used for windowing and other interactive user program tasks. WPF does not use it much.
Windows.Forms is mostly a .net wrapper around User32, and so is still based entirely on GDI,GDI+, and window handles.

WPF uses CreateWindow just for creating "real windows" and then it will create its controls by drawing on these Windows via DirectX (as if it were drawing shapes). As an analogy, think of how html controls work. An html button or textbox looks like its WinForms counterpart, but it's not a Windows Control, but a shape that the browser draws (for example via Cairo in Firefox)

You can verify this by running Winspector and trying to select a control in a WinForms application and a WPF application.

In the WinForms application you can select controls, for example a button:

While in the WPF application the only thing you can select is the "normal Window":