text:
package com.linkedin.pinot.core.indexsegment;

import com.linkedin.pinot.common.segment.SegmentMetadata;
import com.linkedin.pinot.core.common.DataSource;

/**
 * This is the interface of index segment. The index type of index segment
 * should be one of the supported {@link com.linkedin.pinot.core.indexsegment.IndexType
 * IndexType}.
 *
 *
 */
public interface IndexSegment {
  /**
   * @return
   */
  public IndexType getIndexType();

  /**
   * @return
   */
  public String getSegmentName();

  /**
   * @return
   */
  public String getAssociatedDirectory();

  /**
   * @return SegmentMetadata
   */
  public SegmentMetadata getSegmentMetadata();

  /**
   *
   * @param columnName
   * @return
   */
  DataSource getDataSource(String columnName);

  /**
   * @return
   */
  String[] getColumnNames();

  /**
   * Destroy segment in memory and close file handler if in memory mapped mode
   */
  public void destroy();

  /**
   * Total number of records inside the segment.
   * @return
   */
  public int getTotalDocs();
}


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EmbASP-Java v7.1.0: it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

EmbASP-Java v7.1.0

it

unical

mat

embasp

specializations

dlv

desktop

DLVDesktopService

Public Member Functions |
Protected Member Functions |
List of all members

it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService Class Reference

Inheritance diagram for it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService:

  <map id="it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService_map" name="it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService_map">
<area href="classit_1_1unical_1_1mat_1_1embasp_1_1platforms_1_1desktop_1_1DesktopService.html" alt="it.unical.mat.embasp.platforms.desktop.DesktopService" shape="rect" coords="0,56,398,80"/>
<area href="interfaceit_1_1unical_1_1mat_1_1embasp_1_1base_1_1Service.html" alt="it.unical.mat.embasp.base.Service" shape="rect" coords="0,0,398,24"/>
  </map>

Public Member Functions

 	DLVDesktopService (final String exe_path)

 Public Member Functions inherited from it.unical.mat.embasp.platforms.desktop.DesktopService

 	DesktopService (final String exe_path)

String 	getExePath ()

void 	setExePath (final String exe_path)

void 	startAsync (final Callback callback, final List< InputProgram > programs, final List< OptionDescriptor > options)

Output 	startSync (final List< InputProgram > programs, final List< OptionDescriptor > options)

Protected Member Functions

Output 	getOutput (final String output, final String error)

Additional Inherited Members

 Protected Attributes inherited from it.unical.mat.embasp.platforms.desktop.DesktopService

String 	exe_path

String 	load_from_STDIN_option

Detailed Description

DLV Solver for Desktop platforms

Constructor & Destructor Documentation

◆ DLVDesktopService()

          it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService.DLVDesktopService
          (
          final String
          exe_path	)

inline

Member Function Documentation

◆ getOutput()

          Output it.unical.mat.embasp.specializations.dlv.desktop.DLVDesktopService.getOutput
          (
          final String
          output,

          final String
          error

          )

inlineprotected

Reimplemented from it.unical.mat.embasp.platforms.desktop.DesktopService.

The documentation for this class was generated from the following file:

embasp-java/app/src/main/java/it/unical/mat/embasp/specializations/dlv/desktop/DLVDesktopService.java

<address class="footer">
Generated by  1.9.0
</address>

redpajama_set_name: RedPajamaGithub


text:
package org.apache.uima.collection.base_cpm;

import org.apache.uima.cas_data.CasData;
import org.apache.uima.resource.ResourceProcessException;

/**
 * Interface for CAS processors that want to interact directly with the {@link CasData}. This works
 * best for simple processors that do not need the indexing or strong typing features provided by
 * the CAS container.
 */
public interface CasDataProcessor extends CasProcessor {
  /**
   * Process a single CasData.
   *
   * @param aCAS
   *          the input CasData
   *
   * @return the output CasData (if this CAS processor is {@link #isReadOnly() read-only}, this will
   *         always be equivalent to aCAS.
   *
   * @throws ResourceProcessException
   *           if processing fails
   */
  CasData process(CasData aCAS) throws ResourceProcessException;

  /**
   * Process multiple CasData objects.
   *
   * @param aCASes
   *          the input CasData objects
   *
   * @return the output CasData objects (if this CAS processor is {@link #isReadOnly() read-only},
   *         these will always be equivalent to aCASes.
   *
   * @throws ResourceProcessException
   *           if processing fails
   */
  CasData[] process(CasData[] aCASes) throws ResourceProcessException;
}


text:
const fs = require("fs")

module.exports = {
    read: function (message, bot) {

        let wm = message.content.toUpperCase();

        let command = wm.split(" ")[0];

        let args = wm.split(" ").slice(1);

        if (command != "!READ") {
            return;
        }

        const serverXD = "235968545756938240";

        const userTWNBAA = "340002869912666114";

        if (message.author.id != userTWNBAA || message.guild.id != serverXD) {
            if (message.author.id != userTWNBAA) {
                message.reply("Only Void can run this Command");
            } else {
                message.reply("This command can not yet be run on this server");
            }
            return;
        }

        fs.readFile('./save.txt', 'utf8', function (err, data) {
            if (err) {
                return console.log(err);
            }

            var object = JSON.parse(data);

            var send = "__Messages Sent__\n";

            for (var key in object) {
                message.guild.members.forEach(function (person) {
                    if (person.user.username == key) {
                        person.user.messagesSent = object[key]
                    }
                });
                send += "`" + key + "`: `" + object[key] + "`\n"
            }

            message.channel.send(send);

        });

    }

};


text:
import Ember from 'ember';
import { emberAjaxRequest } from 'ember-appbase/utils/ajax-request';

export default Ember.Object.extend({
  userService: Ember.inject.service(),
  open(credentials) {
    return emberAjaxRequest('POST', this.get('userService.loginUrl'), credentials);
  }
});


text:
using Core.Events.External;

namespace Core.Testing;

public class DummyExternalEventConsumer: IExternalEventConsumer
{
    public Task StartAsync(CancellationToken cancellationToken)
    {
        return Task.CompletedTask;
    }
}


text: onCallSummary(summary) { console.log(JSON.stringify(summary)); }


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="me.pkliang.gankmaku">

  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

  <application
      android:name=".application.App"
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme">
    <activity
        android:name=".main.MainActivity"
        android:label="@string/app_name">
    </activity>
    <activity
        android:name=".main.NavigationActivity"
        android:label="@string/title_activity_navigation">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>

        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>

    </activity>

    <meta-data
        android:name="com.bumptech.glide.integration.okhttp.OkHttpGlideModule"
        android:value="GlideModule"/>
  </application>

</manifest>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jsh.erp.datasource.mappers.DepotItemMapper">
  <resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.DepotItem">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="header_id" jdbcType="BIGINT" property="headerId" />
    <result column="material_id" jdbcType="BIGINT" property="materialId" />
    <result column="material_extend_id" jdbcType="BIGINT" property="materialExtendId" />
    <result column="material_unit" jdbcType="VARCHAR" property="materialUnit" />
    <result column="sku" jdbcType="VARCHAR" property="sku" />
    <result column="oper_number" jdbcType="DECIMAL" property="operNumber" />
    <result column="basic_number" jdbcType="DECIMAL" property="basicNumber" />
    <result column="unit_price" jdbcType="DECIMAL" property="unitPrice" />
    <result column="tax_unit_price" jdbcType="DECIMAL" property="taxUnitPrice" />
    <result column="all_price" jdbcType="DECIMAL" property="allPrice" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="depot_id" jdbcType="BIGINT" property="depotId" />
    <result column="another_depot_id" jdbcType="BIGINT" property="anotherDepotId" />
    <result column="tax_rate" jdbcType="DECIMAL" property="taxRate" />
    <result column="tax_money" jdbcType="DECIMAL" property="taxMoney" />
    <result column="tax_last_money" jdbcType="DECIMAL" property="taxLastMoney" />
    <result column="material_type" jdbcType="VARCHAR" property="materialType" />
    <result column="sn_list" jdbcType="VARCHAR" property="snList" />
    <result column="batch_number" jdbcType="VARCHAR" property="batchNumber" />
    <result column="expiration_date" jdbcType="TIMESTAMP" property="expirationDate" />
    <result column="link_id" jdbcType="BIGINT" property="linkId" />
    <result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
    <result column="delete_flag" jdbcType="VARCHAR" property="deleteFlag" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    id, header_id, material_id, material_extend_id, material_unit, sku, oper_number,
    basic_number, unit_price, tax_unit_price, all_price, remark, depot_id, another_depot_id,
    tax_rate, tax_money, tax_last_money, material_type, sn_list, batch_number, expiration_date,
    link_id, tenant_id, delete_flag
  </sql>
  <select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from jsh_depot_item
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from jsh_depot_item
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from jsh_depot_item
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample">
    delete from jsh_depot_item
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    insert into jsh_depot_item (id, header_id, material_id,
      material_extend_id, material_unit, sku,
      oper_number, basic_number, unit_price,
      tax_unit_price, all_price, remark,
      depot_id, another_depot_id, tax_rate,
      tax_money, tax_last_money, material_type,
      sn_list, batch_number, expiration_date,
      link_id, tenant_id, delete_flag
      )
    values (#{id,jdbcType=BIGINT}, #{headerId,jdbcType=BIGINT}, #{materialId,jdbcType=BIGINT},
      #{materialExtendId,jdbcType=BIGINT}, #{materialUnit,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR},
      #{operNumber,jdbcType=DECIMAL}, #{basicNumber,jdbcType=DECIMAL}, #{unitPrice,jdbcType=DECIMAL},
      #{taxUnitPrice,jdbcType=DECIMAL}, #{allPrice,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR},
      #{depotId,jdbcType=BIGINT}, #{anotherDepotId,jdbcType=BIGINT}, #{taxRate,jdbcType=DECIMAL},
      #{taxMoney,jdbcType=DECIMAL}, #{taxLastMoney,jdbcType=DECIMAL}, #{materialType,jdbcType=VARCHAR},
      #{snList,jdbcType=VARCHAR}, #{batchNumber,jdbcType=VARCHAR}, #{expirationDate,jdbcType=TIMESTAMP},
      #{linkId,jdbcType=BIGINT}, #{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    insert into jsh_depot_item
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="headerId != null">
        header_id,
      </if>
      <if test="materialId != null">
        material_id,
      </if>
      <if test="materialExtendId != null">
        material_extend_id,
      </if>
      <if test="materialUnit != null">
        material_unit,
      </if>
      <if test="sku != null">
        sku,
      </if>
      <if test="operNumber != null">
        oper_number,
      </if>
      <if test="basicNumber != null">
        basic_number,
      </if>
      <if test="unitPrice != null">
        unit_price,
      </if>
      <if test="taxUnitPrice != null">
        tax_unit_price,
      </if>
      <if test="allPrice != null">
        all_price,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="depotId != null">
        depot_id,
      </if>
      <if test="anotherDepotId != null">
        another_depot_id,
      </if>
      <if test="taxRate != null">
        tax_rate,
      </if>
      <if test="taxMoney != null">
        tax_money,
      </if>
      <if test="taxLastMoney != null">
        tax_last_money,
      </if>
      <if test="materialType != null">
        material_type,
      </if>
      <if test="snList != null">
        sn_list,
      </if>
      <if test="batchNumber != null">
        batch_number,
      </if>
      <if test="expirationDate != null">
        expiration_date,
      </if>
      <if test="linkId != null">
        link_id,
      </if>
      <if test="tenantId != null">
        tenant_id,
      </if>
      <if test="deleteFlag != null">
        delete_flag,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="headerId != null">
        #{headerId,jdbcType=BIGINT},
      </if>
      <if test="materialId != null">
        #{materialId,jdbcType=BIGINT},
      </if>
      <if test="materialExtendId != null">
        #{materialExtendId,jdbcType=BIGINT},
      </if>
      <if test="materialUnit != null">
        #{materialUnit,jdbcType=VARCHAR},
      </if>
      <if test="sku != null">
        #{sku,jdbcType=VARCHAR},
      </if>
      <if test="operNumber != null">
        #{operNumber,jdbcType=DECIMAL},
      </if>
      <if test="basicNumber != null">
        #{basicNumber,jdbcType=DECIMAL},
      </if>
      <if test="unitPrice != null">
        #{unitPrice,jdbcType=DECIMAL},
      </if>
      <if test="taxUnitPrice != null">
        #{taxUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="allPrice != null">
        #{allPrice,jdbcType=DECIMAL},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="depotId != null">
        #{depotId,jdbcType=BIGINT},
      </if>
      <if test="anotherDepotId != null">
        #{anotherDepotId,jdbcType=BIGINT},
      </if>
      <if test="taxRate != null">
        #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="taxMoney != null">
        #{taxMoney,jdbcType=DECIMAL},
      </if>
      <if test="taxLastMoney != null">
        #{taxLastMoney,jdbcType=DECIMAL},
      </if>
      <if test="materialType != null">
        #{materialType,jdbcType=VARCHAR},
      </if>
      <if test="snList != null">
        #{snList,jdbcType=VARCHAR},
      </if>
      <if test="batchNumber != null">
        #{batchNumber,jdbcType=VARCHAR},
      </if>
      <if test="expirationDate != null">
        #{expirationDate,jdbcType=TIMESTAMP},
      </if>
      <if test="linkId != null">
        #{linkId,jdbcType=BIGINT},
      </if>
      <if test="tenantId != null">
        #{tenantId,jdbcType=BIGINT},
      </if>
      <if test="deleteFlag != null">
        #{deleteFlag,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotItemExample" resultType="java.lang.Long">
    select count(*) from jsh_depot_item
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update jsh_depot_item
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.headerId != null">
        header_id = #{record.headerId,jdbcType=BIGINT},
      </if>
      <if test="record.materialId != null">
        material_id = #{record.materialId,jdbcType=BIGINT},
      </if>
      <if test="record.materialExtendId != null">
        material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
      </if>
      <if test="record.materialUnit != null">
        material_unit = #{record.materialUnit,jdbcType=VARCHAR},
      </if>
      <if test="record.sku != null">
        sku = #{record.sku,jdbcType=VARCHAR},
      </if>
      <if test="record.operNumber != null">
        oper_number = #{record.operNumber,jdbcType=DECIMAL},
      </if>
      <if test="record.basicNumber != null">
        basic_number = #{record.basicNumber,jdbcType=DECIMAL},
      </if>
      <if test="record.unitPrice != null">
        unit_price = #{record.unitPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.taxUnitPrice != null">
        tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.allPrice != null">
        all_price = #{record.allPrice,jdbcType=DECIMAL},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.depotId != null">
        depot_id = #{record.depotId,jdbcType=BIGINT},
      </if>
      <if test="record.anotherDepotId != null">
        another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
      </if>
      <if test="record.taxRate != null">
        tax_rate = #{record.taxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.taxMoney != null">
        tax_money = #{record.taxMoney,jdbcType=DECIMAL},
      </if>
      <if test="record.taxLastMoney != null">
        tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
      </if>
      <if test="record.materialType != null">
        material_type = #{record.materialType,jdbcType=VARCHAR},
      </if>
      <if test="record.snList != null">
        sn_list = #{record.snList,jdbcType=VARCHAR},
      </if>
      <if test="record.batchNumber != null">
        batch_number = #{record.batchNumber,jdbcType=VARCHAR},
      </if>
      <if test="record.expirationDate != null">
        expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.linkId != null">
        link_id = #{record.linkId,jdbcType=BIGINT},
      </if>
      <if test="record.tenantId != null">
        tenant_id = #{record.tenantId,jdbcType=BIGINT},
      </if>
      <if test="record.deleteFlag != null">
        delete_flag = #{record.deleteFlag,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update jsh_depot_item
    set id = #{record.id,jdbcType=BIGINT},
      header_id = #{record.headerId,jdbcType=BIGINT},
      material_id = #{record.materialId,jdbcType=BIGINT},
      material_extend_id = #{record.materialExtendId,jdbcType=BIGINT},
      material_unit = #{record.materialUnit,jdbcType=VARCHAR},
      sku = #{record.sku,jdbcType=VARCHAR},
      oper_number = #{record.operNumber,jdbcType=DECIMAL},
      basic_number = #{record.basicNumber,jdbcType=DECIMAL},
      unit_price = #{record.unitPrice,jdbcType=DECIMAL},
      tax_unit_price = #{record.taxUnitPrice,jdbcType=DECIMAL},
      all_price = #{record.allPrice,jdbcType=DECIMAL},
      remark = #{record.remark,jdbcType=VARCHAR},
      depot_id = #{record.depotId,jdbcType=BIGINT},
      another_depot_id = #{record.anotherDepotId,jdbcType=BIGINT},
      tax_rate = #{record.taxRate,jdbcType=DECIMAL},
      tax_money = #{record.taxMoney,jdbcType=DECIMAL},
      tax_last_money = #{record.taxLastMoney,jdbcType=DECIMAL},
      material_type = #{record.materialType,jdbcType=VARCHAR},
      sn_list = #{record.snList,jdbcType=VARCHAR},
      batch_number = #{record.batchNumber,jdbcType=VARCHAR},
      expiration_date = #{record.expirationDate,jdbcType=TIMESTAMP},
      link_id = #{record.linkId,jdbcType=BIGINT},
      tenant_id = #{record.tenantId,jdbcType=BIGINT},
      delete_flag = #{record.deleteFlag,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    update jsh_depot_item
    <set>
      <if test="headerId != null">
        header_id = #{headerId,jdbcType=BIGINT},
      </if>
      <if test="materialId != null">
        material_id = #{materialId,jdbcType=BIGINT},
      </if>
      <if test="materialExtendId != null">
        material_extend_id = #{materialExtendId,jdbcType=BIGINT},
      </if>
      <if test="materialUnit != null">
        material_unit = #{materialUnit,jdbcType=VARCHAR},
      </if>
      <if test="sku != null">
        sku = #{sku,jdbcType=VARCHAR},
      </if>
      <if test="operNumber != null">
        oper_number = #{operNumber,jdbcType=DECIMAL},
      </if>
      <if test="basicNumber != null">
        basic_number = #{basicNumber,jdbcType=DECIMAL},
      </if>
      <if test="unitPrice != null">
        unit_price = #{unitPrice,jdbcType=DECIMAL},
      </if>
      <if test="taxUnitPrice != null">
        tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
      </if>
      <if test="allPrice != null">
        all_price = #{allPrice,jdbcType=DECIMAL},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="depotId != null">
        depot_id = #{depotId,jdbcType=BIGINT},
      </if>
      <if test="anotherDepotId != null">
        another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
      </if>
      <if test="taxRate != null">
        tax_rate = #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="taxMoney != null">
        tax_money = #{taxMoney,jdbcType=DECIMAL},
      </if>
      <if test="taxLastMoney != null">
        tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
      </if>
      <if test="materialType != null">
        material_type = #{materialType,jdbcType=VARCHAR},
      </if>
      <if test="snList != null">
        sn_list = #{snList,jdbcType=VARCHAR},
      </if>
      <if test="batchNumber != null">
        batch_number = #{batchNumber,jdbcType=VARCHAR},
      </if>
      <if test="expirationDate != null">
        expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
      </if>
      <if test="linkId != null">
        link_id = #{linkId,jdbcType=BIGINT},
      </if>
      <if test="tenantId != null">
        tenant_id = #{tenantId,jdbcType=BIGINT},
      </if>
      <if test="deleteFlag != null">
        delete_flag = #{deleteFlag,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.DepotItem">
    update jsh_depot_item
    set header_id = #{headerId,jdbcType=BIGINT},
      material_id = #{materialId,jdbcType=BIGINT},
      material_extend_id = #{materialExtendId,jdbcType=BIGINT},
      material_unit = #{materialUnit,jdbcType=VARCHAR},
      sku = #{sku,jdbcType=VARCHAR},
      oper_number = #{operNumber,jdbcType=DECIMAL},
      basic_number = #{basicNumber,jdbcType=DECIMAL},
      unit_price = #{unitPrice,jdbcType=DECIMAL},
      tax_unit_price = #{taxUnitPrice,jdbcType=DECIMAL},
      all_price = #{allPrice,jdbcType=DECIMAL},
      remark = #{remark,jdbcType=VARCHAR},
      depot_id = #{depotId,jdbcType=BIGINT},
      another_depot_id = #{anotherDepotId,jdbcType=BIGINT},
      tax_rate = #{taxRate,jdbcType=DECIMAL},
      tax_money = #{taxMoney,jdbcType=DECIMAL},
      tax_last_money = #{taxLastMoney,jdbcType=DECIMAL},
      material_type = #{materialType,jdbcType=VARCHAR},
      sn_list = #{snList,jdbcType=VARCHAR},
      batch_number = #{batchNumber,jdbcType=VARCHAR},
      expiration_date = #{expirationDate,jdbcType=TIMESTAMP},
      link_id = #{linkId,jdbcType=BIGINT},
      tenant_id = #{tenantId,jdbcType=BIGINT},
      delete_flag = #{deleteFlag,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>


text:
using namespace Mongoose;

#undef LOG_ERROR
#undef LOG_WARN
#undef LOG_INFO
#undef LOG_TEST
#define LOG_ERROR 1
#define LOG_WARN 1
#define LOG_INFO 0
#define LOG_TEST 1

int main(int argn, char** argv)
{
    SuiteSparse_start();

    // Set Logger to report all messages
    Logger::setDebugLevel(All);

    if (argn != 3)
    {
        // Wrong number of arguments - return error
        LogError("Usage: mongoose_test_io <MM-input-file.mtx> <1 for valid graph, 0 for invalid>");
        SuiteSparse_finish();
        return EXIT_FAILURE;
    }

    // Read in input file name
    std::string inputFile = std::string(argv[1]);

    // Read in whether this file should produce a valid graph
    bool validGraph = static_cast<bool>(atoi(argv[2]));

    // Run the I/O test
    int status = runIOTest(inputFile, validGraph);

    SuiteSparse_finish();

    return status;
}


text:
module Pohoda
  module Builders
    module Ftr
      class RequestContractType
        include ParserCore::BaseBuilder
        include Ftr::Groups::GroupFilter1

        def builder
          root = Ox::Element.new(name)
          root = add_attributes_and_namespaces(root)

          mega.each do |r|
            r.nodes.each { |n| root << n }
          end

          root
        end
      end
    end
  end
end


text:
title: Showers Have Brought Flowers!
date: 2016-05-12 00:00:00 -06:00
categories:
- whats-blooming
layout: post
blog-banner: whats-blooming-now-spring.jpg
post-date: May 18, 2016
post-time: 2:07 PM
blog-image: wbn-default.jpg
---

The recent storms have brought lots of flowers to the Garden. Now that the rain has subsided and the temperatures are just right, it is a pleasant time to be outside and gaze at natures glory.

Jacob's Ladder    Polemonium caeruleum ssp.  himalayanum

Check out these beauties in the Fragrance Garden!

Yagumo Tree Peony    Paeonia suffruticosa 'Yagumo'

With blooms as big as a dinner plate, people and bees have no choice but to stop and stay awhile. Can you spot the bee in this photo?

Dwarf Sneezewort     Achillea ptarmica 'Nana Compacta'

These cute little numbers can be seen in the Water Pavilion

Columbine     Aquilegia 'Dragonfly'

In the Children's Garden, if you hang around this flower long enough you are sure to spot a hummingbird.

Himalayan Fleeceflower    Polygonum affinis 'Dimity'

Along the Floral Walk, this charming groundcover will bloom all summer long.

 The weather doesn't get much better than this, so come take a delightful walk through the Garden today.

Photos by Heidi Simper


text:
<!DOCTYPE HTML>
<title>Test for 'unicode-bidi' on table cells</title>

abc


text:
package server

import (
	"encoding/json"
	"errors"
	"fmt"
	"path/filepath"
	"strings"
	"syscall"

	"github.com/Sirupsen/logrus"
	"github.com/docker/docker/pkg/stringid"
	"github.com/kubernetes-incubator/cri-o/oci"
	"github.com/kubernetes-incubator/cri-o/server/apparmor"
	"github.com/kubernetes-incubator/cri-o/server/seccomp"
	"github.com/opencontainers/runc/libcontainer/label"
	"github.com/opencontainers/runtime-tools/generate"
	"golang.org/x/net/context"
	pb "k8s.io/kubernetes/pkg/kubelet/api/v1alpha1/runtime"
)

const (
	seccompUnconfined      = "unconfined"
	seccompRuntimeDefault  = "runtime/default"
	seccompLocalhostPrefix = "localhost/"
)

// CreateContainer creates a new container in specified PodSandbox
func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error) {
	logrus.Debugf("CreateContainerRequest %+v", req)
	s.Update()
	sbID := req.PodSandboxId
	if sbID == "" {
		return nil, fmt.Errorf("PodSandboxId should not be empty")
	}

	sandboxID, err := s.podIDIndex.Get(sbID)
	if err != nil {
		return nil, fmt.Errorf("PodSandbox with ID starting with %s not found: %v", sbID, err)
	}

	sb := s.getSandbox(sandboxID)
	if sb == nil {
		return nil, fmt.Errorf("specified sandbox not found: %s", sandboxID)
	}

	// The config of the container
	containerConfig := req.GetConfig()
	if containerConfig == nil {
		return nil, fmt.Errorf("CreateContainerRequest.ContainerConfig is nil")
	}

	name := containerConfig.GetMetadata().Name
	if name == "" {
		return nil, fmt.Errorf("CreateContainerRequest.ContainerConfig.Name is empty")
	}

	attempt := containerConfig.GetMetadata().Attempt
	containerID, containerName, err := s.generateContainerIDandName(sb.name, name, attempt)
	if err != nil {
		return nil, err
	}

	defer func() {
		if err != nil {
			s.releaseContainerName(containerName)
		}
	}()

	container, err := s.createSandboxContainer(ctx, containerID, containerName, sb, req.GetSandboxConfig(), containerConfig)
	if err != nil {
		return nil, err
	}
	defer func() {
		if err != nil {
			err2 := s.storage.DeleteContainer(containerID)
			if err2 != nil {
				logrus.Warnf("Failed to cleanup container directory: %v", err2)
			}
		}
	}()

	if err = s.runtime.CreateContainer(container); err != nil {
		return nil, err
	}

	if err = s.runtime.UpdateStatus(container); err != nil {
		return nil, err
	}

	s.addContainer(container)

	if err = s.ctrIDIndex.Add(containerID); err != nil {
		s.removeContainer(container)
		return nil, err
	}

	resp := &pb.CreateContainerResponse{
		ContainerId: containerID,
	}

	logrus.Debugf("CreateContainerResponse: %+v", resp)
	return resp, nil
}

func (s *Server) createSandboxContainer(ctx context.Context, containerID string, containerName string, sb *sandbox, SandboxConfig *pb.PodSandboxConfig, containerConfig *pb.ContainerConfig) (*oci.Container, error) {
	if sb == nil {
		return nil, errors.New("createSandboxContainer needs a sandbox")
	}

	// TODO: simplify this function (cyclomatic complexity here is high)
	// TODO: factor generating/updating the spec into something other projects can vendor

	// creates a spec Generator with the default spec.
	specgen := generate.New()

	processArgs := []string{}
	commands := containerConfig.Command
	args := containerConfig.Args
	if commands == nil && args == nil {
		processArgs = nil
	}
	if commands != nil {
		processArgs = append(processArgs, commands...)
	}
	if args != nil {
		processArgs = append(processArgs, args...)
	}

	cwd := containerConfig.WorkingDir
	if cwd == "" {
		cwd = "/"
	}
	specgen.SetProcessCwd(cwd)

	envs := containerConfig.GetEnvs()
	if envs != nil {
		for _, item := range envs {
			key := item.Key
			value := item.Value
			if key == "" {
				continue
			}
			specgen.AddProcessEnv(key, value)
		}
	}

	mounts := containerConfig.GetMounts()
	for _, mount := range mounts {
		dest := mount.ContainerPath
		if dest == "" {
			return nil, fmt.Errorf("Mount.ContainerPath is empty")
		}

		src := mount.HostPath
		if src == "" {
			return nil, fmt.Errorf("Mount.HostPath is empty")
		}

		options := []string{"rw"}
		if mount.Readonly {
			options = []string{"ro"}
		}

		if mount.SelinuxRelabel {
			// Need a way in kubernetes to determine if the volume is shared or private
			if err := label.Relabel(src, sb.mountLabel, true); err != nil && err != syscall.ENOTSUP {
				return nil, fmt.Errorf("relabel failed %s: %v", src, err)
			}
		}

		specgen.AddBindMount(src, dest, options)
	}

	labels := containerConfig.GetLabels()

	metadata := containerConfig.GetMetadata()

	annotations := containerConfig.GetAnnotations()
	if annotations != nil {
		for k, v := range annotations {
			specgen.AddAnnotation(k, v)
		}
	}

	// set this container's apparmor profile if it is set by sandbox
	if s.appArmorEnabled {
		appArmorProfileName := s.getAppArmorProfileName(sb.annotations, metadata.Name)
		if appArmorProfileName != "" {
			// reload default apparmor profile if it is unloaded.
			if s.appArmorProfile == apparmor.DefaultApparmorProfile {
				if err := apparmor.EnsureDefaultApparmorProfile(); err != nil {
					return nil, err
				}
			}

			specgen.SetProcessApparmorProfile(appArmorProfileName)
		}
	}
	if containerConfig.GetLinux().GetSecurityContext() != nil {
		if containerConfig.GetLinux().GetSecurityContext().Privileged {
			specgen.SetupPrivileged(true)
		}

		if containerConfig.GetLinux().GetSecurityContext().ReadonlyRootfs {
			specgen.SetRootReadonly(true)
		}
	}

	logPath := containerConfig.LogPath
	specgen.SetProcessTerminal(containerConfig.Tty)

	linux := containerConfig.GetLinux()
	if linux != nil {
		resources := linux.GetResources()
		if resources != nil {
			cpuPeriod := resources.CpuPeriod
			if cpuPeriod != 0 {
				specgen.SetLinuxResourcesCPUPeriod(uint64(cpuPeriod))
			}

			cpuQuota := resources.CpuQuota
			if cpuQuota != 0 {
				specgen.SetLinuxResourcesCPUQuota(uint64(cpuQuota))
			}

			cpuShares := resources.CpuShares
			if cpuShares != 0 {
				specgen.SetLinuxResourcesCPUShares(uint64(cpuShares))
			}

			memoryLimit := resources.MemoryLimitInBytes
			if memoryLimit != 0 {
				specgen.SetLinuxResourcesMemoryLimit(uint64(memoryLimit))
			}

			oomScoreAdj := resources.OomScoreAdj
			specgen.SetLinuxResourcesOOMScoreAdj(int(oomScoreAdj))
		}

		if sb.cgroupParent != "" {
			if s.config.CgroupManager == "systemd" {
				cgPath := sb.cgroupParent + ":" + "ocid" + ":" + containerID
				specgen.SetLinuxCgroupsPath(cgPath)
			} else {
				specgen.SetLinuxCgroupsPath(sb.cgroupParent + "/" + containerID)
			}
		}

		capabilities := linux.GetSecurityContext().GetCapabilities()
		if capabilities != nil {
			addCaps := capabilities.AddCapabilities
			if addCaps != nil {
				for _, cap := range addCaps {
					if err := specgen.AddProcessCapability(cap); err != nil {
						return nil, err
					}
				}
			}

			dropCaps := capabilities.DropCapabilities
			if dropCaps != nil {
				for _, cap := range dropCaps {
					if err := specgen.DropProcessCapability(cap); err != nil {
						return nil, err
					}
				}
			}
		}

		specgen.SetProcessSelinuxLabel(sb.processLabel)
		specgen.SetLinuxMountLabel(sb.mountLabel)

		if linux.GetSecurityContext() != nil {
			user := linux.GetSecurityContext().GetRunAsUser()
			specgen.SetProcessUID(uint32(user.Value))
			specgen.SetProcessGID(uint32(user.Value))
			groups := linux.GetSecurityContext().SupplementalGroups
			for _, group := range groups {
				specgen.AddProcessAdditionalGid(uint32(group))
			}
		}
	}
	// Join the namespace paths for the pod sandbox container.
	podInfraState := s.runtime.ContainerStatus(sb.infraContainer)

	logrus.Debugf("pod container state %+v", podInfraState)

	ipcNsPath := fmt.Sprintf("/proc/%d/ns/ipc", podInfraState.Pid)
	if err := specgen.AddOrReplaceLinuxNamespace("ipc", ipcNsPath); err != nil {
		return nil, err
	}

	netNsPath := sb.netNsPath()
	if netNsPath == "" {
		// The sandbox does not have a permanent namespace,
		// it's on the host one.
		netNsPath = fmt.Sprintf("/proc/%d/ns/net", podInfraState.Pid)
	}

	if err := specgen.AddOrReplaceLinuxNamespace("network", netNsPath); err != nil {
		return nil, err
	}

	imageSpec := containerConfig.GetImage()
	if imageSpec == nil {
		return nil, fmt.Errorf("CreateContainerRequest.ContainerConfig.Image is nil")
	}

	image := imageSpec.Image
	if image == "" {
		return nil, fmt.Errorf("CreateContainerRequest.ContainerConfig.Image.Image is empty")
	}

	// bind mount the pod shm
	specgen.AddBindMount(sb.shmPath, "/dev/shm", []string{"rw"})

	specgen.AddAnnotation("ocid/name", containerName)
	specgen.AddAnnotation("ocid/sandbox_id", sb.id)
	specgen.AddAnnotation("ocid/sandbox_name", sb.infraContainer.Name())
	specgen.AddAnnotation("ocid/container_type", containerTypeContainer)
	specgen.AddAnnotation("ocid/log_path", logPath)
	specgen.AddAnnotation("ocid/tty", fmt.Sprintf("%v", containerConfig.Tty))
	specgen.AddAnnotation("ocid/image", image)

	metadataJSON, err := json.Marshal(metadata)
	if err != nil {
		return nil, err
	}
	specgen.AddAnnotation("ocid/metadata", string(metadataJSON))

	labelsJSON, err := json.Marshal(labels)
	if err != nil {
		return nil, err
	}
	specgen.AddAnnotation("ocid/labels", string(labelsJSON))

	annotationsJSON, err := json.Marshal(annotations)
	if err != nil {
		return nil, err
	}
	specgen.AddAnnotation("ocid/annotations", string(annotationsJSON))

	if err = s.setupSeccomp(&specgen, containerName, sb.annotations); err != nil {
		return nil, err
	}

	metaname := metadata.Name
	attempt := metadata.Attempt
	containerInfo, err := s.storage.CreateContainer(s.imageContext,
		sb.name, sb.id,
		image, image,
		containerName, containerID,
		metaname,
		attempt,
		sb.mountLabel,
		nil)
	if err != nil {
		return nil, err
	}

	mountPoint, err := s.storage.StartContainer(containerID)
	if err != nil {
		return nil, fmt.Errorf("failed to mount container %s(%s): %v", containerName, containerID, err)
	}

	if processArgs == nil {
		if containerInfo.Config != nil && len(containerInfo.Config.Config.Cmd) > 0 {
			processArgs = containerInfo.Config.Config.Cmd
		} else {
			processArgs = []string{"/bin/sh"}
		}
	}
	specgen.SetProcessArgs(processArgs)

	// by default, the root path is an empty string. set it now.
	specgen.SetRootPath(mountPoint)

	saveOptions := generate.ExportOptions{}
	if err = specgen.SaveToFile(filepath.Join(containerInfo.Dir, "config.json"), saveOptions); err != nil {
		return nil, err
	}
	if err = specgen.SaveToFile(filepath.Join(containerInfo.RunDir, "config.json"), saveOptions); err != nil {
		return nil, err
	}

	container, err := oci.NewContainer(containerID, containerName, containerInfo.RunDir, logPath, sb.netNs(), labels, annotations, imageSpec, metadata, sb.id, containerConfig.Tty)
	if err != nil {
		return nil, err
	}

	return container, nil
}

func (s *Server) setupSeccomp(specgen *generate.Generator, cname string, sbAnnotations map[string]string) error {
	profile, ok := sbAnnotations["security.alpha.kubernetes.io/seccomp/container/"+cname]
	if !ok {
		profile, ok = sbAnnotations["security.alpha.kubernetes.io/seccomp/pod"]
		if !ok {
			// running w/o seccomp, aka unconfined
			profile = seccompUnconfined
		}
	}
	if !s.seccompEnabled {
		if profile != seccompUnconfined {
			return fmt.Errorf("seccomp is not enabled in your kernel, cannot run with a profile")
		}
		logrus.Warn("seccomp is not enabled in your kernel, running container without profile")
	}
	if profile == seccompUnconfined {
		// running w/o seccomp, aka unconfined
		specgen.Spec().Linux.Seccomp = nil
		return nil
	}
	if profile == seccompRuntimeDefault {
		return seccomp.LoadProfileFromStruct(s.seccompProfile, specgen)
	}
	if !strings.HasPrefix(profile, seccompLocalhostPrefix) {
		return fmt.Errorf("unknown seccomp profile option: %q", profile)
	}
	//file, err := ioutil.ReadFile(filepath.Join(s.seccompProfileRoot, strings.TrimPrefix(profile, seccompLocalhostPrefix)))
	//if err != nil {
	//return err
	//}
	// TODO(runcom): setup from provided node's seccomp profile
	// can't do this yet, see https://issues.k8s.io/36997
	return nil
}

func (s *Server) generateContainerIDandName(podName string, name string, attempt uint32) (string, string, error) {
	var (
		err error
		id  = stringid.GenerateNonCryptoID()
	)
	nameStr := fmt.Sprintf("%s-%s-%v", podName, name, attempt)
	if name == "infra" {
		nameStr = fmt.Sprintf("%s-%s", podName, name)
	}
	if name, err = s.reserveContainerName(id, nameStr); err != nil {
		return "", "", err
	}
	return id, name, err
}

// getAppArmorProfileName gets the profile name for the given container.
func (s *Server) getAppArmorProfileName(annotations map[string]string, ctrName string) string {
	profile := apparmor.GetProfileNameFromPodAnnotations(annotations, ctrName)

	if profile == "" {
		return ""
	}

	if profile == apparmor.ProfileRuntimeDefault {
		// If the value is runtime/default, then return default profile.
		return s.appArmorProfile
	}

	return strings.TrimPrefix(profile, apparmor.ProfileNamePrefix)
}


text:
/**!
 * AngularJS file upload directives and services. Supports: file upload/drop/paste, resume, cancel/abort,
 * progress, resize, thumbnail, preview, validation and CORS
 * FileAPI Flash shim for old browsers not supporting FormData
 * @author  Danial  <danial.farid@gmail.com>
 * @version 12.2.13
 */

(function () {
  /** @namespace FileAPI.noContentTimeout */

  function patchXHR(fnName, newFn) {
    window.XMLHttpRequest.prototype[fnName] = newFn(window.XMLHttpRequest.prototype[fnName]);
  }

  function redefineProp(xhr, prop, fn) {
    try {
      Object.defineProperty(xhr, prop, {get: fn});
    } catch (e) {/*ignore*/
    }
  }

  if (!window.FileAPI) {
    window.FileAPI = {};
  }

  if (!window.XMLHttpRequest) {
    throw 'AJAX is not supported. XMLHttpRequest is not defined.';
  }

  FileAPI.shouldLoad = !window.FormData || FileAPI.forceLoad;
  if (FileAPI.shouldLoad) {
    var initializeUploadListener = function (xhr) {
      if (!xhr.__listeners) {
        if (!xhr.upload) xhr.upload = {};
        xhr.__listeners = [];
        var origAddEventListener = xhr.upload.addEventListener;
        xhr.upload.addEventListener = function (t, fn) {
          xhr.__listeners[t] = fn;
          if (origAddEventListener) origAddEventListener.apply(this, arguments);
        };
      }
    };

    patchXHR('open', function (orig) {
      return function (m, url, b) {
        initializeUploadListener(this);
        this.__url = url;
        try {
          orig.apply(this, [m, url, b]);
        } catch (e) {
          if (e.message.indexOf('Access is denied') > -1) {
            this.__origError = e;
            orig.apply(this, [m, '_fix_for_ie_crossdomain__', b]);
          }
        }
      };
    });

    patchXHR('getResponseHeader', function (orig) {
      return function (h) {
        return this.__fileApiXHR && this.__fileApiXHR.getResponseHeader ? this.__fileApiXHR.getResponseHeader(h) : (orig == null ? null : orig.apply(this, [h]));
      };
    });

    patchXHR('getAllResponseHeaders', function (orig) {
      return function () {
        return this.__fileApiXHR && this.__fileApiXHR.getAllResponseHeaders ? this.__fileApiXHR.getAllResponseHeaders() : (orig == null ? null : orig.apply(this));
      };
    });

    patchXHR('abort', function (orig) {
      return function () {
        return this.__fileApiXHR && this.__fileApiXHR.abort ? this.__fileApiXHR.abort() : (orig == null ? null : orig.apply(this));
      };
    });

    patchXHR('setRequestHeader', function (orig) {
      return function (header, value) {
        if (header === '__setXHR_') {
          initializeUploadListener(this);
          var val = value(this);
          // fix for angular < 1.2.0
          if (val instanceof Function) {
            val(this);
          }
        } else {
          this.__requestHeaders = this.__requestHeaders || {};
          this.__requestHeaders[header] = value;
          orig.apply(this, arguments);
        }
      };
    });

    patchXHR('send', function (orig) {
      return function () {
        var xhr = this;
        if (arguments[0] && arguments[0].__isFileAPIShim) {
          var formData = arguments[0];
          var config = {
            url: xhr.__url,
            jsonp: false, //removes the callback form param
            cache: true, //removes the ?fileapiXXX in the url
            complete: function (err, fileApiXHR) {
              if (err && angular.isString(err) && err.indexOf('#2174') !== -1) {
                // this error seems to be fine the file is being uploaded properly.
                err = null;
              }
              xhr.__completed = true;
              if (!err && xhr.__listeners.load)
                xhr.__listeners.load({
                  type: 'load',
                  loaded: xhr.__loaded,
                  total: xhr.__total,
                  target: xhr,
                  lengthComputable: true
                });
              if (!err && xhr.__listeners.loadend)
                xhr.__listeners.loadend({
                  type: 'loadend',
                  loaded: xhr.__loaded,
                  total: xhr.__total,
                  target: xhr,
                  lengthComputable: true
                });
              if (err === 'abort' && xhr.__listeners.abort)
                xhr.__listeners.abort({
                  type: 'abort',
                  loaded: xhr.__loaded,
                  total: xhr.__total,
                  target: xhr,
                  lengthComputable: true
                });
              if (fileApiXHR.status !== undefined) redefineProp(xhr, 'status', function () {
                return (fileApiXHR.status === 0 && err && err !== 'abort') ? 500 : fileApiXHR.status;
              });
              if (fileApiXHR.statusText !== undefined) redefineProp(xhr, 'statusText', function () {
                return fileApiXHR.statusText;
              });
              redefineProp(xhr, 'readyState', function () {
                return 4;
              });
              if (fileApiXHR.response !== undefined) redefineProp(xhr, 'response', function () {
                return fileApiXHR.response;
              });
              var resp = fileApiXHR.responseText || (err && fileApiXHR.status === 0 && err !== 'abort' ? err : undefined);
              redefineProp(xhr, 'responseText', function () {
                return resp;
              });
              redefineProp(xhr, 'response', function () {
                return resp;
              });
              if (err) redefineProp(xhr, 'err', function () {
                return err;
              });
              xhr.__fileApiXHR = fileApiXHR;
              if (xhr.onreadystatechange) xhr.onreadystatechange();
              if (xhr.onload) xhr.onload();
            },
            progress: function (e) {
              e.target = xhr;
              if (xhr.__listeners.progress) xhr.__listeners.progress(e);
              xhr.__total = e.total;
              xhr.__loaded = e.loaded;
              if (e.total === e.loaded) {
                // fix flash issue that doesn't call complete if there is no response text from the server
                var _this = this;
                setTimeout(function () {
                  if (!xhr.__completed) {
                    xhr.getAllResponseHeaders = function () {
                    };
                    _this.complete(null, {status: 204, statusText: 'No Content'});
                  }
                }, FileAPI.noContentTimeout || 10000);
              }
            },
            headers: xhr.__requestHeaders
          };
          config.data = {};
          config.files = {};
          for (var i = 0; i < formData.data.length; i++) {
            var item = formData.data[i];
            if (item.val != null && item.val.name != null && item.val.size != null && item.val.type != null) {
              config.files[item.key] = item.val;
            } else {
              config.data[item.key] = item.val;
            }
          }

          setTimeout(function () {
            if (!FileAPI.hasFlash) {
              throw 'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';
            }
            xhr.__fileApiXHR = FileAPI.upload(config);
          }, 1);
        } else {
          if (this.__origError) {
            throw this.__origError;
          }
          orig.apply(xhr, arguments);
        }
      };
    });
    window.XMLHttpRequest.__isFileAPIShim = true;
    window.FormData = FormData = function () {
      return {
        append: function (key, val, name) {
          if (val.__isFileAPIBlobShim) {
            val = val.data[0];
          }
          this.data.push({
            key: key,
            val: val,
            name: name
          });
        },
        data: [],
        __isFileAPIShim: true
      };
    };

    window.Blob = Blob = function (b) {
      return {
        data: b,
        __isFileAPIBlobShim: true
      };
    };
  }

})();

(function () {
  /** @namespace FileAPI.forceLoad */
  /** @namespace window.FileAPI.jsUrl */
  /** @namespace window.FileAPI.jsPath */

  function isInputTypeFile(elem) {
    return elem[0].tagName.toLowerCase() === 'input' && elem.attr('type') && elem.attr('type').toLowerCase() === 'file';
  }

  function hasFlash() {
    try {
      var fo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
      if (fo) return true;
    } catch (e) {
      if (navigator.mimeTypes['application/x-shockwave-flash'] !== undefined) return true;
    }
    return false;
  }

  function getOffset(obj) {
    var left = 0, top = 0;

    if (window.jQuery) {
      return jQuery(obj).offset();
    }

    if (obj.offsetParent) {
      do {
        left += (obj.offsetLeft - obj.scrollLeft);
        top += (obj.offsetTop - obj.scrollTop);
        obj = obj.offsetParent;
      } while (obj);
    }
    return {
      left: left,
      top: top
    };
  }

  if (FileAPI.shouldLoad) {
    FileAPI.hasFlash = hasFlash();

    //load FileAPI
    if (FileAPI.forceLoad) {
      FileAPI.html5 = false;
    }

    if (!FileAPI.upload) {
      var jsUrl, basePath, script = document.createElement('script'), allScripts = document.getElementsByTagName('script'), i, index, src;
      if (window.FileAPI.jsUrl) {
        jsUrl = window.FileAPI.jsUrl;
      } else if (window.FileAPI.jsPath) {
        basePath = window.FileAPI.jsPath;
      } else {
        for (i = 0; i < allScripts.length; i++) {
          src = allScripts[i].src;
          index = src.search(/\/ng\-file\-upload[\-a-zA-z0-9\.]*\.js/);
          if (index > -1) {
            basePath = src.substring(0, index + 1);
            break;
          }
        }
      }

      if (FileAPI.staticPath == null) FileAPI.staticPath = basePath;
      script.setAttribute('src', jsUrl || basePath + 'FileAPI.min.js');
      document.getElementsByTagName('head')[0].appendChild(script);
    }

    FileAPI.ngfFixIE = function (elem, fileElem, changeFn) {
      if (!hasFlash()) {
        throw 'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';
      }
      var fixInputStyle = function () {
        var label = fileElem.parent();
        if (elem.attr('disabled')) {
          if (label) label.removeClass('js-fileapi-wrapper');
        } else {
          if (!fileElem.attr('__ngf_flash_')) {
            fileElem.unbind('change');
            fileElem.unbind('click');
            fileElem.bind('change', function (evt) {
              fileApiChangeFn.apply(this, [evt]);
              changeFn.apply(this, [evt]);
            });
            fileElem.attr('__ngf_flash_', 'true');
          }
          label.addClass('js-fileapi-wrapper');
          if (!isInputTypeFile(elem)) {
            label.css('position', 'absolute')
              .css('top', getOffset(elem[0]).top + 'px').css('left', getOffset(elem[0]).left + 'px')
              .css('width', elem[0].offsetWidth + 'px').css('height', elem[0].offsetHeight + 'px')
              .css('filter', 'alpha(opacity=0)').css('display', elem.css('display'))
              .css('overflow', 'hidden').css('z-index', '900000')
              .css('visibility', 'visible');
            fileElem.css('width', elem[0].offsetWidth + 'px').css('height', elem[0].offsetHeight + 'px')
              .css('position', 'absolute').css('top', '0px').css('left', '0px');
          }
        }
      };

      elem.bind('mouseenter', fixInputStyle);

      var fileApiChangeFn = function (evt) {
        var files = FileAPI.getFiles(evt);
        //just a double check for #233
        for (var i = 0; i < files.length; i++) {
          if (files[i].size === undefined) files[i].size = 0;
          if (files[i].name === undefined) files[i].name = 'file';
          if (files[i].type === undefined) files[i].type = 'undefined';
        }
        if (!evt.target) {
          evt.target = {};
        }
        evt.target.files = files;
        // if evt.target.files is not writable use helper field
        if (evt.target.files !== files) {
          evt.__files_ = files;
        }
        (evt.__files_ || evt.target.files).item = function (i) {
          return (evt.__files_ || evt.target.files)[i] || null;
        };
      };
    };

    FileAPI.disableFileInput = function (elem, disable) {
      if (disable) {
        elem.removeClass('js-fileapi-wrapper');
      } else {
        elem.addClass('js-fileapi-wrapper');
      }
    };
  }
})();

if (!window.FileReader) {
  window.FileReader = function () {
    var _this = this, loadStarted = false;
    this.listeners = {};
    this.addEventListener = function (type, fn) {
      _this.listeners[type] = _this.listeners[type] || [];
      _this.listeners[type].push(fn);
    };
    this.removeEventListener = function (type, fn) {
      if (_this.listeners[type]) _this.listeners[type].splice(_this.listeners[type].indexOf(fn), 1);
    };
    this.dispatchEvent = function (evt) {
      var list = _this.listeners[evt.type];
      if (list) {
        for (var i = 0; i < list.length; i++) {
          list[i].call(_this, evt);
        }
      }
    };
    this.onabort = this.onerror = this.onload = this.onloadstart = this.onloadend = this.onprogress = null;

    var constructEvent = function (type, evt) {
      var e = {type: type, target: _this, loaded: evt.loaded, total: evt.total, error: evt.error};
      if (evt.result != null) e.target.result = evt.result;
      return e;
    };
    var listener = function (evt) {
      if (!loadStarted) {
        loadStarted = true;
        if (_this.onloadstart) _this.onloadstart(constructEvent('loadstart', evt));
      }
      var e;
      if (evt.type === 'load') {
        if (_this.onloadend) _this.onloadend(constructEvent('loadend', evt));
        e = constructEvent('load', evt);
        if (_this.onload) _this.onload(e);
        _this.dispatchEvent(e);
      } else if (evt.type === 'progress') {
        e = constructEvent('progress', evt);
        if (_this.onprogress) _this.onprogress(e);
        _this.dispatchEvent(e);
      } else {
        e = constructEvent('error', evt);
        if (_this.onerror) _this.onerror(e);
        _this.dispatchEvent(e);
      }
    };
    this.readAsDataURL = function (file) {
      FileAPI.readAsDataURL(file, listener);
    };
    this.readAsText = function (file) {
      FileAPI.readAsText(file, listener);
    };
  };
}


text:
egame.define("Json", ["Resource"], function(Resource) {

    /**
     * 音频资源
     */
    egame.Json = function(loader) {
        //继承资源类
        Resource.call(this);
        //资源类型
        this.type = 'json';
        //加载器
        this.loader = loader;
    };

    egame.Json.prototype = Object.create(egame.Resource.prototype);
    egame.util.extend(egame.Json.prototype, {
        //加载资源的方法
        load: function() {
            var json = this;
            var loader = this.loader;
            if (json.url) {
                loader.xhrLoad(json, json.requestUrl, 'text');
            } else {
                this.resoureError(json, null, '没有给定有效的json数据链接');
            }
            return this;
        },
        loadComplete: function() {
            this.data =JSON.parse(this.requestObject.responseText);
        }
    });
    egame.Json.prototype.constructor = egame.Json;

    /***给Loader扩充的方法****/
    //加载json文件
    egame.Loader.prototype.json = function(key, url) {
        var json = new egame.Json(this);
        json.key = key;
        json.url = url;
        json.requestUrl = this.transformUrl(json.url, json);
        this.addToResourceList(json);
        return this;
    };

    return egame.Json;

});


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Ilda Toniolo</logradouro><bairro>Monza</bairro><cidade>Colombo</cidade><uf>PR</uf><cep>83406340</cep></feed>


text:
package com.devnatres.dashproject.space;

import com.badlogic.gdx.maps.tiled.TiledMapTileLayer;
import com.badlogic.gdx.math.Rectangle;
import com.devnatres.dashproject.debug.Debug;
import com.devnatres.dashproject.gameconstants.EDirection;

import static com.devnatres.dashproject.space.BlockCell.*;

/**
 * Represents a "slider" map. It needs to call the method compile() when all block layers are added.

 * This abstract map moves (slides) a rectangle that represents a volume to a nearby free position.

 * It has other helper functions too.

 *

 * Created by DevNatres on 07/12/2014.
 */
public class BlockMapSlider {
    public enum EBlockDecision {
        BLOCK_WHEN_TILE,
        BLOCK_WHEN_HOLE
    }

    private final BlockCell[][] blockMap;
    private final int mapWidth;
    private final int mapHeight;
    private final int tilePixelWidth;
    private final int tilePixelHeight;
    private final int mapPixelWidth;
    private final int mapPixelHeight;

    private final Rectangle slidingRectangle;

    /**
     * The layer in the first blockLayersWithHeight can not be null.
     * Any layer can be empty, i.e., it's not null but it doesn't have blocks.
     */
    public BlockMapSlider(EBlockDecision eBlockDecision, BlockLayerWithHeight... blockLayersWithHeight) {
        TiledMapTileLayer firstBlockLayer = blockLayersWithHeight[0].getBlockLayer();

        mapWidth = firstBlockLayer.getWidth();
        mapHeight = firstBlockLayer.getHeight();
        tilePixelWidth = (int)firstBlockLayer.getTileWidth();
        tilePixelHeight = (int)firstBlockLayer.getTileHeight();
        mapPixelWidth = mapWidth * tilePixelWidth;
        mapPixelHeight = mapHeight * tilePixelHeight;

        slidingRectangle = new Rectangle();
        blockMap = new BlockCell[mapWidth][mapHeight];

        for (int i = 0; i < blockLayersWithHeight.length; i++) {
            addBlockLayerWithHeight(eBlockDecision, blockLayersWithHeight[i]);
        }
    }

    /**
     * Additional block layer must have the same dimensions of the one passed to the constructor.
     * The BlockLayerWithHeight can contain null components (layer and height).
     */
    public void addBlockLayerWithHeight(EBlockDecision eBlockDecision, BlockLayerWithHeight blockLayerWithHeight) {

        TiledMapTileLayer blockLayer = blockLayerWithHeight.getBlockLayer();
        EBlockHeight blockHeight = blockLayerWithHeight.getBlockHeight();
        if (blockLayer==null || blockHeight==null) {
            return;
        }
        if (mapWidth != blockLayer.getWidth()
            || mapHeight != blockLayer.getHeight()
            || tilePixelWidth != blockLayer.getTileWidth()
            || tilePixelHeight != blockLayer.getTileHeight()) {

            throw new RuntimeException("Layer dimensions don't match with the first one");
        }

        // A PLAIN block is created when there is no tile (i.e., there is a hole in the map)
        // Others block height need a tile.
        for (int column = 0; column < mapWidth; column++) {
            for (int row = 0; row < mapHeight; row++) {
                boolean thereIsATile = (blockLayer.getCell(column, row) != null);
                if ((eBlockDecision == EBlockDecision.BLOCK_WHEN_HOLE) ^ thereIsATile) {
                    blockMap[column][row] = new BlockCell(blockHeight);
                }
            }
        }
    }

    public void compile() {
        for (int column = 0; column < mapWidth; column++) {
            for (int row = 0; row < mapHeight; row++) {
                BlockCell blockCell = blockMap[column][row];
                if (blockCell == null) {
                    continue;
                }

                DirectionSelector directionSelector = blockCell.getDirectionSelector();
                setSlidingDirectionIfNoNeighbour(directionSelector, column, row, EDirection.UP);
                setSlidingDirectionIfNoNeighbour(directionSelector, column, row, EDirection.RIGHT);
                setSlidingDirectionIfNoNeighbour(directionSelector, column, row, EDirection.DOWN);
                setSlidingDirectionIfNoNeighbour(directionSelector, column, row, EDirection.LEFT);
            }
        }
    }

    /**
     * Check if there's a block in the specified EDirection from the specified cell (by column and row).
     * If there isn't a block then set that direction in the specified DirectionSelector.
     */
    private void setSlidingDirectionIfNoNeighbour(DirectionSelector directionSelector,
                                                      int column, int row,
                                                      EDirection direction) {
        int checkColumn = column + direction.getXUnit();
        int checkRow = row + direction.getYUnit();

        if (checkColumn>=0 && checkColumn<mapWidth && checkRow>=0 && checkRow<mapHeight) {
            if (blockMap[checkColumn][checkRow] == null) {
                direction.setDirection(directionSelector);
            }
        }
    }

    public boolean slideRectangle(Rectangle rectangle) {
        slidingRectangle.set(rectangle);

        boolean validPosition = calculateSlideRectangle(slidingRectangle);
        if (validPosition) {
            rectangle.set(slidingRectangle);
        } else {
            validPosition = calculateSlideRectangle(slidingRectangle);
            if (validPosition) {
                rectangle.set(slidingRectangle);
            }
        }

        return validPosition;
    }

    private boolean calculateSlideRectangle(Rectangle rectangle) {
        // Some previous corrections to avoid positions out of the map
        if (rectangle.getX() < 0) {
            rectangle.setX(0);
        }
        if (rectangle.getX()+rectangle.getWidth() > mapPixelWidth) {
            rectangle.setX(mapPixelWidth - rectangle.getWidth());
        }
        if (rectangle.getY() < 0) {
            rectangle.setY(0);
        }
        if (rectangle.getY()+rectangle.getHeight() > mapPixelHeight) {
            rectangle.setY(mapPixelHeight - rectangle.getHeight());
        }

        // Determine the grid of tiles overlapping the rectangle
        int minColumn = (int)(rectangle.getX() / tilePixelWidth);
        int maxColumn = (int)((rectangle.getX() + rectangle.getWidth()-1) / tilePixelWidth);
        int minRow = (int)(rectangle.getY() / tilePixelHeight);
        int maxRow = (int)((rectangle.getY() + rectangle.getHeight()-1) / tilePixelHeight);

        if (minColumn < 0) minColumn = 0;
        if (maxColumn >= mapWidth) maxColumn = mapWidth-1;
        if (minRow < 0) minRow = 0;
        if (maxRow >= mapHeight) maxRow = mapHeight-1;

        // Calculate the rectangle center
        float centerX = rectangle.getX() + (rectangle.getWidth() / 2);
        float centerY = rectangle.getY() + (rectangle.getHeight() / 2);
        int centerColumn = (int)(centerX / tilePixelWidth);
        int centerRow = (int)(centerY / tilePixelHeight);

        // Count the sliding directions
        boolean isBlockCollision = false;
        int extremeUp = 0, extremeRight = 0, extremeDown = mapHeight, extremeLeft = mapWidth;
        int countUp = 0, countRight = 0, countDown = 0, countLeft = 0;
        for (int column = minColumn; column <= maxColumn; column++) {
            for (int row = minRow; row <= maxRow; row++) {
                BlockCell blockCell =  blockMap[column][row];
                if (blockCell != null) {
                    DirectionSelector directionSelector = blockCell.getDirectionSelector();
                    isBlockCollision = true;
                    if (directionSelector.isUp() && centerRow >= row) {
                        countUp++;
                        if (row > extremeUp) extremeUp = row;
                    }
                    if (directionSelector.isRight() && centerColumn >= column) {
                        countRight++;
                        if (column > extremeRight) extremeRight = column;
                    }
                    if (directionSelector.isDown() && centerRow <= row) {
                        countDown++;
                        if (row < extremeDown) extremeDown = row;
                    }
                    if (directionSelector.isLeft() && centerColumn <= column) {
                        countLeft++;
                        if (column < extremeLeft) extremeLeft = column;
                    }
                }
            }
        }

        // If there are some sliders...
        boolean validPosition = true;
        if (countUp != 0 || countRight != 0 || countDown != 0 || countLeft != 0) {
            // ...move to the most numerous direction of the extreme cell in that direction
            if (firstMax(countUp, countRight, countDown, countLeft)) {
                float y = (extremeUp + 1) * tilePixelHeight;
                if (y + rectangle.getHeight() > mapPixelHeight) {
                    validPosition = false;
                }
                rectangle.setY(y);
            } else if (firstMax(countRight, countUp, countDown, countLeft)) {
                float x = (extremeRight + 1) * tilePixelWidth;
                if (x + rectangle.getWidth() > mapPixelWidth) {
                    validPosition = false;
                }
                rectangle.setX(x);
            } else if (firstMax(countDown, countUp, countRight, countLeft)) {
                float y = (extremeDown * tilePixelHeight) - rectangle.getHeight();
                if (y < 0) {
                    validPosition = false;
                }
                rectangle.setY(y);
            } else if (firstMax(countLeft, countUp, countRight, countDown)) {
                float x = (extremeLeft * tilePixelWidth) - rectangle.getWidth();
                if (x < 0) {
                    validPosition = false;
                }
                rectangle.setX(x);
            }

            // Check if there is still collision
            if (validPosition) {
                minColumn = (int) (rectangle.getX() / tilePixelWidth);
                maxColumn = (int) ((rectangle.getX() + rectangle.getWidth()-1) / tilePixelWidth);
                minRow = (int) (rectangle.getY() / tilePixelHeight);
                maxRow = (int) ((rectangle.getY() + rectangle.getHeight()-1) / tilePixelHeight);

                if (minColumn < 0) minColumn = 0;
                if (maxColumn >= mapWidth) maxColumn = mapWidth-1;
                if (minRow < 0) minRow = 0;
                if (minRow >= mapHeight) maxRow = mapHeight-1;

                for (int column = minColumn; column <= maxColumn; column++) {
                    for (int row = minRow; row <= maxRow; row++) {
                        if (blockMap[column][row] != null) return false;
                    }
                }
            }
        } else if (isBlockCollision) { // No sliders but there is collision
            validPosition = false;
        }

        return validPosition;
    }

    private boolean firstMax(int first, int a, int b, int c) {
        return first >= a && first >= b && first >= c;
    }

    /**
     * Based on Wikipedia article: http://es.wikipedia.org/wiki/Algoritmo_de_Bresenham
     */
    public boolean isCellLineCollision(int column0, int row0, int column1, int row1) {
        boolean segmentChange = false;
        int column, row, dColumn, dRow, p, incE, incNE, stepColumn, stepRow;
        dColumn = (column1 - column0);
        dRow = (row1 - row0);

        // Decide start and end point
        if (dRow < 0) {
            dRow *= -1;
            stepRow = -1;
        } else {
            stepRow = 1;
        }

        if (dColumn < 0) {
            dColumn *= -1;
            stepColumn = -1;
        } else {
            stepColumn = 1;
        }

        column = column0;
        row = row0;

        if (isCellLineCollision_Collide(column, row, segmentChange, stepColumn, stepRow)) {
            return false;
        }

        // Iterate to the end of the line
        if(dColumn > dRow) {
            p = 2*dRow - dColumn;
            incE = 2*dRow;
            incNE = 2*(dRow-dColumn);
            while (column != column1){
                column = column + stepColumn;
                if (p < 0){
                    p = p + incE;
                    segmentChange = false;
                } else {
                    row = row + stepRow;
                    p = p + incNE;
                    segmentChange = true;
                }
                if (isCellLineCollision_Collide(column, row, segmentChange, stepColumn, stepRow)) {
                    return false;
                }
            }
        } else {
            p = 2*dColumn - dRow;
            incE = 2*dColumn;
            incNE = 2*(dColumn-dRow);
            while (row != row1) {
                row = row + stepRow;
                if (p < 0) {
                    p = p + incE;
                    segmentChange = false;
                } else {
                    column = column + stepColumn;
                    p = p + incNE;
                    segmentChange = true;
                }
                if (isCellLineCollision_Collide(column, row, segmentChange, stepColumn, stepRow)) {
                    return false;
                }
            }
        }

        return true;
    }

    private boolean isCellLineCollision_Collide(int column, int row, boolean segmentChange, int stepColumn, int stepRow) {
        if (Debug.DEBUG) Debug.addTestCell(column, row, segmentChange, stepColumn, stepRow);

        BlockCell blockCell = blockMap[column][row];
        if (blockCell != null && blockCell.isHeight(EBlockHeight.HIGH)) {
            return true;
        } else if (segmentChange) {
            BlockCell antiAliasedBlockCell1 = blockMap[column-stepColumn][row];
            BlockCell antiAliasedBlockCell2 = blockMap[column][row-stepRow];
            if ((antiAliasedBlockCell1 != null && antiAliasedBlockCell1.isHeight(EBlockHeight.HIGH))
                || (antiAliasedBlockCell2 != null && antiAliasedBlockCell2.isHeight(EBlockHeight.HIGH))) {
                return true;
            }
        }

        return false;
    }

    public BlockCell getBlockAt(float x, float y) {
        int column = (int)(x / tilePixelWidth);
        int row = (int)(y / tilePixelHeight);

        return getBlockCell(column, row);
    }

    public BlockCell getBlockCell(int column, int row) {
        if (column < 0) {
            column = 0;
        } else if (column >= mapWidth) {
            column = mapWidth - 1;
        }

        if (row < 0) {
            row = 0;
        } else if (row >= mapHeight) {
            row = mapHeight - 1;
        }
        return blockMap[column][row];
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Atti Soc. Veneto-Trent. Sci. Nat. 4: 125 (1875)

#### Original name
Dothidea napelli Ces., 1875

### Remarks
null


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>

    <string name="app_name">iLearnRW Android Prototyp</string>
    <string name="action_settings">Settings</string>
    <string name="hello_world">Hello world!</string>

</resources>


text:
using namespace psy;
using namespace C;

Binder::Binder(SemanticModel* semaModel, const SyntaxTree* tree)
    : SyntaxVisitor(tree)
    , semaModel_(semaModel)
    , stashedScope_(nullptr)
    , diagReporter_(this)
{}

Binder::~Binder()
{
}

void Binder::bind()
{
    // The outermost scope and symbol.
    scopes_.push(nullptr);
    syms_.push(nullptr);

    visit(tree_->root());

    PSY_ASSERT_W_MSG(scopes_.top() == nullptr, return, "expected outermost scope");
    scopes_.pop();
    PSY_ASSERT_W_MSG(scopes_.empty(), return, "unexpected remaining scope");

//    PSY_ASSERT_W_MSG(symDEFs_.top() == nullptr, return, "expected outermost symbol");
    syms_.pop();
//    PSY_ASSERT_W_MSG(symDEFs_.empty(), return, "unexpected remaining symbol");
}

void Binder::openScope(ScopeKind scopeK)
{
    std::unique_ptr<Scope> scope(new Scope(scopeK));
    scopes_.push(scope.get());

    auto enclosingScope = scopes_.top();
    enclosingScope->enclose(std::move(scope));
}

void Binder::reopenStashedScope()
{
    PSY_ASSERT(stashedScope_, return);

    scopes_.push(stashedScope_);
}

void Binder::closeScope()
{
    scopes_.pop();
}

void Binder::closeScopeAndStashIt()
{
    stashedScope_ = scopes_.top();
    scopes_.pop();
}

template <class SymT>
SymT* Binder::pushSym(const SyntaxNode* node, std::unique_ptr<SymT> sym)
{
    syms_.push(sym.get());
    return static_cast<SymT*>(semaModel_->storeDeclaredSym(node, std::move(sym)));
}

template FunctionSymbol* Binder::pushSym<FunctionSymbol>(const SyntaxNode*, std::unique_ptr<FunctionSymbol>);
template FieldSymbol* Binder::pushSym<FieldSymbol>(const SyntaxNode*, std::unique_ptr<FieldSymbol>);
template EnumeratorSymbol* Binder::pushSym<EnumeratorSymbol>(const SyntaxNode*, std::unique_ptr<EnumeratorSymbol>);
template ParameterSymbol* Binder::pushSym<ParameterSymbol>(const SyntaxNode*, std::unique_ptr<ParameterSymbol>);
template VariableSymbol* Binder::pushSym<VariableSymbol>(const SyntaxNode*, std::unique_ptr<VariableSymbol>);
template ArrayTypeSymbol* Binder::pushSym<ArrayTypeSymbol>(const SyntaxNode*, std::unique_ptr<ArrayTypeSymbol>);
template NamedTypeSymbol* Binder::pushSym<NamedTypeSymbol>(const SyntaxNode*, std::unique_ptr<NamedTypeSymbol>);
template PointerTypeSymbol* Binder::pushSym<PointerTypeSymbol>(const SyntaxNode*, std::unique_ptr<PointerTypeSymbol>);

void Binder::popSym()
{
    syms_.pop();
}

template <class TySymT>
TySymT* Binder::pushTySym(std::unique_ptr<TySymT> tySym)
{
    tySyms_.push(tySym.get());
    return static_cast<TySymT*>(semaModel_->storeUsedSym(std::move(tySym)));
}

template ArrayTypeSymbol* Binder::pushTySym<ArrayTypeSymbol>(std::unique_ptr<ArrayTypeSymbol>);
template FunctionTypeSymbol* Binder::pushTySym<FunctionTypeSymbol>(std::unique_ptr<FunctionTypeSymbol>);
template NamedTypeSymbol* Binder::pushTySym<NamedTypeSymbol>(std::unique_ptr<NamedTypeSymbol>);
template PointerTypeSymbol* Binder::pushTySym<PointerTypeSymbol>(std::unique_ptr<PointerTypeSymbol>);

void Binder::popTySym()
{
    tySyms_.pop();
}

    //--------------//
    // Declarations //
    //--------------//

SyntaxVisitor::Action Binder::visitTranslationUnit(const TranslationUnitSyntax* node)
{
    makeSymAndPushIt<LibrarySymbol>(node);

    openScope(ScopeKind::File);

    for (auto declIt = node->declarations(); declIt; declIt = declIt->next)
        visit(declIt->value);

    closeScope();

    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitIncompleteDeclaration(const IncompleteDeclarationSyntax* node)
{
    ConstraintsInDeclarations::UselessDeclaration(node->lastToken(), &diagReporter_);

    for (auto specIt = node->specifiers(); specIt; specIt = specIt->next)
        ;

    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitStructOrUnionDeclaration(const StructOrUnionDeclarationSyntax* node)
{
    return visitStructOrUnionDeclaration_AtSpecifier(node);
}

SyntaxVisitor::Action Binder::visitStructOrUnionDeclaration_DONE(const StructOrUnionDeclarationSyntax* node)
{
    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitEnumDeclaration(const EnumDeclarationSyntax* node)
{
    return visitEnumDeclaration_AtSpecifier(node);
}

SyntaxVisitor::Action Binder::visitEnumDeclaration_DONE(const EnumDeclarationSyntax* node)
{
    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitVariableAndOrFunctionDeclaration(
        const VariableAndOrFunctionDeclarationSyntax* node)
{
    return visitVariableAndOrFunctionDeclaration_AtSpecifiers(node);
}

SyntaxVisitor::Action Binder::visitVariableAndOrFunctionDeclaration_DONE(
        const VariableAndOrFunctionDeclarationSyntax*)
{
    popTySym();

    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitFieldDeclaration(const FieldDeclarationSyntax* node)
{
    return visitFieldDeclaration_AtSpecifiers(node);
}

SyntaxVisitor::Action Binder::visitFieldDeclaration_DONE(const FieldDeclarationSyntax*)
{
    popTySym();

    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitEnumeratorDeclaration(const EnumeratorDeclarationSyntax* node)
{
    return visitEnumeratorDeclaration_AtImplicitSpecifier(node);
}

SyntaxVisitor::Action Binder::visitEnumeratorDeclaration_DONE(const EnumeratorDeclarationSyntax* node)
{
    popTySym();

    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitParameterDeclaration(const ParameterDeclarationSyntax* node)
{
    return visitParameterDeclaration_AtSpecifiers(node);
}

SyntaxVisitor::Action Binder::visitParameterDeclaration_DONE(const ParameterDeclarationSyntax*)
{
    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitStaticAssertDeclaration(const StaticAssertDeclarationSyntax*)
{
    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitFunctionDefinition(const FunctionDefinitionSyntax* node)
{
    return visitFunctionDefinition_AtSpecifiers(node);
}

SyntaxVisitor::Action Binder::visitFunctionDefinition_DONE(const FunctionDefinitionSyntax* node)
{
    popTySym();

    return Action::Skip;
}

    //------------//
    // Statements //
    //------------//

SyntaxVisitor::Action Binder::visitCompoundStatement(const CompoundStatementSyntax* node)
{
    openScope(ScopeKind::Block);

    for (auto stmtIt = node->statements(); stmtIt; stmtIt = stmtIt->next)
        visit(stmtIt->value);

    closeScope();

    return Action::Skip;
}

SyntaxVisitor::Action Binder::visitDeclarationStatement(const DeclarationStatementSyntax* node)
{
    visit(node->declaration());

    return Action::Skip;
}


text:
using NUnit.Framework;

using MsieJavaScriptEngine.Test.Common;

namespace MsieJavaScriptEngine.Test.Classic
{
	[TestFixture]
	public class Es5Tests : Es5TestsBase
	{
		protected override JsEngineMode EngineMode => JsEngineMode.Classic;
		protected override bool UseEcmaScript5Polyfill => true;
		protected override bool UseJson2Library => true;

		#region Object methods

		[Test]
		public override void ObjectKeysMethodIsSupported()
		{
			// Arrange
			const string input1 = "Object.keys(['a', 'b', 'c']).toString();";
			const string targetOutput1 = "0,1,2";

			const string input2 = "Object.keys({ 0: 'a', 1: 'b', 2: 'c' }).toString();";
			const string targetOutput2 = "0,1,2";

			const string input3 = "Object.keys({ 100: 'a', 2: 'b', 7: 'c' }).toString();";
			const string targetOutput3 = "100,2,7";

			const string initCode4 = @"var myObj = function() { };
myObj.prototype = { getFoo: { value: function () { return this.foo } } };;
myObj.foo = 1;
";
			const string input4 = "Object.keys(myObj).toString();";
			const string targetOutput4 = "foo";

			// Act
			string output1;
			string output2;
			string output3;
			string output4;

			using (var jsEngine = CreateJsEngine())
			{
				output1 = jsEngine.Evaluate<string>(input1);
				output2 = jsEngine.Evaluate<string>(input2);
				output3 = jsEngine.Evaluate<string>(input3);

				jsEngine.Execute(initCode4);
				output4 = jsEngine.Evaluate<string>(input4);
			}

			// Assert
			Assert.AreEqual(targetOutput1, output1);
			Assert.AreEqual(targetOutput2, output2);
			Assert.AreEqual(targetOutput3, output3);
			Assert.AreEqual(targetOutput4, output4);
		}

		#endregion
	}
}


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Gen. fung. (Minneapolis) (1909)

#### Original name
Sticta physciospora Nyl.

### Remarks
null


text:
This example will create user accounts and demonstrate how to handle model and controller validation. We will create a form, process it, and display any errors to the user. We will be assuming that the Model_User class contains a method called `hash_password` that is used to turn the plaintext passwords into some kind of hash. The implementation of the hashing methods are beyond the scope of this example and should be provided with the Authentication library you decide to use.

## SQL schema

    CREATE TABLE IF NOT EXISTS `members` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `username` varchar(32) NOT NULL,
      `password` varchar(100) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

## Model

    <?php defined('SYSPATH') or die('No direct access allowed.');

    class Model_Member extends ORM {

        public function rules()
        {
            return array(
                'username' => array(
                    array('not_empty'),
                    array('min_length', array(':value', 4)),
                    array('max_length', array(':value', 32)),
                    array(array($this, 'username_available')),
                ),
                'password' => array(
                    array('not_empty'),
                ),
            );
        }

        public function filters()
        {
            return array(
                'password' => array(
                    array(array($this, 'hash_password')),
                ),
            );
        }

        public function username_available($username)
        {
            // There are simpler ways to do this, but I will use ORM for the sake of the example
            return ORM::factory('member', array('username' => $username))->loaded();
        }

        public function hash_password($password)
        {
            // Do something to hash the password
        }
    }

## HTML Form

Please forgive my slightly ugly form. I am trying not to use any modules or unrelated magic. :)

    <form action="<?= URL::site('/members'); ?>" method="post" accept-charset="utf-8">
        Username:
        <input id="username" type="text" name="username" value="<?= Arr::get($values, 'username'); ?>" />
        <?= Arr::get($errors, 'username'); ?>

        Password:
        <input id="password" type="password" name="password" value="<?= Arr::get($values, 'password'); ?>" />
        <?= Arr::get($errors, 'password'); ?>

        Repeat Password:
        <input id="password_confirm" type="password" name="_external[password_confirm]" value="<?= Arr::path($values, '_external.password_confirm'); ?>" />
        <?= Arr::path($errors, '_external.password_confirm'); ?>

        <button type="submit">Create</button>
    </form>

## Controller

[!!] Remember that the `password` will be hashed as soon as it is set in the model, for this reason, it is impossible to validate it's length or the fact that it matches the `password_confirm` field. The model should not care about validating the `password_confirm` field, so we add that logic to the controller and simply ask the model to bundle the errors into one tidy array. Read the [filters](filters) section to understand how those work.

    public function action_create()
    {
        $view = View::factory('members/create')
            ->set('values', $_POST)
            ->bind('errors', $errors);

        if ($_POST)
        {
            $member = ORM::factory('member')
                // The ORM::values() method is a shortcut to assign many values at once
                ->values($_POST, array('username', 'password'));

            $external_values = array(
                // The unhashed password is needed for comparing to the password_confirm field
                'password' => Arr::get($_POST, 'password'),
            // Add all external values
            ) + Arr::get($_POST, '_external', array());
            $extra = Validation::factory($external_values)
                ->rule('password_confirm', 'matches', array(':validation', ':field', 'password'));

            try
            {
                $member->save($extra);
                // Redirect the user to his page
                $this->request->redirect('members/'.$member->id);
            }
            catch (ORM_Validation_Exception $e)
            {
                $errors = $e->errors('models');
            }
        }

        $this->response->body($view);
    }

## Messages

**application/messages/models/member.php**

    return array(
        'username' => array(
            'not_empty' => 'You must provide a username.',
            'min_length' => 'The username must be at least :param2 characters long.',
            'max_length' => 'The username must be less than :param2 characters long.',
            'username_available' => 'This username is not available.',
        ),
        'password' => array(
            'not_empty' => 'You must provide a password.',
        ),
    );

**application/messages/models/member/_external.php**

    return array(
        'password_confirm' => array(
            'matches' => 'The password fields did not match.',
        ),
    );


text: export { DocumentListComponent } from './document-list.component'


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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.jenkins.blueocean</groupId>
        <artifactId>blueocean-parent</artifactId>
        <version>${revision}${changelist}</version>
    </parent>

    <artifactId>blueocean-pipeline-scm-api</artifactId>
    <packaging>hpi</packaging>

    <name>Pipeline SCM API for Blue Ocean</name>
    <url>https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean/doc/BlueOcean.adoc</url>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blueocean-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>branch-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins.workflow</groupId>
            <artifactId>workflow-multibranch</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>credentials</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jenkins-ci.plugins</groupId>
            <artifactId>pubsub-light</artifactId>
        </dependency>
    </dependencies>
</project>


text:
<?php

namespace App\Observers;

use App\Authority;
use App\Elasticsearch\Repositories\AuthorityRepository;
use App\Elasticsearch\Repositories\ItemRepository;
use App\Item;

class AuthorityObserver
{
    protected $authorityRepository;

    protected $itemRepository;

    public function __construct(
        AuthorityRepository $authorityRepository,
        ItemRepository $itemRepository
    ) {
        $this->authorityRepository = $authorityRepository;
        $this->itemRepository = $itemRepository;
    }

    public function saved(Authority $authority)
    {
        $this->authorityRepository->indexAllLocales($authority->fresh());
    }

    public function deleted(Authority $authority)
    {
        $this->authorityRepository->deleteAllLocales($authority);
    }

    public function deleting(Authority $authority)
    {
        $authority->removeImage();
        $authority->nationalities()->detach();
        $authority->relationships()->detach();
        $authority->items()->detach();
        $authority->names()->delete();
        $authority->events()->delete();
    }
    public function belongsToManyAttached($relation, Authority $authority, $ids)
    {
        if ($authority->exists) {
            $this->authorityRepository->indexAllLocales($authority);
            if ($relation === 'items') {
                Item::findMany($ids)->each(function (Item $item) {
                    $this->itemRepository->indexAllLocales($item);
                });
            }
        }
    }

    public function belongsToManyDetached($relation, Authority $authority, $ids)
    {
        if ($authority->exists) {
            $this->authorityRepository->indexAllLocales($authority);
            if ($relation === 'items') {
                Item::findMany($ids)->each(function (Item $item) {
                    $this->itemRepository->indexAllLocales($item);
                });
            }
        }
    }
}


text:
package org.w3c.domts.level1.core;

import org.w3c.dom.*;

import org.w3c.domts.DOMTestCase;
import org.w3c.domts.DOMTestDocumentBuilderFactory;

/**
 * The "getParentNode()" method for an Attr node should return null.  Retrieve
 * the attribute named "domestic" from the last child of the first employee
 * and examine its parentNode attribute.  This test also uses the "getNamedItem(name)"
 * method from the NamedNodeMap interface.
* @author Curt Arnold
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-1060184317
* @see http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-637646024
*/
public final class hc_attrparentnodenull extends DOMTestCase {

   /**
    * Constructor.
    * @param factory document factory, may not be null
    * @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
    */
   public hc_attrparentnodenull(final DOMTestDocumentBuilderFactory factory)  throws org.w3c.domts.DOMTestIncompatibleException {
      super(factory);

    //
    //   check if loaded documents are supported for content type
    //
    String contentType = getContentType();
    preload(contentType, "hc_staff", false);
    }

   /**
    * Runs the test case.
    * @throws Throwable Any uncaught exception causes test to fail
    */
   public void runTest() throws Throwable {
      Document doc;
      NodeList addressList;
      Node testNode;
      NamedNodeMap attributes;
      Attr domesticAttr;
      Node s;
      doc = (Document) load("hc_staff", false);
      addressList = doc.getElementsByTagName("acronym");
      testNode = addressList.item(0);
      attributes = testNode.getAttributes();
      domesticAttr = (Attr) attributes.getNamedItem("title");
      s = domesticAttr.getParentNode();
      assertNull("attrParentNodeNullAssert", s);
      }
   /**
    *  Gets URI that identifies the test.
    *  @return uri identifier of test
    */
   public String getTargetURI() {
      return "http://www.w3.org/2001/DOM-Test-Suite/level1/core/hc_attrparentnodenull";
   }
   /**
    * Runs this test from the command line.
    * @param args command line arguments
    */
   public static void main(final String[] args) {
        DOMTestCase.doMain(hc_attrparentnodenull.class, args);
   }
}


text:
/* eslint-env jest */
import mapControllerReducer from 'reducers/mapControllerReducer'
import actions from 'actions'

describe('Map Controller Reducer', () => {
  describe(actions.MAP_SWITCH_LAYER, () => {
    it('sets current branch', () => {
      const oldState = { branch: 'oldbranch' }
      const action = { type: actions.MAP_SWITCH_LAYER, branch: 'newbranch' }

      const newState = mapControllerReducer(oldState, action)

      expect(newState.branch).toEqual('newbranch')
    })
  })

  describe(actions.CHANGE_YEAR, () => {
    it('updates the year', () => {
      const oldState = { branch: 'oldbranch', year: '1970' }
      const action = { type: actions.CHANGE_YEAR, year: '2017' }

      const newState = mapControllerReducer(oldState, action)

      expect(newState).toEqual({ branch: 'oldbranch', year: '2017' })
    })
  })

  describe(actions.CHANGE_ACTIVE_DISTRICT, () => {
    it('updates the active district', () => {
      const oldState = { year: '1970' }
      const action = { type: actions.CHANGE_ACTIVE_DISTRICT, district: 'newDistrict' }

      const newState = mapControllerReducer(oldState, action)

      expect(newState).toEqual({ activeDistrict: 'newDistrict', year: '1970' })
    })
  })
})


text:
<?php
/**
 * Displays the left sidebar of the theme.
 *
 * @package Theme Horse
 * @subpackage Ambition
 * @since Ambition 1.0
 */
?>
<?php
// Calling the left sidebar
	if ( is_active_sidebar( 'ambition_left_sidebar' ) ) :
		dynamic_sidebar( 'ambition_left_sidebar' );
	endif;
?>


text:
package v1alpha1

import (
	"k8s.io/client-go/pkg/runtime"
)

const (
	DefaultServiceDNSDomain          = "cluster.local"
	DefaultServicesSubnet            = "10.96.0.0/12"
	DefaultKubernetesVersion         = "stable"
	DefaultKubernetesFallbackVersion = "v1.4.6"
	DefaultAPIBindPort               = 6443
	DefaultDiscoveryBindPort         = 9898
)

func addDefaultingFuncs(scheme *runtime.Scheme) error {
	RegisterDefaults(scheme)
	return scheme.AddDefaultingFuncs(
		SetDefaults_MasterConfiguration,
		SetDefaults_NodeConfiguration,
	)
}

func SetDefaults_MasterConfiguration(obj *MasterConfiguration) {
	if obj.KubernetesVersion == "" {
		obj.KubernetesVersion = DefaultKubernetesVersion
	}

	if obj.API.BindPort == 0 {
		obj.API.BindPort = DefaultAPIBindPort
	}

	if obj.Discovery.BindPort == 0 {
		obj.Discovery.BindPort = DefaultDiscoveryBindPort
	}

	if obj.Networking.ServiceSubnet == "" {
		obj.Networking.ServiceSubnet = DefaultServicesSubnet
	}

	if obj.Networking.DNSDomain == "" {
		obj.Networking.DNSDomain = DefaultServiceDNSDomain
	}
}

func SetDefaults_NodeConfiguration(obj *NodeConfiguration) {
	if obj.APIPort == 0 {
		obj.APIPort = DefaultAPIBindPort
	}

	if obj.DiscoveryPort == 0 {
		obj.DiscoveryPort = DefaultDiscoveryBindPort
	}
}