Ramblings

December 14, 2009

PathTools and iTerm instead of Terminal

Filed under: applescript, automation, eclipse, iterm, osx, pathtools, Uncategorized — michaelangela @ 9:44 am

So as noted, I tried using PathTools with FleBuilder under Eclipse 3.5 except FlexBuilder just has too many issues under 3.5. I gave up on PathTools with FlexBuilder but it’s been just awesome with the recent JaveEE 3.5 build. I only had one not-even-gripe as there really isn’t anything to complain about. It opens Terminal for the new paths instead of iTerm. Fortunately a little scripting later and it’s all good based on some code from the iTerm site and also this snippet.

You can see in the PathTool preferences what is called in order to do some of the interaction. Launching a terminal in the selected path is simple enough and is located here: /Applications/eclipse/configuration/org.eclipse.osgi/bundles/685/1/.cp/scripts/cdterminal.scpt

Changing that to the following makes it launch iTerm instead, with a little simple error correction. I hadn’t done Applescript stuff before so was just trying it out. I love these little bits of integration/customizations that are possible.

on run argv
set cdTo to item 1 of argv
tell application “iTerm”
activate
— talk to the first terminal
tell the first terminal
— launch a default shell in a new tab in the same terminal
try
launch session “Default Session”
on error
display dialog “There was an error creating a new tab in iTerm.” buttons {“OK”}
end try
tell the last session
try
— cd to the requested cdTo path
write text “cd ” & cdTo
on error
display dialog “There was an error cding to the requested path.” buttons {“OK”}
end try
end tell
end tell
end tell
return
end run

Advertisements

December 7, 2009

Speeding up workflow with FDT

Filed under: cool, eclipse, tip, tool — michaelangela @ 6:40 am

Some of the following work with FlexBuilder (soon to be FlashBuilder) as well since they are both based on Eclipse.

FDT – Customize Your Workflow- Touch My Blog

We all come across things that end up saving us lots of time when used over and over again. If you use FDT, there are countless options available to enhance a development work-flow. Here are some of mine:

November 30, 2009

Eclipse PathTools and a 503 error for the DTD

Filed under: eclipse, tip, tool — michaelangela @ 10:17 am

The problem I was having with PathTools (which was only alluded to here) is that Eclipse simply failed to install it… after I installed it once already. Either way the error got me digging into my Eclipse config.

The error message was a seemingly unrelated “Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/html4/loose.dtd”. For whatever reason, Eclipse is actively trying to request and parse the DTD. According to the post below, the W3C gets hammered by these requests and have been actively blocking them with 503’s which is what I got when trying to install PathTools.

W3C Systeam’s blog – W3C’s Excessive DTD Traffic

A while ago we put a system in place to monitor our servers for abusive request patterns and send 503 Service Unavailable responses with custom text depending on the nature of the abuse. Our hope was that the authors of misbehaving software and the administrators of sites who deployed it would notice these errors and make the necessary fixes to the software responsible.

  • Pay attention to HTTP response codes

    This is basic good programming practice: check your return codes, otherwise you have no idea when something goes wrong.

This happens when trying to install PathTools from the update site given on the Google project page:

http://pathtools.googlecode.com/svn/trunk/PathToolsUpdateSite/site.xml

However searching Eclipse Plugin Central site for the plugin shows a different update site:

http://pathtools.googlecode.com/svn/trunk/PathToolsUpdateSite/

And it also shows that it needs Eclipse 3.4+. My install of FlexBuilder 3.2 is running Eclipse 3.3. And THAT turns out to be the crux of my problem. I installed it once (during some late night coding session no doubt) but it never showed up. It did show up in the “Manage Configuration” dialog though. So I disabled it, then deleted the related plugin and feature files, and to make sure it can actually install without the DTD error I tried again. It installed correctly except for the fact that it still doesn’t show up since this Eclipse is too old. So I’ll try a previous version to see if that’ll get it running here. Either that or see if I can get FlexBuilder running with 3.5.

[update]
I got Flex running on Eclipse 3.5 as per the directions noted in the line above. I’ll have to put it through it’s paces to see if it’s behaving correctly, but PathTools is oh very nice. 🙂

[update2]
Unfortunately the issues noted at the link for installing FB3.2 and Eclipse 3.5 happened for me as well so it’s back to my current working install for now.

EploreFS for Eclipse

Filed under: eclipse, tip, tool — michaelangela @ 9:44 am

In this post I mentioned trying to get PathTools to work and that I’d look into it later. That’s for another post upcoming in just a moment. But for now, there is ExploreFS mentioned below. It gets you to the folder where the asset is stored so you do still have to navigate to it but that’s still easier pretty good. Once it’s highighted (and you’re on a Mac) you can of course use Quicksilver to copy the highlighted file’s path to the clipboard.

Eclipse Plugins – RSS View, ExploreFS, and FreeMem

Eclipse Plugin: ExploreFS
ExploreFSExploreFS is a tiny plugin (~6KB) that opens a selected file in the folder of the native file manager. It adds “Explore in File System” to the context menu of Eclipse’s package explorer, resource navigator, and other views. Windows, Mac OS X, and Linux are supported.

November 24, 2009

Revealing an asset in Eclipse in the Finder

Filed under: automation, cool, eclipse, tip — michaelangela @ 3:35 pm

So my previous post about using PathTools isn’t working at the moment but the tip below does get the file open in Finder (well Pathfinder in my case). External Tools can obviously be quite powerful.

In eclipse, reveal current file in filesystem – Stack Overflow

Great tip. On Mac OS X, replace the location with /usr/bin/open and the arguments should be just ${container_loc}. – zvikico Jul 22 at 5:27

Copy path of asset in Eclipse

Filed under: cool, eclipse, tool — michaelangela @ 3:24 pm

I often find myself alt-clicking an item to pull up the properties to get the path to that file/folder/etc. Just found this. Nice! Copies paths, folder paths, other commands, terminal open to the path of the file, find the item in the file explorer of the OS, and other goodies.

pathtools – Project Hosting on Google Code

and was this is how it was originally made?!

update: not able to get it to work in FlexBuilder 3.2 at the moment. I’ll have to look into it later.

August 21, 2009

Generated getters and setters in Flex

Filed under: as3, automation, cool, eclipse, flex, tool — michaelangela @ 1:11 am

So for this particular Flash AS3 project I am doing that uses Flex as the code editor, I was just about to write a getter/setter pair and thought “perhaps someone has made a way to automate this…”

Quick Google later…

No More Writing Getters and Setters in Flex

eokyere blog has one of the best Flex productivity tips I have seen in quite a while. I build AS3 components all day, and spend way too much time manually typing getter and setter methods. Using the Dash plugin for Eclipse and eokyere’s productivity with with dash in eclipse, you’ll never write another getter and setter again!

April 17, 2008

Good list of Eclipse plugins specific to Flex

Filed under: cool, eclipse, flex, plugins, tool — michaelangela @ 9:09 pm

This list has many of the plugins I already use, and there are more that I haven’t looked at yet. I’ll give them a shot in due time, but it’s a good reference.

dispatchEvent » Pimp my ‘clipse – a list of must-have Eclipse plug-ins for Flex/Flash Development

FlexBuilder may have its ups and downs but it still remains my pick for best AS3/MXML editor on the market (with TextMate not far behind). Part of the beauty of FlexBuilder is that it’s built on the Eclipse SDK, one of the most versatile and powerful IDEs available, which is not only free and open source, but boasts a wealth of third party plug-ins
for every kind of (mostly Java) development. This article will take a
look at some must-have plug-ins for doing Flex development as well as
some tips for tricking out your development process.

Eclipse: updating Buckminster

Filed under: dev, eclipse, tip, tool — michaelangela @ 5:58 pm

Recently I have had trouble doing any updates in Eclipse. Buckminster always failed with a 404 not found. My current Buckminster Update Site is:

http://download.eclipse.org/technology/buckminster/updates

Later I found this bit:

Nabble – Eclipse – Buckminster Dev – Has something changed on buckminster update site?

yes, something has changed. Eclipse 3.3.2 was released and Buckminster headless-site.xml was updated to reflect this. Obviously I’ve made a mistake somewhere. It should have redirected the requests for the file in question to the Eclipse standard update site. I’ll check…

Two things to note:

  • The update site has changed
  • Buckminster can run headless

The new update site appears to be:

http://download.eclipse.org/tools/buckminster/updates

That change fixes it. And running Buckminster headless seems to be a valuable tool… not something I need right now but perhaps one day.

Headless (Buckminster) – Eclipsepedia

Buckminster offers functionality and/or integrations pertaining to many activities that are useful to reach in scripted situations, for example invoking ‘build’. Such activities are frequently necessary to run in situations where a user is not available, or even in situations where it’s not possible to use a graphical user interface. Thus, Buckminster recognizes the need to provide a way to do these things from the command line. This will come in handy in situations such as for automated nightly builds, for example. In Eclipse parlance, this is typically referred to as ‘running headless’.

Nightly builds for complex systems are of course a necessity and this is how some folks work it out.

Eclipse, Quicksilver, and hopping to a folder or terminal quickly

Filed under: cool, eclipse, quicksilver, tip — michaelangela @ 2:27 am

You can pull the currently selected item in Finder into Quicksilver with Command-G. Neato! But you can also pull selected text in a current app. You probably need to install and enable the Quicksilver proxy objects. But once you do, you can grab selected text and it’ll show up in Quicksilver.

But! If you’re in Eclipse and you want to get to a file somewhere you can open up the properties, select the path name, and then do the trigger to do the Command Window with Selection. You might have to set up a shortcut for it.

But since the text is a Unix path, Quicksilver interprets that as a folder and so there you are! You can then open it, reveal in Path Finder, go to in Terminal, etc., etc. Of course I have Quicksilver index the Eclipse project files so I can get there that way but it’s just another cool tip.

Hack Attack: Advanced Quicksilver guide – slashes, appends, and proxies, oh my!

(in the QS trigger preferences it’s called Command Window with Selection).

April 8, 2008

Local subversion on 1and1

Filed under: 1and1, automation, cool, dev, eclipse, education, svn, tip, tool, webfaction — michaelangela @ 4:15 am

1and1 had an update. Good. It broke subversion. Bad. 😦 After a short fight with subversion 1.4.6 (which didn’t work) I thought about using 1.4.5. Fortunately that’s pretty straightforward and… it works! So here are the commands for that. I develop on Eclipse using a JumpBox Trac/Subversion server locally. Changes to my Django app and Flex app are stored there. Then I can pull it from outside over ssh. Very helpful. Well… 1and1 is only file hosting. Webfaction hosts the fun stuff.

cd ~/some/src/directory
wget http://subversion.tigris.org/downloads/subversion-1.4.5.tar.gz

wget http://subversion.tigris.org/downloads/subversion-deps-1.4.5.tar.gz
tar xvfz subversion-1.4.5.tar.gz
tar xvfz subversion-deps-1.4.5.tar.gz
cd subversion-1.4.5
./configure --prefix=$HOME
make
make install

April 5, 2008

Building Flexlib from SVN source to get openEnd and closeEnd events for WindowShade

Filed under: component, cool, dev, eclipse, education, flex, mac, subclipse, svn, tip, tool — michaelangela @ 12:20 am

Short version: You must provide a path to the manifest.xml file in order for ant to find it! For example:

<arg line="-namespace http://code.google.com/p/flexlib/ /path/to/manifest.xml" />

Long version: I didn’t know that… thought it makes total sense in hindsight.

I am using the very nifty WindowShade from the life-saving (OK that’s a bit melodramatic…) FlexLib library. However, I wanted to be notified of open and close events. I heard somewhere (can’t find where now) that those events have been added into the SVN for FlexLib. I didn’t want to have to do a checkout and copy those files over and update it everytime the FlexLib SVN code updated… not fun. Fortunately there is a note in the FlexLib Wiki about creating a FlexBuildProject from the svn tree. This got interesting. I never build a SWC before and it certainly makes it a lot easier.

I decided to take the plunge.

I previously installed ant and all the other goodies (like subclipse) from previous project development, including my still-not-quite successful compilation of the Cairngen project for Cairngorm. (On a mac. That’s another story.)

Anyway, after fiddling with the build.xml file and the build.<your platform here>.properties file, it wouldn’t compile. compc complained about not being able to open the manifest.xml file. So very close. Then after a bit of digging, this note popped up.

Talk:Flex Ant Tasks – Adobe Labs

<namespace uri="http://www.company.com/2007/mxml" manifest="${CustomFlexLibrarySource.dir}/customFlexLibrary-manifest.xml"/>

That actually still provided that user with an error which is unfortunate. It’s also unfortunate I don’t know how to help in that situation. 😦 However the bit about providing a full path to the manifest.xml file was the tip I needed. And so, the flexlib.swc file has been created. A quick hit with the SVN update command followed by another build will keep it current. Gotta like that. Of course I need to test it and make sure I built it right, i.e. it works… 🙂

There is an option for running tests for the build as well. Well… let’s see…Run as > Ant Build… add compile tests… test… OK… trying…working…working… doh! Gotta uncomment the the flashPlayerDebug.exe line. Doh! It can’t execute Flash Player.app. Gotta set the path to /path/to/Adobe Flex Builder 3 Plug-in/Player/mac/Flash Player.app/Contents/MacOS/Flash Player instead.

What ho! It worked! Other than some deprecation warnings it worked. Cool.

update…Building the examples and everything else works without a hitch now as well. And yes I have the new openEnd, closeEnd and other properties I was looking for in WindowShade. However I got the “unable to export SWC oem”. I haven’t found a solution for it yet. I saw this:

I think I’ll start using this set up for many other libraries…

[flexcoders] Re: Compiling problems

First of all, I rebuild the workspace using the instructions (I did 
not see it before:( ) like FlexBuilder -clean -vmargs -Xmx512m.

Furthermore, it remained the problem of the connection for my swc.
After reading all debug instructions, I saw that the cause was the
history management. I disable it and it works.

But why the history management caused an error during execution (no
modification made to the swc) ?????

But that’s about actual Flex projects and not just a library project. More study on this later. (Hey, it’s Friday night after all! Time for a break! :-p ) But it’s working as needed so far… *finger’s crossed* Oh yes, the compile tests did pass so that’s a good sign.

March 31, 2008

Getting Cairngen to work with Eclipse and Tiger

Filed under: cairngen, cairngorm, eclipse, tip, tool — michaelangela @ 11:06 pm

Thanks to Darren who added some notes on it, there may be hope yet! (I copy things things here to my blog in case the original sources disappear as many others have done… :-()

And Darren, yes it did help very much!

Eric Feminella: Solutions Architect, Rich Internet Applications » Blog Archive » Cairngen 2.1

For anyone interested, I’ve worked out how to get Cairngen running
on Tiger. It probably works for Leopard too. It wasn’t easy as there’s
no (official) JRE 1.6 available but now I’ve got there, it’s reasonably
straightforward. You just have to add BSF, Rhino and Commons-Logging
jars to your Ant classpath. Like so:

1. Download and copy bsf.jar and js.jar to your Ant lib directory. Get them here:

http://jakarta.apache.org/site/downloads/downloads_bsf.cgi
http://www.mozilla.org/rhino/download.html

2. In Eclipse->Preferences->Ant->Runtime->Classpath, add
the 2 jars above (Add External JARs button), as well as
org.apache.commons.logging._*.jar (which should already be in your
Eclipse plugins directory). I’ve added them to Ant Home Entries which
works for me.

That’s really all there is to it. Then, as Eric says, you have to
run the appropriate targets in your Ant build file if you want to
create delegates, events, vo’s, etc. I couldn’t find an explanation as
to the best way to do this so I just added the targets to line 63 of
build.xml so it’s now:

depends=”log, create-model-locator, create-front-controller,
create-service-locator, create-multiple-sequences-include-delegates,
create-multiple-value-objects” />

I hope this helps.

Starting Eclipse with an alternate VM

Filed under: cairngen, cairngorm, eclipse, java, tool — michaelangela @ 10:29 pm

So I was trying out the Soylatte Java VM to get it to work with Eclipse so I could use Cairngen on a 10.4 Mac. I got an error after working with some Eclipse configurations so that Eclipse started with errors and didn’t allow much work. However starting from the command line (/Applications/eclipse/eclipse) got me back. I can also set the VM I want to use with the -vm argument. (Side note, I can use Scribefire’s “Custom HTML” option to insert <code> tags where needed it seems!)

Java Runtime Environment (JRE) – How to change the default JRE when there are several version of JRE in Sys

I recently installed Oracle 9i client on my new box
and now Eclipse will not start. I get an error

You can set the path to your VM in the eclipse start command:
eclipse.exe -vm <path-to-your-javaw.exe>

e.g.
eclipse.exe -vm c:\program files\java\jdk1.5.09_09\bin\javaw.exe

Another way is to locate the VM with your path environment. Set the variable JAVA_HOME to the root path of your VM installation. Update your path settings and remove all occurences of java. At the end add the following: %JAVA_HOME%\bin
Now delete javaw.exe and java.exe from your windows\system32 directory. They’re not needed, because they are in your path.

So all java programs are in the path. To change the VM you only need to change the JAVA_HOME variable.

Create a free website or blog at WordPress.com.