text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>io.permazen.annotation (Permazen 4.1.9 API)</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

io.permazen.annotation

Annotation Types

FollowPath

JCompositeIndex

JCompositeIndexes

JField

JFieldType

JListField

JMapField

JSetField

JTransient

OnChange

OnCreate

OnDelete

OnValidate

OnVersionChange

PermazenType


text:
package com.minecraftdimensions.bungeesuitechat.objects;

public class Channel {
	private String name;
	private String format;
	private String owner;
	private boolean muted;
	public boolean isDefault;
	public boolean open;

	public Channel(String name, String format, String owner, boolean muted, boolean isDefault, boolean open){
		this.name = name;
		this.format = format;
		this.owner = owner;
		this.muted = muted;
		this.isDefault = isDefault;
		this.open=open;
	}

	public Channel(String serialised){
		String data[] = serialised.split("~");
		name = data[0];
		format = data[1];
		owner = data[2];
		muted = Boolean.parseBoolean(data[3]);
		isDefault = Boolean.parseBoolean(data[4]);
		open = Boolean.parseBoolean(data[5]);
	}

	public String getName(){
		return name;
	}
	public void setName(String name){
		this.name = name;
	}
	public String getFormat(){
		return format;
	}
	public void setFormat(String format){
		this.format=format;
	}
	public String getOwner(){
		return owner;
	}
	public void setOwner(String owner){
		this.owner = owner;
	}
	public boolean isOwner(String owner){
		return this.owner.equals(owner);
	}
	public boolean isMuted(){
		return muted;
	}
	public void setMuted(boolean mute){
		this.muted = mute;
	}
	public boolean isDefault(){
		return isDefault;
	}
	public String serialise(){
		return name+"~"+format+"~"+owner+"~"+muted+"~"+isDefault+"~"+open;
	}

}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// A parser for the Type 2 Charstring Format.
// http://www.adobe.com/devnet/font/pdfs/5177.Type2.pdf

#include "cff_type2_charstring.h"

#include <climits>
#include <cstdio>
#include <cstring>
#include <stack>
#include <string>
#include <utility>

#define TABLE_NAME "CFF"

namespace {

// Type 2 Charstring Implementation Limits. See Appendix. B in Adobe Technical
// Note #5177.
const int32_t kMaxSubrsCount = 65536;
const size_t kMaxCharStringLength = 65535;
const size_t kMaxArgumentStack = 48;
const size_t kMaxNumberOfStemHints = 96;
const size_t kMaxSubrNesting = 10;

// |dummy_result| should be a huge positive integer so callsubr and callgsubr
// will fail with the dummy value.
const int32_t dummy_result = INT_MAX;

bool ExecuteType2CharString(ots::OpenTypeFile *file,
                            size_t call_depth,
                            const ots::CFFIndex& global_subrs_index,
                            const ots::CFFIndex& local_subrs_index,
                            ots::Buffer *cff_table,
                            ots::Buffer *char_string,
                            std::stack<int32_t> *argument_stack,
                            bool *out_found_endchar,
                            bool *out_found_width,
                            size_t *in_out_num_stems);

#ifdef DUMP_T2CHARSTRING
// Converts |op| to a string and returns it.
const char *Type2CharStringOperatorToString(ots::Type2CharStringOperator op) {
  switch (op) {
  case ots::kHStem:
    return "HStem";
  case ots::kVStem:
    return "VStem";
  case ots::kVMoveTo:
    return "VMoveTo";
  case ots::kRLineTo:
    return "RLineTo";
  case ots::kHLineTo:
    return "HLineTo";
  case ots::kVLineTo:
    return "VLineTo";
  case ots::kRRCurveTo:
    return "RRCurveTo";
  case ots::kCallSubr:
    return "CallSubr";
  case ots::kReturn:
    return "Return";
  case ots::kEndChar:
    return "EndChar";
  case ots::kHStemHm:
    return "HStemHm";
  case ots::kHintMask:
    return "HintMask";
  case ots::kCntrMask:
    return "CntrMask";
  case ots::kRMoveTo:
    return "RMoveTo";
  case ots::kHMoveTo:
    return "HMoveTo";
  case ots::kVStemHm:
    return "VStemHm";
  case ots::kRCurveLine:
    return "RCurveLine";
  case ots::kRLineCurve:
    return "RLineCurve";
  case ots::kVVCurveTo:
    return "VVCurveTo";
  case ots::kHHCurveTo:
    return "HHCurveTo";
  case ots::kCallGSubr:
    return "CallGSubr";
  case ots::kVHCurveTo:
    return "VHCurveTo";
  case ots::kHVCurveTo:
    return "HVCurveTo";
  case ots::kDotSection:
    return "DotSection";
  case ots::kAnd:
    return "And";
  case ots::kOr:
    return "Or";
  case ots::kNot:
    return "Not";
  case ots::kAbs:
    return "Abs";
  case ots::kAdd:
    return "Add";
  case ots::kSub:
    return "Sub";
  case ots::kDiv:
    return "Div";
  case ots::kNeg:
    return "Neg";
  case ots::kEq:
    return "Eq";
  case ots::kDrop:
    return "Drop";
  case ots::kPut:
    return "Put";
  case ots::kGet:
    return "Get";
  case ots::kIfElse:
    return "IfElse";
  case ots::kRandom:
    return "Random";
  case ots::kMul:
    return "Mul";
  case ots::kSqrt:
    return "Sqrt";
  case ots::kDup:
    return "Dup";
  case ots::kExch:
    return "Exch";
  case ots::kIndex:
    return "Index";
  case ots::kRoll:
    return "Roll";
  case ots::kHFlex:
    return "HFlex";
  case ots::kFlex:
    return "Flex";
  case ots::kHFlex1:
    return "HFlex1";
  case ots::kFlex1:
    return "Flex1";
  }

  return "UNKNOWN";
}
#endif

// Read one or more bytes from the |char_string| buffer and stores the number
// read on |out_number|. If the number read is an operator (ex 'vstem'), sets
// true on |out_is_operator|. Returns true if the function read a number.
bool ReadNextNumberFromType2CharString(ots::Buffer *char_string,
                                       int32_t *out_number,
                                       bool *out_is_operator) {
  uint8_t v = 0;
  if (!char_string->ReadU8(&v)) {
    return OTS_FAILURE();
  }
  *out_is_operator = false;

  // The conversion algorithm is described in Adobe Technical Note #5177, page
  // 13, Table 1.
  if (v <= 11) {
    *out_number = v;
    *out_is_operator = true;
  } else if (v == 12) {
    uint16_t result = (v << 8);
    if (!char_string->ReadU8(&v)) {
      return OTS_FAILURE();
    }
    result += v;
    *out_number = result;
    *out_is_operator = true;
  } else if (v <= 27) {
    // Special handling for v==19 and v==20 are implemented in
    // ExecuteType2CharStringOperator().
    *out_number = v;
    *out_is_operator = true;
  } else if (v == 28) {
    if (!char_string->ReadU8(&v)) {
      return OTS_FAILURE();
    }
    uint16_t result = (v << 8);
    if (!char_string->ReadU8(&v)) {
      return OTS_FAILURE();
    }
    result += v;
    *out_number = result;
  } else if (v <= 31) {
    *out_number = v;
    *out_is_operator = true;
  } else if (v <= 246) {
    *out_number = static_cast<int32_t>(v) - 139;
  } else if (v <= 250) {
    uint8_t w = 0;
    if (!char_string->ReadU8(&w)) {
      return OTS_FAILURE();
    }
    *out_number = ((static_cast<int32_t>(v) - 247) * 256) +
        static_cast<int32_t>(w) + 108;
  } else if (v <= 254) {
    uint8_t w = 0;
    if (!char_string->ReadU8(&w)) {
      return OTS_FAILURE();
    }
    *out_number = -((static_cast<int32_t>(v) - 251) * 256) -
        static_cast<int32_t>(w) - 108;
  } else if (v == 255) {
    // TODO(yusukes): We should not skip the 4 bytes. Note that when v is 255,
    // we should treat the following 4-bytes as a 16.16 fixed-point number
    // rather than 32bit signed int.
    if (!char_string->Skip(4)) {
      return OTS_FAILURE();
    }
    *out_number = dummy_result;
  } else {
    return OTS_FAILURE();
  }

  return true;
}

// Executes |op| and updates |argument_stack|. Returns true if the execution
// succeeds. If the |op| is kCallSubr or kCallGSubr, the function recursively
// calls ExecuteType2CharString() function. The arguments other than |op| and
// |argument_stack| are passed for that reason.
bool ExecuteType2CharStringOperator(ots::OpenTypeFile *file,
                                    int32_t op,
                                    size_t call_depth,
                                    const ots::CFFIndex& global_subrs_index,
                                    const ots::CFFIndex& local_subrs_index,
                                    ots::Buffer *cff_table,
                                    ots::Buffer *char_string,
                                    std::stack<int32_t> *argument_stack,
                                    bool *out_found_endchar,
                                    bool *in_out_found_width,
                                    size_t *in_out_num_stems) {
  const size_t stack_size = argument_stack->size();

  switch (op) {
  case ots::kCallSubr:
  case ots::kCallGSubr: {
    const ots::CFFIndex& subrs_index =
        (op == ots::kCallSubr ? local_subrs_index : global_subrs_index);

    if (stack_size < 1) {
      return OTS_FAILURE();
    }
    int32_t subr_number = argument_stack->top();
    argument_stack->pop();
    if (subr_number == dummy_result) {
      // For safety, we allow subr calls only with immediate subr numbers for
      // now. For example, we allow "123 callgsubr", but does not allow "100 12
      // add callgsubr". Please note that arithmetic and conditional operators
      // always push the |dummy_result| in this implementation.
      return OTS_FAILURE();
    }

    // See Adobe Technical Note #5176 (CFF), "16. Local/GlobalSubrs INDEXes."
    int32_t bias = 32768;
    if (subrs_index.count < 1240) {
      bias = 107;
    } else if (subrs_index.count < 33900) {
      bias = 1131;
    }
    subr_number += bias;

    // Sanity checks of |subr_number|.
    if (subr_number < 0) {
      return OTS_FAILURE();
    }
    if (subr_number >= kMaxSubrsCount) {
      return OTS_FAILURE();
    }
    if (subrs_index.offsets.size() <= static_cast<size_t>(subr_number + 1)) {
      return OTS_FAILURE();  // The number is out-of-bounds.
    }

    // Prepare ots::Buffer where we're going to jump.
    const size_t length =
      subrs_index.offsets[subr_number + 1] - subrs_index.offsets[subr_number];
    if (length > kMaxCharStringLength) {
      return OTS_FAILURE();
    }
    const size_t offset = subrs_index.offsets[subr_number];
    cff_table->set_offset(offset);
    if (!cff_table->Skip(length)) {
      return OTS_FAILURE();
    }
    ots::Buffer char_string_to_jump(cff_table->buffer() + offset, length);

    return ExecuteType2CharString(file,
                                  call_depth + 1,
                                  global_subrs_index,
                                  local_subrs_index,
                                  cff_table,
                                  &char_string_to_jump,
                                  argument_stack,
                                  out_found_endchar,
                                  in_out_found_width,
                                  in_out_num_stems);
  }

  case ots::kReturn:
    return true;

  case ots::kEndChar:
    *out_found_endchar = true;
    *in_out_found_width = true;  // just in case.
    return true;

  case ots::kHStem:
  case ots::kVStem:
  case ots::kHStemHm:
  case ots::kVStemHm: {
    bool successful = false;
    if (stack_size < 2) {
      return OTS_FAILURE();
    }
    if ((stack_size % 2) == 0) {
      successful = true;
    } else if ((!(*in_out_found_width)) && (((stack_size - 1) % 2) == 0)) {
      // The -1 is for "width" argument. For details, see Adobe Technical Note
      // #5177, page 16, note 4.
      successful = true;
    }
    (*in_out_num_stems) += (stack_size / 2);
    if ((*in_out_num_stems) > kMaxNumberOfStemHints) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    *in_out_found_width = true;  // always set true since "w" might be 0 byte.
    return successful ? true : OTS_FAILURE();
  }

  case ots::kRMoveTo: {
    bool successful = false;
    if (stack_size == 2) {
      successful = true;
    } else if ((!(*in_out_found_width)) && (stack_size - 1 == 2)) {
      successful = true;
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    *in_out_found_width = true;
    return successful ? true : OTS_FAILURE();
  }

  case ots::kVMoveTo:
  case ots::kHMoveTo: {
    bool successful = false;
    if (stack_size == 1) {
      successful = true;
    } else if ((!(*in_out_found_width)) && (stack_size - 1 == 1)) {
      successful = true;
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    *in_out_found_width = true;
    return successful ? true : OTS_FAILURE();
  }

  case ots::kHintMask:
  case ots::kCntrMask: {
    bool successful = false;
    if (stack_size == 0) {
      successful = true;
    } else if ((!(*in_out_found_width)) && (stack_size == 1)) {
      // A number for "width" is found.
      successful = true;
    } else if ((!(*in_out_found_width)) ||  // in this case, any sizes are ok.
               ((stack_size % 2) == 0)) {
      // The numbers are vstem definition.
      // See Adobe Technical Note #5177, page 24, hintmask.
      (*in_out_num_stems) += (stack_size / 2);
      if ((*in_out_num_stems) > kMaxNumberOfStemHints) {
        return OTS_FAILURE();
      }
      successful = true;
    }
    if (!successful) {
       return OTS_FAILURE();
    }

    if ((*in_out_num_stems) == 0) {
      return OTS_FAILURE();
    }
    const size_t mask_bytes = (*in_out_num_stems + 7) / 8;
    if (!char_string->Skip(mask_bytes)) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    *in_out_found_width = true;
    return true;
  }

  case ots::kRLineTo:
    if (!(*in_out_found_width)) {
      // The first stack-clearing operator should be one of hstem, hstemhm,
      // vstem, vstemhm, cntrmask, hintmask, hmoveto, vmoveto, rmoveto, or
      // endchar. For details, see Adobe Technical Note #5177, page 16, note 4.
      return OTS_FAILURE();
    }
    if (stack_size < 2) {
      return OTS_FAILURE();
    }
    if ((stack_size % 2) != 0) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kHLineTo:
  case ots::kVLineTo:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 1) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kRRCurveTo:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 6) {
      return OTS_FAILURE();
    }
    if ((stack_size % 6) != 0) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kRCurveLine:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 8) {
      return OTS_FAILURE();
    }
    if (((stack_size - 2) % 6) != 0) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kRLineCurve:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 8) {
      return OTS_FAILURE();
    }
    if (((stack_size - 6) % 2) != 0) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kVVCurveTo:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 4) {
      return OTS_FAILURE();
    }
    if (((stack_size % 4) != 0) &&
        (((stack_size - 1) % 4) != 0)) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kHHCurveTo: {
    bool successful = false;
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 4) {
      return OTS_FAILURE();
    }
    if ((stack_size % 4) == 0) {
      // {dxa dxb dyb dxc}+
      successful = true;
    } else if (((stack_size - 1) % 4) == 0) {
      // dy1? {dxa dxb dyb dxc}+
      successful = true;
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return successful ? true : OTS_FAILURE();
  }

  case ots::kVHCurveTo:
  case ots::kHVCurveTo: {
    bool successful = false;
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size < 4) {
      return OTS_FAILURE();
    }
    if (((stack_size - 4) % 8) == 0) {
      // dx1 dx2 dy2 dy3 {dya dxb dyb dxc dxd dxe dye dyf}*
      successful = true;
    } else if ((stack_size >= 5) &&
               ((stack_size - 5) % 8) == 0) {
      // dx1 dx2 dy2 dy3 {dya dxb dyb dxc dxd dxe dye dyf}* dxf
      successful = true;
    } else if ((stack_size >= 8) &&
               ((stack_size - 8) % 8) == 0) {
      // {dxa dxb dyb dyc dyd dxe dye dxf}+
      successful = true;
    } else if ((stack_size >= 9) &&
               ((stack_size - 9) % 8) == 0) {
      // {dxa dxb dyb dyc dyd dxe dye dxf}+ dyf?
      successful = true;
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return successful ? true : OTS_FAILURE();
  }

  case ots::kDotSection:
    // Deprecated operator but harmless, we probably should drop it some how.
    if (stack_size != 0) {
      return OTS_FAILURE();
    }
    return true;

  case ots::kAnd:
  case ots::kOr:
  case ots::kEq:
  case ots::kAdd:
  case ots::kSub:
    if (stack_size < 2) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kNot:
  case ots::kAbs:
  case ots::kNeg:
    if (stack_size < 1) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kDiv:
    // TODO(yusukes): Should detect div-by-zero errors.
    if (stack_size < 2) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kDrop:
    if (stack_size < 1) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    return true;

  case ots::kPut:
  case ots::kGet:
  case ots::kIndex:
    // For now, just call OTS_FAILURE since there is no way to check whether the
    // index argument, |i|, is out-of-bounds or not. Fortunately, no OpenType
    // fonts I have (except malicious ones!) use the operators.
    // TODO(yusukes): Implement them in a secure way.
    return OTS_FAILURE();

  case ots::kRoll:
    // Likewise, just call OTS_FAILURE for kRoll since there is no way to check
    // whether |N| is smaller than the current stack depth or not.
    // TODO(yusukes): Implement them in a secure way.
    return OTS_FAILURE();

  case ots::kRandom:
    // For now, we don't handle the 'random' operator since the operator makes
    // it hard to analyze hinting code statically.
    return OTS_FAILURE();

  case ots::kIfElse:
    if (stack_size < 4) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kMul:
    // TODO(yusukes): Should detect overflows.
    if (stack_size < 2) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kSqrt:
    // TODO(yusukes): Should check if the argument is negative.
    if (stack_size < 1) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kDup:
    if (stack_size < 1) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->push(dummy_result);
    argument_stack->push(dummy_result);
    if (argument_stack->size() > kMaxArgumentStack) {
      return OTS_FAILURE();
    }
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kExch:
    if (stack_size < 2) {
      return OTS_FAILURE();
    }
    argument_stack->pop();
    argument_stack->pop();
    argument_stack->push(dummy_result);
    argument_stack->push(dummy_result);
    // TODO(yusukes): Implement this. We should push a real value for all
    // arithmetic and conditional operations.
    return true;

  case ots::kHFlex:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size != 7) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kFlex:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size != 13) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kHFlex1:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size != 9) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;

  case ots::kFlex1:
    if (!(*in_out_found_width)) {
      return OTS_FAILURE();
    }
    if (stack_size != 11) {
      return OTS_FAILURE();
    }
    while (!argument_stack->empty())
      argument_stack->pop();
    return true;
  }

  return OTS_FAILURE_MSG("Undefined operator: %d (0x%x)", op, op);
}

// Executes |char_string| and updates |argument_stack|.
//
// call_depth: The current call depth. Initial value is zero.
// global_subrs_index: Global subroutines.
// local_subrs_index: Local subroutines for the current glyph.
// cff_table: A whole CFF table which contains all global and local subroutines.
// char_string: A charstring we'll execute. |char_string| can be a main routine
//              in CharString INDEX, or a subroutine in GlobalSubr/LocalSubr.
// argument_stack: The stack which an operator in |char_string| operates.
// out_found_endchar: true is set if |char_string| contains 'endchar'.
// in_out_found_width: true is set if |char_string| contains 'width' byte (which
//                     is 0 or 1 byte.)
// in_out_num_stems: total number of hstems and vstems processed so far.
bool ExecuteType2CharString(ots::OpenTypeFile *file,
                            size_t call_depth,
                            const ots::CFFIndex& global_subrs_index,
                            const ots::CFFIndex& local_subrs_index,
                            ots::Buffer *cff_table,
                            ots::Buffer *char_string,
                            std::stack<int32_t> *argument_stack,
                            bool *out_found_endchar,
                            bool *in_out_found_width,
                            size_t *in_out_num_stems) {
  if (call_depth > kMaxSubrNesting) {
    return OTS_FAILURE();
  }
  *out_found_endchar = false;

  const size_t length = char_string->length();
  while (char_string->offset() < length) {
    int32_t operator_or_operand = 0;
    bool is_operator = false;
    if (!ReadNextNumberFromType2CharString(char_string,
                                           &operator_or_operand,
                                           &is_operator)) {
      return OTS_FAILURE();
    }

#ifdef DUMP_T2CHARSTRING
    /*
      You can dump all operators and operands (except mask bytes for hintmask
      and cntrmask) by the following code:
    */

      if (!is_operator) {
        std::fprintf(stderr, "#%d# ", operator_or_operand);
      } else {
        std::fprintf(stderr, "#%s#\n",
           Type2CharStringOperatorToString(
               ots::Type2CharStringOperator(operator_or_operand))
           );
      }
#endif

    if (!is_operator) {
      argument_stack->push(operator_or_operand);
      if (argument_stack->size() > kMaxArgumentStack) {
        return OTS_FAILURE();
      }
      continue;
    }

    // An operator is found. Execute it.
    if (!ExecuteType2CharStringOperator(file,
                                        operator_or_operand,
                                        call_depth,
                                        global_subrs_index,
                                        local_subrs_index,
                                        cff_table,
                                        char_string,
                                        argument_stack,
                                        out_found_endchar,
                                        in_out_found_width,
                                        in_out_num_stems)) {
      return OTS_FAILURE();
    }
    if (*out_found_endchar) {
      return true;
    }
    if (operator_or_operand == ots::kReturn) {
      return true;
    }
  }

  // No endchar operator is found.
  return OTS_FAILURE();
}

// Selects a set of subroutings for |glyph_index| from |cff| and sets it on
// |out_local_subrs_to_use|. Returns true on success.
bool SelectLocalSubr(const std::map<uint16_t, uint8_t> &fd_select,
                     const std::vector<ots::CFFIndex *> &local_subrs_per_font,
                     const ots::CFFIndex *local_subrs,
                     uint16_t glyph_index,  // 0-origin
                     const ots::CFFIndex **out_local_subrs_to_use) {
  *out_local_subrs_to_use = NULL;

  // First, find local subrs from |local_subrs_per_font|.
  if ((fd_select.size() > 0) &&
      (!local_subrs_per_font.empty())) {
    // Look up FDArray index for the glyph.
    std::map<uint16_t, uint8_t>::const_iterator iter =
        fd_select.find(glyph_index);
    if (iter == fd_select.end()) {
      return OTS_FAILURE();
    }
    const uint8_t fd_index = iter->second;
    if (fd_index >= local_subrs_per_font.size()) {
      return OTS_FAILURE();
    }
    *out_local_subrs_to_use = local_subrs_per_font.at(fd_index);
  } else if (local_subrs) {
    // Second, try to use |local_subrs|. Most Latin fonts don't have FDSelect
    // entries. If The font has a local subrs index associated with the Top
    // DICT (not FDArrays), use it.
    *out_local_subrs_to_use = local_subrs;
  } else {
    // Just return NULL.
    *out_local_subrs_to_use = NULL;
  }

  return true;
}

}  // namespace

namespace ots {

bool ValidateType2CharStringIndex(
    ots::OpenTypeFile *file,
    const CFFIndex& char_strings_index,
    const CFFIndex& global_subrs_index,
    const std::map<uint16_t, uint8_t> &fd_select,
    const std::vector<CFFIndex *> &local_subrs_per_font,
    const CFFIndex *local_subrs,
    Buffer* cff_table) {
  const uint16_t num_offsets =
      static_cast<uint16_t>(char_strings_index.offsets.size());
  if (num_offsets != char_strings_index.offsets.size() || num_offsets == 0) {
    return OTS_FAILURE();  // no charstring.
  }

  // For each glyph, validate the corresponding charstring.
  for (uint16_t i = 1; i < num_offsets; ++i) {
    // Prepare a Buffer object, |char_string|, which contains the charstring
    // for the |i|-th glyph.
    const size_t length =
      char_strings_index.offsets[i] - char_strings_index.offsets[i - 1];
    if (length > kMaxCharStringLength) {
      return OTS_FAILURE();
    }
    const size_t offset = char_strings_index.offsets[i - 1];
    cff_table->set_offset(offset);
    if (!cff_table->Skip(length)) {
      return OTS_FAILURE();
    }
    Buffer char_string(cff_table->buffer() + offset, length);

    // Get a local subrs for the glyph.
    const uint16_t glyph_index = i - 1;  // index in the map is 0-origin.
    const CFFIndex *local_subrs_to_use = NULL;
    if (!SelectLocalSubr(fd_select,
                         local_subrs_per_font,
                         local_subrs,
                         glyph_index,
                         &local_subrs_to_use)) {
      return OTS_FAILURE();
    }
    // If |local_subrs_to_use| is still NULL, use an empty one.
    CFFIndex default_empty_subrs;
    if (!local_subrs_to_use){
      local_subrs_to_use = &default_empty_subrs;
    }

    // Check a charstring for the |i|-th glyph.
    std::stack<int32_t> argument_stack;
    bool found_endchar = false;
    bool found_width = false;
    size_t num_stems = 0;
    if (!ExecuteType2CharString(file,
                                0 /* initial call_depth is zero */,
                                global_subrs_index, *local_subrs_to_use,
                                cff_table, &char_string, &argument_stack,
                                &found_endchar, &found_width, &num_stems)) {
      return OTS_FAILURE();
    }
    if (!found_endchar) {
      return OTS_FAILURE();
    }
  }
  return true;
}

}  // namespace ots

#undef TABLE_NAME


text:
package org.jsoup.nodes;

import org.jsoup.helper.StringUtil;
import org.jsoup.parser.Parser;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.CharsetEncoder;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * HTML entities, and escape routines.
 * Source: W3C HTML
 * named character references.
 */
public class Entities {
    public enum EscapeMode {
        /** Restricted entities suitable for XHTML output: lt, gt, amp, and quot only. */
        xhtml(xhtmlByVal),
        /** Default HTML output entities. */
        base(baseByVal),
        /** Complete HTML entities. */
        extended(fullByVal);

        private Map<Character, String> map;

        EscapeMode(Map<Character, String> map) {
            this.map = map;
        }

        public Map<Character, String> getMap() {
            return map;
        }
    }

    private static final Map<String, Character> full;
    private static final Map<Character, String> xhtmlByVal;
    private static final Map<String, Character> base;
    private static final Map<Character, String> baseByVal;
    private static final Map<Character, String> fullByVal;

    private Entities() {}

    /**
     * Check if the input is a known named entity
     * @param name the possible entity name (e.g. "lt" or "amp")
     * @return true if a known named entity
     */
    public static boolean isNamedEntity(String name) {
        return full.containsKey(name);
    }

    /**
     * Check if the input is a known named entity in the base entity set.
     * @param name the possible entity name (e.g. "lt" or "amp")
     * @return true if a known named entity in the base set
     * @see #isNamedEntity(String)
     */
    public static boolean isBaseNamedEntity(String name) {
        return base.containsKey(name);
    }

    /**
     * Get the Character value of the named entity
     * @param name named entity (e.g. "lt" or "amp")
     * @return the Character value of the named entity (e.g. '<' or '&')
     */
    public static Character getCharacterByName(String name) {
        return full.get(name);
    }

    static String escape(String string, Document.OutputSettings out) {
        StringBuilder accum = new StringBuilder(string.length() * 2);
        escape(accum, string, out, false, false, false);
        return accum.toString();
    }

    // this method is ugly, and does a lot. but other breakups cause rescanning and stringbuilder generations
    static void escape(StringBuilder accum, String string, Document.OutputSettings out,
                       boolean inAttribute, boolean normaliseWhite, boolean stripLeadingWhite) {

        boolean lastWasWhite = false;
        boolean reachedNonWhite = false;
        EscapeMode escapeMode = out.escapeMode();
        CharsetEncoder encoder = out.encoder();
        Map<Character, String> map = escapeMode.getMap();
        final int length = string.length();

        int codePoint;
        for (int offset = 0; offset < length; offset += Character.charCount(codePoint)) {
            codePoint = string.codePointAt(offset);

            if (normaliseWhite) {
                if (StringUtil.isWhitespace(codePoint)) {
                    if ((stripLeadingWhite && !reachedNonWhite) || lastWasWhite)
                        continue;
                    accum.append(' ');
                    lastWasWhite = true;
                    continue;
                } else {
                    lastWasWhite = false;
                    reachedNonWhite = true;
                }
            }
            // surrogate pairs, split implementation for efficiency on single char common case (saves creating strings, char[]):
            if (codePoint < Character.MIN_SUPPLEMENTARY_CODE_POINT) {
                final char c = (char) codePoint;
                // html specific and required escapes:
                switch (c) {
                    case '&':
                        accum.append("&");
                        break;
                    case 0xA0:
                        if (escapeMode != EscapeMode.xhtml)
                            accum.append(" ");
                        else
                            accum.append(c);
                        break;
                    case '<':
                        if (!inAttribute)
                            accum.append("<");
                        else
                            accum.append(c);
                        break;
                    case '>':
                        if (!inAttribute)
                            accum.append(">");
                        else
                            accum.append(c);
                        break;
                    case '"':
                        if (inAttribute)
                            accum.append(""");
                        else
                            accum.append(c);
                        break;
                    default:
                        if (encoder.canEncode(c))
                            accum.append(c);
                        else if (map.containsKey(c))
                            accum.append('&').append(map.get(c)).append(';');
                        else
                            accum.append("&#x").append(Integer.toHexString(codePoint)).append(';');
                }
            } else {
                final String c = new String(Character.toChars(codePoint));
                if (encoder.canEncode(c))
                    accum.append(c);
                else
                    accum.append("&#x").append(Integer.toHexString(codePoint)).append(';');
            }
        }
    }

    static String unescape(String string) {
        return unescape(string, false);
    }

    /**
     * Unescape the input string.
     * @param string
     * @param strict if "strict" (that is, requires trailing ';' char, otherwise that's optional)
     * @return
     */
    static String unescape(String string, boolean strict) {
        return Parser.unescapeEntities(string, strict);
    }

    // xhtml has restricted entities
    private static final Object[][] xhtmlArray = {
            {"quot", 0x00022},
            {"amp", 0x00026},
            {"lt", 0x0003C},
            {"gt", 0x0003E}
    };

    static {
        xhtmlByVal = new HashMap<Character, String>();
        base = loadEntities("entities-base.properties");  // most common / default
        baseByVal = toCharacterKey(base);
        full = loadEntities("entities-full.properties"); // extended and overblown.
        fullByVal = toCharacterKey(full);

        for (Object[] entity : xhtmlArray) {
            Character c = Character.valueOf((char) ((Integer) entity[1]).intValue());
            xhtmlByVal.put(c, ((String) entity[0]));
        }
    }

    private static Map<String, Character> loadEntities(String filename) {
        Properties properties = new Properties();
        Map<String, Character> entities = new HashMap<String, Character>();
        try {
            InputStream in = Entities.class.getResourceAsStream(filename);
            properties.load(in);
            in.close();
        } catch (IOException e) {
            throw new MissingResourceException("Error loading entities resource: " + e.getMessage(), "Entities", filename);
        }

        for (Map.Entry entry: properties.entrySet()) {
            Character val = Character.valueOf((char) Integer.parseInt((String) entry.getValue(), 16));
            String name = (String) entry.getKey();
            entities.put(name, val);
        }
        return entities;
    }

    private static Map<Character, String> toCharacterKey(Map<String, Character> inMap) {
        Map<Character, String> outMap = new HashMap<Character, String>();
        for (Map.Entry<String, Character> entry: inMap.entrySet()) {
            Character character = entry.getValue();
            String name = entry.getKey();

            if (outMap.containsKey(character)) {
                // dupe, prefer the lower case version
                if (name.toLowerCase().equals(name))
                    outMap.put(character, name);
            } else {
                outMap.put(character, name);
            }
        }
        return outMap;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="com.nimo.namefate" android:versionCode="2" android:versionName="1.1">

	<application android:icon="@drawable/icon" android:label="@string/app_name">
		<activity android:name=".NameFate" android:label="@string/app_name" android:screenOrientation="portrait"
		android:configChanges="keyboardHidden|orientation">
			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>

		<activity android:name=".ResultView" android:label="@string/app_name" android:screenOrientation="portrait"
		android:configChanges="keyboardHidden|orientation">

		</activity>

	</application>

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

		<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

		<uses-permission android:name="android.permission.READ_PHONE_STATE" />

		<uses-permission android:name="android.permission.CALL_PHONE" />

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

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

		<uses-permission android:name="android.permission.GET_TASKS" />

		<uses-sdk android:minSdkVersion="3" />

</manifest>


text:
ACCEPTED

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

#### Published in
Ann. Bot. , Lond. 25: 1027 (1911)

#### Original name
Allomyces E.J. Butler

### Remarks
null


text:
import java.util.*;

public class AcademyGraduation {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        TreeMap<String, List<Double>> studentGrades = new TreeMap<>();

        int studentCnt = Integer.parseInt(scanner.nextLine());
        for (int i = 0; i < studentCnt; i++) {
            String studentName = scanner.nextLine();
            studentGrades.putIfAbsent(studentName, new ArrayList<>());

            Collections.addAll(
                    studentGrades.get(studentName),
                    Arrays.stream(scanner.nextLine().split("\\s+")).map(Double::valueOf).toArray(Double[]::new)
            );
        }

        for (String studentName : studentGrades.keySet()) {
            double gradeSum = 0D;
            List<Double> grades = studentGrades.get(studentName);
            for (Double grade : grades) {
                gradeSum += grade;
            }
            System.out.printf(
                    "%s is graduated with %s%s",
                    studentName,
                    Double.valueOf(gradeSum / grades.size()).toString(),
                    System.lineSeparator()
            );
        }
    }
}


text:
  This inspection reports files which can be custom type checkers and are not added to compiler resources yet.

Powered by JetGroovy


text:
function dat= proc_commonMedianReference(dat, refChans, rerefChans)
%PROC_COMMONMEDIANREFERENCE - rereference signals to common median reference
%
%Synopsis:
% dat= proc_commonMedianReference(dat, <refChans, rerefChans>)
%
%
%Arguments:
%      dat        - data structure of continuous or epoched data
%      refChans   - channels used as average reference, see util_chanind for format,
%                   default util_scalpChannels(dat)
%      rerefChans - those channels are rereferenced, default refChans
%
%Returns:
%      dat        - updated data structure
%
% SEE util_scalpChannels, util_chanind

% Author: Benjamin Blankertz
dat = misc_history(dat);

if ~exist('refChans','var') || isempty(refChans),
  refChans= util_scalpChannels(dat);
end
if ~exist('rerefChans','var') || isempty(rerefChans), rerefChans= refChans; end

misc_checkType(dat, 'STRUCT(x clab)');
misc_checkType(refChans, 'CELL{CHAR}|CHAR');
misc_checkType(rerefChans, 'CELL{CHAR}|CHAR');

rc= util_chanind(dat, refChans);
rrc= util_chanind(dat, rerefChans);
car= median(dat.x(:,rc,:), 2);
%% this might consume too much memory:
%car= repmat(car, [1 length(rrc) 1]);
%dat.x(:,rrc,:)= dat.x(:,rrc,:) - car;

for cc= rrc,
  dat.x(:,cc,:)= dat.x(:,cc,:) - car;
  dat.clab{cc}= [dat.clab{cc} ' car'];
end


text:
ConsultorioMedico
=================

Private practice with integrated migration system.


text:
require "#{Rails.root}/lib/ingestor/drupal/n_inflectional_form"

FactoryGirl.define do
  factory :n_inflectional_form, class: Ingestor::Drupal::NInflectionalForm do
    data {{"nid":"523667","type":"inflectional_form","language":"","uid":"3",
          "status":"1","created":"1312562552","changed":"1312562552","comment":"0",
          "promote":"0","moderate":"0","sticky":"0","tnid":"0","translate":"0",
          "vid":"796870","revision_uid":"1","title":"=baabaayag -  -  - ","body":"",
          "teaser":"","log":"Created\/updated by FeedsNodeProcessor",
          "revision_timestamp":"1312562552","format":"0","name":"ojibwe","picture":"",
          "data":"a:1:{s:13:\"form_build_id\";s:37:\"form-b622ca1acaf1e4c9ff8e6535bc154c7f\";}",
          "path":"inflectional-form\/baabaayag","field_inflectional_value":[{"value":"=baabaayag"}],
          "field_inflectional_type":[{"nid":nil}],"field_inflectional_osort":[{"value":"=ba|ba|yag"}],
          "field_inflectional_source":[{"nid":nil}],"field_region":[{"value":"BF"}],"field_object":[{"nid":nil}],
          "field_old_if_key":[{"value":"nplur - nad"}],"field_subject":[{"nid":nil}],
          "field_inflectional_audio":[{"nid":nil}],"field_provenance":[{"value":"book"}],"taxonomy":[]}}
    initialize_with { new(data) }
  end
end


text:
module Librevox
  # All applications should call `application` with the following parameters:
  #
  #   `name` - name of the application
  #   `args` - arguments as a string to be sent to FreeSWITCH (optional)
  #   `params` - parameters for tweaking the command (optional)
  #
  module Applications
    # Answers an incoming call or session.
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_answer
    def answer &block
      application "answer", &block
    end

    # Make an attended transfer
    # @example
    #   att_xfer("user/davis")
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_att_xfer
    # @todo Add support for origination_cancel_key
    def att_xfer endpoint, &block
      application "att_xfer", endpoint, &block
    end

    # Binds an application to the specified call legs.
    # @example
    #   bind_meta_app :key          => 2,
    #                 :listen_to    => "a",
    #                 :respond_on   => "s",
    #                 :application  => "execute_extension",
    #                 :parameters   => "dx XML features"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bind_meta_app
    def bind_meta_app args={}, &block
      arg_string =
        args.values_at(:key, :listen_to, :respond_on, :application).join(" ")
      arg_string += "::#{args[:parameters]}" if args[:parameters]

      application "bind_meta_app", arg_string, &block
    end

    # Bridges an incoming call to an endpoint, optionally taking an array of
    # channel variables to set. If given an array of arrays, each contained
    # array of endpoints will be called simultaneously, with the next array
    # of endpoints as failover. See the examples below for different constructs
    # and the callstring it sends to FreeSWITCH.
    # @example
    #   bridge "user/coltrane", "user/backup-office"
    #   #=> user/coltrane,user/backup-office
    # @example With channel variables
    #   bridge "user/coltrane", "user/backup-office", :some_var => "value"
    #   #=> {some_var=value}user/coltrane,user/backup-office
    # @example With failover
    #   bridge ['user/coltrane', 'user/davis'], ['user/sun-ra', 'user/taylor']
    #   #=> user/coltrane,user/davis|user/sun-ra,user/taylor
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_bridge
    def bridge *args, &block
      variables = if args.last.is_a? Hash
                    # We need to sort the key/value pairs to facilitate testing.
                    # This can be removed once 1.8-compat is dropped.
                    key_value_pairs = args.pop.sort {|x,y| x.to_s <=> y.to_s}
                    key_value_pairs.map! {|k,v| "#{k}=#{v}"}
                    "{#{key_value_pairs.join(",")}}"
                  else
                    ""
                  end

      endpoints = if args.first.is_a? Array
                    args.map {|e| e.join(",")}.join("|")
                  else
                    args.join ","
                  end

      application "bridge", variables + endpoints, &block
    end

    # Deflect a call by sending a REFER. Takes a SIP URI as argument, rerouting
    # the call to that SIP URI.
    #
    # Beware that REFER only can be used on established calls. If a call hasn't
    # been established with e.g. the {#answer} application, you should use
    # {#redirect} instead.
    # @example
    #   deflect "sip:miles@davis.com"
    # @see #redirect
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_deflect
    def deflect uri, &block
      application "deflect", uri, &block
    end

    # Exports a channel variable from the A leg to the B leg. Variables and
    # their values will be replicated in any new channels created from the one
    # export was called.
    #
    # Set :local => false if the variable should only be exported to the B-leg.
    #
    # @example
    #   export "some_var"
    # @example Only export to B-leg
    #   export "some_var", :local => false
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_export
    def export var, args={}, &block
      nolocal = args[:local] == false ? "nolocal:" : "" # ugly!!111

      application "export", "#{nolocal}#{var}", &block
    end

    # Generate TGML tones
    # @example Generate a 500ms beep at 800Hz
    #   gentones "%(500,0,800)"
    # @example  Generate a DTMF string
    #   gentones "0800500005"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_gentones
    def gentones tgml , &block
      application "gentones", tgml, &block
    end

    # Hang up current channel
    # @example
    #   hangup
    # @example Hang up with a reason
    #   hangup "USER_BUSY"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_hangup
    def hangup cause="", &block
      application "hangup", cause, &block
    end

    # Plays a sound file and reads DTMF presses.
    # @example
    #   play_and_get_digits "please-enter.wav", "wrong-choice.wav",
    #     :min          => 1,
    #     :max          => 2,
    #     :tries        => 3,
    #     :terminators  => "#",
    #     :timeout      => 5000,
    #     :regexp       => '\d+'
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_get_digits
    def play_and_get_digits file, invalid_file, args={}, &block
      min         = args[:min]          || 1
      max         = args[:max]          || 2
      tries       = args[:tries]        || 3
      terminators = args[:terminators]  || "#"
      timeout     = args[:timeout]      || 5000
      variable    = args[:variable]     || "read_digits_var"
      regexp      = args[:regexp]       || "\\d+"

      args = [min, max, tries, timeout, terminators, file, invalid_file,
        variable, regexp].join " "

      params = {:variable => variable}

      application "play_and_get_digits", args, params, &block
    end

    # Plays a sound file on the current channel.
    # @example
    #   playback "/path/to/file.wav"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_playback
    def playback file, &block
      application "playback", file, &block
    end

    # Pre-answer establishes early media but does not answer.
    # @example
    #   pre_anser
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_pre_answer
    def pre_answer &block
      application "pre_answer", &block
    end

    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_read
    def read file, args={}, &block
      min         = args[:min]          || 1
      max         = args[:max]          || 2
      terminators = args[:terminators]  || "#"
      timeout     = args[:timeout]      || 5000
      variable    = args[:variable]     || "read_digits_var"

      arg_string = "%s %s %s %s %s %s" % [min, max, file, variable, timeout,
        terminators]

      params = {:variable => variable}

      application "read", arg_string, params, &block
    end

    # Records a message, with an optional limit on the maximum duration of the
    # recording.
    # @example Without limit
    #   record "/path/to/new/file.wac"
    # @example With 20 second limit
    #   record "/path/to/new/file.wac", :limit => 20
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_record
    def record path, params={}, &block
      args = [path, params[:limit]].compact.join(" ")
      application "record", args, &block
    end

    # Redirect a channel to another endpoint. You must take care to not
    # redirect incompatible channels, as that wont have the desired effect.
    # I.e. if you redirect to a SIP URI, it should be a SIP channel.
    #
    # {#redirect} can only be used on non-established calls, i.e. calls that
    # has not been answered with the {#answer} application yet. If the call has
    # been answered, use {#deflect} instead.
    # @example
    #   redirect "sip:freddie@hubbard.org"
    # @see #deflect
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_redirect
    def redirect uri, &block
      application "redirect", uri, &block
    end

    # Send SIP session respond code.
    # @example Send 403 Forbidden
    #   respond 403
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_respond
    def respond code, &block
      application "respond", code.to_s, &block
    end

    # Sets a channel variable.
    # @example
    #   set "some_var", "some value"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_set
    def set variable, value, &block
      application "set", "#{variable}=#{value}", &block
    end

    # Transfers the current channel to a new context.
    # @example
    #   transfer "new_context"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_transfer
    def transfer context, &block
      application "transfer", context, &block
    end

    # Unbinds a previously bound key with bind_meta_app
    # @example
    #   unbind_meta_app 3
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_unbind_meta_app
    def unbind_meta_app key, &block
      application "unbind_meta_app", key.to_s, &block
    end

    # Unset a channel variable.
    # @example
    #   unset "foo"
    # @see http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_unset
    def unset variable, &block
      application "unset", variable, &block
    end
  end
end


text:
package isse.mbr.experiments;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;
import java.util.Set;

public class LunchVoter {

	private int studentId;
	private String voterName;
	private List<Integer> privateRanking;
	private int amplifier;
	private int k;
	private int topN; // we want our top n picks to be in selected, the least favorites in deselected
	private int utility;

	public LunchVoter(int id, Random random, RankingFactory rankingFactory, int topN) {
		privateRanking = rankingFactory.getRanking(random);
		this.studentId = id;
		voterName = "lunchvoter"+id;
		amplifier = 1;
		k = 10000;
		this.topN = topN;
	}

	public List<Integer> getPrivateRanking() {
		return privateRanking;
	}

	public void setPrivateRanking(List<Integer> privateRanking) {
		this.privateRanking = privateRanking;
	}

	public String writePvs(boolean doAmplify) {

		StringBuilder pvsBuilder = new StringBuilder();
		pvsBuilder.append("PVS: ");
		pvsBuilder.append(voterName);
		pvsBuilder.append(" = new WeightedCsp(\"");
		pvsBuilder.append(voterName);
		pvsBuilder.append("\") {\n");
		String targetSet = "selected";

		for(int j = 0; j < privateRanking.size(); ++j) {
			if(j >= topN)
				targetSet = "deselected";

			pvsBuilder.append("\t soft-constraint ");

			pvsBuilder.append(voterName + "_rank_"+j);
			pvsBuilder.append(": '");
			pvsBuilder.append(privateRanking.get(j));
			pvsBuilder.append(" in " );
			pvsBuilder.append(targetSet);
			pvsBuilder.append("' :: weights('");
			pvsBuilder.append(privateRanking.size()-j);
			pvsBuilder.append("');\n");
		}
		pvsBuilder.append("\t amplifier: '");
		if(doAmplify)
			pvsBuilder.append(amplifier);
		else
			pvsBuilder.append('1');
		pvsBuilder.append("';\n");

		pvsBuilder.append("\t k: '");
		pvsBuilder.append(k);
		pvsBuilder.append("';\n");

		pvsBuilder.append("};\n");
		return pvsBuilder.toString();
	}

	public int getAmplifier() {
		return amplifier;
	}

	public void setAmplifier(int amplifier) {
		this.amplifier = amplifier;
	}

	public String getStudentName() {
		return voterName;
	}

	public void setStudentName(String studentName) {
		this.voterName = studentName;
	}

	public int getRankForCompany(int company) {
		int rank = privateRanking.indexOf(company);
		return rank+1;
	}

	public void evaluate(Set<Integer> selectionJavaSet, Set<Integer> deselectionJavaSet) {
		utility = 0;
		for(int i = 0; i < privateRanking.size(); ++i) {
			int nextFood = privateRanking.get(i);
			Set<Integer> referenceSet = selectionJavaSet;
			if(i >= topN) { // I *want* that food
				referenceSet = deselectionJavaSet;
			}
			if(referenceSet.contains(nextFood))
				++utility;
		}
	}

	public int getUtility() {
		return utility;
	}

	public void setUtility(int utility) {
		this.utility = utility;
	}

}


text:
<?php
/**
 * Resource Italian lexicon topic
 *
 * @language it
 * @package modx
 * @subpackage lexicon
 */
$_lang['access'] = 'Accesso';
$_lang['cache_output'] = 'Output cache';
$_lang['changes'] = 'Modifiche';
$_lang['class_key'] = 'Classe Chiave';
$_lang['context'] = 'Contesto';
$_lang['document'] = 'Documento';
$_lang['document_create'] = 'Crea Documento';
$_lang['document_create_here'] = 'Crea Documento qui';
$_lang['document_new'] = 'Nuovo Documento';
$_lang['documents'] = 'Documenti';
$_lang['duplicate_uri_found'] = 'La Risorsa [[+id]] sta già usando l\'URI [[+uri]]. Inserisci un alias univoco o usa la funziona Congela (Freeze) URI per sovrasciverlo manualmente.';
$_lang['empty_template'] = '(vuoto)';
$_lang['general'] = 'Generale';
$_lang['markup'] = 'Markup/Struttura';
$_lang['none'] = 'Nessuno';
$_lang['page_settings'] = 'Configurazione Risorsa';
$_lang['preview'] = 'Anteprima';
$_lang['resource_access_message'] = 'Qui puoi selezionare a quali Gruppi Risorse appartiene questa risorsa.';
$_lang['resource_add_children_access_denied'] = 'Non hai il permesso di creare una Risorsa qui.';
$_lang['resource_alias'] = 'Alias Risorsa';
$_lang['resource_alias_help'] = 'Inserisci alias per questa risorsa. Questo renderà la risorsa accessibile tramite:
http://tuoserver/alias
Nota Bene: Funzionerà SOLO se stai usando i "friendly URLs".';
$_lang['resource_change_template_confirm'] = 'Sei sicuro di voler cambiare Template? ATTENZIONE: In tal caso saranno salvati i tuoi cambiamenti e sarà ricaricata la pagina; assicurati di esser pronto per questa azione prima di procedere. Dopo che la pagina è stata ricaricata, dovrai salvare nuovamente non appena sarai pronto a salvare il cambiamento del Template.';
$_lang['resource_cacheable'] = 'Cacheable';
$_lang['resource_cacheable_help'] = 'Quando attivato (selezionato), la risorsa sarà salvata in cache.';
$_lang['resource_cancel_dirty_confirm'] = 'Hai modifiche in corso; sei sicuro di voler cancellare?';
$_lang['resource_class_key_help'] = 'Questa è la Chiave della classe della risorsa, che mostra il suo tipo di MODX.';
$_lang['resource_content'] = 'Contenuto Risorsa. (*content)';
$_lang['resource_contentdispo'] = 'Disposizione Contenuto';
$_lang['resource_contentdispo_help'] = 'Usa il campo Disposizione contenuto per specificare come sarà gestita questa risorsa dal browser. Per i download seleziona l\'opzione Allegato.';
$_lang['resource_content_type'] = 'Tipo Contenuto';
$_lang['resource_content_type_help'] = 'Il Tipo di Contenuto di questa risorsa. Se non sei sicuro sul tipo di contenuto che dovrebbe avere la risorsa, lascia text/html.';
$_lang['resource_create_access_denied'] = 'Non hai il permesso di creare  Risorse.';
$_lang['resource_create_here'] = 'Crea Risorsa qui';
$_lang['resource_createdby'] = 'Creata da';
$_lang['resource_createdon'] = 'Creata il';
$_lang['resource_delete'] = 'Cancella risorsa';
$_lang['resource_delete_confirm'] = 'Sei sicuro di voler cancellare questa risorsa?
NOTA: saranno cancellate anche le sue risorse figlio!';
$_lang['resource_description'] = 'Descrizione';
$_lang['resource_description_help'] = 'Questa è una descrizione personale e facoltativa della risorsa.';
$_lang['resource_duplicate'] = 'Duplica Risorsa';
$_lang['resource_duplicate_confirm'] = 'Sei sicuro di voler duplicare questa risorsa? Ogni elemento in essa contenuto sarà a sua volta duplicato.';
$_lang['resource_edit'] = 'Modifica risorsa';
$_lang['resource_editedby'] = 'Modificato da';
$_lang['resource_editedon'] = 'Modificato il';
$_lang['resource_err_change_parent_to_folder'] = 'Si è verificato un errore cercando di convertire  il genitore della risorsa in cartella.';
$_lang['resource_err_class'] = 'La risorsa non è un valido [[+class]].';
$_lang['resource_err_create'] = 'Si è verificato un errore cercando di creare la risorsa.';
$_lang['resource_err_delete'] = 'Si è verificato un errore cercando di cancellare la risorsa.';
$_lang['resource_err_delete_children'] = 'Si è verificato un errore cercando di cancellare il figlio della risorsa.';
$_lang['resource_err_delete_container_sitestart'] = 'La risorsa che stai cercando di cancellare è un contenitore e contiene la risorsa [[+id]]. Questa risorsa è indicata come \'Site start\' (pagina iniziale) quindi non può essere cancellata. Se vuoi cancellarla cambia la risorsa impostata come \'Site start\' e riprova.';
$_lang['resource_err_delete_container_siteunavailable'] = 'La risorsa che stai cercando di cancellare è un contenitore e contiene la risorsa [[+id]]. Questa risorsa è indicata come  \'Site unavailable page\' (pagina da mostrare quanto il sito non è raggiungibile) quindi non può essere cancellata. Se vuoi cancellarla cambia la risorsa impostata come \'Site unavailable page\' e riprova.';
$_lang['resource_err_delete_sitestart'] = 'La risorsa è impostata come pagina iniziale \'Site start\' e non può essere cancellata!';
$_lang['resource_err_delete_siteunavailable'] = 'La risorsa è usata come  \'Site unavailable page\' e non può essere cancellata!';
$_lang['resource_err_duplicate'] = 'Si è verificato un errore cercando di duplicare la risorsa.';
$_lang['resource_err_move_to_child'] = 'Non puoi spostare una risorsa (annidarla) sotto una sua stessa risorsa figlio.';
$_lang['resource_err_move_sitestart'] = 'La risorsa è collegata alla variabile site_start e non può essere spostata in un altro contesto!';
$_lang['resource_err_nf'] = 'Risorsa non trovata.';
$_lang['resource_err_nfs'] = 'Risorsa  con ID: [[+id]] ,non trovata';
$_lang['resource_err_ns'] = 'Risorsa non specificata.';
$_lang['resource_err_own_parent'] = 'La risorsa non può essere genitore di se stessa.';
$_lang['resource_err_publish'] = 'Si è verificato un errore cercando di pubblicare la risorsa.';
$_lang['resource_err_new_parent_nf'] = 'Nuova risorsa genitore con id [[+id]], non trovata.';
$_lang['resource_err_remove'] = 'Si è verificato un errore cercando di rimuovere la risorsa.';
$_lang['resource_err_save'] = 'Si è verificato un errore cercando di salvare la risorsa.';
$_lang['resource_err_select_parent'] = 'Seleziona una risorsa genitore.';
$_lang['resource_err_undelete'] = 'Si è verificato un errore cercando di ripristinare la cancellazione di una risorsa.';
$_lang['resource_err_undelete_children'] = 'Si è verificato un errore cercando di ripristinare la cancellazione di un figlio della risorsa.';
$_lang['resource_err_unpublish'] = 'Si è verificato un errore cercando di de-pubblicare la risorsa.';
$_lang['resource_err_unpublish_sitestart'] = 'La risorsa è collegata alla variabile site_start  e non può essere ritirata (de-pubblicata)!';
$_lang['resource_err_unpublish_sitestart_dates'] = 'La risorsa è collegata alla variabile site_start e non si possono impostare date di pubblicazione o ritiro!';
$_lang['resource_folder'] = 'Contenitore';
$_lang['resource_folder_help'] = 'Attivare per rendere la risorsa anche un contenitore di altre risorse. Un \'Contenitore\' è come una cartella, però può anche avere un contenuto (Content: text,html,...).';
$_lang['resource_group_resource_err_ae'] = 'La risorsa appartiene già al Gruppo Risorse indicato.';
$_lang['resource_group_resource_err_nf'] = 'La risorsa non appartiene al Gruppo Risorse indicato.';
$_lang['resource_hide_from_menus'] = 'Nascondi nei menu';
$_lang['resource_hide_from_menus_help'] = 'Quando attivo, la risorsa NON sarà disponibile per essere inserita nei menu web. Nota Bene: alcuni Costruttori di Menu (snippet, plugin)  potrebbero ignorare questa opzione.';
$_lang['resource_link_attributes'] = 'Attributi Link';
$_lang['resource_link_attributes_help'] = 'Attributi per il link di questa risorsa, come target= o  rel=.';
$_lang['resource_locked_by'] = 'La risorsa è attualmente bloccata da [[+user]]';
$_lang['resource_longtitle'] = 'Titolo Esteso';
$_lang['resource_longtitle_help'] = 'Questo è il titolo esteso della risorsa. E\' utile per i motori di ricerca e potrebbe essere più descrittivo per la risorsa.';
$_lang['resource_menuindex'] = 'Indice Menu';
$_lang['resource_menuindex_help'] = 'Questo è l\'ordine della risorsa nella struttura ad albero . Normalmente è usato per l\'ordinamento nel mostrare dinamicamente le risorse. Maggiore è il numero  più bassa sarà la sua posizione nell\'albero.
Nota Bene: Alcuni componenti potrebbero ignorare questi valori.';
$_lang['resource_menutitle'] = 'Titolo Menu';
$_lang['resource_menutitle_help'] = 'Il titolo menu è il nome che puoi utilizzare dentro i tuoi snippet(s) di menu.';
$_lang['resource_new'] = 'Nuova Risorsa';
$_lang['resource_notcached'] = 'Questa risorsa non è (ancora) stata inserita in cache.';
$_lang['resource_pagetitle'] = 'Titolo/Nome';
$_lang['resource_pagetitle_help'] = 'Il nome/titolo della risorsa. Evita l\'utilizzo di backslashes nel nome!';
$_lang['resource_parent'] = 'Risorsa Genitore';
$_lang['resource_parent_help'] = 'Inserisci l\'ID della risorsa genitore.';
$_lang['resource_parent_select_node'] = 'Seleziona un nodo nella struttura ad albero a sinistra.';
$_lang['resource_publish'] = 'Pubblica Risorsa';
$_lang['resource_publish_confirm'] = 'Pubblicando ora questa risorsa si rimuovono eventuali date di pubblicazione/ritiro impostate precedentemente. Se hai intenzione di settare o mantenere date di pubblicazione o ritiro, seleziona Modifica Risorsa.
Procedere?';
$_lang['resource_publishdate'] = 'Data Pubblicazione';
$_lang['resource_publishdate_help'] = 'Se setti una data di pubblicazione, la risorsa sarà pubblicata non appena la data è raggiunta. Clicca sull\'icona del calendario per selezionare una data,lascia in bianco per fare in modo che la risorsa non venga pubblicata in automatico.';
$_lang['resource_published'] = 'Pubblicata';
$_lang['resource_published_help'] = 'Quando pubblicata la risorsa è immediatamente  disponibile al pubblico  dopo il salvataggio.';
$_lang['resource_publishedby'] = 'Pubblicata da';
$_lang['resource_publishedon'] = 'Pubblicata il';
$_lang['resource_publishedon_help'] = 'La data in cui la risorsa è stata pubblicata.';
$_lang['resource_refresh'] = 'Aggiorna Risorsa';
$_lang['resource_richtext'] = 'Rich Text';
$_lang['resource_richtext_help'] = 'Quando attivato verrà utilizzato il rich text editor per modificare le risorse. Se le risorse contengono JavaScript et simila, disattivalo per modificarle in modalità  HTML così l\'editor non danneggerà il codice.';
$_lang['resource_searchable'] = 'Ricercabile';
$_lang['resource_searchable_help'] = 'Quando attivato, la risorsa può essere ricercata. Questo parametro può anche essere usato per altri scopi nei tuoi snippet.';
$_lang['resource_settings'] = 'Configurazione risorsa';
$_lang['resource_status'] = 'Status';
$_lang['resource_status_help'] = 'Quando pubblicata la risorsa è disponibile al pubblico subito dopo il salvataggio. Altrimenti, rimane nascosta nel sito pubblico.';
$_lang['resource_summary'] = 'Sintesi (introtext)';
$_lang['resource_summary_help'] = 'Un breve riassunto della risorsa.';
$_lang['resource_syncsite'] = 'Svuota Cache';
$_lang['resource_syncsite_help'] = 'Se attivato, MODX svuoterà la cache dopo il salvataggio della risorsa. In questo modo i tuoi visitatori non vedranno la versione vecchia.';
$_lang['resource_template'] = 'Template utilizzato';
$_lang['resource_template_help'] = 'Il template utilizzato per la risorsa.';
$_lang['resource_undelete'] = 'Ripristina Risorsa';
$_lang['resource_unpublish'] = 'Ritira Risorsa';
$_lang['resource_unpublish_confirm'] = 'Ritirando ora questa risorsa si rimuovono eventuali date di pubblicazione/ritiro impostate precedentemente. Se hai intenzione di settare o mantenere date di pubblicazione o ritiro, seleziona Modifica Risorsa.
Procedere?';
$_lang['resource_unpublishdate'] = 'Data Ritiro ';
$_lang['resource_unpublishdate_help'] = 'Se setti una data di ritiro, la risorsa sarà ritirata non appena la data è raggiunta. Clicca sull\'icona del calendario per selezionare una data, o lascia bianco per fare in modo che la risorsa NON venga ritirata in automatico.';
$_lang['resource_unpublished'] = 'Ritirata';
$_lang['resource_untitled'] = 'Risorsa senza titolo';
$_lang['resource_uri'] = 'URI';
$_lang['resource_uri_help'] = 'L\'URL relativo completo per questa Risorsa.';
$_lang['resource_uri_override'] = 'Congela (Freeze) URI';
$_lang['resource_uri_override_help'] = 'Questa opzione ti consente di congelare l\'URI per questa Risorsa al valore mostrato nel campo di testo sotto.';
$_lang['resource_with_id_not_found'] = 'Risorsa con ID %s non trovata!';
$_lang['resource_view'] = 'Visualizza risorsa';
$_lang['show_sort_options'] = 'Mostra Opzioni Ordinamento';
$_lang['site_schedule'] = 'Programmazione';
$_lang['site_schedule_desc'] = 'Mostra fra le risorse correnti quelle  programmate per essere pubblicate o ritirate in date specifiche. Puoi attivare/disattivare la visualizzazione corrente cliccando sul pulsante nella Barra strumenti.';
$_lang['source'] = 'Sorgente';
$_lang['static_resource'] = 'Risorsa Statica';
$_lang['static_resource_create_here'] = 'Crea Risorsa Statica qui';
$_lang['static_resource_new'] = 'Nuova Risorsa Statica';
$_lang['status'] = 'Status';
$_lang['symlink'] = 'Symlink';
$_lang['symlink_create'] = 'Crea Symlink';
$_lang['symlink_create_here'] = 'Crea Symlink qui';
$_lang['symlink_help'] = 'L\'indirizzo dell\'oggetto a cui vorresti fare riferimento con questo Symlink. Se vuoi che punti a una Risorsa di MODX esistente, inserisci qui il suo ID.';
$_lang['symlink_message'] = 'Un symlink è un link simbolico ad un\'altra risorsa nel sito alla quale è trasmesso senza cambiare l\'URL.';
$_lang['symlink_new'] = 'Nuovo Symlink';
$_lang['template_variables'] = 'Variabili Template (TV)';
$_lang['untitled_resource'] = 'Risorsa senza Titolo';
$_lang['weblink'] = 'Weblink';
$_lang['weblink_create'] = 'Crea Weblink';
$_lang['weblink_create_here'] = 'Crea Weblink qui';
$_lang['weblink_help'] = 'L\'indirizzo dell\'oggetto al quale vorresti riferirti con questo weblink. Se vuoi che punti a una Risorsa di MODX esistente, inserisci qui il suo ID.';
$_lang['weblink_message'] = 'Un weblink è un riferimento ad un oggetto in internet. Potrebbe essere un documento in MODX, una pagina in un altro sito o un\'immagine o un altro tipo di file internet.
';
$_lang['weblink_new'] = 'Nuovo Weblink';
$_lang['weblink_response_code'] = 'Codice Risposta';
$_lang['weblink_response_code_help'] = 'Il codice HTTP di risposta che dovrebbe essere inviato per il weblink.';


text:
from py3kwarn2to3.fixer_base import BaseFix

class FixLast(BaseFix):

    run_order = 10

    def match(self, node): return False


text:
precision mediump float;

uniform sampler2D vTexture;
uniform int vChangeType;
uniform vec3 vChangeColor;
uniform int vIsHalf;
uniform float uXY;

varying vec4 gPosition;

varying vec2 aCoordinate;
varying vec4 aPos;

void modifyColor(vec4 color){
    color.r=max(min(color.r,1.0),0.0);
    color.g=max(min(color.g,1.0),0.0);
    color.b=max(min(color.b,1.0),0.0);
    color.a=max(min(color.a,1.0),0.0);
}

void main(){
    vec4 nColor=texture2D(vTexture,aCoordinate);
    if(aPos.x>0.0||vIsHalf==0){
        if(vChangeType==1){
            float c=nColor.r*vChangeColor.r+nColor.g*vChangeColor.g+nColor.b*vChangeColor.b;
            gl_FragColor=vec4(c,c,c,nColor.a);
        }else if(vChangeType==2){
            vec4 deltaColor=nColor+vec4(vChangeColor,0.0);
            modifyColor(deltaColor);
            gl_FragColor=deltaColor;
        }else if(vChangeType==3){
            nColor+=texture2D(vTexture,vec2(aCoordinate.x-vChangeColor.r,aCoordinate.y-vChangeColor.r));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x-vChangeColor.r,aCoordinate.y+vChangeColor.r));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x+vChangeColor.r,aCoordinate.y-vChangeColor.r));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x+vChangeColor.r,aCoordinate.y+vChangeColor.r));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x-vChangeColor.g,aCoordinate.y-vChangeColor.g));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x-vChangeColor.g,aCoordinate.y+vChangeColor.g));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x+vChangeColor.g,aCoordinate.y-vChangeColor.g));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x+vChangeColor.g,aCoordinate.y+vChangeColor.g));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x-vChangeColor.b,aCoordinate.y-vChangeColor.b));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x-vChangeColor.b,aCoordinate.y+vChangeColor.b));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x+vChangeColor.b,aCoordinate.y-vChangeColor.b));
            nColor+=texture2D(vTexture,vec2(aCoordinate.x+vChangeColor.b,aCoordinate.y+vChangeColor.b));
            nColor/=13.0;
            gl_FragColor=nColor;
        }else if(vChangeType==4){
            float dis=distance(vec2(gPosition.x,gPosition.y/uXY),vec2(vChangeColor.r,vChangeColor.g));
            if(dis<vChangeColor.b){
                nColor=texture2D(vTexture,vec2(aCoordinate.x/2.0+0.25,aCoordinate.y/2.0+0.25));
            }
            gl_FragColor=nColor;
        }else{
            gl_FragColor=nColor;
        }
    }else{
        gl_FragColor=nColor;
    }
}


text:
from opendc.models.model import Model
from opendc.util import database

class TaskState(Model):
    JSON_TO_PYTHON_DICT = {
        'TaskState': {
            'id': 'id',
            'taskId': 'task_id',
            'experimentId': 'experiment_id',
            'tick': 'tick',
            'flopsLeft': 'flops_left',
            'coresUsed': 'cores_used'
        }
    }

    TABLE_NAME = 'task_states'

    COLUMNS = ['id', 'task_id', 'experiment_id', 'tick', 'flops_left', 'cores_used']
    COLUMNS_PRIMARY_KEY = ['id']

    @classmethod
    def from_experiment_id_and_tick(cls, experiment_id, tick):
        """Query Task States by their Experiment id and tick."""

        task_states = []

        statement = 'SELECT * FROM task_states WHERE experiment_id = %s AND tick = %s'
        results = database.fetchall(statement, (experiment_id, tick))

        for row in results:
            task_states.append(
                cls(
                    id=row[0],
                    task_id=row[1],
                    experiment_id=row[2],
                    tick=row[3],
                    flops_left=row[4]
                )
            )

        return task_states

    def google_id_has_at_least(self, google_id, authorization_level):
        """Return True if the User has at least the given auth level over this TaskState."""

        if authorization_level in ['EDIT', 'OWN']:
            return False

        return True


text:
package io.github.quackmatic.gloop;

public class AABB {
	public double x, y, width, height;

	public AABB(double x, double y, double width, double height) {
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}

	public boolean colliding(AABB aabb) {
		double horizontalDistance = Math.abs(this.x - aabb.x) - Math.abs(this.width - aabb.width) / 2;
		double verticalDistance = Math.abs(this.y - aabb.y) - Math.abs(this.height - aabb.height) / 2;
		return (horizontalDistance < 0 || verticalDistance < 0);
	}

	public void deintersect(AABB aabb) {
		double horizontalDistance = Math.abs(this.x - aabb.x) - Math.abs(this.width - aabb.width) / 2;
		double verticalDistance = Math.abs(this.y - aabb.y) - Math.abs(this.height - aabb.height) / 2;

		if(horizontalDistance < 0) {
			if(this.x > aabb.x) {
				this.x += horizontalDistance;
			} else {
				this.x -= horizontalDistance;
			}
		}

		if(verticalDistance < 0) {
			if(this.y > aabb.y) {
				this.y += verticalDistance;
			} else {
				this.y -= verticalDistance;
			}
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<es:job-bag xmlns:es="http://www.marklogic.com/enhanced-search#">

         <meta property="rnews:description"
               content="A former North Vietnamese soldier is reunited with his arm after more than 40 years, when the US war doctor who amputated it returned the bones in person."/>
         <meta property="rnews:datePublished" content="2013-07-01T11:57:13"/>
         <meta property="rnews:thumbnailUrl"
               content="http://news.bbcimg.co.uk/media/images/68480000/jpg/_68480012_68479502.jpg"/>
         <meta property="rnews:headline" content="Vietnam man regains long-lost arm"/>
         <meta name="CPS_SECTION_PATH" content="World/Asia"/>
         <meta property="rnews:creator" content="http://www.bbc.co.uk#org"/>
         <link rel="copyright"
               href="http://www.bbc.co.uk/terms/"
               title="Terms of Use"/>
         <link rel="http://purl.org/dc/terms/source"
               href="http://www.bbc.co.uk/news/world-asia-23124347"/>
         <title>BBC News - Vietnam war veteran reunited with long-lost
arm</title>

               1 July 2013
               Last updated
at
               12:57

Vietnam war veteran reunited with
long-lost arm

               Mr Hung, left, said he would use the arm
to try to claim a war veteran's pension

A former North
Vietnamese soldier has been reunited with his arm after more than
40 years.

Nguyen Quang Hung fought during the Vietnam war and had his arm
amputated by US army doctor Sam Axelrad in 1966 after his arm
caught gangrene.

Dr Axelrad kept the bones of the arm as a reminder of the good
deed he had performed by treating an enemy soldier.

He began a quest to track down the owner of the arm in 2012,
meeting Mr Hung on Monday to return his bones.

"I'm very happy to see him again and have that part of my body
back after nearly half a century," Mr Hung said.

"My arm bone is evidence of my contribution to the war. I will
keep it in my house... in the glass display cabinet," he said,
adding that he hoped the arm would help him claim a veteran's
pension, as his army files had been lost.

He also plans to be buried with his bones.

               Dr Axelrad, left, amputated Mr Hung's
arm in 1966

Dr Axelrad said he was "unbelievably happy" to be able to return
the arm.

"When I amputated his arm [in 1966], our medics took the arm,
took the flesh off it, put it back together perfectly with wires,
and then they gave it to me," he said.

"When I left the country six months later, I didn't want to
throw it away, I put it in my trunk and brought it home, and all
these years it has been in my house," he added.

In 2011, he returned to Vietnam and tried to find the man whose
arm he had amputated - a move he later said would help provide
"closure".

A local journalist wrote about his mission, and the news
eventually spread back to Mr Hung.

When he heard he would get his arm back he said he "really could
not believe it".

"I can't believe that an American doctor took my infected arm,
got rid of the flesh, dried it, took it home and kept it for more
than 40 years," he said.

He added later that he considered himself "very lucky" compared
to many of his comrades who died in the war.

The Vietnam war, which ended in 1975, killed an estimated 58,000
US soldiers and three million Vietnamese.

Related Stories

                  Return to Vietnam

                  Vietnam country
profile

   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:og="http://opengraphprotocol.org/schema/"
            xmlns:rnews="http://iptc.org/std/rNews/2011-10-07#">
      <rdf:Description rdf:about="http://www.bbc.co.uk/news/world-asia-23124347">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#NewsItem"/>
         <rnews:identifier rdf:resource="http://www.bbc.co.uk/news/world-asia-23124347"/>
         <rnews:usageTerms rdf:resource="http://www.bbc.co.uk/terms/"/>
         <rnews:description xml:lang="en-GB">A former North Vietnamese soldier is reunited with his arm after more than 40 years, when the US war doctor who amputated it returned the bones in person.</rnews:description>
         <rnews:datePublished rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2013-07-01T11:57:13</rnews:datePublished>
         <rnews:thumbnailUrl rdf:resource="http://news.bbcimg.co.uk/media/images/68480000/jpg/_68480012_68479502.jpg"/>
         <rnews:headline xml:lang="en-GB">Vietnam man regains long-lost arm</rnews:headline>
         <rnews:articleSection rdf:datatype="http://www.w3.org/2001/XMLSchema#string">World</rnews:articleSection>
         <rnews:creator rdf:resource="http://www.bbc.co.uk#org"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://news.bbcimg.co.uk/media/images/68479000/jpg/_68479499_018508864-1.jpg">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#ImageObject"/>
         <rnews:associatedArticle rdf:resource="http://www.bbc.co.uk/news/world-asia-23124347"/>
         <rnews:width rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">464</rnews:width>
         <rnews:height rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">261</rnews:height>
         <rnews:description xml:lang="en-GB">Dr Sam Axelrad, right, hands over arm bones belonging to former North Vietnamese soldier Nguyen Quang Hung at Hung's house in Gia Lai province, Vietnam on 1 July 2013</rnews:description>
         <rnews:encodingFormat rdf:resource="http://cv.iptc.org/newscodes/format/JPEG_Baseline"/>
      </rdf:Description>
      <rdf:Description rdf:about="http://news.bbcimg.co.uk/media/images/68479000/jpg/_68479501_018507827-1.jpg">
         <rdf:type rdf:resource="http://iptc.org/std/rNews/2011-10-07#ImageObject"/>
         <rnews:associatedArticle rdf:resource="http://www.bbc.co.uk/news/world-asia-23124347"/>
         <rnews:width rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">224</rnews:width>
         <rnews:height rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">299</rnews:height>
         <rnews:description xml:lang="en-GB">Dr Sam Axelrad, left, with Nguyen Quang Hung in October 1966 in front of his military clinic in the former South Vietnam</rnews:description>
         <rnews:encodingFormat rdf:resource="http://cv.iptc.org/newscodes/format/JPEG_Baseline"/>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       c:allowDistribution="true"
                       c:allowSearch="false"
                       c:calaisRequestID="1372be37-1d22-adc4-13fb-dd0dd0945cd1"
                       c:externalID="mluces"
                       c:id="http://id.opencalais.com/U9osaYPKOiVZ4BkPNaHm6w"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfo"/>
         <c:docDate rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2013-07-01</c:docDate>
         <c:submitter>ml</c:submitter>
         <owl:sameAs xmlns:owl="http://www.w3.org/2002/07/owl#"
                     rdf:resource="http://www.bbc.co.uk/news/world-asia-23124347"/>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       c:contentType="TEXT/HTML"
                       c:emVer="7.1.1103.5"
                       c:langIdVer="DefaultLangId"
                       c:language="English"
                       c:processingVer="CalaisJob01"
                       c:submissionDate="2013-07-08 05:25:49.321"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/meta">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/DocInfoMeta"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:submitterCode>c2b78ae4-093d-1686-b3f0-28ae1ba30b6e</c:submitterCode>
         <c:signature>digestalg-1|EcfxXOCHdG9hSQVtyfIRAInxkVE=|Uq+6OHBgog6RwCiHlSg4hNjJPM45V01GvrLVUxmKFwpaY0lpsuOG5g==</c:signature>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/lid/DefaultLangId">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/lid/DefaultLangId"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:lang rdf:resource="http://d.opencalais.com/lid/DefaultLangId/English"/>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/cat/1">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/cat/DocCat"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:category rdf:resource="http://d.opencalais.com/cat/Calais/War_Conflict"/>
         <c:classifierName>Calais</c:classifierName>
         <c:categoryName>War_Conflict</c:categoryName>
         <c:score rdf:datatype="http://www.w3.org/2001/XMLSchema#double">0.522</c:score>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/er/geo/country/ralg-geo1/5f8f9e33-bb5e-1384-8af2-622b66b2308c">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/er/Geo/Country"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/44e7a00f-f0f6-380d-bc26-0892ecfbda84"/>
         <c:name>Vietnam</c:name>
         <c:latitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">15.4548637037</c:latitude>
         <c:longitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">106.576013518</c:longitude>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/pershash-1/29bbbee8-53b2-31fb-b6b5-6acb4a2dee89">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/>
         <c:name>Sam Axelrad</c:name>
         <c:persontype>N/A</c:persontype>
         <c:nationality>N/A</c:nationality>
         <c:commonname>Sam Axelrad</c:commonname>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/Relevance/1">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/pershash-1/29bbbee8-53b2-31fb-b6b5-6acb4a2dee89"/>
         <c:relevance>0.828</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/er/geo/country/ralg-geo1/152649df-347e-e289-1a9e-acc883e07d17">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/er/Geo/Country"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a54ac18b-a956-3b5c-b235-0609ca899305"/>
         <c:name>United States</c:name>
         <c:latitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">40.4230003233</c:latitude>
         <c:longitude rdf:datatype="http://www.w3.org/2001/XMLSchema#double">-98.7372244786</c:longitude>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/fce36612-627b-34d0-9874-611de4063865">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Organization"/>
         <c:name>United States Army</c:name>
         <c:organizationtype>governmental military</c:organizationtype>
         <c:nationality>American</c:nationality>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/Relevance/2">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/fce36612-627b-34d0-9874-611de4063865"/>
         <c:relevance>0.314</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/6735ed24-5545-3e41-9e1a-fd3bd987cc9c">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/r/PersonTravel"/>
         <c:person rdf:resource="http://d.opencalais.com/pershash-1/29bbbee8-53b2-31fb-b6b5-6acb4a2dee89"/>
         <c:locationdestination rdf:resource="http://d.opencalais.com/genericHasher-1/44e7a00f-f0f6-380d-bc26-0892ecfbda84"/>
         <c:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2011-00-00</c:date>
         <c:datestring>In 2011</c:datestring>
         <c:status>past</c:status>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/a54ac18b-a956-3b5c-b235-0609ca899305">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Country"/>
         <c:name>United States</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/Relevance/3">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/a54ac18b-a956-3b5c-b235-0609ca899305"/>
         <c:relevance>0.572</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/pershash-1/3d5fc486-7833-3b9a-a7cd-bd0c81a90a0b">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Person"/>
         <c:name>Quang Hung</c:name>
         <c:persontype>N/A</c:persontype>
         <c:nationality>N/A</c:nationality>
         <c:commonname>Quang Hung</c:commonname>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/Relevance/4">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/pershash-1/3d5fc486-7833-3b9a-a7cd-bd0c81a90a0b"/>
         <c:relevance>0.722</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/44e7a00f-f0f6-380d-bc26-0892ecfbda84">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Country"/>
         <c:name>Vietnam</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/Relevance/5">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/44e7a00f-f0f6-380d-bc26-0892ecfbda84"/>
         <c:relevance>0.725</c:relevance>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/genericHasher-1/3a053c1d-e6c6-341c-934c-1201c838d08d">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/em/e/Position"/>
         <c:name>local journalist</c:name>
      </rdf:Description>
      <rdf:Description xmlns:c="http://s.opencalais.com/1/pred/"
                       rdf:about="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7/Relevance/6">
         <rdf:type rdf:resource="http://s.opencalais.com/1/type/sys/RelevanceInfo"/>
         <c:docId rdf:resource="http://d.opencalais.com/dochash-1/b003b5a9-3d61-3098-beee-1114f29e65f7"/>
         <c:subject rdf:resource="http://d.opencalais.com/genericHasher-1/3a053c1d-e6c6-341c-934c-1201c838d08d"/>
         <c:relevance>0.114</c:relevance>
      </rdf:Description>
   </rdf:RDF>
</es:job-bag>


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ramularia petrakiana Moesz

### Remarks
null


text:
package org.apache.jsieve;

import org.apache.jsieve.exception.SieveException;
import org.apache.jsieve.mail.MailAdapter;
import org.apache.jsieve.tests.Address;

final class OpenedAddress extends Address {

    protected boolean match(MailAdapter mail, String addressPart,
                            String comparator, String matchType, String headerName, String key,
                            SieveContext context) throws SieveException {
        return super.match(mail, addressPart, comparator, matchType,
                headerName, key, context);
    }

}