5 entries in

February 2009

En chino

“Arguments based on the ideal of subjective autonomy played a key role in the early postwar episteme, contesting deterministic forms of both historical materialism and liberal behaviorism and highlighting the importance of intentional intervention. At the same time, in the early Japanese postwar context demands for subjective participation seemed to make sense only in conjunction with either a historical materialist or liberal humanist metanarrative of progress. Accordingly, when subjectivity was propounded, the effect was paradoxically to reinforce the primacy in discourse of objective, scientistic concepts of class, history, and modernity.”

Un párrafo de uno de los artículos de mi reading list para mi próxima presentación en clase, en dos semanas.

Estudio la cultura japonesa, pero a veces me parece que lo que leo está en chino ^_^

21 Feb 2009 3 comments so farJapan


Rationalism (II)

The absolute genius of Tim Minchin and a very different take on rationalism (audio only):

He is, like George Carlin, a brilliant comedian with a soft spot for science.

15 Feb 2009 3 comments so farLife, Music, Videos


Rationalism (I)

“I want to be, if I can, as sure of the world (the real world around me) as is possible. Now, you can only attain that to a certain degree, but I want the greatest degree of control. I don’t… I never involve myself in narcotics of any kind, I don’t smoke, I don’t drink… because that can easily just fuzz the edges of my rationality, fuzz the edges of my reasoning powers; and I want to be as aware as I possibly can. That means giving up a lot of fantasies that might be comforting, in some ways; but I’m willing to give that up in order to live in an actually real world — as close as I can get to it.”

James Randi (@8:03)

“Economists… forgive me, for those of you who play the lottery… but economists, at least among themselves, refer to the lottery as a ‘stupidity tax’. Because the odds of getting any payoff by investing your money in a lottery ticket are approximately equivalent to flushing the money directly down the toilet (which, by the way, doesn’t require you to actually go to the store an buy anything). Why in the world would anybody ever play the lottery?”

Dan Gilbert (@6:10) via The German Component

“One great mistake (and maybe this is the legacy of the Romantic Era) is that we think that all the great feelings of transcendence that you might get in the face of a marvelous piece of art; or you feel in front of a landscape; or the wonderful, oceanic sense you have when you feel love for someone… we have this idea that somehow these are incompatible with being rational. And this is a great problem. There is nothing paradoxical about a rational man or woman falling in love or [swirling?] in front of a Michelangelo. These are the great, wonderful emotions of being an adult human being.”

Ian McEwan (@17:20) via Richard Dawkins

I love quotes; I collect them. Whenever I read or hear a sequence of words that strikes me as true, or as particularly beautiful, cunning or moving, I write it down. Oddly, I have to admit that I love discovering quotations even if the source is considered frivolous or unreliable, e.g. advertising. I guess that the mere realisation that someone else uttered, or put in writing, a thought that one has always regarded as useful or valuable is in itself exciting, no matter the agenda or the legitimacy of the author.

In the last few days I have stumbled on these three wonderful videos in YouTube, all of them related to rationalism in one way or another; and I strongly agree with most of what they say.

What do you think?

13 Feb 2009 6 comments so farLife


Getting FB3’s design view to work with your MXML components

For the past ten months I have been working on the same Flex/Air application. It is part of a larger, multi-tiered, multi-language project, of which the Flex subproject is but the front-end. (Actually, I have been involved in one of the other tiers, too, messing with a different programming language; not all my time has been devoted to Flex development during this year.)

Our Flex codebase is a nice instance of a complex, heterogeneous Air application to which probably more than twenty developers have contributed to date. A not-so-well-known Flex MVC framework is at the core of the architecture, and we leverage quite a good number of Flex components and Flash libraries from third parties. We do unit testing, code coverage and continuous integration.

Ever since I joined the team (when the guys had just upgraded from the beta 3 of Air to Air 1.0) there has been an odd issue with the Air project in Flex Builder 3: we could not use FB3’s “design view” to preview the layout of the application or to edit our custom MXML components.

The problems were two. First, the design view displayed what looked like a blank canvas — sometimes with whimsical wireframe edges that seemed to represent containers and other children. But only a few of those children appeared (if any at all). Rarely their sizes and positions were right, or their actual contents visible (see the screenshot below). Only when previewing simple components that inherited directly from Flex standard components (and not from our own components) the result seemed correct.

The second problem was that when switching from code view to design view a pair of errors suddenly appeared for every custom font that the project uses (even if the project builds just fine in code view):

unable to resolve '/project/assets/fonts/customFont.ttf' for transcoding | project | line 195
Unable to transcode /project/assets/fonts/customFont.ttf.                | project | line 195

We gave it a go at trying to solve these issues at the time (ten months ago), with no luck. It never was much of a problem, though. Not for me at least, since I usually prefer to work on code view, even for building layouts and style-tweaking (in design view FB3 is slow rendering your changes, and I’m too fussy with my code to accept the auto-generated MXML). But boy, was it annoying.

A few days ago I investigated these problems again for a while… and this time I cracked it. Let me share what I learnt, because I think it is not that obvious.

The main problem has to do with the limitations of the design view in FB3. As you probably know (because you bothered to read this far), MXML is just a more readable way to describe visual Flash objects. MXML is more intuitive than ActionScript to define the layout of your Flex GUI precisely because the nesting of XML nodes in MXML matches the nesting of visual components that those XML nodes represent. Actually, the Flex SDK compiles all MXML classes to intermediate AS. If you know that, you would presume that Flex Builder treats both AS classes and MXML classes in pretty much the same way. Well, it doesn’t.

It turns out that the “design view” can render any MXML class, provided that all its ancestor classes (up to the first standard Flash component) are defined in MXML too, i.e. not in AS.

In our project we had the situation represented in the diagram below. Most of the “screens” or “pages” in our application are based (directly or indirectly) on a common class. That common class, in turn, inherits from some other class that is defined within the MVC framework. The problem was, that common class was written in ActionScript, thus cutting off the hierarchy of MXML classes that the design view in FB3 “understands”.

All I had to do was rewrite that class in MXML and keep the name of the file, changing its extension from as to mxml. It was a quick change: the class was short and I could maintain parts of the original ActionScript embedded within a Script component anyway. Note that no other changes were necessary, because the subclasses don’t care whether their superclass is originally written in AS or in MXML.

As for the other issue (the problem with the custom font families), it seems that the design view can’t load custom fonts unless they are defined as embedded resources in AS, i.e. not in separate CSS files.

Originally we had something like this:

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">
 
    <mx:Style source="../styles/fonts.css" />
 
    <!-- … -->
 
</mx:WindowedApplication>

Where styles/fonts.css contained:

@font-face {
    font-family: "_DefaultFont";
    font-weight: normal;
    src:         url("../assets/fonts/verdana.ttf");
}
 
@font-face {
    font-family: "_DefaultFontBold";
    font-weight: bold;
    src:         url("../assets/fonts/verdanab.ttf");
}

I removed the CSS file and embeded the two font families directly into the MXML component (which is less elegant, of course):

<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml">
 
    <mx:Script><![CDATA[
 
        [Embed(source='../assets/fonts/verdana.ttf', fontWeight='normal',
            fontName='_DefaultFont', mimeType='application/x-font')]
        private var thisObjectIsNeverUsedButItHasToExist_1:Class;
 
        [Embed(source='../assets/fonts/verdanab.ttf', fontWeight='bold',
            fontName='_DefaultFontBold', mimeType='application/x-font')]
        private var thisObjectIsNeverUsedButItHasToExist_2:Class;
 
    ]]></mx:Script>
 
    <!---->
 
</mx:WindowedApplication>

I guess the moral of the story is: Adobe, we need a better IDE!

12 Feb 2009 6 comments so farAdobe Flex, Computers, Work


Cuento agridulce de navidad (y III)

(Leer las partes primera y segunda)

Llegando a Charing Cross me viene la inspiración de pronto; recuerdo que varios homeless viven entre los pasillos de la estación de metro y la de ferrocarril.

Bajo las escaleras y le doy varios sandwiches a un hombre que está tumbado sobre cartones. El pasillo es uno de esos grandes y amplios del metro, con el techo y las paredes alicatados. Al fondo veo a mi segundo objetivo, sentado contra el muro, con las piernas dentro de su saco de dormir verde. Me acerco a él y me mira, agitando el dedo índice delante de la cara. Cuando llego a su lado está diciendo: No fish! No fish! A pesar de eso no pone muchas objeciones y escarba con curiosidad entre los triángulos de pan en cuanto me agacho frente a él con la bandeja en una mano, como un camarero.

Agotados los recursos que el metro puede ofrecer, emerjo a la superficie de nuevo, resuelto a liquidar las existencias. Enseguida encuentro a otro repartidor, esta vez del London Lite, que es un diario gratuito (y caro, en relación calidad/precio). Le echo morro e intento una suerte de simbiosis unilateral, plantándome junto a él y extendiendo mi bandeja en sincronía con su fajo de periódicos. ¿Qué más se puede pedir? Señora, llévese a casa esta noche de gratis una cena medioqué y las peores noticias de Londres.

Al poco me siento un poco culpable, porque el ratio de conversión del repartidor está disminuyendo en proporción al cuadrado de la distancia que nos separa. Le sonrío para quitarle hierro al asunto e intento discutir con él detalles sobre la puesta en práctica, delimitar competencias, pulir las rebabas de nuestra oferta. El repartidor no me entiende. Y por una vez no es mi inglés, sino el suyo. No habla una palabra, el pobre.

En ese momento formulé mi Ley de Marketing Sandwichero: se colocan muchos menos sandwiches trabajando en tándem con un repartidor del London Lite que operando por libre. Vaya usted a saber por qué.

La verdad es que si tuviese que ganarme la vida haciendo esto, lo llevaría crudo, me digo. Claramente las personas serias e introvertidas no damos el tipo para repartir cosas por la calle. Mucho menos si esas cosas son gratis. No servimos ni para eso ni para otras muchas profesiones, como ya señaló un amigo mío. De todas formas, también es cierto que a estas alturas la bandeja ya no tiene el aspecto lustroso del principio: la comida está distribuida irregularmente por la superficie de plástico y hay algunos trozos de pan huérfanos o desparejados. Tengo que trabajar en la presentación del producto. Necesitaría un escaparatista.

En vista del escaso éxito me vuelvo hacia el repartidor y le pregunto por gestos y en indio (indio americano, no indio de la India) si hay vagabundos cerca (Homeless? Homeless here?). Me señala la entrada de uno de los teatros del West End, a cincuenta metros de distancia. A saber qué demonios cree este tipo que le he preguntado. Por si acaso, me acerco un poco al teatro. Pero no veo a nadie con pinta de agradecer un sandwich de un desconocido. Todo a babor hacia Leicester Square.

Fue una mala decisión. Eso sí: Merry Christmas, Merry Christmas. La intención es buena, pero me gustaría pararlos y decirles que me la suda que sea navidad. Mi tercera y última vergüenza por sorpresa: me da vergüenza que piensen que el espíritu navideño me impulsa a hacer esto. Me da vergüenza que piensen que soy manipulable (aunque lo sea irremisiblemente).

Bajando de nuevo hacia Trafalgar Square, me vienen a la cabeza las palabras de un personaje al que admiro y me digo que les den por culo a los pobres.

No veo mucho más que pueda hacer, es tarde y aún tengo que preparar mi equipaje para volar mañana. La mitad de la segunda bandeja acaba en una de esas papeleras cilíndricas abiertas al cielo, tan Westminsterianas.

Atravieso la plaza en diagonal para meterme en el metro. En el centro de Trafalgar Square, un árbol de navidad gigantesco, cargado de lucecitas. Es la mitad de alto que la columna de Nelson. La base está vallada y hay parejas y familias alrededor; haciendo fotos, gritando, frotándose las manos enguantadas. Haciendo las cosas que se hacen en navidad.

7 Feb 2009 No comments yetLife, UK