I was attempting to switch my use of tabs (in Eclipse Juno) to pure spaces. The problem was, even though the Text Editor configuration within Eclipse was set to use “Insert spaces for tabs”, this was not having any effect on my Java code.
Solution: the Java editor is using an Eclipse editor “profile” which is overriding the default Text Editor configuration parameters; thus, you need to customize the Java editor profile.
- Open up Eclipse preferences (Mac: Eclipse->Preferences)
- Navigate to Java->Editor->Formatter
- Create a new ‘Active Profile’, and call it whatever you like
- Edit the newly created profile (click Edit)
- Next to the ‘Tab policy’ item, select ‘Spaces only’ under the drop-down menu
- Click OK and make sure you use this profile
- (optional) for exiting code, you can convert source code to use the new tab policy by highlighting all the code, and right-clicking to select: Source->Correct Indentation
Getting OODT OPSUI 0.6-SNAPSHOT working with OODT Workflow Manager 0.3 should more or less work out of the box.
Please make sure to modify the following though:
- Edit your opsui webapp’s context.xml to use the old workflow-lifecycle file.
- Change: “[WORKFLOW_HOME]/policy/wengine/wengine-lifecycle.xml” to “[WORKFLOW_HOME]/policy/workflow-lifecycle.xml“
The following quick tutorial guides you in how to download and access S3 data from the command-line (on *nix) machines.
- An AWS S3 storage account already set up
- An AWS Access Key
- An AWS Private Key
- s3cmd (http://s3tools.org/s3cmd)
- Download s3cmd
- Mac (using homebrew):
brew install s3cmd
sudo apt-get install s3cmd
- Initialize your s3cmd to communicate with your S3 server
- Enter your AWS Access key
- Enter your AWS Private key
- (optional) enter encryption key or other paramters, otherwise just hit ‘enter’ for defaults
- s3cmd will test to see if it can connect – look for this
- View/download files
s3cmd get ...
Processing sketches (PDEs) are translated from the processing syntax to pure Java and are compiled and packaged into executable JARs. Is it possible to by pass the packaging step and go straight from the Java code to your own compiled class? Yes it is!
NOTE: Apart from your source and compiled class file, you will need the Processing “core.jar” binary to compile the class as well as run it.
- Use Processing to create a sketch file (.pde) and use the “Export” capability to export it to your native enviornment
- Open the generated export folder and navigate to the “source” directory. Inside here you will find the Java source file
- Compile the Java source file via:
javac -cp "core.jar" SOURCE_FILE.java
- Run the compiled class via the following command:
java -cp "core.jar:." CLASS_FILE
I spent some time searching for how to do this, so thought I’d share my findings.
I created an Apache CXF JAX-RS web-service using the Maven2 archetype “cxf-jaxrs-service (Simple CXF JAX-RS webapp service using Spring configuration)”. Using this as a boiler-plate, I then created my own RESTful web-service endpoint.
The problem was, without having my class extend HttpServlet, how would I get a hold of configuration parameters specified in a servlet configuration file? For example, within Tomcat’s META-INF/context.xml?
It’s as simple as just utilizing the @Servlet context variable.
First, ensure you have the following Maven dependency included in your project’s pom.xml:
Second, define a variable within your REST resource class as such:
@Context private ServletContext context;
Finally, read parameters from the context variable via:
Nice alternative to IRB for Ruby called Pry: http://pryrepl.org/
- Syntax highlighting
- Autocompletion of method names