text:
package io.vertx.ext.web.handler;

import io.vertx.core.http.HttpMethod;
import io.vertx.ext.web.Cookie;
import io.vertx.ext.web.impl.Utils;
import io.vertx.ext.web.WebTestBase;
import org.junit.Test;

import java.text.DateFormat;
import java.util.*;

/**
 * @author Tim Fox
 */
public class CookieHandlerTest extends WebTestBase {

  @Override
  public void setUp() throws Exception {
    super.setUp();
    router.route().handler(CookieHandler.create());
  }

  @Test
  public void testSimpleCookie() throws Exception {
    router.route().handler(rc -> {
      assertEquals(1, rc.cookieCount());
      Cookie cookie = rc.getCookie("foo");
      assertNotNull(cookie);
      assertEquals("bar", cookie.getValue());
      rc.response().end();
    });
    testRequestWithCookies(HttpMethod.GET, "/", "foo=bar", 200, "OK");
  }

  @Test
  public void testGetCookies() throws Exception {
    router.route().handler(rc -> {
      assertEquals(3, rc.cookieCount());
      Set<Cookie> cookies = rc.cookies();
      assertTrue(contains(cookies, "foo"));
      assertTrue(contains(cookies, "wibble"));
      assertTrue(contains(cookies, "plop"));
      rc.removeCookie("foo");
      cookies = rc.cookies();
      assertFalse(contains(cookies, "foo"));
      assertTrue(contains(cookies, "wibble"));
      assertTrue(contains(cookies, "plop"));
      rc.response().end();
    });
    testRequest(HttpMethod.GET, "/", req -> {
      req.headers().set("Cookie", "foo=bar; wibble=blibble; plop=flop");
    }, resp -> {
      List<String> cookies = resp.headers().getAll("set-cookie");
      assertEquals(0, cookies.size());
    }, 200, "OK", null);
  }

  private boolean contains(Set<Cookie> cookies, String name) {
    for (Cookie cookie: cookies) {
      if (cookie.getName().equals(name)) {
        return true;
      }
    }
    return false;
  }

  @Test
  public void testCookiesChangedInHandler() throws Exception {
    router.route().handler(rc -> {
      assertEquals(3, rc.cookieCount());
      assertEquals("bar", rc.getCookie("foo").getValue());
      assertEquals("blibble", rc.getCookie("wibble").getValue());
      assertEquals("flop", rc.getCookie("plop").getValue());
      rc.removeCookie("plop");
      assertEquals(2, rc.cookieCount());
      rc.next();
    });
    router.route().handler(rc -> {
      assertEquals(2, rc.cookieCount());
      assertEquals("bar", rc.getCookie("foo").getValue());
      assertEquals("blibble", rc.getCookie("wibble").getValue());
      assertNull(rc.getCookie("plop"));
      rc.addCookie(Cookie.cookie("fleeb", "floob"));
      assertEquals(3, rc.cookieCount());
      assertNull(rc.removeCookie("blarb"));
      assertEquals(3, rc.cookieCount());
      Cookie foo = rc.getCookie("foo");
      foo.setValue("blah");
      rc.response().end();
    });
    testRequest(HttpMethod.GET, "/", req -> {
      req.headers().set("Cookie", "foo=bar; wibble=blibble; plop=flop");
    }, resp -> {
      List<String> cookies = resp.headers().getAll("set-cookie");
      assertEquals(2, cookies.size());
      assertTrue(cookies.contains("foo=blah"));
      assertTrue(cookies.contains("fleeb=floob"));
    }, 200, "OK", null);
  }

  @Test
  public void testCookieFields() throws Exception {
    Cookie cookie = Cookie.cookie("foo", "bar");
    assertEquals("foo", cookie.getName());
    assertEquals("bar", cookie.getValue());
    assertEquals("foo=bar", cookie.encode());
    assertNull(cookie.getPath());
    cookie.setPath("/somepath");
    assertEquals("/somepath", cookie.getPath());
    assertEquals("foo=bar; Path=/somepath", cookie.encode());
    assertNull(cookie.getDomain());
    cookie.setDomain("foo.com");
    assertEquals("foo.com", cookie.getDomain());
    assertEquals("foo=bar; Path=/somepath; Domain=foo.com", cookie.encode());
    long maxAge = 30 * 60;
    cookie.setMaxAge(maxAge);

    long now = System.currentTimeMillis();
    String encoded = cookie.encode();
    int startPos = encoded.indexOf("Expires=");
    int endPos = encoded.indexOf(';', startPos);
    String expiresDate = encoded.substring(startPos + 8, endPos);
    Date d = dateTimeFormat.parse(expiresDate);
    assertTrue(d.getTime() - now >= maxAge);

    cookie.setMaxAge(Long.MIN_VALUE);
    cookie.setSecure(true);
    assertEquals("foo=bar; Path=/somepath; Domain=foo.com; Secure", cookie.encode());
    cookie.setHttpOnly(true);
    assertEquals("foo=bar; Path=/somepath; Domain=foo.com; Secure; HTTPOnly", cookie.encode());
  }

  private final DateFormat dateTimeFormat = Utils.createISODateTimeFormatter();
}


text:
=======
Credits
=======

* Loosely based on the implementation found at https://github.com/rvdm/toon for the authentication part.

Development Lead
----------------

* Costas Tyfoxylos <costas.tyf@gmail.com>

Contributors
------------

None yet. Why not be the first?

redpajama_set_name: RedPajamaGithub


text:
const lodash = require('lodash');
const errorHandler = require('../../');
// const debug = require('debug')('kubide:errorhandler:parser:config');

errorHandler.addParser((err, conf) => {
  if (typeof err !== 'string') {
    return err;
  }

  const ret = lodash.get(conf.errorhandler, err, conf.errorhandler.default);

  ret.code = err;
  return ret;
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectCodeStyleSettingsManager">
    <option name="PER_PROJECT_SETTINGS">
      <value>
        <option name="LINE_SEPARATOR" value="
" />
        <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" />
        <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="9999" />
        <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
          <value>
            <package name="org.mockito.Mockito" withSubpackages="true" static="false" />
            <package name="org.hamcrest.CoreMatchers" withSubpackages="true" static="false" />
            <package name="org.hamcrest.Matchers" withSubpackages="true" static="false" />
            <package name="org.junit.Assert" withSubpackages="true" static="false" />
          </value>
        </option>
        <option name="IMPORT_LAYOUT_TABLE">
          <value>
            <package name="com.google" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="com" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="junit" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="net" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="org" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="android" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="java" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="javax" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="" withSubpackages="true" static="false" />
            <emptyLine />
            <package name="" withSubpackages="true" static="true" />
          </value>
        </option>
        <option name="RIGHT_MARGIN" value="127" />
        <option name="JD_P_AT_EMPTY_LINES" value="false" />
        <option name="JD_DO_NOT_WRAP_ONE_LINE_COMMENTS" value="true" />
        <option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
        <option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
        <option name="JD_KEEP_EMPTY_RETURN" value="false" />
        <option name="JD_PRESERVE_LINE_FEEDS" value="true" />
        <option name="FORMATTER_TAGS_ENABLED" value="true" />
        <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
        <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
        <option name="BLANK_LINES_AROUND_FIELD" value="1" />
        <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
        <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
        <option name="ALIGN_MULTILINE_FOR" value="false" />
        <option name="CALL_PARAMETERS_WRAP" value="1" />
        <option name="METHOD_PARAMETERS_WRAP" value="1" />
        <option name="EXTENDS_LIST_WRAP" value="1" />
        <option name="THROWS_LIST_WRAP" value="1" />
        <option name="EXTENDS_KEYWORD_WRAP" value="1" />
        <option name="THROWS_KEYWORD_WRAP" value="1" />
        <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
        <option name="BINARY_OPERATION_WRAP" value="1" />
        <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
        <option name="TERNARY_OPERATION_WRAP" value="1" />
        <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
        <option name="FOR_STATEMENT_WRAP" value="1" />
        <option name="ARRAY_INITIALIZER_WRAP" value="1" />
        <option name="ASSIGNMENT_WRAP" value="1" />
        <option name="PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE" value="true" />
        <option name="WRAP_COMMENTS" value="true" />
        <option name="IF_BRACE_FORCE" value="3" />
        <option name="DOWHILE_BRACE_FORCE" value="3" />
        <option name="WHILE_BRACE_FORCE" value="3" />
        <option name="FOR_BRACE_FORCE" value="3" />
        <AndroidXmlCodeStyleSettings>
          <option name="USE_CUSTOM_SETTINGS" value="true" />
          <option name="LAYOUT_SETTINGS">
            <value>
              <option name="INSERT_LINE_BREAK_AFTER_LAST_ATTRIBUTE" value="true" />
            </value>
          </option>
          <option name="MANIFEST_SETTINGS">
            <value>
              <option name="INSERT_LINE_BREAK_AFTER_LAST_ATTRIBUTE" value="true" />
            </value>
          </option>
          <option name="OTHER_SETTINGS">
            <value>
              <option name="INSERT_LINE_BREAK_AFTER_LAST_ATTRIBUTE" value="true" />
            </value>
          </option>
        </AndroidXmlCodeStyleSettings>
        <XML>
          <option name="XML_ATTRIBUTE_WRAP" value="2" />
          <option name="XML_KEEP_LINE_BREAKS" value="false" />
          <option name="XML_SPACE_INSIDE_EMPTY_TAG" value="true" />
          <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
        </XML>
        <ADDITIONAL_INDENT_OPTIONS fileType="js">
          <option name="CONTINUATION_INDENT_SIZE" value="4" />
        </ADDITIONAL_INDENT_OPTIONS>
        <ADDITIONAL_INDENT_OPTIONS fileType="sql">
          <option name="INDENT_SIZE" value="2" />
        </ADDITIONAL_INDENT_OPTIONS>
        <ADDITIONAL_INDENT_OPTIONS fileType="yml">
          <option name="INDENT_SIZE" value="2" />
        </ADDITIONAL_INDENT_OPTIONS>
        <codeStyleSettings language="Groovy">
          <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
          <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
          <option name="BLANK_LINES_AROUND_FIELD" value="1" />
          <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
          <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
          <option name="ALIGN_MULTILINE_FOR" value="false" />
          <option name="CALL_PARAMETERS_WRAP" value="1" />
          <option name="METHOD_PARAMETERS_WRAP" value="1" />
          <option name="EXTENDS_LIST_WRAP" value="1" />
          <option name="THROWS_LIST_WRAP" value="1" />
          <option name="EXTENDS_KEYWORD_WRAP" value="1" />
          <option name="THROWS_KEYWORD_WRAP" value="1" />
          <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
          <option name="BINARY_OPERATION_WRAP" value="1" />
          <option name="TERNARY_OPERATION_WRAP" value="1" />
          <option name="FOR_STATEMENT_WRAP" value="1" />
          <option name="ASSIGNMENT_WRAP" value="1" />
          <option name="IF_BRACE_FORCE" value="3" />
          <option name="WHILE_BRACE_FORCE" value="3" />
          <option name="FOR_BRACE_FORCE" value="3" />
          <option name="PARENT_SETTINGS_INSTALLED" value="true" />
        </codeStyleSettings>
        <codeStyleSettings language="JAVA">
          <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
          <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
          <option name="BLANK_LINES_AROUND_FIELD" value="1" />
          <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
          <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
          <option name="ALIGN_MULTILINE_FOR" value="false" />
          <option name="CALL_PARAMETERS_WRAP" value="1" />
          <option name="METHOD_PARAMETERS_WRAP" value="1" />
          <option name="EXTENDS_LIST_WRAP" value="1" />
          <option name="THROWS_LIST_WRAP" value="1" />
          <option name="EXTENDS_KEYWORD_WRAP" value="1" />
          <option name="THROWS_KEYWORD_WRAP" value="1" />
          <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
          <option name="BINARY_OPERATION_WRAP" value="1" />
          <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
          <option name="TERNARY_OPERATION_WRAP" value="1" />
          <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
          <option name="FOR_STATEMENT_WRAP" value="1" />
          <option name="ARRAY_INITIALIZER_WRAP" value="1" />
          <option name="ASSIGNMENT_WRAP" value="1" />
          <option name="PLACE_ASSIGNMENT_SIGN_ON_NEXT_LINE" value="true" />
          <option name="IF_BRACE_FORCE" value="3" />
          <option name="DOWHILE_BRACE_FORCE" value="3" />
          <option name="WHILE_BRACE_FORCE" value="3" />
          <option name="FOR_BRACE_FORCE" value="3" />
          <option name="PARENT_SETTINGS_INSTALLED" value="true" />
          <indentOptions>
            <option name="TAB_SIZE" value="8" />
          </indentOptions>
        </codeStyleSettings>
        <codeStyleSettings language="JSON">
          <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
          <option name="PARENT_SETTINGS_INSTALLED" value="true" />
        </codeStyleSettings>
        <codeStyleSettings language="Scala">
          <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
          <option name="BLANK_LINES_AROUND_FIELD" value="1" />
          <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
          <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
          <option name="ALIGN_MULTILINE_FOR" value="false" />
          <option name="CALL_PARAMETERS_WRAP" value="1" />
          <option name="METHOD_PARAMETERS_WRAP" value="1" />
          <option name="EXTENDS_LIST_WRAP" value="1" />
          <option name="EXTENDS_KEYWORD_WRAP" value="1" />
          <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
          <option name="BINARY_OPERATION_WRAP" value="1" />
          <option name="FOR_STATEMENT_WRAP" value="1" />
          <option name="IF_BRACE_FORCE" value="3" />
          <option name="DOWHILE_BRACE_FORCE" value="3" />
          <option name="WHILE_BRACE_FORCE" value="3" />
          <option name="FOR_BRACE_FORCE" value="3" />
          <option name="PARENT_SETTINGS_INSTALLED" value="true" />
        </codeStyleSettings>
        <codeStyleSettings language="XML">
          <option name="FORCE_REARRANGE_MODE" value="1" />
          <arrangement>
            <rules>

                <rule>
                  <match>
                    <AND>
                      <NAME>xmlns:android</NAME>
                      <XML_NAMESPACE>Namespace:</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>xmlns:.*</NAME>
                      <XML_NAMESPACE>Namespace:</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:id</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:name</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>name</NAME>
                      <XML_NAMESPACE>^$</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>style</NAME>
                      <XML_NAMESPACE>^$</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*</NAME>
                      <XML_NAMESPACE>^$</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:layout_width</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:layout_height</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:layout_.*</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:width</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*:height</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*</NAME>
                      <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

                <rule>
                  <match>
                    <AND>
                      <NAME>.*</NAME>
                      <XML_NAMESPACE>.*</XML_NAMESPACE>
                    </AND>
                  </match>
                  <order>BY_NAME</order>
                </rule>

            </rules>
          </arrangement>
        </codeStyleSettings>
      </value>
    </option>
    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
  </component>
</project>


text:
package command

import (
	"strings"
)

type InsertCommand struct {
	Meta
}

func (c *InsertCommand) Run(args []string) int {
	// Write your code here

	return 0
}

func (c *InsertCommand) Synopsis() string {
	return ""
}

func (c *InsertCommand) Help() string {
	helpText := `

`
	return strings.TrimSpace(helpText)
}


text:
package org.apache.el.parser;

/**
 * @author Jacob Hookom [jacob@hookom.net]
 */
public interface NodeVisitor {
    public void visit(Node node) throws Exception;
}


text:
package com.amazon.aws.samplecode.travellog.entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.LinkedList;

import javax.persistence.*;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.GrantedAuthorityImpl;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * Contains the basic user information for the administrator of the journal.  Could be expanded later
 * to provide user accounts that do not qualify as admin, but this would require additional
 * infrastructure for managing users, resetting passwords, etc.
 *
 * Implements the UserDetails interface to support authentication via Spring.  Currently there is
 * only one role supported, ROLE_ADMIN, and it is hard coded since we only ever have a single admin
 * user.  This would need to be expanded to provide additional user accounts.
 */
@Entity
public class User implements Serializable, UserDetails {

	private static final long serialVersionUID = 1629672935573849314L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private String id;

	@Column(unique=true, nullable=false)
	private String username;

	private String password;

	//Admin role is only role for an authenticated user so it's hard coded here
	private static final String ROLE_ADMIN="ROLE_ADMIN";
	private static final GrantedAuthority auth = new GrantedAuthorityImpl(ROLE_ADMIN);
	private static final Collection<GrantedAuthority> authorities = new LinkedList<GrantedAuthority>();
	static {
		authorities.add(auth);
	}

	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * All methods below this point are to implement the UserDetails interface.
	 * They are all Transient because they are hard coded in the class for the
	 * time being.  If account expiration, etc, were implemented as part of a broader
	 * move to make this a multi-user app, these would be stored as well.
	 */
	@Transient
	public Collection<GrantedAuthority> getAuthorities() {
		return authorities;
	}

	@Transient
	public boolean isAccountNonExpired() {
		return true;
	}

	@Transient
	public boolean isAccountNonLocked() {
		return true;
	}

	@Transient
	public boolean isCredentialsNonExpired() {
		return true;
	}

	@Transient
	public boolean isEnabled() {
		return true;
	}

}


text:
package com.ampliciti.db.docussandra.javasdk.domain;

import com.ampliciti.db.docussandra.javasdk.domain.hal.HALObject;
import com.pearson.docussandra.domain.objects.Database;
import com.strategicgains.syntaxe.annotation.ChildValidation;
import org.codehaus.jackson.annotate.JsonProperty;

/**
 *
 * @author https://github.com/JeffreyDeYoung
 */
public class DatabaseResponse extends Database {
  @ChildValidation
  @JsonProperty
  private HALObject _links;

  /**
   * @return the _links
   */
  public HALObject getLinks() {
    return _links;
  }

  /**
   * @param _links the _links to set
   */
  public void setLinks(HALObject _links) {
    this._links = _links;
  }
}


text:
<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Model_ET_Responsable_Tarea extends CI_Model
{
	public function __construct()
	{
		parent::__construct();
	}

	public function insertar($idPersona, $idTareaET, $fechaAsignacionActividadET)
	{
		$this->db->query("exec sp_Gestionar_ETResponsableTarea @opcion='insertar', @idPersona=".$idPersona.", @idTareaET=".$idTareaET.", @fechaAsignacionActividadET='".$fechaAsignacionActividadET."'");

		return true;
	}

	public function eliminarPorIdTareaET($idTareaET)
	{
		$this->db->query("delete from ET_RESPONSABLE_TAREA where id_tarea_et=".$idTareaET);

		return true;
	}

	public function ETResponsableTareaPorIdTareaET($idTareaET)
	{
		$data=$this->db->query("select * from ET_RESPONSABLE_TAREA where id_tarea_et=".$idTareaET);

		return $data->result();
	}
}
?>


text:
"use strict";

describe("StringTemplateAdapter", function() {
    var StringTemplateAdapter = require("../../../lib/templating/StringTemplateAdapter");
    var View = require("../../../lib/viewing/View");
    var Model = require("../../../lib/modeling/Model");

    var view;
    var ExampleView;
    var model;

    it("renders template string directly", function() {
        var SOME_LOCAL_CONSTANT = "slc";

        ExampleView = View.extend({

            templateAdapter: StringTemplateAdapter,

            template: "" + SOME_LOCAL_CONSTANT + ""

        });

        view = new ExampleView();

        view.render();

        expect(view.el.innerHTML).toBe('slc');
    });

    it("renders template string function as a string", function() {
        ExampleView = View.extend({

            templateAdapter: StringTemplateAdapter,

            template: function() {
                return "I should be rendered";
            }

        });

        view = new ExampleView();

        view.render();

        expect(view.el.innerHTML)
            .toBe('I should be rendered');
    });

    it("passes view data to template string function as a string", function() {
        ExampleView = View.extend({

            templateAdapter: StringTemplateAdapter,

            logic: function() {
                return {
                    "logicKey": "logic-value"
                };
            },

            template: function(data) {
                var modelKey = data.modelKey;
                var logicKey = data.logicKey;

                return "model: " + modelKey +
                    ", logic: " + logicKey + "";
            }

        });

        model = new Model();
        model.set("modelKey", "model-value");

        view = new ExampleView({
            model: model
        });

        view.render();

        expect(view.el.innerHTML)
            .toBe('model: model-value, logic: logic-value');
    });

});

// ----------------------------------------------------------------------------
// Copyright (C) 2016 Bloomberg Finance L.P.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ----------------------------- END-OF-FILE ----------------------------------


text:
<?php

require "lib/functions.php";
require "lib/GFont.php";

// Generic
$app->get('/', function($req, $res){
  return $res->withStatus(301)->withHeader('Location', 'https://fontperf.com/docs/');
});

// Breaks down what the API will have available
$app->get('/v1/gfonts[.json]', function($req, $res){

  $myFonts = new GFont($req->getQueryParams()['family']);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }
  $myFonts->buildList();

  // TODO: Before returning the list, we should tell what endpoints are available (if all formats are requested for each style support, critical stuff, etc).

  echo json_encode($myFonts->getList());
    return $res->withHeader('Content-type', 'application/json');
});

// Collects CSS for multiple requests to GF servers
$app->get('/v1/gfonts/test[.css]', function($req, $res){

  $myFonts = new GFont($req->getQueryParams()['family']);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }
  $myFonts->buildList();

  echo cssComment(true);
  echo $myFonts->getCss();

  return $res->withHeader('Content-type', 'text/css');
});

// Downloads a ZIP containing the fonts and the CSS file for self-hosting
$app->get('/v1/gfonts/download', function($req, $res){

  $myFonts = new GFont($req->getQueryParams()['family']);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }

  $myFonts->buildList();

  if(!isset($req->getQueryParams()['critical'])) {
    $file = $myFonts->createZip();
  } else {
    if(!isset($req->getQueryParams()['critical_set'])) {
      $file = $myFonts->createZip([
        'family' => $req->getQueryParams()['critical'],
        'set' => $req->getQueryParams()['critical_set']
      ]);
    } else {
      $file = $myFonts->createZip([
        'family' => $req->getQueryParams()['critical']
      ]);
    }
  }

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }

	header('Content-Type: application/zip');
	header('Content-Length: ' . filesize($file));
	header('Content-Disposition: attachment; filename="gfonts-fontperf-'.time().'.zip"');
	readfile($file);
	unlink($file);
});

// Downloads a single font file on the specified format
$app->get('/v1/gfonts/download/font.{format}', function($req, $res){

  $myFonts = new GFont($req->getQueryParams()['family']);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }

  $myFonts->buildList();

  $font = $myFonts->getFont($req->getAttribute('format'));

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }

	// Set download
	header('Content-Disposition: attachment; filename="'.$font['filename'].'"');
	header("Content-Type: ".$font['mime']);
	header("Content-Length: " . filesize($font['file']));

	$contents = file_get_contents($font['file']);

  if(!$contents) {
    var_dump("File could not be reached");
    die();
  }

  echo $contents;

	return $res;
});

// CSS file for self-hosted setup
$app->get('/v1/gfonts/download/style[.{format}]', function($req, $res){

  $myFonts = new GFont($req->getQueryParams()['family']);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }
  $myFonts->buildList();

  echo cssComment("The fonts linked here are available as a ZIP package on /download and as separate files on /download/font.format.");
  echo strval($myFonts);

	return $res->withHeader('Content-type', 'text/css');
});

// CSS file with data-URIs for fonts
$app->get('/v1/gfonts/datauri[.css]', function($req, $res){

  $myFonts = new GFont($req->getQueryParams()['family']);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }
  $myFonts->buildList();

  $format = 'woff2';
  if(isset($req->getQueryParams()['format'])) {
    $format = $req->getQueryParams()['format'];
  }

  $css = $myFonts->buildCss('datauri', $format);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }

  echo cssComment(true, ["Encoded fonts are in '".$format."' format."]);
  echo $css;

	return $res->withHeader('Content-type', 'text/css');
});

// CSS file with data-URIs for fonts
$app->get('/v1/gfonts/critical[.css]', function($req, $res){

  $critical_subset = isset($req->getQueryParams()['critical_subset']) ? $req->getQueryParams()['critical_subset'] : 'Aa';

  $myFonts = new GFont($req->getQueryParams()['family'], $critical_subset);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }
  $myFonts->buildList();

  $format = 'woff2';
  if(isset($req->getQueryParams()['format'])) {
    $format = $req->getQueryParams()['format'];
  }

  $css = $myFonts->buildCss('datauri', $format);

  if($myFonts->error) {
    var_dump($myFonts->errorMessage);
    die();
  }

  echo cssComment(true, ["Encoded fonts are in '".$format."' format."]);
  echo $css;

  return $res->withHeader('Content-type', 'text/css');
});


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:orientation="vertical">

        <ImageView
            android:layout_width="@dimen/_120sdp"
            android:layout_height="@dimen/_120sdp"
            android:src="@drawable/icon" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="@dimen/_10sdp"
            android:text="@string/app_name"
            android:textSize="30sp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="0.7.2"
            android:textSize="20sp" />
    </LinearLayout>
</RelativeLayout>


text:
namespace installer {

class Version {
public:
  virtual ~Version();

  // Check if the current version is higher than the version object passed
  // as parameter
  bool IsHigherThan(const Version* other) const;

  // Return the string representation of this version
  const std::wstring& GetString() const {
    return version_str_;
  }

  // Assume that the version string is specified by four integers separated
  // by character '.'. Return NULL if string is not of this format.
  // Caller is responsible for freeing the Version object once done.
  static Version* GetVersionFromString(const std::wstring& version_str);

private:
  int64 major_;
  int64 minor_;
  int64 build_;
  int64 patch_;
  std::wstring version_str_;

  // Classes outside this file do not have any need to create objects of
  // this type so declare constructor as private.
  Version(int64 major, int64 minor, int64 build, int64 patch);
};

}  // namespace installer

#endif


text:
using System;
using System.Reflection;
using System.Reflection.Emit;

namespace JilTests
{
    internal static class TypeHelpers
    {
        public static ConstructorInfo AssertNotNull(this ConstructorInfo ctor, string name)
        {
            if (ctor == null) throw new InvalidOperationException("Failed to resolve constructor: " + name);
            return ctor;
        }
        public static MethodInfo AssertNotNull(this MethodInfo method, string name)
        {
            if (method == null) throw new InvalidOperationException("Failed to resolve method: " + name);
            return method;
        }
#if COREFX

        public static object _GetRawConstantValue(this FieldInfo field)
        {
            return field.GetValue(null);
        }
        public static bool _IsValueType(this Type type)
        {
            return type.GetTypeInfo().IsValueType;
        }
        public static bool _IsEnum(this Type type)
        {
            return type.GetTypeInfo().IsEnum;
        }
        public static bool _IsGenericType(this Type type)
        {
            return type.GetTypeInfo().IsGenericType;
        }
        public static bool _IsInterface(this Type type)
        {
            return type.GetTypeInfo().IsInterface;
        }
        public static bool _IsSealed(this Type type)
        {
            return type.GetTypeInfo().IsSealed;
        }
        public static Type _CreateType(this TypeBuilder type)
        {
            return type.CreateTypeInfo().AsType();
        }

        public static bool _IsPublic(this Type type)
        {
            return type.GetTypeInfo().IsPublic;
        }
        public static Type _BaseType(this Type type)
        {
            return type.GetTypeInfo().BaseType;
        }
        public static MethodInfo _GetPublicStaticMethod(this Type type, string name, Type[] args)
        {
            var method = type.GetRuntimeMethod(name, args);
            return (method == null || !method.IsPublic || !method.IsStatic) ? null : method;
        }
        public static ConstructorInfo _GetPublicOrPrivateConstructor(this Type onType, params Type[] parameterTypes)
        {
            return onType.GetConstructor(parameterTypes ?? Type.EmptyTypes);
        }
        public static bool _IsDefined(this Type type, Type attributeType)
        {
            return type.GetTypeInfo().IsDefined(attributeType);
        }
#else
        public static object _GetRawConstantValue(this FieldInfo field)
        {
            return field.GetRawConstantValue();
        }
        public static bool _IsValueType(this Type type)
        {
            return type.IsValueType;
        }
        public static bool _IsEnum(this Type type)
        {
            return type.IsEnum;
        }
        public static bool _IsGenericType(this Type type)
        {
            return type.IsGenericType;
        }
        public static bool _IsInterface(this Type type)
        {
            return type.IsInterface;
        }
        public static bool _IsSealed(this Type type)
        {
            return type.IsSealed;
        }
        public static Type _CreateType(this TypeBuilder type)
        {
            return type.CreateType();
        }

        public static bool _IsPublic(this Type type)
        {
            return type.IsPublic;
        }
        public static Type _BaseType(this Type type)
        {
            return type.BaseType;
        }
        public static MethodInfo _GetPublicStaticMethod(this Type type, string name, Type[] args)
        {
            return type.GetMethod(name, BindingFlags.Public | BindingFlags.Static, null, args, null);
        }
        public static ConstructorInfo _GetPublicOrPrivateConstructor(this Type onType, params Type[] parameterTypes)
        {
            return onType.GetConstructor(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance, null, parameterTypes ?? Type.EmptyTypes, null);
        }
        public static bool _IsDefined(this Type type, Type attributeType)
        {
            return Attribute.IsDefined(type, attributeType);
        }
#endif
    }
}


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>net.aequologica.neo</groupId>
        <artifactId>geppaequo</artifactId>
        <version>0.6.1-SNAPSHOT</version>
    </parent>

    <artifactId>geppaequo-waffle</artifactId>

    <name>geppaequo-waffle</name>

    <description>Everything you need to activate waffle (Windows Authentication Framework) on tomcat, bundled as a war overlay</description>

    <packaging>war</packaging>

    <dependencies>

        <dependency>
            <groupId>com.github.waffle</groupId>
            <artifactId>waffle-tomcat9</artifactId>
        </dependency>

        <!-- jstl -->
        <dependency>
            <groupId>jakarta.servlet.jsp.jstl</groupId>
            <artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jakarta.servlet.jsp.jstl</artifactId>
        </dependency>

        <!-- BEGIN provided -->
        <!-- el-api -->
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>jakarta.el</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- jsp-api -->
        <dependency>
            <groupId>jakarta.servlet.jsp</groupId>
            <artifactId>jakarta.servlet.jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- servlet-api -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- END provided -->

    </dependencies>

</project>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Maui.Trading.Model;

namespace Maui.Trading.Binding
{
    public interface IDataSource
    {
        string Name { get; }
    }
}


text:
===========
suelta.util
===========

A collection of general functions for finding and selecting available
hashing algorithms, and unifying APIs between Python 2.6+ and Python 3.

.. automodule:: suelta.util
    :members:


text:
class Weather

end


text:
package org.pentaho.di.ui.trans.steps.fileinput.text;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.swt.widgets.Shell;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.pentaho.di.core.KettleClientEnvironment;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.fileinput.FileInputList;
import org.pentaho.di.core.logging.LoggingObjectType;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.row.value.ValueMetaFactory;
import org.pentaho.di.core.variables.VariableSpace;
import org.pentaho.di.repository.Repository;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.steps.file.BaseFileErrorHandling;
import org.pentaho.di.trans.steps.file.BaseFileField;
import org.pentaho.di.trans.steps.file.BaseFileInputAdditionalField;
import org.pentaho.di.trans.steps.file.BaseFileInputFiles;
import org.pentaho.di.trans.steps.fileinput.text.TextFileInputMeta;
import org.pentaho.metastore.api.IMetaStore;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.io.ByteArrayInputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import static org.powermock.reflect.Whitebox.setInternalState;

@RunWith( PowerMockRunner.class )
@PowerMockIgnore( "jdk.internal.reflect.*" )
@PrepareForTest( FileInputList.class )
public class TextFileInputTextCSVImportProgressDialogTest {

  private TextFileCSVImportProgressDialog textFileCSVImportProgressDialog;
  private Shell shell;
  private TextFileInputMeta meta;
  private TransMeta transMeta;
  private InputStreamReader reader;
  private IProgressMonitor monitor;
  private TextFileInputMeta.Content content;
  private BaseFileInputFiles baseFileInputFiles;
  private BaseFileErrorHandling baseFileErrorHandling;
  private BaseFileInputAdditionalField baseFileInputAdditionalField;

  @Before
  public void setup() {
    mockStatic( FileInputList.class );

    shell = mock( Shell.class );
    meta = mock( TextFileInputMeta.class );
    transMeta = mock( TransMeta.class );
    monitor = mock( IProgressMonitor.class );
    content = mock( TextFileInputMeta.Content.class );
    baseFileInputFiles =  mock( BaseFileInputFiles.class );
    baseFileErrorHandling = mock( BaseFileErrorHandling.class );
    baseFileInputAdditionalField = mock( BaseFileInputAdditionalField.class );
  }

  @BeforeClass
  public static void beforeClassSetUp() throws KettleException {
    KettleClientEnvironment.init();
  }

  @Test
  public void fileDOSFormatTestWithNoEnclosures() throws Exception {
    BaseFileField[] baseFileFields = BaseFileFields( "String", "Number", "Boolean", "Date" );
    String fileContent = "String, int, boolean, date\r\n"
      + "レコード名1,1.7976E308,true,9999/12/31 23:59:59.999,\r\n"
      + "\"あa1\",123456789,false,2016/1/5 12:00:00.000\r\n";

    fileContentTest( fileContent, baseFileFields, TextFileInputMeta.FILE_FORMAT_DOS );
  }

  @Test
  public void fileDOSFormatTestWithEnclosures() throws Exception {
    BaseFileField[] baseFileFields = BaseFileFields( "String", "Number", "Boolean", "Date" );
    String fileContent = "String, int, boolean, date\r\n"
      + "\"レコ\r\n"
      + "ード名1\",1.7976E308,true,9999/12/31 23:59:59.999,\r\n"
      + "\"あ\r\n"
      + "a1\",123456789,false,2016/1/5 12:00:00.000\r\n";

    fileContentTest( fileContent, baseFileFields, TextFileInputMeta.FILE_FORMAT_DOS );
  }

  @Test
  public void fileUnixFormatTestWithNoEnclosures() throws Exception {
    BaseFileField[] baseFileFields = BaseFileFields( "String", "Number", "Boolean", "Date" );
    String fileContent = "String, int, boolean, date\n"
      + "レコード名1,1.7976E308,true,9999/12/31 23:59:59.999,\n"
      + "\"あa1\",123456789,false,2016/1/5 12:00:00.000\n";

    fileContentTest( fileContent, baseFileFields, TextFileInputMeta.FILE_FORMAT_UNIX );
  }

  @Test
  public void fileUnixFormatTestWithEnclosures() throws Exception {
    BaseFileField[] baseFileFields = BaseFileFields( "String", "Number", "Boolean", "Date" );
    String fileContent = "String, int, boolean, date\n"
      + "\"レコ\n"
      + "ード名1\",1.7976E308,true,9999/12/31 23:59:59.999,\n"
      + "\"あ\n"
      + "a1\",123456789,false,2016/1/5 12:00:00.000\n";

    fileContentTest( fileContent, baseFileFields, TextFileInputMeta.FILE_FORMAT_UNIX );
  }

  @Test
  public void fileMixFormatTestWithNoEnclosures() throws Exception {
    BaseFileField[] baseFileFields = BaseFileFields( "String", "Number", "Boolean", "Date" );
    String fileContent = "String, int, boolean, date\n"
      + "レコード名1,1.7976E308,true,9999/12/31 23:59:59.999,\r\n"
      + "\"あa1\",123456789,false,2016/1/5 12:00:00.000\r\n";

    fileContentTest( fileContent, baseFileFields, TextFileInputMeta.FILE_FORMAT_MIXED );
  }

  @Test
  public void fileMixFormatTestWithEnclosures() throws Exception {
    BaseFileField[] baseFileFields = BaseFileFields( "String", "Number", "Boolean", "Date" );
    String fileContent = "String, int, boolean, date\r\n"
      + "\"レコ\n"
      + "ード名1\",1.7976E308,true,9999/12/31 23:59:59.999,\n"
      + "\"あ\r\n"
      + "a1\",123456789,false,2016/1/5 12:00:00.000\n";

    fileContentTest( fileContent, baseFileFields, TextFileInputMeta.FILE_FORMAT_MIXED );
  }

  private void fileContentTest( String fileContent, BaseFileField[] baseFileFields, int fileFormat ) throws Exception {
    initiateVariables( fileContent, baseFileFields, fileFormat );
    String result = textFileCSVImportProgressDialog.doScan( monitor );

    assertEquals( ValueMetaFactory.getValueMetaName( meta.getInputFields()[0].getType() ), baseFileFields[0].getName() );
    assertEquals( ValueMetaFactory.getValueMetaName( meta.getInputFields()[1].getType() ), baseFileFields[1].getName() );
    assertEquals( ValueMetaFactory.getValueMetaName( meta.getInputFields()[2].getType() ), baseFileFields[2].getName() );
    assertEquals( ValueMetaFactory.getValueMetaName( meta.getInputFields()[3].getType() ), baseFileFields[3].getName() );
  }

  private void initiateVariables( String fileContent, BaseFileField[] baseFileFields, int fileFormat ) throws Exception {
    //reader
    reader = new InputStreamReader( new ByteArrayInputStream( fileContent.getBytes( StandardCharsets.UTF_8 ) ) );
    //Content
    setInternalState( content, "header",  true );
    setInternalState( content, "nrHeaderLines",  1 );
    setInternalState( content, "escapeCharacter",  "" );
    //baseFileInputFiles
    setInternalState( baseFileInputFiles, "fileName", new String[]{} );
    setInternalState( baseFileInputFiles, "fileMask", new String[]{} );
    setInternalState( baseFileInputFiles, "excludeFileMask", new String[]{} );
    setInternalState( baseFileInputFiles, "fileRequired", new String[]{} );
    when( baseFileInputFiles.includeSubFolderBoolean() ).thenReturn( new boolean[] {} );
    when( FileInputList.createFilePathList( any( VariableSpace.class ),
      any( String[].class ), any( String[].class ), any( String[].class ), any( String[].class ),
      any( boolean[].class ) ) ).thenReturn( new String[]{""} );
    //meta
    when( meta.getInputFields() ).thenReturn( baseFileFields );
    doCallRealMethod().when( meta ).getFields( any( RowMetaInterface.class ), anyString(), any( RowMetaInterface[].class ),
      any( StepMeta.class ), any( VariableSpace.class ), any( Repository.class ), any( IMetaStore.class ) );
    setInternalState( meta, "inputFields",  baseFileFields );
    setInternalState( meta, "content",  content );
    when( meta.clone() ).thenReturn( meta );
    setInternalState( content, "separator",  "," );
    setInternalState( content, "enclosure",  "\"" );
    when( meta.getEnclosure() ).thenReturn( "\"" );
    when( meta.getFileFormatTypeNr() ).thenReturn( fileFormat );
    setInternalState( content, "fileType",  "CSV" );
    setInternalState( meta, "inputFiles", baseFileInputFiles );
    setInternalState( meta, "errorHandling", baseFileErrorHandling );
    setInternalState( meta, "additionalOutputFields", baseFileInputAdditionalField );
    //transmeta
    when( transMeta.environmentSubstitute( "," ) ).thenReturn( "," );
    when( transMeta.environmentSubstitute( "\"" ) ).thenReturn( "\"" );
    when( transMeta.getObjectType() ).thenReturn( LoggingObjectType.TRANSMETA );
    //textFileCSVImportProgressDialog
    textFileCSVImportProgressDialog = spy( new TextFileCSVImportProgressDialog(
      shell, meta, transMeta, reader, 100, true ) );
  }

  private BaseFileField[] BaseFileFields( String... names ) {
    BaseFileField[] fields = new BaseFileField[ names.length ];
    for ( int i = 0; i < names.length; i++ ) {
      fields[ i ] = createBaseFileField( names[ i ] );
    }
    return fields;
  }

  private BaseFileField createBaseFileField( String name ) {
    BaseFileField field = new BaseFileField();
    field.setName( name );
    field.setType( ValueMetaInterface.TYPE_NONE );
    return field;
  }
}


text:
'use strict';

const key = 'intialWebviewUrl';
const defaultInitialUrl = 'https://slack.com/signin';

function get() {
  return localStorage.getItem(key) || defaultInitialUrl;
}

function set(initialUrl) {
  localStorage.setItem(key, initialUrl);
}

exports.get = get;
exports.set = set;


text:
namespace ObserverPattern
{
    using System.Collections.Generic;

    public abstract class DirtyLawEnforcementAgent
    {
        public DirtyLawEnforcementAgent(string name)
        {
            this.Name = name;
            this.Criminals = new List<Criminal>();
        }

        public string Name { get; set; }

        public string Investigation { get; set; }

        private IList<Criminal> Criminals { get; set; }

        public void ReceiveBride(Criminal criminal)
        {
            this.Criminals.Add(criminal);
        }

        public void StartInvestigation(string investigation)
        {
            this.Investigation = investigation;

            this.WarnCriminals();
        }

        private void WarnCriminals()
        {
            foreach (var criminal in this.Criminals)
            {
                criminal.Notify(this);
            }
        }
    }
}


text:
package com.phoenixnap.oss.ramlapisync.generation.rules;

import com.phoenixnap.oss.ramlapisync.data.ApiResourceMetadata;
import com.phoenixnap.oss.ramlapisync.generation.RamlParser;
import com.sun.codemodel.JCodeModel;
import com.sun.codemodel.JDefinedClass;
import org.junit.Test;

public class Spring3ControllerRulesThrowsExceptionTest extends AbstractRuleTestBase {

    private Rule<JCodeModel, JDefinedClass, ApiResourceMetadata> rule;

    public Spring3ControllerRulesThrowsExceptionTest() {
        defaultRamlParser =  new RamlParser("com.gen.test", "/api", false, false, true);
    }

    @Test
    public void applySpring3ControllerStubRule_shouldCreate_validCode() throws Exception {
        rule = new Spring3ControllerStubRule();
        rule.apply(getControllerMetadata(), jCodeModel);
        verifyGeneratedCode("Spring3ThrowsExceptionBaseControllerStub");
    }

    @Test
    public void applySpring3ControllerInterfaceRule_shouldCreate_validCode() throws Exception {
        rule = new Spring3ControllerInterfaceRule();
        rule.apply(getControllerMetadata(), jCodeModel);
        verifyGeneratedCode("Spring3ThrowsExceptionBaseControllerInterface");
    }

    @Test
    public void applySpring3ControllerDecoratorRule_shouldCreate_validCode() throws Exception {
        rule = new Spring3ControllerDecoratorRule();
        rule.apply(getControllerMetadata(), jCodeModel);
        verifyGeneratedCode("Spring3ThrowsExceptionBaseControllerDecorator");
    }

}


text:
namespace Bit.BlazorUI;

/// <summary>
/// A callback that provides data for a <see cref="BitDataGrid{TGridItem}"/>.
/// </summary>
/// <typeparam name="TGridItem">The type of data represented by each row in the grid.</typeparam>
/// <param name="request">Parameters describing the data being requested.</param>
/// <returns>A <see cref="ValueTask{BitDataGridItemsProviderResult{TResult}}" /> that gives the data to be displayed.</returns>
public delegate ValueTask<BitDataGridItemsProviderResult<TGridItem>> BitDataGridItemsProvider<TGridItem>(
    BitDataGridItemsProviderRequest<TGridItem> request);


text:
package sql.generic.ddl.alter;

import hydra.Log;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Set;

import sql.generic.GenericBBHelper;
import sql.generic.SQLOldTest;
import sql.generic.ddl.ColumnInfo;
import sql.generic.ddl.Constraint;
import sql.generic.ddl.DDLAction;
import sql.generic.ddl.Executor;
import sql.generic.ddl.FKConstraint;
import sql.generic.ddl.TableInfo;

public class AlterForeignKeyOperation extends AlterConstraintOperation {

  AlterForeignKeyOperation(String ddl , Executor executor , DDLAction action){
    super(ddl,executor,action);
    this.constraintType = Constraint.ConstraintType.FK_CONSTRAINT;
  }

  public AlterForeignKeyOperation parse(){
    switch (action) {
      case ADD :
        addFKConstraint();
        break;
      case DROP:
        dropConstraint();
        break;
     }
    return this;
  }

  protected  void addFKConstraint (){
    HashMap<String, List<FKConstraint>> droppedFKMap = new HashMap<String, List<FKConstraint>>(constraintHolder.getDroppedFkList());
    if (!droppedFKMap.isEmpty()) {
      Set<String> tables = droppedFKMap.keySet();
      tableName = (String)(tables.toArray())[SQLOldTest.random.nextInt(tables.size())];
      this.tableInfo = GenericBBHelper.getTableInfo(tableName);
      List<FKConstraint> droppedFKs =  droppedFKMap.get(tableName);

      FKConstraint constraint = droppedFKs.get(SQLOldTest.random.nextInt(droppedFKs.size()));

      //get columnName list
      List<ColumnInfo> fkColumns = constraint.getColumns();
      for(ColumnInfo c : fkColumns){
        if (columnName.length() == 0)
          columnName = c.getColumnName();
        else
          columnName = columnName + "," + c.getColumnName();
      }
      List<ColumnInfo> refColumns = constraint.getParentColumns();
      String refColumn = "" ;
      for(ColumnInfo c : refColumns){
        if (refColumn.length() == 0)
          refColumn = c.getColumnName();
        else
          refColumn = refColumn + "," + c.getColumnName();
      }
      // give new constraint name.
      constraintName = AlterUtilityHelper.getRandomConstraintName(tableInfo.getTableName(),constraintType);
      constraint.setConstraintName(constraintName);
      String ref = " REFERENCES " + constraint.getParentTable() + " (" + refColumn+ ") ON DELETE RESTRICT";
      replacePlaceHolders(tableInfo.getFullyQualifiedTableName(),constraintName,"(" + columnName + ")" + ref);
    } else {
      Log.getLogWriter().info("Did not get FKs to be added, continuing the test...");
      executeDDL = false;
    }
  }

  protected  TableInfo getTableInfoForDropConstraint(){
    tablesWithFKConstraint = new ArrayList<String>(constraintHolder.getTablesWithFKConstraint());
    if(tablesWithFKConstraint.size()==0)
      return null;
    tableName = tablesWithFKConstraint.get(SQLOldTest.random.nextInt(tablesWithFKConstraint.size()));
    return GenericBBHelper.getTableInfo(tableName);
  }

  protected FKConstraint getConstraint(){
    fkConstraints = new ArrayList<FKConstraint>(tableInfo.getForeignKeys());
    return fkConstraints.get(SQLOldTest.random.nextInt(fkConstraints.size()));
  }

}


text:
TEST_F(ImmediateDecoratorTest, VerifyImmediate) {
  // Create one filter which cannot be immediately satisfied, and one which can be:
  AutoRequired<FilterA> filterA;
  AutoRequired<FilterF> filterF;

  AutoRequired<AutoPacketFactory> factory;
  auto packet = factory->NewPacket();

  // Create an immediate style decoration:
  Decoration<0> imm;
  packet->DecorateImmediate(&imm);
  EXPECT_TRUE(filterF->m_called) << "FilterF should have been satisfied immediately, but it was not";

  // Now add the other decoration:
  packet->Decorate(Decoration<1>());

  // Verify that the first filter was not satisfied:
  EXPECT_FALSE(filterA->m_called) << "FilterA was called, even though it had no opportunity to be called";
}

TEST_F(ImmediateDecoratorTest, VerifyNoImmediateCrossthread) {
  // Create a concurrent filter which should not get called:
  AutoRequired<FilterB> filterB;
  m_create->InitiateCoreThreads();

  // Decorate a packet with half of the filter's requirement:
  AutoRequired<AutoPacketFactory> factory;
  auto packet = factory->NewPacket();
  packet->Decorate(Decoration<0>());

  // Verify that the factory correctly recognizes a deferred tag:
  auto desc = factory->FindSubscriber<FilterB>();
  ASSERT_TRUE(desc != nullptr) << "Failed to find a known subscriber";
  ASSERT_TRUE(desc->IsDeferred()) << "Deferred filter incorrectly identified as being non-deferred";

  // Now, use an immediate decoration on the other half, and wait for the filter to quit:
  Decoration<1> dec;
  packet->DecorateImmediate(&dec);

  // We should not hit the second filter's satisfaction:
  filterB->m_barr.wait();
  *filterB += [&filterB] { filterB->Stop(); };
  filterB->Wait();
  EXPECT_FALSE(filterB->m_excepted) << "Parallel filter threw an exception while processing a message";
  EXPECT_FALSE(filterB->m_called) << "Parallel filter incorrectly received an immediate-mode decoration";
}


text:
#include <aws/config/model/DeliveryChannel.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace ConfigService
{
namespace Model
{

DeliveryChannel::DeliveryChannel() :
    m_nameHasBeenSet(false),
    m_s3BucketNameHasBeenSet(false),
    m_s3KeyPrefixHasBeenSet(false),
    m_snsTopicARNHasBeenSet(false),
    m_configSnapshotDeliveryPropertiesHasBeenSet(false)
{
}

DeliveryChannel::DeliveryChannel(JsonView jsonValue) :
    m_nameHasBeenSet(false),
    m_s3BucketNameHasBeenSet(false),
    m_s3KeyPrefixHasBeenSet(false),
    m_snsTopicARNHasBeenSet(false),
    m_configSnapshotDeliveryPropertiesHasBeenSet(false)
{
  *this = jsonValue;
}

DeliveryChannel& DeliveryChannel::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("name"))
  {
    m_name = jsonValue.GetString("name");

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("s3BucketName"))
  {
    m_s3BucketName = jsonValue.GetString("s3BucketName");

    m_s3BucketNameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("s3KeyPrefix"))
  {
    m_s3KeyPrefix = jsonValue.GetString("s3KeyPrefix");

    m_s3KeyPrefixHasBeenSet = true;
  }

  if(jsonValue.ValueExists("snsTopicARN"))
  {
    m_snsTopicARN = jsonValue.GetString("snsTopicARN");

    m_snsTopicARNHasBeenSet = true;
  }

  if(jsonValue.ValueExists("configSnapshotDeliveryProperties"))
  {
    m_configSnapshotDeliveryProperties = jsonValue.GetObject("configSnapshotDeliveryProperties");

    m_configSnapshotDeliveryPropertiesHasBeenSet = true;
  }

  return *this;
}

JsonValue DeliveryChannel::Jsonize() const
{
  JsonValue payload;

  if(m_nameHasBeenSet)
  {
   payload.WithString("name", m_name);

  }

  if(m_s3BucketNameHasBeenSet)
  {
   payload.WithString("s3BucketName", m_s3BucketName);

  }

  if(m_s3KeyPrefixHasBeenSet)
  {
   payload.WithString("s3KeyPrefix", m_s3KeyPrefix);

  }

  if(m_snsTopicARNHasBeenSet)
  {
   payload.WithString("snsTopicARN", m_snsTopicARN);

  }

  if(m_configSnapshotDeliveryPropertiesHasBeenSet)
  {
   payload.WithObject("configSnapshotDeliveryProperties", m_configSnapshotDeliveryProperties.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace ConfigService
} // namespace Aws


text:
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Octokit
{
    public class OrganizationHooksClient : ApiClient, IOrganizationHooksClient
    {
        ///
        /// Initializes a new GitHub Repos API client.
        ///
        /// <param name="apiConnection">An API connection.</param>
        public OrganizationHooksClient(IApiConnection apiConnection)
            : base(apiConnection)
        {
        }

        ///
        /// Gets the list of hooks defined for a organization
        ///
        /// <param name="org">The organization's name</param>
        /// <remarks>See API documentation for more information.</remarks>
        /// <returns></returns>
        [ManualRoute("GET", "orgs/{org}/hooks")]
        public Task<IReadOnlyList<OrganizationHook>> GetAll(string org)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));

            return ApiConnection.GetAll<OrganizationHook>(ApiUrls.OrganizationHooks(org));
        }

        ///
        /// Gets the list of hooks defined for a organization
        ///
        /// <param name="org">The organization's name</param>
        /// <param name="options">Options for changing the API response</param>
        /// <remarks>See API documentation for more information.</remarks>
        /// <returns></returns>
        [ManualRoute("GET", "orgs/{org}/hooks")]
        public Task<IReadOnlyList<OrganizationHook>> GetAll(string org, ApiOptions options)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(options, nameof(options));

            return ApiConnection.GetAll<OrganizationHook>(ApiUrls.OrganizationHooks(org), options);
        }

        ///
        /// Gets a single hook by Id
        ///
        /// <param name="org"></param>
        /// <param name="hookId"></param>
        /// <returns></returns>
        /// <remarks>See API documentation for more information.</remarks>
        [ManualRoute("GET", "orgs/{org}/hooks/{hook_id}")]
        public Task<OrganizationHook> Get(string org, int hookId)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(hookId, nameof(hookId));

            return ApiConnection.Get<OrganizationHook>(ApiUrls.OrganizationHookById(org, hookId));
        }

        ///
        /// Creates a hook for a organization
        ///
        /// <remarks>See API documentation for more information.</remarks>
        /// <returns></returns>
        [ManualRoute("POST", "orgs/{org}/hooks")]
        public Task<OrganizationHook> Create(string org, NewOrganizationHook hook)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(hook, nameof(hook));

            return ApiConnection.Post<OrganizationHook>(ApiUrls.OrganizationHooks(org), hook.ToRequest());
        }

        ///
        /// Edits a hook for a organization
        ///
        /// <remarks>See API documentation for more information.</remarks>
        /// <returns></returns>
        [ManualRoute("PATCH", "orgs/{org}/hooks/{hook_id}")]
        public Task<OrganizationHook> Edit(string org, int hookId, EditOrganizationHook hook)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(hook, nameof(hook));

            return ApiConnection.Patch<OrganizationHook>(ApiUrls.OrganizationHookById(org, hookId), hook);
        }

        ///
        /// This will trigger a ping event to be sent to the hook.
        ///
        /// <remarks>See API documentation for more information.</remarks>
        /// <returns></returns>
        [ManualRoute("POST", "orgs/{org}/hooks/{hook_id}/pings")]
        public Task Ping(string org, int hookId)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(hookId, nameof(hookId));
            return ApiConnection.Post(ApiUrls.OrganizationHookPing(org, hookId));
        }

        ///
        /// Deletes a hook for a organization
        ///
        /// <remarks>See API documentation for more information.</remarks>
        /// <returns></returns>
        [ManualRoute("DELETE", "orgs/{org}/hooks/{hook_id}")]
        public Task Delete(string org, int hookId)
        {
            Ensure.ArgumentNotNullOrEmptyString(org, nameof(org));
            Ensure.ArgumentNotNull(hookId, nameof(hookId));

            return ApiConnection.Delete(ApiUrls.OrganizationHookById(org, hookId));
        }
    }
}


text:
/**
 * DO NOT EDIT
 *
 * This file was automatically generated by
 *   https://github.com/Polymer/gen-typescript-declarations
 *
 * To modify these typings, edit the source file(s):
 *   paper-spinner-lite.html
 */

/// <reference path="../polymer/types/polymer.d.ts" />
/// <reference path="../paper-styles/color.d.ts" />
/// <reference path="paper-spinner-behavior.d.ts" />
/// <reference path="paper-spinner-styles.d.ts" />

/**
 * Material design: [Progress & activity](https://www.google.com/design/spec/components/progress-activity.html)
 *
 * Element providing a single color material design circular spinner.
 *
 *     <paper-spinner-lite active></paper-spinner-lite>
 *
 * The default spinner is blue. It can be customized to be a different color.
 *
 * ### Accessibility
 *
 * Alt attribute should be set to provide adequate context for accessibility. If not provided,
 * it defaults to 'loading'.
 * Empty alt can be provided to mark the element as decorative if alternative content is provided
 * in another form (e.g. a text block following the spinner).
 *
 *     <paper-spinner-lite alt="Loading contacts list" active></paper-spinner-lite>
 *
 * ### Styling
 *
 * The following custom properties and mixins are available for styling:
 *
 * Custom property | Description | Default
 * ----------------|-------------|----------
 * `--paper-spinner-color` | Color of the spinner | `--google-blue-500`
 * `--paper-spinner-stroke-width` | The width of the spinner stroke | 3px
 */
interface PaperSpinnerLiteElement extends Polymer.Element, Polymer.PaperSpinnerBehavior {
}

interface HTMLElementTagNameMap {
  "paper-spinner-lite": PaperSpinnerLiteElement;
}


text:
Test for bug #66721: __wakeup of DateTime segfaults when invalid object data is supplied
--CREDITS--
Boro Sitnikovski <buritomath@yahoo.com>
--FILE--
<?php
$y = 'O:8:"DateTime":3:{s:4:"date";s:19:"2014-02-15 02:00:51";s:13:"timezone_type";i:3;s:8:"timezone";s:10:"1234567890";}';
var_dump(unserialize($y));
?>
--EXPECTF--
Fatal error: Invalid serialization data for DateTime object in %s on line %d


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for SwapDatastoreNotWritableOnHost complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="SwapDatastoreNotWritableOnHost">
 *   <complexContent>
 *     <extension base="{urn:vim25}DatastoreNotWritableOnHost">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SwapDatastoreNotWritableOnHost")
public class SwapDatastoreNotWritableOnHost
    extends DatastoreNotWritableOnHost
{

}


text:
package org.praisenter.ui.slide;

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

import org.praisenter.data.slide.Slide;
import org.praisenter.data.slide.SlideComponent;
import org.praisenter.ui.document.DocumentContext;

import javafx.beans.binding.Bindings;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Border;
import javafx.scene.layout.BorderStroke;
import javafx.scene.layout.BorderStrokeStyle;
import javafx.scene.layout.BorderWidths;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.StrokeLineCap;
import javafx.scene.shape.StrokeLineJoin;
import javafx.scene.shape.StrokeType;

final class EditNode extends StackPane {
	private static final double THUMB_SIZE = 10;
	private static final double BORDER_OFFSET = 6;
	private static final double BORDER_SIZE = 1;
	private static final double DASH_SIZE = 4;

	private final DocumentContext<Slide> document;
	private final ObjectProperty<SlideComponent> component;
	private final DoubleProperty scale;
	private final BooleanProperty selected;

	// for selection, move, and resize

	private Cursor cursor;

	/** The start x value of the mouse gesture */
	private double sx;

	/** The start y value of the mouse gesture */
	private double sy;

	/** The current x coordinate of the region */
	private double x;

	/** The current y coordinate of the region */
	private double y;

	/** The current width of the region */
	private double w;

	/** The current height of the region */
	private double h;

//	private final ContextMenu contextMenu;

	public EditNode(
			DocumentContext<Slide> document,
			SlideComponent component) {
		this.document = document;
		this.component = new SimpleObjectProperty<>(component);
		this.scale = new SimpleDoubleProperty(1);
		this.selected = new SimpleBooleanProperty(false);

//		this.contextMenu = new ContextMenu();
//		this.contextMenu.getItems().addAll(
////				this.createMenuItem(Action.NEW_BOOK),
////				this.createMenuItem(Action.NEW_CHAPTER),
////				this.createMenuItem(Action.NEW_VERSE),
////				new SeparatorMenuItem(),
//				this.createMenuItem(Action.COPY),
//				this.createMenuItem(Action.CUT),
//				this.createMenuItem(Action.PASTE),
////				new SeparatorMenuItem(),
////				this.createMenuItem(Action.REORDER),
////				this.createMenuItem(Action.RENUMBER),
//				new SeparatorMenuItem(),
//				this.createMenuItem(Action.DELETE)
//			);
//		this.contextMenu.setAutoHide(true);
//		this.setOnContextMenuRequested(e -> this.contextMenu.show(this, e.getScreenX(), e.getScreenY()));

		List<Double> halfdashes = new ArrayList<Double>();
		halfdashes.add(DASH_SIZE / 2);
		halfdashes.add(DASH_SIZE / 2);

		List<Double> dashes = new ArrayList<Double>();
		dashes.add(DASH_SIZE);
		dashes.add(DASH_SIZE);

		Border hoverBorder = new Border(
			new BorderStroke(Color.BLACK, new BorderStrokeStyle(StrokeType.OUTSIDE, StrokeLineJoin.MITER, StrokeLineCap.BUTT, BORDER_SIZE * 2, 0.0, halfdashes), null, new BorderWidths(BORDER_SIZE)),
			new BorderStroke(Color.WHITE, new BorderStrokeStyle(StrokeType.OUTSIDE, StrokeLineJoin.MITER, StrokeLineCap.BUTT, BORDER_SIZE * 2, DASH_SIZE / 2, halfdashes), null, new BorderWidths(BORDER_SIZE))
		);

		Border selectBorder = new Border(
			new BorderStroke(Color.BLACK, new BorderStrokeStyle(StrokeType.OUTSIDE, StrokeLineJoin.MITER, StrokeLineCap.BUTT, BORDER_SIZE * 2, 0.0, dashes), null, new BorderWidths(BORDER_SIZE)),
			new BorderStroke(Color.WHITE, new BorderStrokeStyle(StrokeType.OUTSIDE, StrokeLineJoin.MITER, StrokeLineCap.BUTT, BORDER_SIZE * 2, DASH_SIZE, dashes), null, new BorderWidths(BORDER_SIZE))
		);

		Region editBorder = new Region();
		editBorder.setSnapToPixel(true);
//		border.setBackground(new Background(new BackgroundFill(Color.WHITE, null, null)));

		StackPane editBorderContainer = new StackPane(editBorder);
		editBorderContainer.setPadding(new Insets(BORDER_OFFSET));
		editBorderContainer.setSnapToPixel(true);

		// resize knobs
		Rectangle tlThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle tThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle trThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle rThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle brThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle bThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle blThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);
		Rectangle lThumb = new Rectangle(THUMB_SIZE, THUMB_SIZE);

		StackPane.setAlignment(tlThumb, Pos.TOP_LEFT);
		StackPane.setAlignment(tThumb, Pos.TOP_CENTER);
		StackPane.setAlignment(trThumb, Pos.TOP_RIGHT);
		StackPane.setAlignment(rThumb, Pos.CENTER_RIGHT);
		StackPane.setAlignment(brThumb, Pos.BOTTOM_RIGHT);
		StackPane.setAlignment(bThumb, Pos.BOTTOM_CENTER);
		StackPane.setAlignment(blThumb, Pos.BOTTOM_LEFT);
		StackPane.setAlignment(lThumb, Pos.CENTER_LEFT);

		tlThumb.setCursor(Cursor.NW_RESIZE);
		tThumb.setCursor(Cursor.N_RESIZE);
		trThumb.setCursor(Cursor.NE_RESIZE);
		rThumb.setCursor(Cursor.E_RESIZE);
		brThumb.setCursor(Cursor.SE_RESIZE);
		bThumb.setCursor(Cursor.S_RESIZE);
		blThumb.setCursor(Cursor.SW_RESIZE);
		lThumb.setCursor(Cursor.W_RESIZE);

		Rectangle[] thumbs = new Rectangle[] {
			tlThumb,
			tThumb,
			trThumb,
			rThumb,
			brThumb,
			bThumb,
			blThumb,
			lThumb
		};

		for (Rectangle r : thumbs) {
			r.setFill(Color.WHITE);
			r.setStroke(Color.BLACK);
			r.setStrokeWidth(BORDER_SIZE);
			r.setStrokeType(StrokeType.CENTERED);
			r.setStrokeLineCap(StrokeLineCap.BUTT);
			r.setStrokeLineJoin(StrokeLineJoin.MITER);
			r.setStrokeMiterLimit(BORDER_SIZE);
			r.addEventHandler(MouseEvent.ANY, e -> {
				if (e.getEventType() == MouseEvent.MOUSE_PRESSED ||
					e.getEventType() == MouseEvent.MOUSE_CLICKED) {
					pressed(e, r.getCursor());
				} else if (e.getEventType() == MouseEvent.MOUSE_DRAGGED) {
					dragged(e);
				} else if (e.getEventType() == MouseEvent.MOUSE_RELEASED) {
					apply(e);
				}
				e.consume();
			});
		}

		this.getChildren().addAll(editBorderContainer, tlThumb, tThumb, trThumb, rThumb, brThumb, bThumb, blThumb, lThumb);

		this.prefWidthProperty().bind(Bindings.createDoubleBinding(() -> {
			return Math.ceil(component.getWidth() * this.scale.get()) + BORDER_OFFSET * 2;
		}, component.widthProperty(), this.scale));

		this.prefHeightProperty().bind(Bindings.createDoubleBinding(() -> {
			return Math.ceil(component.getHeight() * this.scale.get()) + BORDER_OFFSET * 2;
		}, component.heightProperty(), this.scale));

		this.layoutXProperty().bind(Bindings.createDoubleBinding(() -> {
			return Math.floor(component.getX() * this.scale.get()) - BORDER_OFFSET;
		}, component.xProperty(), this.scale));

		this.layoutYProperty().bind(Bindings.createDoubleBinding(() -> {
			return Math.floor(component.getY() * this.scale.get()) - BORDER_OFFSET;
		}, component.yProperty(), this.scale));

		for (Rectangle r : thumbs) {
			r.visibleProperty().bind(this.selected);
		}

		this.addEventHandler(MouseEvent.MOUSE_PRESSED, e -> this.selected.set(true));
		this.addEventHandler(MouseEvent.ANY, e -> {
			if (e.getEventType() == MouseEvent.MOUSE_PRESSED ||
				e.getEventType() == MouseEvent.MOUSE_CLICKED) {
				pressed(e, Cursor.MOVE);
			} else if (e.getEventType() == MouseEvent.MOUSE_DRAGGED) {
				dragged(e);
			} else if (e.getEventType() == MouseEvent.MOUSE_RELEASED) {
				apply(e);
			} else if (e.getEventType() == MouseEvent.MOUSE_ENTERED) {
				if (!this.isSelected()) {
					editBorder.setBorder(hoverBorder);
				}
			} else if (e.getEventType() == MouseEvent.MOUSE_EXITED) {
				if (!this.isSelected()) {
					editBorder.setBorder(null);
				}
			}
		});

		this.selected.addListener((obs, ov, nv) -> {
			if (!nv) {
				editBorder.setBorder(null);
			} else {
				editBorder.setBorder(selectBorder);
			}
		});

		this.setCursor(Cursor.MOVE);
		this.setSnapToPixel(true);

//		this.setBackground(new Background(new BackgroundFill(random(), null, null)));
	}

//	private Color random() {
//		return Color.color(Math.random(), Math.random(), Math.random());
//	}

	/**
	 * Called when a mouse button has been pressed on the component.
	 * @param event the event
	 */
	private void pressed(MouseEvent event, Cursor cursor) {
		this.cursor = cursor;

		// record the scene coordinates of the start
		sx = event.getSceneX();
		sy = event.getSceneY();

		// record the original x,y coordinates of the slide component
		x = component.get().getX();
		y = component.get().getY();
		w = component.get().getWidth();
		h = component.get().getHeight();
	}

	/**
	 * Called when a mouse drag gesture involves the component.
	 * @param event the event
	 */
	private void dragged(MouseEvent event) {
		// only components can be moved or resized

		// compute the integer difference in position
		// of the mouse from the start and scale it
		// by the scale factor
		double nx = event.getSceneX();
		double ny = event.getSceneY();
		double dx = nx - sx;
		double dy = ny - sy;

		// get the scaled (transformed translation)
		double sf = 1.0 / this.scale.get();
		double dxi = dx * sf;
		double dyi = dy * sf;

		// are we moving the node?
		if (cursor == Cursor.MOVE) {
			// we SET the x/y for accuracy
			this.positionChanged(x + dxi, y + dyi);
		}

		if (cursor == Cursor.E_RESIZE) {
			dxi = clamp(w, dxi);
			this.sizeChanged(x, y, w + dxi, h);
		} else if (cursor == Cursor.S_RESIZE) {
			dyi = clamp(h, dyi);
			this.sizeChanged(x, y, w, h + dyi);
		} else if (cursor == Cursor.N_RESIZE) {
			dyi = -clamp(h, -dyi);
			this.sizeChanged(x, y + dyi, w, h - dyi);
		} else if (cursor == Cursor.W_RESIZE) {
			dxi = -clamp(w, -dxi);
			this.sizeChanged(x + dxi, y, w - dxi, h);
		} else if (cursor == Cursor.SE_RESIZE) {
			dxi = clamp(w, dxi);
			dyi = clamp(h, dyi);
			this.sizeChanged(x, y, w + dxi, h + dyi);
		} else if (cursor == Cursor.SW_RESIZE) {
			dxi = -clamp(w, -dxi);
			dyi = clamp(h, dyi);
			this.sizeChanged(x + dxi, y, w - dxi, h + dyi);
		} else if (cursor == Cursor.NE_RESIZE) {
			dxi = clamp(w, dxi);
			dyi = -clamp(h, -dyi);
			this.sizeChanged(x, y + dyi, w + dxi, h - dyi);
		} else if (cursor == Cursor.NW_RESIZE) {
			dxi = -clamp(w, -dxi);
			dyi = -clamp(h, -dyi);
			this.sizeChanged(x + dxi, y + dyi, w - dxi, h - dyi);
		}
	}

	/**
	 * Clamps the given dimension + value to no less than MIN_DIMENSION.
	 * @param dimension the dimension
	 * @param value the value
	 * @return double
	 */
	private static double clamp(double dimension, double value) {
		if (value < 0) {
			if (dimension + value < 20) {
				return -Math.floor(dimension - 20);
			}
		}
		return Math.floor(value);
	}

	/**
	 * Calls the position changed handler.
	 * @param x the new x coordinate
	 * @param y the new y coordinate
	 */
	private void positionChanged(double x, double y) {
		this.component.get().setX(x);
		this.component.get().setY(y);
	}

	/**
	 * Calls the size changed handler.
	 * @param x the new x coordinate
	 * @param y the new y coordinate
	 * @param w the new width
	 * @param h the new height
	 */
	private void sizeChanged(double x, double y, double w, double h) {
		SlideComponent component = this.component.get();
		component.setX(x);
		component.setY(y);
		component.setWidth(w);
		component.setHeight(h);
	}

	/**
	 * Records the action performed to the undo manager for easy undo/redo.
	 * @param e the mouse event
	 */
	private void apply(MouseEvent e) {
		SlideComponent component = this.component.get();

		double sx = this.x;
		double sy = this.y;
		double sw = this.w;
		double sh = this.h;

		double nx = component.getX();
		double ny = component.getY();
		double nw = component.getWidth();
		double nh = component.getHeight();

		if (sx != nx ||
			sy != ny ||
			sw != nw ||
			sh != nh) {
			SlideComponentBoundsEdit be = new SlideComponentBoundsEdit(
					component.xProperty(),
					component.yProperty(),
					component.widthProperty(),
					component.heightProperty(),
					sx, sy, sw, sh,
					nx, ny, nw, nh);

			// apply the undo
			this.document.getUndoManager().addEdit(be);
		}
	}

	public ReadOnlyObjectProperty<SlideComponent> componentProperty() {
		return this.component;
	}

	public SlideComponent getComponent() {
		return this.component.get();
	}

	public DoubleProperty scaleProperty() {
		return this.scale;
	}

	public double getScale() {
		return this.scale.get();
	}

	public void setScale(double scale) {
		this.scale.set(scale);
	}

	public BooleanProperty selectedProperty() {
		return this.selected;
	}

	public boolean isSelected() {
		return this.selected.get();
	}

	public void setSelected(boolean flag) {
		this.selected.set(flag);
	}
}


text:
package com.android.server;

import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.Intent;
import android.os.Message;
import android.view.accessibility.AccessibilityEvent;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

import junit.framework.TestCase;

/**
 * This is the base class for mock {@link AccessibilityService}s.
 */
public abstract class MockAccessibilityService extends AccessibilityService {

    /**
     * The event this service expects to receive.
     */
    private final Queue<AccessibilityEvent> mExpectedEvents = new LinkedList<AccessibilityEvent>();

    /**
     * Interruption call this service expects to receive.
     */
    private boolean mExpectedInterrupt;

    /**
     * Flag if the mock is currently replaying.
     */
    private boolean mReplaying;

    /**
     * Flag if the system is bound as a client to this service.
     */
    private boolean mIsSystemBoundAsClient;

    /**
     * Creates an {@link AccessibilityServiceInfo} populated with default
     * values.
     *
     * @return The default info.
     */
    public static AccessibilityServiceInfo createDefaultInfo() {
        AccessibilityServiceInfo defaultInfo = new AccessibilityServiceInfo();
        defaultInfo.eventTypes = AccessibilityEvent.TYPE_VIEW_CLICKED;
        defaultInfo.feedbackType = AccessibilityServiceInfo.FEEDBACK_AUDIBLE;
        defaultInfo.flags = 0;
        defaultInfo.notificationTimeout = 0;
        defaultInfo.packageNames = new String[] {
            "foo.bar.baz"
        };

        return defaultInfo;
    }

    /**
     * Starts replaying the mock.
     */
    public void replay() {
        mReplaying = true;
    }

    /**
     * Verifies if all expected service methods have been called.
     */
    public void verify() {
        if (!mReplaying) {
            throw new IllegalStateException("Did you forget to call replay()");
        }

        if (mExpectedInterrupt) {
            throw new IllegalStateException("Expected call to #interrupt() not received");
        }
        if (!mExpectedEvents.isEmpty()) {
            throw new IllegalStateException("Expected a call to onAccessibilityEvent() for "
                    + "events \"" + mExpectedEvents + "\" not received");
        }
    }

    /**
     * Resets this instance so it can be reused.
     */
    public void reset() {
        mExpectedEvents.clear();
        mExpectedInterrupt = false;
        mReplaying = false;
    }

    /**
     * Sets an expected call to
     * {@link #onAccessibilityEvent(AccessibilityEvent)} with given event as
     * argument.
     *
     * @param expectedEvent The expected event argument.
     */
    public void expectEvent(AccessibilityEvent expectedEvent) {
        mExpectedEvents.add(expectedEvent);
    }

    /**
     * Sets an expected call of {@link #onInterrupt()}.
     */
    public void expectInterrupt() {
        mExpectedInterrupt = true;
    }

    @Override
    public void onAccessibilityEvent(AccessibilityEvent receivedEvent) {
        if (!mReplaying) {
            return;
        }

        if (mExpectedEvents.isEmpty()) {
            throw new IllegalStateException("Unexpected event: " + receivedEvent);
        }

        AccessibilityEvent expectedEvent = mExpectedEvents.poll();
        assertEqualsAccessiblityEvent(expectedEvent, receivedEvent);
    }

    @Override
    public void onInterrupt() {
        if (!mReplaying) {
            return;
        }

        if (!mExpectedInterrupt) {
            throw new IllegalStateException("Unexpected call to onInterrupt()");
        }

        mExpectedInterrupt = false;
    }

    @Override
    protected void onServiceConnected() {
        mIsSystemBoundAsClient = true;
    }

    @Override
    public boolean onUnbind(Intent intent) {
        mIsSystemBoundAsClient = false;
        return false;
    }

    /**
     * Returns if the system is bound as client to this service.
     *
     * @return True if the system is bound, false otherwise.
     */
    public boolean isSystemBoundAsClient() {
        return mIsSystemBoundAsClient;
    }

    /**
     * Compares all properties of the expectedEvent and the
     * receviedEvent to verify that the received event is the one
     * that is expected.
     */
    private void assertEqualsAccessiblityEvent(AccessibilityEvent expectedEvent,
            AccessibilityEvent receivedEvent) {
        TestCase.assertEquals("addedCount has incorrect value", expectedEvent.getAddedCount(),
                receivedEvent.getAddedCount());
        TestCase.assertEquals("beforeText has incorrect value", expectedEvent.getBeforeText(),
                receivedEvent.getBeforeText());
        TestCase.assertEquals("checked has incorrect value", expectedEvent.isChecked(),
                receivedEvent.isChecked());
        TestCase.assertEquals("className has incorrect value", expectedEvent.getClassName(),
                receivedEvent.getClassName());
        TestCase.assertEquals("contentDescription has incorrect value", expectedEvent
                .getContentDescription(), receivedEvent.getContentDescription());
        TestCase.assertEquals("currentItemIndex has incorrect value", expectedEvent
                .getCurrentItemIndex(), receivedEvent.getCurrentItemIndex());
        TestCase.assertEquals("enabled has incorrect value", expectedEvent.isEnabled(),
                receivedEvent.isEnabled());
        TestCase.assertEquals("eventType has incorrect value", expectedEvent.getEventType(),
                receivedEvent.getEventType());
        TestCase.assertEquals("fromIndex has incorrect value", expectedEvent.getFromIndex(),
                receivedEvent.getFromIndex());
        TestCase.assertEquals("fullScreen has incorrect value", expectedEvent.isFullScreen(),
                receivedEvent.isFullScreen());
        TestCase.assertEquals("itemCount has incorrect value", expectedEvent.getItemCount(),
                receivedEvent.getItemCount());
        assertEqualsNotificationAsParcelableData(expectedEvent, receivedEvent);
        TestCase.assertEquals("password has incorrect value", expectedEvent.isPassword(),
                receivedEvent.isPassword());
        TestCase.assertEquals("removedCount has incorrect value", expectedEvent.getRemovedCount(),
                receivedEvent.getRemovedCount());
        assertEqualsText(expectedEvent, receivedEvent);
    }

    /**
     * Compares the {@link android.os.Parcelable} data of the
     * expectedEvent and receivedEvent to verify that
     * the received event is the one that is expected.
     */
    private void assertEqualsNotificationAsParcelableData(AccessibilityEvent expectedEvent,
            AccessibilityEvent receivedEvent) {
        String message = "parcelableData has incorrect value";
        Message expectedMessage = (Message) expectedEvent.getParcelableData();
        Message receivedMessage = (Message) receivedEvent.getParcelableData();

        if (expectedMessage == null) {
            if (receivedMessage == null) {
                return;
            }
        }

        TestCase.assertNotNull(message, receivedMessage);

        // we do a very simple sanity check since we do not test Message
        TestCase.assertEquals(message, expectedMessage.what, receivedMessage.what);
    }

    /**
     * Compares the text of the expectedEvent and
     * receivedEvent by comparing the string representation of the
     * corresponding {@link CharSequence}s.
     */
    private void assertEqualsText(AccessibilityEvent expectedEvent,
            AccessibilityEvent receivedEvent) {
        String message = "text has incorrect value";
        List<CharSequence> expectedText = expectedEvent.getText();
        List<CharSequence> receivedText = receivedEvent.getText();

        TestCase.assertEquals(message, expectedText.size(), receivedText.size());

        Iterator<CharSequence> expectedTextIterator = expectedText.iterator();
        Iterator<CharSequence> receivedTextIterator = receivedText.iterator();

        for (int i = 0; i < expectedText.size(); i++) {
            // compare the string representation
            TestCase.assertEquals(message, expectedTextIterator.next().toString(),
                    receivedTextIterator.next().toString());
        }
    }
}


text:
/**
 * Controller for the main view
 */
define( [
	"text!./main-view.ng.html"
],
function (
	template
) {
	"use strict";
	function MainController( $scope ) {
		$scope.message = "Main";
	}

	return {
		template: template,
		controller: MainController
	};
} );


text:
package com.eggsy.epermission;

import android.Manifest;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import com.eggsy.permission.EPermission;
import com.permission.annotation.PermissionDeny;
import com.permission.annotation.PermissionGrant;
import com.permission.annotation.PermissionRationale;

/**
 * Created by eggsy on 16-12-27.
 */

public class PermissionActivity extends Activity implements View.OnClickListener {

    private static final String TAG = "permission";

    private static final int REQUEST_SINGLE_PERMISSON = 1;
    private static final int REQUEST_MULTI_PERMISSON = 2;

    Button mBtnRequestSinglePermission;
    Button mBtnRequestMultiPermission;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_permission);

        initView();
    }

    private void initView() {
        mBtnRequestSinglePermission = (Button) findViewById(R.id.btn_request_single_permission);
        mBtnRequestMultiPermission = (Button) findViewById(R.id.btn_request_multi_permission);

        mBtnRequestSinglePermission.setOnClickListener(this);
        mBtnRequestMultiPermission.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn_request_multi_permission:
                EPermission.requestPermissions(this, REQUEST_MULTI_PERMISSON, Manifest.permission.CAMERA, Manifest.permission.READ_CONTACTS);
                break;
            case R.id.btn_request_single_permission:
                // judge the request permission should be show the rational explain to the user
                if (!EPermission.shouldShowRequestPermissionRationale(this, REQUEST_SINGLE_PERMISSON, Manifest.permission.READ_EXTERNAL_STORAGE)) {
                    EPermission.requestPermissions(this, REQUEST_SINGLE_PERMISSON, Manifest.permission.READ_EXTERNAL_STORAGE);
                }
                break;
        }
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
        EPermission.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
    }

    /**
     * below content is process READ_EXTERNAL_STORAGE permission callback
     */

    @PermissionGrant(requestPermission = Manifest.permission.READ_EXTERNAL_STORAGE)
    public void grantSdcardPermission() {
        Log.d(TAG, "permission READ_EXTERNAL_STORAGE grant");
        Toast.makeText(this, "permission READ_EXTERNAL_STORAGE grant", Toast.LENGTH_SHORT).show();
    }

    @PermissionDeny(requestCode = REQUEST_SINGLE_PERMISSON, requestPermission = Manifest.permission.READ_EXTERNAL_STORAGE)
    public void denyGrantSdcardPermission() {
        Log.d(TAG, "permission READ_EXTERNAL_STORAGE deny");
        Toast.makeText(this, "permission READ_EXTERNAL_STORAGE deny", Toast.LENGTH_SHORT).show();
    }

    @PermissionRationale(requestCode = REQUEST_SINGLE_PERMISSON, requestPermission = Manifest.permission.READ_EXTERNAL_STORAGE)
    public void rationableSdcardPermission() {
        Log.d(TAG, "ask to rationable READ_EXTERNAL_STORAGE permission");
        Toast.makeText(this, "ask to rationable READ_EXTERNAL_STORAGE permission", Toast.LENGTH_SHORT).show();
        EPermission.requestPermissions(this, REQUEST_SINGLE_PERMISSON, Manifest.permission.READ_EXTERNAL_STORAGE);
    }

    /**
     * below content is process CAMERA permission callback
     */

    @PermissionGrant(requestPermission = Manifest.permission.CAMERA)
    public void grantCameraPermission() {
        Log.d(TAG, "permission CAMERA grant");
        Toast.makeText(this, "permission CAMERA grant", Toast.LENGTH_SHORT).show();
    }

    @PermissionDeny(requestPermission = Manifest.permission.CAMERA)
    public void denyGrantCameraPermission() {
        Log.d(TAG, "permission CAMERA deny");
        Toast.makeText(this, "permission CAMERA deny", Toast.LENGTH_SHORT).show();
    }

    @PermissionRationale(requestPermission = Manifest.permission.CAMERA)
    public void rationableCameraPermission() {
        Log.d(TAG, "ask to rationable CAMERA permission");
        Toast.makeText(this, "ask to rationable CAMERA permission", Toast.LENGTH_SHORT).show();
        EPermission.requestPermissions(this, REQUEST_SINGLE_PERMISSON, Manifest.permission.CAMERA);
    }

    /**
     * below content is process READ_CONTACTS permission callback
     */

    @PermissionGrant(requestCode = REQUEST_MULTI_PERMISSON, requestPermission = Manifest.permission.READ_CONTACTS)
    public void grantContactPermission() {
        Log.d(TAG, "permission READ_CONTACTS grant");
        Toast.makeText(this, "permission READ_CONTACTS grant", Toast.LENGTH_SHORT).show();
    }

    @PermissionDeny(requestCode = REQUEST_MULTI_PERMISSON, requestPermission = Manifest.permission.READ_CONTACTS)
    public void denyGrantContactPermission() {
        Log.d(TAG, "permission READ_CONTACTS deny");
        Toast.makeText(this, "permission READ_CONTACTS deny", Toast.LENGTH_SHORT).show();
    }

    @PermissionRationale(requestCode = REQUEST_MULTI_PERMISSON, requestPermission = Manifest.permission.READ_CONTACTS)
    public void rationableContactPermission() {
        Log.d(TAG, "ask to rationable READ_CONTACTS permission");
        Toast.makeText(this, "ask to rationable READ_CONTACTS permission", Toast.LENGTH_SHORT).show();
        EPermission.requestPermissions(this, REQUEST_SINGLE_PERMISSON, Manifest.permission.READ_CONTACTS);
    }

}