text:
package com.blazebit.persistence.view.impl.objectbuilder.transformer.correlation;

import com.blazebit.persistence.parser.expression.Expression;
import com.blazebit.persistence.parser.expression.ExpressionFactory;
import com.blazebit.persistence.view.CorrelationProviderFactory;
import com.blazebit.persistence.view.impl.EntityViewConfiguration;
import com.blazebit.persistence.view.impl.EntityViewManagerImpl;
import com.blazebit.persistence.view.impl.metamodel.ManagedViewTypeImplementor;
import com.blazebit.persistence.view.impl.objectbuilder.ContainerAccumulator;
import com.blazebit.persistence.view.impl.objectbuilder.Limiter;

/**
 *
 * @author Christian Beikov
 * @since 1.2.0
 */
public class CorrelatedMapSubselectTupleTransformer extends AbstractCorrelatedSubselectTupleTransformer {

    private final boolean recording;

    public CorrelatedMapSubselectTupleTransformer(ExpressionFactory ef, Correlator correlator, ContainerAccumulator<?> containerAccumulator, EntityViewManagerImpl evm, ManagedViewTypeImplementor<?> viewRootType, String viewRootAlias, ManagedViewTypeImplementor<?> embeddingViewType, String embeddingViewPath,
                                                  Expression correlationResult, String correlationBasisExpression, String correlationKeyExpression, CorrelationProviderFactory correlationProviderFactory, String attributePath, String[] fetches,
                                                  String[] indexFetches, Expression indexExpression, Correlator indexCorrelator, int viewRootIndex, int embeddingViewIndex, int tupleIndex, Class<?> correlationBasisType, Class<?> correlationBasisEntity,
                                                  Limiter limiter, EntityViewConfiguration entityViewConfiguration, boolean recording) {
        super(ef, correlator, containerAccumulator, evm, viewRootType, viewRootAlias, embeddingViewType, embeddingViewPath, correlationResult, correlationBasisExpression, correlationKeyExpression, correlationProviderFactory, attributePath, fetches, indexFetches, indexExpression, indexCorrelator, viewRootIndex, embeddingViewIndex,
                tupleIndex, correlationBasisType, correlationBasisEntity, limiter, entityViewConfiguration);
        this.recording = recording;
    }

    @Override
    protected boolean isRecording() {
        return recording;
    }

}


text:
@interface EnterNames : UIViewController

@end
#endif

redpajama_set_name: RedPajamaGithub


text:
/* */
require("../modules/es7.reflect.define-metadata");
require("../modules/es7.reflect.delete-metadata");
require("../modules/es7.reflect.get-metadata");
require("../modules/es7.reflect.get-metadata-keys");
require("../modules/es7.reflect.get-own-metadata");
require("../modules/es7.reflect.get-own-metadata-keys");
require("../modules/es7.reflect.has-metadata");
require("../modules/es7.reflect.has-own-metadata");
require("../modules/es7.reflect.metadata");
module.exports = require("../modules/_core").Reflect;


text:
Upload `.deb` files and execute commands on them.

## Configuration

Create `/etc/debbox.json`

    {
        "debCommand": "deb-release $1"
    }

`debCommand` will be executed for each uploaded `.deb` file. `$1` will be
absolute path to the uploaded file.

## Curl usage

Upload single file

    curl --form "deb=@package.deb" http://localhost:8080/deb

Upload multiple files in single request

    curl --form "deb=@package1.deb" --form "deb=@package1.deb" http://localhost:8080/deb

## Install

    npm install

Start server with

    node index.js


text:
#import "ACEDrawingTools.h"
#if (TARGET_OS_EMBEDDED || TARGET_OS_IPHONE)
#import <CoreText/CoreText.h>
#else
#import <AppKit/AppKit.h>
#endif

CGPoint midPoint(CGPoint p1, CGPoint p2)
{
    return CGPointMake((p1.x + p2.x) * 0.5, (p1.y + p2.y) * 0.5);
}

#pragma mark - ACEDrawingPenTool

@implementation ACEDrawingPenTool

@synthesize lineColor = _lineColor;
@synthesize lineAlpha = _lineAlpha;

- (id)init
{
    self = [super init];
    if (self != nil) {
        self.lineCapStyle = kCGLineCapRound;
        path = CGPathCreateMutable();
    }
    return self;
}

- (void)setInitialPoint:(CGPoint)firstPoint
{
    //[self moveToPoint:firstPoint];
}

- (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint
{
    //[self addQuadCurveToPoint:midPoint(endPoint, startPoint) controlPoint:startPoint];
}

- (CGRect)addPathPreviousPreviousPoint:(CGPoint)p2Point withPreviousPoint:(CGPoint)p1Point withCurrentPoint:(CGPoint)cpoint {

    CGPoint mid1 = midPoint(p1Point, p2Point);
    CGPoint mid2 = midPoint(cpoint, p1Point);
    CGMutablePathRef subpath = CGPathCreateMutable();
    CGPathMoveToPoint(subpath, NULL, mid1.x, mid1.y);
    CGPathAddQuadCurveToPoint(subpath, NULL, p1Point.x, p1Point.y, mid2.x, mid2.y);
    CGRect bounds = CGPathGetBoundingBox(subpath);

    CGPathAddPath(path, NULL, subpath);
    CGPathRelease(subpath);

    return bounds;
}

- (void)draw
{
    CGContextRef context = UIGraphicsGetCurrentContext();

	CGContextAddPath(context, path);
    CGContextSetLineCap(context, kCGLineCapRound);
    CGContextSetLineWidth(context, self.lineWidth);
    CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
    CGContextSetBlendMode(context, kCGBlendModeNormal);
    CGContextSetAlpha(context, self.lineAlpha);
    CGContextStrokePath(context);
}

- (void)dealloc
{
    CGPathRelease(path);
    self.lineColor = nil;
    #if !ACE_HAS_ARC
    [super dealloc];
    #endif
}

@end

#pragma mark - ACEDrawingEraserTool

@implementation ACEDrawingEraserTool

- (void)draw
{
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSaveGState(context);

	CGContextAddPath(context, path);
    CGContextSetLineCap(context, kCGLineCapRound);
    CGContextSetLineWidth(context, self.lineWidth);
    CGContextSetBlendMode(context, kCGBlendModeClear);
    CGContextStrokePath(context);
    CGContextRestoreGState(context);
}

@end

#pragma mark - ACEDrawingLineTool

@interface ACEDrawingLineTool ()
@property (nonatomic, assign) CGPoint firstPoint;
@property (nonatomic, assign) CGPoint lastPoint;
@end

#pragma mark -

@implementation ACEDrawingLineTool

@synthesize lineColor = _lineColor;
@synthesize lineAlpha = _lineAlpha;
@synthesize lineWidth = _lineWidth;

- (void)setInitialPoint:(CGPoint)firstPoint
{
    self.firstPoint = firstPoint;
}

- (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint
{
    self.lastPoint = endPoint;
}

- (void)draw
{
    CGContextRef context = UIGraphicsGetCurrentContext();

    // set the line properties
    CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
    CGContextSetLineCap(context, kCGLineCapRound);
    CGContextSetLineWidth(context, self.lineWidth);
    CGContextSetAlpha(context, self.lineAlpha);

    // draw the line
    CGContextMoveToPoint(context, self.firstPoint.x, self.firstPoint.y);
    CGContextAddLineToPoint(context, self.lastPoint.x, self.lastPoint.y);
    CGContextStrokePath(context);
}

- (void)dealloc
{
    self.lineColor = nil;
#if !ACE_HAS_ARC
    [super dealloc];
#endif
}

@end

#pragma mark - ACEDrawingTextTool

@interface ACEDrawingTextTool ()
@property (nonatomic, assign) CGPoint firstPoint;
@property (nonatomic, assign) CGPoint lastPoint;
@end

#pragma mark -

@implementation ACEDrawingTextTool

@synthesize lineColor = _lineColor;
@synthesize lineAlpha = _lineAlpha;
@synthesize lineWidth = _lineWidth;
@synthesize attributedText = _attributedText;

- (void)setInitialPoint:(CGPoint)firstPoint
{
    self.firstPoint = firstPoint;
}

- (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint
{
    self.lastPoint = endPoint;
}

- (void)draw
{

    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSaveGState(context);
    CGContextSetAlpha(context, self.lineAlpha);

    // draw the text
    CGRect viewBounds = CGRectMake(MIN(self.firstPoint.x, self.lastPoint.x),
                                   MIN(self.firstPoint.y, self.lastPoint.y),
                                   fabs(self.firstPoint.x - self.lastPoint.x),
                                   fabs(self.firstPoint.y - self.lastPoint.y)
                                   );

    // Flip the context coordinates, in iOS only.
    CGContextTranslateCTM(context, 0, viewBounds.size.height);
    CGContextScaleCTM(context, 1.0, -1.0);

    // Set the text matrix.
    CGContextSetTextMatrix(context, CGAffineTransformIdentity);

    // Create a path which bounds the area where you will be drawing text.
    // The path need not be rectangular.
    CGMutablePathRef path = CGPathCreateMutable();

    // In this simple example, initialize a rectangular path.
    CGRect bounds = CGRectMake(viewBounds.origin.x, -viewBounds.origin.y, viewBounds.size.width, viewBounds.size.height);
    CGPathAddRect(path, NULL, bounds );

    // Create the framesetter with the attributed string.
    CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)self.attributedText);

    // Create a frame.
    CTFrameRef frame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0, 0), path, NULL);

    // Draw the specified frame in the given context.
    CTFrameDraw(frame, context);

    // Release the objects we used.
    CFRelease(frame);
    CFRelease(framesetter);
    CFRelease(path);
    CGContextRestoreGState(context);
}

- (void)dealloc
{
    self.lineColor = nil;
    self.attributedText = nil;
#if !ACE_HAS_ARC
    [super dealloc];
#endif
}

@end

#pragma mark - ACEDrawingMultilineTextTool

@implementation ACEDrawingMultilineTextTool
@end

#pragma mark - ACEDrawingRectangleTool

@interface ACEDrawingRectangleTool ()
@property (nonatomic, assign) CGPoint firstPoint;
@property (nonatomic, assign) CGPoint lastPoint;
@end

#pragma mark -

@implementation ACEDrawingRectangleTool

@synthesize lineColor = _lineColor;
@synthesize lineAlpha = _lineAlpha;
@synthesize lineWidth = _lineWidth;

- (void)setInitialPoint:(CGPoint)firstPoint
{
    self.firstPoint = firstPoint;
}

- (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint
{
    self.lastPoint = endPoint;
}

- (void)draw
{
    CGContextRef context = UIGraphicsGetCurrentContext();

    // set the properties
    CGContextSetAlpha(context, self.lineAlpha);

    // draw the rectangle
    CGRect rectToFill = CGRectMake(self.firstPoint.x, self.firstPoint.y, self.lastPoint.x - self.firstPoint.x, self.lastPoint.y - self.firstPoint.y);
    if (self.fill) {
        CGContextSetFillColorWithColor(context, self.lineColor.CGColor);
        CGContextFillRect(UIGraphicsGetCurrentContext(), rectToFill);

    } else {
        CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
        CGContextSetLineWidth(context, self.lineWidth);
        CGContextStrokeRect(UIGraphicsGetCurrentContext(), rectToFill);
    }
}

- (void)dealloc
{
    self.lineColor = nil;
#if !ACE_HAS_ARC
    [super dealloc];
#endif
}

@end

#pragma mark - ACEDrawingEllipseTool

@interface ACEDrawingEllipseTool ()
@property (nonatomic, assign) CGPoint firstPoint;
@property (nonatomic, assign) CGPoint lastPoint;
@end

#pragma mark -

@implementation ACEDrawingEllipseTool

@synthesize lineColor = _lineColor;
@synthesize lineAlpha = _lineAlpha;
@synthesize lineWidth = _lineWidth;

- (void)setInitialPoint:(CGPoint)firstPoint
{
    self.firstPoint = firstPoint;
}

- (void)moveFromPoint:(CGPoint)startPoint toPoint:(CGPoint)endPoint
{
    self.lastPoint = endPoint;
}

- (void)draw
{
    CGContextRef context = UIGraphicsGetCurrentContext();

    // set the properties
    CGContextSetAlpha(context, self.lineAlpha);

    // draw the ellipse
    CGRect rectToFill = CGRectMake(self.firstPoint.x, self.firstPoint.y, self.lastPoint.x - self.firstPoint.x, self.lastPoint.y - self.firstPoint.y);
    if (self.fill) {
        CGContextSetFillColorWithColor(context, self.lineColor.CGColor);
        CGContextFillEllipseInRect(UIGraphicsGetCurrentContext(), rectToFill);

    } else {
        CGContextSetStrokeColorWithColor(context, self.lineColor.CGColor);
        CGContextSetLineWidth(context, self.lineWidth);
        CGContextStrokeEllipseInRect(UIGraphicsGetCurrentContext(), rectToFill);
    }
}

- (void)dealloc
{
    self.lineColor = nil;
#if !ACE_HAS_ARC
    [super dealloc];
#endif
}

@end


text:
package cn.edu.sdut.softlab;

import java.util.Random;

/**
 * Created by subaochen on 16-12-24.
 */
public class FruitGenerator implements Generator<String> {

    private String[] fruits = new String[]{"Apple", "Banana", "Pear"};

    @Override
    public String next() {
        Random rand = new Random();
        return fruits[rand.nextInt(3)];
    }

    public static void main(String[] args) {
        FruitGenerator generator = new FruitGenerator();
        System.out.println(generator.next());
        System.out.println(generator.next());
        System.out.println(generator.next());
        System.out.println(generator.next());
    }
}


text:
/* pam_ftp module */

/*
 * $Id: pam_ftp.c,v 1.2 2000/11/19 23:54:03 agmorgan Exp $
 *
 * Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
 *
 */

#define PLEASE_ENTER_PASSWORD "Password required for %s."
#define GUEST_LOGIN_PROMPT "Guest login ok, " \
"send your complete e-mail address as password."

/* the following is a password that "can't be correct" */
#define BLOCK_PASSWORD "\177BAD PASSWPRD\177"

#include <security/_pam_aconf.h>

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>
#include <stdarg.h>
#include <string.h>

/*
 * here, we make a definition for the externally accessible function
 * in this file (this definition is required for static a module
 * but strongly encouraged generally) it is used to instruct the
 * modules include file to define the function prototypes.
 */

#define PAM_SM_AUTH

#include <security/pam_modules.h>
#include <security/_pam_macros.h>

/* some syslogging */

static void _pam_log(int err, const char *format, ...)
{
    va_list args;

    va_start(args, format);
    openlog("PAM-ftp", LOG_CONS|LOG_PID, LOG_AUTH);
    vsyslog(err, format, args);
    va_end(args);
    closelog();
}

static int converse(pam_handle_t *pamh, int nargs
		    , struct pam_message **message
		    , struct pam_response **response)
{
    int retval;
    struct pam_conv *conv;

    D(("begin to converse\n"));

    retval = pam_get_item( pamh, PAM_CONV, (const void **) &conv ) ;
    if ( retval == PAM_SUCCESS ) {

	retval = conv->conv(nargs, ( const struct pam_message ** ) message
			    , response, conv->appdata_ptr);

	D(("returned from application's conversation function\n"));

	if ((retval != PAM_SUCCESS) && (retval != PAM_CONV_AGAIN)) {
	    _pam_log(LOG_DEBUG, "conversation failure [%s]"
		     , pam_strerror(pamh, retval));
	}

    } else {
	_pam_log(LOG_ERR, "couldn't obtain coversation function [%s]"
		 , pam_strerror(pamh, retval));
    }

    D(("ready to return from module conversation\n"));

    return retval;                  /* propagate error status */
}

/* argument parsing */

#define PAM_DEBUG_ARG       01
#define PAM_IGNORE_EMAIL    02
#define PAM_NO_ANON         04

static int _pam_parse(int argc, const char **argv, char **users)
{
    int ctrl=0;

    /* step through arguments */
    for (ctrl=0; argc-- > 0; ++argv) {

	/* generic options */

	if (!strcmp(*argv,"debug"))
	    ctrl |= PAM_DEBUG_ARG;
	else if (!strncmp(*argv,"users=",6)) {
	    *users = x_strdup(6+*argv);
	    if (*users == NULL) {
		ctrl |= PAM_NO_ANON;
		_pam_log(LOG_CRIT, "failed to duplicate user list - anon off");
	    }
	} else if (!strcmp(*argv,"ignore")) {
	    ctrl |= PAM_IGNORE_EMAIL;
	} else {
	    _pam_log(LOG_ERR,"pam_parse: unknown option; %s",*argv);
	}
    }

    return ctrl;
}

/*
 * check if name is in list or default list. place users name in *_user
 * return 1 if listed 0 if not.
 */

static int lookup(const char *name, char *list, const char **_user)
{
    int anon = 0;

    *_user = name;                 /* this is the default */
    if (list) {
	const char *l;
	char *x;

	x = list;
	while ((l = strtok(x, ","))) {
	    x = NULL;
	    if (!strcmp(name, l)) {
		*_user = list;
		anon = 1;
	    }
	}
    } else {
#define MAX_L 2
	static const char *l[MAX_L] = { "ftp", "anonymous" };
	int i;

	for (i=0; i<MAX_L; ++i) {
	    if (!strcmp(l[i], name)) {
		*_user = l[0];
		anon = 1;
		break;
	    }
	}
    }

    return anon;
}

/* --- authentication management functions (only) --- */

PAM_EXTERN
int pam_sm_authenticate(pam_handle_t *pamh,int flags,int argc
			,const char **argv)
{
    int retval, anon=0, ctrl;
    const char *user;
    char *users=NULL;

    /*
     * this module checks if the user name is ftp or annonymous. If
     * this is the case, it can set the PAM_RUSER to the entered email
     * address and SUCCEEDS, otherwise it FAILS.
     */

    ctrl = _pam_parse(argc, argv, &users);

    retval = pam_get_user(pamh, &user, NULL);
    if (retval != PAM_SUCCESS || user == NULL) {
	_pam_log(LOG_ERR, "no user specified");
	return PAM_USER_UNKNOWN;
    }

    if (!(ctrl & PAM_NO_ANON)) {
	anon = lookup(user, users, &user);
    }

    if (anon) {
	retval = pam_set_item(pamh, PAM_USER, (const void *)user);
	if (retval != PAM_SUCCESS || user == NULL) {
	    _pam_log(LOG_ERR, "user resetting failed");
	    return PAM_USER_UNKNOWN;
	}
    }

    /*
     * OK. we require an email address for user or the user's password.
     * - build conversation and get their input.
     */

    {
	struct pam_message msg[1], *mesg[1];
	struct pam_response *resp=NULL;
	const char *token;
	char *prompt=NULL;
	int i=0;

	if (!anon) {
	    prompt = malloc(strlen(PLEASE_ENTER_PASSWORD) + strlen(user));
	    if (prompt == NULL) {
		D(("out of memory!?"));
		return PAM_BUF_ERR;
	    } else {
		sprintf(prompt, PLEASE_ENTER_PASSWORD, user);
		msg[i].msg = prompt;
	    }
	} else {
	    msg[i].msg = GUEST_LOGIN_PROMPT;
	}

	msg[i].msg_style = PAM_PROMPT_ECHO_OFF;
	mesg[i] = &msg[i];

	retval = converse(pamh, ++i, mesg, &resp);
	if (prompt) {
	    _pam_overwrite(prompt);
	    _pam_drop(prompt);
	}

	if (retval != PAM_SUCCESS) {
	    if (resp != NULL)
		_pam_drop_reply(resp,i);
	    return ((retval == PAM_CONV_AGAIN)
		    ? PAM_INCOMPLETE:PAM_AUTHINFO_UNAVAIL);
	}

	if (anon) {
	    /* XXX: Some effort should be made to verify this email address! */

	    if (!(ctrl & PAM_IGNORE_EMAIL)) {
		token = strtok(resp->resp, "@");
		retval = pam_set_item(pamh, PAM_RUSER, token);

		if ((token) && (retval == PAM_SUCCESS)) {
		    token = strtok(NULL, "@");
		    retval = pam_set_item(pamh, PAM_RHOST, token);
		}
	    }

	    /* we are happy to grant annonymous access to the user */
	    retval = PAM_SUCCESS;

	} else {
	    /*
	     * we have a password so set AUTHTOK
	     */

	    (void) pam_set_item(pamh, PAM_AUTHTOK, resp->resp);

	    /*
	     * this module failed, but the next one might succeed with
	     * this password.
	     */

	    retval = PAM_AUTH_ERR;
	}

	if (resp) {                                      /* clean up */
	    _pam_drop_reply(resp, i);
	}

	/* success or failure */

	return retval;
    }
}

PAM_EXTERN
int pam_sm_setcred(pam_handle_t *pamh,int flags,int argc
		   ,const char **argv)
{
     return PAM_IGNORE;
}

#ifdef PAM_STATIC

/* static module data */

struct pam_module _pam_ftp_modstruct = {
     "pam_ftp",
     pam_sm_authenticate,
     pam_sm_setcred,
     NULL,
     NULL,
     NULL,
     NULL,
};

#endif

/* end of module definition */


text:
import cookie from "react-cookie";
import PropTypes from "prop-types";
import React from "react";
import TextField from "material-ui/TextField";

const Base = ( {activeEnvironment, yiiAppState} ) => {
  const handleSetCookieValidationKey = (e, event) => {
    cookie.save("cookie_validation_key-"+activeEnvironment,
      JSON.stringify(
        (event=="")?
          {
            environment: activeEnvironment,
            cookie_validation_key: e.target.value
          }:
          {
            id: event.id,
            environment: event.environment,
            cookie_validation_key: e.target.value
          }
      ),
      { path:"/"});
  };
return (

{"Base Configuration"}

      {yiiAppState.get("cookie_validation_key")?
        yiiAppState.get("cookie_validation_key").filter(value=>
          value.get("environment") === activeEnvironment
        ).toJS().length>0?
          yiiAppState.get("cookie_validation_key").filter(value=>
            value.get("environment") === activeEnvironment
          ).toJS().map((value,index)=>
          <TextField
              defaultValue={value.cookie_validation_key}
              errorText="This field is required."
              floatingLabelText={"Cookie validation key"}
              fullWidth
              key={index}
              name={"cookie_validation_key"}
              onChange={(event)=>handleSetCookieValidationKey(event, value)}
              type={"password"}
          />
          ):
          <TextField
              errorText="This field is required."
              floatingLabelText={"Cookie validation key"}
              fullWidth
              name={"cookie_validation_key"}
              onChange={(event)=>handleSetCookieValidationKey(event, "")}
              type={"password"}
          />
        :
        <TextField
            errorText="This field is required."
            floatingLabelText={"Cookie validation key"}
            fullWidth
            name={"cookie_validation_key"}
            onChange={(event)=>handleSetCookieValidationKey(event, "")}
            type={"password"}
        />
      }

  );
};

Base.propTypes = {
  yiiAppState: PropTypes.object.isRequired,
  activeEnvironment: PropTypes.number.isRequired
};

export default Base;


text:
from framework.dependency_management.dependency_resolver import ServiceLocator
"""
Plugin for probing x11
"""

DESCRIPTION = " x11 Probing "

def run(PluginInfo):
    #ServiceLocator.get_component("config").Show()
    #print "Content="+Content
    return ServiceLocator.get_component("plugin_helper").CommandDump('Test Command', 'Output', ServiceLocator.get_component("resource").GetResources('X11ProbeMethods'), PluginInfo, []) # No previous output


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xmlns:context="http://www.springframework.org/schema/context"
	   xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx"
	   xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:aop="http://www.springframework.org/schema/aop"
	   xsi:schemaLocation="http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.2.xsd
        http://www.springframework.org/schema/util
        http://www.springframework.org/schema/util/spring-util-3.2.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

	<!-- 配置服务 -->
	<bean id="simpleEmailService" class="com.lovecws.mumu.common.email.service.SimpleEmailService">
		<property name="userName" value="${email.username}"></property>
		<property name="password" value="${email.password}"></property>
		<property name="smtpHostName" value="${email.smtpHostName}"></property>
		<property name="pop3HostName" value="${email.pop3HostName}"></property>
	</bean>

	<!--velocityEngine 模板引擎 发送邮件-->
	<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
		<property name="velocityProperties">
			<props>
				<prop key="resource.loader">class</prop>
				<prop key="class.resource.loader.class">
					org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
				</prop>
				<prop key="velocimacro.library"></prop>
			</props>
		</property>
	</bean>

</beans>


text:
## Description
This software is designed to identify both simple and complex rearrangements from paired-end sequencing data. Specific information regarding the methodology can be found in the respective publication:

Zhao X, Emery SB, Myers B, Kidd JM, and Mills RE. Resolving complex strucural genomic rearrangements using a randomized approach. Genome Biology 2016 Jun 10;17:126

## Required third-party resources
```
R:        https://www.r-project.org/
python:   https://www.python.org/
samtools: http://samtools.sourceforge.net/
```

## Quick Start
Download and Install
```
git clone https://github.com/mills-lab/svelter.git
cd svelter
python setup.py install --user
export PATH=$PATH:$HOME/.local/bin
```
Setup working directory:
```
svelter.py Setup --reference reference.fa --workdir /working/directory/ --support ../Support/hg19/
```
Run svelter with its default setting:
```
svelter.py --sample /absolute/path/of/sample.bam --workdir /working/directory/
```

### Required files:
`Exclude.ref.bed`, `CN2.ref.bed` and `Segdup.ref.bed` are available under *Support* for some versions of human reference genome.
'Exclude.ref.bed' specifies the genomic regions to be excluded from SV analysis;
`CN2.ref.bed` specifies the copy neutral genomic regions where SVs are rarely reported;
`Segdup.ref.bed` specifieds predefined segmental duplications in reference genome; will be excluded from analysis;

Customized versions could be used, as long as they are in bed format, collected in the same folder, and named in the same format.For more details, please see *Support*.

Pre-indexed files of certain reference genomes have been produced and kept under folder */Support/Index-ref*. For specific reference, if not pre-indexed files provided, the optional parameter '--ref-index' could be omit and the indexed files would be produced through the setup step.

### Attention:
1. reference file should have been indexed by calling samtools first:  `samtools faidx ref.fasta`
2. in the Setup step, reference file should be specified by absolute path
3. the pre-indexed files under ./Support/ref-index/ are restored through large file resources on github, which require manual download.
4. working directory is required to be writable for temporary files
5. with large sample size (eg. >50X whole genome sequencing), it is recommended that the parameter *--null-copyneutral-perc 0.01* added to your command,   with small ones (eg. < 10x), *--null-copyneutral-perc 0.5* is recommended.   This parameter decides the number of CN2 regions extracted for building null model.

## Usage
svelter.py  [options]  [parameters]

### Options:
```
    Setup
    Clean
    NullModel
    BPSearch
    BPIntegrate
    SVPredict
    SVIntegrate
```

### Parameters:
#### For `Setup`:
##### Required Parameters:
```
	--workdir, writable working directory.
	--reference, absolute path of reference genome. eg: .../svelter/reference/genome.fa
	--support, folder containing all supportive file including: Exclude.bed,CN2.bed,Segdup.bed
```
 ##### Optional Parameters:
```
	--ref-index, folders containin pre-indexed files, if applicable. For certain versions of human genome, the indexed files are availabel from https://github.com/mills-lab/svelter.
```

#### For other steps:
##### Required:
```
	--workdir, writable working directory.
	--sample, input alignment file in bam format
```

##### Optional:
```
	--null-model, specify which stat model to be fitted on each parameter. if --null-model==C / Complex, negative bimodal distribution will be fitted to insertlenth; else, normal will be used

	--null-copyneutral-length, minimum length requirement for --copyneutral regions used to build null model (default: 2000)

	--null-copyneutral-perc, percentage of regions from --copyneutral to utilize (default: 0.1)

	--null-random-length, specify the length of random regions if --copyneutral parameter not used (default: 5000)

	--null-random-num, specify the number of random regions if --copyneutral parameter not used (default: 10000)

	--num-iteration, maximum number of iterations per structure will run in SV predicting step

	--qc-map-cutoff, the minimum mapping quality required for a breakpoint to be reported (default: 0.0)

	--qc-align, minimum alignment quality required for mapped reads in bam file (default: 20)

	--qc-split, minimum alighment of clipped parts of reads considered as a soft clip (default: 20)

	--qc-structure, minimum quality score of a resolved structure to be considered as PASS and included in the output vcf file

	--split-min-len, the minumum length of clip read considered as split; (default:10% of read length)

	--prefix, output prefix for vcf and svelter files (default: input.vcf, input.svelter)

	--ploidy, limit algorithm to specific zygosity (0:heterozygous only; 1:homozygous only; 2:both; default:2)
```

### For faster processing, svelter can by run with multiple cores:

#### Step1: Build null models:
```
svelter.py NullModel --sample /absolute/path/of/sample.bam --workdir /working/directory
```

```
Optional Parameters:

--chromosome, name of chromosome to run. should match chromosome name in bam file

--null-model, specify which stat model to be fitted on each parameter. if --null-model==C / Complex, negative bimodal distribution will be fitted to insertlenth; else, normal will be used

--null-copyneutral-length, minimum length requirement for --copyneutral regions used to build null model (default: 2000)

--null-copyneutral-perc, percentage of regions from --copyneutral to utilize (default: 0.1)

--null-random-length, specify the length of random regions if --copyneutral parameter not used (default: 5000)

--null-random-num, specify the number of random regions if --copyneutral parameter not used (default: 10000)

--qc-align, minimum alignment quality required for mapped reads in bam file (default: 20)

--qc-split, minimum alighment of clipped parts of reads considered as a soft clip (default: 20)

--split-min-len, the minumum length of clip read considered as split  (default:10% of read length)
```

#### Step2: Search for Breakpoints:
```
svelter.py BPSearch --sample /absolute/path/of/sample.bam --workdir /working/directory
```

```
Optional Parameters:

--chromosome, name of chromosome to run. should match chromosome name in bam file

--null-model, specify which stat model to be fitted on each parameter. if --null-model==C / Complex, negative bimodal distribution will be fitted to insertlenth; else, normal will be used

--qc-align, minimum alignment quality required for mapped reads in bam file (default: 20)

--qc-split, minimum alighment of clipped parts of reads considered as a soft clip (default: 20)

--split-min-len, the minumum length of clip read considered as split; (default:10% of read length)

--qc-map-tool, the tool extracts mappability information from a bigWig file,avaliable from: http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/bigWigSummary

--qc-map-file, .bigWig file used to decide local genomic mappability, avaliable from: ftp://hgdownload.cse.ucsc.edu/goldenPath/currentGenomes/Homo_sapiens/encodeDCC/wgEncodeMapability/

--qc-map-cutoff, the minimum mapping quality required for a breakpoint to be reported (default: 0.0)
```

#### Step3: Cluster Breakpoints:
```
svelter.py BPIntegrate --sample /absolute/path/of/sample.bam --workdir /working/directory
```

```
Optional Parameters:

--chromosome, name of chromosome to run. should match chromosome name in bam file

--batch, specify number of structures in each separate file (if 0, output files will be calssified by chromosomes; default, all BP clustered will be integrated in one txt file)
```

#### Step4: Resolve complex structural variants:
```
svelter.py SVPredict --sample sample.bam --workdir /working/directory --bp-file input/file/containing/clustered/bps
 ```

 ```
Optional Parameters:

--num-iteration, maximum number of iterations per structure will run

--ploidy, limit algorithm to specific zygosity (0:heterozygous only; 1:homozygous only; 2:both; default:2)

--null-model, specify which stat model to be fitted on each parameter. if --null-model==C / Complex, negative bimodal distribution will be fitted to insertlenth; else, normal will be used

--qc-align, minimum alignment quality required for mapped reads in bam file (default: 20)
```

#### Step5: Write output in vcf format:
```
svelter.py SVIntegrate --workdir /working/directory --prefix output  --input-path path/of/output/from/Step4
```

```
Optional Parameters:

--qc-structure, minimum quality score of a resolved structure to be considered as PASS and included in the output vcf file
```


text:
/*
	MIT License http://www.opensource.org/licenses/mit-license.php
	Author Tobias Koppers @sokra
*/
var ConstDependency = require("./dependencies/ConstDependency");
var BasicEvaluatedExpression = require("./BasicEvaluatedExpression");

var NullFactory = require("./NullFactory");

function getQuery(request) {
	var i = request.indexOf("?");
	return i < 0 ? "" : request.substr(i);
}

function ConstPlugin() {}
module.exports = ConstPlugin;

ConstPlugin.prototype.apply = function(compiler) {
	compiler.plugin("compilation", function(compilation, params) {
		compilation.dependencyFactories.set(ConstDependency, new NullFactory());
		compilation.dependencyTemplates.set(ConstDependency, new ConstDependency.Template());

		params.normalModuleFactory.plugin("parser", function(parser) {
			parser.plugin("statement if", function(statement) {
				var param = this.evaluateExpression(statement.test);
				var bool = param.asBool();
				if(typeof bool === "boolean") {
					if(statement.test.type !== "Literal") {
						var dep = new ConstDependency(bool + "", param.range);
						dep.loc = statement.loc;
						this.state.current.addDependency(dep);
					}
					return bool;
				}
			});
			parser.plugin("expression ?:", function(expression) {
				var param = this.evaluateExpression(expression.test);
				var bool = param.asBool();
				if(typeof bool === "boolean") {
					if(expression.test.type !== "Literal") {
						var dep = new ConstDependency(" " + bool + "", param.range);
						dep.loc = expression.loc;
						this.state.current.addDependency(dep);
					}
					return bool;
				}
			});
			parser.plugin("evaluate Identifier __resourceQuery", function(expr) {
				if(!this.state.module) return;
				var res = new BasicEvaluatedExpression();
				res.setString(getQuery(this.state.module.resource));
				res.setRange(expr.range);
				return res;
			});
			parser.plugin("expression __resourceQuery", function() {
				if(!this.state.module) return;
				this.state.current.addVariable("__resourceQuery", JSON.stringify(getQuery(this.state.module.resource)));
				return true;
			});
		});
	});
};


text:
import * as React from 'react';
import * as sinon from 'sinon';
import { shallow } from 'enzyme';
import Checkbox from '@material-ui/core/Checkbox';
import AlertError from '@material-ui/icons/Error';
import NotificationSync from '@material-ui/icons/Sync';
import NavigationCheck from '@material-ui/icons/Check';
import { StatusFilter } from '../../components/DataPackPage/StatusFilter';

describe('StatusFilter component', () => {
    const getProps = () => ({
        completed: false,
        incomplete: false,
        submitted: false,
        onChange: sinon.spy(),
        ...(global as any).eventkit_test_props,
    });

    const getWrapper = props => (
        shallow(<StatusFilter {...props} />)
    );

    it('should have checkboxes and icons', () => {
        const props = getProps();
        const wrapper = getWrapper(props);
        expect(wrapper.find('p').first().html()).toContain('Export Status');
        expect(wrapper.find(Checkbox)).toHaveLength(3);
        expect(wrapper.find(Checkbox).at(0).props().checked).toEqual(false);
        expect(wrapper.find(Checkbox).at(1).props().checked).toEqual(false);
        expect(wrapper.find(Checkbox).at(2).props().checked).toEqual(false);
        expect(wrapper.find('.qa-StatusFilter-title-complete').html()).toContain('Complete');
        expect(wrapper.find('.qa-StatusFilter-title-running').html()).toContain('Running');
        expect(wrapper.find('.qa-StatusFilter-title-error').html()).toContain('Error');
        expect(wrapper.find(AlertError)).toHaveLength(1);
        expect(wrapper.find(NotificationSync)).toHaveLength(1);
        expect(wrapper.find(NavigationCheck)).toHaveLength(1);
        expect(wrapper.find('p')).toHaveLength(1);
    });

    it('should call onChange with "COMPLETED"', () => {
        const props = getProps();
        props.onChange = sinon.spy();
        const wrapper = getWrapper(props);
        const input = wrapper.find(Checkbox).at(0);
        input.simulate('change', { target: { checked: true } });
        wrapper.update();
        expect(props.onChange.calledOnce).toBe(true);
    });

    it('should call onChange with "INCOMPLETE"', () => {
        const props = getProps();
        props.onChange = sinon.spy();
        const wrapper = getWrapper(props);
        const input = wrapper.find(Checkbox).at(2);
        input.simulate('change', { target: { checked: true } });
        wrapper.update();
        expect(props.onChange.calledOnce).toBe(true);
    });

    it('should call onChange with "SUBMITTED"', () => {
        const props = getProps();
        props.onChange = sinon.spy();
        const wrapper = getWrapper(props);
        const input = wrapper.find(Checkbox).at(1);
        input.simulate('change', { target: { checked: true } });
        wrapper.update();
        expect(props.onChange.calledOnce).toBe(true);
    });

    it('should set Completed as checked', () => {
        const props = getProps();
        const wrapper = getWrapper(props);
        let input = wrapper.find(Checkbox).at(0);
        expect(input.props().checked).toBe(false);
        const nextProps = getProps();
        nextProps.completed = true;
        wrapper.setProps(nextProps);
        input = wrapper.find(Checkbox).at(0);
        expect(input.props().checked).toBe(true);
    });

    it('should set incomplete as checked', () => {
        const props = getProps();
        const wrapper = getWrapper(props);
        let input = wrapper.find(Checkbox).at(2);
        expect(input.props().checked).toBe(false);
        const nextProps = getProps();
        nextProps.incomplete = true;
        wrapper.setProps(nextProps);
        input = wrapper.find(Checkbox).at(2);
        expect(input.props().checked).toBe(true);
    });

    it('should set running as checked', () => {
        const props = getProps();
        const wrapper = getWrapper(props);
        let input = wrapper.find(Checkbox).at(1);
        expect(input.props().checked).toBe(false);
        const nextProps = getProps();
        nextProps.submitted = true;
        wrapper.setProps(nextProps);
        input = wrapper.find(Checkbox).at(1);
        expect(input.props().checked).toBe(true);
    });
});


text:
// Copyright (c) 2014, Oracle and/or its affiliates.

// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle

// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html

#ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_COMPLEMENT_GRAPH_HPP
#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_DEBUG_COMPLEMENT_GRAPH_HPP

#ifdef BOOST_GEOMETRY_TEST_DEBUG
#include <iostream>
#endif

namespace boost { namespace geometry
{

namespace detail { namespace is_valid
{

#ifdef BOOST_GEOMETRY_TEST_DEBUG
template <typename OutputStream, typename TurnPoint>
inline void
debug_print_complement_graph(OutputStream& os,
                             complement_graph<TurnPoint> const& graph)
{
    typedef typename complement_graph<TurnPoint>::vertex_handle vertex_handle;

    os << "num rings: " << graph.m_num_rings << std::endl;
    os << "vertex ids: {";
    for (vertex_handle it = graph.m_vertices.begin();
         it != graph.m_vertices.end(); ++it)
    {
        os << " " << it->id();
    }
    os << " }" << std::endl;

    for (vertex_handle it = graph.m_vertices.begin();
         it != graph.m_vertices.end(); ++it)
    {
        os << "neighbors of " << it->id() << ": {";
        for (typename complement_graph
                 <
                     TurnPoint
                 >::neighbor_container::const_iterator
                 nit = graph.m_neighbors[it->id()].begin();
             nit != graph.m_neighbors[it->id()].end(); ++nit)
        {
            os << " " << (*nit)->id();
        }
        os << "}" << std::endl;
    }
}
#else
template <typename OutputStream, typename TurnPoint>
inline void debug_print_complement_graph(OutputStream&,
                                         complement_graph<TurnPoint> const&)
{
}
#endif

}} // namespace detail::is_valid

}} // namespace boost::geometry

#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_COMPLEMENT_GRAPH_HPP


text:
webpackJsonp([1],{

/***/ 247:
/***/ function(module, exports, __webpack_require__) {

	'use strict';

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

	function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

	var React = __webpack_require__(1);

	var _require = __webpack_require__(162);

	var Link = _require.Link;
	var hashHistory = _require.hashHistory;

	var _require2 = __webpack_require__(225);

	var connector = _require2.connector;

	var Landing = function (_React$Component) {
	  _inherits(Landing, _React$Component);

	  function Landing(props) {
	    _classCallCheck(this, Landing);

	    var _this = _possibleConstructorReturn(this, (Landing.__proto__ || Object.getPrototypeOf(Landing)).call(this, props));

	    _this.handleSearchTermEvent = _this.handleSearchTermEvent.bind(_this);
	    _this.gotoSearch = _this.gotoSearch.bind(_this);
	    return _this;
	  }

	  _createClass(Landing, [{
	    key: 'handleSearchTermEvent',
	    value: function handleSearchTermEvent(event) {
	      this.props.setSearchTerm(event.target.value);
	    }
	  }, {
	    key: 'gotoSearch',
	    value: function gotoSearch(event) {
	      hashHistory.push('search');
	      event.preventDefault();
	    }
	  }, {
	    key: 'render',
	    value: function render() {
	      return React.createElement(
	        'div',
	        { className: 'home-info' },
	        React.createElement(
	          'h1',
	          { className: 'title' },
	          'svideo is awesome'
	        ),
	        React.createElement(
	          'form',
	          { onSubmit: this.gotoSearch },
	          React.createElement('input', { value: this.props.searchTerm, onChange: this.handleSearchTermEvent, className: 'search', type: 'text', placeholder: 'Search' })
	        ),
	        React.createElement(
	          Link,
	          { to: '/search', className: 'browse-all' },
	          ' or Browse All'
	        )
	      );
	    }
	  }]);

	  return Landing;
	}(React.Component);

	var _React$PropTypes = React.PropTypes;
	var func = _React$PropTypes.func;
	var string = _React$PropTypes.string;

	Landing.propTypes = {
	  searchTerm: string,
	  setSearchTerm: func
	};

	module.exports = connector(Landing);

/***/ }

});


text:
                <input type="file"  id="FileOpener" fileread="vm.uploadme" ng-show='0' >
                <button class="btn btn-info" ng-click="add()"></button>

                Search
                <input type="search" class="form-control" ng-model="key" placeholder="filter songs" />

{{selected_song_name}}

                                {{time_str}}

                        <button class="btn btn-info" ng-click='prev()'></button>
                        <button class="btn btn-info" ng-click='play()'></button>
                        <button class="btn btn-info" ng-click='pause()'></button>
                        <button class="btn btn-info" ng-click='next()'></button>
                        <button class="btn btn-info" ng-click="record()" ></button>

Track List

                            Track No
                            Name
                            Play

                            {{$index+1}}
                            {{x.name}}
                             <input type="button" id={{x.path}} onclick="sel(this.id)" selectBut class="btn btn-info" value="Select">

                  <button class="btn btn-info" onclick="share()"> Share</button>

                     User ID

                    <input type="text" class="form-control" id='share_user_id'>

                    <button class="btn btn-info" onclick="send_mail()"> Send Mail</button>


text:
package org.dcm4chee.archive.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * @author Damien Evans <damien.daddy@gmail.com>
 * @author Justin Falk <jfalkmu@gmail.com>
 * @author Gunter Zeilinger <gunterze@gmail.com>
 * @version $Revision$ $Date$
 * @since Mar 3, 2008
 */
@Entity
@Table(name = "study_permission")
public class StudyPermission extends BaseEntity implements Serializable {

    private static final long serialVersionUID = -4389532918446366208L;

    /**
     * Action value for permission to query attributes of the Study and included
     * Series and Instance entities.
     */
    public static final String QUERY_ACTION = "Q";

    /**
     * Action value for permission to active retrieve or passive receive
     * Instances of the Study.
     */
    public static final String READ_ACTION = "R";

    /**
     * Action value for permission to retrieve Instances of the Study to another
     * application entity.
     */
    public static final String EXPORT_ACTION = "E";

    /**
     * Action value for permission to store Instances to an already existing
     * Study.
     */
    public static final String APPEND_ACTION = "A";

    /**
     * Action value to modify attributes of the Study and included Series.
     */
    public static final String UPDATE_ACTION = "U";

    /**
     * Action value to delete the whole Study or individual Series or Instances.
     */
    public static final String DELETE_ACTION = "D";

    @Column(name = "study_iuid", nullable = false)
    private String studyInstanceUID;

    @Column(name = "action", nullable = false)
    private String action;

    @Column(name = "roles", nullable = false)
    private String role;

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getStudyInstanceUID() {
        return studyInstanceUID;
    }

    public void setStudyInstanceUID(String studyInstanceUID) {
        this.studyInstanceUID = studyInstanceUID;
    }

    @Override
    public String toString() {
        return "StudyPermission[pk=" + pk
                + ", suid=" + studyInstanceUID
                + ", action=" + action +
                ", role=" + role + "]";
    }
}


text:
package org.wso2.maven.inboundendpoint;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;

import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.wso2.developerstudio.eclipse.utils.data.ITemporaryFileTag;
import org.wso2.maven.capp.model.Artifact;
import org.wso2.maven.capp.mojo.AbstractPOMGenMojo;
import org.wso2.maven.capp.utils.CAppMavenUtils;
import org.wso2.maven.capp.utils.WSO2MavenPluginConstantants;
import org.wso2.maven.core.utils.MavenConstants;
import org.wso2.maven.esb.ESBArtifact;
import org.wso2.maven.esb.utils.ESBMavenUtils;

/**
 * This is the Maven Mojo used for generating a pom for a sequence artifact from
 * the old CApp project structure
 *
 * @goal pom-gen
 *
 */
public class InboundEndpointPOMGenMojo extends AbstractPOMGenMojo {

	/**
	 * @parameter default-value="${project}"
	 */
	private MavenProject project;

	/**
	 * Maven ProjectHelper.
	 *
	 * @component
	 */
	private MavenProjectHelper projectHelper;

	/**
	 * The path of the location to output the pom
	 *
	 * @parameter expression="${project.build.directory}/artifacts"
	 */
	private File outputLocation;

	/**
	 * The resulting extension of the file
	 *
	 * @parameter
	 */
	private File artifactLocation;

	/**
	 * POM location for the module project
	 *
	 * @parameter expression="${project.build.directory}/pom.xml"
	 */
	private File moduleProject;

	/**
	 * Group id to use for the generated pom
	 *
	 * @parameter
	 */
	private String groupId;

	/**
	 * Comma separated list of "artifact_type=extension" to be used when
	 * creating dependencies for other capp artifacts
	 *
	 * @parameter
	 */
	public String typeList;

	private List<ESBArtifact> retrieveArtifacts() {
		return ESBMavenUtils.retrieveArtifacts(getArtifactLocation());
	}

	public void execute() throws MojoExecutionException, MojoFailureException {
		// Retrieving all the existing ESB Artifacts for the given Maven project
		List<ESBArtifact> artifacts = retrieveArtifacts();

		// Artifact list
		List<Artifact> mappedArtifacts = new ArrayList<Artifact>();

		// Mapping ESBArtifacts to C-App artifacts so that we can reuse the
		// maven-endpoint-plugin
		for (ESBArtifact esbArtifact : artifacts) {
			Artifact artifact = new Artifact();
			artifact.setName(esbArtifact.getName());
			// artifact.setVersion(this.getProject().getVersion());
			artifact.setVersion(esbArtifact.getVersion());
			artifact.setType(esbArtifact.getType());
			artifact.setServerRole(esbArtifact.getServerRole());
			artifact.setFile(esbArtifact.getFile());
			artifact.setSource(new File(getArtifactLocation(), MavenConstants.ARTIFACT_XML_NAME));
			mappedArtifacts.add(artifact);
		}
		// Calling the process artifacts method of super type to continue the
		// sequence.
		super.processArtifacts(mappedArtifacts);

	}

	protected void copyResources(MavenProject project, File projectLocation, Artifact artifact) throws IOException {
		ITemporaryFileTag newTag = org.wso2.developerstudio.eclipse.utils.file.FileUtils.createNewTempTag();
		File sequenceArtifact = processTokenReplacement(artifact);
		if (sequenceArtifact == null) {
			sequenceArtifact = artifact.getFile();
		}
		FileUtils.copyFile(sequenceArtifact, new File(projectLocation, artifact.getFile().getName()));
		newTag.clearAndEnd();
	}

	protected void addPlugins(MavenProject artifactMavenProject, Artifact artifact) {
		Plugin plugin = CAppMavenUtils.createPluginEntry(artifactMavenProject, MavenConstants.WSO2_MAVEN_GROUPID,
				MavenConstants.MAVEN_INBOUND_ENDPOINT_ARTIFACTID,
				WSO2MavenPluginConstantants.MAVEN_INBOUND_ENDPOINT_PLUGIN_VERSION, true);
		Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
		// add configuration
		Xpp3Dom aritfact = CAppMavenUtils.createConfigurationNode(configuration, MavenConstants.ARTIFACT_TAG);
		aritfact.setValue(artifact.getFile().getName());
	}

	protected String getArtifactType() {
		return MavenConstants.INBOUND_ENDPOINT_ARTIFACT_TYPE;
	}
}


text:
        menu

queue_music Tracks

stars Artists

album Albums

audiotrack Genders

explore Explore

queue_music Tracks

stars Artists

album Albums

audiotrack Genders

explore Explore


text:
<?php
if($type=='peepoo'){
    $bg = '#6A1D84';
    $appName = 'Pee@Poo';
}
else if($type=='smartq'){
    $bg = '#166961';
    $appName = 'SmartQ';
  }
else if($type=='codify'){
    //
    $bg = '#808080';
    $appName = 'Codify';
  }
else if($type=='askgov'){
    $bg = '#C9D662';
    $appName = 'AskGov';
  }
else if($type=='moja'){
    $bg = '#65BEC7';
    $appName = 'Jejak Asnaf';
  }
?>

    <div class="col-lg-12 header-section" style="background:<?php echo $bg;?>">

            <img src="<?php echo base_url(); ?>assets/img/<?php echo $type;?>.png" id="profile1" class="profileActive" alt=""/>

            <?php echo $appName;?>
            <?php if(null!==$this->session->flashdata('submited')) echo "
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">×</button>".
              $this->session->flashdata('submited')
            ."
"; //else echo "
<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">×</button>Problem with your submission...
";?>

            <form method="post" action="<?php echo base_url('index.php/proses/submit/'.$type); ?>">

1:
                      How do you rate the overall <?php echo $appName; ?> apps?

                    <input id="input-q1" class="rating" data-size="md" data-min="0" data-max="5" data-step="1" data-default-caption="{rating} stars" data-star-captions="{}" name="" data-show-clear="false">
                    <input type="hidden" name="v1" id="v1" />

2:
                      Do you think the apps can benefit the citizen?

                    <input id="input-q2" class="rating" data-size="md" data-min="0" data-max="5" data-step="1" data-stars="5"
data-symbol="" data-default-caption="{rating} hearts" data-star-captions="{}" data-show-clear="false">
                    <input type="hidden" name="v2" id="v2" />

3:
                      Would you like to recommend this app to others?

                    <input id="input-q3" class="rating"  data-size="md" data-symbol="" data-glyphicon="false"
data-rating-class="rating-fa" data-default-caption="{rating} likes" data-star-captions="{}" data-min="0" data-max="5" data-step="1" data-show-clear="false">
                    <input type="hidden" name="v3" id="v3" />

4:
                      How would you improve the apps? [optional]

                    Comment
                    <textarea rows="2" class="form-control" placeholder="Comment" id="q4" name="v4"></textarea>

5:
                      I would like to be notified when the app is available to download. Here's my email : [optional]

                    Email Address
                    <input type="email" class="form-control" placeholder="Email Address" id="q5" name="v5">

                    <input type="submit" class="btn btn-success btn-xl" id="btnSubmit" value="Submit" />

                    <input type="reset" class="btn btn-cancel btn-xl" value="Cancel" />

            </form>

I am interested to participate in the next Immersion Programme

<img src='<?php echo base_url(); ?>assets/img/qrcode.png' alt=''>

https://goo.gl/wCQt3g


text:
package org.apache.tomcat.util.net;

/**
 *
IPv6 utilities.
 *
For the moment, it only contains function to canonicalize IPv6 address
 * into RFC 5952 form.
 */
public class IPv6Utils {

    private static final int MAX_NUMBER_OF_GROUPS = 8;
    private static final int MAX_GROUP_LENGTH = 4;

    /**
     *
Convert IPv6 address into RFC 5952 form.
     * E.g. 2001:db8:0:1:0:0:0:1 -> 2001:db8:0:1::1

     *
     *
Method is null safe, and if IPv4 address or host name is passed to the
     * method it is returned without any processing.

     *
     *
Method also supports IPv4 in IPv6 (e.g. 0:0:0:0:0:ffff:192.0.2.1 ->
     * ::ffff:192.0.2.1), and zone ID (e.g. fe80:0:0:0:f0f0:c0c0:1919:1234%4
     * -> fe80::f0f0:c0c0:1919:1234%4).

     *
     *
The behaviour of this method is undefined if an invalid IPv6 address
     * is passed in as input.

     *
     * @param ipv6Address String representing valid IPv6 address.
     * @return String representing IPv6 in canonical form.
     * @throws IllegalArgumentException if IPv6 format is unacceptable.
     */
    public static String canonize(String ipv6Address) throws IllegalArgumentException {

        if (ipv6Address == null) {
            return null;
        }

        // Definitely not an IPv6, return untouched input.
        if (!mayBeIPv6Address(ipv6Address)) {
            return ipv6Address;
        }

        // Length without zone ID (%zone) or IPv4 address
        int ipv6AddressLength = ipv6Address.length();
        if (ipv6Address.contains(".")) {
            // IPv4 in IPv6
            // e.g. 0:0:0:0:0:FFFF:127.0.0.1
            int lastColonPos = ipv6Address.lastIndexOf(':');
            int lastColonsPos = ipv6Address.lastIndexOf("::");
            if (lastColonsPos >= 0 && lastColonPos == lastColonsPos + 1) {
                /*
                 *  IPv6 part ends with two consecutive colons,
                 *  last colon is part of IPv6 format.
                 *  e.g. ::127.0.0.1
                 */
                ipv6AddressLength = lastColonPos + 1;
            } else {
                /*
                 *  IPv6 part ends with only one colon,
                 *  last colon is not part of IPv6 format.
                 *  e.g. ::FFFF:127.0.0.1
                 */
                ipv6AddressLength = lastColonPos;
            }
        } else if (ipv6Address.contains("%")) {
            // Zone ID
            // e.g. fe80:0:0:0:f0f0:c0c0:1919:1234%4
            ipv6AddressLength = ipv6Address.lastIndexOf('%');
        }

        StringBuilder result = new StringBuilder();
        char [][] groups = new char[MAX_NUMBER_OF_GROUPS][MAX_GROUP_LENGTH];
        int groupCounter = 0;
        int charInGroupCounter = 0;

        // Index of the current zeroGroup, -1 means not found.
        int zeroGroupIndex = -1;
        int zeroGroupLength = 0;

        // maximum length zero group, if there is more then one, then first one
        int maxZeroGroupIndex = -1;
        int maxZeroGroupLength = 0;

        boolean isZero = true;
        boolean groupStart = true;

        /*
         *  Two consecutive colons, initial expansion.
         *  e.g. 2001:db8:0:0:1::1 -> 2001:db8:0:0:1:0:0:1
         */

        StringBuilder expanded = new StringBuilder(ipv6Address);
        int colonsPos = ipv6Address.indexOf("::");
        int length = ipv6AddressLength;
        int change = 0;

        if (colonsPos >= 0 && colonsPos < ipv6AddressLength - 1) {
            int colonCounter = 0;
            for (int i = 0; i < ipv6AddressLength; i++) {
                if (ipv6Address.charAt(i) == ':') {
                    colonCounter++;
                }
            }

            if (colonsPos == 0) {
                expanded.insert(0, "0");
                change = change + 1;
            }

            for (int i = 0; i < MAX_NUMBER_OF_GROUPS - colonCounter; i++) {
                expanded.insert(colonsPos + 1, "0:");
                change = change + 2;
            }

            if (colonsPos == ipv6AddressLength - 2) {
                expanded.setCharAt(colonsPos + change + 1, '0');
            } else {
                expanded.deleteCharAt(colonsPos + change + 1);
                change = change - 1;
            }
            length = length + change;
        }

        // Processing one char at the time
        for (int charCounter = 0; charCounter < length; charCounter++) {
            char c = expanded.charAt(charCounter);
            if (c >= 'A' && c <= 'F') {
                c = (char) (c + 32);
            }
            if (c != ':') {
                groups[groupCounter][charInGroupCounter] = c;
                if (!(groupStart && c == '0')) {
                    ++charInGroupCounter;
                    groupStart = false;
                }
                if (c != '0') {
                    isZero = false;
                }
            }
            if (c == ':' || charCounter == (length - 1)) {
                // We reached end of current group
                if (isZero) {
                    ++zeroGroupLength;
                    if (zeroGroupIndex == -1) {
                        zeroGroupIndex = groupCounter;
                    }
                }

                if (!isZero || charCounter == (length - 1)) {
                    // We reached end of zero group
                    if (zeroGroupLength > maxZeroGroupLength) {
                        maxZeroGroupLength = zeroGroupLength;
                        maxZeroGroupIndex = zeroGroupIndex;
                    }
                    zeroGroupLength = 0;
                    zeroGroupIndex = -1;
                }
                ++groupCounter;
                charInGroupCounter = 0;
                isZero = true;
                groupStart = true;
            }
        }

        int numberOfGroups = groupCounter;

        // Output results
        for (groupCounter = 0; groupCounter < numberOfGroups; groupCounter++) {
            if (maxZeroGroupLength <= 1 || groupCounter < maxZeroGroupIndex
                    || groupCounter >= maxZeroGroupIndex + maxZeroGroupLength) {
                for (int j = 0; j < MAX_GROUP_LENGTH; j++) {
                    if (groups[groupCounter][j] != 0) {
                        result.append(groups[groupCounter][j]);
                    }
                }
                if (groupCounter < (numberOfGroups - 1)
                        && (groupCounter != maxZeroGroupIndex - 1
                                || maxZeroGroupLength <= 1)) {
                    result.append(':');
                }
            } else if (groupCounter == maxZeroGroupIndex) {
                result.append("::");
            }
        }

        // Solve problem with three colons in IPv4 in IPv6 format
        // e.g. 0:0:0:0:0:0:127.0.0.1 -> :::127.0.0.1 -> ::127.0.0.1
        int resultLength = result.length();
        if (result.charAt(resultLength - 1) == ':' && ipv6AddressLength < ipv6Address.length()
                && ipv6Address.charAt(ipv6AddressLength) == ':') {
            result.delete(resultLength - 1, resultLength);
        }

        /*
         * Append IPv4 from IPv4-in-IPv6 format or Zone ID
         */
        for (int i = ipv6AddressLength; i < ipv6Address.length(); i++) {
            result.append(ipv6Address.charAt(i));
        }

        return result.toString();
    }

    /**
     * Heuristic check if string might be an IPv6 address.
     *
     * @param input Any string or null
     * @return true, if input string contains only hex digits and at least two colons, before '.' or '%' character
     */
    static boolean mayBeIPv6Address(String input) {
        if (input == null) {
            return false;
        }

        int colonsCounter = 0;
        int length = input.length();
        for (int i = 0; i < length; i++) {
            char c = input.charAt(i);
            if (c == '.' || c == '%') {
                // IPv4 in IPv6 or Zone ID detected, end of checking.
                break;
            }
            if (!((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f')
                    || (c >= 'A' && c <= 'F') || c == ':')) {
                return false;
            } else if (c == ':') {
                colonsCounter++;
            }
        }
        if (colonsCounter < 2) {
            return false;
        }
        return true;
    }
}


text:
#region

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using AutoMapper;
using ESS.Domain.Common.Association.Domain;
using ESS.Domain.Common.Association.Events;
using ESS.Domain.Common.Category.ReadModels;
using ESS.Domain.Common.PartyRole.ReadModels;
using ESS.Framework.CQRS.Event;
using ESS.Framework.CQRS.ReadModel;
using ESS.Framework.Data;

#endregion

namespace ESS.Domain.Common.Association.ReadModels
{
    public class AssociationView
        :ReadModel, ISubscribeTo<AssociationCreated>, ISubscribeTo<AssociationDeleted>, ISubscribeTo<AssociationEdited>
    {
        private readonly IRepositoryAsync<AssociationItem, Guid> _repositoryAsync;

        public AssociationView(IRepositoryAsync<AssociationItem, Guid> repositoryAsync)
        {
            _repositoryAsync = repositoryAsync;
        }

        public async Task<IQueryable<AssociationItem>> AssociationListAsync(Expression<Func<AssociationItem, bool>> condition)
        {
            return await _repositoryAsync.FindAsync(condition);
        }

        public async Task<IQueryable<AssociationItem>> AssociationListAsync()
        {
            return await _repositoryAsync.GetAllAsync();
        }

        public Task<AssociationItem> GetAssociationAsync(Guid id)
        {
            return _repositoryAsync.GetAsync(id);
        }

        #region handle

        public void Handle(AssociationCreated e)
        {
            var item = Mapper.DynamicMap<AssociationItem>(e);

            _repositoryAsync.AddAsync(e.Id, item);
        }
        public void Handle(AssociationEdited e)
        {
            var item = Mapper.DynamicMap<AssociationItem>(e);

            _repositoryAsync.UpdateAsync(e.Id, item);
        }

        public void Handle(AssociationDeleted e)
        {
            _repositoryAsync.DeleteAsync(e.Id);
        }

        private void Update(Guid id, Action<AssociationItem> action)
        {
            var item = _repositoryAsync.SingleAsync(c => c.Id == id).Result;

            action.Invoke(item);
            _repositoryAsync.UpdateAsync(item.Id, item);
        }

        public override Task<bool> Clear()
        {
            return _repositoryAsync.DeleteAllAsync();
        }

        public override async Task<IEnumerable> GetAll()
        {
            return await AssociationListAsync();
        }

        #endregion
    }

    [Serializable]
    public class AssociationItem
    {
        public Guid Id;
        public Guid From;
        public Guid To;
        public AssociationRule AssociationRule;
        public CategoryTypeItem Type;
        public DateTime FromDate;
        public DateTime EndDate;

        public string Code;
        public bool IsSystem;
    }

}


text:
async function simple (context) {
  const template = 'simple.ejs'
  const dir = 'generated'
  const target = `${dir}/simple.txt`

  const result = await context.template.generate({ template, target })
  return result
}

module.exports = simple


text:
void hello(void) {
    printf("hello, library world\n");
}


text:
<?php

require_once(dirname(__FILE__).'/../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../init.php');
require_once(dirname(__FILE__).'/puntopagos_config.php');
require_once(dirname(__FILE__).'/puntopagos.php');

if (!Context::getContext()->customer->isLogged())
    Tools::redirect('authentication.php?back=order.php');

$time = time();
setlocale(LC_TIME, 'C');

$puntopagos = new puntopagos();

$total = $cart->getOrderTotal(true, Cart::BOTH);
$total2 = number_format((int)$total, 2, '.', '');
//$uniqid = date('Uu');
$uniqid = (int)($cart->id);

$authorization_string = $puntopagos->authorization_string('create', $uniqid, $total,$time, '');
$id_customer = $cookie->{'id_customer'};

$headers = $puntopagos->create_headers($authorization_string, $time, $puntopagos_keyid, $puntopagos_secret);
$body = array('trx_id' => $uniqid,
			  'medio_pago' => '3',
			  'monto' => $total2,
			  'detalle' => '',
			  'fecha' => strftime($puntopagos->RFC1123_FORMAT, $time));
$json_body = json_encode($body);

$response = $puntopagos->do_post_request("https://$puntopagos_host/transaccion/crear", $json_body, $headers);

$db = Db::getInstance();
$query = "INSERT INTO `"._DB_PREFIX_."puntopagos` (id, id_customer, total, status, `date`) VALUES ($uniqid, '$id_customer', '$total', 'INIT', NOW() )";
$db->Execute($query);

$json_response = json_decode($response);

if ($json_response->{'respuesta'} != '00') {
	// puntopagos ha respondido con un error
	$query = "UPDATE `"._DB_PREFIX_."puntopagos` SET `status` = 'ERR', `error` = '" . $json_response->{'error'} . "' WHERE id = '$uniqid'";
	$db->Execute($query);
	header('Location: trx_error.php?tid=' . $uniqid);
	die();
}

$query = "UPDATE `"._DB_PREFIX_."puntopagos` SET `status` = 'PAY', `token` = '" . $json_response->{'token'} . "' WHERE id = '$uniqid'";
$db->Execute($query);

Tools::redirectLink('https://' . $puntopagos_host . '/transaccion/procesar/' . $json_response->{'token'});

?>


text:
.monaco-workbench > .sidebar > .content {
	overflow: hidden;
}

.monaco-workbench.nosidebar > .sidebar {
	display: none !important;
	visibility: hidden !important;
}

.monaco-workbench > .sidebar > .title > .title-label h2 {
	text-transform: uppercase;
}

.monaco-workbench .viewlet .collapsible.header .title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.monaco-workbench .viewlet .collapsible.header .actions {
	width: 0; /* not using display: none for keyboard a11y reasons */
}

.monaco-workbench .viewlet .split-view-view:hover > .header .actions,
.monaco-workbench .viewlet .collapsible.header.focused .actions {
	width: initial;
	flex: 1;
}

.monaco-workbench .viewlet .collapsible.header .actions .action-label {
	width: 28px;
	background-size: 16px;
	background-position: center center;
	background-repeat: no-repeat;
	margin-right: 0;
	height: 22px;
}

.monaco-workbench .viewlet .collapsible.header .actions .action-label .label {
	display: none;
}

.monaco-workbench .viewlet .collapsible.header.collapsed .actions {
	display: none;
}

.monaco-workbench .viewlet .collapsible.header .action-label {
	margin-right: 0.2em;
	background-repeat: no-repeat;
	width: 16px;
	height: 16px;
}


text:
module DuckHunt
  module Validators
    class NotEqualTo < Validator
      attr_reader :value
      def initialize(*args)
        @value = args[0]
        raise ArgumentError, "a value must be provided" if @value.nil?
      end

      def valid?(value)
        return value != @value
      end

      def error_message
        return "equal to `#{@value}`"
      end
    end
  end
end


text:
/*
Template Name: Academic Education
File: Forms CSS
Author: OS Templates
Author URI: http://www.os-templates.com/
Licence: Website Template Licence
*/

form, fieldset, legend{
	margin:0;
	padding:0;
	border:none;
	}

legend{
	display:none;
	}

input, textarea, select{
	font-size:12px;
	font-family:Georgia, "Times New Roman", Times, serif;
	}

/* ----------------------------------------------Search Form-------------------------------------*/

#sitesearch{
	display:block;
	float:right;
	}

#sitesearch strong{
	display:block;
	float:left;
	margin:0;
	padding:7px 15px 0 0;
	text-transform:uppercase;
	color:#C6CDD6;
	background-color:#06213F;
	}

#sitesearch input{
	display:block;
	float:left;
	width:230px;
	height:25px;
	margin:0 15px 0 0;
	padding:0 5px;
	color:#979797;
	background:url("../images/form_input_long.gif") 0 0 no-repeat #F9F9F9;
	border:none;
	}

#sitesearch input#search{
	width:23px;
	height:23px;
	margin:0;
	padding:0;
	cursor:pointer;
	background:none;
	float:left;
	}

/* ----------------------------------------------Forms in Content Area-------------------------------------*/

#container #respond{
	display:block;
	width:100%;
	}

#container #respond input{
	width:170px;
	padding:2px;
	border:1px solid #CCCCCC;
	margin:5px 5px 0 0;
	}

#container #respond textarea{
	width:98%;
	border:1px solid #CCCCCC;
	padding:2px;
	overflow:auto;
	}

#container #respond p{
	margin:5px 0;
	}

#container #respond #submit, #container #respond #reset{
	margin:0;
	padding:5px;
	color:#666666;
	background-color:#F7F7F7;
	border:1px solid #CCCCCC;
	cursor:pointer;
	}

/* ----------------------------------------------Newsletter-------------------------------------*/

#footer legend{
	display:block;
	margin-bottom:15px;
	}

#footer input{
	display:block;
	float:left;
	width:260px;
	height:20px;
	margin:0;
	padding:5px 10px;
	color:#666666;
	background-color:#ECECEC;
	border:none;
	}

#footer input#subscribe{
	width:100px;
	height:30px;
	float:left;
	margin:0 0 0 8px;
	padding:0;
	cursor:pointer;
	text-align:center;
	text-transform:uppercase;
	font-weight:bold;
	}


text:
<?php

	namespace CRD\Core;

	class HTML
	{
		public static function entities($value)
		{
			return htmlentities($value, ENT_QUOTES, 'UTF-8');
		}

		public static function entities_decode($value)
		{
			return html_entity_decode($value, ENT_QUOTES, 'UTF-8');
		}
	}
?>


text:
<?php
namespace PlaygroundCore\TwitterCard;

class Tag
{
    protected $property;
    protected $value;

    public function __construct($property, $value = null)
    {
        $this->property = $property;
        $this->value   = $value;
    }

    public function getProperty()
    {
        return $this->property;
    }

    public function setProperty($property)
    {
        $this->property = $property;
    }

    public function getValue()
    {
        return $this->value;
    }

    public function setValue($value)
    {
        $this->value = $value;
    }
}


text:
package ro.nextreports.server.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.jcrom.annotations.JcrCheckedout;
import org.jcrom.annotations.JcrChildNode;
import org.jcrom.annotations.JcrNode;
import org.jcrom.annotations.JcrProperty;
import org.jcrom.annotations.JcrReference;

import ro.nextreports.server.StorageConstants;
import ro.nextreports.server.cache.Cacheable;

import ro.nextreports.engine.exporter.ResultExporter;

/**
 * @author Decebal Suiu
 */
@JcrNode (classNameProperty = "className", mixinTypes = { StorageConstants.NEXT_REPORT_MIXIN })
public class Report extends VersionableEntity implements Cacheable {

	private static final long serialVersionUID = 1L;

	@JcrProperty
    private String type;

    @JcrProperty
    private String description;

    @JcrReference
    private DataSource dataSource;

    @JcrChildNode(createContainerNode = false)
	private Serializable content;

	@JcrCheckedout
	private boolean checkedOut;

    @JcrProperty
    private int specialType;

	@JcrProperty
    private int expirationTime;

	@JcrChildNode
	private List<DrillDownEntity> drillDownEntities;

    public Report() {
    	super();
    }

    public Report(String name, String path) {
        super(name, path);
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getSpecialType() {
		return specialType;
	}

	public void setSpecialType(int specialType) {
		this.specialType = specialType;
	}

	public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public DataSource getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
    }

	public Serializable getContent() {
		return content;
	}

	public void setContent(Serializable content) {
		this.content = content;
	}

	public boolean isCheckedOut() {
		return checkedOut;
	}

	public void setCheckedOut(boolean checkedOut) {
		this.checkedOut = checkedOut;
	}

	@Override
    public boolean allowPermissions() {
        return true;
    }

    public boolean isTableType() {
        return  getSpecialType() == ResultExporter.TABLE_TYPE;
    }

    public boolean isAlarmType() {
		return getSpecialType() == ResultExporter.ALARM_TYPE;
	}

	public boolean isIndicatorType() {
		return getSpecialType() == ResultExporter.INDICATOR_TYPE;
	}

	public boolean isDisplayType() {
		return getSpecialType() == ResultExporter.DISPLAY_TYPE;
	}

    public int getExpirationTime() {
		return expirationTime;
	}

	public void setExpirationTime(int expirationTime) {
		this.expirationTime = expirationTime;
	}

	public List<DrillDownEntity> getDrillDownEntities() {
        if (drillDownEntities == null) {
        	drillDownEntities = new ArrayList<DrillDownEntity>();
		}
		Collections.sort(drillDownEntities);
        return drillDownEntities;
    }

    public void setDrillDownEntities(List<DrillDownEntity> drillDownEntities) {
        this.drillDownEntities = drillDownEntities;
    }

    public boolean isDrillDownable() {
        return (drillDownEntities != null) && (drillDownEntities.size() > 0);
    }

	@Override
	public String toString() {
		StringBuffer buffer = new StringBuffer();
		buffer.append("Report[");
		buffer.append("name = ").append(name);
		buffer.append(" path = ").append(path);
		buffer.append(" type = ").append(type);
		buffer.append(" specialType = ").append(specialType);
		buffer.append(" description = ").append(description);
		buffer.append(" content = ").append(content);
		buffer.append(" checkedOut = ").append(checkedOut);
		buffer.append(" baseVersionCreated = ").append(baseVersionCreated);
		buffer.append(" baseVersionName = ").append(baseVersionName);
		buffer.append(" dataSource = ").append(dataSource);
        buffer.append(" specialType = ").append(specialType);
        buffer.append(" expirationTime = ").append(expirationTime);
        buffer.append(" versionCreated = ").append(versionCreated);
		buffer.append(" versionName = ").append(versionName);
		buffer.append(" drillDownEntities = ").append(drillDownEntities);
		buffer.append("]");

		return buffer.toString();
	}

}


text:
<?php

namespace Installer;

use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\Plugin\PluginInterface;
use Composer\Plugin\Capable;

class Plugin8 implements PluginInterface, Capable
{
    public $version = 'installer-v8';

    public function activate(Composer $composer, IOInterface $io)
    {
    }

    public function getCapabilities()
    {
        return array(
            'Composer\Plugin\Capability\CommandProvider' => 'Installer\CommandProvider',
        );
    }
}


text:
#include <assert.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>

#include <boost/filesystem.hpp>
#include <iostream>
#include <fstream>
#include <sstream>

#include <sdf/sdf.hh>

#include "gazebo/common/ModelDatabase.hh"
#include "gazebo/common/SystemPaths.hh"
#include "gazebo/common/Exception.hh"
#include "gazebo/common/Console.hh"

using namespace gazebo;
using namespace common;

//////////////////////////////////////////////////
SystemPaths::SystemPaths()
{
  this->gazeboPaths.clear();
  this->ogrePaths.clear();
  this->pluginPaths.clear();
  this->modelPaths.clear();

  char *homePath = getenv("HOME");
  std::string home;
  if (!homePath)
    home = "/tmp/gazebo";
  else
    home = homePath;

  sdf::addURIPath("model://", home + "/.gazebo/models");

  this->modelPaths.push_back(home + "/.gazebo/models");

  char *path = getenv("GAZEBO_LOG_PATH");
  std::string fullPath;
  if (!path)
  {
    if (home != "/tmp/gazebo")
      fullPath = home + "/.gazebo";
    else
      fullPath = home;
  }
  else
    fullPath = path;

  DIR *dir = opendir(fullPath.c_str());
  if (!dir)
  {
    mkdir(fullPath.c_str(), S_IRWXU | S_IRGRP | S_IROTH);
  }
  else
    closedir(dir);

  this->logPath = fullPath;

  this->UpdateModelPaths();
  this->UpdateGazeboPaths();
  this->UpdatePluginPaths();
  this->UpdateOgrePaths();

  // Add some search paths
  // this->suffixPaths.push_back(std::string("/sdf/") + SDF_VERSION + "/");
  this->suffixPaths.push_back("/models/");
  this->suffixPaths.push_back("/media/models/");
  this->suffixPaths.push_back("/Media/models/");

  this->pluginPathsFromEnv = true;
  this->gazeboPathsFromEnv = true;
  this->modelPathsFromEnv = true;
  this->ogrePathsFromEnv = true;
}

/////////////////////////////////////////////////
std::string SystemPaths::GetLogPath() const
{
  return this->logPath;
}

/////////////////////////////////////////////////
const std::list<std::string> &SystemPaths::GetGazeboPaths()
{
  if (this->gazeboPathsFromEnv)
    this->UpdateGazeboPaths();
  return this->gazeboPaths;
}

/////////////////////////////////////////////////
const std::list<std::string> &SystemPaths::GetPluginPaths()
{
  if (this->pluginPathsFromEnv)
    this->UpdatePluginPaths();
  return this->pluginPaths;
}

/////////////////////////////////////////////////
const std::list<std::string> &SystemPaths::GetModelPaths()
{
  if (this->modelPathsFromEnv)
    this->UpdateModelPaths();
  return this->modelPaths;
}

/////////////////////////////////////////////////
const std::list<std::string> &SystemPaths::GetOgrePaths()
{
  if (this->ogrePathsFromEnv)
    this->UpdateOgrePaths();
  return this->ogrePaths;
}

/////////////////////////////////////////////////
void SystemPaths::UpdateModelPaths()
{
  std::string delim(":");
  std::string path;

  char *pathCStr = getenv("GAZEBO_MODEL_PATH");
  if (!pathCStr || *pathCStr == '\0')
  {
    // gzdbg << "gazeboPaths is empty and GAZEBO_RESOURCE_PATH doesn't exist. "
    //  << "Set GAZEBO_RESOURCE_PATH to gazebo's installation path. "
    //  << "...or are you using SystemPlugins?\n";
    return;
  }
  path = pathCStr;

  /// \TODO: Use boost to split string.
  size_t pos1 = 0;
  size_t pos2 = path.find(delim);
  while (pos2 != std::string::npos)
  {
    sdf::addURIPath("model://", path.substr(pos1, pos2-pos1));
    this->InsertUnique(path.substr(pos1, pos2-pos1), this->modelPaths);
    pos1 = pos2+1;
    pos2 = path.find(delim, pos2+1);
  }
  this->InsertUnique(path.substr(pos1, path.size()-pos1), this->modelPaths);
}

/////////////////////////////////////////////////
void SystemPaths::UpdateGazeboPaths()
{
  std::string delim(":");
  std::string path;

  char *pathCStr = getenv("GAZEBO_RESOURCE_PATH");
  if (!pathCStr || *pathCStr == '\0')
  {
    // No env var; take the compile-time default.
    path = GAZEBO_RESOURCE_PATH;
  }
  else
    path = pathCStr;

  size_t pos1 = 0;
  size_t pos2 = path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(path.substr(pos1, pos2-pos1), this->gazeboPaths);
    pos1 = pos2+1;
    pos2 = path.find(delim, pos2+1);
  }
  this->InsertUnique(path.substr(pos1, path.size()-pos1), this->gazeboPaths);
}

//////////////////////////////////////////////////
void SystemPaths::UpdatePluginPaths()
{
  std::string delim(":");
  std::string path;

  char *pathCStr = getenv("GAZEBO_PLUGIN_PATH");
  if (!pathCStr || *pathCStr == '\0')
  {
    // No env var; take the compile-time default.
    path = GAZEBO_PLUGIN_PATH;
  }
  else
    path = pathCStr;

  size_t pos1 = 0;
  size_t pos2 = path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(path.substr(pos1, pos2-pos1), this->pluginPaths);
    pos1 = pos2+1;
    pos2 = path.find(delim, pos2+1);
  }
  this->InsertUnique(path.substr(pos1, path.size()-pos1), this->pluginPaths);
}

//////////////////////////////////////////////////
void SystemPaths::UpdateOgrePaths()
{
  std::string delim(":");
  std::string path;

  char *pathCStr = getenv("OGRE_RESOURCE_PATH");
  if (!pathCStr || *pathCStr == '\0')
  {
    // No env var; take the compile-time default.
    path = OGRE_RESOURCE_PATH;
  }
  else
    path = pathCStr;

  size_t pos1 = 0;
  size_t pos2 = path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(path.substr(pos1, pos2-pos1), this->ogrePaths);
    pos1 = pos2+1;
    pos2 = path.find(delim, pos2+1);
  }
  this->InsertUnique(path.substr(pos1, path.size()-pos1), this->ogrePaths);
}

//////////////////////////////////////////////////
std::string SystemPaths::GetWorldPathExtension()
{
  return "/worlds";
}

//////////////////////////////////////////////////
std::string SystemPaths::FindFileURI(const std::string &_uri)
{
  int index = _uri.find("://");
  std::string prefix = _uri.substr(0, index);
  std::string suffix = _uri.substr(index + 3, _uri.size() - index - 3);
  std::string filename;

  // If trying to find a model, return the path to the users home
  // .gazebo/models
  if (prefix == "model")
  {
    boost::filesystem::path path;
    for (std::list<std::string>::iterator iter = this->modelPaths.begin();
         iter != this->modelPaths.end(); ++iter)
    {
      path = boost::filesystem::path(*iter) / suffix;
      if (boost::filesystem::exists(path))
      {
        filename = path.string();
        break;
      }
    }

    // Try to download the model if it wasn't found.
    if (filename.empty())
      filename = ModelDatabase::Instance()->GetModelPath(_uri, true);
  }
  else if (prefix.empty() || prefix == "file")
  {
    // First try to find the file on the current system
    filename = this->FindFile(suffix);
  }
  else if (prefix != "http" && prefix != "https")
    gzerr << "Unknown URI prefix[" << prefix << "]\n";

  return filename;
}

//////////////////////////////////////////////////
std::string SystemPaths::FindFile(const std::string &_filename,
                                  bool _searchLocalPath)
{
  boost::filesystem::path path;

  if (_filename.empty())
    return path.string();

  if (_filename.find("://") != std::string::npos)
  {
    path = boost::filesystem::path(this->FindFileURI(_filename));
  }
  else if (_filename[0] == '/')
  {
    path = boost::filesystem::path(_filename);
  }
  else
  {
    bool found = false;

    try
    {
      path = boost::filesystem::operator/(boost::filesystem::current_path(),
          _filename);
    }
    catch(boost::filesystem::filesystem_error &_e)
    {
      gzerr << "Filesystem error[" << _e.what() << "]\n";
      return std::string();
    }

    if (_searchLocalPath && boost::filesystem::exists(path))
    {
      found = true;
    }
    else if ((_filename[0] == '/' || _filename[0] == '.' || _searchLocalPath)
             && boost::filesystem::exists(boost::filesystem::path(_filename)))
    {
      path = boost::filesystem::path(_filename);
      found = true;
    }
    else
    {
      std::list<std::string> paths = this->GetGazeboPaths();

      for (std::list<std::string>::const_iterator iter = paths.begin();
          iter != paths.end() && !found; ++iter)
      {
        path = boost::filesystem::path((*iter));
        path = boost::filesystem::operator/(path, _filename);
        if (boost::filesystem::exists(path))
        {
          found = true;
          break;
        }

        std::list<std::string>::iterator suffixIter;
        for (suffixIter = this->suffixPaths.begin();
            suffixIter != this->suffixPaths.end(); ++suffixIter)
        {
          path = boost::filesystem::path(*iter);
          path = boost::filesystem::operator/(path, *suffixIter);
          path = boost::filesystem::operator/(path, _filename);
          if (boost::filesystem::exists(path))
          {
            found = true;
            break;
          }
        }
      }
    }

    if (!found)
      return std::string();
  }

  if (!boost::filesystem::exists(path))
  {
    gzerr << "File or path does not exist[" << path << "]\n";
    return std::string();
  }

  return path.string();
}

/////////////////////////////////////////////////
void SystemPaths::ClearGazeboPaths()
{
  this->gazeboPaths.clear();
}

/////////////////////////////////////////////////
void SystemPaths::ClearOgrePaths()
{
  this->ogrePaths.clear();
}

/////////////////////////////////////////////////
void SystemPaths::ClearPluginPaths()
{
  this->pluginPaths.clear();
}

/////////////////////////////////////////////////
void SystemPaths::ClearModelPaths()
{
  this->modelPaths.clear();
}

/////////////////////////////////////////////////
void SystemPaths::AddGazeboPaths(const std::string &_path)
{
  std::string delim(":");

  size_t pos1 = 0;
  size_t pos2 = _path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(_path.substr(pos1, pos2-pos1), this->gazeboPaths);
    pos1 = pos2+1;
    pos2 = _path.find(delim, pos2+1);
  }
  this->InsertUnique(_path.substr(pos1, _path.size()-pos1), this->gazeboPaths);
}

/////////////////////////////////////////////////
void SystemPaths::AddOgrePaths(const std::string &_path)
{
  std::string delim(":");
  size_t pos1 = 0;
  size_t pos2 = _path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(_path.substr(pos1, pos2-pos1), this->ogrePaths);
    pos1 = pos2+1;
    pos2 = _path.find(delim, pos2+1);
  }
  this->InsertUnique(_path.substr(pos1, _path.size()-pos1), this->ogrePaths);
}

/////////////////////////////////////////////////
void SystemPaths::AddPluginPaths(const std::string &_path)
{
  std::string delim(":");
  size_t pos1 = 0;
  size_t pos2 = _path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(_path.substr(pos1, pos2-pos1), this->pluginPaths);
    pos1 = pos2+1;
    pos2 = _path.find(delim, pos2+1);
  }
  this->InsertUnique(_path.substr(pos1, _path.size()-pos1), this->pluginPaths);
}

/////////////////////////////////////////////////
void SystemPaths::AddModelPaths(const std::string &_path)
{
  std::string delim(":");
  size_t pos1 = 0;
  size_t pos2 = _path.find(delim);
  while (pos2 != std::string::npos)
  {
    this->InsertUnique(_path.substr(pos1, pos2-pos1), this->modelPaths);
    pos1 = pos2+1;
    pos2 = _path.find(delim, pos2+1);
  }
  this->InsertUnique(_path.substr(pos1, _path.size()-pos1), this->modelPaths);
}

/////////////////////////////////////////////////
void SystemPaths::InsertUnique(const std::string &_path,
                               std::list<std::string> &_list)
{
  if (std::find(_list.begin(), _list.end(), _path) == _list.end())
    _list.push_back(_path);
}

/////////////////////////////////////////////////
void SystemPaths::AddSearchPathSuffix(const std::string &_suffix)
{
  std::string s;

  if (_suffix[0] != '/')
    s = std::string("/") + _suffix;
  else
    s = _suffix;

  if (_suffix[_suffix.size()-1] != '/')
    s += "/";

  this->suffixPaths.push_back(s);
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/set_permission"
        android:orderInCategory="100"
        android:title="@string/set_permission"/>

</menu>


text:
infinispan.infoText = {};
infinispan.infoText.width = 400;
infinispan.infoText.height = 50;
infinispan.infoText.x = 100;
infinispan.infoText.y = 100;
infinispan.infoText.offsetx = 10;
infinispan.infoText.offsety = 10;
infinispan.infoText.textObjectOffsety = 30;

infinispan.infoText.defaultPath = [ [ "M", infinispan.infoText.x, infinispan.infoText.y ],
		[ "l", infinispan.infoText.width, 0 ], [ "l", 0, infinispan.infoText.height ],
		[ "l", -infinispan.infoText.width, 0 ], [ "z" ] ];

infinispan.infoText.inTransfer = [ [ "M", infinispan.infoText.x, infinispan.infoText.y ],
		[ "l", 0, 0 ], [ "l", 0, 0 ], [ "l", 0, 0 ], [ "z" ] ];

infinispan.InfoTextAreaStateElementView = Backbone.View
		.extend({
			initialize : function(argument) {
				_.bindAll();
				this._paper = argument.paper;
				if (this._paper == null) {
					alert("paper is not exist");
					return;
				}
				this.hide = true;
				this.id = this.model.get("objectId");

				// if initailized yet, initalize textarea
				if ($("#taskInfoDiv").length === 0) {
					// task info area.
					$("#arrowChart").before("

");
					$("#taskInfoDiv").append("<textarea id='textArea'>
");
					$("#taskInfoDiv").css({
						'background-color' : 'white',
						'display' : 'none',
						position : 'absolute',
						'z-index' : 1
					});
					$("#textArea").css({
						width : '400px',
						height : '50px',
						'text-align' : 'center',
						resize: 'none'
					});
				}

				this.render();
				infinispan.arrowChart.detailInfoElement = this;
			},
			render : function() {
				var color = this.getStateColor();
				this.model.set({
					"attributes" : {
						"stroke-width" : 0,
						"stroke-opacity" : 0,
						"fill" : 'red',
						r : 7
					}
				}, {
					silent : true
				});
				this.element = [];
				this.element[0] = this._paper.path(infinispan.infoText.inTransfer)
						.attr({
							"fill" : "red",
							"stroke" : "blue"
						});
				this.element[1] = new textArea(this.model.attributes,
						this._paper);

			},
			update : function(model) {
				var instance = this;
				var color = this.getStateColor();
				this.model.set({
					"fill" : color
				}, {
					silent : true
				});
				this.element[0].setAttributes(model);
				this.element[1].setAttributes(model);
			},
			remove : function(property) {
				this.element[0].hide();
				this.element[1].hide();
			},
			getStateColor : function() {
				var state = this.model.get("state");
				var color = infinispan.constants.STATE_COLOR[state];
				if (color == null) {
					color = infinispan.constants.STATE_COLOR[infinispan.constants.STATE.NORMAL];
				}
				return color;
			},
			animationAppear : function(info) {
				this._makePath(info.event);
				var tmpText = info.text;
				var scrollHeight = $("#arrowChart").scrollTop();
				$("#textArea").val(tmpText);
				$("#taskInfoDiv").css({
					display : "inline",
					left : infinispan.infoText.x + infinispan.infoText.width / 2 - 160,
					top : infinispan.infoText.y + infinispan.infoText.textObjectOffsety - scrollHeight + 225
				});

				this.hide = false;
			},
			animationDisappear : function(info) {
				$("#taskInfoDiv").css({
					display : "none"
				});
				this.hide = true;
			},
			_makePath : function(event) {
				infinispan.infoText.x = event.layerX;
				infinispan.infoText.y = event.layerY;
				if (infinispan.arrowChart.paperWidth / 2
						+ infinispan.arrowChart.startLineX < infinispan.infoText.x) {
					infinispan.infoText.x = infinispan.infoText.x
							- infinispan.infoText.width;
				}

				infinispan.infoText.defaultPath = [
						[ "M", infinispan.infoText.x + infinispan.infoText.offsetx,
								infinispan.infoText.y + infinispan.infoText.offsety ],
						[ "l", infinispan.infoText.width, 0 ],
						[ "l", 0, infinispan.infoText.height ],
						[ "l", -infinispan.infoText.width, 0 ], [ "z" ] ];

				infinispan.infoText.inTransfer = [
						[ "M", infinispan.infoText.x + infinispan.infoText.offsetx,
								infinispan.infoText.y + infinispan.infoText.offsety ],
						[ "l", 0, 0 ], [ "l", 0, 0 ], [ "l", 0, 0 ], [ "z" ] ];

			}

		});