text:
<?xml version="1.0" encoding="UTF-8"?>
<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">
    <parent>
        <artifactId>kadima</artifactId>
        <groupId>com.bei2love</groupId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modules>
        <module>../kadima-commons</module>
        <module>../kadima-web-core</module>
    </modules>
    <modelVersion>4.0.0</modelVersion>
    <packaging>pom</packaging>
    <artifactId>kadima-parent</artifactId>

    <!-- 项目属性 -->
    <properties>

        <!-- main version setting -->
        <spring.version>4.0.8.RELEASE</spring.version>
        <validator.version>5.1.1.Final</validator.version>
        <mybatis.version>3.2.8</mybatis.version>
        <mybatis-spring.version>1.2.2</mybatis-spring.version>
        <druid.version>1.0.11</druid.version>
        <ehcache.version>2.6.9</ehcache.version>
        <ehcache-web.version>2.0.4</ehcache-web.version>
        <shiro.version>1.2.3</shiro.version>
        <sitemesh.version>2.4.2</sitemesh.version>
        <activiti.version>5.15.1</activiti.version>

        <!-- tools version setting -->
        <slf4j.version>1.7.7</slf4j.version>
        <commons-lang3.version>3.3.2</commons-lang3.version>
        <commons-io.version>2.4</commons-io.version>
        <commons-codec.version>1.9</commons-codec.version>
        <commons-fileupload.version>1.3.1</commons-fileupload.version>
        <commons-beanutils.version>1.9.1</commons-beanutils.version>
        <jackson.version>2.2.3</jackson.version>
        <fastjson.version>1.1.40</fastjson.version>
        <xstream.version>1.4.7</xstream.version>
        <guava.version>17.0</guava.version>
        <dozer.version>5.5.1</dozer.version>
        <poi.version>3.9</poi.version>
        <freemarker.version>2.3.20</freemarker.version>

        <!-- jdbc driver setting -->
        <mysql.driver.version>5.1.30</mysql.driver.version>
        <oracle.driver.version>10.2.0.4.0</oracle.driver.version>
        <mssql.driver.version>1.3.1</mssql.driver.version>

    </properties>

    <!-- 依赖项定义 -->
    <dependencies>

        <!-- SPRING begin -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- spring orm -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- bean validate -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>${validator.version}</version>
        </dependency>
        <!-- SPRING end -->

        <!-- AOP begin -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>1.7.4</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.7.4</version>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib</artifactId>
            <version>3.1</version>
        </dependency>
        <!-- AOP end -->

        <!-- PERSISTENCE begin -->

        <!-- MyBatis -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${mybatis.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>${mybatis-spring.version}</version>
        </dependency>

        <!-- connection pool -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>${druid.version}</version>
        </dependency>

        <!-- jdbc driver -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.driver.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc14</artifactId>
            <version>${oracle.driver.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jtds</groupId>
            <artifactId>jtds</artifactId>
            <version>${mssql.driver.version}</version>
            <scope>runtime</scope>
        </dependency>
        <!-- PERSISTENCE end -->

        <!-- WEB begin -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
            <version>${sitemesh.version}</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <!-- <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
            <scope>provided</scope>
        </dependency> -->
        <!-- WEB end -->

        <!-- CACHE begin -->
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-core</artifactId>
            <version>${ehcache.version}</version>
        </dependency>
        <dependency>
            <groupId>net.sf.ehcache</groupId>
            <artifactId>ehcache-web</artifactId>
            <version>${ehcache-web.version}</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.5.1</version>
        </dependency>
        <!-- CACHE end -->

        <!-- SECURITY begin -->
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-core</artifactId>
            <version>${shiro.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-spring</artifactId>
            <version>${shiro.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-cas</artifactId>
            <version>${shiro.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-web</artifactId>
            <version>${shiro.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-ehcache</artifactId>
            <version>${shiro.version}</version>
        </dependency>
        <!-- SECURITY end -->

        <!-- Activiti -->
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-engine</artifactId>
            <version>${activiti.version}</version>
        </dependency>
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-spring</artifactId>
            <version>${activiti.version}</version>
        </dependency>
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-explorer</artifactId>
            <version>${activiti.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>vaadin</artifactId>
                    <groupId>com.vaadin</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>dcharts-widget</artifactId>
                    <groupId>org.vaadin.addons</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>activiti-simple-workflow</artifactId>
                    <groupId>org.activiti</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-modeler</artifactId>
            <version>${activiti.version}</version>
        </dependency>
        <dependency>
            <groupId>org.activiti</groupId>
            <artifactId>activiti-diagram-rest</artifactId>
            <version>${activiti.version}</version>
        </dependency>

        <!-- 支持activiti缓存 -->
        <!-- <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-core</artifactId>
            <version>5.1.7.Final</version>
        </dependency> -->

        <!-- LOGGING begin -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <!-- common-logging 实际调用slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <!-- java.util.logging 实际调用slf4j -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <!-- LOGGING end -->

        <!-- GENERAL UTILS begin -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${commons-codec.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>${commons-fileupload.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>${commons-beanutils.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- google java lib -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>

        <!-- jackson json -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <!-- fastjson json
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>${fastjson.version}</version>
        </dependency> -->

        <!-- xstream xml -->
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>${xstream.version}</version>
        </dependency>

        <!-- pojo copy -->
        <dependency>
            <groupId>net.sf.dozer</groupId>
            <artifactId>dozer</artifactId>
            <version>${dozer.version}</version>
        </dependency>

        <!-- freemarker engine -->
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>${freemarker.version}</version>
        </dependency>

        <!-- email -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
        </dependency>

        <!-- poi office -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>${poi.version}</version>
        </dependency>

        <!-- image util -->
        <dependency>
            <groupId>com.drewnoakes</groupId>
            <artifactId>metadata-extractor</artifactId>
            <version>2.6.2</version>
        </dependency>

        <!-- 条形码、二维码生成  -->
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>core</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.zxing</groupId>
            <artifactId>javase</artifactId>
            <version>2.2</version>
        </dependency>

        <!-- 中文分词 -->
        <dependency>
            <groupId>org.wltea</groupId>
            <artifactId>analyzer</artifactId>
            <version>2012_u6</version>
        </dependency>
        <!-- GENERAL UTILS end -->

        <!-- CKFinder begin -->
        <dependency>
            <groupId>net.coobird</groupId>
            <artifactId>thumbnailator</artifactId>
            <version>0.4.2</version>
        </dependency>
        <dependency>
            <groupId>com.ckfinder</groupId>
            <artifactId>apache-ant-zip</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>com.ckfinder</groupId>
            <artifactId>ckfinder</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>com.ckfinder</groupId>
            <artifactId>ckfinderplugin-fileeditor</artifactId>
            <version>2.3</version>
        </dependency>
        <dependency>
            <groupId>com.ckfinder</groupId>
            <artifactId>ckfinderplugin-imageresize</artifactId>
            <version>2.3</version>
        </dependency>
        <!-- CKFinder end -->

        <!-- TEST begin -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!-- TEST end -->

        <!-- User Agent -->
        <dependency>
            <groupId>bitwalker</groupId>
            <artifactId>UserAgentUtils</artifactId>
            <version>1.13</version>
        </dependency>

        <!-- 使用 Jetty JSP引擎
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-jsp</artifactId>
            <version>${jetty.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.eclipse.jetty.orbit</groupId>
                    <artifactId>javax.servlet</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.eclipse.jetty.orbit</groupId>
                    <artifactId>org.apache.taglibs.standard.glassfish</artifactId>
                </exclusion>
            </exclusions>
        </dependency> -->

    </dependencies>
</project>


text:
require 'test_helper'

class AsignaturasControllerTest < ActionController::TestCase
  setup do
    @asignatura = asignaturas(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:asignaturas)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should create asignatura" do
    assert_difference('Asignatura.count') do
      post :create, asignatura: { descripcion: @asignatura.descripcion, nombre_corto: @asignatura.nombre_corto, nombre_largo: @asignatura.nombre_largo }
    end

    assert_redirected_to asignatura_path(assigns(:asignatura))
  end

  test "should show asignatura" do
    get :show, id: @asignatura
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @asignatura
    assert_response :success
  end

  test "should update asignatura" do
    patch :update, id: @asignatura, asignatura: { descripcion: @asignatura.descripcion, nombre_corto: @asignatura.nombre_corto, nombre_largo: @asignatura.nombre_largo }
    assert_redirected_to asignatura_path(assigns(:asignatura))
  end

  test "should destroy asignatura" do
    assert_difference('Asignatura.count', -1) do
      delete :destroy, id: @asignatura
    end

    assert_redirected_to asignaturas_path
  end
end

redpajama_set_name: RedPajamaGithub


text:
package java.net;

import org.apache.harmony.luni.util.Msg;

/**
 * This class models a datagram packet to be sent or received. The
 * DatagramPacket(byte[], int, InetAddress, int) constructor is used for packets
 * to be sent, while the DatagramPacket(byte[], int) constructor is used for
 * received packets.
 *
 * @see DatagramSocket
 */
public final class DatagramPacket {

    byte[] data;

    int length;

    InetAddress address;

    int port = -1; // The default port number is -1

    int offset = 0;

    /**
     * Constructs a new DatagramPacket suitable for receiving
     * datagram packets of length up to length.
     *
     * @param data
     *            byte array to store the read characters
     * @param length
     *            length of the data buffer
     */
    public DatagramPacket(byte[] data, int length) {
        this(data, 0, length);
    }

    /**
     * Constructs a new DatagramPacket suitable for receiving
     * datagram packets of length up to length, with an offset
     * into the buffer offset.
     *
     * @param data
     *            byte array to store the read characters
     * @param offset
     *            the offset into the byte array
     * @param length
     *            length of the data buffer
     */
    public DatagramPacket(byte[] data, int offset, int length) {
        super();
        setData(data, offset, length);
    }

    /**
     * Constructs a new DatagramPacket suitable for sending
     * packets to the nominated host/port. The length must be
     * less than or equal to the size of data.
     *
     * @param data
     *            byte array to store the read characters
     * @param offset
     *            the offset in to read/write from
     * @param length
     *            length of the data buffer
     * @param host
     *            address of the target host
     * @param aPort
     *            target host port
     */

    public DatagramPacket(byte[] data, int offset, int length,
            InetAddress host, int aPort) {
        this(data, offset, length);
        setPort(aPort);
        address = host;
    }

    /**
     * Constructs a new DatagramPacket suitable for sending
     * packets to the nominated host/port. The length must be
     * less than or equal to the size of data.
     *
     * @param data
     *            byte array to store the read characters
     * @param length
     *            length of the data buffer
     * @param host
     *            address of the target host
     * @param port
     *            target host port
     */
    public DatagramPacket(byte[] data, int length, InetAddress host, int port) {
        this(data, 0, length, host, port);
    }

    /**
     * Answer the IP address of the machine that is the target or sender of this
     * datagram.
     *
     * @return InetAddress the target host address
     */
    public synchronized InetAddress getAddress() {
        return address;
    }

    /**
     * Answer the data sent or received in this datagram.
     *
     * @return byte[] the data sent/received
     */
    public synchronized byte[] getData() {
        return data;
    }

    /**
     * Answer the length of the data sent or received in this datagram.
     *
     * @return int the length of the sent/received data
     */
    public synchronized int getLength() {
        return length;
    }

    /**
     * Answer the offset of the data sent or received in this datagram buffer.
     *
     * @return int the offset of the start of the sent/received data
     */
    public synchronized int getOffset() {
        return offset;
    }

    /**
     * Answer the port number of the target or sender machine of this datagram.
     *
     * @return int for received packets, the sender address and for sent
     *         packets, the target host
     */
    public synchronized int getPort() {
        return port;
    }

    /**
     * Set the IP address of the machine that is the target of this datagram.
     *
     * @param addr
     *            the target host address
     */
    public synchronized void setAddress(InetAddress addr) {
        address = addr;
    }

    /**
     * Set the data buffer for this datagram.
     *
     * @param buf
     *            the data to be sent
     * @param anOffset
     *            the offset into the data
     * @param aLength
     *            the length of the data to be sent
     */
    public synchronized void setData(byte[] buf, int anOffset, int aLength) {
        if (0 > anOffset || anOffset > buf.length || 0 > aLength
                || aLength > buf.length - anOffset) {
            throw new IllegalArgumentException(Msg.getString("K002f")); //$NON-NLS-1$
        }
        data = buf;
        offset = anOffset;
        length = aLength;
    }

    /**
     * Set the data sent in this datagram.
     *
     * @param buf
     *            the data to be sent
     */
    public synchronized void setData(byte[] buf) {
        length = buf.length; // This will check for null
        data = buf;
        offset = 0;
    }

    /**
     * Set the length of the data sent in this datagram.
     *
     * @param len
     *            the length of the data to be sent
     */
    public synchronized void setLength(int len) {
        if (0 > len || offset + len > data.length) {
            throw new IllegalArgumentException(Msg.getString("K002f")); //$NON-NLS-1$
        }
        length = len;
    }

    /**
     * Set the port number of the target machine of this datagram.
     *
     * @param aPort
     *            the target host port
     */
    public synchronized void setPort(int aPort) {
        if (aPort < 0 || aPort > 65535) {
            throw new IllegalArgumentException(Msg.getString("K0325", aPort)); //$NON-NLS-1$
        }
        port = aPort;
    }

    /**
     * Constructs a new DatagramPacket suitable for sending
     * packets to the nominated host/port. The length must be
     * less than or equal to the size of data.
     *
     * @param data
     *            byte array to store the read characters
     * @param length
     *            length of the data buffer
     * @param sockAddr
     *            the machine address and port
     */
    public DatagramPacket(byte[] data, int length, SocketAddress sockAddr)
            throws SocketException {
        this(data, 0, length);
        setSocketAddress(sockAddr);
    }

    /**
     * Constructs a new DatagramPacket suitable for sending
     * packets to the nominated host/port. The length must be
     * less than or equal to the size of data.
     *
     * @param data
     *            byte array to store the read characters
     * @param offset
     *            the offset in to read/write from
     * @param length
     *            length of the data buffer
     * @param sockAddr
     *            the machine address and port
     */
    public DatagramPacket(byte[] data, int offset, int length,
            SocketAddress sockAddr) throws SocketException {
        this(data, offset, length);
        setSocketAddress(sockAddr);
    }

    /**
     * Answer the SocketAddress for this packet.
     */
    public synchronized SocketAddress getSocketAddress() {
        return new InetSocketAddress(getAddress(), getPort());
    }

    /**
     * Set the SocketAddress for this packet.
     *
     * @param sockAddr
     *            the machine address and port
     */
    public synchronized void setSocketAddress(SocketAddress sockAddr) {
        if (!(sockAddr instanceof InetSocketAddress)) {
            throw new IllegalArgumentException(Msg.getString(
                    "K0316", sockAddr == null ? null : sockAddr.getClass())); //$NON-NLS-1$
        }
        InetSocketAddress inetAddr = (InetSocketAddress) sockAddr;
        port = inetAddr.getPort();
        address = inetAddr.getAddress();
    }
}


text:
# Class Instance
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L41)
This class represents an single instance, a database row. You might see it referred to as both Instance and instance. You should not
instantiate the Instance class directly, instead you access it using the finder and creation methods on the model.

Instance instances operate with the concept of a `dataValues` property, which stores the actual values represented by the instance.
By default, the values from dataValues can also be accessed directly from the Instance, that is:
```js
instance.field
// is the same as
instance.get('field')
// is the same as
instance.getDataValue('field')
```
However, if getters and/or setters are defined for `field` they will be invoked, instead of returning the value from `dataValues`.
Accessing properties directly or using `get` is preferred for regular use, `getDataValue` should only be used for custom getters.

**See:**

* [Sequelize#define](api/sequelize#define)

***

## `isNewRecord` -> `Boolean`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L54)
Returns true if this instance has not yet been persisted to the database

***

## `Model()` -> `Model`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L63)
Returns the Model the instance was created from.

**See:**

* [Model](api/model)

***

## `sequelize()` -> `Sequelize`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L72)
A reference to the sequelize instance

**See:**

* [Sequelize](api/sequelize)

***

## `isDeleted()` -> `Boolean`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L85)
If timestamps and paranoid are enabled, returns whether the deletedAt timestamp of this instance is set. Otherwise, always returns false.

***

## `values()` -> `Object`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L98)
Get the values of this Instance. Proxies to `this.get`
**Deprecated** .values is deprecated. Please use .get() instead.

**See:**

* [Instance#get](api/instance#get)

***

## `isDirty()` -> `Boolean`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L112)
A getter for `this.changed()`. Returns true if any keys have changed.

**See:**

* [Instance#changed](api/instance#changed)

***

## `primaryKeyValues()` -> `Object`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L124)
Get the values of the primary keys of this instance.

***

## `getDataValue(key)` -> `any`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L160)
Get the value of the underlying data value

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| key | String |  |

***

## `setDataValue(key, value)`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L170)
Update the underlying data value

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| key | String |  |
| value | any |  |

***

## `get([key], [options])` -> `Object|any`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L189)
If no key is given, returns all values of the instance, also invoking virtual getters.

If key is given and a field or virtual getter is present for the key it will call that getter - else it will return the value for key.

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [key] | String |  |
| [options] | Object |  |
| [options.plain=false] | Boolean | If set to true, included instances will be returned as plain objects |

***

## `set(key, value, [options])`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L271)
Set is used to update values on the instance (the sequelize representation of the instance that is, remember that nothing will be persisted before you actually call `save`).
In its most basic form `set` will update a value stored in the underlying `dataValues` object. However, if a custom setter function is defined for the key, that function
will be called instead. To bypass the setter, you can pass `raw: true` in the options object.

If set is called with an object, it will loop over the object, and call set recursively for each key, value pair. If you set raw to true, the underlying dataValues will either be
set directly to the object passed, or used to extend dataValues, if dataValues already contain values.

When set is called, the previous value of the field is stored and sets a changed flag(see `changed`).

Set can also be used to build instances for associations, if you have values for those.
When using set with associations you need to make sure the property key matches the alias of the association
while also making sure that the proper include options have been set (from .build() or .find())

If called with a dot.seperated key on a JSON/JSONB attribute it will set the value nested and flag the entire object as changed.

**See:**

* [Model#find](api/model#find)

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| key | String | Object |  |
| value | any |  |
| [options] | Object |  |
| [options.raw=false] | Boolean | If set to true, field and virtual setters will be ignored |
| [options.reset=false] | Boolean | Clear all previously set data values |

__Aliases:__ setAttributes

***

## `changed([key])` -> `Boolean|Array`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L412)
If changed is called with a string it will return a boolean indicating whether the value of that key in `dataValues` is different from the value in `_previousDataValues`.

If changed is called without an argument, it will return an array of keys that have changed.

If changed is called without an argument and no keys have changed, it will return `false`.

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [key] | String |  |

***

## `previous(key)` -> `any`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L433)
Returns the previous value for key from `_previousDataValues`.

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| key | String |  |

***

## `save([options])` -> `Promise.<this|Errors.ValidationError>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L494)
Validate this instance, and if the validation passes, persist it to the database.

On success, the callback will be called with this instance. On validation error, the callback will be called with an instance of `Sequelize.ValidationError`.
This error will have a property for each of the fields for which validation failed, with the error message for that field.

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [options] | Object |  |
| [options.fields] | Object | An optional array of strings, representing database columns. If fields is provided, only those columns will be validated and saved. |
| [options.silent=false] | Boolean | If true, the updatedAt timestamp will not be updated. |
| [options.validate=true] | Boolean | If false, validations won't be run. |
| [options.transaction] | Transaction |  |

***

## `reload([options])` -> `Promise.<this>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L742)
Refresh the current instance in-place, i.e. update the object with current data from the DB and return the same object.
This is different from doing a `find(Instance.id)`, because that would create and return a new instance. With this method,
all references to the Instance are updated with the new data and no new objects are created.

**See:**

* [Model#find](api/model#find)

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [options] | Object | Options that are passed on to `Model.find` |

***

## `validate([options])` -> `Promise.<Errors.ValidationError|undefined>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L769)
Validate the attribute of this instance according to validation rules set in the model definition.

Emits null if and only if validation successful; otherwise an Error instance containing { field name : [error msgs] } entries.

**See:**

* [InstanceValidator](api/instancevalidator)

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [options] | Object | Options that are passed to the validator |
| [options.skip] | Array | An array of strings. All properties that are in this array will not be validated |

***

## `update(updates, options)` -> `Promise.<this>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L788)
This is the same as calling `set` and then calling `save`.

**See:**

* [Instance#set](api/instance#set)
* [Instance#save](api/instance#save)

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| updates | Object | See `set` |
| options | Object | See `save`  |

__Aliases:__ updateAttributes

***

## `destroy([options={}])` -> `Promise.<undefined>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L820)
Destroy the row corresponding to this instance. Depending on your setting for paranoid, the row will either be completely deleted, or have its deletedAt timestamp set to the current time.

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [options={}] | Object |  |
| [options.force=false] | Boolean | If set to true, paranoid models will actually be deleted |
| [options.transaction] | Transaction |  |

***

## `restore([options={}])` -> `Promise.<undefined>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L863)
Restore the row corresponding to this instance. Only available for paranoid models.

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| [options={}] | Object |  |
| [options.transaction] | Transaction |  |

***

## `increment(fields, [options])` -> `Promise.<this>`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L909)
Increment the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The increment is done using a
```sql
SET column = column + X
```
query. To get the correct value after an increment into the Instance you should do a reload.

```js
instance.increment('number') // increment number by 1
instance.increment(['number', 'count'], { by: 2 }) // increment number and count by 2
instance.increment({ answer: 42, tries: 1}, { by: 2 }) // increment answer by 42, and tries by 1.
                                                       // `by` is ignored, since each column has its own value
```

**See:**

* [Instance#reload](api/instance#reload)

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| fields | String | Array | Object | If a string is provided, that column is incremented by the value of `by` given in options. If an array is provided, the same is true for each column. If and object is provided, each column is incremented by the value given. |
| [options] | Object |  |
| [options.by=1] | Integer | The number to increment by |
| [options.transaction] | Transaction |  |

***

## `decrement(fields, [options])` -> `Promise`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L998)
Decrement the value of one or more columns. This is done in the database, which means it does not use the values currently stored on the Instance. The decrement is done using a
```sql
SET column = column - X
```
query. To get the correct value after an decrement into the Instance you should do a reload.

```js
instance.decrement('number') // decrement number by 1
instance.decrement(['number', 'count'], { by: 2 }) // decrement number and count by 2
instance.decrement({ answer: 42, tries: 1}, { by: 2 }) // decrement answer by 42, and tries by 1.
                                                       // `by` is ignored, since each column has its own value
```

**See:**

* [Instance#reload](api/instance#reload)

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| fields | String | Array | Object | If a string is provided, that column is decremented by the value of `by` given in options. If an array is provided, the same is true for each column. If and object is provided, each column is decremented by the value given |
| [options] | Object |  |
| [options.by=1] | Integer | The number to decrement by |
| [options.transaction] | Transaction |  |

***

## `equals(other)` -> `Boolean`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L1034)
Check whether all values of this and `other` Instance are the same

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| other | Instance |  |

***

## `equalsOneOf(others)` -> `Boolean`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L1054)
Check if this is eqaul to one of `others` by calling equals

**Params:**

| Name | Type | Description |
| ---- | ---- | ----------- |
| others | Array |  |

***

## `toJSON()` -> `object`
[View code](https://github.com/sequelize/sequelize/blob/716cb2d2aae3a4cd7fdaace13411cf4161e6deb6/lib/instance.js#L1072)
Convert the instance to a JSON representation. Proxies to calling `get` with no keys. This means get all values gotten from the DB, and apply all custom getters.

**See:**

* [Instance#get](api/instance#get)

***

_This document is automatically generated based on source code comments. Please do not edit it directly, as your changes will be ignored. Please write on IRC, open an issue or a create a pull request if you feel something can be improved. For help on how to write source code documentation see [JSDoc](http://usejsdoc.org) and [dox](https://github.com/tj/dox)_


text:
#ifndef SYNCHRONIZATION_FUTURE_H_INCLUDED
#define SYNCHRONIZATION_FUTURE_H_INCLUDED

#include <vector>
#include <memory>
#include <cassert>

#include "signal.h"

namespace eps {
namespace sync {

template<typename _Type> class transport;
template<typename _Type> class future;
template<typename _Type> class promise;
template<typename _Type> class controller;

template<typename _Type>
struct traits
{
    using transport_type  = transport<_Type>;
    using ptransport_type = std::shared_ptr<transport_type>;

    using container_type  = std::vector<_Type>;
    using pcontainer_type = std::shared_ptr<container_type>;
};

template<typename _Type>
class promise
{
public:

    using container_type = typename traits<_Type>::container_type;

    explicit promise(size_t size)
        : transport_(new typename traits<_Type>::transport_type(size))
    {}

    promise(promise &&) = default;
    promise & operator=(promise &&) = default;
    promise(const promise &) = delete;
    promise & operator=(const promise &) = delete;

    ~promise()
    {
        if(valid())
            transport_->close();
    }

    void send()
    {
        assert(transport_ != nullptr);
        transport_->send();
    }

    bool valid() const
    {
        return transport_ && !transport_->closed();
    }

    container_type & input()
    {
        assert(transport_ != nullptr);
        return transport_->input();
    }

    future<_Type> get_future() const
    {
        return future<_Type>(transport_);
    }

    controller<_Type> get_controller() const
    {
        return controller<_Type>(transport_);
    }

private:

    typename traits<_Type>::ptransport_type transport_;
};

template<typename _Type>
class controller
{
public:

    using container_type = typename traits<_Type>::container_type;

    controller() = default;
    controller(controller &&) = default;
    controller & operator=(controller &&) = default;
    controller(const controller &) = delete;
    controller & operator=(const controller &) = delete;

    explicit controller(typename traits<_Type>::ptransport_type transport)
        : transport_(transport)
    {}

    bool valid() const
    {
        return transport_ && !transport_->closed();
    }

    void close()
    {
        assert(transport_ != nullptr);
        transport_->close();
    }

private:

    typename traits<_Type>::ptransport_type transport_;
};

template<typename _Type>
class future
{
public:

    using container_type = typename traits<_Type>::container_type;

    future() = default;
    future(future &&) = default;
    future & operator=(future &&) = default;
    future(const future &) = delete;
    future & operator=(const future &) = delete;

    ~future()
    {
        if(valid())
            transport_->close();
    }

    explicit future(typename traits<_Type>::ptransport_type transport)
        : transport_(transport)
    {}

    void wait()
    {
        assert(transport_ != nullptr);
        transport_->wait();
    }

    template<typename _Perf>
    void wait(_Perf perf)
    {
        assert(transport_ != nullptr);
        transport_->wait(perf);
    }

    bool valid() const
    {
        return transport_ && !transport_->closed();
    }

    const container_type & output() const
    {
        assert(transport_ != nullptr);
        return transport_->output();
    }

private:

    typename traits<_Type>::ptransport_type transport_;
};

template<typename _Type>
class transport
{
public:

    using container_type = typename traits<_Type>::container_type;

    explicit transport(size_t size)
        : input_(size)
        , output_(size)
    {}

    transport(transport &&) = default;
    transport & operator=(transport &&) = default;
    transport(const transport &) = delete;
    transport & operator=(const transport &) = delete;

    void send()
    {
        customer_.send([this]()
        {
            std::swap(input_, output_);
        });
    }

    template<typename _Perf>
    void wait(_Perf perf)
    {
        customer_.recv(perf);
    }

    void wait()
    {
        customer_.recv();
    }

    void close()
    {
        customer_.close();
    }

    bool closed() const
    {
        return customer_.closed();
    }

    container_type & input() { return input_; }
    const container_type & output() const { return output_; }

private:

    signal customer_;

    typename traits<_Type>::container_type input_;
    typename traits<_Type>::container_type output_;
};

} /* sync */
} /* eps */

#endif // SYNCHRONIZATION_FUTURE_H_INCLUDED


text:
package org.displaytag.properties;

import org.displaytag.test.DisplaytagCase;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
import com.meterware.httpunit.WebTable;

/**
 * Tests for "titlekey" column attribute.
 *
 * @author Fabrizio Giustina
 *
 * @version $Revision$ ($Author$)
 */
class TitleKeyJstlFmtBundleTest extends DisplaytagCase {

    /**
     * Gets the jsp name.
     *
     * @return the jsp name
     *
     * @see org.displaytag.test.DisplaytagCase#getJspName()
     */
    @Override
    public String getJspName() {
        return "titlekeyfmtbundle.jsp";
    }

    /**
     * Test that headers are correctly removed.
     *
     * @throws Exception
     *             any exception thrown during test.
     */
    @Override
    @Test
    public void doTest() throws Exception {
        // test keep
        final WebRequest request = new GetMethodWebRequest(this.getJspUrl(this.getJspName()));

        final WebResponse response = this.runner.getResponse(request);

        if (this.log.isDebugEnabled()) {
            this.log.debug(response.getText());
        }

        final WebTable[] tables = response.getTables();
        Assertions.assertEquals(1, tables.length, "Expected one table");

        Assertions.assertEquals("foo bundle", tables[0].getCellAsText(0, 0), "Header from resource is not valid.");
        Assertions.assertEquals("baz bundle", tables[0].getCellAsText(0, 1), "Header from resource is not valid.");
        Assertions.assertEquals("camel bundle", tables[0].getCellAsText(0, 2), "Header from resource is not valid.");
        Assertions.assertEquals("???missing???", tables[0].getCellAsText(0, 3),
            "Missing resource should generate the ???missing??? header.");

    }
}


text:
package ini

import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"regexp"
	"runtime"
)

const (
	// Name for default section. You can use this constant or the string literal.
	// In most of cases, an empty string is all you need to access the section.
	DEFAULT_SECTION = "DEFAULT"

	// Maximum allowed depth when recursively substituing variable names.
	_DEPTH_VALUES = 99
	_VERSION      = "1.37.0"
)

// Version returns current package version literal.
func Version() string {
	return _VERSION
}

var (
	// Delimiter to determine or compose a new line.
	// This variable will be changed to "\r\n" automatically on Windows
	// at package init time.
	LineBreak = "\n"

	// Variable regexp pattern: %(variable)s
	varPattern = regexp.MustCompile(`%\(([^\)]+)\)s`)

	// Indicate whether to align "=" sign with spaces to produce pretty output
	// or reduce all possible spaces for compact format.
	PrettyFormat = true

	// Place spaces around "=" sign even when PrettyFormat is false
	PrettyEqual = false

	// Explicitly write DEFAULT section header
	DefaultHeader = false

	// Indicate whether to put a line between sections
	PrettySection = true
)

func init() {
	if runtime.GOOS == "windows" {
		LineBreak = "\r\n"
	}
}

func inSlice(str string, s []string) bool {
	for _, v := range s {
		if str == v {
			return true
		}
	}
	return false
}

// dataSource is an interface that returns object which can be read and closed.
type dataSource interface {
	ReadCloser() (io.ReadCloser, error)
}

// sourceFile represents an object that contains content on the local file system.
type sourceFile struct {
	name string
}

func (s sourceFile) ReadCloser() (_ io.ReadCloser, err error) {
	return os.Open(s.name)
}

// sourceData represents an object that contains content in memory.
type sourceData struct {
	data []byte
}

func (s *sourceData) ReadCloser() (io.ReadCloser, error) {
	return ioutil.NopCloser(bytes.NewReader(s.data)), nil
}

// sourceReadCloser represents an input stream with Close method.
type sourceReadCloser struct {
	reader io.ReadCloser
}

func (s *sourceReadCloser) ReadCloser() (io.ReadCloser, error) {
	return s.reader, nil
}

func parseDataSource(source interface{}) (dataSource, error) {
	switch s := source.(type) {
	case string:
		return sourceFile{s}, nil
	case []byte:
		return &sourceData{s}, nil
	case io.ReadCloser:
		return &sourceReadCloser{s}, nil
	default:
		return nil, fmt.Errorf("error parsing data source: unknown type '%s'", s)
	}
}

type LoadOptions struct {
	// Loose indicates whether the parser should ignore nonexistent files or return error.
	Loose bool
	// Insensitive indicates whether the parser forces all section and key names to lowercase.
	Insensitive bool
	// IgnoreContinuation indicates whether to ignore continuation lines while parsing.
	IgnoreContinuation bool
	// IgnoreInlineComment indicates whether to ignore comments at the end of value and treat it as part of value.
	IgnoreInlineComment bool
	// AllowBooleanKeys indicates whether to allow boolean type keys or treat as value is missing.
	// This type of keys are mostly used in my.cnf.
	AllowBooleanKeys bool
	// AllowShadows indicates whether to keep track of keys with same name under same section.
	AllowShadows bool
	// AllowNestedValues indicates whether to allow AWS-like nested values.
	// Docs: http://docs.aws.amazon.com/cli/latest/topic/config-vars.html#nested-values
	AllowNestedValues bool
	// AllowPythonMultilineValues indicates whether to allow Python-like multi-line values.
	// Docs: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure
	// Relevant quote:  Values can also span multiple lines, as long as they are indented deeper
	// than the first line of the value.
	AllowPythonMultilineValues bool
	// SpaceBeforeInlineComment indicates whether to allow comment symbols (\# and \;) inside value.
	// Docs: https://docs.python.org/2/library/configparser.html
	// Quote: Comments may appear on their own in an otherwise empty line, or may be entered in lines holding values or section names.
	// In the latter case, they need to be preceded by a whitespace character to be recognized as a comment.
	SpaceBeforeInlineComment bool
	// UnescapeValueDoubleQuotes indicates whether to unescape double quotes inside value to regular format
	// when value is surrounded by double quotes, e.g. key="a \"value\"" => key=a "value"
	UnescapeValueDoubleQuotes bool
	// UnescapeValueCommentSymbols indicates to unescape comment symbols (\# and \;) inside value to regular format
	// when value is NOT surrounded by any quotes.
	// Note: UNSTABLE, behavior might change to only unescape inside double quotes but may noy necessary at all.
	UnescapeValueCommentSymbols bool
	// Some INI formats allow group blocks that store a block of raw content that doesn't otherwise
	// conform to key/value pairs. Specify the names of those blocks here.
	UnparseableSections []string
}

func LoadSources(opts LoadOptions, source interface{}, others ...interface{}) (_ *File, err error) {
	sources := make([]dataSource, len(others)+1)
	sources[0], err = parseDataSource(source)
	if err != nil {
		return nil, err
	}
	for i := range others {
		sources[i+1], err = parseDataSource(others[i])
		if err != nil {
			return nil, err
		}
	}
	f := newFile(sources, opts)
	if err = f.Reload(); err != nil {
		return nil, err
	}
	return f, nil
}

// Load loads and parses from INI data sources.
// Arguments can be mixed of file name with string type, or raw data in []byte.
// It will return error if list contains nonexistent files.
func Load(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{}, source, others...)
}

// LooseLoad has exactly same functionality as Load function
// except it ignores nonexistent files instead of returning error.
func LooseLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{Loose: true}, source, others...)
}

// InsensitiveLoad has exactly same functionality as Load function
// except it forces all section and key names to be lowercased.
func InsensitiveLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{Insensitive: true}, source, others...)
}

// InsensitiveLoad has exactly same functionality as Load function
// except it allows have shadow keys.
func ShadowLoad(source interface{}, others ...interface{}) (*File, error) {
	return LoadSources(LoadOptions{AllowShadows: true}, source, others...)
}


text:
/*
    The interface/functionality for the UI.
    Add functionality here, don't implement.
    Try work with CSS/HTML/ect mostly here.

    Templates, timers, popup, queue

    TODO
    -Fix bugs with queue UI getting out of sync
*/

var UI = {
    timeout:null,
    queueInterval:null,      //for clearing intervals on global queue timer

    /*
        The HTML templates to be reused in the site.
    */
    T : {
        getTemplates : function(){
                //must wait for document to download or can cause errors
                $(document).ready(function(){
                    UI.T.popup = $('#popupTemplate').html();
                    UI.T.nameTemplate = $('#nameTemplate').html();
                });
            }
        },
    /* displays standard popup message. */
    /*
    @option error - displays error type popup - bool
    @option announcment - displays announcemet type popup - bool
    @option millis - ms for popup to display.  default forever - number
    @option clone - indicate to make a separate popup,
                    rather than replace the current one. Not tested. - bool
    */
    popup: function(title, message, options){
        options = options || {};
        clearTimeout(UI.timeout);
        var popup = $('#popupSpace');
        if(options.clone){
            popup = popup.clone();
            $('#'+options.id).remove();
            popup.attr('id',options.id);
            popup.toggleClass('level5 level4');
            $('body').append(popup);
        }
        popup.html(this.T.popup);
        popup.find('.popupTitle').html(title);
        popup.find('.popupMessage').html(message);
        if (options.error) popup.find('.popupTitle').css('color', 'red');
        if (options.announcement) popup.find('.popupTitle').css('color', '#8d8cff');
        popup.show('fast');
        if (options.pin) {
            var ele =  $(options.pin.element);
            var pos = ele.position();
            popup.css('position', 'absolute');
            popup.css('right', $(window).width()-(pos.left*5/4)).css('left', 'inherit');
            popup.css('top', pos.top);
            console.log('pnned popup at  ', pos);
        }
        if(options.millis!=undefined) this.timeout = setTimeout(function(){popup.hide('fast')},options.millis);
    },
    /*
        Display the big timer for when user is in command.

        millis - millisecond duration for countdown - number
    */
    timer: function(millis){
        var secs = Math.floor(millis/1000);
        $('#time').html(secs);
        var interval = setInterval(function(){
            secs = parseInt($('#time').text());
            secs--;
            if (secs<0) {
                clearInterval(interval);
                secs='';
            }
            $('#time').html(secs);
        },1000);
    },

    /*
        Adds html data from server to queue table.
        Handles the 'empty' message, unique ID's
        update ID's based on changing position.
        starts timer in queue table.

        Slightly buggy.

        html - string from server that is html for table entry
        position - number to specify position in queue, default 1.
    */
    addQueue: function(html, position){
        position = position || 1;
        if (html) $('#noQ').remove();
        if (position == 1 && $('#pos1').length && html) {
            $('#pos1').remove();
        }
        $('#queue').find('tbody').append(html);
        if (position==1 && $('#pos1').length) {
            $('#pos1').addClass('success');
            var time = $('#pos1').find('td.timer');
            var secs = parseInt(time.text());
            UI.queueInterval = setInterval(function(){
                secs = parseInt(time.text()) - 1;
                if (secs<0) {
                    clearInterval(UI.queueInterval);
                    secs='';
                }
                time.html(secs);
            },1000);
        }
    },

    /*
     Remove client in queue from queue table,
     stop timer if needed.

     position - number to specify which position to remove, default 1
    */
    removeQueue: function(position){
        position = position || 1;
        $('#pos'+position).remove();
        clearInterval(this.queueInterval);
        if ($('tr.queueMember').length){
            $('.queueMember').each(function(){
                var newPos = parseInt(this.id.replace('pos',''))-1;
                $(this).find('td.pos').html(newPos);
                if (newPos>=position) {
                    $(this).attr('id', 'pos'+newPos);
                }
            });
        }else this.noQueue();
        this.addQueue(); //call it with no args to set first css class (the green table entry) and timer
    },

    /* show queue is empty message. */
    noQueue: function(){
        console.log('No queue');
        var noQ = '
Empty
'
        $('tr.queueMember').remove();
        this.addQueue(noQ);
    },

    /*
        For updating time remaining with true value from server.
        For when client/server time values get out of sync.
    */
    syncTime: function(millis){
        var secs = Math.floor(millis/1000);
        $('#pos1').find('td.timer').html(secs);
        if (Command.inCommand) {
            $('#timer').html(secs);
        }
    },

    showGPS: function(){

    },
    //Creates map with layer and
    //sets rover and home markers
    createMap: function(){
        try {
        if (!L) {return;}
        } catch(e) {
            return;
        }
        UI.map = L.map('map',{
            center: Settings.home,
            zoom: 17,
            zoomControl:false
        });
        L.mapbox.tileLayer('examples.map-y7l23tes').addTo(UI.map);
        UI.map.addControl(new L.Control.Zoom({ position: 'topright' }));
        UI.marker = L.marker(Settings.home);
        UI.homeMarker = L.marker(Settings.home);
        UI.marker.setIcon(L.icon({
                iconUrl:'/images/marker.png',
                iconAnchor:[15, 35],
                popupAnchor:[0, -35],
            }));
        UI.homeMarker.setIcon(L.icon({
                iconUrl:'/images/homeMarker.png',
                iconAnchor:[15, 35],
                popupAnchor:[0, -35],
            }));
        UI.marker.addTo(UI.map);
        UI.homeMarker.addTo(UI.map);
        UI.marker.bindPopup('
The rover
').openPopup();
        UI.homeMarker.bindPopup('
Rover home point
');
        //UI.marker.setLatLng();
    }
};
//get templates.
UI.T.getTemplates();


text:
require "ruboty/wareki/actions/convert"
require "ruboty/wareki/actions/convert_after"

module Ruboty
  module Handlers
    class Wareki < Base
      on /wareki convert (?<year>\d{4})\z/, name: 'convert', description: 'get wareki from AD. ※1月1日時点の元号'
      on /wareki convert_after (?<year>\d{4})\z/, name: 'convert_after', description: 'get wareki from AD. ※12月31日時点の元号'

      def convert(message)
        Ruboty::Wareki::Actions::Convert.new(message).call
      end

      def convert_after(message)
        Ruboty::Wareki::Actions::ConvertAfter.new(message).call
      end
    end
  end
end


text:
package com.epam.training.gamingassistant.auth;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.util.Log;

import org.json.JSONException;
import org.json.JSONObject;

public class GoogleOAuthHelper {
    private static String CLIENT_ID = "42965839176-fnbm1lbt42e2dofu5em2ui9otve1lfgl.apps.googleusercontent.com";
    private static String REDIRECT_URI = "http://localhost";
    private static String OAUTH_URL = "https://accounts.google.com/o/oauth2/auth";
    private static String OAUTH_SCOPE = "https://www.googleapis.com/auth/plus.login";
    public static String AUTORIZATION_URL = OAUTH_URL + "?redirect_uri=" + REDIRECT_URI + "&response_type=code&client_id=" + CLIENT_ID + "&scope=" + OAUTH_SCOPE;
    private static String GRANT_TYPE = "authorization_code";
    private static String TOKEN_URL = "https://accounts.google.com/o/oauth2/token";
    private static String CLIENT_SECRET = "UWbrpUz0TG9jtDoZUlTjvM6Z";
    private static String CODE;
    private static JSONObject temp;
    private boolean authComplete = false;
    private static Intent resultIntent = new Intent();
    private String authCode;
    private static Activity act;

    public static boolean proceedRedirectURL(Activity activity, String url) {
        act = activity;
        boolean authComplete = false;
        Intent resultIntent = new Intent();
        String authCode;
        if (url.contains("?code=") && authComplete != true) {
            Uri uri = Uri.parse(url);
            authCode = uri.getQueryParameter("code");
            CODE = authCode;
            Log.i("", "CODE : " + authCode);

            authComplete = true;

            new TokenGet().execute();

            return true;

        } else if (url.contains("error=access_denied")) {
            Log.i("", "ACCESS_DENIED_HERE");
            resultIntent.putExtra("token", "Acces Denied");
            authComplete = true;
            activity.setResult(Activity.RESULT_OK, resultIntent);
            activity.finish();

        }
        return false;
    }

    public static void sendResult() throws JSONException {

        resultIntent.putExtra("token", temp.getString("access_token"));
        resultIntent.putExtra("expires", temp.getString("expires_in"));
        resultIntent.putExtra("refresh", temp.getString("refresh_token"));
        act.setResult(Activity.RESULT_OK, resultIntent);
        act.finish();
    }

    private static class TokenGet extends AsyncTask<String, String, JSONObject> {

        String Code;

        @Override
        protected void onPreExecute() {
            super.onPreExecute();

        }

        @Override
        protected JSONObject doInBackground(String... args) {
            GoogleOAuthGetAccessToken jParser = new GoogleOAuthGetAccessToken();
            JSONObject json = jParser.gettoken(TOKEN_URL, CODE, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, GRANT_TYPE);
            return json;
        }

        @Override
        protected void onPostExecute(JSONObject json) {

            if (json != null) {
                try {
                    temp = json;
                    sendResult();

                } catch (JSONException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            } else {
                Log.d("Error", "NetworkError");

            }
        }
    }

}


text:
package simplehttp

import (
	"encoding/json"
	"net/http"
)

func GetJSONInput(r *http.Request, w http.ResponseWriter, v interface{}) (err error) {
	decoder := json.NewDecoder(r.Body)
	err = decoder.Decode(v)
	if err != nil {
		http.Error(w, "Bad request.", http.StatusBadRequest)
		return err
	}

	return nil
}

func OutputJSON(w http.ResponseWriter, v interface{}) (err error) {
	var data []byte
	data, err = json.Marshal(v)
	if err != nil {
		http.Error(w, "Internal error.", http.StatusInternalServerError)
		return err
	}

	w.Header().Add("Content-Type", "application/json")
	_, err = w.Write(data)

	return nil
}


text:
package org.projectfloodlight.openflow.types;

import com.google.common.hash.PrimitiveSink;

public interface PrimitiveSinkable {
    public void putTo(PrimitiveSink sink);
}