Nando's blog
About Nando Nando's blog Posts about video, movies etc. Posts about computing Posts about music Posts about literature Philosophical posts Posts about programming

WYMeditor

WYMeditor: finally a javascript wysiwyg editor that shouldn’t generate buggy XHTML.

Our daily nazism — parents beware

What are our children being prepared for? *Death Note, seen by millions, is nazi. The story was a huge opportunity for moral thought, but only nazi ethos has a chance to appear.*

Death Note

I am talking about Death Note, anime series. The manga series has been read by millions in Japan alone. There is also a Japanese film and a few other franchises.

I wouldn’t normally lose any of my time with nonsense such as anime series, but my 14-year-old daughter likes it and I decided to accompany her, plus in the first few episodes I was curious myself. Why?

Light is a popular, good-looking student who only gets A grades. A genius, really. One day he finds a weapon, thrown unto this world by a Shinigami (a God of Death) for his amusement. The weapon basically lets Light kill anyone he wants, without even meeting the victim. Light decides that he will use this weapon to kill every criminal that appears on the news. This way, he thinks, he will be the unknown creator of a new world, without crime.

Crime rates drop quickly and crowds thank the mysteryous Kira (“killer”) for it.

Is it nazi enough for you? But there is more.

The premise of the story seems a golden opportunity to talk about ethics. It would have been easy to discuss (and, in the process, teach children) about:

  • how wrong it is to take justice in one’s own hands;
  • how wrong it is to be accuser and judge at the same time;
  • why we need the due process of law;
  • how deceiving the news (and the rest of the culture industry) can be;
  • how anybody can end up committing a crime (nobody is immune);
  • how the law is not always right and may define crimes that shouldn’t be;
  • how the law may not define some actions as crimes when they should be;
  • the principle that punishment should be proportional to the crime;
  • etc. etc.

Instead what happens?

  • The mass murderer, who thinks of himself as a god, is indeed called Light;
  • He just kills everybody, he is not interested in finding out whether the news are even true;
  • He is Japan’s best student (!!!) but somehow has no idea that his concept of justice is barbaric, absolutely uncivilized;
  • The series carefully avoids any moral evaluation, except Kira’s own reasoning to do as he does;
  • Nobody else has high dreams;
  • Kira is the main character, no other character comes close;
  • Eventually other people find a way to follow the mass murderer’s example;
  • The Gods of Death don’t ever interfere for moral reasons. They interfere either for fun or because they are in love with a female character. They don’t really think there is an enormous mess going on. In the end the plot just forgets about the Shinigami, they almost disappear.
  • The whole series becomes just a thriller alla Sherlock Holmes versus Moryarty. Except that the killer is more competent than the cops.
  • When the blockbusterish thriller ends, the series ends. There was nothing else to say.
  • Due process of law is never mentioned.
  • What is a crime? This is never questioned.
  • How should punishment be done? This is never asked.
  • etc. etc.

Do you think I am exaggerating? Do you think nobody would really identify with Kira? Think again.

Many people already think like Kira and would do the same. I have witnessed bad taste television shows in Brazil in which the angry host talked about a criminal (not a convicted criminal, but one that had just been arrested by the police), showing sensationalist disgust to what the criminal had done, saying things like “when he was doing it, he didn’t think about human rights, so why should he have human rights now?”

This is how many people think. We are surrounded, outnumbered by the stupid.

I was curious enough to go to IMDb. I know most of the posts there are noise; there is no place to find idiots as the IMDb forums. But I have also found extremely intelligent comments there before. Maybe it depends on the film.

In this case, I could find next to nobody interested in any moral issues raised by Death Note. Most people just talked about the cat/mouse game. When they did talk about ethics, they were always examples of what I am saying:

Example 1

I have a hunch as to why Light may not have ultimately succeeded in wiping out criminals. Rather why he ended up getting caught. It’s because he never got creative with his killings. He killed solely by heart attacks.

Example 2

“The real problem started when Light decided to kill an innocent. IE Lind “L”. For starters, he’s no longer got moral authority. Before that you could make a philosophical argument that although he wasn’t legally supposed to kill criminals with the Death Note, from a moral standpoint he was the only one with the power to protect the world and humanity from it’s own evil elements, and therefore he had to act. But the moment he kills “Lind” (who as far as Light knew was only doing his job), he’s just another killer who takes pleasure in the act.”

Example 3

YEah you shouldn’t feel sorry for Misa b/c she even states that she doesn’t care if Light only uses her and she’s happy w/ just that.

Example 4

death note is not about good vs. evil L died because Light is better than him and Light died because the death note is bad luck.

in my opinion Light is a good person that happened to pick up the death note and use it to make the world a better place (he can be seen as a supper hero who’s only power is to kill people just by knowing their face and name, some evil guy who wants to take over the world, or a victim). I didn’t really see treat misa bad he just got mad at her when she did something stupid (it was her fault why they got cot by L besides she wanted to help light. Also I thank he fell in love with her when they lost their memory. If he didn’t like her would have killed her or break up with her near the end of the series in stead of going to marry her.

L might seem like the good guy but he’s not really a good person. he’s just a detective for fun, he doesn’t care if what he’s doing is bad or good, he will do any thing just to solve a case like lie, stalling, killing, letting good people die, takes advantage of people, breaks the law, forces people to do bad thing (forcing light to take advantage of misa) siding with criminals. He also hinted he is/was a pervert. You see his evil side and love of sweets in mello and his thinking, logic, loner side in near.

If it was about good vs. evil it would have been more black and white about it.

If any thing the most good person is light dad and the most bad person is the mob boss

Conclusion

See what I mean? People can watch this obscenity and not even be aware that they are becoming nazis.

In the last (bloody) episode, the good cops prevail. OK. But notice how this is done. Kira, surrounded, wounded, once again explains at length what he thinks (more nazi propaganda). Now the good cops are going to respond. I expect some education, finally, would anyone pleeease explain to Kira his mistake? Nobody does. The cop just says “you are wrong, you are just another serial killer and that is all”.

But I have already shown that the moral question is not understood by the target audience. I don’t feel it is understood by the author either.

Artistically, this shit isn’t. It is just another anime. Economically animated (this means many, many stills), silly story, unidimensional characters (who never change), everything you can expect from the culture industry. No investigator appears smoking — but most of them are children (because children is the target audience of this crap and they like to see children), so they have children’s vices such as eating too much chocolate. When a female character finally appears, of course she is a model, blonde, subservient, dumb, and her voice sounds like a woodpecker with a toothache. Intelligent characters are always socially inept, even Light (who starts out popular) becomes lonesome; the detective who finally defeats Kira is a 10-year-old genius who only plays alone with his toys. In other words, all significant people must always be alone. If there ever was a serial killer generator, this is it.

Trash that only children would take; however it is rated TV-14. Much of the music (which always sounds stupid and is repeated in every episode) is stolen from “Carmina Burana” by Carl Orff, himself possibly a Nazi and in any case a favourite composer of the original Nazis. (“Carmina Burana” is a very simple score by 20th century standards; nazis don’t take complexity well, as “Death Note” helps to show.) Some of the credits music is heavy metal, which is known to always be Nazi anyway.

Some cultural references are thrown in without any real significance or effect:

  • Plainchant in the music is in the wrong places and leads to nothing.
  • The main Shinigami character likes to eat apples and Kira provides apples to him. Everybody knows what apples mean, but like I said, this has no significance or effect. It is like an afterthought: “wow, I finally finished writing this damn script — oh wait, I forgot to drop a couple of biblical references in it”.

Anyhow, now that Death Note contains apples, people are saying it is cult.

Desu nôto is one of the most irresponsible things I have ever seen. My advice is: take care of your children and never be afraid to say “no TV”!

Entendendo mal o software livre

Será que os jornalistas da Globo sabem o que é software livre? Mas é claro que não!

Um amigo me envia esta notícia no portal Globo.com e fica esperando minha reação. Eu sabia que levaria horas para escrever a seguinte diatribe. Mas decepcioná-lo nunca!

O texto tem duas partes. A primeira noticia o resultado de uma pesquisa. A segunda vira ainda mais um artigo do gênero “Quem tem medo do open source?”. Esse trecho final, para começar, me parece desnecessário. Hoje acho que nem Eric S. Raymond evangeliza mais. Além disso, há erros grosseiros nesses últimos parágrafos. Vou tentar não me preocupar com as asneiras de português e falar só do conteúdo.

A besteira mais ululante e que tanta gente comete é a confusão entre software livre e software grátis. Por exemplo: “Marcelo Okano, confere inúmeras vantagens aos softwares livres frente aos aplicativos pagos.” (A vírgula é do original.)

Vamos combinar uma coisa. Software livre não é o mesmo que software grátis. Essas duas questões são ortogonais. “Livre” opõe-se a “proprietário”. O primeiro pode ser modificado e redistribuído sem dar satisfação a ninguém. O outro não.

O artigo diz: A forma de licenciamento dos softwares livres é gratuita. Isso é freqüente, mas nem sempre. Nada impede uma empresa que produz software livre de cobrar por ele e muitas o fazem. Exemplos: Red Hat, Mandriva, MySQL, db4o etc. O licenciamento é uma questão cheia de firulas; existem muitas maneiras de fazê-lo e uma pessoa comum levará semanas para entender o que está acontecendo.

Nessa esteira, o segundo parágrafo sugere que a “crença geral” é a de que software livre é software para pobre. Verdade? Crença de quem, essa? Da Globo? Pergunto porque já faz anos que o open source é a maneira de trabalhar preferida das maiores empresas de tecnologia (com poucas exceções). Por exemplo, as empresas gostam de fazer tudo em Java e neste universo quase todos os componentes são de código aberto.

Quem fala do open source como se ainda fosse minoria o faz por conhecer somente o monopólio do desktop.

Dito isto, na prática o preço do software livre tende a ser muito competitivo porque o cliente pode mudar de fornecedor sem trocar de software. Por exemplo, se uma empresa fornecedora de suporte ao banco de dados Postgres cometer muitos erros ou cobrar caro demais, o cliente pode mudar de fornecedora e continuar usando o mesmo software.

A liberdade de redistribuir o software também reprime preços altos. O argumento da empresa que vende o software acaba sendo o suporte — pois o mesmo software pode geralmente ser obtido de outra fonte.

Os trechos sobre confiabilidade e segurança são mais ou menos verdadeiros. É que são expressos de maneira tão desajeitada que ficam sujeitos à fácil impugnação pelos adversários. “Há um firewall feito para Linux.” Um? UM firewall? Haja paciência com quem ouviu o galo cantar mas não sabe onde...

O parágrafo seguinte sugere que o Samba é um novo avanço. Como se nossos computadores não conversassem com a rede do Windows há mais de uma década.

“O Linux, por exemplo, é um sistema operacional, sendo o único livre.” Quem disse isso esqueceu-se de FreeBSD, OpenBSD, OpenSolaris... Eu estou me esquecendo de outros. Em números absolutos, existem mais sistemas operacionais livres do que proprietários.

“Pessoas que desenvolvem softwares livres não entendem como uma empresa pode cobrar muito mais pelos programas do que gastou para desenvolvê-los. Como eram contra essa filosofia, lançaram os aplicativos gratuitos”, analisa.

Capitalistas bonzinhos? Isso não existe, é uma asneira de proporções mastodônticas. A dominância do open source é um efeito da acirrada competição na área de tecnologia. Produtos proprietários não sobrevivem se houver equivalente de código aberto. Isto só não atingiu ainda uns poucos mercados em que há monopólio (e.g. Windows). O Adobe Photoshop só sobreviverá, custando o quanto custa, enquanto o Gimp continuar sendo muito inferior. Numa situação de equivalência (ou quase), isso mudará.

O último parágrafo da notícia é tão errado que é incompreensível. Confunde software que roda no servidor (Apache) com software que roda no cliente (navegador do Windows). Também chama de desvantagem do “programa gratuito” a incompatibilidade que na realidade é causada pelo outro lado (sites de bancos que exigem o Internet Explorer). Teria sido melhor não dizer nada.

Finalmente, além de falar de software livre versus software pago, o texto deixa de mencionar que o software livre não é só software. É uma filosofia libertária, é uma causa moral. O primeiro passo para suprimir essa causa foi a invenção do “open source” (código aberto), que é o mesmo software livre, porém sem o argumento de que todo software deveria ser livre pois isto é que é ético.

A IBM fez uma campanha milionária de marketing em prol do Linux. Ao mesmo tempo, gosta de ter alguns produtos proprietários sempre que possível. A IBM não se interessa, destarte, em promover a causa ética do software livre. Por isso falam em open source. Sempre os vi falar em open source.

No Brasil, os meios de comunicação não têm a mesma hombridade. Eles causam mesmo a confusão, usando o termo software livre. Quem lê a notícia da Globo pensa que entendeu e já sabe tudo sobre o assunto. Sequer pode imaginar que a questão é bem mais profunda, é uma questão de liberdade individual mesmo, de direito público e privado. Uma questão que deve ser discutida, não apagada.

Conclusão: mesmo quando dá boas notícias, a indústria cultural o faz de maneira repugnante e estúpida. O propósito é cultivar o framework mental do público, excluindo ou confundindo o que não interessa ao sistema. As razões e o como disto tudo são bem explicadas no documentário “Manufacturing Consent: Noam Chomsky and the Media”. A primeira hora desse filme é devagar, mas depois esquenta.

E quem quiser entender corretamente o software livre conheça o homem que o inventou.

SQLAlchemy has a new, easy declarative layer

A historic transcript from the #sqlalchemy IRC channel

<zzzeek_> deitarion: we just added a new declarative layer which removes a little of the verbosity, not sure if thats where you saw “too much boilerplate”

<justsomedood> woot, declarative layer part of SA? So not an extension?

<zzzeek_> its in ext/

<zzzeek_> we’ve had activemapper its just terrilby out of date

<justsomedood> way out of date

<zzzeek_> this is way smaller than activemapper

<zzzeek_> its 90 lines

<justsomedood> I ran into a lot of problems with it, and sent some fixes to johnathan but it ended up being too much work

<zzzeek_> i doubt this one has any big problems

<zzzeek_> since it does almost nothing :)

<justsomedood> hehehe

<Gedd> justsomedood: what kind of problems?

<justsomedood> It deferred class loading / table creation to make sure all dependencies were met before it did, that didn’t always work

<justsomedood> I ran into cases where if I didn’t define my classes in the correct order it would never create them, or get stuck in a loop

<justsomedood> I haven’t used it since 3.10-ish I think though

<Gedd> ah ok

<Gedd> that explains it :)

<NandoFlorestan> zzzeek_, the synonym stuff in the declarative layer is sweet!

<NandoFlorestan> I think this may be an Elixir killer

<jek> nah

<Gedd> NandoFlorestan: FWIW, Elixir handles synonyms too

<NandoFlorestan> hmm, didnt know that.

<zzzeek_> NandoFlorestan: elixir has a ton of stuff this does not

<justsomedood> So on this one, when defining “complex” relations(), with a primaryjoin on a table/object that hasn’t been defined yet you’d probably have to make that at the end with a class_mapper()?

<zzzeek_> you can stick it on later, like User.someprop = relation(SomeOtherObject, priamryjoin=foo.c.bar==bat.c.foo)

<zzzeek_> theres no class_mapper() needed here really since the class goes right to the mapper.....its also there as class.__mapper__

<justsomedood> k

<justsomedood> cool

<justsomedood> it would definitly condense my models and make them easier for others to read, and I wouldn’t have to worry about the syntax changing

<justsomedood> me likes

<NandoFlorestan> that is why I like it: I already know the syntax

Pylons without Buffet, and a critique of TurboGears

Ben Bangert has decided to remove Buffet from Pylons. Of course it will still support all those templating languages, just not through Buffet.

The replacement? Just a few basic render functions. They make it much easier to see how you’d modify parts if you needed to tweak options — something you cannot do if Buffet is in the equation.

Here is ltbarcly’s version of the same thing.

ltbarcly agrees. Why do we need one function that knows how to render every possible type of template? Just have a function called “render_genshi”, one called “render_mako” etc., then you can do things like streaming in genshi, or form filling, and use all the caching etc in mako. Buffet doesn’t do anything for you really — except give you the lowest common denominator.

He thinks, as I do, that dot notation for template names is stupid. If you write a common path instead, such as “test/blah.html”, it looks for “test/blah/html”... Who needs the additional text replacement code — who ever needed dot notation for templates?

(Mitsuhiko answers: Kid was the one that needed dot notation, because it compiled the template, then imported it.)

I wish TurboGears 2.0 does without Buffet, too...

Do you really need 21 MB of RAM for a Python website?

I made a little experiment and found that using CherryPy 3.1, plus the packages I need, instead of the whole TurboGears stack, can save a lot of RAM.

How can a TurboGears website use 1/3 less RAM?

(If you host at WebFaction, your account is mainly constrained on memory usage.)

My TurboGears 1.0.4.2 application is using 23,888 KB on startup, then 27,512 KB after many requests for different pages. Pylons is more or less the same, since a Hello World takes up 21 MB.

(Python 2.5, Ubuntu 7.10. I understand this varies a lot based on OS.)

I decided to see what would happen if I rolled my own “framework” on top of CherryPy 3.1, which is vastly superior to CherryPy 2.3 — pity TG hasn’t upgraded!

So I tried a memory consumption test for a CherryPy 3.1 based website.

I started with the CherryPy Hello World, then added import by import, measuring the impact in memory usage. The total memory used is annotated besides the corresponding import.

You can see memory usage with the following Linux shell commands:

ps aux
ps aux | grep python
ps aux | grep hello.py

Don’t confuse virtual memory with resident memory. I am worried about the latter only.

The answer: A CherryPy 3.1 Hello World amounts to mere 7 MB. After I import everything I remember that I need (including Genshi, SQLAlchemy and Routes), I’m using 14 MB.

Here is the (very simple) test for you to reproduce.

Why this enormous difference?

Robert Brewer, CherryPy author, explains to me at #cherrypy:

  • well, I know Sylvain went on a tear recently to make sure we weren’t importing things too early
  • so CP 2.x -> 3.1 might be a good chunk of the difference by itself
  • I also ripped out some of the stdlib modules from CP and rewrote them myself in order to be faster (e.g. no sense importing the whole MIME module when you’re just doing http headers–a lot of the mime stuff is for email)

Of course, I owe my whole Python web programming experience to TurboGears. It provides sane defaults, especially for beginners. I learned Kid, then Genshi. I learned SQLObject, then SQLAlchemy. I also learned how to use Routes as the TG URL dispatcher. And there was the help of a large community.

But now that I am not a beginner, just using plain CherryPy could be a very similar experience.

Based on the result of this simple test, I am thinking of assembling a small TurboGears-like web framework. I would really just steal the things I really use. Make them work under CherryPy 3.1 (TG really should have upgraded.)

TurboGears 2.0 is being implemented on top of Pylons for good reasons... but CherryPy still seems to have several advantages over Paste or even WebOb, so it is not such an easy decision. At least for me.

A maravilhosa Cantata 95

Não sou um homem religioso mas sei apreciar música, e garanto que é difícil encontrar coisa melhor que as cantatas religiosas de J. S. Bach.

Estou escutando-as todas, na ordem. A Cantata BWV 95 chamou minha atenção. Ao escutá-la seguindo a partitura, fui levado às lágrimas, coisa que nunca acontece. É que só nesse momento vi a letra da música. Não entendo alemão, mas na partitura há uma tradução para o inglês.

Johann Sebastian Bach escreveu mais de 300 cantatas, porém só nos restaram umas 195. Cada Cantata era apresentada num domingo do ano (durante a missa) e seu assunto era determinado pelo calendário religioso luterano.

Cada cantata é um conjunto de peças tais como corais, recitativos, árias etc.

Um famoso relato revela que, ao escutar uma peça de Bach, Mozart exclamou “eis uma coisa com a qual se pode aprender!”, sentou-se com as partituras e não levantou até ter lido todas. Beethoven chamava Bach de “o pai da harmonia”. O compositor de que Chopin provavelmente mais gostava e mais tocava era Bach.

Para o idiota moderno, acostumado a nulidades musicais como as da MTV e da rádio Jovem Pan, pode haver bastante estranhamento no início. Vencida essa barreira, que de resto é culpa de nosso estúpido estilo de vida e não do genial compositor, as cantatas de Bach trazem muita alegria, afinal veiculam um conteúdo humano e divino ao mesmo tempo.

A Cantata BWV 95, intitulada “Christus, der ist mein Leben” (Cristo é minha vida) contém uma famosa ária com pizzicato: “Ach, schlage doch bald”.

http://www.youtube.com/watch?v=_5-mmfof4H8

Página em inglês sobre a Cantata 95

Webpyte, framework web escrito em Python

Publiquei o código-fonte do Webpyte, novo framework para desenvolvimento de sites inspirado no excelente framework web TurboGears, mas usando componentes atualizados. Se você é um desenvolvedor Python, colabore! Aqui está a página do projeto no Google Code.

Webpyte

Typography: Helvetica and Arial

The history of the design of Helvetica and the subsequent scourge of Arial are pretty interesting.