Saturday, 16 September 2017

100% CPU usage when using The Pirate Bay site

You may have noticed that when using the Pirate Bay site, your CPU usage goes up all to the top. That is because the web site is silently using CoinHive, a distributed cryptographic currency miner that uses the processing power of web users. The easiest solution for me was to go to %windir%/System32/drivers/etc/hosts and add the line
1.1.1.1 coin-hive.com
This tells your computer that the coin-hive server is in an unreachable place. You could add URLs with coin-hive in your URL filter or ad blocker software instead.

Now, CoinHive is not a bad thing. (Using it silently is. I wonder if they do this for mobiles as well, destroying their battery life.) In fact, the idea is pretty interesting and I've considered it before in a different context. I may still use it. You are browsing a web site and there are no ads on it or you have a mighty good ad blocker. How is that site to sustain itself? It does so by using some of your processing power. Before the advent of cryptocurrency, there was not way of efficiently monetize CPU power. People have tried, with projects like SETI@Home, but it was always a not very granular process. It only worked for processes that could be split into tiny pieces that were still relevant.

So there you have it, an interesting idea, used in a nefarious way :) Or, if you want to support the site, leave it on. You will make them money.

Question for programmers [Regular Expressions 2]

As with all the programmer questions, I will update the post with the answer after people comment on this. Today's question is:

Friday, 15 September 2017

Question for programmers [Regular Expressions]

Here is a question for programmers. I will wait for your comments before answering.

Tuesday, 5 September 2017

The Last Wish (Saga o Wiedźminie #1), by Andrzej Sapkowski

The Last Wish is not what I expected. I liked the Witcher games reasonably well, but I liked the character in the stories of the games more than the one in this book. Andrzej Sapkowski creates this character who is trained by pain, knowledge, poison and discipline to become the ultimate monster killer. However, the result is a very ordinary person, one who is better at fighting and resisting various magic or chemical attacks, but still a regular dude. He has friends, he falls in love and has moral qualms, he gets defeated and knocked out.

The book is actually a collection of short stories with Geralt the witcher as the main character. Some are reimaginings of classical folk tales, but all of them are about real versus perceived monsters. Is something huge with dagger like teeth a monster to be killed or is there a cursed person inside. Is a normal human less monstrous just because he looks normal, or is he a cruel and vicious villain? In all stories there is a lot of dialog, with characters that are not clearly developed talking a lot about what is going on. I didn't like that. It felt like reading plays.

But even so, I would have said that the book is OK. Like someone trying to write a fairy tale of their own. Why not? But there was this expectation from the games that the witcher was a womanizer that decides who lives and who dies based on his own strange code and lives on the edge by the strength of his skill. In fact, in the books he is the most decent hero I've read about in a while. He is one of the last of a dying breed, like samurai or American native warriors, not because of the monsters that kill them off, but because of humans spreading everywhere and expecting everyone to live by their code of conduct. If he would kill all the monsters in the world, he would be the very next to be destroyed by the people who no longer need him and have always hated him. Let me tell you that it is hard to reconcile my expectations with the book character.

Bottom line: an OK book. Certainly not great in any respect. I recommend you read it before researching the character or playing the games. I think that the book makes the games more interesting, by adding a backdrop story, but the games make the story hard to enjoy... because they are simply better.

Saturday, 2 September 2017

We Eat Our Own, by Kea Wilson

book cover We Eat Our Own is a reimagining of the making of an infamous movie called Cannibal Holocaust. It was an exploitation movie, featuring all kind of violence, from rape to murder and cannibalism, but also one that strives for maximum realism. In her book, Kea Wilson is portraying a world of emotional dog-eat-dog, with the movie and even the reality around the film set becoming part of a cannibal act where people use and consume and corrupt others.

I can't say I enjoyed the book too much. It is very well written and it makes the reader get visceral feelings about the people and the events inside, however I couldn't make myself care about any of it. In striving for realism herself, Wilson managed to make all her characters human, flawed, real, and almost impossible to empathize with. You understand some of them, you even see yourself think or act the same, but none of it is something you would want to see yourself do. Also, while a lot of the people in the book are caught in an abuse cycle, none of them is actually stuck there. They can leave at any time. Perhaps this is the most intriguing and interesting point of the story: even the most horrible things that we do to each other require some form of consent from the victims, some form of submission, without which the abuse would never happen or at least, not last too long.

In conclusion, I am sure there are a lot of people that will enjoy the hell out of this book. People oriented, feeling focused people, perhaps. I had difficulty making myself finish it, even fully conscious that the writing was very good. But this is my review, so I will not grade this above average. Probably it is a good idea to watch Cannibal Holocaust first, even if the movie is only an inspiration for the book.

Tuesday, 29 August 2017

Careful with case sensitivity in html files. (especially in Firefox extensions)

After my disappointment with the Firefox for Android lack of proper bookmarks API implementation, I was at least happy that my Bookmark Explorer extension works well with Firefox for desktop. That quickly turned cold when I got a one star review because the extension did not work. And the user was right, it didn't! One of the variables declared in one of the Javascript files was not found. But that only happened in the published version, not the unpacked one on my computer.

Basically the scenario was this:
  1. Load unpacked (from my computer) extension
  2. Test it
  3. Works great
  4. Make it a Zip file and publish it
  5. Shame! Shame! Shame!

Long story short, I was loading the Javascript file like this: <script src="ApiWrapper.js"></script> when the name of the file was apiWrapper.js (note the lowercase A). My computer file system is Windows, couldn't care less about filename casing, while the virtual Zip filesystem probably isn't like that, at least in Firefox's implementation. Note that this error only affected Firefox and not Chrome or (as far as I know - because it has been 2 months since I've submitted the extension and I got no reply other than "awaiting moderation") Opera.

Sunday, 27 August 2017

Infomocracy (Centenal Cycle #1), by Malka Ann Older

book cover Malka Older is a writer, humanitarian worker, and PhD candidate at the Centre de Sociologie des Organisations (Sciences Po) studying governance and disasters. Named Senior Fellow for Technology and Risk at the Carnegie Council for Ethics in International Affairs for 2015, she has more than eight years of experience in humanitarian aid and development, and has responded to complex emergencies and natural disasters in Sri Lanka, Uganda, Darfur, Indonesia, Japan, and Mali. (quoted from the About the Author section) And if your interests are not exactly aligned with the author's, you will probably not like this book.

Infomocracy describes a near future in which countries have dissolved their borders and instead opted for a system of centenals, groups of 100000 people who vote for the system they want instead of having it shoved down their throats based on where they were born. A decent idea that deserves some thought. However, the entire story, action and drama of the book is about the voting process. It's like a cyberpunk novel written by a voting system enthusiast with an obsessive disorder, thus feeling both boring and out of touch. It was literally hard work finishing the story, trying to understand why I should care about the stuff happening there or about any of the characters.

Even taking into consideration that it is the first book Older wrote and that it is supposed to start a cycle (damn it, people, write something for its own sake, not for endless series and trilogies and sagas!), the book is still a failure, because it doesn't really explore the way microdemocracy works, instead focusing on a bunch of electoral agents and some of the underhanded methods to sabotage the system. The players are not clearly defined, the characters are shallow and so it is almost impossible to care about any part of the book. You want a good sci-fi book about microdemocracy, try Daemon, by Daniel Suarez.