text:
namespace g{namespace Android{namespace android{namespace graphics{struct SurfaceTexture;}}}}
namespace g{namespace Android{namespace android{namespace media{struct MediaPlayer;}}}}
namespace g{namespace Android{namespace android{namespace view{struct Surface;}}}}
namespace g{namespace Fuse{namespace Video{namespace Graphics{namespace Android{struct VideoSurface;}}}}}
namespace g{namespace Uno{namespace Graphics{struct VideoTexture;}}}
namespace g{namespace Uno{struct EventArgs;}}

namespace g{
namespace Fuse{
namespace Video{
namespace Graphics{
namespace Android{

// internal sealed extern class VideoSurface :644
// {
struct VideoSurface_type : uType
{
    ::g::Uno::IDisposable interface0;
};

VideoSurface_type* VideoSurface_typeof();
void VideoSurface__ctor__fn(VideoSurface* __this, ::g::Android::android::media::MediaPlayer* mediaPlayer);
void VideoSurface__Create_fn(::g::Android::android::media::MediaPlayer* mediaPlayer, VideoSurface** __retval);
void VideoSurface__Dispose_fn(VideoSurface* __this);
void VideoSurface__get_FrameAvailable_fn(VideoSurface* __this, bool* __retval);
void VideoSurface__New1_fn(::g::Android::android::media::MediaPlayer* mediaPlayer, VideoSurface** __retval);
void VideoSurface__OnFrameAvailable_fn(VideoSurface* __this, uObject* sender, ::g::Uno::EventArgs* args);
void VideoSurface__UpdateTexture_fn(VideoSurface* __this);
void VideoSurface__get_VideoTexture_fn(VideoSurface* __this, ::g::Uno::Graphics::VideoTexture** __retval);

struct VideoSurface : uObject
{
    bool _frameAvailable;
    uStrong<uObject*> _frameAvailableListener;
    bool _isDisposed;
    uStrong< ::g::Android::android::media::MediaPlayer*> _mediaPlayer;
    uStrong< ::g::Android::android::view::Surface*> _surface;
    uStrong< ::g::Android::android::graphics::SurfaceTexture*> _surfaceTexture;
    uStrong< ::g::Uno::Graphics::VideoTexture*> _videoTexture;

    void ctor_(::g::Android::android::media::MediaPlayer* mediaPlayer);
    void Dispose();
    bool FrameAvailable();
    void OnFrameAvailable(uObject* sender, ::g::Uno::EventArgs* args);
    void UpdateTexture();
    ::g::Uno::Graphics::VideoTexture* VideoTexture();
    static VideoSurface* Create(::g::Android::android::media::MediaPlayer* mediaPlayer);
    static VideoSurface* New1(::g::Android::android::media::MediaPlayer* mediaPlayer);
};
// }

}}}}} // ::g::Fuse::Video::Graphics::Android


text:
function parcellation = ft_datatype_parcellation(parcellation, varargin)

% FT_DATATYPE_PARCELLATION describes the FieldTrip MATLAB structure for parcellated
% cortex-based data and atlases. A parcellation can either be indexed or probabilistic
% (see below).
%
% A parcellation describes the tissue types for each of the surface elements.
% Parcellations are often, but not always labeled. A parcellatoin can be used to
% estimate the activity from MEG data in a known region of interest. A surface-based
% atlas is basically a very detailled parcellation with an anatomical label for each
% vertex.
%
% An example of a surface based Brodmann parcellation looks like this
%
%              pos: [8192x3]         positions of the vertices forming the cortical sheet
%              tri: [16382x3]        triangles of the cortical sheet
%         coordsys: 'ctf'            the (head) coordinate system in which the vertex positions are expressed
%             unit: 'mm'             the units in which the coordinate system is expressed
%         brodmann: [8192x1 uint8]   values from 1 to N, the value 0 means unknown
%    brodmannlabel: {Nx1 cell}
%
% An alternative representation of this parcellation is
%
%              pos: [8192x3]           positions of the vertices forming the cortical sheet
%              tri: [16382x3]          triangles of the cortical sheet
%         coordsys: 'ctf'              the (head) coordinate system in which the vertex positions are expressed
%             unit: 'mm'               the units in which the coordinate system is expressed
%  Brodmann_Area_1: [8192x1 logical]   binary map representing the voxels belonging to the specific area
%  Brodmann_Area_2: [8192x1 logical]   binary map representing the voxels belonging to the specific area
%  Brodmann_Area_3: [8192x1 logical]   binary map representing the voxels belonging to the specific area
%  ...
%
% The examples above demonstrate that a parcellation can be indexed, i.e. consisting of
% subsequent integer numbers (1, 2, ...) or probabilistic, consisting of real numbers
% ranging from 0 to 1 that represent probabilities between 0% and 100%. An extreme case
% is one where the probability is either 0 or 1, in which case the probability can be
% represented as a binary or logical array.
%
% The only difference to the source data structure is that the parcellation structure
% contains the additional fields xxx and xxxlabel. See FT_DATATYPE_SOURCE for further
% details.
%
% Required fields:
%   - pos
%
% Optional fields:
%   - tri, coordsys, unit
%
% Deprecated fields:
%   - none
%
% Obsoleted fields:
%   - none
%
% Revision history:
% (2012/latest) The initial version was defined in accordance with the representation of
% a voxel-based segmentation.
%
% See also FT_DATATYPE, FT_DATATYPE_SOURCE, FT_DATATYPE_SEGMENTATION

% Copyright (C) 2012, Robert Oostenveld
%
% This file is part of FieldTrip, see http://www.ru.nl/neuroimaging/fieldtrip
% for the documentation and details.
%
%    FieldTrip is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    FieldTrip is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with FieldTrip. If not, see <http://www.gnu.org/licenses/>.
%
% $Id: ft_datatype_parcellation.m 7123 2012-12-06 21:21:38Z roboos $

% get the optional input arguments, which should be specified as key-value pairs
version           = ft_getopt(varargin, 'version', 'latest');
parcellationstyle = ft_getopt(varargin, 'parcellationstyle');  % can be indexed or probabilistic

if strcmp(version, 'latest')
  parcelversion = '2012';
  sourceversion = 'latest';
  clear version
else
  parcelversion = version;
  sourceversion = version;
  clear version
end

if isempty(parcellation)
  return;
end

switch parcelversion
  case '2012'
    % determine whether the style of the input fields is probabilistic or indexed
    fn = fieldnames(parcellation);

    if ~any(strcmp('pos',fn))
        if any(strcmp('pnt', fn))
            parcellation.pos = parcellation.pnt;
            parcellation = rmfield(parcellation, 'pnt');
            fn = fieldnames(parcellation);
        end
    end

    dim = size(parcellation.pos,1);
    [indexed, probabilistic] = determine_segmentationstyle(parcellation, fn, dim);

    if any(probabilistic) && any(indexed)
      warning('cannot work with a mixed representation, removing tissue probability maps');
      sel = find(probabilistic);
      parcellation       = rmfield(parcellation, fn(sel));
      probabilistic(sel) = false;
    end

    if any(probabilistic)
      fn = fn(probabilistic);
      probabilistic = true; indexed = false;
    elseif any(indexed)
      fn = fn(indexed);
      indexed = true; probabilistic = false;
    end

    if ~any(probabilistic) && ~any(indexed)  % allow for tissue labels of elements
        for i = 1:length(fn)
            fname = fn{i};
            switch fname
                case 'tri'
                    dim = size(parcellation.tri,1);
                case 'hex'
                    dim = size(parcellation.hex,1);
                case 'tet'
                    dim = size(parcellation.tet,1);
            end
        end
        [indexed, probabilistic] = determine_segmentationstyle(parcellation, fn, dim);

        if any(probabilistic) && any(indexed)
            warning('cannot work with a mixed representation, removing tissue probability maps');
            sel = find(probabilistic);
            parcellation       = rmfield(parcellation, fn(sel));
            probabilistic(sel) = false;
        end

        if any(probabilistic)
            fn = fn(probabilistic);
            probabilistic = true; indexed = false;
        elseif any(indexed)
            fn = fn(indexed);
            indexed = true; probabilistic = false;
        end
    end
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % ensure that the parcellation is internally consistent
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    if probabilistic
      parcellation = fixsegmentation(parcellation, fn, 'probabilistic');
    elseif indexed
      parcellation = fixsegmentation(parcellation, fn, 'indexed');
    end

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % convert the parcellation to the desired style
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    if probabilistic && strcmp(parcellationstyle, 'indexed')
      parcellation  = convert_segmentationstyle(parcellation, fn, [dim 1], 'indexed');
      indexed       = true;
      probabilistic = false;
      clear fn % to avoid any potential confusion
    elseif indexed && strcmp(parcellationstyle, 'probabilistic')
      parcellation  = convert_segmentationstyle(parcellation, fn, [dim 1], 'probabilistic');
      probabilistic = true;
      indexed       = false;
      clear fn % to avoid any potential confusion
    end % converting between probabilistic and indexed

  otherwise
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    error('unsupported version "%s" for parcellation datatype', parcelversion);
end

% the parcellation is a speciat type of volume structure, so ensure that it also fulfills the requirements for that
parcellation = ft_datatype_source(parcellation, 'version', sourceversion);

% For the pass through ft_datatype_volume it is perhaps neccessary to remove
% the fields that are specific for the parcellation and add them later again.
% At this moment ft_datatype_volume nicely passes all fields, so there is no
% special handling of the parcellation fields needed.

redpajama_set_name: RedPajamaGithub


text:
package org.orekit.propagation.analytical;

import java.util.Collection;

import org.apache.commons.math3.exception.util.DummyLocalizable;
import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;
import org.apache.commons.math3.geometry.euclidean.threed.Vector3D;
import org.apache.commons.math3.util.FastMath;
import org.apache.commons.math3.util.MathUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.orekit.Utils;
import org.orekit.attitudes.Attitude;
import org.orekit.attitudes.AttitudeProvider;
import org.orekit.attitudes.LofOffset;
import org.orekit.bodies.GeodeticPoint;
import org.orekit.bodies.OneAxisEllipsoid;
import org.orekit.errors.OrekitException;
import org.orekit.errors.PropagationException;
import org.orekit.forces.gravity.potential.GravityFieldFactory;
import org.orekit.forces.gravity.potential.TideSystem;
import org.orekit.forces.gravity.potential.UnnormalizedSphericalHarmonicsProvider;
import org.orekit.frames.Frame;
import org.orekit.frames.FramesFactory;
import org.orekit.frames.LOFType;
import org.orekit.frames.TopocentricFrame;
import org.orekit.orbits.CircularOrbit;
import org.orekit.orbits.EquinoctialOrbit;
import org.orekit.orbits.KeplerianOrbit;
import org.orekit.orbits.Orbit;
import org.orekit.orbits.PositionAngle;
import org.orekit.propagation.Propagator;
import org.orekit.propagation.SpacecraftState;
import org.orekit.propagation.events.ApsideDetector;
import org.orekit.propagation.events.DateDetector;
import org.orekit.propagation.events.ElevationDetector;
import org.orekit.propagation.events.EventDetector;
import org.orekit.propagation.events.NodeDetector;
import org.orekit.propagation.events.handlers.ContinueOnEvent;
import org.orekit.propagation.sampling.OrekitFixedStepHandler;
import org.orekit.time.AbsoluteDate;
import org.orekit.utils.Constants;
import org.orekit.utils.IERSConventions;
import org.orekit.utils.PVCoordinates;
import org.orekit.utils.PVCoordinatesProvider;

public class EcksteinHechlerPropagatorTest {

    @Test
    public void sameDateCartesian() throws OrekitException {

        // Definition of initial conditions with position and velocity
        // ------------------------------------------------------------
        // with e around e = 1.4e-4 and i = 1.7 rad
        Vector3D position = new Vector3D(3220103., 69623., 6449822.);
        Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);

        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
        Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity),
                                                  FramesFactory.getEME2000(), initDate, provider.getMu());

        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, provider);

        // Extrapolation at the initial date
        // ---------------------------------
        double delta_t = 0.0; // extrapolation duration in seconds
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);

        SpacecraftState finalOrbit = extrapolator.propagate(extrapDate);

        Assert.assertEquals(finalOrbit.getDate().durationFrom(extrapDate), 0.0, Utils.epsilonTest);
        Assert.assertEquals(finalOrbit.getA(), initialOrbit.getA(), Utils.epsilonTest
                     * initialOrbit.getA());
        Assert.assertEquals(finalOrbit.getEquinoctialEx(), initialOrbit.getEquinoctialEx(), Utils.epsilonE
                     * initialOrbit.getE());
        Assert.assertEquals(finalOrbit.getEquinoctialEy(), initialOrbit.getEquinoctialEy(), Utils.epsilonE
                     * initialOrbit.getE());
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getHx(), initialOrbit.getHx()),
                     initialOrbit.getHx(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getI()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getHy(), initialOrbit.getHy()),
                     initialOrbit.getHy(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getI()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getLv(), initialOrbit.getLv()),
                     initialOrbit.getLv(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getLv()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getLM(), initialOrbit.getLM()),
                     initialOrbit.getLM(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getLM()));

    }

    @Test
    public void sameDateKeplerian() throws OrekitException {

        // Definition of initial conditions with keplerian parameters
        // -----------------------------------------------------------
        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
        Orbit initialOrbit = new KeplerianOrbit(7209668.0, 0.5e-4, 1.7, 2.1, 2.9,
                                                6.2, PositionAngle.TRUE,
                                                FramesFactory.getEME2000(), initDate, provider.getMu());

        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, Propagator.DEFAULT_MASS, provider);

        // Extrapolation at the initial date
        // ---------------------------------
        double delta_t = 0.0; // extrapolation duration in seconds
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);

        SpacecraftState finalOrbit = extrapolator.propagate(extrapDate);

        Assert.assertEquals(finalOrbit.getDate().durationFrom(extrapDate), 0.0, Utils.epsilonTest);
        Assert.assertEquals(finalOrbit.getA(), initialOrbit.getA(), Utils.epsilonTest
                     * initialOrbit.getA());
        Assert.assertEquals(finalOrbit.getEquinoctialEx(), initialOrbit.getEquinoctialEx(), Utils.epsilonE
                     * initialOrbit.getE());
        Assert.assertEquals(finalOrbit.getEquinoctialEy(), initialOrbit.getEquinoctialEy(), Utils.epsilonE
                     * initialOrbit.getE());
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getHx(), initialOrbit.getHx()),
                     initialOrbit.getHx(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getI()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getHy(), initialOrbit.getHy()),
                     initialOrbit.getHy(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getI()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getLv(), initialOrbit.getLv()),
                     initialOrbit.getLv(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getLv()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getLE(), initialOrbit.getLE()),
                     initialOrbit.getLE(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getLE()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbit.getLM(), initialOrbit.getLM()),
                     initialOrbit.getLM(), Utils.epsilonAngle
                     * FastMath.abs(initialOrbit.getLM()));

    }

    @Test
    public void almostSphericalBody() throws OrekitException {

        // Definition of initial conditions
        // ---------------------------------
        // with e around e = 1.4e-4 and i = 1.7 rad
        Vector3D position = new Vector3D(3220103., 69623., 6449822.);
        Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);

        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
        Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity),
                                                  FramesFactory.getEME2000(), initDate, provider.getMu());

        // Initialisation to simulate a keplerian extrapolation
        // To be noticed: in order to simulate a keplerian extrapolation with the
        // analytical
        // extrapolator, one should put the zonal coefficients to 0. But due to
        // numerical pbs
        // one must put a non 0 value.
        UnnormalizedSphericalHarmonicsProvider kepProvider =
                GravityFieldFactory.getUnnormalizedProvider(6.378137e6, 3.9860047e14,
                                                            TideSystem.UNKNOWN,
                                                            new double[][] {
                                                                { 0 }, { 0 }, { 0.1e-10 }, { 0.1e-13 }, { 0.1e-13 }, { 0.1e-14 }, { 0.1e-14 }
                                                            }, new double[][] {
                                                                { 0 }, { 0 },  { 0 }, { 0 }, { 0 }, { 0 }, { 0 }
                                                            });

        // Extrapolators definitions
        // -------------------------
        EcksteinHechlerPropagator extrapolatorAna =
            new EcksteinHechlerPropagator(initialOrbit,
                                          kepProvider);
        KeplerianPropagator extrapolatorKep = new KeplerianPropagator(initialOrbit);

        // Extrapolation at a final date different from initial date
        // ---------------------------------------------------------
        double delta_t = 100.0; // extrapolation duration in seconds
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);

        SpacecraftState finalOrbitAna = extrapolatorAna.propagate(extrapDate);
        SpacecraftState finalOrbitKep = extrapolatorKep.propagate(extrapDate);

        Assert.assertEquals(finalOrbitAna.getDate().durationFrom(extrapDate), 0.0,
                     Utils.epsilonTest);
        // comparison of each orbital parameters
        Assert.assertEquals(finalOrbitAna.getA(), finalOrbitKep.getA(), 10
                     * Utils.epsilonTest * finalOrbitKep.getA());
        Assert.assertEquals(finalOrbitAna.getEquinoctialEx(), finalOrbitKep.getEquinoctialEx(), Utils.epsilonE
                     * finalOrbitKep.getE());
        Assert.assertEquals(finalOrbitAna.getEquinoctialEy(), finalOrbitKep.getEquinoctialEy(), Utils.epsilonE
                     * finalOrbitKep.getE());
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getHx(), finalOrbitKep.getHx()),
                     finalOrbitKep.getHx(), Utils.epsilonAngle
                     * FastMath.abs(finalOrbitKep.getI()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getHy(), finalOrbitKep.getHy()),
                     finalOrbitKep.getHy(), Utils.epsilonAngle
                     * FastMath.abs(finalOrbitKep.getI()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLv(), finalOrbitKep.getLv()),
                     finalOrbitKep.getLv(), Utils.epsilonAngle
                     * FastMath.abs(finalOrbitKep.getLv()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLE(), finalOrbitKep.getLE()),
                     finalOrbitKep.getLE(), Utils.epsilonAngle
                     * FastMath.abs(finalOrbitKep.getLE()));
        Assert.assertEquals(MathUtils.normalizeAngle(finalOrbitAna.getLM(), finalOrbitKep.getLM()),
                     finalOrbitKep.getLM(), Utils.epsilonAngle
                     * FastMath.abs(finalOrbitKep.getLM()));

    }

    @Test
    public void propagatedCartesian() throws OrekitException {
        // Definition of initial conditions with position and velocity
        // ------------------------------------------------------------
        // with e around e = 1.4e-4 and i = 1.7 rad
        Vector3D position = new Vector3D(3220103., 69623., 6449822.);
        Vector3D velocity = new Vector3D(6414.7, -2006., -3180.);

        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
        Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity),
                                                  FramesFactory.getEME2000(), initDate, provider.getMu());

        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit,
                                          new LofOffset(initialOrbit.getFrame(),
                                                        LOFType.VNC, RotationOrder.XYZ, 0, 0, 0),
                                          provider);

        // Extrapolation at a final date different from initial date
        // ---------------------------------------------------------
        double delta_t = 100000.0; // extrapolation duration in seconds
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);

        SpacecraftState finalOrbit = extrapolator.propagate(extrapDate);

        Assert.assertEquals(0.0, finalOrbit.getDate().durationFrom(extrapDate), 1.0e-9);

        // computation of M final orbit
        double LM = finalOrbit.getLE() - finalOrbit.getEquinoctialEx()
        * FastMath.sin(finalOrbit.getLE()) + finalOrbit.getEquinoctialEy()
        * FastMath.cos(finalOrbit.getLE());

        Assert.assertEquals(LM, finalOrbit.getLM(), Utils.epsilonAngle
                     * FastMath.abs(finalOrbit.getLM()));

        // test of tan ((LE - Lv)/2) :
        Assert.assertEquals(FastMath.tan((finalOrbit.getLE() - finalOrbit.getLv()) / 2.),
                     tangLEmLv(finalOrbit.getLv(), finalOrbit.getEquinoctialEx(), finalOrbit
                               .getEquinoctialEy()), Utils.epsilonAngle);

        // test of evolution of M vs E: LM = LE - ex*sin(LE) + ey*cos(LE)
        double deltaM = finalOrbit.getLM() - initialOrbit.getLM();
        double deltaE = finalOrbit.getLE() - initialOrbit.getLE();
        double delta = finalOrbit.getEquinoctialEx() * FastMath.sin(finalOrbit.getLE())
        - initialOrbit.getEquinoctialEx() * FastMath.sin(initialOrbit.getLE())
        - finalOrbit.getEquinoctialEy() * FastMath.cos(finalOrbit.getLE())
        + initialOrbit.getEquinoctialEy() * FastMath.cos(initialOrbit.getLE());

        Assert.assertEquals(deltaM, deltaE - delta, Utils.epsilonAngle
                     * FastMath.abs(deltaE - delta));

        // for final orbit
        double ex = finalOrbit.getEquinoctialEx();
        double ey = finalOrbit.getEquinoctialEy();
        double hx = finalOrbit.getHx();
        double hy = finalOrbit.getHy();
        double LE = finalOrbit.getLE();

        double ex2 = ex * ex;
        double ey2 = ey * ey;
        double hx2 = hx * hx;
        double hy2 = hy * hy;
        double h2p1 = 1. + hx2 + hy2;
        double beta = 1. / (1. + FastMath.sqrt(1. - ex2 - ey2));

        double x3 = -ex + (1. - beta * ey2) * FastMath.cos(LE) + beta * ex * ey
        * FastMath.sin(LE);
        double y3 = -ey + (1. - beta * ex2) * FastMath.sin(LE) + beta * ex * ey
        * FastMath.cos(LE);

        Vector3D U = new Vector3D((1. + hx2 - hy2) / h2p1, (2. * hx * hy) / h2p1,
                                  (-2. * hy) / h2p1);

        Vector3D V = new Vector3D((2. * hx * hy) / h2p1, (1. - hx2 + hy2) / h2p1,
                                  (2. * hx) / h2p1);

        Vector3D r = new Vector3D(finalOrbit.getA(), (new Vector3D(x3, U, y3, V)));

        Assert.assertEquals(finalOrbit.getPVCoordinates().getPosition().getNorm(), r.getNorm(),
                     Utils.epsilonTest * r.getNorm());

    }

    @Test
    public void propagatedKeplerian() throws OrekitException {
        // Definition of initial conditions with keplerian parameters
        // -----------------------------------------------------------
        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH.shiftedBy(584.);
        Orbit initialOrbit = new KeplerianOrbit(7209668.0, 0.5e-4, 1.7, 2.1, 2.9,
                                              6.2, PositionAngle.TRUE,
                                              FramesFactory.getEME2000(), initDate, provider.getMu());

        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit,
                                          new LofOffset(initialOrbit.getFrame(),
                                                        LOFType.VNC, RotationOrder.XYZ, 0, 0, 0),
                                          2000.0, provider);

        // Extrapolation at a final date different from initial date
        // ---------------------------------------------------------
        double delta_t = 100000.0; // extrapolation duration in seconds
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);

        SpacecraftState finalOrbit = extrapolator.propagate(extrapDate);

        Assert.assertEquals(0.0, finalOrbit.getDate().durationFrom(extrapDate), 1.0e-9);

        // computation of M final orbit
        double LM = finalOrbit.getLE() - finalOrbit.getEquinoctialEx()
        * FastMath.sin(finalOrbit.getLE()) + finalOrbit.getEquinoctialEy()
        * FastMath.cos(finalOrbit.getLE());

        Assert.assertEquals(LM, finalOrbit.getLM(), Utils.epsilonAngle);

        // test of tan((LE - Lv)/2) :
        Assert.assertEquals(FastMath.tan((finalOrbit.getLE() - finalOrbit.getLv()) / 2.),
                     tangLEmLv(finalOrbit.getLv(), finalOrbit.getEquinoctialEx(), finalOrbit
                               .getEquinoctialEy()), Utils.epsilonAngle);

        // test of evolution of M vs E: LM = LE - ex*sin(LE) + ey*cos(LE)
        // with ex and ey the same for initial and final orbit
        double deltaM = finalOrbit.getLM() - initialOrbit.getLM();
        double deltaE = finalOrbit.getLE() - initialOrbit.getLE();
        double delta = finalOrbit.getEquinoctialEx() * FastMath.sin(finalOrbit.getLE())
        - initialOrbit.getEquinoctialEx() * FastMath.sin(initialOrbit.getLE())
        - finalOrbit.getEquinoctialEy() * FastMath.cos(finalOrbit.getLE())
        + initialOrbit.getEquinoctialEy() * FastMath.cos(initialOrbit.getLE());

        Assert.assertEquals(deltaM, deltaE - delta, Utils.epsilonAngle
                     * FastMath.abs(deltaE - delta));

        // for final orbit
        double ex = finalOrbit.getEquinoctialEx();
        double ey = finalOrbit.getEquinoctialEy();
        double hx = finalOrbit.getHx();
        double hy = finalOrbit.getHy();
        double LE = finalOrbit.getLE();

        double ex2 = ex * ex;
        double ey2 = ey * ey;
        double hx2 = hx * hx;
        double hy2 = hy * hy;
        double h2p1 = 1. + hx2 + hy2;
        double beta = 1. / (1. + FastMath.sqrt(1. - ex2 - ey2));

        double x3 = -ex + (1. - beta * ey2) * FastMath.cos(LE) + beta * ex * ey
        * FastMath.sin(LE);
        double y3 = -ey + (1. - beta * ex2) * FastMath.sin(LE) + beta * ex * ey
        * FastMath.cos(LE);

        Vector3D U = new Vector3D((1. + hx2 - hy2) / h2p1, (2. * hx * hy) / h2p1,
                                  (-2. * hy) / h2p1);

        Vector3D V = new Vector3D((2. * hx * hy) / h2p1, (1. - hx2 + hy2) / h2p1,
                                  (2. * hx) / h2p1);

        Vector3D r = new Vector3D(finalOrbit.getA(), (new Vector3D(x3, U, y3, V)));

        Assert.assertEquals(finalOrbit.getPVCoordinates().getPosition().getNorm(), r.getNorm(),
                     Utils.epsilonTest * r.getNorm());

    }

    @Test
    public void propagatedEquinoctial() throws OrekitException {

        // Comparison with a given extrapolated orbit
        // -----------------------------------------
        AbsoluteDate initDate = AbsoluteDate.FIFTIES_EPOCH.shiftedBy(12584. * Constants.JULIAN_DAY);

        double a = 7200000.;
        double exp = .9848e-4; // e * cos(pom)
        double eyp = .17367e-4; // e * sin(pom)
        double i = 1.710423;
        double gom = 1.919862;
        double pso_M = 0.5236193; // M + pom

        double e = FastMath.sqrt(exp * exp + eyp * eyp);
        double pom = FastMath.atan2(eyp, exp);
        double ex = e * FastMath.cos(pom + gom);
        double ey = e * FastMath.sin(pom + gom);
        Orbit initialOrbit = new EquinoctialOrbit(a, ex, ey,
                                                FastMath.tan(i / 2) * FastMath.cos(gom),
                                                FastMath.tan(i / 2) * FastMath.sin(gom),
                                                pso_M + gom, PositionAngle.MEAN,
                                                FramesFactory.getEME2000(), initDate, provider.getMu());
        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, provider);

        // Extrapolation at a final date different from initial date
        // ---------------------------------------------------------
        double delta_t = (12587. - 12584.) * Constants.JULIAN_DAY; // extrapolation duration in
        // seconds
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);

        SpacecraftState finalOrbit = extrapolator.propagate(extrapDate);
        // the final orbit

        a = 7187990.1979844316;
        exp = 7.766165990293499E-4; // e * cos(pom)
        eyp = 1.054283074113609E-3; // e * sin(pom)
        i = 1.7105407051081795;
        gom = 1.9674147913622104;
        pso_M = 4.42298640282359; // M + pom

        e = FastMath.sqrt(exp * exp + eyp * eyp);
        pom = FastMath.atan2(eyp, exp);
        ex = e * FastMath.cos(pom + gom);
        ey = e * FastMath.sin(pom + gom);
        Assert.assertEquals(0.0, finalOrbit.getDate().durationFrom(extrapDate), Utils.epsilonTest * delta_t);
        Assert.assertEquals(finalOrbit.getA(), a, 10. * Utils.epsilonTest * finalOrbit.getA());
        Assert.assertEquals(finalOrbit.getEquinoctialEx(), ex, Utils.epsilonE * finalOrbit.getE());
        Assert.assertEquals(finalOrbit.getEquinoctialEy(), ey, Utils.epsilonE * finalOrbit.getE());
        Assert.assertEquals(finalOrbit.getHx(), FastMath.tan(i / 2.) * FastMath.cos(gom),
                     Utils.epsilonAngle * FastMath.abs(finalOrbit.getHx()));
        Assert.assertEquals(finalOrbit.getHy(), FastMath.tan(i / 2.) * FastMath.sin(gom),
                     Utils.epsilonAngle * FastMath.abs(finalOrbit.getHy()));
        Assert.assertEquals(finalOrbit.getLM(), pso_M + gom, Utils.epsilonAngle
                     * FastMath.abs(finalOrbit.getLM()));

    }

    @Test(expected = PropagationException.class)
    public void undergroundOrbit() throws OrekitException {

        // for a semi major axis < equatorial radius
        Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
        Vector3D velocity = new Vector3D(-500.0, 800.0, 100.0);
        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
        Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity),
                                                  FramesFactory.getEME2000(), initDate, provider.getMu());
        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, provider);

        // Extrapolation at the initial date
        // ---------------------------------
        double delta_t = 0.0;
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
        extrapolator.propagate(extrapDate);
    }

    @Test(expected = PropagationException.class)
    public void equatorialOrbit() throws OrekitException {
        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
        Orbit initialOrbit = new CircularOrbit(7000000, 1.0e-4, -1.5e-4,
                                               0.0, 1.2, 2.3, PositionAngle.MEAN,
                                               FramesFactory.getEME2000(),
                                               initDate, provider.getMu());
        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, provider);

        // Extrapolation at the initial date
        // ---------------------------------
        double delta_t = 0.0;
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
        extrapolator.propagate(extrapDate);
    }

    @Test(expected = PropagationException.class)
    public void criticalInclination() throws OrekitException {
        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
        Orbit initialOrbit = new CircularOrbit(new PVCoordinates(new Vector3D(-3862363.8474653554,
                                                                              -3521533.9758022362,
                                                                              4647637.852558916),
                                                                 new Vector3D(65.36170817232278,
                                                                              -6056.563439401233,
                                                                              -4511.1247889782757)),
                                               FramesFactory.getEME2000(),
                                               initDate, provider.getMu());

        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, provider);

        // Extrapolation at the initial date
        // ---------------------------------
        double delta_t = 0.0;
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
        extrapolator.propagate(extrapDate);
    }

    @Test(expected = PropagationException.class)
    public void tooEllipticalOrbit() throws OrekitException {
        // for an eccentricity too big for the model
        Vector3D position = new Vector3D(7.0e6, 1.0e6, 4.0e6);
        Vector3D velocity = new Vector3D(-500.0, 8000.0, 1000.0);
        AbsoluteDate initDate = AbsoluteDate.J2000_EPOCH;
        Orbit initialOrbit = new EquinoctialOrbit(new PVCoordinates(position, velocity),
                                                  FramesFactory.getEME2000(), initDate, provider.getMu());
        // Extrapolator definition
        // -----------------------
        EcksteinHechlerPropagator extrapolator =
            new EcksteinHechlerPropagator(initialOrbit, provider);

        // Extrapolation at the initial date
        // ---------------------------------
        double delta_t = 0.0;
        AbsoluteDate extrapDate = initDate.shiftedBy(delta_t);
        extrapolator.propagate(extrapDate);
    }

    @Test(expected = PropagationException.class)
    public void hyperbolic() throws OrekitException {
        KeplerianOrbit hyperbolic =
            new KeplerianOrbit(-1.0e10, 2, 0, 0, 0, 0, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(hyperbolic, provider);
        propagator.propagate(AbsoluteDate.J2000_EPOCH.shiftedBy(10.0));
    }

    @Test(expected = PropagationException.class)
    public void wrongAttitude() throws OrekitException {
        KeplerianOrbit orbit =
            new KeplerianOrbit(1.0e10, 1.0e-4, 1.0e-2, 0, 0, 0, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
        AttitudeProvider wrongLaw = new AttitudeProvider() {
            private static final long serialVersionUID = 5918362126173997016L;
            public Attitude getAttitude(PVCoordinatesProvider pvProv, AbsoluteDate date, Frame frame) throws OrekitException {
                throw new OrekitException(new DummyLocalizable("gasp"), new RuntimeException());
            }
        };
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, wrongLaw, provider);
        propagator.propagate(AbsoluteDate.J2000_EPOCH.shiftedBy(10.0));
    }

    @Test
    public void ascendingNode() throws OrekitException {
        final KeplerianOrbit orbit =
            new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, provider.getMu());
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, provider);
        NodeDetector detector = new NodeDetector(orbit, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        Assert.assertTrue(FramesFactory.getITRF(IERSConventions.IERS_2010, true) == detector.getFrame());
        propagator.addEventDetector(detector);
        AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
        SpacecraftState propagated = propagator.propagate(farTarget);
        PVCoordinates pv = propagated.getPVCoordinates(FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) > 3500.0);
        Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) < 4000.0);
        Assert.assertEquals(0, pv.getPosition().getZ(), 1.0e-6);
        Assert.assertTrue(pv.getVelocity().getZ() > 0);
        Collection<EventDetector> detectors = propagator.getEventsDetectors();
        Assert.assertEquals(1, detectors.size());
        propagator.clearEventsDetectors();
        Assert.assertEquals(0, propagator.getEventsDetectors().size());
    }

    @Test
    public void stopAtTargetDate() throws OrekitException {
        final KeplerianOrbit orbit =
            new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, provider);
        Frame itrf =  FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        propagator.addEventDetector(new NodeDetector(orbit, itrf).withHandler(new ContinueOnEvent<NodeDetector>()));
        AbsoluteDate farTarget = orbit.getDate().shiftedBy(10000.0);
        SpacecraftState propagated = propagator.propagate(farTarget);
        Assert.assertEquals(0.0, FastMath.abs(farTarget.durationFrom(propagated.getDate())), 1.0e-3);
    }

    @Test
    public void perigee() throws OrekitException {
        final KeplerianOrbit orbit =
            new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, provider.getMu());
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, provider);
        propagator.addEventDetector(new ApsideDetector(orbit));
        AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
        SpacecraftState propagated = propagator.propagate(farTarget);
        PVCoordinates pv = propagated.getPVCoordinates(FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) > 3000.0);
        Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) < 3500.0);
        Assert.assertEquals(orbit.getA() * (1.0 - orbit.getE()), pv.getPosition().getNorm(), 400);
    }

    @Test
    public void date() throws OrekitException {
        final KeplerianOrbit orbit =
            new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, provider);
        final AbsoluteDate stopDate = AbsoluteDate.J2000_EPOCH.shiftedBy(500.0);
        propagator.addEventDetector(new DateDetector(stopDate));
        AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
        SpacecraftState propagated = propagator.propagate(farTarget);
        Assert.assertEquals(0, stopDate.durationFrom(propagated.getDate()), 1.0e-10);
    }

    @Test
    public void fixedStep() throws OrekitException {
        final KeplerianOrbit orbit =
            new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, provider);
        final double step = 100.0;
        propagator.setMasterMode(step, new OrekitFixedStepHandler() {
            private AbsoluteDate previous;
            public void init(SpacecraftState s0, AbsoluteDate t) {
            }
            public void handleStep(SpacecraftState currentState, boolean isLast)
            throws PropagationException {
                if (previous != null) {
                    Assert.assertEquals(step, currentState.getDate().durationFrom(previous), 1.0e-10);
                }
                previous = currentState.getDate();
            }
        });
        AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
        propagator.propagate(farTarget);
    }

    @Test
    public void setting() throws OrekitException {
        final KeplerianOrbit orbit =
            new KeplerianOrbit(7.8e6, 0.032, 0.4, 0.1, 0.2, 0.3, PositionAngle.TRUE,
                               FramesFactory.getEME2000(), AbsoluteDate.J2000_EPOCH, 3.986004415e14);
        EcksteinHechlerPropagator propagator =
            new EcksteinHechlerPropagator(orbit, provider);
        final OneAxisEllipsoid earthShape =
            new OneAxisEllipsoid(6378136.460, 1 / 298.257222101, FramesFactory.getITRF(IERSConventions.IERS_2010, true));
        final TopocentricFrame topo =
            new TopocentricFrame(earthShape, new GeodeticPoint(0.389, -2.962, 0), null);
        ElevationDetector detector = new ElevationDetector(60, 1.0e-9, topo).withConstantElevation(0.09);
        Assert.assertEquals(0.09, detector.getMinElevation(), 1.0e-12);
        Assert.assertTrue(topo == detector.getTopocentricFrame());
        propagator.addEventDetector(detector);
        AbsoluteDate farTarget = AbsoluteDate.J2000_EPOCH.shiftedBy(10000.0);
        SpacecraftState propagated = propagator.propagate(farTarget);
        final double elevation = topo.getElevation(propagated.getPVCoordinates().getPosition(),
                                                   propagated.getFrame(),
                                                   propagated.getDate());
        final double zVelocity = propagated.getPVCoordinates(topo).getVelocity().getZ();
        Assert.assertTrue(farTarget.durationFrom(propagated.getDate()) > 7800.0);
        Assert.assertTrue("Incorrect value " + farTarget.durationFrom(propagated.getDate()) + " !< 7900",farTarget.durationFrom(propagated.getDate()) < 7900.0);
        Assert.assertEquals(0.09, elevation, 1.0e-11);
        Assert.assertTrue(zVelocity < 0);
    }

    private static double tangLEmLv(double Lv, double ex, double ey) {
        // tan ((LE - Lv) /2)) =
        return (ey * FastMath.cos(Lv) - ex * FastMath.sin(Lv))
        / (1 + ex * FastMath.cos(Lv) + ey * FastMath.sin(Lv) + FastMath.sqrt(1 - ex * ex
                                                                 - ey * ey));
    }

    @Before
    public void setUp() {
        Utils.setDataRoot("regular-data");
        double mu  = 3.9860047e14;
        double ae  = 6.378137e6;
        double[][] cnm = new double[][] {
            { 0 }, { 0 }, { -1.08263e-3 }, { 2.54e-6 }, { 1.62e-6 }, { 2.3e-7 }, { -5.5e-7 }
           };
        double[][] snm = new double[][] {
            { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }, { 0 }
           };
        provider = GravityFieldFactory.getUnnormalizedProvider(ae, mu, TideSystem.UNKNOWN, cnm, snm);
    }

    @After
    public void tearDown() {
        provider = null;
    }

    private UnnormalizedSphericalHarmonicsProvider provider;

}


text:
package hudson.plugins.dry.tokens;

import hudson.Extension;
import hudson.plugins.analysis.tokens.AbstractResultTokenMacro;
import hudson.plugins.dry.DryMavenResultAction;
import hudson.plugins.dry.DryResultAction;

/**
 * Provides a token that evaluates to the DRY build result.
 *
 * @author Ulli Hafner
 */
@Extension(optional = true)
public class DryResultTokenMacro extends AbstractResultTokenMacro {
    /**
     * Creates a new instance of {@link DryResultTokenMacro}.
     */
    @SuppressWarnings("unchecked")
    public DryResultTokenMacro() {
        super("DRY_RESULT", DryResultAction.class, DryMavenResultAction.class);
    }
}


text:
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
   <session-factory>

      <property name = "hibernate.dialect">
         org.hibernate.dialect.PostgreSQLDialect
      </property>

      <property name = "hibernate.connection.driver_class">
         org.postgresql.Driver
      </property>

      <property name = "hibernate.connection.url">
         jdbc:postgresql://localhost:5432/memap
      </property>

      <property name = "hibernate.connection.username">
         memap
      </property>

      <property name = "hibernate.connection.password">
         memap
      </property>

<!--       <mapping class="serverDB.dao.BuildingSpec"/> -->

   </session-factory>
</hibernate-configuration>


text:
package org.efaps.esjp.common.dashboard;

import org.efaps.admin.program.esjp.EFapsApplication;
import org.efaps.admin.program.esjp.EFapsUUID;

/**
 * This class must be replaced for customization, therefore it is left empty.
 * Functional description can be found in the related "<code>_Base</code>"
 * class.
 *
 * @author The eFaps Team
 */
@EFapsUUID("edad2fe7-77e0-443f-a159-b0e391a58b05")
@EFapsApplication("eFaps-Kernel")
public abstract class AbstractDashboardPanel
    extends AbstractDashboardPanel_Base
{

    /**
     * Key used to store the filters in the context.
     */
    public static final String CACHENAME = AbstractDashboardPanel_Base.CACHENAME;

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    /**
     * Instantiates a new abstract dashboard panel.
     */
    public AbstractDashboardPanel()
    {
        super();
    }

    /**
     * Instantiates a new abstract dashboard panel.
     *
     * @param _config the _config
     */
    public AbstractDashboardPanel(final String _config)
    {
        super(_config);
    }
}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: io/grpc/reflection/testing/reflection_test.proto

package io.grpc.reflection.testing;

public final class ReflectionTestProto {
  private ReflectionTestProto() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
    registry.add(io.grpc.reflection.testing.ReflectionTestProto.bar);
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public static final int BAR_FIELD_NUMBER = 100;
  /**
   * extend .grpc.reflection.testing.ThirdLevelType { ... }
   */
  public static final
    com.google.protobuf.GeneratedMessage.GeneratedExtension<
      io.grpc.reflection.testing.ThirdLevelType,
      java.lang.Integer> bar = com.google.protobuf.GeneratedMessage
          .newFileScopedGeneratedExtension(
        java.lang.Integer.class,
        null);

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n0io/grpc/reflection/testing/reflection_" +
      "test.proto\022\027grpc.reflection.testing\032:io/" +
      "grpc/reflection/testing/reflection_test_" +
      "depth_two.proto\032Dio/grpc/reflection/test" +
      "ing/reflection_test_depth_two_alternate." +
      "proto2b\n\022ReflectableService\022L\n\006Method\022 ." +
      "grpc.reflection.testing.Request\032\036.grpc.r" +
      "eflection.testing.Reply\"\0002^\n\016DynamicServ" +
      "ice\022L\n\006Method\022 .grpc.reflection.testing." +
      "Request\032\036.grpc.reflection.testing.Reply\"",
      "\000:4\n\003bar\022\'.grpc.reflection.testing.Third" +
      "LevelType\030d \001(\005B3\n\032io.grpc.reflection.te" +
      "stingB\023ReflectionTestProtoP\001"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          io.grpc.reflection.testing.ReflectionTestDepthTwoProto.getDescriptor(),
          io.grpc.reflection.testing.ReflectionTestDepthTwoAlternateProto.getDescriptor(),
        }, assigner);
    bar.internalInit(descriptor.getExtensions().get(0));
    io.grpc.reflection.testing.ReflectionTestDepthTwoProto.getDescriptor();
    io.grpc.reflection.testing.ReflectionTestDepthTwoAlternateProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lecidea melastegia f. mesoleucodes Nyl.

### Remarks
null


text:
class GURL;

namespace crypto {
class SymmetricKey;
}

namespace media {

// Decrypts an AES encrypted buffer into an unencrypted buffer. The AES
// encryption must be CTR with a key size of 128bits.
class MEDIA_EXPORT AesDecryptor : public MediaKeys,
                                  public CdmContext,
                                  public Decryptor {
 public:
  AesDecryptor(const GURL& security_origin,
               const SessionMessageCB& session_message_cb,
               const SessionClosedCB& session_closed_cb,
               const SessionKeysChangeCB& session_keys_change_cb);

  // MediaKeys implementation.
  void SetServerCertificate(const std::vector<uint8_t>& certificate,
                            scoped_ptr<SimpleCdmPromise> promise) override;
  void CreateSessionAndGenerateRequest(
      SessionType session_type,
      EmeInitDataType init_data_type,
      const std::vector<uint8_t>& init_data,
      scoped_ptr<NewSessionCdmPromise> promise) override;
  void LoadSession(SessionType session_type,
                   const std::string& session_id,
                   scoped_ptr<NewSessionCdmPromise> promise) override;
  void UpdateSession(const std::string& session_id,
                     const std::vector<uint8_t>& response,
                     scoped_ptr<SimpleCdmPromise> promise) override;
  void CloseSession(const std::string& session_id,
                    scoped_ptr<SimpleCdmPromise> promise) override;
  void RemoveSession(const std::string& session_id,
                     scoped_ptr<SimpleCdmPromise> promise) override;
  CdmContext* GetCdmContext() override;

  // CdmContext implementation.
  Decryptor* GetDecryptor() override;
  int GetCdmId() const override;

  // Decryptor implementation.
  void RegisterNewKeyCB(StreamType stream_type,
                        const NewKeyCB& key_added_cb) override;
  void Decrypt(StreamType stream_type,
               const scoped_refptr<DecoderBuffer>& encrypted,
               const DecryptCB& decrypt_cb) override;
  void CancelDecrypt(StreamType stream_type) override;
  void InitializeAudioDecoder(const AudioDecoderConfig& config,
                              const DecoderInitCB& init_cb) override;
  void InitializeVideoDecoder(const VideoDecoderConfig& config,
                              const DecoderInitCB& init_cb) override;
  void DecryptAndDecodeAudio(const scoped_refptr<DecoderBuffer>& encrypted,
                             const AudioDecodeCB& audio_decode_cb) override;
  void DecryptAndDecodeVideo(const scoped_refptr<DecoderBuffer>& encrypted,
                             const VideoDecodeCB& video_decode_cb) override;
  void ResetDecoder(StreamType stream_type) override;
  void DeinitializeDecoder(StreamType stream_type) override;

 private:
  // TODO(fgalligan): Remove this and change KeyMap to use crypto::SymmetricKey
  // as there are no decryptors that are performing an integrity check.
  // Helper class that manages the decryption key.
  class DecryptionKey {
   public:
    explicit DecryptionKey(const std::string& secret);
    ~DecryptionKey();

    // Creates the encryption key.
    bool Init();

    crypto::SymmetricKey* decryption_key() { return decryption_key_.get(); }

   private:
    // The base secret that is used to create the decryption key.
    const std::string secret_;

    // The key used to decrypt the data.
    scoped_ptr<crypto::SymmetricKey> decryption_key_;

    DISALLOW_COPY_AND_ASSIGN(DecryptionKey);
  };

  // Keep track of the keys for a key ID. If multiple sessions specify keys
  // for the same key ID, then the last key inserted is used. The structure is
  // optimized so that Decrypt() has fast access, at the cost of slow deletion
  // of keys when a session is released.
  class SessionIdDecryptionKeyMap;

  // Key ID <-> SessionIdDecryptionKeyMap map.
  typedef base::ScopedPtrHashMap<std::string,
                                 scoped_ptr<SessionIdDecryptionKeyMap>>
      KeyIdToSessionKeysMap;

  ~AesDecryptor() override;

  // Creates a DecryptionKey using |key_string| and associates it with |key_id|.
  // Returns true if successful.
  bool AddDecryptionKey(const std::string& session_id,
                        const std::string& key_id,
                        const std::string& key_string);

  // Gets a DecryptionKey associated with |key_id|. The AesDecryptor still owns
  // the key. Returns NULL if no key is associated with |key_id|.
  DecryptionKey* GetKey_Locked(const std::string& key_id) const;

  // Determines if |key_id| is already specified for |session_id|.
  bool HasKey(const std::string& session_id, const std::string& key_id);

  // Deletes all keys associated with |session_id|.
  void DeleteKeysForSession(const std::string& session_id);

  // Callbacks for firing session events.
  SessionMessageCB session_message_cb_;
  SessionClosedCB session_closed_cb_;
  SessionKeysChangeCB session_keys_change_cb_;

  // Since only Decrypt() is called off the renderer thread, we only need to
  // protect |key_map_|, the only member variable that is shared between
  // Decrypt() and other methods.
  KeyIdToSessionKeysMap key_map_;  // Protected by |key_map_lock_|.
  mutable base::Lock key_map_lock_;  // Protects the |key_map_|.

  // Keeps track of current valid sessions.
  std::set<std::string> valid_sessions_;

  // Make session ID unique per renderer by making it static. Session
  // IDs seen by the app will be "1", "2", etc.
  static uint32_t next_session_id_;

  NewKeyCB new_audio_key_cb_;
  NewKeyCB new_video_key_cb_;

  // Protect |new_audio_key_cb_| and |new_video_key_cb_| as they are set on the
  // main thread but called on the media thread.
  mutable base::Lock new_key_cb_lock_;

  DISALLOW_COPY_AND_ASSIGN(AesDecryptor);
};

}  // namespace media

#endif  // MEDIA_CRYPTO_AES_DECRYPTOR_H_


text:
<!DOCTYPE html>

This test checks select attribute of content element is valid.


text:
package mysql

import (
	"database/sql"

	"github.com/fkmhrk/OpenInvoice/v1/model/db"
	"github.com/fkmhrk/OpenInvoice/v1/model/seq"
)

const (
	tableName    = "seq"
	sqlSelectAll = "SELECT seq_type,year,value " +
		"FROM " + tableName + " "
	sqlSelectByTypeAndYear = sqlSelectAll +
		"WHERE seq_type=? AND year=? AND deleted <> 1"
	sqlInsert = "INSERT INTO " + tableName +
		"(seq_type,year,value,created_time,modified_time,deleted) " +
		"VALUES(?,?,?,unix_timestamp(),unix_timestamp(),0)"
	sqlUpdate = "UPDATE " + tableName + " " +
		"SET seq_type=?, year=?, value=?,modified_time=unix_timestamp() " +
		"WHERE seq_type=? AND year=? AND deleted <> 1"
	sqlNext = "UPDATE " + tableName + " " +
		"SET value=value+1,modified_time=unix_timestamp() " +
		"WHERE seq_type=? AND year=? AND deleted <> 1"
	sqlSoftDelete = "UPDATE " + tableName + " " +
		"SET modified_time=unix_timestamp(),deleted=1 " +
		"WHERE seq_type=? AND year=? AND deleted <> 1"
)

type seqDAO struct {
	connection *db.Connection
}

// New creates instance
func New(connection *db.Connection) seq.DAO {
	return &seqDAO{
		connection: connection,
	}
}

func (d *seqDAO) Create(seqType seq.SeqType, year, value int) (seq.Seq, error) {
	tr, err := d.connection.Begin()
	if err != nil {
		return seq.Seq{}, err
	}
	defer tr.Rollback()

	st, err := tr.Prepare(sqlInsert)
	if err != nil {
		return seq.Seq{}, err
	}
	defer st.Close()

	_, err = st.Exec(seqType, year, value)
	if err != nil {
		return seq.Seq{}, err
	}

	tr.Commit()

	return seq.Seq{
		SeqType: seqType,
		Year:    year,
		Value:   value,
	}, nil
}

func (d *seqDAO) Get(seqType seq.SeqType, year int) (seq.Seq, error) {
	db := d.connection.Connect()
	st, err := db.Prepare(sqlSelectByTypeAndYear)
	if err != nil {
		return seq.Seq{}, err
	}
	defer st.Close()

	rows, err := st.Query(seqType, year)
	if err != nil {
		return seq.Seq{}, err
	}
	defer rows.Close()

	if !rows.Next() {
		return seq.Seq{}, nil
	}

	return d.scan(rows), nil
}

func (d *seqDAO) Update(seqType seq.SeqType, year, value int) (seq.Seq, error) {
	db := d.connection.Connect()
	st, err := db.Prepare(sqlUpdate)
	if err != nil {
		return seq.Seq{}, err
	}
	defer st.Close()

	_, err = st.Exec(seqType, year, value, seqType, year)
	if err != nil {
		return seq.Seq{}, err
	}

	return seq.Seq{
		SeqType: seqType,
		Year:    year,
		Value:   value,
	}, nil
}

func (d *seqDAO) Next(seqType seq.SeqType, year int) (seq.Seq, error) {
	tx, err := d.connection.Begin()
	if err != nil {
		return seq.Seq{}, err
	}
	defer tx.Rollback()

	seqEntity, err := d.doNext(tx, seqType, year)
	if err == nil {
		tx.Commit()
		return seqEntity, nil
	} else {
		return seq.Seq{}, err
	}
}

func (d *seqDAO) doNext(tx *sql.Tx, seqType seq.SeqType, year int) (seq.Seq, error) {
	// update
	st, err := tx.Prepare(sqlNext)
	if err != nil {
		return seq.Seq{}, err
	}
	defer st.Close()

	result, err := st.Exec(seqType, year)
	if err != nil {
		return seq.Seq{}, err
	}
	rowCount, err := result.RowsAffected()
	if err != nil {
		return seq.Seq{}, err
	}
	if rowCount == 0 {
		// create
		st2, err := tx.Prepare(sqlInsert)
		if err != nil {
			return seq.Seq{}, err
		}
		defer st2.Close()

		_, err = st2.Exec(seqType, year, 1)
		if err != nil {
			return seq.Seq{}, err
		}
		return seq.Seq{
			SeqType: seqType,
			Year:    year,
			Value:   1,
		}, nil
	}

	// get
	st2, err := tx.Prepare(sqlSelectByTypeAndYear)
	if err != nil {
		return seq.Seq{}, err
	}
	defer st2.Close()

	rows, err := st2.Query(seqType, year)
	if err != nil {
		return seq.Seq{}, err
	}
	defer rows.Close()

	if !rows.Next() {
		return seq.Seq{}, err
	}
	return d.scan(rows), nil
}

func (d *seqDAO) Delete(seqType seq.SeqType, year int) (seq.Seq, error) {
	db := d.connection.Connect()
	st, err := db.Prepare(sqlSoftDelete)
	if err != nil {
		return seq.Seq{}, err
	}
	defer st.Close()

	_, err = st.Exec(seqType, year)
	if err != nil {
		return seq.Seq{}, err
	}

	return seq.Seq{}, nil
}

func (d *seqDAO) scan(rows *sql.Rows) seq.Seq {
	var seqType int
	var year int
	var value int
	rows.Scan(&seqType, &year, &value)
	return seq.Seq{
		SeqType: seq.SeqType(seqType),
		Year:    year,
		Value:   value,
	}
}


text:
'use strict';

/* globals describe:false, it:false */

var should = require('should'); //jshint ignore:line

var jshint = require('../../lib/jshint');

var gulpMock = {};
var task = null;

gulpMock.task = function (name, description, deps, func) {
  task = func;
};

var configMock = {
  root: __dirname,
  src: ['**/*.js', '!./node_modules/**', '!./docs/**']
};

jshint(gulpMock, configMock);

describe('Gulp Module JSHint', function () {
  it('Should return a function', function () {
    jshint.should.be.type('function');
  });

  it('Should create a task', function () {
    task.should.be.type('function');
  });

  it('Should run and throw an error', function (cb) {
    try {
      task();
    } catch (e) {
      cb();
    }
  });
});


text:
package com.intellij.lang.jsgraphql.ide.introspection;

import com.google.common.collect.Lists;
import com.intellij.lang.jsgraphql.psi.GraphQLElementFactory;
import com.intellij.lang.jsgraphql.psi.GraphQLFile;
import com.intellij.lang.jsgraphql.types.language.*;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.project.Project;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.stream.Collectors;

import static com.intellij.lang.jsgraphql.types.Assert.*;

@SuppressWarnings({"unchecked", "rawtypes"})
public class GraphQLIntrospectionResultToSchema {

    private static final Logger LOG = Logger.getInstance(GraphQLIntrospectionResultToSchema.class);

    private final Project myProject;

    public GraphQLIntrospectionResultToSchema(@NotNull Project project) {
        myProject = project;
    }

    /**
     * Returns a IDL Document that represents the schema as defined by the introspection result map
     *
     * @param introspectionResult the result of an introspection query on a schema
     * @return a IDL Document of the schema
     */
    @SuppressWarnings("unchecked")
    public Document createSchemaDefinition(@NotNull Map<String, Object> introspectionResult) {
        assertTrue(introspectionResult.get("__schema") != null, () -> "__schema expected");
        Map<String, Object> schema = (Map<String, Object>) introspectionResult.get("__schema");

        SchemaDefinition.Builder schemaDefinition = SchemaDefinition.newSchemaDefinition();

        Map<String, Object> queryType = (Map<String, Object>) schema.get("queryType");
        boolean nonDefaultQueryName = false;
        if (queryType != null) {
            TypeName query = TypeName.newTypeName().name((String) queryType.get("name")).build();
            nonDefaultQueryName = !"Query".equals(query.getName());
            schemaDefinition.operationTypeDefinition(
                OperationTypeDefinition.newOperationTypeDefinition().name("query").typeName(query).build());
        }

        Map<String, Object> mutationType = (Map<String, Object>) schema.get("mutationType");
        boolean nonDefaultMutationName = false;
        if (mutationType != null) {
            TypeName mutation = TypeName.newTypeName().name((String) mutationType.get("name")).build();
            nonDefaultMutationName = !"Mutation".equals(mutation.getName());
            schemaDefinition.operationTypeDefinition(
                OperationTypeDefinition.newOperationTypeDefinition().name("mutation").typeName(mutation).build());
        }

        Map<String, Object> subscriptionType = (Map<String, Object>) schema.get("subscriptionType");
        boolean nonDefaultSubscriptionName = false;
        if (subscriptionType != null) {
            TypeName subscription = TypeName.newTypeName().name(((String) subscriptionType.get("name"))).build();
            nonDefaultSubscriptionName = !"Subscription".equals(subscription.getName());
            schemaDefinition.operationTypeDefinition(
                OperationTypeDefinition.newOperationTypeDefinition().name("subscription")
                    .typeName(subscription).build());
        }

        Document.Builder document = Document.newDocument();
        if (nonDefaultQueryName || nonDefaultMutationName || nonDefaultSubscriptionName) {
            document.definition(schemaDefinition.build());
        }

        List<Map<String, Object>> types = (List<Map<String, Object>>) schema.get("types");
        if (types != null) {
            for (Map<String, Object> type : types) {
                if (type == null) continue;
                TypeDefinition<?> typeDefinition = createTypeDefinition(type);
                document.definition(typeDefinition);
            }
        }

        List<Map<String, Object>> directives = (List<Map<String, Object>>) schema.get("directives");
        if (directives != null) {
            for (Map<String, Object> directive : directives) {
                if (directive == null) continue;
                DirectiveDefinition directiveDefinition = createDirectiveDefinition(directive);
                document.definition(directiveDefinition);
            }
        }

        return document.build();
    }

    @NotNull
    private TypeDefinition<?> createTypeDefinition(@NotNull Map<String, Object> type) {
        String kind = assertNotNull((String) type.get("kind"),
            () -> String.format("null object kind: %s", type));

        switch (kind) {
            case "INTERFACE":
                return createInterface(type);
            case "OBJECT":
                return createObject(type);
            case "UNION":
                return createUnion(type);
            case "ENUM":
                return createEnum(type);
            case "INPUT_OBJECT":
                return createInputObject(type);
            case "SCALAR":
                return createScalar(type);
            default:
                return assertShouldNeverHappen("unexpected kind %s", kind);
        }
    }

    @NotNull
    private static TypeDefinition<?> createScalar(@NotNull Map<String, Object> input) {
        String name = (String) input.get("name");
        return ScalarTypeDefinition.newScalarTypeDefinition().name(name).description(getDescription(input)).build();
    }

    @SuppressWarnings("unchecked")
    @NotNull
    static UnionTypeDefinition createUnion(@NotNull Map<String, Object> input) {
        assertTrue(Objects.equals(input.get("kind"), "UNION"), () -> "wrong input");

        final List<Map<String, Object>> possibleTypes = (List<Map<String, Object>>) input.get("possibleTypes");
        final List<Type> memberTypes = Lists.newArrayList();
        if (possibleTypes != null) {
            for (Map<String, Object> possibleType : possibleTypes) {
                if (possibleType == null) continue;
                TypeName typeName = new TypeName((String) possibleType.get("name"));
                memberTypes.add(typeName);
            }
        }

        return UnionTypeDefinition.newUnionTypeDefinition()
            .name((String) input.get("name"))
            .description(getDescription(input))
            .memberTypes(memberTypes)
            .build();
    }

    @SuppressWarnings("unchecked")
    @NotNull
    static EnumTypeDefinition createEnum(@NotNull Map<String, Object> input) {
        assertTrue(Objects.equals(input.get("kind"), "ENUM"), () -> "wrong input");

        final List<Map<String, Object>> enumValues = (List<Map<String, Object>>) input.get("enumValues");
        final List<EnumValueDefinition> enumValueDefinitions = Lists.newArrayList();
        if (enumValues != null) {
            for (Map<String, Object> enumValue : enumValues) {
                if (enumValue == null) continue;

                EnumValueDefinition enumValueDefinition = EnumValueDefinition.newEnumValueDefinition()
                    .name((String) enumValue.get("name"))
                    .description(getDescription(enumValue))
                    .directives(createDeprecatedDirective(enumValue))
                    .build();

                enumValueDefinitions.add(enumValueDefinition);
            }
        }

        return EnumTypeDefinition.newEnumTypeDefinition()
            .name((String) input.get("name"))
            .description(getDescription(input))
            .enumValueDefinitions(enumValueDefinitions)
            .build();
    }

    @SuppressWarnings("unchecked")
    @NotNull
    InterfaceTypeDefinition createInterface(@NotNull Map<String, Object> input) {
        assertTrue(Objects.equals(input.get("kind"), "INTERFACE"), () -> "wrong input");

        final List<Map<String, Object>> fields = (List<Map<String, Object>>) input.get("fields");

        return InterfaceTypeDefinition.newInterfaceTypeDefinition()
            .name((String) input.get("name"))
            .description(getDescription(input))
            .definitions(createFields(fields))
            .build();

    }

    @SuppressWarnings("unchecked")
    @NotNull
    InputObjectTypeDefinition createInputObject(@NotNull Map<String, Object> input) {
        assertTrue(Objects.equals(input.get("kind"), "INPUT_OBJECT"), () -> "wrong input");
        final List<Map<String, Object>> fields = (List<Map<String, Object>>) input.get("inputFields");

        return InputObjectTypeDefinition.newInputObjectDefinition()
            .name((String) input.get("name"))
            .description(getDescription(input))
            .inputValueDefinitions(createInputValueDefinitions(fields))
            .build();
    }

    @SuppressWarnings("unchecked")
    @NotNull
    ObjectTypeDefinition createObject(@NotNull Map<String, Object> input) {
        assertTrue(Objects.equals(input.get("kind"), "OBJECT"), () -> "wrong input");

        ObjectTypeDefinition.Builder builder = ObjectTypeDefinition.newObjectTypeDefinition()
            .name((String) input.get("name"))
            .description(getDescription(input));
        if (input.containsKey("interfaces")) {
            builder.implementz(
                ((List<Map<String, Object>>) input.get("interfaces")).stream()
                    .map(GraphQLIntrospectionResultToSchema::createTypeReference)
                    .collect(Collectors.toList())
            );
        }
        List<Map<String, Object>> fields = (List<Map<String, Object>>) input.get("fields");

        builder.fieldDefinitions(createFields(fields));

        return builder.build();
    }

    @NotNull
    private List<FieldDefinition> createFields(@Nullable List<Map<String, Object>> fields) {
        if (fields == null) return ContainerUtil.emptyList();

        List<FieldDefinition> result = new ArrayList<>();
        for (Map<String, Object> field : fields) {
            if (field == null) continue;

            List<Map<String, Object>> args = (List<Map<String, Object>>) field.get("args");
            List<InputValueDefinition> inputValueDefinitions = createInputValueDefinitions(args);
            FieldDefinition fieldDefinition = FieldDefinition.newFieldDefinition()
                .name((String) field.get("name"))
                .description(getDescription(field))
                .type(createTypeReference((Map<String, Object>) field.get("type")))
                .inputValueDefinitions(inputValueDefinitions)
                .directives(createDeprecatedDirective(field))
                .build();
            result.add(fieldDefinition);
        }
        return result;
    }

    @NotNull
    private static List<Directive> createDeprecatedDirective(@NotNull Map<String, Object> field) {
        if ((Boolean) field.get("isDeprecated")) {
            String reason = (String) field.get("deprecationReason");
            if (reason == null) {
                reason = "No longer supported"; // default according to spec
            }
            Argument reasonArg = new Argument("reason", new StringValue(reason));
            return Collections.singletonList(new Directive("deprecated", Collections.singletonList(reasonArg)));
        }
        return Collections.emptyList();
    }

    @SuppressWarnings("unchecked")
    @NotNull
    private List<InputValueDefinition> createInputValueDefinitions(@Nullable List<Map<String, Object>> args) {
        if (args == null) return ContainerUtil.emptyList();

        List<InputValueDefinition> result = new ArrayList<>();
        for (Map<String, Object> arg : args) {
            if (arg == null) continue;

            Type argType = createTypeReference((Map<String, Object>) arg.get("type"));
            String valueLiteral = (String) arg.get("defaultValue");
            Value defaultValue = valueLiteral != null ? valueFromAst(valueLiteral) : null;
            InputValueDefinition inputValueDefinition = InputValueDefinition.newInputValueDefinition()
                .name((String) arg.get("name"))
                .type(argType)
                .description(getDescription(arg))
                .defaultValue(defaultValue)
                .build();
            result.add(inputValueDefinition);
        }
        return result;
    }

    @Nullable
    private static Type createTypeReference(@Nullable Map<String, Object> type) {
        if (type == null) return null;

        String kind = (String) type.get("kind");
        switch (kind) {
            case "INTERFACE":
            case "OBJECT":
            case "UNION":
            case "ENUM":
            case "INPUT_OBJECT":
            case "SCALAR":
                return TypeName.newTypeName().name((String) type.get("name")).build();
            case "NON_NULL":
                Type ofType = createTypeReference((Map<String, Object>) type.get("ofType"));
                if (ofType == null) return null;
                return NonNullType.newNonNullType().type(ofType).build();
            case "LIST":
                return ListType.newListType()
                    .type(createTypeReference((Map<String, Object>) type.get("ofType"))).build();
            default:
                return assertShouldNeverHappen("Unknown kind %s", kind);
        }
    }

    @Nullable
    private static Description getDescription(@Nullable Map<String, Object> descriptionAware) {
        if (descriptionAware == null) return null;

        final Object rawDescription = descriptionAware.get("description");
        if (rawDescription instanceof String) {
            String description = (String) rawDescription;
            if (!description.trim().isEmpty()) {
                final boolean multiLine = description.contains("\n");
                if (multiLine) {
                    // ensures the description stands on separate lines from the triple quotes
                    description = "\n" + description.trim() + "\n";
                }
                return new Description(description, new SourceLocation(1, 1), multiLine);
            }
        }
        return null;
    }

    @NotNull
    private DirectiveDefinition createDirectiveDefinition(@NotNull Map<String, Object> definition) {
        List<Map<String, Object>> args = (List<Map<String, Object>>) definition.get("args");
        List<InputValueDefinition> inputValueDefinitions = createInputValueDefinitions(args);

        return DirectiveDefinition.newDirectiveDefinition()
            .name(((String) definition.get("name")))
            .description(getDescription(definition))
            .directiveLocations(createDirectiveLocations((List<String>) definition.get("locations")))
            .inputValueDefinitions(inputValueDefinitions)
            .repeatable(isRepeatable(definition))
            .build();
    }

    private boolean isRepeatable(@NotNull Map<String, Object> definition) {
        Object isRepeatable = definition.get("isRepeatable");
        return isRepeatable instanceof Boolean && (boolean) isRepeatable;
    }

    @NotNull
    private static List<DirectiveLocation> createDirectiveLocations(@NotNull List<String> locations) {
        return ContainerUtil.mapNotNull(
            locations,
            location -> location != null ? DirectiveLocation.newDirectiveLocation().name(location).build() : null);
    }

    @Nullable
    private Value<?> valueFromAst(@NotNull String literal) {
        try {
            Document doc = ReadAction.compute(() -> {
                String text = "input X { x: String = " + literal + "}";
                GraphQLFile file = GraphQLElementFactory.createFile(myProject, text);
                return file.getDocument();
            });
            InputObjectTypeDefinition inputType = (InputObjectTypeDefinition) doc.getDefinitions().get(0);
            InputValueDefinition inputValueDefinition = inputType.getInputValueDefinitions().get(0);
            return inputValueDefinition.getDefaultValue();
        } catch (ProcessCanceledException e) {
            throw e;
        } catch (Exception e) {
            LOG.error(e);
        }

        return null;
    }

}


text:
import Sequelize from 'sequelize';
import sequelize from '../sequelize';

let Solution = sequelize.define('Solution', {
  id: {
    type: Sequelize.INTEGER.UNSIGNED,
    primaryKey: true,
    autoIncrement: true
  },
  sentAtMs: {
    type: Sequelize.BIGINT(15).UNSIGNED,
    defaultValue: () => new Date().getTime()
  },
  verdictGotAtMs: {
    type: Sequelize.BIGINT(15).UNSIGNED
  },
  retriesNumber: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  nextAttemptWillBeAtMs: {
    type: Sequelize.BIGINT(15).UNSIGNED
  },
  testNumber: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  executionTime: {
    type: Sequelize.FLOAT,
    defaultValue: 0
  },
  memory: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  sourceCode: {
    type: Sequelize.TEXT
  },
  ip: {
    type: Sequelize.STRING
  },
  internalSolutionIdentifier: {
    type: Sequelize.STRING
  },
  refreshedNumber: {
    type: Sequelize.INTEGER,
    defaultValue: 0
  },
  errorTrace: {
    type: Sequelize.TEXT
  },
  compilationError: {
    type: Sequelize.TEXT
  }
}, {
  paranoid: true,
  engine: 'INNODB',
  indexes: [{
    name: 'sent_time_index',
    fields: [ 'sentAtMs' ]
  }, {
    name: 'next_attempt_time_index',
    fields: [ 'nextAttemptWillBeAtMs' ]
  }, {
    name: 'verdict_time_index',
    fields: [ 'verdictGotAtMs' ]
  }, {
    name: 'solution_identifier_index',
    fields: [ 'internalSolutionIdentifier' ]
  }]
});

export default Solution;


text:
package com.deleidos.rtws.commons.metrics;

import java.util.HashMap;

public class MetricsMap {

	private HashMap<MetricsKey, Number> metricsMap = new HashMap<MetricsKey, Number>();

	public void addMetric(MetricsKey key) {
		addMetric(key, 0);
	}

	public void addMetric(MetricsKey key, Integer initialValue) {
		metricsMap.put(key, initialValue);
	}

	public void addMetric(MetricsKey key, Double initialValue) {
		metricsMap.put(key, initialValue);
	}

	public void addMetric(MetricsKey key, Float initialValue) {
		metricsMap.put(key, initialValue);
	}

	public void addMetric(MetricsKey key, Long initialValue) {
		metricsMap.put(key, initialValue);
	}

	public void removeMetric(MetricsKey key) {
		metricsMap.remove(key);
	}

	public void increment(MetricsKey key) {
		Number value = metricsMap.get(key);

		if(value != null) {
			if(value.getClass() == Integer.class) {
				metricsMap.put(key, value.intValue() + 1);
			}
			else if(value.getClass() == Double.class) {
				metricsMap.put(key, value.doubleValue() + 1D);
			}
			else if(value.getClass() == Float.class) {
				metricsMap.put(key, value.floatValue() + 1F);
			}
			else if(value.getClass() == Long.class) {
				metricsMap.put(key, value.longValue() + 1L);
			}
		}
	}

	public void deccrement(MetricsKey key) {
		Number value = metricsMap.get(key);

		if(value != null) {
			if(value.getClass() == Integer.class) {
				metricsMap.put(key, value.intValue() - 1);
			}
			else if(value.getClass() == Double.class) {
				metricsMap.put(key, value.doubleValue() - 1D);
			}
			else if(value.getClass() == Float.class) {
				metricsMap.put(key, value.floatValue() - 1F);
			}
			else if(value.getClass() == Long.class) {
				metricsMap.put(key, value.longValue() - 1L);
			}
		}
	}

	public Number getMetric(MetricsKey key) {
		return metricsMap.get(key);
	}
}


text:
package org.graylog.outputs.metrics;

import com.codahale.metrics.*;
import com.codahale.metrics.ganglia.GangliaReporter;
import com.codahale.metrics.graphite.Graphite;
import com.codahale.metrics.graphite.GraphiteReporter;
import com.google.common.util.concurrent.AtomicLongMap;
import com.google.inject.assistedinject.Assisted;
import com.readytalk.metrics.StatsD;
import com.readytalk.metrics.StatsDReporter;
import info.ganglia.gmetric4j.gmetric.GMetric;
import org.graylog2.plugin.Message;
import org.graylog2.plugin.configuration.Configuration;
import org.graylog2.plugin.configuration.ConfigurationRequest;
import org.graylog2.plugin.configuration.fields.BooleanField;
import org.graylog2.plugin.configuration.fields.ConfigurationField;
import org.graylog2.plugin.configuration.fields.NumberField;
import org.graylog2.plugin.configuration.fields.TextField;
import org.graylog2.plugin.outputs.MessageOutput;
import org.graylog2.plugin.outputs.MessageOutputConfigurationException;
import org.graylog2.plugin.streams.Stream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.inject.Inject;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.SortedSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

public class MetricsOutput implements MessageOutput {
    private static final Logger LOG = LoggerFactory.getLogger(MetricsOutput.class);

    public static final String CK_URL = "url";
    public static final String CK_PREFIX = "prefix";
    public static final String CK_RUN_RATE = "run_rate";
    public static final String CK_FIELDS = "fields";
    public static final String CK_INCLUDE_SOURCE = "include_source";
    public static final String CK_INCLUDE_TYPE = "include_type";
    public static final String CK_INCLUDE_FIELD_VALUE = "include_field_value";

    private final AtomicBoolean isRunning = new AtomicBoolean(false);
    private Configuration configuration;

    private GangliaReporter gangliaReporter;
    private GraphiteReporter graphiteReporter;
    private StatsDReporter statsDReporter;

    private final MetricRegistry registry = new MetricRegistry();
//    private AtomicLongMap<String> metricBuffer = AtomicLongMap.create();
    private ConcurrentHashMap<String, Double> metricBuffer = new ConcurrentHashMap<>();
    private List<String> metricFields;

    @Inject
    public MetricsOutput(@Assisted Stream stream, @Assisted Configuration configuration) throws MessageOutputConfigurationException {
        this.configuration = configuration;
        metricFields = Arrays.asList(configuration.getString(CK_FIELDS).split(","));

        metricBuffer.clear();

        if (!checkConfiguration(configuration)) {
            throw new RuntimeException("Missing configuration parameters.");
        }

        URI uri = parseUrl(configuration.getString(CK_URL));

        switch (uri.getScheme()) {
            case "graphite":
                graphiteReporter = createGraphiteReporter(uri);
                break;
            case "ganglia":
                gangliaReporter = createGangliaReporter(uri);
                break;
            case "statsd":
                statsDReporter = createStatsDReporter(uri);
                break;
            default:
                LOG.error("Metrics backend not supported!");
                break;
        }

        isRunning.set(true);
    }

    @Override
    public void write(Message message) throws Exception {
        SortedSet<String> currentMetrics = registry.getNames();
        final List<String> validTypes = Arrays.asList("gauge", "counter", "histogram", "meter");

        for (String field : metricFields) {
            field = field.trim();
            String fieldType = "gauge";
            if(field.contains(":")) {
                String[] tupel = field.split(":");
                String type = tupel[tupel.length-1];
                if(validTypes.contains(type)) {
                    fieldType = type;
                    field = tupel[0];
                }
            }

            LOG.trace("Trying to read field [{}] from message <{}>.", field, message.getId());
            if (!message.getFields().containsKey(field)) {
                LOG.debug("Message <{}> does not contain field [{}]:[{}]. Can not send data to metrics store.", message.getId(), field, fieldType);
                continue;
            }

            // Get value
            Object messageValue = message.getField(field);
            Number metricValue;
            if (messageValue instanceof Long) {
                metricValue = (Long) messageValue;
            } else if (messageValue instanceof Integer) {
                metricValue = (Integer) messageValue;
            } else if (messageValue instanceof Float) {
                metricValue = (Float) messageValue;
            } else if (messageValue instanceof Double) {
                metricValue = (Double) messageValue;
            } else if (fieldType.equals("counter")) {
                metricValue = 1;
            } else {
                LOG.error("Field [{}] of message <{}> is not of numeric type. Not sending to metrics store.",
                        field, message.getId());
                continue;
            }

            final String metricName = getMetricName(field, fieldType, message.getFields(), message.getSource());

            switch (fieldType.toLowerCase()) {
                case "gauge":
                    // Register metric
                    if (!currentMetrics.contains(metricName)) {
                        registry.register(metricName, new Gauge<Number>() {
                            @Override
                            public Number getValue() {
                                return metricBuffer.get(metricName);
                            }
                        });
                    }
                    // Update metric
                    metricBuffer.put(metricName, metricValue.doubleValue());
                    break;
                case "counter":
                    final Counter counter = registry.counter(metricName);
                    counter.inc();
                    break;
                case "histogram":
                    final Histogram histogram = registry.histogram(metricName);
                    histogram.update(metricValue.longValue());
                    break;
                case "meter":
                    final Meter meter = registry.meter(metricName);
                    meter.mark(metricValue.longValue());
                    break;
                default:
                    LOG.error("Unknown metric field type for [{}]: {}", metricName, fieldType);
            }
            LOG.debug("Metrics in Registry: {}", registry.getNames());

        }
    }

    @Override
    public void write(List<Message> messages) throws Exception {
        for (Message message : messages) {
            write(message);
        }
    }

    @Override
    public boolean isRunning() {
        return isRunning.get();
    }

    @Override
    public void stop() {
        LOG.info("Stopping Metrics output");

        registry.removeMatching(MetricFilter.ALL);
        metricBuffer.clear();

        if (gangliaReporter != null) {
            gangliaReporter.close();
        }
        if (graphiteReporter != null) {
            graphiteReporter.close();
        }
        if (statsDReporter != null) {
            statsDReporter.close();
        }

        isRunning.set(false);
    }

    public interface Factory extends MessageOutput.Factory<MetricsOutput> {
        @Override
        MetricsOutput create(Stream stream, Configuration configuration);
        @Override
        Config getConfig();
        @Override
        Descriptor getDescriptor();
    }

    public static class Config extends MessageOutput.Config {
        @Override
        public ConfigurationRequest getRequestedConfiguration() {
            final ConfigurationRequest configurationRequest = new ConfigurationRequest();

            configurationRequest.addField(new TextField(
                            CK_URL,
                            "URL of metrics endpoint",
                            "graphite://localhost:2003",
                            "URL of your Graphite/Ganglia/StatsD instance",
                            ConfigurationField.Optional.NOT_OPTIONAL)
            );

            configurationRequest.addField(new TextField(
                            CK_PREFIX,
                            "Prefix for metric names",
                            "org.graylog",
                            "Metric name will be 'prefix + field name'.",
                            ConfigurationField.Optional.OPTIONAL)
            );

            configurationRequest.addField(new TextField(
                            CK_FIELDS,
                            "Message fields to submit to the metrics store",
                            "response_time,db_time,view_time",
                            "A comma separated list of message field names that should be transmitted as gauge values." +
                            "Types like counter, meter, histogram can be set like: cache_hit:counter",
                            ConfigurationField.Optional.NOT_OPTIONAL)
            );

            configurationRequest.addField(new NumberField(
                            CK_RUN_RATE,
                            "Submission frequency (seconds)",
                            30,
                            "The period (in seconds) at which Graylog will submit metrics to the endpoint. " +
                            "Keep this number high to not flood the metrics store.",
                            ConfigurationField.Optional.NOT_OPTIONAL,
                            NumberField.Attribute.ONLY_POSITIVE)
            );

            configurationRequest.addField(new TextField(
                            CK_INCLUDE_FIELD_VALUE,
                            "Append the value of the given field to the end of the metric name.",
                            "",
                            "Metric name will be 'prefix + field name + value of another field'.",
                            ConfigurationField.Optional.OPTIONAL)
            );

            configurationRequest.addField(new BooleanField(
                            CK_INCLUDE_SOURCE,
                            "Include message source in metric name",
                            false,
                            "Metric name will be 'prefix + source + field name'.")
            );

            configurationRequest.addField(new BooleanField(
                            CK_INCLUDE_TYPE,
                            "Include field type in metric name",
                            false,
                            "Metric name will be 'prefix + field name + type'.")
            );

            return configurationRequest;
        }
    }

    private boolean checkConfiguration(Configuration config) {
        return config.stringIsSet(CK_URL)
                && config.stringIsSet(CK_FIELDS)
                && config.intIsSet(CK_RUN_RATE)
                && config.getInt(CK_RUN_RATE) > 0;
    }

    public static class Descriptor extends MessageOutput.Descriptor {
        public Descriptor() {
            super("Metrics Output", false, "",
                    "Forwards selected field values of your messages to Graphite/Ganglia/StatsD.");
        }
    }

    private String getMetricName(String field, String fieldType, Map<String, Object> fields, String messageSource) {
        String metricName;

        /* prefix message source to metric name */
        if (configuration.getBoolean(CK_INCLUDE_SOURCE)) {
            metricName = messageSource + "." + field;
        } else {
            metricName = field;
        }

        /* append field type to metric name */
        if (configuration.getBoolean(CK_INCLUDE_TYPE)) {
            metricName = metricName + "." + fieldType;
        }

        /* append field value to metric name */
        if (!configuration.getString(CK_INCLUDE_FIELD_VALUE).isEmpty()) {
            for (Map.Entry<String, Object> fieldEntry : fields.entrySet()) {
                if (fieldEntry.getKey().equals(configuration.getString(CK_INCLUDE_FIELD_VALUE))) {
                    metricName = metricName + "." + fieldEntry.getValue();
                }
            }
        }

        return metricName;
    }

    private URI parseUrl(String url) {
        URI uri = null;
        try {
            uri = new URI(url);
        } catch (URISyntaxException e) {
            LOG.error("Malformed metrics URL.");
        }
        return uri;
    }

    private GraphiteReporter createGraphiteReporter(URI uri) {
        final Graphite graphite = new Graphite(new InetSocketAddress(uri.getHost(), uri.getPort()));
        GraphiteReporter graphiteReporter = GraphiteReporter.forRegistry(registry)
                .prefixedWith(configuration.getString(CK_PREFIX))
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.MILLISECONDS)
                .filter(MetricFilter.ALL)
                .build(graphite);
        graphiteReporter.start(configuration.getInt(CK_RUN_RATE), TimeUnit.SECONDS);
        return graphiteReporter;
    }

    private GangliaReporter createGangliaReporter(URI uri) {
        GangliaReporter gangliaReporter = null;
        try {
            final GMetric ganglia = new GMetric(uri.getHost(), uri.getPort(), GMetric.UDPAddressingMode.MULTICAST, 1);
            gangliaReporter = GangliaReporter.forRegistry(registry)
                    .convertRatesTo(TimeUnit.SECONDS)
                    .convertDurationsTo(TimeUnit.MILLISECONDS)
                    .prefixedWith(configuration.getString(CK_PREFIX))
                    .build(ganglia);
            gangliaReporter.start(configuration.getInt(CK_RUN_RATE), TimeUnit.SECONDS);
        } catch (IOException e) {
            LOG.error("Can not connect to Ganglia server");
        }
        return gangliaReporter;
    }

    private StatsDReporter createStatsDReporter(URI uri) {
        StatsDReporter statsDReporter = StatsDReporter.forRegistry(registry)
                .prefixedWith(configuration.getString(CK_PREFIX))
                .convertRatesTo(TimeUnit.SECONDS)
                .convertDurationsTo(TimeUnit.MILLISECONDS)
                .filter(MetricFilter.ALL)
                .build(uri.getHost(), uri.getPort());
        statsDReporter.start(configuration.getInt(CK_RUN_RATE), TimeUnit.SECONDS);
        return statsDReporter;
    }
}