text:
package io.zucchiniui.backend.scenario.views;

import io.zucchiniui.backend.scenario.dao.ScenarioDAO;
import io.zucchiniui.backend.scenario.domain.Scenario;
import io.zucchiniui.backend.scenario.domain.ScenarioQuery;
import io.zucchiniui.backend.scenario.domain.ScenarioStatus;
import io.zucchiniui.backend.scenario.domain.Step;
import io.zucchiniui.backend.shared.domain.TagSelection;
import io.zucchiniui.backend.support.ddd.morphia.MorphiaRawQuery;
import io.zucchiniui.backend.support.ddd.morphia.MorphiaUtils;
import io.zucchiniui.backend.testrun.domain.TestRunQuery;
import io.zucchiniui.backend.testrun.domain.TestRunRepository;
import xyz.morphia.query.Query;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@Component
public class ScenarioViewAccess {

    private final ScenarioDAO scenarioDAO;

    private final TestRunRepository testRunRepository;

    private final ScenarioToListItemViewMapper scenarioToListItemViewMapper;

    private final FailedScenarioToListItemViewMapper failedScenarioToListItemViewMapper;

    private final ScenarioToHistoryItemViewMapper scenarioToHistoryItemViewMapper;

    public ScenarioViewAccess(
        final ScenarioDAO scenarioDAO,
        final TestRunRepository testRunRepository,
        final ScenarioToListItemViewMapper scenarioToListItemViewMapper,
        FailedScenarioToListItemViewMapper failedScenarioToListItemViewMapper,
        ScenarioToHistoryItemViewMapper scenarioToHistoryItemViewMapper) {
        this.scenarioDAO = scenarioDAO;
        this.testRunRepository = testRunRepository;
        this.scenarioToListItemViewMapper = scenarioToListItemViewMapper;
        this.failedScenarioToListItemViewMapper = failedScenarioToListItemViewMapper;
        this.scenarioToHistoryItemViewMapper = scenarioToHistoryItemViewMapper;
    }

    public List<ScenarioListItemView> getScenarioListItems(final Consumer<ScenarioQuery> preparator) {
        final Query<Scenario> query = scenarioDAO.prepareTypedQuery(preparator)
            .project("info", true)
            .project("status", true)
            .project("testRunId", true)
            .project("featureId", true)
            .project("reviewed", true);

        return MorphiaUtils.streamQuery(query)
            .map(scenarioToListItemViewMapper::map)
            .collect(Collectors.toList());
    }

    public Map<String, ScenarioListItemView> getScenarioListItemsGroupedByScenarioKey(final Consumer<ScenarioQuery> preparator) {
        final Query<Scenario> query = scenarioDAO.prepareTypedQuery(preparator)
            .project("info", true)
            .project("status", true)
            .project("testRunId", true)
            .project("featureId", true)
            .project("reviewed", true)
            .project("scenarioKey", true);

        return MorphiaUtils.streamQuery(query).collect(Collectors.toMap(Scenario::getScenarioKey, scenarioToListItemViewMapper::map));
    }

    public List<GroupedFailuresListItemView> getGroupedFailedScenarii(final Consumer<ScenarioQuery> preparator) {
        List<GroupedFailuresListItemView> groupedFailures = new ArrayList<>();
        getFailedScenarii(preparator).forEach(scenario -> {
            boolean matchFound = false;
            for (GroupedFailuresListItemView current : groupedFailures) {
                if (ErrorMessageGroupingUtils.isSimilar(current.getErrorMessage(), scenario.getErrorMessage())) {
                    current.addFailedScenario(scenario);
                    matchFound = true;
                    break;
                }
            }
            if (!matchFound) {
                GroupedFailuresListItemView noMatch = new GroupedFailuresListItemView();
                noMatch.setErrorMessage(scenario.getErrorMessage());
                noMatch.setFailedScenarii(new TreeSet<>(Comparator.comparing(failure -> failure.getInfo().getName())));
                noMatch.addFailedScenario(scenario);
                groupedFailures.add(noMatch);
            }
        });
        return groupedFailures
            .stream()
            .sorted(Comparator.comparing((GroupedFailuresListItemView grp) -> grp.getFailedScenarii().size()).reversed())
            .collect(Collectors.toList());
    }

    public List<FailedScenarioListItemView> getFailedScenarii(final Consumer<ScenarioQuery> preparator) {
        Consumer<ScenarioQuery> fullPreparator = preparator.andThen(ScenarioQuery::havingErrorMessage);

        final Query<Scenario> query = scenarioDAO.prepareTypedQuery(fullPreparator);
        return MorphiaUtils.streamQuery(query)
            .map(failedScenarioToListItemViewMapper::map)
            .collect(Collectors.toList());
    }

    public List<ScenarioHistoryItemView> getScenarioHistory(final String scenarioKey) {
        return testRunRepository.query(TestRunQuery::orderByLatestFirst)
            .stream()
            .flatMap(testRun -> {
                final Scenario scenario = scenarioDAO.prepareTypedQuery(q -> q.withTestRunId(testRun.getId()).withScenarioKey(scenarioKey))
                    .project("status", true)
                    .get();

                if (scenario == null) {
                    return Stream.empty();
                }

                final ScenarioHistoryItemView item = scenarioToHistoryItemViewMapper.map(scenario);
                item.setTestRun(testRun);
                return Stream.of(item);
            })
            .collect(Collectors.toList());
    }

    public ScenarioHistoryItemView getLastScenariiTested(final Consumer<ScenarioQuery> preparator) {
        final Query<Scenario> query = scenarioDAO.prepareTypedQuery(preparator);
        final Scenario scenario = MorphiaUtils.streamQuery(query).findFirst().orElse(null);
        if(scenario == null) {
            return new ScenarioHistoryItemView(); // empty object
        }
        List<ScenarioHistoryItemView> scenariosHistory = getScenarioHistory(scenario.getScenarioKey());
        return scenariosHistory.get(0);
    }

    public ScenarioStats getStats(final Consumer<ScenarioQuery> preparator) {
        final ScenarioStats stats = new ScenarioStats();

        new MorphiaRawQuery(scenarioDAO.prepareTypedQuery(preparator))
            .includeFields("status", "reviewed")
            .stream()
            .forEach(dbObj -> {
                final String statusStr = (String) dbObj.get("status");
                final boolean reviewed = (Boolean) dbObj.get("reviewed");
                stats.addScenarioStatus(ScenarioStatus.valueOf(statusStr), reviewed);
            });

        return stats;
    }

    public List<ScenarioTagStats> getTagStats(final Consumer<ScenarioQuery> preparator, final Collection<String> tags) {
        // Filter tags if requested
        final Predicate<String> tagFilter;
        if (tags.isEmpty()) {
            tagFilter = ignored -> true;
        } else {
            tagFilter = tags::contains;
        }

        final Map<String, ScenarioStats> statsByTag = new HashMap<>();

        // Raw Mongo query for performance, to bypass Morphia object conversion
        new MorphiaRawQuery(scenarioDAO.prepareTypedQuery(preparator))
            .includeFields("status", "reviewed", "allTags")
            .stream()
            .forEach(dbObj -> {
                final String statusStr = (String) dbObj.get("status");
                final boolean reviewed = (Boolean) dbObj.get("reviewed");

                @SuppressWarnings("unchecked")
                List<String> scenarioTags = (List) dbObj.get("allTags");
                if (scenarioTags == null) {
                    scenarioTags = Collections.emptyList();
                }

                scenarioTags.stream()
                    .filter(tagFilter)
                    .forEach(tag -> {
                        final ScenarioStats tagStats = statsByTag.computeIfAbsent(tag, key -> new ScenarioStats());
                        tagStats.addScenarioStatus(ScenarioStatus.valueOf(statusStr), reviewed);
                    });
            });

        return statsByTag.entrySet().stream()
            .map(entry -> new ScenarioTagStats(entry.getKey(), entry.getValue()))
            .sorted(Comparator.comparing(ScenarioTagStats::getTag))
            .collect(Collectors.toList());
    }

    public Set<String> getFeatureIdsForTags(final TagSelection tagSelection) {
        return new MorphiaRawQuery(scenarioDAO.prepareTypedQuery(q -> q.withSelectedTags(tagSelection)))
            .includeFields("featureId")
            .stream()
            .map(dbObj -> (String) dbObj.get("featureId"))
            .collect(Collectors.toSet());
    }

    public List<GroupedStepsListItemView> getStepDefinitions(final Consumer<ScenarioQuery> preparator) {

        final Query<Scenario> query = scenarioDAO.prepareTypedQuery(preparator).project("steps", true);
        List<Step> steps = MorphiaUtils.streamQuery(query)
            .flatMap(scenario -> scenario.getSteps().stream())
            .filter(step -> step.getDefinitionSource() != null)
            .collect(Collectors.toList());

        final List<GroupedStepsListItemView> groupedSteps = new ArrayList<>();
        steps.forEach(step -> {
            boolean matchFound = false;
            for (GroupedStepsListItemView current : groupedSteps) {
                if (current.getDefinitionSource().equals(step.getDefinitionSource())) {
                    current.addOccurrence(step);
                    matchFound = true;
                    break;
                }
            }
            if (!matchFound) {
                GroupedStepsListItemView noMatch = new GroupedStepsListItemView();
                noMatch.setOccurrences(new TreeSet<>(Comparator.comparing(s -> s.getInfo().getName())));
                noMatch.addOccurrence(step);
                noMatch.setDefinitionSource(step.getDefinitionSource());
                groupedSteps.add(noMatch);
            }
        });

        return groupedSteps
            .stream()
            .sorted(Comparator.comparing((GroupedStepsListItemView grp) -> grp.getOccurrences().size()).reversed())
            .collect(Collectors.toList());
    }

}


text:
package org.broad.igv.feature.genome;

import org.apache.log4j.Logger;
import org.broad.igv.Globals;
import org.broad.igv.prefs.PreferencesManager;
import org.broad.igv.ui.IGV;
import org.broad.igv.ui.util.FileDialogUtils;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.Serializable;
import java.util.Collection;

/**
 * @author eflakes
 */
public class GenomeBuilderPane extends javax.swing.JPanel implements Serializable {

    private static Logger logger = Logger.getLogger(GenomeBuilderPane.class);
    private String genomeArchiveLocation;
    private String genomeFilename;
    GenomeImporter importer;
    IGV igv;

    public GenomeBuilderPane() {
        initComponents();
        importer = new GenomeImporter();
    }

    public void setIgv(IGV igv) {
        this.igv = igv;
    }

    public String getCytobandFileName() {
        String cytobandFile = cytobandFileTextField.getText();
        if (cytobandFile != null && cytobandFile.trim().equals("")) {
            cytobandFile = null;
        }
        return cytobandFile;
    }

    public String getGeneAnnotFileName() {
        String refFlatFile = geneAnnotFileTextField.getText();
        if (refFlatFile != null && refFlatFile.trim().equals("")) {
            refFlatFile = null;
        }
        return refFlatFile;
    }

    public String getFastaFileName() {
        String fastaFile = fastaFileTextField.getText();
        if (fastaFile != null && fastaFile.trim().equals("")) {
            fastaFile = null;
        }
        return fastaFile;
    }

    public String getChrAliasFileName() {
        String chrAliasFile = chrAliasField.getText();
        if (chrAliasFile != null && chrAliasFile.trim().equals("")) {
            chrAliasFile = null;
        }
        return chrAliasFile;
    }

    public String getGenomeId() {
        return idField.getText();
    }

//    public String getSequenceURL() {
//        return sequenceURLField.getText();
//    }

    public String getGenomeDisplayName() {
        String name = genomeDisplayNameTextField.getText();
        if (name != null && name.trim().equals("")) {
            name = null;
        } else {
            name = name.trim();
        }
        return name;
    }

    public String getGenomeArchiveLocation() {
        if (genomeArchiveLocation != null && genomeArchiveLocation.trim().equals("")) {
            genomeArchiveLocation = null;
        }
        return genomeArchiveLocation;
    }

    public String getArchiveFileName() {

        if (genomeFilename == null) {
            genomeFilename = getGenomeId() + Globals.GENOME_FILE_EXTENSION;
        }
        return genomeFilename;
    }

    protected File showGenomeArchiveDirectoryChooser() {

        File directory = PreferencesManager.getPreferences().getLastGenomeImportDirectory();
        File archiveName = new File(getGenomeId() + Globals.GENOME_FILE_EXTENSION);
        File file = FileDialogUtils.chooseFile("Save Genome File", directory, archiveName, FileDialogUtils.SAVE);

        if (file != null) {

            genomeFilename = file.getName();
            if (genomeFilename != null) {
                if (!genomeFilename.endsWith(Globals.GENOME_FILE_EXTENSION)) {
                    genomeFilename += Globals.GENOME_FILE_EXTENSION;
                    file = new File(file.getParentFile(), genomeFilename);
                }
                genomeArchiveLocation = file.getParentFile().getAbsolutePath();
            }
        }
        return file;
    }

    public boolean validateSelection() {

        try {

            if (!isIdValid()) {
                return false;
            }

            if (!isGenomeDisplayNameValid()) {
                genomeDisplayNameTextField.setText(null);
                return false;
            }

            if (!isFASTAFileValid()) {
                JOptionPane.showMessageDialog(this, "A fasta file is required!");
                return false;
            }

        } catch (Exception e) {
            logger.error("Error during Genome Builder validation!", e);
            return false;
        }
        return true;
    }

    private boolean isFASTAFileValid() {

        String file = fastaFileTextField.getText();
        return file != null && file.trim().length() > 0;
    }

    private Boolean isIdValid() {

        String id = getGenomeId();
        if (id == null || id.trim().length() == 0) {
            JOptionPane.showMessageDialog(this, "Genome ID is required");
            return false;
        }

        Collection<String> inUseIds = GenomeManager.getInstance().getSelectableGenomeIDs();
        if (inUseIds.contains(id)) {
            JOptionPane.showMessageDialog(this,
                    "The genome ID '" + id + "' is already in use - please select another!");
            return false;
        }
        return true;
    }

    private boolean isGenomeDisplayNameValid() {

        String displayName = getGenomeDisplayName();
        if (displayName == null || displayName.trim().length() == 0) {
            JOptionPane.showMessageDialog(this, "Genome name is required");
            return false;
        }

        Collection<String> inUseDisplayNames = GenomeManager.getInstance().getGenomeDisplayNames();

        if (inUseDisplayNames.contains(displayName)) {
            JOptionPane.showMessageDialog(this,
                    "The genome name '" + displayName + "' is already in use - please select another!");
            return false;
        }
        return true;
    }

    /**
     * This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    // Generated using JFormDesigner non-commercial license
    private void initComponents() {
        panel3 = new JPanel();
        panel2 = new JPanel();
        genomeDisplayNameLabel2 = new JLabel();
        idField = new JTextField();
        genomeDisplayNameLabel = new JLabel();
        genomeDisplayNameTextField = new JTextField();
        fastaFileLabel = new JLabel();
        fastaFileTextField = new JTextField();
        fastaFileButton = new JButton();
        panel1 = new JPanel();
        cytobandFileLabel = new JLabel();
        cytobandFileTextField = new JTextField();
        cytobandFileButton = new JButton();
        geneAnnotFileLabel = new JLabel();
        geneAnnotFileTextField = new JTextField();
        geneAnnotFileButton = new JButton();
        aliasFileLabel = new JLabel();
        chrAliasField = new JTextField();
        chrAliasButton = new JButton();
        vSpacer2 = new JPanel(null);

        //======== this ========
        setFont(new Font("Tahoma", Font.ITALIC, 12));
        setMaximumSize(new Dimension(900, 500));
        setMinimumSize(new Dimension(400, 200));
        setPreferredSize(new Dimension(700, 200));
        setLayout(new BorderLayout());

        //======== panel3 ========
        {
            panel3.setBorder(new EmptyBorder(20, 20, 20, 20));
            panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));

            //======== panel2 ========
            {
                panel2.setBorder(new EmptyBorder(0, 0, 30, 0));
                panel2.setLayout(null);

                //---- genomeDisplayNameLabel2 ----
                genomeDisplayNameLabel2.setText("Unique identifier");
                genomeDisplayNameLabel2.setToolTipText("Unique identifier (e.g. hg18)");
                genomeDisplayNameLabel2.setMaximumSize(new Dimension(84, 16));
                genomeDisplayNameLabel2.setMinimumSize(new Dimension(84, 16));
                genomeDisplayNameLabel2.setPreferredSize(new Dimension(14, 16));
                panel2.add(genomeDisplayNameLabel2);
                genomeDisplayNameLabel2.setBounds(15, 22, 125, 28);

                //---- idField ----
                idField.setToolTipText("A uniqe identifier for the genome");
                panel2.add(idField);
                idField.setBounds(145, 22, 548, 29);

                //---- genomeDisplayNameLabel ----
                genomeDisplayNameLabel.setText("Descriptive name");
                panel2.add(genomeDisplayNameLabel);
                genomeDisplayNameLabel.setBounds(15, 56, 175, 28);

                //---- genomeDisplayNameTextField ----
                genomeDisplayNameTextField.setToolTipText("The user-readable name of the genome");
                genomeDisplayNameTextField.setPreferredSize(new Dimension(400, 28));
                genomeDisplayNameTextField.setMinimumSize(new Dimension(25, 28));
                panel2.add(genomeDisplayNameTextField);
                genomeDisplayNameTextField.setBounds(145, 56, 548, 29);

                //---- fastaFileLabel ----
                fastaFileLabel.setText("FASTA file");
                panel2.add(fastaFileLabel);
                fastaFileLabel.setBounds(15, 88, 175, 29);

                //---- fastaFileTextField ----
                fastaFileTextField.setToolTipText("A FASTA data file");
                fastaFileTextField.setPreferredSize(new Dimension(400, 28));
                fastaFileTextField.setMinimumSize(new Dimension(25, 28));
                panel2.add(fastaFileTextField);
                fastaFileTextField.setBounds(145, 88, 548, 29);

                //---- fastaFileButton ----
                fastaFileButton.setText("Browse");
                fastaFileButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        fastaFileButtonActionPerformed(e);
                    }
                });
                panel2.add(fastaFileButton);
                fastaFileButton.setBounds(698, 88, 83, fastaFileButton.getPreferredSize().height);
            }
            panel3.add(panel2);

            //======== panel1 ========
            {
                panel1.setBorder(new TitledBorder(null, "Optional", TitledBorder.LEADING, TitledBorder.DEFAULT_POSITION,
                    new Font("Lucida Grande", Font.BOLD, 13)));
                panel1.setLayout(null);

                //---- cytobandFileLabel ----
                cytobandFileLabel.setText("Cytoband file");
                panel1.add(cytobandFileLabel);
                cytobandFileLabel.setBounds(15, 25, 105, 29);

                //---- cytobandFileTextField ----
                cytobandFileTextField.setToolTipText("A cytoband data file");
                cytobandFileTextField.setPreferredSize(new Dimension(400, 28));
                cytobandFileTextField.setMinimumSize(new Dimension(25, 28));
                panel1.add(cytobandFileTextField);
                cytobandFileTextField.setBounds(145, 22, 548, 29);

                //---- cytobandFileButton ----
                cytobandFileButton.setText("Browse");
                cytobandFileButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        cytobandFileButtonActionPerformed(e);
                    }
                });
                panel1.add(cytobandFileButton);
                cytobandFileButton.setBounds(698, 22, 83, cytobandFileButton.getPreferredSize().height);

                //---- geneAnnotFileLabel ----
                geneAnnotFileLabel.setText("Gene file");
                panel1.add(geneAnnotFileLabel);
                geneAnnotFileLabel.setBounds(15, 56, 84, 29);

                //---- geneAnnotFileTextField ----
                geneAnnotFileTextField.setToolTipText("An annotation file");
                geneAnnotFileTextField.setPreferredSize(new Dimension(400, 28));
                geneAnnotFileTextField.setMinimumSize(new Dimension(25, 28));
                panel1.add(geneAnnotFileTextField);
                geneAnnotFileTextField.setBounds(145, 56, 548, 29);

                //---- geneAnnotFileButton ----
                geneAnnotFileButton.setText("Browse");
                geneAnnotFileButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        refFlatFileButtonActionPerformed(e);
                    }
                });
                panel1.add(geneAnnotFileButton);
                geneAnnotFileButton.setBounds(698, 56, 83, geneAnnotFileButton.getPreferredSize().height);

                //---- aliasFileLabel ----
                aliasFileLabel.setText("Alias file");
                panel1.add(aliasFileLabel);
                aliasFileLabel.setBounds(15, 90, 84, 29);

                //---- chrAliasField ----
                chrAliasField.setPreferredSize(new Dimension(400, 28));
                chrAliasField.setMinimumSize(new Dimension(25, 28));
                panel1.add(chrAliasField);
                chrAliasField.setBounds(145, 90, 548, 29);

                //---- chrAliasButton ----
                chrAliasButton.setText("Browse");
                chrAliasButton.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        chrAliasButtonActionPerformed(e);
                    }
                });
                panel1.add(chrAliasButton);
                chrAliasButton.setBounds(698, 90, 83, chrAliasButton.getPreferredSize().height);
                panel1.add(vSpacer2);
                vSpacer2.setBounds(6, 124, 84, 20);
            }
            panel3.add(panel1);
        }
        add(panel3, BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void chrAliasButtonActionPerformed(ActionEvent e) {
        File directory = PreferencesManager.getPreferences().getDefineGenomeInputDirectory();
        File file = FileDialogUtils.chooseFile("Select Chromosome Alias File", directory, FileDialogUtils.LOAD);
        if (file != null) {
            chrAliasField.setText(file.getAbsolutePath());
            PreferencesManager.getPreferences().setDefineGenomeInputDirectory(file.getParentFile());
        }
    }

    private void cytobandFileButtonActionPerformed(java.awt.event.ActionEvent evt) {
        File directory = PreferencesManager.getPreferences().getDefineGenomeInputDirectory();
        File file = FileDialogUtils.chooseFile("Select Cytoband File", directory, FileDialogUtils.LOAD);
        if (file != null) {
            cytobandFileTextField.setText(file.getAbsolutePath());
            PreferencesManager.getPreferences().setDefineGenomeInputDirectory(file.getParentFile());
        }
    }

    private void refFlatFileButtonActionPerformed(java.awt.event.ActionEvent evt) {
        File directory = PreferencesManager.getPreferences().getDefineGenomeInputDirectory();
        File file = FileDialogUtils.chooseFile("Select Annotation File", directory, FileDialogUtils.LOAD);
        if (file != null) {
            geneAnnotFileTextField.setText(file.getAbsolutePath());
            PreferencesManager.getPreferences().setDefineGenomeInputDirectory(file.getParentFile());
        }
    }

    private void fastaFileButtonActionPerformed(java.awt.event.ActionEvent evt) {
        File directory = PreferencesManager.getPreferences().getDefineGenomeInputDirectory();
        File file = FileDialogUtils.chooseFileOrDirectory("Select Fasta File", directory, null, FileDialogUtils.LOAD);
        if (file != null) {
            fastaFileTextField.setText(file.getAbsolutePath());
            PreferencesManager.getPreferences().setDefineGenomeInputDirectory(file.getParentFile());
        }
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    // Generated using JFormDesigner non-commercial license
    private JPanel panel3;
    private JPanel panel2;
    private JLabel genomeDisplayNameLabel2;
    private JTextField idField;
    private JLabel genomeDisplayNameLabel;
    private JTextField genomeDisplayNameTextField;
    private JLabel fastaFileLabel;
    private JTextField fastaFileTextField;
    private JButton fastaFileButton;
    private JPanel panel1;
    private JLabel cytobandFileLabel;
    private JTextField cytobandFileTextField;
    private JButton cytobandFileButton;
    private JLabel geneAnnotFileLabel;
    private JTextField geneAnnotFileTextField;
    private JButton geneAnnotFileButton;
    private JLabel aliasFileLabel;
    private JTextField chrAliasField;
    private JButton chrAliasButton;
    private JPanel vSpacer2;
    // End of variables declaration//GEN-END:variables

}

redpajama_set_name: RedPajamaGithub


text:
Clazz.declarePackage ("J.jvxl.readers");
Clazz.load (["J.jvxl.readers.VolumeFileReader"], "J.jvxl.readers.JvxlXmlReader", ["java.lang.Float", "$.NullPointerException", "java.util.Hashtable", "JU.AU", "$.BS", "$.CU", "$.List", "$.P3", "$.P4", "$.PT", "$.SB", "J.jvxl.data.JvxlCoder", "$.MeshData", "J.jvxl.readers.XmlReader", "J.shapesurface.IsosurfaceMesh", "J.util.C", "$.ColorEncoder", "$.Escape", "$.Logger"], function () {
c$ = Clazz.decorateAsClass (function () {
this.JVXL_VERSION = "2.3";
this.surfaceDataCount = 0;
this.edgeDataCount = 0;
this.colorDataCount = 0;
this.excludedTriangleCount = 0;
this.excludedVertexCount = 0;
this.invalidatedVertexCount = 0;
this.haveContourData = false;
this.xr = null;
this.isXmlFile = true;
this.thisInside = false;
this.tempDataXml = null;
this.bsVoxelBitSet = null;
this.includeValueNaN = true;
this.valueCount = 0;
this.valueMin = NaN;
this.valueRange = NaN;
this.fractionPtr = 0;
this.colorPtr = 0;
this.strFractionTemp = "";
this.haveReadColorData = false;
this.jvxlColorEncodingRead = null;
Clazz.instantialize (this, arguments);
}, J.jvxl.readers, "JvxlXmlReader", J.jvxl.readers.VolumeFileReader);
Clazz.makeConstructor (c$,
function () {
Clazz.superConstructor (this, J.jvxl.readers.JvxlXmlReader, []);
});
$_V(c$, "init2",
function (sg, br) {
this.init2JXR (sg, br);
}, "J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");
$_M(c$, "init2JXR",
function (sg, br) {
this.init2VFR (sg, br);
this.jvxlData.wasJvxl = this.isJvxl = true;
this.isXLowToHigh = false;
this.xr =  new J.jvxl.readers.XmlReader (br);
}, "J.jvxl.readers.SurfaceGenerator,java.io.BufferedReader");
$_V(c$, "readVolumeData",
function (isMapData) {
if (!this.readVolumeDataVFR (isMapData)) return false;
this.strFractionTemp = this.jvxlEdgeDataRead;
this.fractionPtr = 0;
return true;
}, "~B");
$_V(c$, "gotoAndReadVoxelData",
function (isMapData) {
this.initializeVolumetricData ();
if (this.nPointsX < 0 || this.nPointsY < 0 || this.nPointsZ < 0) return true;
try {
this.gotoData (this.params.fileIndex - 1, this.nPointsX * this.nPointsY * this.nPointsZ);
if (this.vertexDataOnly) return true;
this.volumeData.setMappingPlane (this.params.thePlane);
this.readSurfaceData (isMapData);
this.volumeData.setMappingPlane (null);
if (this.edgeDataCount > 0) this.jvxlEdgeDataRead = this.jvxlReadFractionData ("edge", this.edgeDataCount);
this.params.bsExcluded = this.jvxlData.jvxlExcluded =  new Array (4);
this.hasColorData = (this.colorDataCount > 0);
if (this.hasColorData) this.jvxlColorDataRead = this.jvxlReadFractionData ("color", this.colorDataCount);
if (this.excludedVertexCount > 0) {
this.jvxlData.jvxlExcluded[0] = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlExcludedVertexData", null, false, false));
if (this.xr.isNext ("jvxlExcludedPlaneData")) this.jvxlData.jvxlExcluded[2] = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlExcludedPlaneData", null, false, false));
}if (this.excludedTriangleCount > 0) this.jvxlData.jvxlExcluded[3] = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlExcludedTriangleData", null, false, false));
if (this.invalidatedVertexCount > 0) this.jvxlData.jvxlExcluded[1] = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlInvalidatedVertexData", null, false, false));
if (this.haveContourData) this.jvxlDecodeContourData (this.jvxlData, this.xr.getXmlData ("jvxlContourData", null, false, false));
if (this.jvxlDataIsColorMapped && this.jvxlData.nVertexColors > 0) {
this.jvxlData.vertexColorMap =  new java.util.Hashtable ();
var vdata = this.xr.getXmlData ("jvxlVertexColorData", null, true, false);
var baseColor = J.jvxl.readers.XmlReader.getXmlAttrib (vdata, "baseColor");
this.jvxlData.baseColor = (baseColor.length > 0 ? baseColor : null);
for (var i = 0; i < this.jvxlData.nVertexColors; i++) {
var s = this.xr.getXmlData ("jvxlColorMap", vdata, true, false);
var color = J.jvxl.readers.XmlReader.getXmlAttrib (s, "color");
var bs = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlColorMap", s, false, false));
this.jvxlData.vertexColorMap.put (color, bs);
}
}} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
J.util.Logger.error (e.toString ());
return false;
} else {
throw e;
}
}
return true;
}, "~B");
$_V(c$, "readParameters",
function () {
var s = this.xr.getXmlData ("jvxlFileTitle", null, false, false);
this.jvxlFileHeaderBuffer = JU.SB.newS (s);
this.xr.toTag ("jvxlVolumeData");
var data = this.tempDataXml = this.xr.getXmlData ("jvxlVolumeData", null, true, false);
this.volumetricOrigin.setT (this.xr.getXmlPoint (data, "origin"));
this.isAngstroms = true;
this.readVector (0);
this.readVector (1);
this.readVector (2);
this.line = this.xr.toTag ("jvxlSurfaceSet");
this.nSurfaces = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (this.line, "count"));
J.util.Logger.info ("jvxl file surfaces: " + this.nSurfaces);
J.util.Logger.info ("using default edge fraction base and range");
J.util.Logger.info ("using default color fraction base and range");
this.cJvxlEdgeNaN = String.fromCharCode (this.edgeFractionBase + this.edgeFractionRange);
});
$_M(c$, "readVector",
function (voxelVectorIndex) {
var data = this.xr.getXmlData ("jvxlVolumeVector", this.tempDataXml, true, true);
this.tempDataXml = this.tempDataXml.substring (this.tempDataXml.indexOf (data) + data.length);
var n = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "count"));
if (n == -2147483648) this.vertexDataOnly = true;
this.voxelCounts[voxelVectorIndex] = (n < 0 ? 0 : n);
this.volumetricVectors[voxelVectorIndex].setT (this.xr.getXmlPoint (data, "vector"));
if (this.isAnisotropic) this.setVectorAnisotropy (this.volumetricVectors[voxelVectorIndex]);
}, "~N");
$_V(c$, "gotoData",
function (n, nPoints) {
if (n > 0) J.util.Logger.info ("skipping " + n + " data sets, " + nPoints + " points each");
this.vertexDataOnly = this.jvxlData.vertexDataOnly = (nPoints == 0);
for (var i = 0; i < n; i++) {
this.jvxlSkipData (nPoints, true);
}
this.xr.toTag ("jvxlSurface");
this.jvxlReadSurfaceInfo ();
}, "~N,~N");
$_M(c$, "jvxlSkipData",
function (nPoints, doSkipColorData) {
this.readLine ();
this.xr.skipTag ("jvxlSurface");
}, "~N,~B");
$_M(c$, "jvxlReadSurfaceInfo",
function () {
var s;
var data = this.xr.getXmlData ("jvxlSurfaceInfo", null, true, true);
this.isXLowToHigh = J.jvxl.readers.XmlReader.getXmlAttrib (data, "isXLowToHigh").equals ("true");
this.jvxlCutoff = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "cutoff"));
if (!Float.isNaN (this.jvxlCutoff)) J.util.Logger.info ("JVXL read: cutoff " + this.jvxlCutoff);
var nContourData = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nContourData"));
this.haveContourData = (nContourData > 0);
this.params.isContoured = J.jvxl.readers.XmlReader.getXmlAttrib (data, "contoured").equals ("true");
if (this.params.isContoured) {
var nContoursRead = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nContours"));
if (nContoursRead <= 0) {
nContoursRead = 0;
} else {
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "contourValues");
if (s.length > 0) {
this.jvxlData.contourValues = this.params.contoursDiscrete = this.parseFloatArrayStr (s);
J.util.Logger.info ("JVXL read: contourValues " + J.util.Escape.eAF (this.jvxlData.contourValues));
}s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "contourColors");
if (s.length > 0) {
this.jvxlData.contourColixes = this.params.contourColixes = J.util.C.getColixArray (s);
this.jvxlData.contourColors = J.util.C.getHexCodes (this.jvxlData.contourColixes);
J.util.Logger.info ("JVXL read: contourColixes " + J.util.C.getHexCodes (this.jvxlData.contourColixes));
}this.params.contourFromZero = J.jvxl.readers.XmlReader.getXmlAttrib (data, "contourFromZero").equals ("true");
}this.params.nContours = (this.haveContourData ? nContourData : nContoursRead);
}this.jvxlData.nVertexColors = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nVertexColors"));
this.params.isBicolorMap = J.jvxl.readers.XmlReader.getXmlAttrib (data, "bicolorMap").equals ("true");
if (this.params.isBicolorMap) {
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "colorPositive");
if (s.length > 0 && this.params.colorRgb == -2147483648 && this.params.colorPos == -16776961) this.params.colorPos = JU.CU.getArgbFromString (s);
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "colorNegative");
if (s.length > 0 && this.params.colorRgb == -2147483648 && this.params.colorNeg == -65536) this.params.colorNeg = JU.CU.getArgbFromString (s);
}if (this.params.isBicolorMap || this.params.colorBySign) this.jvxlCutoff = 0;
this.jvxlDataIsColorMapped = ((this.params.colorRgb == -2147483648 || this.params.colorRgb == 2147483647) && (this.params.isBicolorMap || J.jvxl.readers.XmlReader.getXmlAttrib (data, "colorMapped").equals ("true")));
this.jvxlData.isJvxlPrecisionColor = J.jvxl.readers.XmlReader.getXmlAttrib (data, "precisionColor").equals ("true");
this.jvxlData.jvxlDataIsColorDensity = this.params.colorDensity = (this.params.colorRgb == -2147483648 && J.jvxl.readers.XmlReader.getXmlAttrib (data, "colorDensity").equals ("true"));
if (this.jvxlData.jvxlDataIsColorDensity && Float.isNaN (this.params.pointSize)) {
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "pointSize");
if (s.length > 0) this.jvxlData.pointSize = this.params.pointSize = this.parseFloatStr (s);
}s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "allowVolumeRender");
this.jvxlData.allowVolumeRender = this.params.allowVolumeRender = (s.length == 0 || s.equalsIgnoreCase ("true"));
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "plane");
if (s.indexOf ("{") >= 0) {
this.params.thePlane = null;
this.params.mapLattice = null;
try {
this.params.thePlane = J.util.Escape.uP (s);
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "maplattice");
J.util.Logger.info ("JVXL read: plane " + this.params.thePlane);
if (s.indexOf ("{") >= 0) {
this.params.mapLattice = J.util.Escape.uP (s);
J.util.Logger.info ("JVXL read: mapLattice " + this.params.mapLattice);
}if (this.params.scale3d == 0) this.params.scale3d = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "scale3d"));
if (Float.isNaN (this.params.scale3d)) this.params.scale3d = 0;
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
if (this.params.thePlane == null) {
J.util.Logger.error ("JVXL Error reading plane definition -- setting to 0 0 1 0  (z=0)");
this.params.thePlane = JU.P4.new4 (0, 0, 1, 0);
} else {
J.util.Logger.error ("JVXL Error reading mapLattice definition -- ignored");
}} else {
throw e;
}
}
this.surfaceDataCount = 0;
this.edgeDataCount = 0;
} else {
this.params.thePlane = null;
this.surfaceDataCount = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nSurfaceInts"));
this.edgeDataCount = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nBytesUncompressedEdgeData"));
}this.excludedVertexCount = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nExcludedVertexes"));
this.excludedTriangleCount = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nExcludedTriangles"));
this.invalidatedVertexCount = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nInvalidatedVertexes"));
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "slabInfo");
if (s.length > 0) this.jvxlData.slabInfo = s;
this.colorDataCount = Math.max (0, this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "nBytesUncompressedColorData")));
this.jvxlDataIs2dContour = (this.params.thePlane != null && this.jvxlDataIsColorMapped);
this.jvxlData.color = J.jvxl.readers.XmlReader.getXmlAttrib (data, "color");
if (this.jvxlData.color.length == 0 || this.jvxlData.color.indexOf ("null") >= 0) this.jvxlData.color = "orange";
this.jvxlData.translucency = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "translucency"));
if (Float.isNaN (this.jvxlData.translucency)) this.jvxlData.translucency = 0;
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "meshColor");
if (s.length > 0) this.jvxlData.meshColor = s;
s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "rendering");
if (s.length > 0) this.jvxlData.rendering = s;
this.jvxlData.colorScheme = J.jvxl.readers.XmlReader.getXmlAttrib (data, "colorScheme");
if (this.jvxlData.colorScheme.length == 0) this.jvxlData.colorScheme = null;
if (this.jvxlData.thisSet < 0) {
var n = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "set"));
if (n > 0) this.jvxlData.thisSet = n - 1;
}this.jvxlData.slabValue = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "slabValue"));
this.jvxlData.isSlabbable = (J.jvxl.readers.XmlReader.getXmlAttrib (data, "slabbable").equalsIgnoreCase ("true"));
this.jvxlData.diameter = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "diameter"));
if (this.jvxlData.diameter == -2147483648) this.jvxlData.diameter = 0;
if (this.jvxlDataIs2dContour) this.params.isContoured = true;
if (this.params.colorBySign) this.params.isBicolorMap = true;
var insideOut = J.jvxl.readers.XmlReader.getXmlAttrib (data, "insideOut").equals ("true");
var dataMin = NaN;
var dataMax = NaN;
var red = NaN;
var blue = NaN;
if (this.jvxlDataIsColorMapped) {
dataMin = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "dataMinimum"));
dataMax = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "dataMaximum"));
red = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "valueMappedToRed"));
blue = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "valueMappedToBlue"));
if (Float.isNaN (dataMin)) {
dataMin = red = -1.0;
dataMax = blue = 1;
}}this.jvxlSetColorRanges (dataMin, dataMax, red, blue, insideOut);
});
$_M(c$, "jvxlSetColorRanges",
function (dataMin, dataMax, red, blue, insideOut) {
if (this.jvxlDataIsColorMapped) {
if (!Float.isNaN (dataMin) && !Float.isNaN (dataMax)) {
if (dataMax == 0 && dataMin == 0) {
dataMin = -1;
dataMax = 1;
}this.params.mappedDataMin = dataMin;
this.params.mappedDataMax = dataMax;
J.util.Logger.info ("JVXL read: data_min/max " + this.params.mappedDataMin + "/" + this.params.mappedDataMax);
}if (!this.params.rangeDefined) if (!Float.isNaN (red) && !Float.isNaN (blue)) {
if (red == 0 && blue == 0) {
red = -1;
blue = 1;
}this.params.valueMappedToRed = Math.min (red, blue);
this.params.valueMappedToBlue = Math.max (red, blue);
this.params.isColorReversed = (red > blue);
this.params.rangeDefined = true;
} else {
this.params.valueMappedToRed = 0;
this.params.valueMappedToBlue = 1;
this.params.rangeDefined = true;
}J.util.Logger.info ("JVXL read: color red/blue: " + this.params.valueMappedToRed + "/" + this.params.valueMappedToBlue);
}this.jvxlData.valueMappedToRed = this.params.valueMappedToRed;
this.jvxlData.valueMappedToBlue = this.params.valueMappedToBlue;
this.jvxlData.mappedDataMin = this.params.mappedDataMin;
this.jvxlData.mappedDataMax = this.params.mappedDataMax;
this.jvxlData.isColorReversed = this.params.isColorReversed;
this.jvxlData.insideOut = insideOut;
if (this.params.insideOut) this.jvxlData.insideOut = !this.jvxlData.insideOut;
this.params.insideOut = this.jvxlData.insideOut;
}, "~N,~N,~N,~N,~B");
$_V(c$, "readSurfaceData",
function (isMapDataIgnored) {
this.thisInside = !this.params.isContoured;
if (this.readSurfaceDataXML ()) return;
this.tempDataXml = this.xr.getXmlData ("jvxlEdgeData", null, true, false);
this.bsVoxelBitSet = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlEdgeData", this.tempDataXml, false, false));
this.readSurfaceDataJXR ();
}, "~B");
$_M(c$, "readSurfaceDataXML",
function () {
if (this.vertexDataOnly) {
this.getEncodedVertexData ();
return true;
}if (this.params.thePlane != null) {
this.volumeData.setDataDistanceToPlane (this.params.thePlane);
this.setVolumeDataV (this.volumeData);
this.params.cutoff = 0;
this.jvxlData.setSurfaceInfo (this.params.thePlane, this.params.mapLattice, 0, "");
this.jvxlData.scale3d = this.params.scale3d;
return true;
}return false;
});
$_M(c$, "readSurfaceDataJXR",
function () {
this.readSurfaceDataVFR (false);
this.volumeData.setMappingPlane (null);
});
$_M(c$, "jvxlReadFractionData",
function (type, nPoints) {
var str;
try {
if (type.equals ("edge")) {
str = J.jvxl.data.JvxlCoder.jvxlDecompressString (J.jvxl.readers.XmlReader.getXmlAttrib (this.tempDataXml, "data"));
} else {
var data = this.xr.getXmlData ("jvxlColorData", null, true, false);
this.jvxlData.isJvxlPrecisionColor = J.jvxl.readers.JvxlXmlReader.getEncoding (data).endsWith ("2");
str = J.jvxl.data.JvxlCoder.jvxlDecompressString (J.jvxl.readers.XmlReader.getXmlAttrib (data, "data"));
}} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
J.util.Logger.error ("Error reading " + type + " data " + e);
throw  new NullPointerException ();
} else {
throw e;
}
}
return str;
}, "~S,~N");
$_V(c$, "getVoxelBitSet",
function (nPoints) {
if (this.bsVoxelBitSet != null) return this.bsVoxelBitSet;
var bs =  new JU.BS ();
var bsVoxelPtr = 0;
if (this.surfaceDataCount <= 0) return bs;
var nThisValue = 0;
while (bsVoxelPtr < nPoints) {
nThisValue = this.parseInt ();
if (nThisValue == -2147483648) {
this.readLine ();
if (this.line == null || (nThisValue = this.parseIntStr (this.line)) == -2147483648) {
if (!this.endOfData) J.util.Logger.error ("end of file in JvxlReader?" + " line=" + this.line);
this.endOfData = true;
nThisValue = 10000;
}}this.thisInside = !this.thisInside;
++this.jvxlNSurfaceInts;
if (this.thisInside) bs.setBits (bsVoxelPtr, bsVoxelPtr + nThisValue);
bsVoxelPtr += nThisValue;
}
return bs;
}, "~N");
$_V(c$, "getSurfacePointAndFraction",
function (cutoff, isCutoffAbsolute, valueA, valueB, pointA, edgeVector, x, y, z, vA, vB, fReturn, ptReturn) {
if (this.edgeDataCount <= 0) return this.getSPFv (cutoff, isCutoffAbsolute, valueA, valueB, pointA, edgeVector, x, y, z, vA, vB, fReturn, ptReturn);
ptReturn.scaleAdd2 (fReturn[0] = this.jvxlGetNextFraction (this.edgeFractionBase, this.edgeFractionRange, 0.5), edgeVector, pointA);
if (Float.isNaN (this.valueMin)) this.setValueMinMax ();
return (this.valueCount == 0 || this.includeValueNaN && Float.isNaN (fReturn[0]) ? fReturn[0] : this.getNextValue ());
}, "~N,~B,~N,~N,JU.P3,JU.V3,~N,~N,~N,~N,~N,~A,JU.P3");
$_M(c$, "getNextValue",
($fz = function () {
var fraction = NaN;
while (this.colorPtr < this.valueCount && Float.isNaN (fraction)) {
if (this.jvxlData.isJvxlPrecisionColor) {
fraction = J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2 (this.jvxlColorDataRead.charCodeAt (this.colorPtr), this.jvxlColorDataRead.charCodeAt ((this.colorPtr++) + this.valueCount), this.colorFractionBase, this.colorFractionRange);
} else {
fraction = J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter (this.jvxlColorDataRead.charCodeAt (this.colorPtr++), this.colorFractionBase, this.colorFractionRange, 0.5);
}break;
}
return this.valueMin + fraction * this.valueRange;
}, $fz.isPrivate = true, $fz));
$_M(c$, "setValueMinMax",
($fz = function () {
this.valueCount = this.jvxlColorDataRead.length;
if (this.jvxlData.isJvxlPrecisionColor) this.valueCount /= 2;
this.includeValueNaN = (this.valueCount != this.jvxlEdgeDataRead.length);
this.valueMin = (!this.jvxlData.isJvxlPrecisionColor ? this.params.valueMappedToRed : this.params.mappedDataMin == 3.4028235E38 ? 0.0 : this.params.mappedDataMin);
this.valueRange = (!this.jvxlData.isJvxlPrecisionColor ? this.params.valueMappedToBlue : this.params.mappedDataMin == 3.4028235E38 ? 1.0 : this.params.mappedDataMax) - this.valueMin;
this.haveReadColorData = true;
}, $fz.isPrivate = true, $fz));
$_M(c$, "jvxlGetNextFraction",
($fz = function (base, range, fracOffset) {
if (this.fractionPtr >= this.strFractionTemp.length) {
if (!this.endOfData) J.util.Logger.error ("end of file reading compressed fraction data");
this.endOfData = true;
this.strFractionTemp = "" + String.fromCharCode (base);
this.fractionPtr = 0;
}return J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter (this.strFractionTemp.charCodeAt (this.fractionPtr++), base, range, fracOffset);
}, $fz.isPrivate = true, $fz), "~N,~N,~N");
$_V(c$, "readColorData",
function () {
if (!this.jvxlDataIsColorMapped) return "";
var vertexCount = this.jvxlData.vertexCount = this.meshData.vertexCount;
var colixes = this.meshData.vertexColixes;
var vertexValues = this.meshData.vertexValues;
if ("none".equals (this.jvxlColorEncodingRead)) {
this.jvxlData.vertexColors =  Clazz.newIntArray (vertexCount, 0);
var nextc =  Clazz.newIntArray (1, 0);
var n = JU.PT.parseIntNext (this.jvxlColorDataRead, nextc);
n = Math.min (n, vertexCount);
var tokens = JU.PT.getTokens (this.jvxlColorDataRead.substring (nextc[0]));
var haveTranslucent = false;
var trans = this.jvxlData.translucency;
var lastColor = 0;
for (var i = 0; i < n; i++) try {
var c = J.jvxl.readers.JvxlXmlReader.getColor (tokens[i]);
if (c == 0) c = lastColor;
 else lastColor = c;
colixes[i] = J.util.C.getColixTranslucent (this.jvxlData.vertexColors[i] = c);
if (J.util.C.isColixTranslucent (colixes[i])) haveTranslucent = true;
 else if (trans != 0) colixes[i] = J.util.C.getColixTranslucent3 (colixes[i], true, trans);
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
J.util.Logger.info ("JvxlXmlReader: Cannot interpret color code: " + tokens[i]);
} else {
throw e;
}
}

if (haveTranslucent && trans == 0) {
this.jvxlData.translucency = 0.5;
}return "-";
}if (this.params.colorEncoder == null) this.params.colorEncoder =  new J.util.ColorEncoder (null);
this.params.colorEncoder.setColorScheme (null, false);
this.params.colorEncoder.setRange (this.params.valueMappedToRed, this.params.valueMappedToBlue, this.params.isColorReversed);
J.util.Logger.info ("JVXL reading color data mapped min/max: " + this.params.mappedDataMin + "/" + this.params.mappedDataMax + " for " + vertexCount + " vertices." + " using encoding keys " + this.colorFractionBase + " " + this.colorFractionRange);
J.util.Logger.info ("mapping red-->blue for " + this.params.valueMappedToRed + " to " + this.params.valueMappedToBlue + " colorPrecision:" + this.jvxlData.isJvxlPrecisionColor);
var getValues = (Float.isNaN (this.valueMin));
if (getValues) this.setValueMinMax ();
var contourPlaneMinimumValue = 3.4028235E38;
var contourPlaneMaximumValue = -3.4028235E38;
if (colixes == null || colixes.length < vertexCount) this.meshData.vertexColixes = colixes =  Clazz.newShortArray (vertexCount, 0);
var colixNeg = 0;
var colixPos = 0;
if (this.params.colorBySign) {
colixPos = J.util.C.getColix (this.params.isColorReversed ? this.params.colorNeg : this.params.colorPos);
colixNeg = J.util.C.getColix (this.params.isColorReversed ? this.params.colorPos : this.params.colorNeg);
}var vertexIncrement = this.meshData.vertexIncrement;
var needContourMinMax = (this.params.mappedDataMin == 3.4028235E38);
for (var i = 0; i < vertexCount; i += vertexIncrement) {
var value;
if (getValues) value = vertexValues[i] = this.getNextValue ();
 else value = vertexValues[i];
if (needContourMinMax) {
if (value < contourPlaneMinimumValue) contourPlaneMinimumValue = value;
if (value > contourPlaneMaximumValue) contourPlaneMaximumValue = value;
}}
if (needContourMinMax) {
this.params.mappedDataMin = contourPlaneMinimumValue;
this.params.mappedDataMax = contourPlaneMaximumValue;
}if (this.jvxlData.colorScheme != null) for (var i = 0; i < vertexCount; i += vertexIncrement) {
var value = vertexValues[i];
if (this.marchingSquares != null && this.params.isContoured) {
this.marchingSquares.setContourData (i, value);
continue;
}var colix = (!this.params.colorBySign ? this.params.colorEncoder.getColorIndex (value) : (this.params.isColorReversed ? value > 0 : value <= 0) ? colixNeg : colixPos);
colixes[i] = J.util.C.getColixTranslucent3 (colix, true, this.jvxlData.translucency);
}
return this.jvxlColorDataRead + "\n";
});
c$.getColor = $_M(c$, "getColor",
($fz = function (c) {
var n = 0;
try {
switch (c.charAt (0)) {
case '[':
n = JU.CU.getArgbFromString (c);
break;
case '0':
n = JU.PT.parseIntRadix (c.substring (2), 16);
break;
default:
n = JU.PT.parseIntRadix (c, 10);
}
} catch (e) {
if (Clazz.exceptionOf (e, Exception)) {
} else {
throw e;
}
}
return n;
}, $fz.isPrivate = true, $fz), "~S");
$_M(c$, "getEncodedVertexData",
function () {
var sdata = this.xr.getXmlData ("jvxlSurfaceData", null, true, false);
this.jvxlDecodeVertexData (this.xr.getXmlData ("jvxlVertexData", sdata, true, false), false);
var tData = this.xr.getXmlData ("jvxlTriangleData", sdata, true, false);
var edgeData = this.xr.getXmlData ("jvxlTriangleEdgeData", sdata, true, false);
var polygonColorData = this.xr.getXmlData ("jvxlPolygonColorData", sdata, false, false);
this.jvxlDecodeTriangleData (tData, edgeData, polygonColorData);
var cData = this.xr.getXmlData ("jvxlColorData", sdata, true, false);
this.jvxlColorEncodingRead = J.jvxl.readers.JvxlXmlReader.getEncoding (cData);
this.jvxlData.isJvxlPrecisionColor = this.jvxlColorEncodingRead.endsWith ("2");
cData = this.getData (cData, "jvxlColorData");
this.jvxlColorDataRead = (this.jvxlColorEncodingRead.equals ("none") ? cData : J.jvxl.data.JvxlCoder.jvxlDecompressString (cData));
this.jvxlDataIsColorMapped = ((this.params.colorRgb == -2147483648 || this.params.colorRgb == 2147483647) && this.jvxlColorDataRead.length > 0);
if (this.haveContourData) this.jvxlDecodeContourData (this.jvxlData, this.xr.getXmlData ("jvxlContourData", null, false, false));
});
$_M(c$, "getData",
($fz = function (sdata, name) {
var data = J.jvxl.readers.XmlReader.getXmlAttrib (sdata, "data");
if (data.length == 0) data = this.xr.getXmlData (name, sdata, false, false);
return data;
}, $fz.isPrivate = true, $fz), "~S,~S");
c$.getEncoding = $_M(c$, "getEncoding",
($fz = function (data) {
if (J.jvxl.readers.XmlReader.getXmlAttrib (data, "len").length > 0) return "";
var s = J.jvxl.readers.XmlReader.getXmlAttrib (data, "encoding");
return (s.length == 0 ? "none" : s);
}, $fz.isPrivate = true, $fz), "~S");
$_M(c$, "jvxlDecodeVertexData",
function (data, asArray) {
var vertexCount = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (data, "count"));
if (!asArray) J.util.Logger.info ("Reading " + vertexCount + " vertices");
var ptCount = vertexCount * 3;
var vertices = (asArray ?  new Array (vertexCount) : null);
var p = (asArray ? null :  new JU.P3 ());
var fraction;
var vData = J.jvxl.readers.XmlReader.getXmlAttrib (data, "data");
var encoding = J.jvxl.readers.JvxlXmlReader.getEncoding (data);
if ("none".equals (encoding)) {
if (vData.length == 0) vData = this.xr.getXmlData ("jvxlVertexData", data, false, false);
var fdata = JU.PT.parseFloatArray (vData);
if (fdata[0] != vertexCount * 3) J.util.Logger.info ("JvxlXmlReader: vertexData count=" + (Clazz.floatToInt (fdata[0])) + "; expected " + (vertexCount * 3));
for (var i = 0, pt = 1; i < vertexCount; i++) {
p = JU.P3.new3 (fdata[pt++], fdata[pt++], fdata[pt++]);
if (asArray) vertices[i] = p;
 else this.addVertexCopy (p, 0, i);
}
} else {
var min = this.xr.getXmlPoint (data, "min");
var range = this.xr.getXmlPoint (data, "max");
range.sub (min);
var colorFractionBase = this.jvxlData.colorFractionBase;
var colorFractionRange = this.jvxlData.colorFractionRange;
var s = J.jvxl.data.JvxlCoder.jvxlDecompressString (vData);
if (s.length == 0) s = this.xr.getXmlData ("jvxlVertexData", data, false, false);
for (var i = 0, pt = -1; i < vertexCount; i++) {
if (asArray) p = vertices[i] =  new JU.P3 ();
fraction = J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2 (s.charCodeAt (++pt), s.charCodeAt (pt + ptCount), colorFractionBase, colorFractionRange);
p.x = min.x + fraction * range.x;
fraction = J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2 (s.charCodeAt (++pt), s.charCodeAt (pt + ptCount), colorFractionBase, colorFractionRange);
p.y = min.y + fraction * range.y;
fraction = J.jvxl.data.JvxlCoder.jvxlFractionFromCharacter2 (s.charCodeAt (++pt), s.charCodeAt (pt + ptCount), colorFractionBase, colorFractionRange);
p.z = min.z + fraction * range.z;
if (!asArray) this.addVertexCopy (p, 0, i);
}
}return vertices;
}, "~S,~B");
$_M(c$, "jvxlDecodeTriangleData",
function (tdata, edgeData, colorData) {
var nTriangles = this.parseIntStr (J.jvxl.readers.XmlReader.getXmlAttrib (tdata, "count"));
if (nTriangles < 0) return;
var nextc =  Clazz.newIntArray (1, 0);
var nColors = (colorData == null ? -1 : JU.PT.parseIntNext (colorData, nextc));
var color = 0;
J.util.Logger.info ("Reading " + nTriangles + " triangles");
var encoding = J.jvxl.readers.JvxlXmlReader.getEncoding (tdata);
tdata = this.getData (tdata, "jvxlTriangleData");
var edata = this.getData (edgeData, "jvxlTriangleEdgeData");
var vertex =  Clazz.newIntArray (3, 0);
var nextp =  Clazz.newIntArray (1, 0);
var nexte = null;
var edgeMask = 7;
var haveEdgeInfo;
var haveEncoding = !"none".equals (encoding);
if (haveEncoding) {
tdata = J.jvxl.data.JvxlCoder.jvxlDecompressString (tdata);
edata = J.jvxl.data.JvxlCoder.jvxlDecompressString (edata).trim ();
haveEdgeInfo = (edata.length == nTriangles);
} else {
var n = JU.PT.parseIntNext (tdata, nextp);
haveEdgeInfo = (edata.length > 0);
if (haveEdgeInfo) {
nexte =  Clazz.newIntArray (1, 0);
JU.PT.parseIntNext (edata, nexte);
} else if (n > 0) {
J.util.Logger.info ("JvxlXmlReader: jvxlTriangleEdgeData count=" + n + "; expected " + nTriangles);
}}for (var i = 0, v = 0, p = 0, pt = -1; i < nTriangles; ) {
if (haveEncoding) {
var ch = tdata.charAt (++pt);
var diff;
switch (ch) {
case '!':
diff = 0;
break;
case '+':
case '.':
case ' ':
case '\n':
case '\r':
case '\t':
case ',':
continue;
case '-':
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
nextp[0] = pt;
diff = JU.PT.parseIntNext (tdata, nextp);
pt = nextp[0] - 1;
break;
default:
diff = ch.charCodeAt (0) - 92;
}
v += diff;
} else {
v = JU.PT.parseIntNext (tdata, nextp) - 1;
}vertex[p] = v;
if (++p == 3) {
p = 0;
if (haveEdgeInfo) {
edgeMask = (nexte == null ? edata.charCodeAt (i) - 48 : JU.PT.parseIntNext (edata, nexte));
if (edgeMask < 0 || edgeMask > 7) edgeMask = 7;
}if (nColors > 0) {
var c = JU.PT.parseIntNext (colorData, nextc);
if (c == -2147483648) nColors = 0;
 else color = c;
nColors--;
}this.addTriangleCheck (vertex[0], vertex[1], vertex[2], edgeMask, 0, false, color);
i++;
}}
}, "~S,~S,~S");
$_M(c$, "jvxlDecodeContourData",
function (jvxlData, data) {
var vs =  new JU.List ();
var values =  new JU.SB ();
var colors =  new JU.SB ();
var pt = -1;
jvxlData.vContours = null;
if (data == null) return;
while ((pt = data.indexOf ("<jvxlContour", pt + 1)) >= 0) {
var v =  new JU.List ();
var s = this.xr.getXmlData ("jvxlContour", data.substring (pt), true, false);
var value = this.parseFloatStr (J.jvxl.readers.XmlReader.getXmlAttrib (s, "value"));
values.append (" ").appendF (value);
var color = J.jvxl.readers.JvxlXmlReader.getColor (J.jvxl.readers.XmlReader.getXmlAttrib (s, "color"));
var colix = J.util.C.getColix (color);
colors.append (" ").append (J.util.Escape.escapeColor (color));
var fData = J.jvxl.data.JvxlCoder.jvxlDecompressString (J.jvxl.readers.XmlReader.getXmlAttrib (s, "data"));
var bs = J.jvxl.data.JvxlCoder.jvxlDecodeBitSet (this.xr.getXmlData ("jvxlContour", s, false, false));
var n = bs.length ();
J.shapesurface.IsosurfaceMesh.setContourVector (v, n, bs, value, colix, color, JU.SB.newS (fData));
vs.addLast (v);
}
var n = vs.size ();
if (n > 0) {
jvxlData.vContours = JU.AU.createArrayOfArrayList (n);
jvxlData.contourColixes = this.params.contourColixes =  Clazz.newShortArray (n, 0);
jvxlData.contourValues = this.params.contoursDiscrete =  Clazz.newFloatArray (n, 0);
for (var i = 0; i < n; i++) {
jvxlData.vContours[i] = vs.get (i);
jvxlData.contourValues[i] = (jvxlData.vContours[i].get (2)).floatValue ();
jvxlData.contourColixes[i] = (jvxlData.vContours[i].get (3))[0];
}
jvxlData.contourColors = J.util.C.getHexCodes (jvxlData.contourColixes);
J.util.Logger.info ("JVXL read: " + n + " discrete contours");
J.util.Logger.info ("JVXL read: contour values: " + values);
J.util.Logger.info ("JVXL read: contour colors: " + colors);
}}, "J.jvxl.data.JvxlData,~S");
$_V(c$, "postProcessVertices",
function () {
var bsInvalid = this.params.bsExcluded[1];
if (bsInvalid != null) {
if (this.meshDataServer != null) this.meshDataServer.fillMeshData (this.meshData, 1, null);
this.meshData.invalidateVertices (bsInvalid);
if (this.meshDataServer != null) {
this.meshDataServer.fillMeshData (this.meshData, 4, null);
this.meshData =  new J.jvxl.data.MeshData ();
}this.updateTriangles ();
}});
});


text:
package rapanui.ui.commands;

import rapanui.core.Application;

public class CreateEnvironmentCommand extends AbstractCommand {
	private static final long serialVersionUID = 1L;

	private final Application app;

	public CreateEnvironmentCommand(Application app) {
		super("\u2A01", "Neuen Beweis starten");
		this.app = app;
	}

	@Override
	public void execute() {
		app.createEnvironment();
	}

	@Override
	protected boolean canExecute() { return true; }
}


text:
<!DOCTYPE html>

        <meta charset="UTF-8">
        <title>Kids Distro</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>

        <link href="<?php echo base_url('assets/css/bootstrap.min.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/font-awesome.min.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/ionicons.min.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/morris/morris.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/jvectormap/jquery-jvectormap-1.2.2.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/fullcalendar/fullcalendar.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/daterangepicker/daterangepicker-bs3.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css'); ?>" rel="stylesheet" type="text/css" />

        <link href="<?php echo base_url('assets/css/AdminLTE.css'); ?>" rel="stylesheet" type="text/css" />

                Pina_B&KD

                    Toggle navigation

                                4

You have 4 messages

                                                    <img src="<?php echo base_url('assets/img/avatar3.png'); ?>" class="img-circle" alt="User Image"/>

                                                    Support Team
                                                     5 mins

Why not buy a new awesome theme?

                                                    <img src="<?php echo base_url('assets/img/avatar2.png'); ?>" class="img-circle" alt="user image"/>

                                                    AdminLTE Design Team
                                                     2 hours

Why not buy a new awesome theme?

                                                    <img src="<?php echo base_url('assets/img/avatar.png'); ?>" class="img-circle" alt="user image"/>

                                                    Developers
                                                     Today

Why not buy a new awesome theme?

                                                    <img src="<?php echo base_url('assets/img/avatar2.png'); ?>" class="img-circle" alt="user image"/>

                                                    Sales Department
                                                     Yesterday

Why not buy a new awesome theme?

                                                    <img src="<?php echo base_url('assets/img/avatar.png'); ?>" class="img-circle" alt="user image"/>

                                                    Reviewers
                                                     2 days

Why not buy a new awesome theme?

See All Messages

                                10

You have 10 notifications

                                                 5 new members joined today

                                                 Very long description here that may not fit into the page and may cause design problems

                                                 5 new members joined

                                                 25 sales made

                                                 You changed your username

View all

                                9

You have 9 tasks

                                                    Design some buttons
                                                    20%

                                                        20% Complete

                                                    Create a nice theme
                                                    40%

                                                        40% Complete

                                                    Some task I need to do
                                                    60%

                                                        60% Complete

                                                    Make beautiful transitions
                                                    80%

                                                        80% Complete

                                    View all tasks

                                <?php echo $this->session->userdata('name'); ?>

                                    <img src="<?php echo base_url('assets/img/avatar3.png'); ?>" class="img-circle" alt="User Image" />

                                        <?php echo $this->session->userdata('name'); ?>

                                        <a href="<?php echo base_url('index.php/Login_controller/logout'); ?>" class="btn btn-default btn-flat">Sign out


text:
BOX_VERSION ?= $(shell cat VERSION)
BOX_SUFFIX := -$(BOX_VERSION).box
BUILDER_TYPES ?= vmware virtualbox parallels
TEMPLATE_FILENAMES := $(filter-out debian.json,$(wildcard *.json))
BOX_NAMES := $(basename $(TEMPLATE_FILENAMES))
BOX_FILENAMES := $(TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX))
VMWARE_BOX_DIR ?= box/vmware
VMWARE_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES)
VMWARE_BOX_FILENAMES := $(VMWARE_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX))
VMWARE_BOX_FILES := $(foreach box_filename, $(VMWARE_BOX_FILENAMES), $(VMWARE_BOX_DIR)/$(box_filename))
VIRTUALBOX_BOX_DIR ?= box/virtualbox
VIRTUALBOX_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES)
VIRTUALBOX_BOX_FILENAMES := $(VIRTUALBOX_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX))
VIRTUALBOX_BOX_FILES := $(foreach box_filename, $(VIRTUALBOX_BOX_FILENAMES), $(VIRTUALBOX_BOX_DIR)/$(box_filename))
PARALLELS_BOX_DIR ?= box/parallels
PARALLELS_TEMPLATE_FILENAMES = $(TEMPLATE_FILENAMES)
PARALLELS_BOX_FILENAMES := $(PARALLELS_TEMPLATE_FILENAMES:.json=$(BOX_SUFFIX))
PARALLELS_BOX_FILES := $(foreach box_filename, $(PARALLELS_BOX_FILENAMES), $(PARALLELS_BOX_DIR)/$(box_filename))
BOX_FILES := $(VMWARE_BOX_FILES) $(VIRTUALBOX_BOX_FILES) $(PARALLELS_BOX_FILES)
ISO_FILES := $(shell sed -nE 's/^.*iso_name.*:\s*"([^"]+\.iso)".*$$/iso\/\1/p' $(TEMPLATE_FILENAMES))

box/vmware/%$(BOX_SUFFIX) box/virtualbox/%$(BOX_SUFFIX) box/parallels/%$(BOX_SUFFIX): %.json
	bin/box build $<

.PHONY: all clean isos assure deliver assure_atlas assure_atlas_vmware assure_atlas_virtualbox assure_atlas_parallels

all: isos build assure deliver

iso/%.iso:
	mkdir -p iso
	@cd iso && ( \
		CURRENT_URL="http://cdimage.debian.org/debian-cd/$(shell echo "$@" | cut -d- -f2,3 --output-delimiter=/)/jigdo-dvd/$(notdir $(basename $@)).jigdo" ; \
		ARCHIVE_URL="http://cdimage.debian.org/mirror/cdimage/archive/$(shell echo "$@" | cut -d- -f2,3 --output-delimiter=/)/jigdo-dvd/$(notdir $(basename $@)).jigdo" ; \
		\
		if curl -sfI "$$CURRENT_URL" >/dev/null ; then \
			URL="$$CURRENT_URL" ; \
		else \
			URL="$$ARCHIVE_URL" ; \
		fi ; \
		jigdo-lite --noask "$$URL" ; \
	)

isos: $(ISO_FILES)

build: $(BOX_FILES)

assure: assure_vmware assure_virtualbox assure_parallels

assure_vmware: $(VMWARE_BOX_FILES)
	@for vmware_box_file in $(VMWARE_BOX_FILES) ; do \
		echo Checking $$vmware_box_file ; \
		bin/box test $$vmware_box_file vmware ; \
	done

assure_virtualbox: $(VIRTUALBOX_BOX_FILES)
	@for virtualbox_box_file in $(VIRTUALBOX_BOX_FILES) ; do \
		echo Checking $$virtualbox_box_file ; \
		bin/box test $$virtualbox_box_file virtualbox ; \
	done

assure_parallels: $(PARALLELS_BOX_FILES)
	@for parallels_box_file in $(PARALLELS_BOX_FILES) ; do \
		echo Checking $$parallels_box_file ; \
		bin/box test $$parallels_box_file parallels ; \
	done

assure_atlas: assure_atlas_vmware assure_atlas_virtualbox assure_atlas_parallels

assure_atlas_vmware:
	@for box_name in $(BOX_NAMES) ; do \
		echo Checking $$box_name ; \
		bin/test-vagrantcloud-box box-cutter/$$box_name vmware ; \
		bin/test-vagrantcloud-box boxcutter/$$box_name vmware ; \
	done

assure_atlas_virtualbox:
	@for box_name in $(BOX_NAMES) ; do \
		echo Checking $$box_name ; \
		bin/test-vagrantcloud-box box-cutter/$$box_name virtualbox ; \
		bin/test-vagrantcloud-box boxcutter/$$box_name virtualbox ; \
	done

assure_atlas_parallels:
	@for box_name in $(BOX_NAME) ; do \
		echo Checking $$box_name ; \
		bin/test-vagrantcloud-box box-cutter/$$box_name parallels ; \
		bin/test-vagrantcloud-box boxcutter/$$box_name parallels ; \
	done

deliver:
	@for box_name in $(BOX_NAMES) ; do \
		echo Uploading $$box_name to Atlas ; \
		bin/register_atlas.sh $$box_name $(BOX_SUFFIX) $(BOX_VERSION) ; \
	done

clean:
	@for builder in $(BUILDER_TYPES) ; do \
		echo Deleting output-*-$$builder-iso ; \
		echo rm -rf output-*-$$builder-iso ; \
	done
	@for builder in $(BUILDER_TYPES) ; do \
		if test -d box/$$builder ; then \
			echo Deleting box/$$builder/*.box ; \
			find box/$$builder -maxdepth 1 -type f -name "*.box" ! -name .gitignore -exec rm '{}' \; ; \
		fi ; \
	done
	@if [ -L iso ] ; then \
		echo "NOT deleting iso (it is a symlink)" ; \
	else \
		echo rm -rf iso ; \
		rm -rf iso ; \
	fi ;


text:
#include "pe/pe.h"

#include <cstring>

PEFile::PEFile(const uint8_t* buf, size_t length) : buf(buf), length(length) {
    memset(pdbSignature, 0, sizeof(pdbSignature) / sizeof(*pdbSignature));

    _init();
}

void PEFile::_init() {
    const uint8_t* p   = buf;
    const uint8_t* end = buf + length;

    if (p + sizeof(IMAGE_DOS_HEADER) >= end)
        throw InvalidImage("missing DOS header");

    dosHeader = (IMAGE_DOS_HEADER*)p;
    if (dosHeader->e_magic != IMAGE_DOS_SIGNATURE)
        throw InvalidImage("invalid DOS signature");

    // Skip to the NT headers. Note that we don't parse this section as
    // IMAGE_NT_HEADERS32/IMAGE_NT_HEADERS64 because we don't yet know if this
    // image is 32- or 64-bit. That information is in the first field of the
    // optional header.
    p += dosHeader->e_lfanew;

    //
    // Check the signature
    //
    if (p + sizeof(uint32_t) >= end) throw InvalidImage("missing PE signature");

    const uint32_t signature = *(uint32_t*)p;
    if (signature != *(const uint32_t*)"PE\0\0")
        throw InvalidImage("invalid PE signature");

    p += sizeof(signature);

    //
    // Parse the image file header
    //
    if (p + sizeof(IMAGE_FILE_HEADER) >= end)
        throw InvalidImage("missing IMAGE_FILE_HEADER");

    fileHeader = (IMAGE_FILE_HEADER*)p;

    p += sizeof(IMAGE_FILE_HEADER);

    //
    // The optional header is here. Parsing of this is delayed because it can
    // either be a 32- or 64-bit structure.
    //
    _optional = p;

    p += fileHeader->SizeOfOptionalHeader;

    //
    // Section headers. There are IMAGE_FILE_HEADER.NumberOfSections of these.
    //
    sectionHeaders = (IMAGE_SECTION_HEADER*)p;
}

const uint8_t* PEFile::translate(size_t rva) const {
    const IMAGE_SECTION_HEADER* s = sectionHeaders;

    for (size_t i = 0; i < fileHeader->NumberOfSections; ++i) {
        if (rva >= s->VirtualAddress &&
            rva < s->VirtualAddress + s->Misc.VirtualSize)
            break;

        ++s;
    }

    return buf + rva - s->VirtualAddress + s->PointerToRawData;
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html/4/loose.dtd">

<title>GLEW: The OpenGL Extension Wrangler Library</title>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<link href="glew.css" type="text/css" rel="stylesheet">

Latest Release: 1.6.0

Download

Installation

Basic Usage

Advanced Usage

Credits & Copyright

Change Log

Project Page

Mailing Lists

Bug Tracker

Last Update: 04-27-11

The OpenGL Extension Wrangler Library

Installation

To use the shared library version of GLEW, you need to copy the
headers and libraries into their destination directories. On Windows
this typically boils down to copying:

<tt>bin/glew32.dll</tt>	    to
<tt>%SystemRoot%/system32</tt>

<tt>lib/glew32.lib</tt>	    to
<tt>{VC Root}/Lib</tt>

<tt>include/GL/glew.h</tt>	    to
<tt>{VC Root}/Include/GL</tt>

<tt>include/GL/wglew.h</tt>	    to
<tt>{VC Root}/Include/GL</tt>

where <tt>{VC Root}</tt> is the Visual C++ root directory, typically
<tt>C:/Program Files/Microsoft Visual Studio/VC98</tt> for Visual
Studio 6.0 or <tt>C:/Program Files/Microsoft Visual
Studio .NET 2003/Vc7/PlatformSDK</tt> for Visual Studio .NET.

On Unix, typing <tt>make install</tt> will attempt to install GLEW
into <tt>/usr/include/GL</tt> and <tt>/usr/lib</tt>.  You can
customize the installation target via the <tt>GLEW_DEST</tt>
environment variable if you do not have write access to these
directories.

Building Your Project with GLEW

There are two ways to build your project with GLEW.

Including the source files / project file

The simpler but less flexible way is to include <tt>glew.h</tt> and
<tt>glew.c</tt> into your project.  On Windows, you also need to
define the <tt>GLEW_STATIC</tt> preprocessor token when building a
static library or executable, and the <tt>GLEW_BUILD</tt> preprocessor
token when building a dll.  You also need to replace
<tt><GL/gl.h></tt> and <tt><GL/glu.h></tt> with
<tt><glew.h></tt> in your code and set the appropriate include
flag (<tt>-I</tt>) to tell the compiler where to look for it.  For
example:

#include <glew.h>

#include <GL/glut.h>

<gl, glu, and glut functionality is available here>

Depending on where you put <tt>glew.h</tt> you may also need to change
the include directives in <tt>glew.c</tt>. Note that if you are using
GLEW together with GLUT, you have to include <tt>glew.h</tt> first.
In addition, <tt>glew.h</tt> includes <tt>glu.h</tt>, so you do not
need to include it separately.

On Windows, you also have the option of adding the supplied project
file <tt>glew_static.dsp</tt> to your workspace (solution) and compile
it together with your other projects.  In this case you also need to
change the <tt>GLEW_BUILD</tt> preprocessor constant to
<tt>GLEW_STATIC</tt> when building a static library or executable,
otherwise you get build errors.

Note that GLEW does not use the C
runtime library, so it does not matter which version (single-threaded,
multi-threaded or multi-threaded DLL) it is linked with (without
debugging information). It is, however, always a good idea to compile all
your projects including GLEW with the same C runtime settings.

Using GLEW as a shared library

Alternatively, you can use the provided project files / makefile to
build a separate shared library you can link your projects with later.
In this case the best practice is to install <tt>glew.h</tt>,
<tt>glew32.lib</tt>, and <tt>glew32.dll</tt> / <tt>libGLEW.so</tt> to
where the OpenGL equivalents <tt>gl.h</tt>, <tt>opengl32.lib</tt>, and
<tt>opengl32.dll</tt> / <tt>libGL.so</tt> are located.  Note that you
need administrative privileges to do this.  If you do not have
administrator access and your system administrator will not do it for
you, you can install GLEW into your own lib and include subdirectories
and tell the compiler where to find it. Then you can just replace
<tt><GL/gl.h></tt> with <tt><GL/glew.h></tt> in your
program:

#include <GL/glew.h>

#include <GL/glut.h>

<gl, glu, and glut functionality is available here>

or:

#include <GL/glew.h>

<gl and glu functionality is available here>

Remember to link your project with <tt>glew32.lib</tt>,
<tt>glu32.lib</tt>, and <tt>opengl32.lib</tt> on Windows and
<tt>libGLEW.so</tt>, <tt>libGLU.so</tt>, and <tt>libGL.so</tt> on
Unix (<tt>-lGLEW -lGLU -lGL</tt>).

It is important to keep in mind that <tt>glew.h</tt> includes neither
<tt>windows.h</tt> nor <tt>gl.h</tt>.  Also, GLEW will warn you by
issuing a preprocessor error in case you have included <tt>gl.h</tt>,
<tt>glext.h</tt>, or <tt>glATI.h</tt> before <tt>glew.h</tt>.


text:
<!DOCTYPE html>

    <title>Etapa de Generación - Rubinius</title>
  	<meta charset="UTF-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta content='es' http-equiv='content-language'>
    <meta content='Rubinius is an implementation of the Ruby programming language. The Rubinius bytecode virtual machine is written in C++. The bytecode compiler is written in pure Ruby. The vast majority of the core library is also written in Ruby, with some supporting primitives that interact with the VM directly.' name='description'>
    <link href='/' rel='home'>
    <link href='/' rel='start'>
    <link href='/doc/es/bytecode-compiler/ast' rel='prev' title='AST'>
    <link href='/doc/es/bytecode-compiler/encoder'         rel='next' title='Etapa de Codificación'>

    <link href="/stylesheets/blueprint/screen.css" media="screen" rel="stylesheet" />
    <link href="/stylesheets/application.css"      media="screen" rel="stylesheet" />
    <link href="/stylesheets/blueprint/print.css"  media="print"  rel="stylesheet" />

    <link href="/stylesheets/pygments.css" media="screen" rel="stylesheet" />

    <link href="/favicon.ico"                 rel="shortcut icon"    type="image/vnd.microsoft.icon" />
    <link href="/images/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" />
    <link href="/images/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" sizes="72x72"   />
    <link href="/images/apple-touch-icon.png" rel="apple-touch-icon" type="image/png" sizes="114x114" />

Home

Blog

Documentation

Projects

Roadmap

Releases

    1.2.4

  Idiomas:

de

en

es

fr

it

ja

pl

pt-br

ru

    Anterior:
    AST

    Subir:
    Tabla de Contenido

    Siguiente:
    Etapa de Codificación

Etapa de Generación

This topic has missing or partial documentation. Please help us improve it.

    See How-To - Write Documentation

Una vez que Melbourne ha creado un AST, invoca la etapa de generación, con el
AST como entrada.

La etapa de generación crea una nueva instancia de Rubinius::Generator y le
comunica a la raíz del AST que genere su bytecode en el objeto Generator.

Un Generator dispone de un DSL escrito en Ruby para generar bytecode de
Rubinius. En su interior, el generador expone métodos que son un reflejo
directo de las Instrucciones de
Rubinius. Por ejemplo, para crear una
instrucción que añada un nil a la pila, se podría llamar el método push_nil
en una instancia de Generator.

La clase Generator expone también ciertos métodos convenientes que permiten
generar patrones comunes de bytecode sin tener que preocuparse por detalles a
demasiado bajo nivel de algunas áreas del conjunto de instrucciones de
Rubinius.

Por ejemplo, para llamar a un método directamente directamente utilizando
bytecode de Rubinius, se debe crear primero un literal representando el
nombre del método, y entonces llamar send_stack para llamar al método.
Además, si se quiere llamar a un método privado, habría primero que crear un
bytecode que permite específicamente la invocación de métodos privados. Si se
quisiera invocar el método puts sin argumentos, permitiendo la invocación de
métodos privados, habría que hacer lo siguiente:

# aquí, g es una instancia de Generator
g.allow_private
name = find_literal(:puts)
g.send_stack name, 0

Utilizar el método auxiliar send simplifica bastante el código anterior:

g.send :puts, 0, true

Cuando se genera bytecode para un AST, Rubinius invoca el método bytecode
en cada nodo del AST con un argumento: la instancia actual de Generator. He
aquí la implementación del método bytecode para el nodo if:

def bytecode(g)
  pos(g)

  done = g.new_label
  else_label = g.new_label

  @condition.bytecode(g)
  g.gif else_label

  @body.bytecode(g)
  g.goto done

  else_label.set!
  @else.bytecode(g)

  done.set!
end

En primer lugar, el método llama al método pos, un método en la superclase
Node que llama a su vez g.set_line @line. Esto sirve a la máquina virtual
a la hora de proveer información de debugging sobre el código que ejecutamos.

A continuación, el código utiliza los métodos auxiliares para tratar con
etiquetas. Las instrucciones de Rubinius no tienen ningúna estructura de
control de flujo excepto por algunas instrucciones “goto” (goto,
goto_if_true y goto_if_false). Se puede usar la forma corta git para
goto_if_true y gif para goto_if_false. En este caso creamos dos
etiquetas nuevas: una para el final de la condición del if y otra que marca
el comienzo del bloque else.

Después de crear las dos etiquetas, el nodo if invoca el método bytecode
en su nodo hijo @condition, pasándole el actual objeto Generator. Esto
emitirá el bytecode para la condición del if en el flujo de instrucciones
actual.

Ese proceso debería dejar en la pila el valor que haya resultado de evaluar la
condición, de modo que si el nodo if emite una instrucción goto_if_false,
saltará inmediatamente a la etiqueta else_label. Entonces usa el mismo
patrón que hemos visto anteriormente para pedir al @body que emita su
bytecode en el flujo de instrucciones actual, y entonces emite un goto
incondicional hasta el final de todo el if (su último end).

A continuación necesitamos marcar la posición del else_label. Desacoplando
la creación de la etiqueta respecto a su uso, podemos pasársela a la
instrucción goto antes de marcar dónde está, requerimiento crucial para
ciertas estructuras de control.

Pedimos entonces al nodo @else que emita su bytecode y marcamos la
posición de la etiqueta done.

Este proceso ocurre recursivamente desde el nodo raíz a través de todo el
AST, lo cual popula el objeto Generator con una representación en bytecode
del AST original empezando desde su raíz.

Probablemente es útil echarle un vistazo a las clases dentro del directorio
lib/compiler/ast, donde están definidos todos los nodos AST y sus
respectivos métodos bytecode. Es una buena forma también de ver ejemplos
prácticos de uso de la API del Generator.

Una vez el Generator ha conseguido la representación en bytecode del AST,
invoca la siguiente etapa del compilador: la etapa de Codificación.

Ficheros mencionados

lib/compiler/generator_methods.rb: Fichero generado que contiene
“wrappers” alrededor de instrucciones de Rubinius. Estos métodos son un
reflejo directo de dichas
instrucciones.

lib/compiler/generator.rb: La definición del objeto Generator. Esta
clase contiene tanto los métodos “crudos” del generador como también algunas
APIs de alto nivel para generar patrones comunes de bytecode.

lib/compiler/ast: La definición de todos los nodos AST creados por la
etapa de Parsing del compilador.

Personalización

La forma más sencilla de personalizar la etapa de Generación del proceso de
compilación es creando métodos de alto nivel complementando los comunes ya
provistos por la implementación por defecto del Generator.

También se puede personalizar la clase del Generador que queremos utilizar.
Para aprender más sobre cómo personalizar determinadas etapas del compilador,
léase Personalizando las etapas.

    Anterior:
    AST

    Subir:
    Tabla de Contenido

    Siguiente:
    Etapa de Codificación

Please enable JavaScript to view the comments powered by Disqus.

Follow Rubinius on Twitter

Fork Rubinius on github

An Engine Yard project


text:
import inspect

from pycket       import values
from pycket.error import SchemeException
from rpython.rlib import jit, objectmodel, unroll
from rpython.rlib.objectmodel import specialize

class EndOfInput(Exception):
    pass

class ArgParser(object):

    _attrs_ = ['context', 'args', 'index']
    _immutable_fields_ = ['context', 'args']

    def __init__(self, context, args, start_at=0):
        assert start_at >= 0
        self.context = context
        self.args    = args
        self.index   = start_at

    def __nonzero__(self):
        return self.has_more()

    def has_more(self):
        return 0 <= self.index < len(self.args)

    def next(self):
        if not self.has_more():
            raise EndOfInput
        index = self.index
        val = self.args[index]
        return val

    @specialize.arg(1)
    def expect(self, *args):
        val = self.next()
        if validate_arg(val, *args):
            self.index += 1
            return val
        raise SchemeException(
                "%s: expected %s at argument %d got %s" %
                (self.context, errorname(*args), self.index, val.tostring()))

    @specialize.arg(1)
    @jit.unroll_safe
    def expect_many(self, *args):
        length = len(self.args) - self.index
        results = [None] * length
        for i in range(length):
            results[i] = self.expect(*args)
        return results

def is_constant_class(cls):
    return inspect.isclass(cls)

@specialize.arg(1)
def validate_arg(value, arg, *args):
    if is_constant_class(arg):
        if isinstance(value, arg):
            return True
    elif value is arg:
        return True

    return bool(args) and validate_arg(value, *args)

@specialize.arg(0)
def _errorname(arg, *args):
    if is_constant_class(arg):
        retval = arg.errorname
    else:
        retval = arg.tostring()
    if not args:
        return retval
    else:
        return retval + " " + _errorname(*args)

@specialize.arg(0)
def errorname(arg, *args):
    if not args:
        return _errorname(arg)
    return "(or/c %s)" % _errorname(arg, *args)

from rpython.rtyper.extregistry import ExtRegistryEntry

class Entry(ExtRegistryEntry):
    _about_ = is_constant_class

    def compute_result_annotation(self, s_cls):
        from rpython.annotator.model import SomeBool, SomePBC, SomeInstance
        r = SomeBool()
        assert s_cls.is_constant()
        if isinstance(s_cls, SomePBC):
            r.const = inspect.isclass(s_cls.const)
        elif isinstance(s_cls, SomeInstance):
            r.const = False
        else:
            assert False
        return r

    def specialize_call(self, hop):
        from rpython.rtyper.lltypesystem import lltype
        hop.exception_cannot_occur()
        return hop.inputconst(lltype.Bool, hop.s_result.const)


text:
package com.google.api.client.googleapis.notifications;

import com.google.api.client.http.HttpMediaType;
import com.google.api.client.util.Beta;
import com.google.api.client.util.ObjectParser;
import com.google.api.client.util.Preconditions;

import java.io.IOException;
import java.nio.charset.Charset;

/**
 * {@link Beta}

 * Callback to receive notifications for watched resource in which the . Callback which is used to
 * receive typed {@link AbstractNotification}s after subscribing to a topic.
 *
 *

 * Must NOT be implemented in form of an anonymous class as this will break serialization.
 *

 *
 *

 * Implementation should be thread-safe.
 *

 *
 * Example usage:
 *
 *

  static class MyNotificationCallback
      extends JsonNotificationCallback{@literal <}ListResponse{@literal >} {

    private static final long serialVersionUID = 1L;

    {@literal @}Override
    protected void onNotification(
        StoredChannel subscription, Notification notification, ListResponse content) {
      switch (notification.getResourceState()) {
        case ResourceStates.SYNC:
          break;
        case ResourceStates.EXISTS:
          break;
        case ResourceStates.NOT_EXISTS:
          break;
      }
    }

    {@literal @}Override
    protected ObjectParser getObjectParser(Notification notification) throws IOException {
      return new JsonObjectParser(new JacksonFactory());
    }

    {@literal @}Override
    protected Class{@literal <}ListResponse{@literal >} getDataClass() throws IOException {
      return ListResponse.class;
    }
  }
 *

 *
 * @param <T> Java type of the notification content
 * @author Yaniv Inbar
 * @author Matthias Linder (mlinder)
 * @since 1.16
 */
@Beta
public abstract class TypedNotificationCallback<T> implements UnparsedNotificationCallback {

  private static final long serialVersionUID = 1L;

  /**
   * Handles a received typed notification.
   *
   * @param storedChannel stored notification channel
   * @param notification typed notification
   */
  protected abstract void onNotification(
      StoredChannel storedChannel, TypedNotification<T> notification) throws IOException;

  /** Returns an {@link ObjectParser} which can be used to parse this notification. */
  protected abstract ObjectParser getObjectParser() throws IOException;

  /**
   * Returns the data class to parse the notification content into or {@code Void.class} if no
   * notification content is expected.
   */
  protected abstract Class<T> getDataClass() throws IOException;

  public final void onNotification(StoredChannel storedChannel, UnparsedNotification notification)
      throws IOException {
    TypedNotification<T> typedNotification = new TypedNotification<T>(notification);
    // TODO(yanivi): how to properly detect if there is no content?
    String contentType = notification.getContentType();
    if (contentType != null) {
      Charset charset = new HttpMediaType(contentType).getCharsetParameter();
      Class<T> dataClass = Preconditions.checkNotNull(getDataClass());
      typedNotification.setContent(
          getObjectParser().parseAndClose(notification.getContentStream(), charset, dataClass));
    }
    onNotification(storedChannel, typedNotification);
  }
}


text:
"use strict";

const
  moment  = require('moment'),
  _       = require('underscore'),
  Promise = require('bluebird'),
  Exception = require('../../error'),
  CalendarMonth = require('../calendar_month');

module.exports = function(sequelize, DataTypes) {
  let Department = sequelize.define("Department", {
    // TODO add validators!
    name : {
      type      : DataTypes.STRING,
      allowNull : false
    },
    allowance : {
      type         : DataTypes.INTEGER,
      allowNull    : false,
      defaultValue : 20,
    },
    include_public_holidays : {
      type         : DataTypes.BOOLEAN,
      allowNull    : false,
      defaultValue : true,
    },
    is_accrued_allowance : {
      type         : DataTypes.BOOLEAN,
      allowNull    : false,
      defaultValue : false,
    },
  }, {
      indexes : [
        {
          fields : ['companyId'],
        },
        {
          fields : ['id'],
        }
      ],
      classMethods: {
          loadScope : function( models ) {

            Department.addScope(
              'with_simple_users',
              {
                include : [
                  { model : models.User, as : 'users' },
                ],
              }
            );

            Department.addScope(
              'with_boss',
              {
                include : [
                  { model : models.User, as : 'boss' },
                ]
              }
            );

            Department.addScope(
              'with_supervisors',
              {
                include : [
                  { model : models.User, as : 'supervisors' },
                ]
              }
            );
          },
          associate : function( models ) {
            // We have constrains OFF as to prevent ORM complaining about
            // cycle reference
            Department.belongsTo ( models.User,    { as : 'boss', constraints: false});
            Department.belongsTo ( models.Company, { as : 'company'});
            Department.hasMany   ( models.User,    { as : 'users'});

            Department.hasMany( models.DepartmentSupervisor, {
              as         : 'supervisors_link',
              foreignKey : {name: 'department_id', allowNull: false},
            });

            Department.belongsToMany(models.User, {
              as         : 'supervisors',
              foreignKey : 'department_id',
              otherKey   : 'user_id',
              through    : models.DepartmentSupervisor,
            });
          },

          default_order_field : function(){
              return 'name';
          },
      },

      instanceMethods : {

        // Return users related to current department and still active
        promise_active_users : function(){
          return this.getUsers({
            where : sequelize.models.User.get_active_user_filter()
          });
        },

        promise_team_view_for_month : function( month ){
          return this._promise_team_view({ start_date : month });
        },

        promise_team_view_for_months_range : function (start_month, end_month){
          return this._promise_team_view({
            start_date : start_month,
            end_date   : end_month,
          });
        },

        _promise_team_view : function(args){

          let
            self       = this,
            model      = sequelize.models,
            start_date = args.start_date,
            end_date   = args.end_date;

          var promise_users_and_leaves = Promise

          // First of all ensure that "start_date" is defined
          .try(function(){
            if ( start_date ) {
              return Promise.resolve(start_date);
            }

            return self.getCompany()
              .then(company => Promise.resolve( start_date = company.get_today() ) )
          })

          // Ensure end_date is suitable if it was provided
          .then(() => {

            // If end_date was not provided: no need to validate it: set it to be equal to start date
            if ( ! end_date ) {

              end_date = start_date;

              return Promise.resolve();
            }

            // If end date is privided...
            // ... ensure start and end dates are from within same year
            if (moment.utc(end_date).format('YYYY') !== moment.utc(start_date).format('YYYY')) {
              Exception.throw_user_error({
                user_error : 'Start and End dates should within single year',
                system_error : '_promise_team_view was called with start_date and end_date from different years.',
              });
            }

            // ... ensure that start date proceed end date
            if (moment.utc(start_date).dayOfYear() > moment.utc(end_date).dayOfYear()) {
              Exception.throw_user_error({
                user_error : 'Start date needs to be before end date',
                system_error : '_promise_team_view was called with end_date prior to start_date',
              });
            }

            return Promise.resolve();
          })

          // Get users
          .then( () => self.promise_active_users() )
          .then(function(users){

            return Promise.all(
              _.map(
                users,
                function(user){
                  return user.promise_my_leaves_for_calendar({
                    year : start_date,
                  })
                  .then(function(leaves){

                    var leave_days = _.flatten( _.map(leaves, function(leave){
                      return _.map( leave.get_days(), function(leave_day){
                        leave_day.leave = leave;
                        return leave_day;
                      });
                    }));

                    return user.promise_schedule_I_obey()
                      .then(function(schedule){
                        return Promise.resolve({
                          user       : user,
                          leave_days : leave_days,
                          schedule   : schedule,
                        });
                      });
                  });
                }
              ) // End of map
            ); // End of promise_users_and_leaves
          });

          var promise_company = self.getCompany({
            include:[
              { model : model.BankHoliday , as : 'bank_holidays' },
              { model : model.LeaveType   , as : 'leave_types' },
            ]
          });

          return Promise.join(
            promise_company,
            promise_users_and_leaves,
            function(company, users_and_leaves){

              let number_of_months = moment.utc(end_date).month() - moment.utc(start_date).month();

              users_and_leaves.forEach( user_data => {

                user_data.days = [];

                // Now iterate throw all monthes between start and end dates
                // and get calendar months for each
                // and then combined them all togather
                for ( let i=0; i<=number_of_months; i++ ) {

                  let calendar_month = new CalendarMonth(
                    moment.utc(start_date).clone().add(i, 'months'),
                    {
                      bank_holidays :
                        self.include_public_holidays
                        ? company.bank_holidays
                        : [],
                      leave_days : user_data.leave_days,
                      schedule   : user_data.schedule,
                      today      : company.get_today(),
                      leave_types: company.leave_types,
                    }
                  );

                  user_data.days.push( calendar_month.as_for_team_view());
                } // end of for
                user_data.days = _.flatten( user_data.days );
              });

              return Promise.resolve(users_and_leaves);
            }
          );

        }, // End of promise_team_view

        // Return new department object that is based on same ID but include all supervisors
        promise_me_with_supervisors : function() {
          var self = this;

          return self.Model.scope('with_supervisors').findById( self.id );
        },
      }
  });

  return Department;
};


text:
package p;

public @interface A {
  Class<?> val();
  String constant();
}

class B {}
class C {
  public static final String FOO = "";
}


text: module.exports = require("npm:tar-pack@3.3.0/index");