Sunday, 26 August 2012

Impressions from Obzor, Bulgaria

I've just returned from a holiday spent in the lovely Bulgarian town called Obzor. At least other people say it's lovely, I thought it was full of them (people, I mean) which would explain both their assessment and mine. Anyway, my wife and I stayed at this hotel called The Cliff and spent 8 days together celebrating her birthday and 10 years of marriage. Happy birthday, love! These are my impressions of the journey.

First we had to get there and there are two major routes from Bucharest to Obzor: through Ruse and across Bulgaria and through Durankulak, after driving on the newly constructed A2 highway in Romania (the digit two coming from the fact that we only have two highways at the moment and this is the second). We went via Ruse and returned on the highway, with similar time results and positive feelings. The GPS did it again and chose a more scenic route running through small villages like, for example, Sindel. I shouted "Fatality!" when we exited the village, to my wife's dismay. Even so, it was a good quality road, which in Romania you rarely see in small rural areas and we enjoyed the wilderness.

Ok, we got there. The Cliff hotel is located just outside Obzor and is a four star hotel. That means... at the moment I have no idea what it means, I just assumed it would be way better than a three star hotel, but it appears it is about the same, only with a pool and a lot more expensive. Actually, I want to spend some time discussing The Cliff. It is one of those hotels that have so much potential and yet the experience is being spoiled by little details which I suspect are the fault of greedy little owners not understanding that they are serving people, that's their job, not just owning stuff and getting richer.

About The Cliff hotel in Obzor, BulgariaThe hotel is situated on a cliff (surprise!) and is in fact a complex of buildings having a system of interconnected pools at the center. The buildings are nice and the pool almost great. Imagine this medium sized pool that has between 1.3 and 1.7 meters in depth, that connects to a smaller one via a jumping point which doubles as a waterfall. Then a small canal takes the water to an even smaller pool, designed for small children. Somewhere in the middle of the meandering canal there is a small jacuzzi. This pool alone and the way it looked make The Cliff a beautiful hotel. One can get to a rather isolated part of the beach via a long set of stairs or by going with the car in Obzor. A taxi can be employed, charging the enormous sum of 10 leva for a 2-3km run, or one could walk the same way.

The beach is one of those great fine sand beaches, only there are some unexpected rocks further into the water. This freaked me out a little, as I was starting to swim and I found myself hugging a gigantic boulder. The rock was covered with algae, not with razor sharp shells, so it was more of a psychological shock. I suppose that makes that part of the beach so remote and isolated. We didn't even try the commercial part of the beach because of all the people, the noise and the fact that we had a perfectly fine chlorinated pool inside the hotel! I didn't have to suffer floating garbage, stinging eyes or the smell of decaying algae and seashells, which other people find so endearing. I don't know about that, wouldn't the same effect be obtained with a bit of garbage in a salt shaker? But returning to the subject of the beach, can you imagine that 10-20m from the edge of the sea, the depth was still around my waist?

So, The Cliff is a beautiful hotel, isolated, with few people and a great pool. What could possibly go wrong? Everything else, of course.

The staff had almost no knowledge of English or Romanian, except maybe some of the folks at the reception. Even so, the others were morose unhappy people that kind of drifted, like some ghosts from The Shining. The reservation included free breakfast and my wife tried to drink the coffee, only to notice it was instant coffee. She asked for an espresso and was told she had to go to the bar and buy one.

Nobody can stand between my wife and her coffee! Civilisations rise and fall when she gets angry. I am an engineer, I can easily find what is the weakest point in a system and make it break, but she is the destroyer of worlds! She is like a cute sexy Dalek. She exterminates anything standing in the way of her daily coffee.

Also the prices from the restaurant were impossible for the quality of the food. I had to pay 25 leva for 5 shrimps in a plate. For the same amount of money I get a full platter of all kind of seafood at the Regina Maria hotel in Balchik, around 80 kilometres above Obzor. (BTW, I can't recommend that hotel enough, also four stars, but one feels good there).

The room had a TV, an old AllView with only 20 total channels that showed anything 10 seconds after you turned it on. That's OK, since we could only get 15 channels anyway with only BBC World in English and the rest in Bulgarian. Two of those were music televisions, but one had horrible audio and both had horrible music. Seriously, Romanian music television is no bastion of good taste, but that was utter crap. There was wireless Internet, only it only worked when not many people were using it and was slow as hell when it did work. We had air conditioning, but the windows could not open, just the main balcony door. There was easy access from other balconies and even from the hotel stair to our balcony so, in the interest of personal security, we had to choose between torpid fresh air and insects and no security or cool air conditioned stale air in a little safe cocoon. The bath was big and had these retro looking finishes, only they went too far. The bath curtain bar was rusted and stained all towels placed on it and the shower head was like a gardening implement with small pressured water jets that hurt rather than cleaned. The insect repellent smell of the bath went away in about three days.

The hotel also had a spa. That included massages with expensive cosmetics, colon cleansing, sauna, etc. The prices were huge, though. Imagine that you had to pay 80 leva for an hour of massage. What bothered me even more is that, after two days, a "promotional" price list was left under our door. They took 25% off some of the procedures. So if you are stupid enough to pay from the first two days, no promotion for you. So you go to a hotel with spa, you pay 80 euros a double room per day and then they tell you the prices are different for any spa procedure so they don't offer you any in the price of the room.

Now, all the hotels have those little annoying cards that double as keys. You have to place them in a slot in order to have electric current. So you can't charge your devices or leave the air conditioning on while you go to sun tan next to the pool. Unless you have a different, similarly shaped card, which I had, the only possible use for those spammy fidelity cards you get at various medical or shopping facilities. But that's like a general rule when going on holiday: always have a standard shaped card to leave in the electric current slot in the hotel.

To summarize: if they bought a little more Internet bandwidth, paid for satellite TV and upgraded the TVs in the room, made some sort of window that you can open without letting everyone in and, above all, didn't think to rip you off at every opportunity, the hotel would have been great! Instead, it felt like a below average overpriced tourist trap.

We also had an unexpected surprise from them. You see, in order to book a room there, you authorize them to take half of the staying sum from your account. For all practical purposes you pay that sum. You then go to the hotel and pay the rest of the sum. Then, they take the sum you authorized them to take when making the reservation, then the rest of the sum, then they "unblock" the authorized sum when you leave the hotel. That means you pay 1.5 times the actual sum until the original half is returned to you. We left on Sunday, and we were kind of... disconcerted... when we noticed a negative balance on our purely debit card. So take that into account (sorry for the pun).

Getting back. A few hundred meters below The Cliff there is the yooBulgaria resort. One could probably go over the Net, find this hotel and choose it, just like we did with The Cliff, to spend their holidays. We went there. It looked nice, but the entire hotel was surrounded by abandoned buildings, victims of the economic crisis in times of great investment in the tourism business in Bulgaria. Seriously, it looked like the hotel was the lucky building that survived a full aerial bombardment of the entire zone. I am talking about empty concrete scaffolds with graffiti on them. Horror movies and parkour videos could be made there.

The town of Obzor was actually a village till 1984. Then it was promoted and then the Communist era ended and the tourism took hold. As a result it is a combination of greedy tourist corporations, small family owned businesses and a tourism oriented management.

We searched the Internet on the best restaurants there and we found: "Starata Kushta", recommended by three different sites that had the same text in them. We couldn't find this restaurant and so we went to recommendation number two: the Tania restaurant. It is a nice little thing, but rather expensive. The guy recommended the pizza there; he probably never went to Romania. Their pizza is mediocre at best. Try the fish things, but do not, under any circumstances, ask for sauces. They are horrible. Then we tried our luck with what was there (and this is my recommendation for anyone visiting Obzor: try your luck, eventually you will find something you will like) and found Morska Perla, or the Sea Pearl. There was this deliciously looking waitress there. We were, of course, served by the old ugly one that didn't know English. The fish was OK, the prices reasonable, but they had this apricot brandy that was really something. We also tried Dionisi, right next to Tania. The pizza in Tania was about 14 leva and rather small. The one at Dionisi was the same size and 4.5 leva. Unfortunately you paid for what you got: pizza from supermarket dough and some cheap stuff sprinkled over. The spaghetti were floating in oil.

The last restaurant I want to mention was almost great: it's called Rai (Heaven) and it is also located around Tania, about 500 meters from it. They have this Rai Calamari dish that has 500 grams and costs 27 leva. I thought it sounded OK, but I really expected some piece of fried cephalopod and instead got a squid filled with a mix of onions, oyster and small shrimp and served with four jumbo shrimps. So, even if the menu didn't advertise it (bad for them) the dish was actually a seafood plateau, something I had been searching for unsuccessfully in Obzor and went up to Balchik to have at Regina Maria (did I mention the hotel and the restaurant are great? They have sushi!)

The only problem with Obzor restaurants and bars is that they don't have dark beer. None of them! I also asked for lemonade and none of them had any! It's water with lemon and something sweet, for crying out loud... I drank a lot of Grozdova Rakia (grape brandy), a Bulgarian speciality, and Kamenitsa, their beer.

That's about it. We visited close by Nesebar, which is nice, but filled with tourists. There was a cool restaurant there, called Hemingway. Not in any way connected to the writer, but good food. We never got to Burgas and we only passed through Varna a few times. Bottom line: Obzor is a nice see side town, but I wouldn't want to be housed in that cacophony of noises, music and smells. The Cliff was a good option, remote as it was, although the sounds from Obzor occasionally made their way there, as well, but it had its flaws.

Wednesday, 15 August 2012

The Strain, by Guillermo del Toro and Chuck Hogan

One of the vampires kindly posed for us before eating the photographerYes, it's that Guillermo del Toro and he wrote a book, together with this Chuck Hogan dude. Actually he wrote more books, this is part one of the Strain trilogy which, judging by the name, should have been about either a contagion or some sort of pulled muscle, but instead is about vampires.

Now, I don't want to be mean towards poor Guillermo. Vampires, even if really overdone nowadays, are pretty cool. The ones in the book are not even sparkling or talking with a Russian accent, but are vicious creatures that have in mind only one thing: to feed. That makes them the more believable type of vampire, although the technical details that are trying to explain in scientific terms the process of vampirification are complete rubbish.

The book is about a contagion of sort, that of vampirism. A "master" comes in New York (where the hell else), wreaking havoc and turning everybody to vampires. They even say this type of vampire is a virus incarnate, although the analogy gets a little strained (get it?). An old Jew is the only one who knows what vampires truly are and how to fight them and he teams up with this New Yorker epidemiologist (and later a pest control rat hunter second generation Russian) in order to fight this asshole vampire.

This melange of different cultures gives opportunity to talk about the Holocaust and 9/11 and even Romania, all at the same time! The writers shamelessly abuse this without actually connecting these facts with the story in any significant way. That bothered me. I understand people can become a little obsessive over things like this, but what kind of a jerk keeps using them to further their careers and books? Anyway, before turning this into another "stop using Hitler, the Holocaust and 9/11 as arguments" extension of the Godwin law, let's get on with the book.

The writing itself is not bad. The only things that kept me getting out of the atmosphere of the book (except the shamelessness above) were some of the emotional background stories used to describe the beginning of the infestation. I would blame that on me, though, as I am often prone to get annoyed by the feelings of others, especially when they get in the way of a good storyline.

Being a trilogy, the book doesn't really end at The Strain. It's just a broken shard of a whole story. You get some hints on what would happen and also some of the arches are closed by the end of the book, so it isn't completely annoying.

Bottom line: Hmm, it was good, not really a masterpiece. It reads like a movie, with a simple almost linear plot. The thing is that, even if it managed to convey the terror of such an occurrence in general, it didn't really evoke in me feelings of horror or at least some empathy with characters that feel that horror, and that is what I was looking for. I've read the book in under a week, but I am not really prepared to spend another two reading the continuation.

Friday, 10 August 2012

How to force a browser render on elements in Internet Explorer (and other browsers as well)

I know of this method from the good old Internet Explorer 6 days. In order to force the browser to redraw an element, solving weird browser refresh issues, change it's css class. I usually go for element.className+='';. So you see, you don't have to actually change it. Sometimes you need to do this after a bit of code has been executed, so put it all in a setTimeout.

More explicitly, I was trying to solve this weird bug where using jQuery slideUp/slideDown I would get some elements in Internet Explorer 8 to disregard some CSS rules. Mainly the header of a collapsible panel would suddenly and intermittently seem to lose a margin-bottom: 18px !important; rule. In order to fix this instead of panel.slideUp(); I used
panel.slideUp(400/*the default value*/,function() { 
setTimeout(function() {
header.each(function(){
this.className+='';
});
},1);
});
where panel is the collapsible part and header is the clickable part. Same for slideDown.

Do not remove the element having focus in Internet Explorer 9!

I had to fix this weird bug today, where only in IE9 the entire page would freeze suddenly. The only way to get anything done was to select some text or scroll a scrollable area. I was creating an input text field, then, when pressing enter, I would do something with the value and remove the element.

It appears that in Internet Explorer 9 it is wrong to remove the element that holds the focus. Use window.focus(); before you do that.

The perils of instanceof in Javascript

I was having one of those Internet Explorer moments in Javascript, when I wanted to use Array.isArray and I couldn't because it was IE8. So, I thought, I would create my own isArray function and attach it to Array, so that it works cross browser. The issue now was how do I detect if an object in Javascript is an Array.

The instanceOf operator came to mind immediately. After all, don't you do the same thing in C#, compare if an object "is" something? Luckily for me, I checked the Internet and reached the faithful StackOverflow with an answer. The interesting bit was explaining why instanceOf would not work for all cases and that is that objects that cross the frame boundaries have their own version of class.

Let's say that you have two pages and one if having the other in an iframe. Let's call them innovatively testParent and testChild. If you create an array instance in testChild like x=new Array(); or x=[];, then the result of x instanceOf Array will be true in testChild, but false in testParent. That's because the Array in one page is different from Array in the other. And, damn it, it makes sense, too. Imagine you did what I did and added a function to the Array class. Would that class be the same as the Array in the iframe, without the function? What if I decide to add
Array.prototype.indexOf?

So, bottom line: in Javascript, instanceOf will not work in any meaningful way across frame boundaries.

Oh, and just so you do have a good way to check if an object is and array, do this:
var strArray=Object.prototype.toString(new Array());
Array.isArray=function(obj) {
return Object.prototype.toString(obj)==strArray;
}

Tuesday, 7 August 2012

That's the way the world works

I am linking four news items. Do you see the connection?
Standard Chartered accused of over $250bn of illegal transactions to Iran
Kim Dotcom judge rules mansion raid was illegal
Gary McKinnon extradition decision delayed until October
TV Shack founder loses round in extradition battle


So let me break this down for you. A British bank is accused of dealing with Iran, against the American embargo laws, to the sum of 250 billion $. It risks losing its licence to operate in the state of New York.

Kim Dotcom, the mega rich founder of MegaUpload, site used almost exclusively to store and share copyrighted material. There are emails of the employees and his detailing the ways they were sharing links to stuff they knew were copyrighted. The New Zealand government raided their offices, arrested him, prepared him for extradition to the US. He was released on bail and the link above explains how the raid was found to be illegal.

Gary McKinnon, a hacker looking for evidence of the US government suppressing information about UFOs and free energy in their military servers, is fighting against extradition to the US. He did minimal damage, and that according to his accusers (McKinnon denied it), he didn't leak the information, he just snooped. The link above shows he is not being extradited yet as the UK home secretary is busy with the Olympic events. If convicted in the US, he is facing up to 70 years of jail. The problem the US government seems most damaging seems to be the bloated cost of 700000$ to "track and correct" the problems McKinnon allegedly caused. In other words, they want him to pay their security costs.

Richard O'Dwyer has hosted links to copyrighted material (not the materials themselves) on UK servers, where such linking is legal (or may be, the discussion rages on). No matter, he is awaiting extradition to the US, where such practices are apparently illegal. The link above shows he lost the first battle against extradition. If convicted in the US, he is facing up to 10 years of jail.

Now do you see the connection? The smaller you are, the larger the punishment. The deed is irrelevant (especially in Great Britain - not so great now, eh?) as well as any national laws when the US is involved. Frankly, I was expecting something like this from my own government, a ridiculous joke that sways whatever way the other nations say, but not from the UK. Canada almost has the same problem, but there the citizens actually rise up against American influence.

Monday, 6 August 2012

House of Leaves, by Mark Z. Danielewski

It is hard to describe House of Leaves in relation to any other I have read before. It is clearly a masterpiece, a mad foray into personal darkness and schizophrenia, maybe Mark Z. Danielewski's (it is certainly difficult to imagine a non-extraordinary person writing this).

What is it about? At the surface, it involves a guy that works in a tattoo parlor finding some old papers in the apartment of a blind old man and getting obsessed by them. You see, this old man has written an extensive analysis of a house made movie than was released to critical acclaim and that was viewed and analysed by a lot of others. Only the film does not exist, the references are mostly bogus and the people that happen to be real deny any connection with this fictitious film.

Now, the old man, Zampano, has died in a house that was sealed from the outside, with various implements used to cover every open bit from the door and windows. Now Truant, the tattoo guy, is reading the Zampano papers and starts to get similarly affected, being overwhelmed by a subtle horror emanating from the old man's writing.

The film itself is about a guy, Navidson, a famous international photographer, who decides to move with his family to a new house, a gesture of healing and reconnection, as his job often took him away from his wife and two children. This house, though, has a secret. Suddenly, there is a corridor in one of the walls of the house. It is terrifying through his deep black color and the fact that the wall is an exterior wall and no evidence of its space is visible from outside. More than that, the corridor twists randomly and seems to go forever, even changing configuration.

These are not the only dimensions of the book. Indeed, the fact that a terrifying hole in a wall exists in their family home terrifies the wife, who forbids anyone going in there, under the threat of leaving. Navidson, though, an explorer and a man dedicated to committing the world to photo and film, feels the need to explore it. The very house that was supposed to bring the family together, breaks it apart.

Zampano's notes are comprehensive, academic, with references from linguistics, physics, philosophy, psychology and literature. They contain numerous quotes from documents and books written about the film. The notes have a lot of footnotes, that contain not only more details about the analysis, but personal ideas and emotional outbursts.

Now, Truant is not really a scholar, but he transcribes all of Zampano's work and adds his own notes, together with the story of the document and bits of his personal life. He does drugs, goes clubbing and has a lot of sex, all while obsessing over his bosses girlfriend. But it is not enough to switch him from his transcribing work and the dark effects this has on him.

And that's not all, either. At one time a foot note describes Truant going into a random bar and hearing a band singing about something in Zampano's notes. He asks the members of the band and they show him the published version of the House of Leaves, by Zampano, annotated by Johnny Truant. Truant starts seeing more and more horrible versions of his own life, only to switch back to reality and not be sure which is which.

The book itself is written in 3 different colors, emphasizing Truant's and Zampano's notes. The references are often insane, hyperanalysing a single quote or sequence of the film through analogies with psychological complexes, Latin quotes and mathematical analysis of sound when it echoes. The notes often end abruptly and continue with Truant's story that itself ends with no discernible pattern.

However, the story somehow remains cohesive and the feelings of alienation and unspeakable, more: undefinable, horror transpire through the book. The early Truant drug trips go further in defining this weird combination of Lovecraft, Kafka and Philip. K. Dick.

Bottom line: this book is as brilliant as it is insane. I have never read a book like it and I can only bow to the immense effort of constructing it. It is itself like a dark corridor, ever shifting, and totally gigantic. You should read it.

Be forewarned, though, this is ergodic literature. To truly understand it, you need to read it on paper or in PDF form; OCR doesn't really work on this book and various rtf, doc, html versions you might find are probably close to unreadable.