Skip to main content

126 posts tagged with "in-English"

View All Tags

Definitive howto: Flex Builder 3 in Ubuntu Linux 9.04

· 6 min read

Two weeks ago I had to reinstall Ubuntu. Yesterday I spent some time setting up Flex Builder in my new Linux installation. This time I faced even more difficulties than the last time, months ago. Definitely, Adobe is not paying much attention to its Linux developers — looking through Adobe.com and Adobe Labs, stuff regarding Flex development in Linux stays pretty much as (bad as) it was one year ago or so. I finally managed to get the Flex 3 IDE and version 3.0.0 of the AIR SDK to run with Eclipse 3.3.2, and to launch both the AIR runtime and the Flash plug-in for Firefox from within Eclipse as needed (run and debug modes). The process is no apt-get install, and is not well documented. At the end I combined instructions and tips from Adobe Labs, one or two comments from forums and the workaround for a bug filed in Jira. This recipe summarises the process in detail and, following it step by step, in a few minutes you will be running Flex Builder 3 in Ubuntu 9.04 Jaunty Jackalope. This recipe might be applicable to other versions of Ubuntu, and even to other Debian-based distros. There are six main steps:

  1. Install a JRE
  2. Install the Eclipse SDK
  3. Install the FB3 plug-in for Eclipse
  4. Back up one SWC library
  5. Upgrade the AIR SDK
  6. Repair the offending SWC library from the backup

A few notes before going into details. First of all, bear in mind that the Linux version of FB3 is an unsupported alpha, and that some key features are (still) missing in it. The most important one is the design view, but also the states view, the profiler and four other features. If these are important limitations for you, you might need to consider virtualisation instead (or a different base OS altogether). Second, there is no stand-alone FB3 for Linux. Flex developers running Windows or Mac OS are used to installing either the FB3 plug-in on top of an existing Eclipse installation or the FB3 stand-alone bundle provided by Adobe. In Linux, on the other hand, there is no option but to install the Eclipse SDK first, and then the FB3 plug-in on top of it. Third, Java is a dependency: the FB3 plug-in needs Eclipse, and Eclipse needs a JRE. Fourth, if you plan to build AIR applications for the desktop (as opposed to Flash applications for the web) you might need to install the AIR runtime separately, in addition to the steps listed here. Finally, here I use Bash commands to illustrate these steps in detail and without ambiguity; but most of these steps, if not all of them, you can accomplish using your file manager and visual tools of choice instead.

  1. Install a JRE

    $ sudo apt-get install sun-java6-jre

    This will also install sun-java6-bin. You can now check that Java has been installed successfully, the usual way:

    $ java -version

  2. Install the Eclipse SDK
    From all the bundles that Eclipse.org provides, pick and download a minimal Eclipse SDK (you won't need all those fancy plug-ins, and they can be added after the installation anyway). Whatever the bundle, it needs to be version 3.3.x, codename Europa. The IDE “for Java developers” [Europa] is the best option:

    $ wget "http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/europa/winter/eclipse-java-europa-winter-linux-gtk.tar.gz"

    Extract the files from the archive and then move the base eclipse/ directory to, for example, /usr/local/:

    $ tar -xzf eclipse-java-europa-winter-linux-gtk.tar.gz $ sudo mv eclipse /usr/local/

    Create a permanent workspace for Eclipse:

    $ mkdir ~/eclipse-workspace/

    Launch Eclipse:

    $ /usr/local/eclipse/eclipse &

  3. Install the FB3 plug-in for Eclipse
    Download Flex Builder for Linux and give yourself permission to run the file:

    $ wget "http://download.macromedia.com/pub/labs/flex/flexbuilder_linux/flexbuilder_linux_install_a4_081408.bin" $ chmod u+x flexbuilder_linux_install_a4_081408.bin

    Create a new directory for FB3 and make it your own:

    $ sudo mkdir /usr/local/flex-builder/ $ sudo chown $USER:$USER /usr/local/flex-builder/

    Run the installer:

    $ ./flexbuilder_linux_install_a4_081408.bin

    Accept the license. When asked where to install Flex Builder, browse to the directory you just created (/usr/local/flex-builder/). When asked where Eclipse is currently installed, browse to the directory where you copied Eclipse (/usr/local/eclipse/). If you plan to develop for the Flash Player, tick the option to install the debug version of Flash Player 9 for Firefox (but you might be able to download it separately anyway). The “pre-installation summary” should look similar to this:

    Once the installation finishes you can launch FB3:

    $ /usr/local/flex-builder/Adobe_Flex_builder.sh &

    Flash projects will run fine …but most likely AIR projects won't work. When you try to build and launch an AIR app, you will see this error message in Eclipse:

  4. Back up one SWC library

    $ cp /usr/local/flex-builder/sdks/3.0.0/frameworks/libs/air/airglobal.swc ~

  5. Upgrade the AIR SDK
    Download the AIR SDK for Linux to a temporary directory and uncompress it:

    $ mkdir ~/tmp-air/ $ cd ~/tmp-air/ $ wget "http://airdownload.adobe.com/air/lin/download/latest/air_1.5_sdk.tbz2" $ tar -xjf air_1.5_sdk.tbz2 $ rm air_1.5_sdk.tbz2

    Delete the current SDK 3.0.0 runtime/ directory from the FB3 installation directory:

    $ rm -rf /usr/local/flex-builder/sdks/3.0.0/runtimes/

    Overwrite the SDK 3.0.0 with the version you downloaded (it will overwrite some files — that's fine):

    $ cp -a ~/tmp-air/* /usr/local/flex-builder/sdks/3.0.0/

    Replace these two files:

    $ cd /usr/local/flex-builder/sdks/3.0.0/bin/ $ rm adl_lin adt_lin $ mv adl adl_lin $ mv adt adt_lin

    Create this new symbolic link:

    $ cd /usr/local/flex-builder/sdks/3.0.0/runtimes/air/ $ ln -s linux/ Linux

    Now it will almost work. When you run FB3 and try to run an AIR app, you will get this error:

  6. Repair the offending SWC library from the backup

    $ cp ~/airglobal.swc /usr/local/flex-builder/sdks/3.0.0/frameworks/libs/air/

    This will fix the previous error. Try to build Flash and AIR apps again in FB3; everything should work fine.

One more on journalists who don't understand blogs

· 2 min read

To Anna Mikhailova With regards to your outing, I strongly condemn the threats you suffered, the harassment and the undoubtedly reprehensible manners. I believe that most bloggers, if asked, would disapprove of that too. That said, I don't quite understand what is the problem with your own outing per se. If three years ago you and your editor judged that it was in the public interest to expose, so prominently, the identity of a thitherto anonymous blogger, then surely you would accept that the public themselves decided that your own outing was relevant news to them, too. Just explain to us how did your piece of news help society, the public interest or the credibility of blogs. You do make a point when you say that the anonymity of bloggers should not be “always absolutely guaranteed”. But you forget that that is not the cause that needs to be fought for: in most countries there are already legal means to take down a web site, and to (try to) identify its authors — only that it is judges (and not journalists) who are to decide when there is ground for suspicion of illegal contents or activities, and therefore for a blogger to be “unmasked”. To bring up such a noble argument to justify your attack against a law-abiding adult who simply writes about her own private life only serves to pervert the fight for free speech on the net within the boundaries of legality.

Doctor WHAT?

· 4 min read

From the I-need-to-procrastinate-now dept. Trying to alleviate somehow this miserable run of hours, days, weeks, months of stooping over my books, notes and laptop; of consuming booked holidays alone at home or in the library; of shortening or cancelling planned trips (so that I can spend more time alone at home or in the library); and of gazing through the window at that hateful, unconveniently sunny outer world, I just watched with Pablo episode #4 of Doctor Who (the new TV series): “Aliens of London”.

Doctor Who is an institution in the United Kingdom: actors who are currently playing the main parts appear on the cover of magazines regularly, Daleks are all over the place in London and everyone here seems to love the show, or at least to acknowledge its existence with reverence.

“In the United Kingdom and elsewhere, the show has become a cult television favourite and has influenced generations of British television professionals, many of whom grew up watching the series. It has received recognition from critics and the public as one of the finest British television programmes, including the BAFTA Award for Best Drama Series in 2006.”
— its page in the Wikipedia.

But all that does not changes a tad the fact that the show is dull and unconvincing. Its production is cheap by any standards of modern TV and it conveys the same dramatic intensity as the test card. You know — I have extensive knowledge about Doctor Who myself, having watched distractedly two episodes and two halves recently. I think it's bad. Take the episode we watched in DVD today. As far as I can tell, a UFO crashed against the Big Ben and fell into the Thames. Only that the dead alien pilot was not dead and was not alien. It was one of a bunch of relentessly farting humanoid pigs with zips on their foreheads (sic) who simulated the accident and infiltrated 10 Downing St in disguise and kidnapped the PM to achieve their evil goals. Oh, and the humanoid pigs were actually oversized, green, royalty-dodging versions of E.T. incapable of bending their necks or their arms because the budget for animatronics ran out the minute after the assistant to the carpenter uttered the words “Jeez, Quentin; this is a neat prototype, innit?”. The only merit of this episode, obviously, is that it predicted the swine flu four years ago. I mean, just take a look at the bloody robots (they ain't no robots; they're an extraterrestrial race of mutants). These rice cookers make the robots in Forbidden Planet (1956) look like cutting-edge pieces of engineering. And Wikipedia says this is the “2005 redesign”. There must be a certain amount of irony at work here, or very sick doses of nostalgia, but I just don't get it.

And still, it is iconic in this country while also enjoying incomprehensible success overseas. So it is good that, thanks to Pablo, I got to watch a few episodes. Now I can leave the country in peace. All this is to say that tonight we discovered that Rose Tyler (the main character, together with “the Doctor”) lives in front of us! In effect, although she lives in the fictional location flat 48, Bucknall House, Powell Estate, SE15 7GO London, the filming location is Brandon Estate, in Kennington.

This estate is literally one minute away by foot from my doorstep. This is where we have our GP, and until very recently our nearest post office was that building partially hidden behind the arches, left-hand side in the picture. Come to think about it, we have seen filming crews at work in our neighbourhood quite a few times in the last three years. I wonder if Doctor Who has something to do with that… Although I suspect that it is just the charming suburban irrelevance of these streets that attracts producers here. Now back to XƎTEX.

Happy

· One min read

Because in about four months I'll be switching from this…

…to this:

From this…

…to this:

From this…

…to this:

From this…

…to this:

Sad

· 3 min read

Xirick has been damn fast replying to my previous post. And the pictures he's used are great to illustrate my changes for the near future. What Xirick didn't know is that I already had an analogous counterpoint for my own argument, ready to be posted today. You know, being as contradictory as I am, you can't post about happiness one day an not try to balance that with sadness the day after. Or maybe you can. Well, I don't think you can. But you definitely can. I know: these photos aren't nearly as good as the ones in Xirick's post. But my point was to illustrate the differences using only my own photos. Enough said.

I'm sad because in about four months I’ll be switching from this…

…to this:

From this…

…to this:

From this…

…to this:

From this…

…to this:

…and so many other wonderful things, habits, activities and feelings that I will leave behind. Some of them difficult, if not impossible, to find in other places. Like the amazing architecture, or rather the flamboyant collage of different styles. And the ostentatious buildings, the cityscapes, and that feeling of living in the city, in the centre (not the center) of the world:

And proper winters (with all the nice things that a winter should have). And solvent organisations to work for; in comfy, spacious offices that are within walking distance from many other important places. Organisations that pay what is fair and where you work the time you are supposed to work, full stop:

And those (few, I know) lovely days of summer spent with friends frolicking on the grass, in one of the many parks:

And the institutions, the organisations, the courses, the opportunities, the knowledge floating around. The libraries, the bookshops:

And the rightful lack of modesty:

And the buzz around, the surprises every day, the unexpected events, the festivals:

And the streets, the variety, the peoples. The freedom, the mind-openers. Walking or running the city. Crossing two blocks means leaving Poland and entering Mexico. Run a bit further and you're in Guinea-Bissau:

And the hub, the connections, the flights, the trains. The freedom again. Having trouble to decide the destination because all the first five countries in the list are close at hand and inexpensive anyway:

And all the friends stopping by, the guests every couple of weeks, friends of other friends who become friends. The parties, the nights out:

And the culture, the music, the big names:

And the events, the conferences, the initiatives:

And most of all, I will be missing these two so much:

Rationalism (I)

· 3 min read

“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?

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

· 5 min read

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!

About personal challenges

· 3 min read

(The third and last installment of my controversial “Cuento agridulce de navidad” is sketched and coming soon. In the meantime, I need to share a thought now, before it vanishes from my Gruyère-shaped memory.) Yesterday officially marked the beginning of the spring term at University of London and all its colleges — among which mine, Birkbeck. Today I got a brand new teaching pack for the core course. During the next eleven weeks I'm supposed to read (and grok!) all this (and ideally should read much more)… in addition to roughly the same amount of reading for one of the optional modules.

…all the while attending classes, preparing a couple of short presentations, writing another two 3K- or 5K-word essays (and I haven't finished all my essays for the first term yet), starting to dive into specific readings for my final dissertation (due in September) and, when possible (hopefully!) attending some of the wonderful seminars and conferences that our department, the School of Languages, Linguistics and Culture has in the oven for this term. I forgot to mention that I also work full-time. Oh, and I'm addicted to the Internet. “Suicidal” is a word that comes to my mind often in these days. And here the thought. Because I risk sounding pretentious (once again), let me first say that with the grandiloquent term “personal challenges” I encompass all the human, worldly, modest enterprises that we pose ourselves throughout life. Unless you can find your own name in the pages of the encyclopaedias, your personal challenges most likely will fall within that vast array of propositions, projects and justifications that we use to invest our existence with some purpose. Your personal challenges are devoid of meaning but for yourself, often hardly noticed by anyone else, completely unknown to the cosmos. And yet, didn't you challenge yourself hardly enough, your life would not be a life but mere resistance. Every time I take up a new personal challenge (a difficult one, not one of the sort “this year I'll eat more vegetables”) I kind of say to myself that, once that's achieved, I'll relax, get a life, switch back from objects to people and become more “normal” (whatever that be). But that never happens; rather the opposite seems true. I feel like I've taken up quite a few personal challenges during the last three years. Some of them proved to be very difficult. At least they were to me. I have succeeded more than failed (or so I think). Annoyingly enough, I keep on cooking new personal challenges which, in my own little world, might well be the toughest to date. Will those be the most rewarding, too? Increasingly, I have the feeling that I'm spreading myself too thin. Does that happen to you? Where is the equilibrium? How do you decide whether a particular enterprise will make you happier or just waste your time? Does the mere fact that I'm reflecting on it and writing this into the wee small hours indicate that I'm damned beyond hope? Good morning.