Here's how to do it:
- Download and install Gimp;
- Download and install Ghostscript
- Setup the environment variable GS_PROG to the Ghostscript executable file, like C:\Program Files\gs\gs8.64\bin\gswin32.exe.
./M6
Software related information one might find useful.
private class Node {Please note that this class can be whatever class you require, this is only an example.
private final Node parent;
private final String word;
private Listchildren = new ArrayList ();
Node(Node parent, String word) {
this.parent = parent;
this.word = word;
if(parent != null) {
parent.children.add(this);
}
}
public Node getParent() {
return parent;
}
public CollectiongetChildren() {
return new ArrayList(children);
}
public boolean hasChildren() {
return children.size() > 0;
}
public void setChildren(CollectionnewChildren) {
if(newChildren != null) {
children = new ArrayList(newChildren);
}
}
public String getWord() {
return word;
}
}
private class NodeContentProvider implements ITreeContentProvider {
@Override
public Object[] getChildren(Object element) {
return ((Node)element).getChildren().toArray();
}
@Override
public Object getParent(Object element) {
return ((Node)element).getParent();
}
@Override
public boolean hasChildren(Object element) {
return ((Node)element).hasChildren();
}
@Override
public Object[] getElements(Object inputElement) {
return (Object[]) inputElement;
}
@Override
public void dispose() {
// unused
}
@Override
public void inputChanged(Viewer viewer, Object oldInput,
Object newInput) {
// unused
}
}
private class NodeLabelProvider extends LabelProvider {
private final TreeViewer viewer;
NodeLabelProvider(TreeViewer viewer) {
this.viewer = viewer;
}
@Override
public String getText(Object element) {
Node node = (Node) element;
return node.getWord();
}
}
PatternFilter patternFilter = new PatternFilter();
FilteredTree filteredTree = new FilteredTree(cTree,
SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CHECK,
this.patternFilter);
filteredTree.setInitialText("type your filter text here");
TreeViewer treeViewer = filteredTree.getViewer();
// Assign the label provider
treeViewer.setLabelProvider(new NodeLabelProvider());
// Assign the content provider
treeViewer.setContentProvider(new NodeContentProvider());
// Populate the tree with elements
Node ex1= new Node(null, "Example 1");
new Node(ex1, "Example 1.1");
new Node(ex1, "Example 1.2");
new Node(ex1, "Example 1.3");
Node ex2= new Node(null, "Example 2");
new Node(ex2, "Example 2.1");
Node[] nodes = Node[] {ex1, ex2}
viewer.setInput(nodes);
// Event for item selection
treeViewer.getTree().addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
TreeItem item = (TreeItem) event.item;
Node node = (Node)item.getData();
// Manually Expand
treeViewer.expandToLevel(node, 1);
treeViewer.update(node, null);
}
});
@Override
public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
// tell eclipse to save workbench state when it quits
// (things like window size, view layout, etc.)
configurer.setSaveAndRestore(true);
}
This is not a perfect solution, it's a workaround, but it's working just fine for me.
// Selections events
combo.addSelectionListener(new SelectionAdapter() {
// Selection changed, check if the options are still visible
public void widgetSelected(SelectionEvent e) {
// If list is not visible assume that the user has
// performed selection with the mouse
if (!combo.getListVisible()) {
setEditionValue(combo);
}
}
// Option selected
public void widgetDefaultSelected(SelectionEvent e) {
// User performed a selection with the keyboard
setEditionValue(combo);
}
});
Here's what I do:
*1.* in R console, I do and get:
> package.skeleton(name='remora')remora-package
Creating directories ...
Creating DESCRIPTION ...
Creating Read-and-delete-me ...
Saving functions and data ...
Making help files ...
Done.
Further steps are described in './remora/Read-and-delete-me'.
Warning messages:
1: In dump(internalObjs, file = file.path(code_dir,
sprintf("%s-internal.R", :
deparse of an S4 object will not be
source()able
2: In dump(internalObjs, file = file.path(code_dir,
sprintf("%s-internal.R", :
deparse of an S4 object will not be
source()able
3: In dump(internalObjs, file = file.path(code_dir,
sprintf("%s-internal.R", :
deparse of an S4 object will not be
source()able
4: In dump(internalObjs, file = file.path(code_dir,
sprintf("%s-internal.R", :
deparse of an S4 object will not be source()able
I don't know why I get these warnings. I've followed R
implementation rules and the S4 objects work fine.
*2.* Performing the 'R CMD build remora' command I get:
* checking for file 'remora/DESCRIPTION' ... OK
* preparing 'remora':
* checking DESCRIPTION meta-information ... OK
* removing junk files
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building 'remora_1.0.tar.gz'
And the remora_1.0.tar.gz file seems ok.
*
3.* Performing the 'R CMD check remora' command I get:
* checking for working pdflatex ...sh: pdflatex: not found
NO
* checking for working latex ...sh: latex: not found
NO
* using log directory '/home/fmm/thesis/R/src/remora.Rcheck'
* using R version 2.8.1 (2008-12-22)
* using session charset: UTF-8
* checking for file 'remora/DESCRIPTION' ... OK
* checking extension type ... Package
* this is package 'remora' version '1.0'
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking for executable files ... OK
* checking whether package 'remora' can be installed ...
ERROR
Installation failed.
See '/home/fmm/thesis/R/src/remora.Rcheck/00install.out'
for details.
*4.* the log file contains:
* Installing *source* package 'remora'
...
**
R
**
data
** preparing package for lazy
loading
Error in parse(n = -1, file = file) : unexpected '<' at 745:
`.__C__remoraConfiguration` <- 746: <> -> code2LazyLoadDB
-> sys.source -> parse Execution halted
ERROR: lazy loading failed for package
'remora'
** Removing
'/home/fmm/thesis/R/src/remora.Rcheck/remora'
fmm@Darkmaster:~/thesis/R/src$ grep -i __C__remoraConfiguration *
fmm@Darkmaster:~/thesis/R/src$ grep -i __C__remoraConfiguration */*
remora.Rcheck/00install.out:745: `.__C__remoraConfiguration`
<- remoraConfiguration is a constructor for the
remoraConfiguration S4 object.
# # Class configuration definition.
# CLASS_REMORA_CONFIGURATION <- "remoraConfiguration" class_configuration
<- setClass(CLASS_REMORA_CONFIGURATION, representation(
number_clusters = "numeric", class_name = "character",
weighting_function="character", scale_variance="logical", s="numeric",
d="numeric", alfa="numeric", eta = "numeric", niter="numeric",
niter_changes="numeric", perform_sum="logical", verbose="logical"),
prototype = list(number_clusters=numeric(), class_name=character(),
weighting_function=character(), scale_variance=logical(),
s=numeric(), d=numeric(), alfa=numeric(), eta=numeric(), niter=numeric(),
niter_changes=numeric(), perform_sum=logical(), verbose=logical()))
# # Builds a Remora configuration object.
# # [...]
# remoraConfiguration <- function(number_clusters, class_name,
weighting_function = FUNCTION_REMORA_EUCLIDEAN,
scale_variance=TRUE, s_value = 0.001, d = 0.3, alfa = 0.9, eta = 0.01,
niter=-1, niter_changes=5, perform_sum = TRUE, verbose=FALSE)
{
result_configuration <- new(CLASS_REMORA_CONFIGURATION)
[...]
result_configuration
}
Now it's time to go to the directory created, with the name of the package,
cat('\nPacking Remora...\n')
file_lst <- character(5)
file_lst[1] <- '/home/m6/thesis/R/src/1_classes.r'
file_lst[2] <- '/home/m6/thesis/R/src/2_common.r'
file_lst[3] <- '/home/m6/thesis/R/src/3_model.r'
file_lst[4] <- '/home/m6/thesis/R/src/4_predict.r'
file_lst[5] <- '/home/m6/thesis/R/src/5_main.r'
package.skeleton(name = "remora", force = TRUE, namespace = TRUE,
code_files = file_lst)
cat('\nDone.\n')