Wednesday, November 3, 2010

Setting up Flash Builder in Ubuntu 10.10

Adobe Flash Builder 4
Ubuntu 10.10 Maverick Meerkat

In a very sad news, Adobe has officially terminated the Linux Flex Builder project, which has stagnated in alpha status for more than three years now, olny receiving updates to extend the termination date. Regardless of the stated alpha status, the Linux Flex Builder plugin was very usable and quite stable, provided, of course, that you used it with Eclipse 3.3.

Since the current alpha 5 of the Linux Flex Builder plugin terminates at the end of this year and as Adobe has no intentions to allow anyone to use it past that termination date, I had to find an alternative.

Although JetBrains is welcoming all Flex programmers in Linux to switch to IntelliJ IDEA, I didn't want to learn yet an another IDE, especially one that is not open source nor free.

And finally I found the fb4linux project which works great (including the debugging).

The following is mostly a copy of the project wiki with only some additions to make it work with the Eclipse installed from Ubuntu repository.
  1. Install Eclipse 3.5.x from Ubuntu repository;
  2. Download the four FB4Linux* files from the fb4linux project download section, concatenate them to form FB4Linux.tar.bz2 and extract it somewhere.
  3. Run Eclipse as root!
    sudo su; cd; eclipse
  4. Select Window / Preferences and open the General / Capabilities section in the Preferences window.
  5. Verify that Classic Update option is checked and close the preferences window.
  6. Select Help / Software Updates / Manage Configuration
  7. Right-click, select Add / Extension location... and browse to the Adobe Flash Builder 4 directory you extracted above.
  8. Restart Eclipse as per its demands.
That's it, you can now open Eclipse from your user account and start coding Flex and AIR applications!

Tuesday, June 8, 2010

Small RegExp to reformat curly brackets Flex style

Adobe Flex 3

Find: [^( *)(.*)(\S+) *\{$]
Replace: [\1\2\3\n\1{]

In order to differentiate between Java code and JavaScript/ActionScript code I have defined for myself, that in Java the opening curly bracket should be at the end of the line where it starts, like this:
if (true) {
    System.out.println("true");
}


And in JavaScript/ActionScript code it should be alone in the next line, like this:
if (true)
{
    System.out.println("true");
}


The above code I am using in Eclipse to replace all such instances in the JavaScript/ActionScript code which does not conform to this rule.

Tuesday, May 25, 2010

How to remove higher version packages installed from another source in Ubuntu.

Ubuntu 10.04 Lucid Lynx
Linux Mint 9 Isadora

I am currently torn between plain Ubuntu 10.04 Lucid Lynx and Linux Mint 9 Isadora. Previously I have had both Linux Mint 7 Gloria and Linux Mint 8 Helena installed and liked them a lot. The main attraction for me is the MintMenu.

The last one was actually Ubuntu 9.10 with Linux Mint 8 repository set up and the packages from there installed over the Ubuntu packages. The reason for this was technical - I decided to try and set up RAID 0 array with my dual 750GB hard drives and unfortunately only Ubuntu had the so called alternate install available needed to install on RAID while the normal installer in Linux Mint 8 did not recognize this, even if it had been previously created.

Ubuntu 10.04 has made some considerable improvements in many areas over the previous version:
  • My SB Audigy 2 ZS card works fine now even with the 5.1 setup switched on.
  • The 3D desktop with my Radeon HD3870 works also out of the box (though it still recommends the ATI driver, but I have decided not to install it, see the next one for why).
  • The LCD display powerdown works now (saving the backlight) with the automatic Mesa DRI R600 driver.
    Previously the ATI driver broke this LCD powerdown leaving the backlight on and I'm afraid it is still not fixed.
  • The CD/DVD automatic mounting works now with correct volume labels appearing in /media instead of using the cdrom0, cdrom1 and cdrom2 directories previously (yes, I have three drives).
    The volume label automatic creation worked also in prior Ubuntu version but this functionality disappeared mysteriously after I installed Linux Mint packages over Ubuntu ones.
  • The switching between text-mode and graphics is almost instantaneous - I wonder if the kernel graphics mode swithcing is already supported with ATI graphics or is this just very good MESA driver...?
  • The resolution of the text-mode is perfect using the whole 1920x1200 screen with 240x75 characters!
    Previously in Linux Mint 8 or perhaps instead because of the ATI driver, the text-mode was an awful 80x25 and switching back messed up the graphics mode aswell...

After trying out the newly released Linux Mint 9 I felt that it looked and worked very similarly to the previous Linux Mint 8 while the Ubuntu 10.04 was considerable jump forward from 9.10 and therefore I decided to do similar configuration as before (though I'm not using RAID this time) to install Ubuntu 10.04 and then include the MintMenu from the Linux Mint 9 repositories.

What happened, unfortunately, is that I accidentally installed a lot of Linux Mint packages including grub and plymouth related things that affect the booting. I decided to remove these packages but alas, this seemed to be impossible without complete reinstall.
Most of the packages depended on others that depended finally on nearly all of the packages (the list was in hundreds of packages).
While each of these packages had counterpart in Lucid repositories, they all outranked the Lucid ones with higher version numbers.

The apt-get does not provide any way to downgrade nor to use different repository for reinstallation, the dpkg can reinstall any version, including downgrading to an earlier versions, but needs physical .deb files.

The answer was the forgotten aptitude package manager, which has somewhat similar syntax and with simple tasks can be used in place of apt-get, while having considerably more power.

And here is the step-by-step list of how I reverted these packages back to their Lucid Lynx counterpars:
  1. First, in order to know which packages I need to switch back to Ubuntu versions, I listed those packages with dpkg:

    sudo dpkg --list | grep mint

  2. Second, I downloaded the physical .deb files from lucid repository:

    aptitude -t lucid download libplymouth2 plymouth plymouth-label plymouth-theme-ubuntu-logo plymouth-theme-ubuntu-text plymouth-x11 python-software-properties software-properties-gtk

  3. Third, I installed these versions with dpkg:

    sudo dpkg --install *.deb

That's it.