text:
#ifndef HTMLFrameElement_h
#define HTMLFrameElement_h

#include "core/html/HTMLFrameElementBase.h"

namespace WebCore {

class HTMLFrameElement FINAL : public HTMLFrameElementBase {
public:
    static PassRefPtr<HTMLFrameElement> create(const QualifiedName&, Document*);

    bool hasFrameBorder() const { return m_frameBorder; }

    bool noResize() const;

private:
    HTMLFrameElement(const QualifiedName&, Document*);

    virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;

    virtual bool rendererIsNeeded(const NodeRenderingContext&);
    virtual RenderObject* createRenderer(RenderStyle*);

    virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;

    virtual bool allowFullScreen() const { return false; }

    bool m_frameBorder;
    bool m_frameBorderSet;
};

} // namespace WebCore

#endif // HTMLFrameElement_h


text:
(function() {
  var Lexer, compile, fs, lexer, parser, path;
  path = require('path');
  Lexer = require('./lexer').Lexer;
  parser = require('./parser').parser;
  if (require.extensions) {
    fs = require('fs');
    require.extensions['.coffee'] = function(module, filename) {
      var content;
      content = compile(fs.readFileSync(filename, 'utf8'));
      return module._compile(content, filename);
    };
  } else if (require.registerExtension) {
    require.registerExtension('.coffee', function(content) {
      return compile(content);
    });
  }
  exports.VERSION = '0.9.4';
  exports.helpers = require('./helpers');
  exports.compile = (compile = function(code, options) {
    options || (options = {});
    try {
      return (parser.parse(lexer.tokenize(code))).compile(options);
    } catch (err) {
      if (options.fileName) {
        err.message = ("In " + (options.fileName) + ", " + (err.message));
      }
      throw err;
    }
  });
  exports.tokens = function(code, options) {
    return lexer.tokenize(code, options);
  };
  exports.nodes = function(code, options) {
    return parser.parse(lexer.tokenize(code, options));
  };
  exports.run = function(code, options) {
    var root;
    root = module;
    while (root.parent) {
      root = root.parent;
    }
    root.filename = options.fileName;
    if (root.moduleCache) {
      root.moduleCache = {};
    }
    return path.extname(root.filename) !== '.coffee' || require.extensions ? root._compile(exports.compile(code, options), root.filename) : root._compile(code, root.filename);
  };
  exports.eval = function(code, options) {
    var __dirname, __filename;
    __filename = options.fileName;
    __dirname = path.dirname(__filename);
    return eval(exports.compile(code, options));
  };
  lexer = new Lexer;
  parser.lexer = {
    lex: function() {
      var token;
      token = this.tokens[this.pos] || [""];
      this.pos += 1;
      this.yylineno = token[2];
      this.yytext = token[1];
      return token[0];
    },
    setInput: function(tokens) {
      this.tokens = tokens;
      return (this.pos = 0);
    },
    upcomingInput: function() {
      return "";
    }
  };
  parser.yy = require('./nodes');
}).call(this);

redpajama_set_name: RedPajamaGithub


text:
package org.pignat.app.qr2gerber;

public class QRtoGerber
{
	private double size;
	private QRPlusInfo qrcode;

	private static final String VERSION = "0.2";

	private static final int INTEGER_PLACES = 4;
	private static final int DECIMAL_PLACES = 4;
	private static final int SCALE = (int) Math.pow(10, DECIMAL_PLACES);
	private static final int D_CODE = 999;

	/**
	 * Workaround for programs unhappy with a gerber lines whith zero in a
	 * coordinate. These software refuse to draw this kind of lines, because
	 * after adding the line with, the coordinate will be negative.
	 *
	 * The workaround consist of adding an offset so the whole drawing fits has
	 * positive coordinates.
	 *
	 * Known software with this bug include
	 * * PCAD 2006 sp2
	 */
	private static final boolean WORKAROUND_OFFSET = true;

	/**
	 * Some program import flashing (D3 gerber command) as pads, and prevents
	 * pad from beeing moved to the silk screen layer.
	 *
	 * The workaround consists of drawing a minimal line instead of flashing.
	 *
	 * Known software with this bug include
	 * * PCAD 2006 sp2
	 */
	private static final boolean WORKAROUND_FLASHING = true;

	/**
	 * @param sz The original QRCode
	 * @param sz The final size
	 */
	public QRtoGerber(QRPlusInfo q, double sz)
	{
		qrcode = q;
		size = sz;
	}

	public double lineSize()
	{
		return (size/qrcode.size());
	}

	private String draw(QRPlusInfo matrix, int sx, int sy, int sdx, int sdy)
	{
		/* scale */
		int f = (int)(SCALE*size/matrix.size());

		int x = f * sx;
		int dx = f * sdx;
		int dy = f * sdy;

		/* Invert Y for gerber */
		int y = f * (matrix.size()-1-sy);

		if (WORKAROUND_OFFSET)
		{
			x += SCALE;
			y += SCALE;
		}

		String format = "%06d";

		if (dx == 0 && dy == 0)
		{
			if (!WORKAROUND_FLASHING)
			{
				return "X" + String.format(format, x) + "Y" + String.format(format, y) + "D3*\n";
			}
			else
			{
				dx = 1;
			}
		}
		return "X" + String.format(format, x) + "Y" + String.format(format, y) + "D2*\n"
		+ "X" + String.format(format, x+dx) + "Y" + String.format(format, y+dy) + "D1*\n";
	}

	public String toGerber()
	{
		double lineSize = lineSize();
		StringBuilder s = new StringBuilder();
		String sizeString = String.format("%.4f", lineSize);

		s.append("G04 File generated using https://github.com/RandomReaper/qr2gerber *\n");

		s.append("G04 encoded with QRtoGerber version " + VERSION + " *\n");
		s.append("G04 encoded string : '" + qrcode.string() + "' *\n");
		s.append("G04 target size : " + size + " mm*\n");

		s.append("G04 line width = " + (int)(lineSize()*1000) + " um" +  " *\n");
		s.append("%INQR2GERBER.GBR*%\n");

		/* Specify format */
		s.append("%ICAS*%\n");
		s.append("%MOMM*%\n");
		s.append("%ADD" + D_CODE +"R, "+ sizeString + "X" + sizeString + "*%\n");
		s.append("%FSLAX"+INTEGER_PLACES+DECIMAL_PLACES+"Y"+INTEGER_PLACES+DECIMAL_PLACES+"*%\n");
		s.append("%SFA1B1*%\n");
		s.append("%OFA0.000B0.000*%\n");
		s.append("G04*\n");
		s.append("G71*\n");
		s.append("G90*\n");
		s.append("G01*\n");
		s.append("D2*\n");
		s.append("%LNTop*%\n");
		s.append("D" + D_CODE + "*\n");

		/* Draw horizontal lines  */
		for (int y = 0; y < qrcode.size(); y++)
		{
			int x = 0;
			int len = 0;
			while (x < qrcode.size())
			{
				if (qrcode.get(x, y))
				{
					len++;
				}
				if (len > 0 && !qrcode.get(x, y))
				{
					s.append(draw(qrcode, x-len, y, len-1, 0));
					len = 0;
				}
				x++;
			}
			if (len > 0)
			{
				s.append(draw(qrcode, x-len, y, len-1, 0));
			}
		}

		s.append("D02M02*\n");

		return s.toString();
	}
}


text:
package org.jkiss.dbeaver.registry;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentDescription;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBPImage;
import org.jkiss.dbeaver.model.app.DBPProject;
import org.jkiss.dbeaver.model.app.DBPResourceHandler;
import org.jkiss.dbeaver.model.app.DBPResourceHandlerDescriptor;
import org.jkiss.dbeaver.model.impl.AbstractDescriptor;
import org.jkiss.utils.ArrayUtils;
import org.jkiss.utils.CommonUtils;
import org.osgi.service.prefs.BackingStoreException;

import java.util.*;

/**
 * ResourceHandlerDescriptor
 */
public class ResourceHandlerDescriptor extends AbstractDescriptor implements DBPResourceHandlerDescriptor {
    private static final Log log = Log.getLog(ResourceHandlerDescriptor.class);

    public static final String EXTENSION_ID = "org.jkiss.dbeaver.resourceHandler"; //$NON-NLS-1$

    private String id;
    private String name;
    private boolean managable;
    private DBPImage icon;
    private ObjectType handlerType;
    private DBPResourceHandler handler;
    private List<IContentType> contentTypes = new ArrayList<>();
    private List<ObjectType> resourceTypes = new ArrayList<>();
    private List<String> roots = new ArrayList<>();
    private String defaultRoot;
    private final Map<String, String> projectRoots = new HashMap<>();

    public ResourceHandlerDescriptor(IConfigurationElement config) {
        super(config);

        this.id = config.getAttribute(RegistryConstants.ATTR_ID);
        this.name = config.getAttribute(RegistryConstants.ATTR_NAME);
        this.managable = CommonUtils.toBoolean(config.getAttribute(RegistryConstants.ATTR_MANAGABLE));
        this.icon = iconToImage(config.getAttribute(RegistryConstants.ATTR_ICON));
        this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_CLASS));
        for (IConfigurationElement contentTypeBinding : ArrayUtils.safeArray(config.getChildren("contentTypeBinding"))) {
            String contentTypeId = contentTypeBinding.getAttribute("contentTypeId");
            if (!CommonUtils.isEmpty(contentTypeId)) {
                IContentType contentType = Platform.getContentTypeManager().getContentType(contentTypeId);
                if (contentType != null) {
                    contentTypes.add(contentType);
                } else {
                    log.warn("Content type '" + contentTypeId + "' not recognized");
                }
            }
        }
        for (IConfigurationElement resourceTypeBinding : ArrayUtils.safeArray(config.getChildren("resourceTypeBinding"))) {
            String resourceType = resourceTypeBinding.getAttribute("resourceType");
            if (!CommonUtils.isEmpty(resourceType)) {
                resourceTypes.add(new ObjectType(resourceType));
            }
        }
        for (IConfigurationElement rootConfig : ArrayUtils.safeArray(config.getChildren("root"))) {
            String folder = rootConfig.getAttribute("folder");
            if (!CommonUtils.isEmpty(folder)) {
                roots.add(folder);
            }
            if ("true".equals(rootConfig.getAttribute("default"))) {
                defaultRoot = folder;
            }
        }
        if (CommonUtils.isEmpty(defaultRoot) && !CommonUtils.isEmpty(roots)) {
            defaultRoot = roots.get(0);
        }
    }

    void dispose() {
        this.handler = null;
        this.handlerType = null;
    }

    @Override
    public String getId() {
        return id;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public boolean isManagable() {
        return managable;
    }

    @Override
    public DBPImage getIcon() {
        return icon;
    }

    public synchronized DBPResourceHandler getHandler() {
        if (handler == null) {
            Class<? extends DBPResourceHandler> clazz = handlerType.getObjectClass(DBPResourceHandler.class);
            if (clazz == null) {
                return null;
            }
            try {
                handler = clazz.getConstructor().newInstance();
            } catch (Exception e) {
                log.error("Can't instantiate resource handler", e);
            }
        }
        return handler;
    }

    public boolean canHandle(IResource resource) {
        if (!contentTypes.isEmpty() && resource instanceof IFile) {
            try {
                IContentDescription contentDescription = ((IFile) resource).getContentDescription();
                if (contentDescription != null) {
                    IContentType fileContentType = contentDescription.getContentType();
                    if (fileContentType != null && contentTypes.contains(fileContentType)) {
                        return true;
                    }
                }
            } catch (CoreException e) {
                log.debug("Can't obtain content description for '" + resource.getName() + "'", e);
            }
            // Check for file extension
            String fileExtension = resource.getFileExtension();
            for (IContentType contentType : contentTypes) {
                String[] ctExtensions = contentType.getFileSpecs(IContentType.FILE_EXTENSION_SPEC);
                if (!ArrayUtils.isEmpty(ctExtensions)) {
                    for (String ext : ctExtensions) {
                        if (ext.equalsIgnoreCase(fileExtension)) {
                            return true;
                        }
                    }
                }
            }
        }
        if (!resourceTypes.isEmpty()) {
            for (ObjectType objectType : resourceTypes) {
                if (objectType.appliesTo(resource, null)) {
                    return true;
                }
            }
        }
        return false;
    }

    public Collection<IContentType> getContentTypes() {
        return contentTypes;
    }

    public Collection<ObjectType> getResourceTypes() {
        return resourceTypes;
    }

    public String getDefaultRoot(DBPProject project) {
        synchronized (projectRoots) {
            String root = projectRoots.get(project.getName());
            if (root != null) {
                return root;
            }
        }
        try {
            IEclipsePreferences resourceHandlers = getResourceHandlerPreferences(project, DBPResourceHandlerDescriptor.RESOURCE_ROOT_FOLDER_NODE);
            String root = resourceHandlers.get(id, defaultRoot);
            boolean isInvalidRoot = root != null && CommonUtils.isEmptyTrimmed(root);
            synchronized (projectRoots) {
                projectRoots.put(project.getName(), isInvalidRoot ? defaultRoot : root);
            }
            if (isInvalidRoot) {
                root = defaultRoot;
                resourceHandlers.put(id, root);
                try {
                    resourceHandlers.flush();
                } catch (BackingStoreException e) {
                    log.error(e);
                }
            }
            return root;
        } catch (Exception e) {
            log.error("Can't obtain resource handler preferences", e);
            return null;
        }
    }

    @Override
    public void setDefaultRoot(DBPProject project, String rootPath) {
        IEclipsePreferences resourceHandlers = getResourceHandlerPreferences(project, DBPResourceHandlerDescriptor.RESOURCE_ROOT_FOLDER_NODE);
        resourceHandlers.put(getId(), rootPath);
        synchronized (projectRoots) {
            projectRoots.put(project.getName(), rootPath);
        }
        try {
            resourceHandlers.flush();
        } catch (BackingStoreException e) {
            log.error(e);
        }
    }

    public List<String> getRoots() {
        return roots;
    }

    @Override
    public String toString() {
        return id;
    }

    private static IEclipsePreferences getResourceHandlerPreferences(DBPProject project, String node) {
        IEclipsePreferences projectSettings = getProjectPreferences(project);
        return (IEclipsePreferences) projectSettings.node(node);
    }

    private static synchronized IEclipsePreferences getProjectPreferences(DBPProject project) {
        return new ProjectScope(project.getEclipseProject()).getNode("org.jkiss.dbeaver.project.resources");
    }

}


text:
#ifndef _MACHINE_IPL_H_
#define	_MACHINE_IPL_H_

#include <machine/ipl.h>	/* XXX "machine" means cpu for i386 */

/*
 * Software interrupt bit numbers in priority order.  The priority only
 * determines which swi will be dispatched next; a higher priority swi
 * may be dispatched when a nested h/w interrupt handler returns.
 */
#define	SWI_TTY		(NHWI + 0)
#define	SWI_NET		(NHWI + 1)
#define	SWI_CAMNET	(NHWI + 2)
#define	SWI_CAMBIO	(NHWI + 3)
#define	SWI_VM		(NHWI + 4)
#define	SWI_CLOCK	30
#define	SWI_AST		31

/*
 * Corresponding interrupt-pending bits for ipending.
 */
#define	SWI_TTY_PENDING		(1 << SWI_TTY)
#define	SWI_NET_PENDING		(1 << SWI_NET)
#define	SWI_CAMNET_PENDING	(1 << SWI_CAMNET)
#define	SWI_CAMBIO_PENDING	(1 << SWI_CAMBIO)
#define	SWI_VM_PENDING		(1 << SWI_VM)
#define	SWI_CLOCK_PENDING	(1 << SWI_CLOCK)
#define	SWI_AST_PENDING		(1 << SWI_AST)

/*
 * Corresponding interrupt-disable masks for cpl.  The ordering is now by
 * inclusion (where each mask is considered as a set of bits). Everything
 * except SWI_AST_MASK includes SWI_CLOCK_MASK so that softclock() doesn't
 * run while other swi handlers are running and timeout routines can call
 * swi handlers.  Everything includes SWI_AST_MASK so that AST's are masked
 * until just before return to user mode.  SWI_TTY_MASK includes SWI_NET_MASK
 * in case tty interrupts are processed at splsofttty() for a tty that is in
 * SLIP or PPP line discipline (this is weaker than merging net_imask with
 * tty_imask in isa.c - splimp() must mask hard and soft tty interrupts, but
 * spltty() apparently only needs to mask soft net interrupts).
 */
#define	SWI_TTY_MASK	(SWI_TTY_PENDING | SWI_CLOCK_MASK | SWI_NET_MASK)
#define	SWI_NET_MASK	(SWI_NET_PENDING | SWI_CLOCK_MASK)
#define	SWI_CAMNET_MASK	(SWI_CAMNET_PENDING | SWI_CLOCK_MASK)
#define	SWI_CAMBIO_MASK	(SWI_CAMBIO_PENDING | SWI_CLOCK_MASK)
#define	SWI_VM_MASK	(SWI_VM_PENDING | SWI_CLOCK_MASK)
#define	SWI_CLOCK_MASK	(SWI_CLOCK_PENDING | SWI_AST_MASK)
#define	SWI_AST_MASK	SWI_AST_PENDING
#define	SWI_MASK	(~HWI_MASK)

#ifndef	LOCORE

/*
 * cpl is preserved by interrupt handlers so it is effectively nonvolatile.
 * ipending and idelayed are changed by interrupt handlers so they are
 * volatile.
 */
extern	unsigned bio_imask;	/* group of interrupts masked with splbio() */
extern	unsigned cam_imask;	/* group of interrupts masked with splcam() */
extern	unsigned cpl;		/* current priority level mask */
extern	volatile unsigned idelayed;	/* interrupts to become pending */
extern	volatile unsigned ipending;	/* active interrupts masked by cpl */
extern	unsigned net_imask;	/* group of interrupts masked with splimp() */
extern	unsigned stat_imask;	/* interrupts masked with splstatclock() */
extern	unsigned tty_imask;	/* group of interrupts masked with spltty() */

/*
 * The volatile bitmap variables must be set atomically.  This normally
 * involves using a machine-dependent bit-set or `or' instruction.
 */
#define	setdelayed()	setbits(&ipending, loadandclear(&idelayed))
#define	setsoftast()	setbits(&ipending, SWI_AST_PENDING)
#define	setsoftclock()	setbits(&ipending, SWI_CLOCK_PENDING)
#define	setsoftnet()	setbits(&ipending, SWI_NET_PENDING)
#define	setsofttty()	setbits(&ipending, SWI_TTY_PENDING)
#define	setsoftcamnet()	setbits(&ipending, SWI_CAMNET_PENDING)
#define	setsoftcambio()	setbits(&ipending, SWI_CAMBIO_PENDING)
#define	setsoftvm()	setbits(&ipending, SWI_VM_PENDING)

#define	schedsofttty()		setbits(&idelayed, SWI_TTY_PENDING)
#define	schedsoftnet()		setbits(&idelayed, SWI_NET_PENDING)
#define	schedsoftcamnet()	setbits(&idelayed, SWI_CAMNET_PENDING)
#define	schedsoftcambio()	setbits(&idelayed, SWI_CAMBIO_PENDING)
#define	schedsoftvm()		setbits(&idelayed, SWI_VM_PENDING)

#define	softclockpending()	(ipending & SWI_CLOCK_PENDING)

#ifdef __GNUC__

void	splz	__P((void));

#define	GENSPL(name, set_cpl) \
static __inline int name(void)			\
{						\
	unsigned x;				\
						\
	__asm __volatile("" : : : "memory");	\
	x = cpl;				\
	set_cpl;				\
	return (x);				\
}

GENSPL(splbio, cpl |= bio_imask)
GENSPL(splclock, cpl = HWI_MASK | SWI_MASK)
GENSPL(splhigh, cpl = HWI_MASK | SWI_MASK)
GENSPL(splimp, cpl |= net_imask)
GENSPL(splnet, cpl |= SWI_NET_MASK)
GENSPL(splcam, cpl |= cam_imask)
GENSPL(splsoftcam, cpl |= SWI_CAMBIO_MASK | SWI_CAMNET_MASK)
GENSPL(splsoftcambio, cpl |= SWI_CAMBIO_MASK)
GENSPL(splsoftcamnet, cpl |= SWI_CAMNET_MASK)
GENSPL(splsoftclock, cpl = SWI_CLOCK_MASK)
GENSPL(splsofttty, cpl |= SWI_TTY_MASK)
GENSPL(splstatclock, cpl |= stat_imask)
GENSPL(spltty, cpl |= tty_imask)
GENSPL(splvm, cpl |= net_imask | bio_imask)
GENSPL(splsoftvm, cpl |= SWI_VM_MASK)

static __inline void
spl0(void)
{
	cpl = SWI_AST_MASK;
	if (ipending & ~SWI_AST_MASK)
		splz();
}

static __inline void
splx(int ipl)
{
	cpl = ipl;
	if (ipending & ~ipl)
		splz();
}

#endif /* __GNUC__ */

#endif /* !LOCORE */

#endif /* !_MACHINE_IPL_H_ */


text:
var test = require('tap').test
var crypto = require('crypto')
var fs = require('fs')

var server = require('./lib/server.js')
var common = require('./lib/common.js')
var client = common.freshClient()

var URI = 'http://localhost:1337/'
var USERNAME = 'username'
var PASSWORD = '%1234@asdf%'
var EMAIL = 'i@izs.me'
var METADATA = require('../package.json')
var ACCESS = 'public'
// not really a tarball, but doesn't matter
var BODY_PATH = require.resolve('../package.json')
var BODY = fs.createReadStream(BODY_PATH)
var AUTH = {
  username: USERNAME,
  password: PASSWORD,
  email: EMAIL
}
var PARAMS = {
  metadata: METADATA,
  access: ACCESS,
  body: BODY,
  auth: AUTH
}

test('publish-new-mixcase-name', function (t) {
  var pd = fs.readFileSync(BODY_PATH)

  // change to mixed-case name
  METADATA.name = 'npm-Registry-Client'

  server.expect('/npm-Registry-Client', function (req, res) {
    t.equal(req.method, 'PUT')
    var b = ''
    req.setEncoding('utf8')
    req.on('data', function (d) {
      b += d
    })

    req.on('end', function () {
      var o = JSON.parse(b)
      t.equal(o._id, 'npm-Registry-Client')
      t.equal(o['dist-tags'].latest, METADATA.version)
      t.equal(o.access, ACCESS)
      t.has(o.versions[METADATA.version], METADATA)
      t.same(o.maintainers, [{ name: 'username', email: 'i@izs.me' }])
      t.same(o.maintainers, o.versions[METADATA.version].maintainers)

      var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz']
      t.same(att.data, pd.toString('base64'))

      var hash = crypto.createHash('sha1').update(pd).digest('hex')
      t.equal(o.versions[METADATA.version].dist.shasum, hash)

      res.statusCode = 403
      res.json({error: 'Name must be lower-case'})
    })
  })

  client.publish(URI, PARAMS, function (er, data, json, res) {
    t.assert(er instanceof Error) // expect error

    // TODO: need a test that ensures useful error message
    // t.similar(data.error, /must be lower-case/)

    server.close()
    t.end()
  })
})


text:
package co.edu.uniandes.csw.bookstore.dtos.minimum;

import co.edu.uniandes.csw.bookstore.entities.ScoreEntity;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @generated
 */
@XmlRootElement
public class ScoreMinimumDTO implements Serializable{

    private Long id;
    private Float score;
    private String description;

    /**
     * @generated
     */
    public ScoreMinimumDTO() {
    }

    /**
     * Crea un objeto ScoreMinimumDTO a partir de un objeto ScoreEntity.
     *
     * @param entity Entidad ScoreEntity desde la cual se va a crear el nuevo objeto.
     * @generated
     */
    public ScoreMinimumDTO(ScoreEntity entity) {
	   if (entity!=null){
        this.id=entity.getId();
        this.score=entity.getScore();
        this.description=entity.getDescription();
       }
    }

    /**
     * Convierte un objeto ScoreMinimumDTO a ScoreEntity.
     *
     * @return Nueva objeto ScoreEntity.
     * @generated
     */
    public ScoreEntity toEntity() {
        ScoreEntity entity = new ScoreEntity();
        entity.setId(this.getId());
        entity.setScore(this.getScore());
        entity.setDescription(this.getDescription());
    return entity;
    }

    /**
     * Obtiene el atributo id.
     *
     * @return atributo id.
     * @generated
     */
    public Long getId() {
        return id;
    }

    /**
     * Establece el valor del atributo id.
     *
     * @param id nuevo valor del atributo
     * @generated
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * Obtiene el atributo score.
     *
     * @return atributo score.
     * @generated
     */
    public Float getScore() {
        return score;
    }

    /**
     * Establece el valor del atributo score.
     *
     * @param score nuevo valor del atributo
     * @generated
     */
    public void setScore(Float score) {
        this.score = score;
    }

    /**
     * Obtiene el atributo description.
     *
     * @return atributo description.
     * @generated
     */
    public String getDescription() {
        return description;
    }

    /**
     * Establece el valor del atributo description.
     *
     * @param description nuevo valor del atributo
     * @generated
     */
    public void setDescription(String description) {
        this.description = description;
    }

}


text:
require 'spree_core'
require 'delayed_job_active_record'
require 'spree_license_key/engine'


text:
package org.estatio.module.lease.integtests.invoicing.summary;

import java.util.List;

import javax.inject.Inject;

import org.junit.Before;
import org.junit.Test;

import org.apache.isis.applib.fixturescripts.FixtureScript;

import org.estatio.module.invoice.dom.Invoice;
import org.estatio.module.invoice.dom.InvoiceStatus;
import org.estatio.module.lease.dom.invoicing.InvoiceForLease;
import org.estatio.module.lease.dom.invoicing.summary.InvoiceSummaryForPropertyDueDateStatus;
import org.estatio.module.lease.dom.invoicing.summary.InvoiceSummaryForPropertyDueDateStatusRepository;
import org.estatio.module.lease.fixtures.invoice.enums.InvoiceForLease_enum;
import org.estatio.module.lease.integtests.LeaseModuleIntegTestAbstract;

import static org.assertj.core.api.Assertions.assertThat;

public class InvoiceSummaryforPropertyDueDateStatus_IntegTest extends LeaseModuleIntegTestAbstract {

    public static class LastInvoiceNumberIntegTest extends
            InvoiceSummaryforPropertyDueDateStatus_IntegTest {

        @Before
        public void setupData() {
            runFixtureScript(new FixtureScript() {
                @Override
                protected void execute(ExecutionContext ec) {
                    ec.executeChildren(this,
                            InvoiceForLease_enum.OxfPoison003Gb);
                }
            });
        }

        @Test
        public void happy_case() throws Exception {

            // given
            InvoiceSummaryForPropertyDueDateStatus summary = findSummary(InvoiceStatus.NEW);

            // when
            String lastInvoiceNumberBefore = summary.getLastInvoiceNumber();
            InvoiceForLease invoice = summary.getInvoices().get(0);
            Invoice invoiceApproved = mixin(InvoiceForLease._approve.class, invoice).$$();
            Invoice invoiceInvoiced = mixin(InvoiceForLease._invoice.class, invoiceApproved).$$(invoiceApproved.getInvoiceDate());
            summary = findSummary(InvoiceStatus.INVOICED);
            String lastInvoiceNumberAfter = summary.getLastInvoiceNumber();

            // then
            assertThat(lastInvoiceNumberBefore).isEqualTo("OXF-0000");
            assertThat(lastInvoiceNumberAfter).isEqualTo("OXF-0001");
            assertThat(lastInvoiceNumberAfter).isEqualTo(invoiceInvoiced.getInvoiceNumber());

        }

    }

    InvoiceSummaryForPropertyDueDateStatus findSummary(final InvoiceStatus status) {

        // clears out queryResultsCache
        transactionService.nextTransaction();

        List<InvoiceSummaryForPropertyDueDateStatus> summaries = invoiceSummaryRepository.findInvoicesByStatus(status);
        assertThat(summaries).hasSize(1);
        return summaries.get(0);
    }

    @Inject
    InvoiceSummaryForPropertyDueDateStatusRepository invoiceSummaryRepository;

}


text:
package stanhebben.zenscript.parser.expression;

import stanhebben.zenscript.annotations.OperatorType;
import stanhebben.zenscript.compiler.IEnvironmentMethod;
import stanhebben.zenscript.expression.Expression;
import stanhebben.zenscript.expression.partial.IPartialExpression;
import stanhebben.zenscript.type.ZenType;
import stanhebben.zenscript.util.ZenPosition;

/**
 * @author Stanneke
 */
public class ParsedExpressionIndex extends ParsedExpression {

    private final ParsedExpression value;
    private final ParsedExpression index;

    public ParsedExpressionIndex(ZenPosition position, ParsedExpression value, ParsedExpression index) {
        super(position);

        this.value = value;
        this.index = index;
    }

    @Override
    public IPartialExpression compile(IEnvironmentMethod environment, ZenType predictedType) {
        // TODO: improve type prediction for this
        Expression cValue = value.compile(environment, null).eval(environment);
        Expression cIndex = index.compile(environment, null).eval(environment);
        return cValue.getType().binary(getPosition(), environment, cValue, cIndex, OperatorType.INDEXGET);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<ldml xmlns:sil="urn://www.sil.org/ldml/0.1">
	<identity>
		<version number="0.0.1"/>
		<generation date="2018-11-20 22:06:30"/>
		<language type="mxv"/>
		<special>
			<sil:identity defaultRegion="MX" script="Latn" draft="generated"/>
		</special>
	</identity>
	<localeDisplayNames>
		<languages>
			<language type="mxv">Tuꞌun Sávi</language>
		</languages>
		<special>
			<sil:names>
				<sil:name xml:lang="en">Metlatónoc Mixtec</sil:name>
			</sil:names>
		</special>
	</localeDisplayNames>
	<layout>
		<orientation>
			<characterOrder>left-to-right</characterOrder>
		</orientation>
	</layout>
	<characters>
		<exemplarCharacters>[a â b c d e f g h i î j k l m n ñ o p q r s t u v x y z \u0300 \u0301 \u0308 \u0331 ꞌ]</exemplarCharacters>
		<exemplarCharacters type="punctuation">[! ( ) * , . \: ; ? ¡ ¿ ― ' ' " "]</exemplarCharacters>
		<exemplarCharacters type="punctuation" alt="proposed-dbl" draft="suspect">[!'-*,.\:;?\^\u00A1\u00BF\u2014\u2015\u2018\u2019\u201C\u201D]</exemplarCharacters>
		<exemplarCharacters type="index">[A Â B C D E F G H I Î J K L M N Ñ O P Q R S T U V X Y Z Ꞌ]</exemplarCharacters>
		<special>
			<sil:exemplarCharacters type="verseSegments">[a b c d e f g h i j k l m n o p q r s t u v w x y z {aa} {bb} {cc} {dd} {ee} {ff} {gg} {hh} {ii} {jj} {kk} {ll} {mm} {nn} {oo} {pp} {qq} {rr} {ss} {tt} {uu} {vv} {ww} {xx} {yy} {zz}]</sil:exemplarCharacters>
		</special>
	</characters>
	<delimiters>
		<quotationStart>"</quotationStart>
		<quotationEnd>"</quotationEnd>
		<alternateQuotationStart>'</alternateQuotationStart>
		<alternateQuotationEnd>'</alternateQuotationEnd>
		<special>
			<sil:matched-pairs>
				<sil:matched-pair open="(" close=")" paraClose="false"/>
				<sil:matched-pair open="[" close="]" paraClose="false"/>
				<sil:matched-pair open="{" close="}" paraClose="false"/>
				<sil:matched-pair open="¡" close="!" paraClose="false"/>
				<sil:matched-pair open="¿" close="?" paraClose="false"/>
				<sil:matched-pair open=""" close=""" paraClose="false"/>
			</sil:matched-pairs>
			<sil:quotation-marks paraContinueType="all">
				<sil:quotationContinue/>
				<sil:quotation open=""" close=""" level="3"/>
			</sil:quotation-marks>
		</special>
	</delimiters>
	<special>
		<sil:external-resources>
			<sil:font name="Charis SIL" types="default">
				<sil:url>https://wirl.api.sil.org/CharisSILReg&type=ttf</sil:url>
			</sil:font>
			<sil:font name="Noto Sans"><!--types="ui"-->
				<sil:url>https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Regular.ttf</sil:url>
			</sil:font>
			<sil:font name="Noto Serif">
				<sil:url>https://github.com/googlefonts/noto-fonts/raw/main/hinted/ttf/NotoSerif/NotoSerif-Regular.ttf</sil:url>
			</sil:font>
			<sil:sampletext type="udhr">
				<sil:url>https://unicode.org/udhr/d/udhr_mxv.txt</sil:url>
			</sil:sampletext>
		</sil:external-resources>
	</special>
</ldml>


text:
package elasticsearch.esapi.resp;

import java.util.ArrayList;

/**
 * Created by I311352 on 11/14/2016.
 */
public class ESMultiGetResponse {
    private ArrayList<ESGetByIdResponse> docs;

    public ArrayList<ESGetByIdResponse> getDocs() {
        return docs;
    }

    public void setDocs(ArrayList<ESGetByIdResponse> docs) {
        this.docs = docs;
    }

    @Override
    public String toString() {
        return "ESMultiGetResponse{" +
                "docs=" + docs +
                '}';
    }
}


text:
describe('ionItem directive', function() {
  beforeEach(module('ionic'));
  function setup(attrs, content) {
    var el;
    inject(function($rootScope, $compile) {
      el = angular.element('<ion-item '+(attrs||'')+'>').html(content || '');
      el.data('$ionListController', {});
      $compile(el)($rootScope);
      $rootScope.$apply();
    });
    return el;
  }

  it('should be simple item by default', function() {
    var el = setup('', '{{1}} 2');
    expect(el.html()).toBe('1 2');
    expect(el.hasClass('item')).toBe(true);
    expect(el.hasClass('item-complex')).toBe(false);
  });
  it('should be complex if ui-sref', function() {
    var el = setup('ui-sref="something"');
    expect(el.hasClass('item item-complex')).toBe(true);
    expect(el.children()[0].tagName).toBe('A');
    expect(el.children().hasClass('item-content')).toBe(true);
  });
  ['href', 'ng-href'].forEach(function(attr) {
    it('should be complex anchor if '+attr+' is defined', function() {
      var el = setup(attr+'="something/{{foo}}"');
      expect(el.hasClass('item item-complex')).toBe(true);
      expect(el.children()[0].tagName).toBe('A');
      expect(el.children().hasClass('item-content')).toBe(true);
      expect(el.children().attr('href')).toBe('something/');
      el.scope().$apply('foo = 44');
      expect(el.children().attr('href')).toBe('something/44');
    });
  });
  it('complex item should not have target by default', function() {
    var el = setup('href="foo"');
    expect(el.find('a').attr('target')).toBeUndefined();
  });
  it('complex item should have target if specified', function() {
    var el = setup('href="foo" target="bar"');
    expect(el.find('a').attr('target')).toBe('bar');
  });
  ['ion-option-button','ion-reorder-button','ion-delete-button'].forEach(function(tag) {
    it('should be complex div if '+tag+' is found', function() {
      var el = setup('', tag);
      expect(el.hasClass('item item-complex')).toBe(true);
      expect(el.children()[0].tagName).toBe('DIV');
      expect(el.children().hasClass('item-content')).toBe(true);
      expect(el.children().html()).toBe(tag);
    });
  });
});

describe('ionDeleteButton directive', function() {
  beforeEach(module('ionic'));
  it('should have delete button', inject(function($compile, $rootScope) {
    var setSpy = jasmine.createSpy('setDeleteButton');
    var el = angular.element('<ion-item><ion-delete-button></ion-delete-button></ion-item>');
    el.data('$ionListController', {
      showDelete: function() { return false; }
    });
    $compile(el)($rootScope.$new());
    $rootScope.$apply();

    var deleteContainer = angular.element(el[0].querySelector('.item-left-edit.item-delete'));
    expect(deleteContainer.length).toBe(1);
    expect(deleteContainer.children().hasClass('button icon button-icon')).toBe(true);
  }));
  it('should unhide if delete is shown', inject(function($compile, $rootScope) {
    var setSpy = jasmine.createSpy('setDeleteButton');
    var el = angular.element('<ion-item><ion-delete-button></ion-delete-button></ion-item>');
    el.data('$ionListController', {
      showDelete: function() { return true; }
    });
    $compile(el)($rootScope.$new());
    $rootScope.$apply();

    var deleteContainer = angular.element(el[0].querySelector('.item-left-edit.item-delete'));
    expect(deleteContainer.length).toBe(1);
    expect(deleteContainer.hasClass('visible')).toBe(true);
    expect(deleteContainer.hasClass('active')).toBe(true);
  }));
});

describe('ionReorderButton directive', function() {
  beforeEach(module('ionic'));
  it('should have reorder button', inject(function($compile, $rootScope) {
    var setSpy = jasmine.createSpy('setReorderButton');
    var el = angular.element('<ion-item><ion-reorder-button></ion-reorder-button></ion-item>');
    el.data('$ionListController', {
      showReorder: function() { return false; }
    });
    $compile(el)($rootScope.$new());
    $rootScope.$apply();

    var reorderContainer = angular.element(el[0].querySelector('.item-right-edit.item-reorder'));
    expect(reorderContainer.length).toBe(1);
    expect(reorderContainer.children().hasClass('button icon button-icon')).toBe(true);
    expect(reorderContainer.attr('data-prevent-scroll')).toBe('true');
    expect(reorderContainer.children().attr('data-prevent-scroll')).toBe('true');
  }));
  it('should show if reorder is already active', inject(function($compile, $rootScope) {
    var setSpy = jasmine.createSpy('setReorderButton');
    var el = angular.element('<ion-item><ion-reorder-button></ion-reorder-button></ion-item>');
    el.data('$ionListController', {
      showReorder: function() { return true; }
    });
    $compile(el)($rootScope.$new());
    $rootScope.$apply();
    var reorderContainer = angular.element(el[0].querySelector('.item-right-edit.item-reorder'));
    expect(reorderContainer.length).toBe(1);
    expect(reorderContainer.hasClass('visible')).toBe(true);
    expect(reorderContainer.hasClass('active')).toBe(true);
  }));
  it('should allow click handlers, but not bubble up to item\'s click event', inject(function($compile, $rootScope) {
    $rootScope.click = jasmine.createSpy('click');;

    var el = angular.element('<ion-item ng-click="click()"><ion-reorder-button></ion-reorder-button></ion-item>');
    $compile(el)($rootScope);
    $rootScope.$apply();
    var reorderContainer = angular.element(el[0].querySelector('ion-reorder-button'));
    reorderContainer.triggerHandler('click');
    expect($rootScope.click).not.toHaveBeenCalled();

    var el = angular.element('<ion-item><ion-reorder-button  ng-click="click()"></ion-reorder-button></ion-item>');
    $compile(el)($rootScope);
    $rootScope.$apply();
    var reorderContainer = angular.element(el[0].querySelector('ion-reorder-button'));
    reorderContainer.triggerHandler('click');
    expect($rootScope.click).toHaveBeenCalled();
  }));
});

describe('ionOptionButton directive', function() {
  beforeEach(module('ionic'));
  it('should have option button', inject(function($compile, $rootScope) {
    var setSpy = jasmine.createSpy('setOptionButton');
    var el = angular.element('<ion-item><ion-option-button></ion-option-button></ion-item>');
    el.data('$ionListController', {
      showDelete: function() { return false; }
    });
    $compile(el)($rootScope.$new());
    $rootScope.$apply();

    var optionContainer = angular.element(el[0].querySelector('.item-options'));
    expect(optionContainer.length).toBe(1);
    expect(optionContainer.children().hasClass('button')).toBe(true);
  }));
});


text:
<?php

namespace FireflyIII\Providers;

use Auth;
use FireflyIII\Exceptions\FireflyException;
use Illuminate\Foundation\Application;
use Illuminate\Support\ServiceProvider;

/**
 * Class PiggyBankServiceProvider
 *
 * @package FireflyIII\Providers
 */
class PiggyBankServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind(
            'FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface',
            function (Application $app, array $arguments) {
                if (!isset($arguments[0]) && Auth::check()) {
                    return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', [Auth::user()]);
                } else {
                    if (!isset($arguments[0]) && !Auth::check()) {
                        throw new FireflyException('There is no user present.');
                    }
                }

                return app('FireflyIII\Repositories\PiggyBank\PiggyBankRepository', $arguments);
            }
        );
    }
}


text:
import * as path from "path";
import * as cp from "child_process";
import { injectable, inject } from "inversify";
import { Trace, IPCMessageReader, IPCMessageWriter, createMessageConnection, MessageConnection, Message } from "vscode-jsonrpc";
import { ILogger, ConnectionErrorHandler, DisposableCollection, Disposable } from "../../common";
import { createIpcEnv } from './ipc-protocol';

export interface ResolvedIPCConnectionOptions {
    readonly serverName: string
    readonly entryPoint: string
    readonly logger: ILogger
    readonly args: string[]
    readonly errorHandler?: ConnectionErrorHandler
}
export type IPCConnectionOptions = Partial<ResolvedIPCConnectionOptions> & {
    readonly serverName: string
    readonly entryPoint: string
};

@injectable()
export class IPCConnectionProvider {

    @inject(ILogger)
    protected readonly logger: ILogger;

    listen(options: IPCConnectionOptions, acceptor: (connection: MessageConnection) => void): Disposable {
        return this.doListen({
            logger: this.logger,
            args: [],
            ...options
        }, acceptor);
    }

    protected doListen(options: ResolvedIPCConnectionOptions, acceptor: (connection: MessageConnection) => void): Disposable {
        const childProcess = this.fork(options);
        const connection = this.createConnection(childProcess, options);
        const toStop = new DisposableCollection();
        const toCancelStop = toStop.push(Disposable.create(() => childProcess.kill()));
        const errorHandler = options.errorHandler;
        if (errorHandler) {
            connection.onError((e: [Error, Message | undefined, number | undefined]) => {
                if (errorHandler.shouldStop(e[0], e[1], e[2])) {
                    toStop.dispose();
                }
            });
            connection.onClose(() => {
                if (toStop.disposed) {
                    return;
                }
                if (errorHandler.shouldRestart()) {
                    toCancelStop.dispose();
                    toStop.push(this.doListen(options, acceptor));
                }
            });
        }
        acceptor(connection);
        return toStop;
    }

    protected createConnection(childProcess: cp.ChildProcess, options: ResolvedIPCConnectionOptions): MessageConnection {
        const reader = new IPCMessageReader(childProcess);
        const writer = new IPCMessageWriter(childProcess);
        const connection = createMessageConnection(reader, writer, {
            error: (message: string) => this.logger.error(`[${options.serverName}: ${childProcess.pid}] ${message}`),
            warn: (message: string) => this.logger.warn(`[${options.serverName}: ${childProcess.pid}] ${message}`),
            info: (message: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}`),
            log: (message: string) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message}`)
        });
        connection.trace(Trace.Off, {
            log: (message, data) => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${message} ${data}`)
        });
        return connection;
    }

    protected fork(options: ResolvedIPCConnectionOptions): cp.ChildProcess {
        const forkOptions: cp.ForkOptions = {
            silent: true,
            env: createIpcEnv(options),
            execArgv: []
        };
        const inspectArgPrefix = `--${options.serverName}-inspect`;
        const inspectArg = process.argv.find(v => v.startsWith(inspectArgPrefix));
        if (inspectArg !== undefined) {
            forkOptions.execArgv = ['--nolazy', `--inspect${inspectArg.substr(inspectArgPrefix.length)}`];
        }

        const childProcess = cp.fork(path.resolve(__dirname, 'ipc-bootstrap.js'), options.args, forkOptions);
        childProcess.stdout.on('data', data => this.logger.info(`[${options.serverName}: ${childProcess.pid}] ${data.toString()}`));
        childProcess.stderr.on('data', data => this.logger.error(`[${options.serverName}: ${childProcess.pid}] ${data.toString()}`));

        this.logger.debug(`[${options.serverName}: ${childProcess.pid}] IPC started`);
        childProcess.once('exit', () => this.logger.debug(`[${options.serverName}: ${childProcess.pid}] IPC exited`));

        return childProcess;
    }

}


text:
import { IAssign } from "./IAssign";

export interface IAssignsState{
unAssigns: JSX.Element[];
assigns:JSX.Element[];
nonMembers?:JSX.Element[];
hasMoreMembers:boolean;
hasError:boolean;
messageError: string;
isloading: boolean;
searchValue?:string;
}


text:
package rest

import (
	discoveryv1 "k8s.io/api/discovery/v1"
	discoveryv1beta1 "k8s.io/api/discovery/v1beta1"
	"k8s.io/apiserver/pkg/registry/generic"
	"k8s.io/apiserver/pkg/registry/rest"
	genericapiserver "k8s.io/apiserver/pkg/server"
	serverstorage "k8s.io/apiserver/pkg/server/storage"
	"k8s.io/kubernetes/pkg/api/legacyscheme"
	"k8s.io/kubernetes/pkg/apis/discovery"
	endpointslicestorage "k8s.io/kubernetes/pkg/registry/discovery/endpointslice/storage"
)

// StorageProvider is a REST storage provider for discovery.k8s.io.
type StorageProvider struct{}

// NewRESTStorage returns a new storage provider.
func (p StorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, bool, error) {
	apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(discovery.GroupName, legacyscheme.Scheme, legacyscheme.ParameterCodec, legacyscheme.Codecs)
	// If you add a version here, be sure to add an entry in `k8s.io/kubernetes/cmd/kube-apiserver/app/aggregator.go with specific priorities.
	// TODO refactor the plumbing to provide the information in the APIGroupInfo

	if apiResourceConfigSource.VersionEnabled(discoveryv1beta1.SchemeGroupVersion) {
		storageMap, err := p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
		if err != nil {
			return genericapiserver.APIGroupInfo{}, false, err
		}
		apiGroupInfo.VersionedResourcesStorageMap[discoveryv1beta1.SchemeGroupVersion.Version] = storageMap
	}

	if apiResourceConfigSource.VersionEnabled(discoveryv1.SchemeGroupVersion) {
		storageMap, err := p.v1Storage(apiResourceConfigSource, restOptionsGetter)
		if err != nil {
			return genericapiserver.APIGroupInfo{}, false, err
		}
		apiGroupInfo.VersionedResourcesStorageMap[discoveryv1.SchemeGroupVersion.Version] = storageMap
	}

	return apiGroupInfo, true, nil
}

func (p StorageProvider) v1beta1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
	storage := map[string]rest.Storage{}

	endpointSliceStorage, err := endpointslicestorage.NewREST(restOptionsGetter)
	if err != nil {
		return storage, err
	}

	storage["endpointslices"] = endpointSliceStorage
	return storage, err
}

func (p StorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (map[string]rest.Storage, error) {
	storage := map[string]rest.Storage{}

	endpointSliceStorage, err := endpointslicestorage.NewREST(restOptionsGetter)
	if err != nil {
		return storage, err
	}

	storage["endpointslices"] = endpointSliceStorage
	return storage, err
}

// GroupName is the group name for the storage provider.
func (p StorageProvider) GroupName() string {
	return discovery.GroupName
}


text:
/*global $ */

function timeSort(a, b){
  return a[1] - b[1];
}

function inverseSort(a, b){
  return -1* (a[1] - b[1]);
}

function plotData(activity, divId, unit){
  function formatter(val, axis) {
    return val.toFixed(axis.tickDecimals) + unit;
  }
  $.plot(divId, [ activity ], {
    series: {
      bars: {
        show: true,
        barWidth: 0.6,
        align: "center"
      }
    },
    xaxis: {
      mode: "categories",
      tickLength: 0
    },
    yaxis: {
      tickFormatter: formatter
    }
  });
}

  function secToMinFormatter(val, axis) {
    return Math.round(val.toFixed(axis.tickDecimals) / 60) + " min";
  }

var activity = [];
var loudness_shortterm = [];
var loudness_momentary = [];
var all = [];

$.getJSON( "http://meta.metaebene.me/media/mm/fs132-denk-nicht-in-layern-denk-in-schichten.json", function( data ) {
  var items = [];
  console.log(data);
  var counter = 0;
  $.each( data.statistics.tracks, function( key, val ) {
    var total = 0;
    counter++;
    var bla = [];
    $.each(val.activity, function(key, val){
      total += val[1] - val[0];
      bla.push([val[0], counter]);
      bla.push([val[1], counter]);
      bla.push(null);
    });
    all.push({"label": val.identifier, data: bla});
    activity.push([val.identifier, Math.round(total/60)]);
    loudness_shortterm.push([val.identifier, val.levels.max_shortterm[0]]);
    loudness_momentary.push([val.identifier, val.levels.max_momentary[0]]);
  });
  activity.sort(timeSort);
}).done(function() {
  plotData(activity.sort(timeSort), "#placeholder", "min");
  plotData(loudness_shortterm.sort(inverseSort), "#loudnessShortTerm", "dB");
  plotData(loudness_momentary.sort(inverseSort), "#loudnessMomentary", "dB");
  $.plot("#bla", all, {legend: {position: "nw"}, xaxis: {tickFormatter: secToMinFormatter}});
});


text:
require 'mongoid'

module SimpleStats
  class Stat
    include Mongoid::Document
  end
end


text:
package org.kie.workbench.common.services.backend.project;

import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.inject.Named;

import org.apache.commons.lang3.StringUtils;
import org.guvnor.common.services.backend.config.SafeSessionInfo;
import org.guvnor.common.services.backend.exceptions.ExceptionUtilities;
import org.guvnor.common.services.backend.util.CommentedOptionFactory;
import org.guvnor.common.services.project.backend.server.ProjectResourcePaths;
import org.guvnor.common.services.project.backend.server.utils.IdentifierUtils;
import org.guvnor.common.services.project.events.NewPackageEvent;
import org.guvnor.common.services.project.events.NewProjectEvent;
import org.guvnor.common.services.project.model.POM;
import org.guvnor.common.services.project.model.Package;
import org.guvnor.common.services.project.service.POMService;
import org.guvnor.common.services.project.service.ProjectRepositoriesService;
import org.kie.workbench.common.services.shared.kmodule.KModuleService;
import org.kie.workbench.common.services.shared.project.KieProject;
import org.kie.workbench.common.services.shared.project.ProjectImportsService;
import org.kie.workbench.common.services.shared.whitelist.PackageNameWhiteListService;
import org.uberfire.backend.server.util.Paths;
import org.uberfire.backend.vfs.Path;
import org.uberfire.io.IOService;
import org.uberfire.rpc.SessionInfo;

import static org.guvnor.common.services.project.backend.server.ProjectResourcePaths.*;

public class ProjectSaver {

    private IOService ioService;
    private POMService pomService;
    private KModuleService kModuleService;
    private Event<NewProjectEvent> newProjectEvent;
    private Event<NewPackageEvent> newPackageEvent;
    private KieResourceResolver resourceResolver;
    private ProjectImportsService projectImportsService;
    private ProjectRepositoriesService projectRepositoriesService;
    private PackageNameWhiteListService packageNameWhiteListService;
    private CommentedOptionFactory commentedOptionFactory;
    private SafeSessionInfo safeSessionInfo;

    public ProjectSaver() {
    }

    @Inject
    public ProjectSaver( final @Named("ioStrategy") IOService ioService,
                         final POMService pomService,
                         final KModuleService kModuleService,
                         final Event<NewProjectEvent> newProjectEvent,
                         final Event<NewPackageEvent> newPackageEvent,
                         final KieResourceResolver resourceResolver,
                         final ProjectImportsService projectImportsService,
                         final ProjectRepositoriesService projectRepositoriesService,
                         final PackageNameWhiteListService packageNameWhiteListService,
                         final CommentedOptionFactory commentedOptionFactory,
                         final SessionInfo sessionInfo ) {
        this.ioService = ioService;
        this.pomService = pomService;
        this.kModuleService = kModuleService;
        this.newProjectEvent = newProjectEvent;
        this.newPackageEvent = newPackageEvent;
        this.resourceResolver = resourceResolver;
        this.projectImportsService = projectImportsService;
        this.projectRepositoriesService = projectRepositoriesService;
        this.packageNameWhiteListService = packageNameWhiteListService;
        this.commentedOptionFactory = commentedOptionFactory;
        this.safeSessionInfo = new SafeSessionInfo( sessionInfo );
    }

    public KieProject save( final Path repositoryRoot,
                            final POM pom,
                            final String baseUrl ) {
        try {
            ioService.startBatch( Paths.convert( repositoryRoot ).getFileSystem(),
                                  commentedOptionFactory.makeCommentedOption( "New project [" + pom.getName() + "]" ) );

            KieProject kieProject = new NewProjectCreator( pom,
                                                           repositoryRoot ).create( baseUrl );

            newProjectEvent.fire( new NewProjectEvent( kieProject,
                                                       safeSessionInfo.getId(),
                                                       safeSessionInfo.getIdentity().getIdentifier() ) );
            return kieProject;

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
        } finally {
            ioService.endBatch();
        }
    }

    private class NewProjectCreator {

        private final Path       repositoryRoot;
        private final Path       projectRootPath;
        private final POM        pom;
        private final KieProject simpleProjectInstance;
        private final org.uberfire.java.nio.file.Path projectNioRootPath;

        public NewProjectCreator( final POM pom,
                                  final Path repositoryRoot ) {
            this.repositoryRoot = repositoryRoot;
            this.pom = pom;

            String projectName = pom.getName();

            if ( projectName == null || projectName.isEmpty() ) {
                projectName = pom.getGav().getArtifactId();
            }

            projectNioRootPath = Paths.convert( repositoryRoot ).resolve( projectName );

            projectRootPath = Paths.convert( projectNioRootPath );

            simpleProjectInstance = resourceResolver.simpleProjectInstance( Paths.convert( projectRootPath ) );

        }

        public KieProject create( final String baseUrl ) {

            createKieProject( baseUrl );

            return resourceResolver.resolveProject( projectRootPath );
        }

        private Path createKieProject( final String baseUrl ) {

            // Update parent pom.xml
            updateParentPOM();

            //Create POM.xml
            pomService.create( projectRootPath,
                               baseUrl,
                               pom );

            //Create Maven project structure
            createMavenDirectories();

            //Create a default kmodule.xml
            kModuleService.setUpKModule( simpleProjectInstance.getKModuleXMLPath() );

            //Create a default workspace based on the GAV
            createDefaultPackage();

            //Create Project configuration - project imports
            projectImportsService.saveProjectImports( simpleProjectInstance.getImportsPath() );

            //Create Project configuration - project package names White List
            packageNameWhiteListService.createProjectWhiteList( simpleProjectInstance.getPackageNamesWhiteListPath() );

            //Create Project configuration - Repositories
            projectRepositoriesService.create( simpleProjectInstance.getRepositoriesPath() );

            return projectRootPath;
        }

        private void updateParentPOM() {
            Path parentPom = Paths.convert( Paths.convert( repositoryRoot ).resolve( "pom.xml" ) );
            if ( ioService.exists( Paths.convert( parentPom ) ) ) {
                POM parent = pomService.load( parentPom );
                parent.setPackaging( "pom" );
                parent.getModules().add( pom.getName() );

                pom.setParent( parent.getGav() );

                pomService.save( parentPom,
                                 parent,
                                 null,
                                 "Adding child module " + pom.getName() );
            }
        }

        private void createMavenDirectories() {
            ioService.createDirectory( projectNioRootPath.resolve( ProjectResourcePaths.MAIN_SRC_PATH ) );
            ioService.createDirectory( projectNioRootPath.resolve( ProjectResourcePaths.MAIN_RESOURCES_PATH ) );
            ioService.createDirectory( projectNioRootPath.resolve( ProjectResourcePaths.TEST_SRC_PATH ) );
            ioService.createDirectory( projectNioRootPath.resolve( ProjectResourcePaths.TEST_RESOURCES_PATH ) );
        }

        private void createDefaultPackage() {
            //Raise an event for the new project's default workspace
            newPackageEvent.fire( new NewPackageEvent( resourceResolver.newPackage( getDefaultPackage(),
                                                                                getDefaultWorkspacePath(),
                                                                                false ) ) );
        }

        private Package getDefaultPackage() {
            return resourceResolver.resolvePackage( Paths.convert( Paths.convert( projectRootPath ).resolve( MAIN_RESOURCES_PATH ) ) );
        }

        private String getDefaultWorkspacePath() {
            return StringUtils.join( getLegalId( pom.getGav().getGroupId() ),
                                     "/" ) + "/" + StringUtils.join( getLegalId( pom.getGav().getArtifactId() ),
                                                                     "/" );
        }

        private String[] getLegalId( final String id ) {
            return IdentifierUtils.convertMavenIdentifierToJavaIdentifier( id.split( "\\.",
                                                                                -1 ) );
        }

    }
}


text:
namespace cc {

RenderPass* AddRenderPass(RenderPassList* pass_list,
                          RenderPassId id,
                          const gfx::Rect& output_rect,
                          const gfx::Transform& root_transform) {
  scoped_ptr<RenderPass> pass(RenderPass::Create());
  pass->SetNew(id, output_rect, output_rect, root_transform);
  RenderPass* saved = pass.get();
  pass_list->push_back(pass.Pass());
  return saved;
}

SolidColorDrawQuad* AddQuad(RenderPass* pass,
                            const gfx::Rect& rect,
                            SkColor color) {
  SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(gfx::Transform(),
                       rect.size(),
                       rect,
                       rect,
                       false,
                       1,
                       SkXfermode::kSrcOver_Mode,
                       0);
  SolidColorDrawQuad* quad =
      pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
  quad->SetNew(shared_state, rect, rect, color, false);
  return quad;
}

SolidColorDrawQuad* AddClippedQuad(RenderPass* pass,
                                   const gfx::Rect& rect,
                                   SkColor color) {
  SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(gfx::Transform(),
                       rect.size(),
                       rect,
                       rect,
                       true,
                       1,
                       SkXfermode::kSrcOver_Mode,
                       0);
  SolidColorDrawQuad* quad =
      pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
  quad->SetNew(shared_state, rect, rect, color, false);
  return quad;
}

SolidColorDrawQuad* AddTransformedQuad(RenderPass* pass,
                                       const gfx::Rect& rect,
                                       SkColor color,
                                       const gfx::Transform& transform) {
  SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(transform,
                       rect.size(),
                       rect,
                       rect,
                       false,
                       1,
                       SkXfermode::kSrcOver_Mode,
                       0);
  SolidColorDrawQuad* quad =
      pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
  quad->SetNew(shared_state, rect, rect, color, false);
  return quad;
}

void AddRenderPassQuad(RenderPass* to_pass, RenderPass* contributing_pass) {
  gfx::Rect output_rect = contributing_pass->output_rect;
  SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(gfx::Transform(),
                       output_rect.size(),
                       output_rect,
                       output_rect,
                       false,
                       1,
                       SkXfermode::kSrcOver_Mode,
                       0);
  RenderPassDrawQuad* quad =
      to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
  quad->SetNew(shared_state,
               output_rect,
               output_rect,
               contributing_pass->id,
               0,
               gfx::Vector2dF(),
               gfx::Size(),
               FilterOperations(),
               gfx::Vector2dF(),
               FilterOperations());
}

void AddRenderPassQuad(RenderPass* to_pass,
                       RenderPass* contributing_pass,
                       ResourceId mask_resource_id,
                       const FilterOperations& filters,
                       gfx::Transform transform,
                       SkXfermode::Mode blend_mode) {
  gfx::Rect output_rect = contributing_pass->output_rect;
  SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(transform,
                       output_rect.size(),
                       output_rect,
                       output_rect,
                       false,
                       1,
                       blend_mode,
                       0);
  RenderPassDrawQuad* quad =
      to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
  gfx::Size arbitrary_nonzero_size(1, 1);
  quad->SetNew(shared_state,
               output_rect,
               output_rect,
               contributing_pass->id,
               mask_resource_id,
               gfx::Vector2dF(1.f, 1.f),
               arbitrary_nonzero_size,
               filters,
               gfx::Vector2dF(),
               FilterOperations());
}

static void EmptyReleaseCallback(uint32 sync_point,
                                 bool lost_resource,
                                 BlockingTaskRunner* main_thread_task_runner) {}

void AddOneOfEveryQuadType(RenderPass* to_pass,
                           ResourceProvider* resource_provider,
                           RenderPassId child_pass,
                           uint32_t* sync_point_for_mailbox_texture_quad) {
  gfx::Rect rect(0, 0, 100, 100);
  gfx::Rect opaque_rect(10, 10, 80, 80);
  gfx::Rect visible_rect(0, 0, 100, 100);
  const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f};

  static const uint32_t kSyncPointForMailboxTextureQuad = 30;
  *sync_point_for_mailbox_texture_quad = kSyncPointForMailboxTextureQuad;

  ResourceId resource1 = resource_provider->CreateResource(
      gfx::Size(45, 5), GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource1);
  ResourceId resource2 = resource_provider->CreateResource(
      gfx::Size(346, 61), GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource2);
  ResourceId resource3 = resource_provider->CreateResource(
      gfx::Size(12, 134), GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource3);
  ResourceId resource4 = resource_provider->CreateResource(
      gfx::Size(56, 12), GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource4);
  gfx::Size resource5_size(73, 26);
  ResourceId resource5 = resource_provider->CreateResource(
      resource5_size, GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource5);
  ResourceId resource6 = resource_provider->CreateResource(
      gfx::Size(64, 92), GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource6);
  ResourceId resource7 = resource_provider->CreateResource(
      gfx::Size(9, 14), GL_CLAMP_TO_EDGE,
      ResourceProvider::TEXTURE_HINT_IMMUTABLE,
      resource_provider->best_texture_format());
  resource_provider->AllocateForTesting(resource7);

  unsigned target = GL_TEXTURE_2D;
  gpu::Mailbox gpu_mailbox;
  memcpy(gpu_mailbox.name, "Hello world", strlen("Hello world") + 1);
  scoped_ptr<SingleReleaseCallbackImpl> callback =
      SingleReleaseCallbackImpl::Create(base::Bind(&EmptyReleaseCallback));
  TextureMailbox mailbox(gpu_mailbox, target,
                         *sync_point_for_mailbox_texture_quad);
  ResourceId resource8 = resource_provider->CreateResourceFromTextureMailbox(
      mailbox, callback.Pass());
  resource_provider->AllocateForTesting(resource8);

  SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(gfx::Transform(), rect.size(), rect, rect, false, 1,
                       SkXfermode::kSrcOver_Mode, 0);

  DebugBorderDrawQuad* debug_border_quad =
      to_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>();
  debug_border_quad->SetNew(shared_state, rect, visible_rect, SK_ColorRED, 1);

  IOSurfaceDrawQuad* io_surface_quad =
      to_pass->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>();
  io_surface_quad->SetNew(shared_state, rect, opaque_rect, visible_rect,
                          gfx::Size(50, 50), resource7,
                          IOSurfaceDrawQuad::FLIPPED, false);

  if (child_pass.layer_id) {
    RenderPassDrawQuad* render_pass_quad =
        to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
    render_pass_quad->SetNew(shared_state, rect, visible_rect, child_pass,
                             resource5, gfx::Vector2dF(1.f, 1.f),
                             resource5_size, FilterOperations(),
                             gfx::Vector2dF(), FilterOperations());

    RenderPassDrawQuad* render_pass_replica_quad =
        to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
    render_pass_replica_quad->SetNew(
        shared_state, rect, visible_rect, child_pass, resource5,
        gfx::Vector2dF(1.f, 1.f), resource5_size, FilterOperations(),
        gfx::Vector2dF(), FilterOperations());
  }

  SolidColorDrawQuad* solid_color_quad =
      to_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
  solid_color_quad->SetNew(shared_state, rect, visible_rect, SK_ColorRED,
                           false);

  StreamVideoDrawQuad* stream_video_quad =
      to_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>();
  stream_video_quad->SetNew(shared_state, rect, opaque_rect, visible_rect,
                            resource6, gfx::Size(), false, gfx::Transform());

  TextureDrawQuad* texture_quad =
      to_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
  texture_quad->SetNew(shared_state, rect, opaque_rect, visible_rect, resource1,
                       false, gfx::PointF(0.f, 0.f), gfx::PointF(1.f, 1.f),
                       SK_ColorTRANSPARENT, vertex_opacity, false, false);

  TextureDrawQuad* mailbox_texture_quad =
      to_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
  mailbox_texture_quad->SetNew(shared_state, rect, opaque_rect, visible_rect,
                               resource8, false, gfx::PointF(0.f, 0.f),
                               gfx::PointF(1.f, 1.f), SK_ColorTRANSPARENT,
                               vertex_opacity, false, false);

  TileDrawQuad* scaled_tile_quad =
      to_pass->CreateAndAppendDrawQuad<TileDrawQuad>();
  scaled_tile_quad->SetNew(shared_state, rect, opaque_rect, visible_rect,
                           resource2, gfx::RectF(0, 0, 50, 50),
                           gfx::Size(50, 50), false, false);

  SharedQuadState* transformed_state =
      to_pass->CreateAndAppendSharedQuadState();
  transformed_state->CopyFrom(shared_state);
  gfx::Transform rotation;
  rotation.Rotate(45);
  transformed_state->quad_to_target_transform =
      transformed_state->quad_to_target_transform * rotation;
  TileDrawQuad* transformed_tile_quad =
      to_pass->CreateAndAppendDrawQuad<TileDrawQuad>();
  transformed_tile_quad->SetNew(
      transformed_state, rect, opaque_rect, visible_rect, resource3,
      gfx::RectF(0, 0, 100, 100), gfx::Size(100, 100), false, false);

  SharedQuadState* shared_state2 = to_pass->CreateAndAppendSharedQuadState();
  shared_state->SetAll(gfx::Transform(), rect.size(), rect, rect, false, 1,
                       SkXfermode::kSrcOver_Mode, 0);

  TileDrawQuad* tile_quad = to_pass->CreateAndAppendDrawQuad<TileDrawQuad>();
  tile_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect, resource4,
                    gfx::RectF(0, 0, 100, 100), gfx::Size(100, 100), false,
                    false);

  ResourceId plane_resources[4];
  for (int i = 0; i < 4; ++i) {
    plane_resources[i] = resource_provider->CreateResource(
        gfx::Size(20, 12), GL_CLAMP_TO_EDGE,
        ResourceProvider::TEXTURE_HINT_IMMUTABLE,
        resource_provider->best_texture_format());
    resource_provider->AllocateForTesting(plane_resources[i]);
  }
  YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601;
  YUVVideoDrawQuad* yuv_quad =
      to_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
  yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect,
                   gfx::RectF(.0f, .0f, 100.0f, 100.0f),
                   gfx::RectF(.0f, .0f, 50.0f, 50.0f), gfx::Size(100, 100),
                   gfx::Size(50, 50), plane_resources[0], plane_resources[1],
                   plane_resources[2], plane_resources[3], color_space);
}

}  // namespace cc


text:
/**
 * @typedef {object} Phaser.Types.Math.SinCosTable
 * @since 3.0.0
 *
 * @property {number} sin - The sine value.
 * @property {number} cos - The cosine value.
 * @property {number} length - The length.
 */


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>AnyLanguage xref</title>
<link type="text/css" rel="stylesheet" href="../../../../stylesheet.css" />

View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   package net.sourceforge.pmd.cpd;
5
6   public class AnyLanguage extends AbstractLanguage {
7   	public AnyLanguage(String... extension) {
8   		super(new AnyTokenizer(), extension);
9   	}
10  }

This page was automatically generated by Maven


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace GodaddyWrapper.Requests
{
    public class CloudSpecsDetailRetrieve
    {
        public string specId { get; set; }
    }
}


text:
[![pub package](https://img.shields.io/pub/v/analyzer.svg)](https://pub.dev/packages/analyzer)
[![package publisher](https://img.shields.io/pub/publisher/analyzer.svg)](https://pub.dev/packages/analyzer/publisher)

This package provides a library that performs static analysis
of Dart code. It is useful for tool integration and embedding.

End-users should use the [dart analyze][] command-line tool
to analyze their Dart code.

Integrators that want to add Dart support to their editor
should use the _Dart Analysis Server_.
The [Analysis Server API Specification][serverapi] is available.
If you are adding Dart support to an editor or IDE, please let us know
by emailing our [list][].

## Configuring the analyzer

Both `dart analyze` and Dart Analysis Server can be configured with an
`analysis_options.yaml` file (using an `.analysis_options` file is deprecated).
This YAML file can control which files and paths are analyzed,
which lints are applied, and more.

If you are embedding the analyzer library in your project, you are responsible
for finding the analysis options file, parsing it, and configuring the analyzer.

The analysis options file should live at the root of your project (for example,
next to your `pubspec.yaml`). Different embedders of analyzer, such as
`dart analyze` or Dart Analysis Server, may choose to find the file in various
different ways. Consult their documentation to learn more.

Here is an example file that instructs the analyzer to ignore two files:

```yaml
analyzer:
  exclude:
    - test/_data/p4/lib/lib1.dart
    - test/_data/p5/p5.dart
    - test/_data/bad*.dart
    - test/_brokendata/**
```

Note that you can use globs, as defined by the [glob package][glob].

Here is an example file that enables two lint rules:

```yaml
linter:
  rules:
    - camel_case_types
    - empty_constructor_bodies
```

Check out all the available [Dart lint rules][lintrules].

You can combine the `analyzer` section and the `linter` section into a single
configuration. Here is an example:

```yaml
analyzer:
  exclude:
    - test/_data/p4/lib/lib1.dart
linter:
  rules:
    - camel_case_types
```

For more information, see the docs for
[customizing static analysis][custom_analysis].

## Who uses this library?

Many tools embed this library, such as:

* [dart format] - a formatter for Dart code
* [dart doc] - a documentation generator for Dart code
* [Dart Analysis Server][analysis_server] - a stateful server that supports IDEs and editors

## Support

Post issues and feature requests at https://github.com/dart-lang/sdk/issues.
These will be triaged according to the [analyzer triage priorities][triage].

Questions and discussions are welcome at the
[Dart Analyzer Discussion Group][list].

## Background

The APIs in this package were originally machine generated by a translator and were
based on an earlier Java implementation. Several of the API's still look like their Java
predecessors rather than clean Dart APIs.

In addition, there is currently no clean distinction between public and internal
APIs. We plan to address this issue but doing so will, unfortunately, require a
large number of breaking changes. We will try to minimize the pain this causes for
our clients, but some pain is inevitable.

## License

See the [LICENSE] file.

[serverapi]: https://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/main/pkg/analysis_server/doc/api.html
[dart analyze]: https://dart.dev/tools/dart-analyze
[list]: https://groups.google.com/a/dartlang.org/forum/#!forum/analyzer-discuss
[lintrules]: https://dart-lang.github.io/linter/lints/
[glob]: https://pub.dev/packages/glob
[LICENSE]: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/LICENSE
[dart format]: https://github.com/dart-lang/dart_style
[dart doc]: https://github.com/dart-lang/dartdoc
[analysis_server]: https://github.com/dart-lang/sdk/tree/main/pkg/analysis_server
[custom_analysis]: https://dart.dev/guides/language/analysis-options
[triage]: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/TRIAGE.md


text:
"""Helper functions for package setup.
"""

import ast
import sys
import subprocess
import pkg_resources

class SetupHelper(object):
    """
    SetupHelper streamlines the population of setup() function calls with
    contents from __init__.py and README.md.
    """

    def __init__(self, initfile="__init__.py", readmefile="README.md"):
        self.author, self.email, self.license = self.get_init(initfile)
        self.author = ", ".join(self.author)
        self.long_description = self.get_long_description(readmefile)

    def check_version(self, name, majorv=2, minorv=7):
        """Make sure the package runs on the supported Python version"""
        if sys.version_info.major == majorv and sys.version_info.minor != minorv:
            sys.stderr.write(
                "ERROR: %s is only for >= Python %d.%d but you are running %d.%d\n"
                % (name, majorv, minorv, sys.version_info.major, sys.version_info.minor)
            )
            sys.exit(1)

    def get_init(self, filename="__init__.py"):
        """Get various info from the package without importing them"""
        with open(filename) as init_file:
            module = ast.parse(init_file.read())

        itr = lambda x: (
            ast.literal_eval(node.value)
            for node in ast.walk(module)
            if isinstance(node, ast.Assign) and node.targets[0].id == x
        )

        try:
            return (
                next(itr("__author__")),
                next(itr("__email__")),
                next(itr("__license__")),
            )
        except StopIteration as stop_exception:
            raise ValueError(
                "One of author, email, license cannot be found in {}".format(filename)
            ) from stop_exception

    def missing_requirements(self, specifiers):
        """Find what's missing"""
        for specifier in specifiers:
            try:
                pkg_resources.require(specifier)
            except pkg_resources.DistributionNotFound:
                yield specifier

    def install_requirements(self, requires):
        """Install the listed requirements"""
        # Temporarily install dependencies required by setup.py before trying to import them.
        sys.path[0:0] = ["setup-requires"]
        pkg_resources.working_set.add_entry("setup-requires")

        to_install = list(self.missing_requirements(requires))
        if to_install:
            cmd = [
                sys.executable,
                "-m",
                "pip",
                "install",
                "-t",
                "setup-requires",
            ] + to_install
            subprocess.call(cmd)

    def get_long_description(self, filename="README.md"):
        """I really prefer Markdown to reStructuredText. PyPi does not."""
        return open(filename).read()


text:
package org.kie.workbench.common.screens.datamodeller.model.index;

import java.util.ArrayList;
import java.util.List;

import org.kie.workbench.common.screens.datamodeller.model.index.terms.valueterms.ValueJavaTypeParentIndexTerm;
import org.kie.workbench.common.services.refactoring.model.index.IndexElementsGenerator;
import org.uberfire.commons.data.Pair;
import org.uberfire.commons.validation.PortablePreconditions;

public class JavaTypeParent implements IndexElementsGenerator {

    private ValueJavaTypeParentIndexTerm javaTypeParentTerm;

    public JavaTypeParent( final ValueJavaTypeParentIndexTerm javaTypeParentTerm ) {
        this.javaTypeParentTerm = PortablePreconditions.checkNotNull( "javaTypeParentTerm",
                javaTypeParentTerm );
    }

    @Override
    public List<Pair<String, String>> toIndexElements() {
        final List<Pair<String, String>> indexElements = new ArrayList<Pair<String, String>>();
        indexElements.add( new Pair<String, String>( javaTypeParentTerm.getTerm(),
                javaTypeParentTerm.getValue() ) );
        return indexElements;
    }
}


text:
layout: publication
type: "conference"
authors: "Lu, Q., Lee D. Rippon, R. Bhushan Gopaluni, M.G. Forbes, P.D. Loewen, J. Backstrom, G.A. Dumont"
order: 51
year: 2015
title: "Cross-directional controller performance monitoring for paper machines"
journal: "In proceedings of American Control Conference, Chicago, USA"
pagenum: "4970 – 4975"
---


text:
"use strict";
import gLong = require('./gLong');
import assert = require('./assert');

/**
 * A ByteStream, implemented using a NodeBuffer.
 */
class ByteStream {
  private _index: number = 0;

  constructor(private buffer: NodeBuffer) {}

  /**
   * Returns the current read index, and increments the index by the indicated
   * amount.
   */
  private incIndex(inc: number): number {
    var readIndex = this._index;
    this._index += inc;
    return readIndex;
  }

  public rewind(): void {
    this._index = 0;
  }

  public seek(idx: number) {
    assert(idx >= 0 && idx < this.buffer.length, "Invalid seek position.");
    this._index = idx;
  }

  public pos(): number {
    return this._index;
  }

  public skip(bytesCount: number): void {
    this._index += bytesCount;
  }

  public hasBytes(): boolean {
    return this._index < this.buffer.length;
  }

  public getFloat(): number {
    return this.buffer.readFloatBE(this.incIndex(4));
  }

  public getDouble(): number {
    return this.buffer.readDoubleBE(this.incIndex(8));
  }

  public getUint(byteCount: number): number {
    switch (byteCount) {
      case 1:
        return this.getUint8();
      case 2:
        return this.getUint16();
      case 4:
        return this.getUint32();
      default:
        throw new Error("Invalid byte count for getUint: " + byteCount);
    }
  }

  public getInt(byteCount: number): number {
    switch (byteCount) {
      case 1:
        return this.getInt8();
      case 2:
        return this.getInt16();
      case 4:
        return this.getInt32();
      default:
        throw new Error("Invalid byte count for getUint: " + byteCount);
    }
  }

  public getUint8(): number {
    return this.buffer.readUInt8(this.incIndex(1));
  }

  public getUint16(): number {
    return this.buffer.readUInt16BE(this.incIndex(2));
  }

  public getUint32(): number {
    return this.buffer.readUInt32BE(this.incIndex(4));
  }

  public getInt8(): number {
    return this.buffer.readInt8(this.incIndex(1));
  }

  public getInt16(): number {
    return this.buffer.readInt16BE(this.incIndex(2));
  }

  public getInt32(): number {
    return this.buffer.readInt32BE(this.incIndex(4));
  }

  public getInt64(): gLong {
    var high = this.getUint32();
    var low = this.getUint32();
    return gLong.fromBits(low, high);
  }

  public read(bytesCount: number): Buffer {
    var rv = this.buffer.slice(this._index, this._index + bytesCount);
    this._index += bytesCount;
    return rv;
  }

  public peek(): number {
    return this.buffer.readUInt8(this._index);
  }

  public size(): number {
    return this.buffer.length - this._index;
  }

  public slice(len: number): ByteStream {
    var arr = new ByteStream(this.buffer.slice(this._index, this._index + len));
    this._index += len;
    return arr;
  }

  public getBuffer(): NodeBuffer {
    return this.buffer;
  }
}

export = ByteStream;


text:
//  (C) Copyright Joel de Guzman 2003.
//  Distributed under the Boost Software License, Version 1.0. (See
//  accompanying file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)

#ifndef VECTOR_INDEXING_SUITE_JDG20036_HPP
# define VECTOR_INDEXING_SUITE_JDG20036_HPP

# include <deel.boost.python/revise/boost/python/suite/indexing/indexing_suite.hpp>
# include <deel.boost.python/revise/boost/python/suite/indexing/container_utils.hpp>
# include <deel.boost.python/revise/boost/python/iterator.hpp>

namespace boost { namespace python {

    // Forward declaration
    template <class Container, bool NoProxy, class DerivedPolicies>
    class vector_indexing_suite;

    namespace detail
    {
        template <class Container, bool NoProxy>
        class final_vector_derived_policies
            : public vector_indexing_suite<Container,
                NoProxy, final_vector_derived_policies<Container, NoProxy> > {};
    }

    // The vector_indexing_suite class is a predefined indexing_suite derived
    // class for wrapping std::vector (and std::vector like) classes. It provides
    // all the policies required by the indexing_suite (see indexing_suite).
    // Example usage:
    //
    //  class X {...};
    //
    //  ...
    //
    //      class_<std::vector<X> >("XVec")
    //          .def(vector_indexing_suite<std::vector<X> >())
    //      ;
    //
    // By default indexed elements are returned by proxy. This can be
    // disabled by supplying *true* in the NoProxy template parameter.
    //
    template <
        class Container,
        bool NoProxy = false,
        class DerivedPolicies
            = detail::final_vector_derived_policies<Container, NoProxy> >
    class vector_indexing_suite
        : public indexing_suite<Container, DerivedPolicies, NoProxy>
    {
    public:

        typedef typename Container::value_type data_type;
        typedef typename Container::value_type key_type;
        typedef typename Container::size_type index_type;
        typedef typename Container::size_type size_type;
        typedef typename Container::difference_type difference_type;

        template <class Class>
        static void
        extension_def(Class& cl)
        {
            cl
                .def("append", &base_append)
                .def("extend", &base_extend)
            ;
        }

        static
        typename mpl::if_<
            is_class<data_type>
          , data_type&
          , data_type
        >::type
        get_item(Container& container, index_type i)
        {
            return container[i];
        }

        static object
        get_slice(Container& container, index_type from, index_type to)
        {
            if (from > to)
                return object(Container());
            return object(Container(container.begin()+from, container.begin()+to));
        }

        static void
        set_item(Container& container, index_type i, data_type const& v)
        {
            container[i] = v;
        }

        static void
        set_slice(Container& container, index_type from,
            index_type to, data_type const& v)
        {
            if (from > to) {
                return;
            }
            else {
                container.erase(container.begin()+from, container.begin()+to);
                container.insert(container.begin()+from, v);
            }
        }

        template <class Iter>
        static void
        set_slice(Container& container, index_type from,
            index_type to, Iter first, Iter last)
        {
            if (from > to) {
                container.insert(container.begin()+from, first, last);
            }
            else {
                container.erase(container.begin()+from, container.begin()+to);
                container.insert(container.begin()+from, first, last);
            }
        }

        static void
        delete_item(Container& container, index_type i)
        {
            container.erase(container.begin()+i);
        }

        static void
        delete_slice(Container& container, index_type from, index_type to)
        {
            if (from > to) {
                // A null-op.
                return;
            }
            container.erase(container.begin()+from, container.begin()+to);
        }

        static size_t
        size(Container& container)
        {
            return container.size();
        }

        static bool
        contains(Container& container, key_type const& key)
        {
            return std::find(container.begin(), container.end(), key)
                != container.end();
        }

        static index_type
        get_min_index(Container& /*container*/)
        {
            return 0;
        }

        static index_type
        get_max_index(Container& container)
        {
            return container.size();
        }

        static bool
        compare_index(Container& /*container*/, index_type a, index_type b)
        {
            return a < b;
        }

        static index_type
        convert_index(Container& container, PyObject* i_)
        {
            extract<long> i(i_);
            if (i.check())
            {
                long index = i();
                if (index < 0)
                    index += DerivedPolicies::size(container);
                if (index >= long(container.size()) || index < 0)
                {
                    PyErr_SetString(PyExc_IndexError, "Index out of range");
                    throw_error_already_set();
                }
                return index;
            }

            PyErr_SetString(PyExc_TypeError, "Invalid index type");
            throw_error_already_set();
            return index_type();
        }

        static void
        append(Container& container, data_type const& v)
        {
            container.push_back(v);
        }

        template <class Iter>
        static void
        extend(Container& container, Iter first, Iter last)
        {
            container.insert(container.end(), first, last);
        }

    private:

        static void
        base_append(Container& container, object v)
        {
            extract<data_type&> elem(v);
            // try if elem is an exact Data
            if (elem.check())
            {
                DerivedPolicies::append(container, elem());
            }
            else
            {
                //  try to convert elem to data_type
                extract<data_type> elem(v);
                if (elem.check())
                {
                    DerivedPolicies::append(container, elem());
                }
                else
                {
                    PyErr_SetString(PyExc_TypeError,
                        "Attempting to append an invalid type");
                    throw_error_already_set();
                }
            }
        }

        static void
        base_extend(Container& container, object v)
        {
            std::vector<data_type> temp;
            container_utils::extend_container(temp, v);
            DerivedPolicies::extend(container, temp.begin(), temp.end());
        }
    };

}} // namespace boost::python

#endif // VECTOR_INDEXING_SUITE_JDG20036_HPP


text:
namespace TXTCommunication.Fischertechnik.Txt.Response
{
    public abstract class ResponseBase
    {
        public uint ResponseId { get; set; }

        public virtual int GetResponseLength()
        {
            return sizeof(uint);
        }

        public abstract void FromByteArray(byte[] bytes);
    }
}


text:
package com.hazelcast.spi.impl.operationservice;

import com.hazelcast.instance.impl.Node;
import com.hazelcast.internal.nio.IOUtil;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.internal.serialization.Data;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.internal.services.NodeAware;
import com.hazelcast.spi.impl.NodeEngine;
import com.hazelcast.spi.impl.SpiDataSerializerHook;

import java.io.IOException;

/**
 * An {@link OperationFactory} that creates operations by cloning
 * the passed Operation.
 */
public final class BinaryOperationFactory implements OperationFactory, NodeAware, IdentifiedDataSerializable {

    private Data operationData;
    private NodeEngine nodeEngine;

    public BinaryOperationFactory() {
    }

    public BinaryOperationFactory(Operation operation, NodeEngine nodeEngine) {
        this.nodeEngine = nodeEngine;
        this.operationData = nodeEngine.toData(operation);
    }

    public BinaryOperationFactory(Data operationData) {
        this.operationData = operationData;
    }

    @Override
    public Operation createOperation() {
        return nodeEngine.toObject(operationData);
    }

    @Override
    public void writeData(ObjectDataOutput out) throws IOException {
        IOUtil.writeData(out, operationData);
    }

    @Override
    public void readData(ObjectDataInput in) throws IOException {
        operationData = IOUtil.readData(in);
    }

    @Override
    public void setNode(Node node) {
        this.nodeEngine = node.nodeEngine;
    }

    @Override
    public int getFactoryId() {
        return SpiDataSerializerHook.F_ID;
    }

    @Override
    public int getClassId() {
        return SpiDataSerializerHook.PARALLEL_OPERATION_FACTORY;
    }
}