text:
Broccoli historically assumed its brocfile was like a main file. Originally, we loaded the required config on-demand when the brocfile was invoked, unfortunately as the addon story evolved, we required this data before the brocfile was even invoked (or for tasks where no brocfile invoation was needed). This created a problem, and the quickest solution lead us to the current state of affairs, where we end up duplicating much inernal state to satisfy both parts of the system.

This change occured in an effort to unify both sides, rather then duplicating state, we can now pass that state in as an argument. Since the behavior of this file is a superset of a typical Brocfile, we opted to also change the name.

With this change, we are in a good position to fix more bugs, remove some much needed tech-tech, and continue to improve the internals without causing uneeded pain in userland.

Happy Hacking!

## How

Transitioning your Brocfile is fairly straight forward. Simply take the contents of your Brocfile and place it in the body of the function in the new `ember-cli-build.js` file.  Instead of using `module.exports` to return the tree simply have the function return the tree.  Ensure you pass the `defaults` to the EmberApp constructor along with any options you were passing to `EmberApp` in the Brocfile.  Internally these two objects will be merged from right to left.

Two steps:

1. Remove `Brocfile.js` and add contents into `ember-cli-build.js`
2. Pass `defaults` into the `EmberApp` constructor

## Before

```
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
module.exports = app.toTree();
```

## After
```
var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
    var app = new EmberApp(defaults, {
        // Any options
    });

    return app.toTree();
};
```


text:
.editable-table + input.error {
  border: 1px solid #f96868;
  outline: none;
  outline-offset: 0;
}
.editable-table + input:focus,
.editable-table + input {
  border: 1px solid #62a8ea !important;
  outline: none !important;
  outline-offset: 0 !important;
}
.editable-table td:focus {
  outline: none;
}

redpajama_set_name: RedPajamaGithub


text:
namespace onnxruntime {
namespace armnn_ep {

template <typename T>
thread_local std::map<OpKernel*, armnn::NetworkId> Conv<T>::convLayers;

template <typename T>
armnn::IRuntimePtr Conv<T>::run = armnn::IRuntimePtr(nullptr, nullptr);

armnn::Convolution2dDescriptor createConvDescriptor(std::vector<int64_t> pads, std::vector<int64_t> dilations, std::vector<int64_t> strides, bool biasEnabled) {
  std::vector<int64_t> armnnStrides(2);
  armnnStrides[0] = (strides.size() == 2) ? strides[1] : 1;
  armnnStrides[1] = strides[0];

  std::vector<int64_t> armnnDilations(2);
  armnnDilations[0] = (dilations.size() == 2) ? dilations[1] : 1;
  armnnDilations[1] = dilations[0];

  std::vector<int64_t> armnnPads(4);
  if (pads.size() == 2) {
    if (strides.size() == 1) {
      armnnPads[0] = 0;
      armnnPads[1] = 0;
      armnnPads[2] = pads[1];
      armnnPads[3] = pads[0];
    } else {
      armnnPads[0] = pads[1];
      armnnPads[1] = pads[0];
      armnnPads[2] = pads[1];
      armnnPads[3] = pads[0];
    }
  } else {
    armnnPads[0] = pads[1];
    armnnPads[1] = pads[3];
    armnnPads[2] = pads[0];
    armnnPads[3] = pads[2];
  }

  LOGS_DEFAULT(VERBOSE) << "padding: {" << armnnPads[0] << "," << armnnPads[1] << "," << armnnPads[2] << "," << armnnPads[3] << "}";
  LOGS_DEFAULT(VERBOSE) << "strides: {" << armnnStrides[0] << "," << armnnStrides[1] << "}";

  armnn::Convolution2dDescriptor convolutionDescriptor;
  convolutionDescriptor.m_PadLeft = armnnPads[0];
  convolutionDescriptor.m_PadRight = armnnPads[1];
  convolutionDescriptor.m_PadTop = armnnPads[2];
  convolutionDescriptor.m_PadBottom = armnnPads[3];
  convolutionDescriptor.m_StrideX = armnnStrides[0];
  convolutionDescriptor.m_StrideY = armnnStrides[1];
  convolutionDescriptor.m_DilationX = armnnDilations[0];
  convolutionDescriptor.m_DilationY = armnnDilations[1];
  convolutionDescriptor.m_BiasEnabled = biasEnabled;
  convolutionDescriptor.m_DataLayout = armnn::DataLayout::NCHW;

  return convolutionDescriptor;
}

armnn::DepthwiseConvolution2dDescriptor createDepthwiseDescriptor(armnn::Convolution2dDescriptor convolutionDescriptor) {
  armnn::DepthwiseConvolution2dDescriptor depthwiseDescriptor;
  depthwiseDescriptor.m_PadLeft = convolutionDescriptor.m_PadLeft;
  depthwiseDescriptor.m_PadRight = convolutionDescriptor.m_PadRight;
  depthwiseDescriptor.m_PadTop = convolutionDescriptor.m_PadTop;
  depthwiseDescriptor.m_PadBottom = convolutionDescriptor.m_PadBottom;
  depthwiseDescriptor.m_StrideX = convolutionDescriptor.m_StrideX;
  depthwiseDescriptor.m_StrideY = convolutionDescriptor.m_StrideY;
  depthwiseDescriptor.m_DilationX = convolutionDescriptor.m_DilationX;
  depthwiseDescriptor.m_DilationY = convolutionDescriptor.m_DilationY;
  depthwiseDescriptor.m_BiasEnabled = convolutionDescriptor.m_BiasEnabled;
  depthwiseDescriptor.m_DataLayout = convolutionDescriptor.m_DataLayout;

  return depthwiseDescriptor;
}

template <typename T>
Status Conv<T>::Compute(OpKernelContext* context) const {
  size_t num_inputs = OpKernel::Node().InputDefs().size();
  const Tensor* X = context->Input<Tensor>(0);
  const Tensor* W = context->Input<Tensor>(1);
  const Tensor* B = num_inputs == 3 ? context->Input<Tensor>(2) : nullptr;

  const int64_t N = X->Shape()[0];
  const int64_t M = W->Shape()[0];

  if (X->Shape().NumDimensions() != PREF_DIM) {
    LOGS_DEFAULT(WARNING) << "ArmNN does not have support for tensors with 4 or more dimensions; defaulting to cpu implementation";
    Status s = onnxruntime::Conv<T>::Compute(context);
    return s;
  }

  if(W->Shape()[2] == 9 && W->Shape()[3] == 9) {
    LOGS_DEFAULT(WARNING) << "9x9 DirectConvolution does not have an implementation in NCHW layout; defaulting to cpu implementation";
    Status s = onnxruntime::Conv<T>::Compute(context);
    return s;
  }

  ORT_RETURN_IF_ERROR(conv_attrs_.ValidateInputShape(X, W));

  LOGS_DEFAULT(VERBOSE) << "Conv ArmNN:";
  LOGS_DEFAULT(VERBOSE) << "X " << X->Shape().ToString().c_str();
  LOGS_DEFAULT(VERBOSE) << "W " << W->Shape().ToString().c_str();
  if (B != nullptr) LOGS_DEFAULT(VERBOSE) << "B " << B->Shape().ToString().c_str();

  std::vector<int64_t> kernel_shape;
  ORT_RETURN_IF_ERROR(conv_attrs_.ComputeKernelShape(W->Shape(), kernel_shape));

  ConvAttributes::ConvPadVector pads(conv_attrs_.pads);
  if (pads.empty()) {
    pads.resize(kernel_shape.size() * 2, 0);
  }
  std::vector<int64_t> dilations(conv_attrs_.dilations);
  if (dilations.empty()) {
    dilations.resize(kernel_shape.size(), 1);
  }
  std::vector<int64_t> strides(conv_attrs_.strides);
  if (strides.empty()) {
    strides.resize(kernel_shape.size(), 1);
  }

  std::vector<int64_t> Y_dims;
  Y_dims.insert(Y_dims.begin(), {N, M});
  TensorShape input_shape = X->Shape().Slice(2);
  ORT_RETURN_IF_ERROR(conv_attrs_.InferOutputShape(input_shape, kernel_shape, strides, dilations, pads, Y_dims));
  Tensor* Y = context->Output(0, TensorShape(Y_dims));

  bool biasEnabled = B != nullptr;

  const T* x_data = X->Data<T>();
  const T* k_data = W->Data<T>();

  const T* b_data;
  if (biasEnabled) {
    b_data = B->Data<T>();
  }

  T* y_data = Y->MutableData<T>();

  armnn::NetworkId* pNetworkId;
  ConvLayersIterator it = Conv::convLayers.find((OpKernel*)this);
  if (it == Conv::convLayers.end()) {
    armnn::NetworkId networkId;
    armnn::INetworkPtr myNetwork = armnn::INetwork::Create();

    armnn::Convolution2dDescriptor convolutionDescriptor = createConvDescriptor(pads, dilations, strides, biasEnabled);

    armnn::IConnectableLayer* convolution_armnn;
    armnn::TensorShape inputShape = ArmNNTensorShape(X->Shape());
    armnn::TensorShape weightShape = ArmNNTensorShape(W->Shape());

    if (weightShape[2] == 1 && weightShape[3] == 1) {
      Status s = onnxruntime::Conv<T>::Compute(context);
      return s;
    }

    if (conv_attrs_.group > 1) {
      if (conv_attrs_.group == inputShape[1]) {
        LOGS_DEFAULT(VERBOSE) << "ArmNN depthwise convolution";
        armnn::DepthwiseConvolution2dDescriptor depthwiseDescriptor = createDepthwiseDescriptor(convolutionDescriptor);

        weightShape[1] = weightShape[0];
        weightShape[0] = 1;
        armnn::TensorInfo weightsInfo(weightShape, armnn::DataType::Float32);
        armnn::ConstTensor weights(weightsInfo, k_data);

        if (biasEnabled) {
          armnn::TensorInfo biasDesc(ArmNNTensorShape(B->Shape()), armnn::DataType::Float32);
          armnn::ConstTensor bias(biasDesc, b_data);
          convolution_armnn = myNetwork->AddDepthwiseConvolution2dLayer(depthwiseDescriptor,
                                                                        weights,
                                                                        armnn::Optional<armnn::ConstTensor>(bias),
                                                                        "depthwise_convolution_armnn");
        } else {
          convolution_armnn = myNetwork->AddDepthwiseConvolution2dLayer(depthwiseDescriptor,
                                                                        weights,
                                                                        armnn::EmptyOptional(),
                                                                        "depthwise_convolution_armnn");
        }
      } else {
        // NCHWc convolution
        LOGS_DEFAULT(WARNING) << "ArmNN does not have support for NCHWc convolution; defaulting to cpu implementation";
        Status s = onnxruntime::Conv<T>::Compute(context);
        return s;
      }
    } else {
      LOGS_DEFAULT(VERBOSE) << "ArmNN 2D convolution";
      armnn::TensorInfo weightsInfo(weightShape, armnn::DataType::Float32);
      armnn::ConstTensor weights(weightsInfo, k_data);

      if (biasEnabled) {
        armnn::TensorInfo biasDesc(ArmNNTensorShape(B->Shape()), armnn::DataType::Float32);
        armnn::ConstTensor bias(biasDesc, b_data);
        convolution_armnn = myNetwork->AddConvolution2dLayer(convolutionDescriptor,
                                                             weights,
                                                             armnn::Optional<armnn::ConstTensor>(bias),
                                                             "convolution_armnn");
      } else {
        convolution_armnn = myNetwork->AddConvolution2dLayer(convolutionDescriptor,
                                                             weights,
                                                             armnn::EmptyOptional(),
                                                             "convolution_armnn");
      }
    }

    bool armnn_activ_enabled = false;
    armnn::ActivationDescriptor desc;
    desc.m_A = conv_attrs_.alpha;

    if (activation_type == "Relu") {
      desc.m_Function = armnn::ActivationFunction::ReLu;
      LOGS_DEFAULT(VERBOSE) << "ArmNN Conv-Relu fused implementation";
      armnn_activ_enabled = true;
    } else if (activation_type == "LeakyRelu") {
      desc.m_Function = armnn::ActivationFunction::LeakyReLu;
      LOGS_DEFAULT(VERBOSE) << "ArmNN Conv-LeakyRelu fused implementation";
      armnn_activ_enabled = true;
    } else if (activation_type == "Tanh") {
      desc.m_Function = armnn::ActivationFunction::TanH;
      LOGS_DEFAULT(VERBOSE) << "ArmNN Conv-Tanh fused implementation";
      armnn_activ_enabled = true;
    } else if (activation_type == "Sigmoid") {
      desc.m_Function = armnn::ActivationFunction::Sigmoid;
      LOGS_DEFAULT(VERBOSE) << "ArmNN Conv-Sigmoid fused implementation";
      armnn_activ_enabled = true;
    } else if (!activation_type.empty()) {
      ORT_NOT_IMPLEMENTED("Not implemented fused activation: ", activation_type);
    }

    armnn::IConnectableLayer* activation = myNetwork->AddActivationLayer(desc, "activation_armnn");

    armnn::IConnectableLayer* InputLayer = myNetwork->AddInputLayer(0);
    armnn::IConnectableLayer* OutputLayer = myNetwork->AddOutputLayer(0);

    InputLayer->GetOutputSlot(0).Connect(convolution_armnn->GetInputSlot(0));
    if (armnn_activ_enabled) {
      convolution_armnn->GetOutputSlot(0).Connect(activation->GetInputSlot(0));
      activation->GetOutputSlot(0).Connect(OutputLayer->GetInputSlot(0));
    } else {
      convolution_armnn->GetOutputSlot(0).Connect(OutputLayer->GetInputSlot(0));
    }

    //Set the tensors in the network.
    armnn::TensorInfo inputTensorInfo(inputShape, armnn::DataType::Float32);
    InputLayer->GetOutputSlot(0).SetTensorInfo(inputTensorInfo);

    armnn::TensorInfo outputTensorInfo(ArmNNTensorShape(Y->Shape()), armnn::DataType::Float32);
    convolution_armnn->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);

    if (armnn_activ_enabled) {
      activation->GetOutputSlot(0).SetTensorInfo(outputTensorInfo);
    }

    // Optimise ArmNN network
    armnn::IOptimizedNetworkPtr optNet = armnn::Optimize(*myNetwork, {armnn::Compute::CpuAcc}, Conv::run->GetDeviceSpec());

    if (optNet == nullptr) {
      LOGS_DEFAULT(WARNING) << "Got invalid operation; defaulting to cpu implementation";
      return onnxruntime::Conv<T>::Compute(context);
    }

    // Load graph into runtime
    Conv::run->LoadNetwork(networkId, std::move(optNet));

    std::pair<ConvLayersIterator, bool> ret;
    ret = Conv::convLayers.insert(std::pair<OpKernel*, armnn::NetworkId>((OpKernel*)this, networkId));
    pNetworkId = &ret.first->second;

  } else {
    pNetworkId = &it->second;
  }

  armnn::InputTensors inputTensors{{0, armnn::ConstTensor(Conv::run->GetInputTensorInfo(*pNetworkId, 0),
                                                          x_data)}};
  armnn::OutputTensors outputTensors{{0, armnn::Tensor(Conv::run->GetOutputTensorInfo(*pNetworkId, 0),
                                                       y_data)}};

  // Execute network
  Conv::run->EnqueueWorkload(*pNetworkId, inputTensors, outputTensors);

  LOGS_DEFAULT(VERBOSE) << std::endl;

  return Status::OK();
}

ONNX_OPERATOR_VERSIONED_KERNEL_EX(
    Conv,
    kOnnxDomain,
    1, 10,
    kArmNNExecutionProvider,
    KernelDefBuilder().TypeConstraint("T", DataTypeImpl::GetTensorType<float>()),
    Conv<float>);

ONNX_OPERATOR_KERNEL_EX(
    Conv,
    kOnnxDomain,
    11,
    kArmNNExecutionProvider,
    KernelDefBuilder().TypeConstraint("T", DataTypeImpl::GetTensorType<float>()),
    Conv<float>);

}  // namespace armnn_ep
}  // namespace onnxruntime


text:
import Board from './components/Board'

export {Board}


text:
package org.basex.build;

import static org.basex.data.DataText.*;

import java.io.*;

import org.basex.core.*;
import org.basex.core.cmd.*;
import org.basex.data.*;
import org.basex.index.name.*;
import org.basex.io.*;
import org.basex.io.in.DataInput;
import org.basex.io.out.*;
import org.basex.io.out.DataOutput;
import org.basex.io.random.*;
import org.basex.util.*;

/**
 * This class creates a database instance on disk.
 * The storage layout is described in the {@link Data} class.
 *
 * @author BaseX Team 2005-22, BSD License
 * @author Christian Gruen
 */
public final class DiskBuilder extends Builder {
  /** Database table. */
  private DataOutput tout;
  /** Database texts. */
  private DataOutput xout;
  /** Database values. */
  private DataOutput vout;
  /** Output stream for temporary values. */
  private DataOutput sout;

  /** Static options. */
  private final StaticOptions sopts;
  /** Debug counter. */
  private int c;

  /**
   * Constructor.
   * @param name name of database
   * @param parser parser
   * @param sopts static options
   * @param opts main options
   */
  public DiskBuilder(final String name, final Parser parser, final StaticOptions sopts,
      final MainOptions opts) {
    super(name, parser);
    this.sopts = sopts;
    meta = new MetaData(dbName, opts, sopts);
  }

  @Override
  public DiskData build() throws IOException {
    meta.assign(parser);

    // calculate optimized output buffer sizes to reduce disk fragmentation
    final Runtime rt = Runtime.getRuntime();
    final long max = Math.min(1 << 22, rt.maxMemory() - rt.freeMemory() >> 2);
    int bs = (int) Math.min(meta.inputsize, max);
    bs = Math.max(IO.BLOCKSIZE, bs - bs % IO.BLOCKSIZE);

    // drop old database (if available) and create new one
    DropDB.drop(dbName, sopts);
    sopts.dbPath(dbName).md();

    elemNames = new Names(meta);
    attrNames = new Names(meta);
    try {
      try {
        tout = new DataOutput(new TableOutput(meta, DATATBL));
        xout = new DataOutput(meta.dbFile(DATATXT), bs);
        vout = new DataOutput(meta.dbFile(DATAATV), bs);
        sout = new DataOutput(meta.dbFile(DATATMP), bs);
        parse();
      } finally {
        if(tout != null) tout.close();
        if(xout != null) xout.close();
        if(vout != null) vout.close();
        if(sout != null) sout.close();
      }

      // copy temporary values into database table
      final IOFile tmpFile = meta.dbFile(DATATMP);
      try(DataInput in = new DataInput(tmpFile)) {
        final TableAccess ta = new TableDiskAccess(meta, true);
        try {
          for(; spos < ssize; ++spos) ta.write4(in.readNum(), 8, in.readNum());
        } finally {
          ta.close();
        }
      }
      tmpFile.delete();

      // return database instance. build will be finalized when this instance is closed
      meta.dirty = true;
      return new DiskData(meta, elemNames, attrNames, path, nspaces);

    } catch(final Throwable th) {
      DropDB.drop(meta.name, sopts);
      throw th;
    }
  }

  @Override
  protected void addDoc(final byte[] value) throws IOException {
    tout.write1(Data.DOC);
    tout.write2(0);
    tout.write5(textRef(value, true));
    tout.write4(0);
    tout.write4(meta.size++);
  }

  @Override
  protected void addElem(final int dist, final int nameId, final int asize, final int uriId,
      final boolean ne) throws IOException {

    tout.write1(asize << 3 | Data.ELEM);
    tout.write2((ne ? 1 << 15 : 0) | nameId);
    tout.write1(uriId);
    tout.write4(dist);
    tout.write4(asize);
    tout.write4(meta.size++);

    if(Prop.debug && (c++ & 0x7FFFF) == 0) Util.err(".");
  }

  @Override
  protected void addAttr(final int nameId, final byte[] value, final int dist, final int uriId)
      throws IOException {

    tout.write1(dist << 3 | Data.ATTR);
    tout.write2(nameId);
    tout.write5(textRef(value, false));
    tout.write4(uriId);
    tout.write4(meta.size++);
  }

  @Override
  protected void addText(final byte[] value, final int dist, final byte kind) throws IOException {
    tout.write1(kind);
    tout.write2(0);
    tout.write5(textRef(value, true));
    tout.write4(dist);
    tout.write4(meta.size++);
  }

  @Override
  protected void setSize(final int pre, final int size) throws IOException {
    sout.writeNum(pre);
    sout.writeNum(size);
    ++ssize;
  }

  /**
   * Calculates the text offset and writes the text value.
   * @param value value to be inlined
   * @param text text/attribute flag
   * @return inline value or text position
   * @throws IOException I/O exception
   */
  private long textRef(final byte[] value, final boolean text) throws IOException {
    // try to inline value
    final long inlined = Inline.pack(value);
    if(inlined != 0) return inlined;

    // store text to heap file
    final byte[] packed = Compress.pack(value);
    final DataOutput store = text ? xout : vout;
    final long offset = store.size();
    store.writeToken(packed);
    return packed == value ? offset : Compress.COMPRESS | offset;
  }
}


text:
package edu.clemson.cs.r2jt.translation;

import edu.clemson.cs.r2jt.ResolveCompiler;
import edu.clemson.cs.r2jt.absyn.*;
import edu.clemson.cs.r2jt.archiving.Archiver;
import edu.clemson.cs.r2jt.compilereport.CompileReport;
import edu.clemson.cs.r2jt.data.Location;
import edu.clemson.cs.r2jt.data.ModuleID;
import edu.clemson.cs.r2jt.data.PosSymbol;
import edu.clemson.cs.r2jt.data.Symbol;
import edu.clemson.cs.r2jt.init.CompileEnvironment;
import edu.clemson.cs.r2jt.treewalk.TreeWalkerStackVisitor;
import edu.clemson.cs.r2jt.typeandpopulate.*;
import edu.clemson.cs.r2jt.typeandpopulate.entry.FacilityEntry;
import edu.clemson.cs.r2jt.typeandpopulate.entry.OperationEntry;
import edu.clemson.cs.r2jt.typeandpopulate.entry.ProgramParameterEntry;
import edu.clemson.cs.r2jt.typeandpopulate.entry.ProgramTypeEntry;
import edu.clemson.cs.r2jt.typeandpopulate.programtypes.*;
import edu.clemson.cs.r2jt.typeandpopulate.query.EntryTypeQuery;
import edu.clemson.cs.r2jt.typeandpopulate.query.OperationQuery;
import edu.clemson.cs.r2jt.typeandpopulate.query.UnqualifiedNameQuery;
import edu.clemson.cs.r2jt.misc.SourceErrorException;
import org.stringtemplate.v4.*;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.*;
import java.util.regex.Pattern;

public abstract class AbstractTranslator extends TreeWalkerStackVisitor {

    protected static final boolean PRINT_DEBUG = false;

    protected final CompileEnvironment myInstanceEnvironment;

    protected ModuleScope myScope = null;
    protected final MathSymbolTableBuilder myBuilder;
    protected final List<String> operationParameterNames =
            new ArrayList<String>();
    /**
     *
A pointer to a SymbolTableEntry that corresponds to
     * the FacilityDec currently being walked.  If one isn't
     * being walked, this should be null.

     */
    protected FacilityEntry myCurrentFacilityEntry = null;

    /**
     *
The STGroup that houses all templates used by a
     * given target language.

     */
    protected STGroup myGroup;

    /**
     *
The top of this Stack maintains a reference to the
     * template actively being built or added to, and the bottom refers to
     * shell - the outermost enclosing template for all
     * currently supported target languages.

     *
     *
Proper usage should generally involve: Pushing in <tt>pre</tt>,
     * modifying top arbitrarily with <tt>pre</tt>'s children, popping in the
     * corresponding <tt>post</tt>, then adding the popped template to the
     * appropriate enclosing template (i.e. the new/current top).

     */
    protected Stack<ST> myActiveTemplates = new Stack<ST>();

    /**
     *
This set keeps track of any additional includes or
     * imports needed to run the translated file. We call
     * it dynamic since only certain nodes trigger additions to this
     * set (i.e. FacilityDecs).

     */
    protected Set<String> myDynamicImports = new HashSet<String>();

    protected final String[] noTranslate =
            { "Std_Boolean_Fac.fa", "Std_Char_Str_Fac.fa",
                    "Std_Character_Fac.fa", "Std_Integer_Fac.fa",
                    "Std_Boolean_Realiz", "Integer_Template.co",
                    "Character_Template.co", "Char_Str_Template.co",
                    "Seq_Input_Template.co", "Seq_Output_Template.co",
                    "Print.co", "Std_Location_Linking_Realiz.rb" };

    /**
     *
This flag is true when walking the children of a
     * WhileStmtChanging clause; false otherwise.

     */
    // TODO : This global can be safely removed once walk methods for virtual
    //        list nodes are fixed. Talk to Blair about this.
    protected boolean myWhileStmtChangingClause = false;
    protected boolean myWalkingInitFinalItemFlag = false;
    /**
     *
This stores the facility qualifier when we encounter a
     * ProgramDotExp. Once we are done walking the
     * ProgramDotExp, its value becomes Null again.

     */
    private PosSymbol myFacilityQualifier;

    /**
     *
While we walk the children of a FacilityOperationDec, this will be set
     * to the FacilityOperationDec.  Otherwise it will be null.

     */
    private FacilityOperationDec myCurrentPrivateProcedure;

    public AbstractTranslator(CompileEnvironment env, ScopeRepository repo) {
        myInstanceEnvironment = env;
        myBuilder = (MathSymbolTableBuilder) repo;
        myFacilityQualifier = null;
    }

    //-------------------------------------------------------------------
    //   Visitor methods
    //-------------------------------------------------------------------

    @Override
    public void preModuleDec(ModuleDec node) {

        try {
            myScope = myBuilder.getModuleScope(new ModuleIdentifier(node));

            ST outermostEnclosingTemplate = myGroup.getInstanceOf("module");

            outermostEnclosingTemplate.add("includes", myGroup.getInstanceOf(
                    "include").add("directories", "RESOLVE"));

            myActiveTemplates.push(outermostEnclosingTemplate);

            AbstractTranslator.emitDebug("----------------------------------\n"
                    + "Translate: " + node.getName().getName()
                    + "\n----------------------------------");
        }
        catch (NoSuchSymbolException nsse) {
            noSuchModule(node.getName());
            throw new RuntimeException();
        }
    }

    @Override
    public void preUsesItem(UsesItem node) {
        try {
            FacilityEntry e =
                    myScope.queryForOne(
                            new UnqualifiedNameQuery(node.getName().getName()))
                            .toFacilityEntry(null);

            String spec =
                    e.getFacility().getSpecification().getModuleIdentifier()
                            .toString();

            List<String> pathPieces = getPathList(getFile(null, spec));

            myActiveTemplates.firstElement().add(
                    "includes",
                    myGroup.getInstanceOf("include").add("directories",
                            pathPieces));
        }
        catch (NoSuchSymbolException nsse) {
            // TODO: Hack Hack. Figure out a way to do this properly.
            // things like static_array_template show up here.
        }
        catch (DuplicateSymbolException dse) {
            throw new RuntimeException(dse);
        }
    }

    @Override
    public void postCallStmt(CallStmt node) {
        ST callStmt = myActiveTemplates.pop();
        myActiveTemplates.peek().add("stmts", callStmt);
    }

    @Override
    public void preWhileStmt(WhileStmt node) {
        ST whileStmt = myGroup.getInstanceOf("while");
        myActiveTemplates.push(whileStmt);
    }

    @Override
    public void postWhileStmt(WhileStmt node) {
        ST whileStmt = myActiveTemplates.pop();
        myActiveTemplates.peek().add("stmts", whileStmt);
    }

    @Override
    public void preWhileStmtChanging(WhileStmt node) {
        myWhileStmtChangingClause = true;
    }

    @Override
    public void postWhileStmtChanging(WhileStmt node) {
        myWhileStmtChangingClause = false;
    }

    @Override
    public void preIfStmt(IfStmt node) {
        ST ifStmt = myGroup.getInstanceOf("if");
        myActiveTemplates.push(ifStmt);
    }

    public void postIfStmt(IfStmt node) {
        ST ifStmt = myActiveTemplates.pop();
        myActiveTemplates.peek().add("stmts", ifStmt);
    }

    // TODO : This is probably going to need some tweaking once else-ifs
    //        are fixed.
    public void preIfStmtElseclause(IfStmt data) {

        //IfStmtElseClauses are nested within the tree. So if we're here,
        //add the if part to the outermost stmt block.
        ST ifPart = myActiveTemplates.pop();
        myActiveTemplates.peek().add("stmts", ifPart);

        ST elseStmt = myGroup.getInstanceOf("else");
        myActiveTemplates.push(elseStmt);
    }

    @Override
    public void preFuncAssignStmt(FuncAssignStmt node) {

        String qualifier =
                getDefiningFacilityEntry(node.getVar().getProgramType())
                        .getName();

        ST assignStmt =
                myGroup.getInstanceOf("qualified_call").add("name", "assign")
                        .add("qualifier", qualifier);

        myActiveTemplates.push(assignStmt);
    }

    @Override
    public void postFuncAssignStmt(FuncAssignStmt node) {
        ST assignStmt = myActiveTemplates.pop();
        myActiveTemplates.peek().add("stmts", assignStmt);
    }

    @Override
    public void postSwapStmt(SwapStmt node) {
        ST swapStmt = myActiveTemplates.pop();
        myActiveTemplates.peek().add("stmts", swapStmt);
    }

    @Override
    public void preProgramDotExp(ProgramDotExp node) {
        myFacilityQualifier = node.getQualifier();
    }

    @Override
    public void preProgramIntegerExp(ProgramIntegerExp node) {

        ST integerExp =
                myGroup.getInstanceOf("var_init").add("type",
                        getVariableTypeTemplate(node.getProgramType()));

        integerExp.add("facility",
                getDefiningFacilityEntry(node.getProgramType()).getName()).add(
                "arguments", node.getValue());

        myActiveTemplates.peek().add("arguments", integerExp);
    }

    @Override
    public void preInitItem(InitItem e) {
        myWalkingInitFinalItemFlag = true;
    }

    @Override
    public void postInitItem(InitItem e) {
        myWalkingInitFinalItemFlag = false;
    }

    @Override
    public void preFinalItem(FinalItem e) {
        myWalkingInitFinalItemFlag = true;
    }

    @Override
    public void postFinalItem(FinalItem e) {
        myWalkingInitFinalItemFlag = false;
    }

    public void preProgramStringExp(ProgramStringExp node) {

        ST stringExp =
                myGroup.getInstanceOf("var_init").add("type",
                        getVariableTypeTemplate(node.getProgramType()));

        stringExp.add("facility",
                getDefiningFacilityEntry(node.getProgramType()).getName()).add(
                "arguments", node.getValue());

        myActiveTemplates.peek().add("arguments", stringExp);
    }

    @Override
    public void preProgramParamExp(ProgramParamExp node) {

        ST paramExp;

        String qualifier =
                getCallQualifier(myFacilityQualifier, node.getName(), node
                        .getArguments());
        if (operationParameterNames.contains(node.getName().getName())) {
            qualifier = node.getName().getName() + "Param";
        }

        if (qualifier != null) {
            paramExp =
                    myGroup.getInstanceOf("qualified_param_exp").add(
                            "qualifier", qualifier).add("name",
                            node.getName().getName());
        }
        else {
            paramExp =
                    myGroup.getInstanceOf("unqualified_param_exp").add("name",
                            node.getName().getName());
        }

        myActiveTemplates.push(paramExp);
    }

    @Override
    public void postProgramDotExp(ProgramDotExp node) {
        myFacilityQualifier = null;
    }

    @Override
    public void postProgramParamExp(ProgramParamExp node) {
        ST paramExp = myActiveTemplates.pop();
        myActiveTemplates.peek().add("arguments", paramExp);
    }

    @Override
    public boolean walkVariableRecordExp(VariableRecordExp node) {
        return true;
    }

    @Override
    public boolean walkVariableDotExp(VariableDotExp e) {

        //If we encounter a dot expression in an initialization clause,
        //we to basically pretend that its a normal name expression. This is not
        //ideal, but for now, our model of java code requires/expects this.

        //TODO: Think about cases in which the java will actually need a
        //variableDotExp, and the RESOLVE source that will elicit this.
        if (myWalkingInitFinalItemFlag) {
            preAny(e);
            preExp(e);
            preProgramExp(e);
            preVariableExp(e);

            //For now we assume we're dealing with a name, since we need to
            //initialize just the name.
            preVariableNameExp((VariableNameExp) e.getSegments().get(1));
            postVariableNameExp((VariableNameExp) e.getSegments().get(1));

            postVariableExp(e);
            postProgramExp(e);
            postExp(e);
            postAny(e);
        }
        return myWalkingInitFinalItemFlag;
    }

    @Override
    public void preVariableDotExp(VariableDotExp node) {

        PTType type = node.getSegments().get(0).getProgramType();

        ST dotExp =
                myGroup.getInstanceOf("variable_dot_exp").add("modulename",
                        myScope.getDefiningElement().getName().getName()).add(
                        "typename", getTypeName(type));

        myActiveTemplates.push(dotExp);
    }

    @Override
    public void postVariableDotExp(VariableDotExp node) {
        ST dotExp = myActiveTemplates.pop();
        myActiveTemplates.peek().add("arguments", dotExp);
    }

    @Override
    public void preFacilityOperationDec(FacilityOperationDec node) {
        myCurrentPrivateProcedure = node;
    }

    @Override
    public void preOperationDec(OperationDec node) {
        // Check to see if we are an OperationDec
        // inside a FacilityOperationDec. If we are,
        // then we have a body.
        boolean hasBody = false;
        if (myCurrentPrivateProcedure != null) {
            hasBody = true;
        }

        ST operation =
                getOperationLikeTemplate((node.getReturnTy() != null) ? node
                        .getReturnTy().getProgramTypeValue() : null, node
                        .getName().getName(), hasBody);

        myActiveTemplates.push(operation);
    }

    @Override
    public void preProcedureDec(ProcedureDec node) {

        ST operation =
                getOperationLikeTemplate((node.getReturnTy() != null) ? node
                        .getReturnTy().getProgramTypeValue() : null, node
                        .getName().getName(), true);

        myActiveTemplates.push(operation);

        if (node.getReturnTy() != null) {
            addVariableTemplate(node.getReturnTy().getProgramTypeValue(), node
                    .getName().getName());
        }
    }

    @Override
    public void postOperationDec(OperationDec node) {
        // Perform different actions depending if we are
        // a standalone OperationDec or if we are an
        // OperationDec inside a FacilityOperationDec
        if (myCurrentPrivateProcedure == null) {
            ST operation = myActiveTemplates.pop();
            myActiveTemplates.peek().add("functions", operation);
        }
        else {
            if (node.getReturnTy() != null) {
                addVariableTemplate(node.getReturnTy().getProgramTypeValue(),
                        node.getName().getName());
            }
        }
    }

    @Override
    public void postProcedureDec(ProcedureDec node) {

        if (node.getReturnTy() != null) {
            ST returnStmt =
                    myGroup.getInstanceOf("return_stmt").add("name",
                            node.getName().getName());

            myActiveTemplates.peek().add("stmts", returnStmt);
        }

        ST operation = myActiveTemplates.pop();
        myActiveTemplates.peek().add("functions", operation);
    }

    @Override
    public void postFacilityOperationDec(FacilityOperationDec node) {

        if (node.getReturnTy() != null) {
            ST returnStmt =
                    myGroup.getInstanceOf("return_stmt").add("name",
                            node.getName().getName());

            myActiveTemplates.peek().add("stmts", returnStmt);
        }

        ST operation = myActiveTemplates.pop();
        myActiveTemplates.peek().add("functions", operation);

        myCurrentPrivateProcedure = null;
    }

    @Override
    public void preVarDec(VarDec node) {
        addVariableTemplate(node.getTy().getProgramTypeValue(), node.getName()
                .getName());
    }

    @Override
    public void preParameterVarDec(ParameterVarDec node) {

        PTType type = node.getTy().getProgramTypeValue();

        ST parameter =
                myGroup.getInstanceOf("parameter").add("type",
                        getParameterTypeTemplate(type)).add("name",
                        node.getName().getName());

        myActiveTemplates.peek().add("parameters", parameter);
    }

    @Override
    public void postModuleDec(ModuleDec node) {

        if (!myDynamicImports.isEmpty()) {
            myActiveTemplates.firstElement().add("includes", myDynamicImports);
        }
        AbstractTranslator.emitDebug("----------------------------------\n"
                + "End: " + node.getName().getName()
                + "\n----------------------------------");
    }

    //-------------------------------------------------------------------
    //   Helper methods
    //-------------------------------------------------------------------

    protected abstract ST getVariableTypeTemplate(PTType type);

    protected abstract ST getOperationTypeTemplate(PTType type);

    protected abstract ST getParameterTypeTemplate(PTType type);

    protected abstract String getFunctionModifier();

    /**
     *
Constructs and adds a parameter to the currently active
     * template.

     *
     * @param type A PTType representing the 'declared type' of
     *             the parameter.
     * @param name The name of the parameter.
     */
    protected void addParameterTemplate(PTType type, String name) {
        ST parameter =
                myGroup.getInstanceOf("parameter").add("type",
                        getVariableTypeTemplate(type)).add("name", name);

        myActiveTemplates.peek().add("parameters", parameter);
    }

    /**
     *
Constructs and adds a var template to the currently
     * active template.

     *
     * @param type A PTType representing the type of the
     *             variable
     * @param name The name of the variable.
     */
    protected void addVariableTemplate(PTType type, String name) {
        ST init, variable;

        if (type instanceof PTGeneric) {
            init =
                    myGroup.getInstanceOf("rtype_init").add("typeName",
                            getTypeName(type));
        }
        else if (type instanceof PTFacilityRepresentation) {
            init =
                    myGroup.getInstanceOf("facility_type_var_init").add("name",
                            getTypeName(type));
        }
        else if (getDefiningFacilityEntry(type) != null) {
            init =
                    myGroup.getInstanceOf("var_init").add("type",
                            getVariableTypeTemplate(type)).add("facility",
                            getDefiningFacilityEntry(type).getName());
        }
        else {
            init =
                    myGroup.getInstanceOf("enhancement_var_init").add("type",
                            getVariableTypeTemplate(type));
        }
        variable =
                myGroup.getInstanceOf("var_decl").add("name", name).add("type",
                        getVariableTypeTemplate(type)).add("init", init);

        AbstractTranslator.emitDebug(("Adding variable: " + name
                + " with type: " + getTypeName(type)));

        myActiveTemplates.peek().add("variables", variable);
    }

    /**
     *
Returns a function template 'filled in' with the
     * attributes provided.

     *
     * @param returnType A PTType representative of the
     *                   function's return type attribute.
     * @param name       The name attribute.
     * @param hasBody    A boolean indicating whether or not the function being
     *                   created should have a body or not.
     *
     * @return A function template with the type
     *         and name attributes formed and filled in.
     */
    protected ST getOperationLikeTemplate(PTType returnType, String name,
            boolean hasBody) {

        String attributeName = (hasBody) ? "function_def" : "function_decl";

        ST operationLikeThingy =
                myGroup.getInstanceOf(attributeName).add("name", name).add(
                        "modifier", getFunctionModifier());

        operationLikeThingy.add("type",
                (returnType != null) ? getOperationTypeTemplate(returnType)
                        : "void");

        return operationLikeThingy;
    }

    /**
     *
Returns a list of ProgramParameterEntrys representing
     * the formal parameters of module moduleName.

     *
     * @param moduleName A PosSymbol containing the name of the
     *                   module whose parameters
     * @return A (possibly empty) list of formal parameters.
     */
    protected List<ProgramParameterEntry> getModuleFormalParameters(
            PosSymbol moduleName) {
        try {
            ModuleDec spec =
                    myBuilder.getModuleScope(
                            new ModuleIdentifier(moduleName.getName()))
                            .getDefiningElement();

            return myBuilder.getScope(spec).getFormalParameterEntries();
        }
        catch (NoSuchSymbolException nsse) {
            noSuchModule(moduleName);
            throw new RuntimeException();
        }
    }

    /**
     *
Returns the 'name' component of a PTType.
     *
     * @param type A PTType.
     *
     * @return type's actual name rather than the more easily
     *         accessible toString representation.
     */
    protected String getTypeName(PTType type) {

        String result;

        if (type == null) {
            return null;
        }
        if (type instanceof PTElement) {
            // Not sure under what conditions this would appear in output.
            result = "PTELEMENT";
        }
        else if (type instanceof PTGeneric) {
            result = ((PTGeneric) type).getName();
        }
        else if (type instanceof PTRepresentation) {
            result = ((PTRepresentation) type).getFamily().getName();
        }
        else if (type instanceof PTFacilityRepresentation) {
            result = ((PTFacilityRepresentation) type).getName();
        }
        else if (type instanceof PTFamily) {
            result = ((PTFamily) type).getName();
        }
        else {
            throw new UnsupportedOperationException("Translation has "
                    + "encountered an unrecognized PTType: " + type.toString()
                    + ". Backing out.");
        }
        return result;
    }

    /**
     *
Searches for the FacilityEntry responsible for
     * bringing the SymbolTableEntry referenced by type into the
     * ModuleScope being translated.

     *
     * @param type  The PTType we want symboltable info for.
     *
     * @return The FacilityEntry that defines type.
     */
    protected FacilityEntry getDefiningFacilityEntry(PTType type) {

        FacilityEntry result = null;
        //String searchString = getTypeName(type);

        try {
            ProgramTypeEntry te =
                    myScope.queryForOne(
                            new UnqualifiedNameQuery(type.toString()))
                            .toProgramTypeEntry(null);

            List<FacilityEntry> facilities =
                    myScope.query(new EntryTypeQuery(FacilityEntry.class,
                            MathSymbolTable.ImportStrategy.IMPORT_NAMED,
                            MathSymbolTable.FacilityStrategy.FACILITY_IGNORE));

            for (FacilityEntry facility : facilities) {
                if (te.getSourceModuleIdentifier().equals(
                        facility.getFacility().getSpecification()
                                .getModuleIdentifier())) {

                    result = facility;
                }
            }
        }
        catch (NoSuchSymbolException nsse) {
            throw new RuntimeException("Translation unable to find a "
                    + "FacilityEntry locally or otherwise that defines type: "
                    + type.toString());
        }
        catch (DuplicateSymbolException dse) {
            throw new RuntimeException(dse); // shouldn't fire.
        }
        return result;
    }

    protected String getCallQualifier(PosSymbol qualifier, PosSymbol name,
            List<ProgramExp> args) {

        String result = null;
        List<PTType> argTypes = new LinkedList<PTType>();
        FacilityEntry definingFacility = null;

        try {
            for (ProgramExp arg : args) {
                argTypes.add(arg.getProgramType());
            }

            OperationEntry oe =
                    myScope.queryForOne(
                            new OperationQuery(null, name, argTypes))
                            .toOperationEntry(null);

            // We're dealing with local operation, then no qualifier.
            if (myScope.getModuleIdentifier().equals(
                    oe.getSourceModuleIdentifier())) {
                return null;
            }
            // Grab FacilityEntries in scope whose specification matches
            // oe's SourceModuleIdentifier.
            List<FacilityEntry> facilities =
                    myScope.query(new EntryTypeQuery(FacilityEntry.class,
                            MathSymbolTable.ImportStrategy.IMPORT_NAMED,
                            MathSymbolTable.FacilityStrategy.FACILITY_IGNORE));

            boolean comesFromEnhancement = false;

            for (FacilityEntry f : facilities) {

                if (qualifier != null
                        && f.getName().equals(qualifier.getName())) {
                    definingFacility = f;
                    break;
                }

                if (oe.getSourceModuleIdentifier().equals(
                        f.getFacility().getSpecification()
                                .getModuleIdentifier())) {
                    definingFacility = f;
                }

                for (ModuleParameterization p : f.getEnhancements()) {
                    if (oe.getSourceModuleIdentifier().equals(
                            p.getModuleIdentifier())) {
                        definingFacility = f;
                        comesFromEnhancement = true;
                    }
                }
            }

            // If we're in an enhancement realization, some calls rightly won't
            // have a facility, and hence no qualifier should be returned.
            if (definingFacility == null) {
                return null;
            }

            // This is the idiotic part, really this is mixing the model and
            // view (since I've put the '(' .. ')' cast parens in but it was
            // mostly so I wouldn't have to write yet another super specific
            // template -- there is likely a more elegant way.
            if (definingFacility.getEnhancements().size() >= 2
                    && comesFromEnhancement) {
                result =
                        "((" + oe.getSourceModuleIdentifier() + ")"
                                + definingFacility.getName() + ")";
            }
            else {
                result = definingFacility.getName();
            }
        }
        catch (NoSuchSymbolException nsse) {
            throw new RuntimeException(); // Should've been caught a long
            // time ago.
        }
        catch (DuplicateSymbolException dse) {
            throw new RuntimeException(); // Should've been caught a long
            // time ago.
        }
        return result;
    }

    //-------------------------------------------------------------------
    //   Error handling
    //-------------------------------------------------------------------

    public void noSuchModule(PosSymbol module) {
        throw new SourceErrorException(
                "Module does not exist or is not in scope.", module);
    }

    public void noSuchSymbol(PosSymbol qualifier, PosSymbol symbol) {
        noSuchSymbol(qualifier, symbol.getName(), symbol.getLocation());
    }

    public void noSuchSymbol(PosSymbol qualifier, String symbolName, Location l) {

        String message;

        if (qualifier == null) {
            message = "Translation was unable to find symbol: " + symbolName;
        }
        else {
            message =
                    "No such symbol in module: " + qualifier.getName() + "."
                            + symbolName;
        }

        throw new SourceErrorException(message, l);
    }

    //-------------------------------------------------------------------
    //   Utility, output, and flag-related methods
    //-------------------------------------------------------------------

    /**
     *
Returns a File given either a ModuleDec
     * or a string containing the name of a
     * ConceptBodyModuleDec.

     *
     * @param module A ModuleDec.
     * @param name The name of an existing ConceptBodyModuleDec.
     *
     * @return A File.
     */
    protected File getFile(ModuleDec module, String name) {

        File result;

        if (module == null && name == null) {
            throw new IllegalArgumentException("Translation requires at least"
                    + " one non-null argument to retrieve the correct file"
                    + " from the compile environment.");
        }

        if (module != null) {
            ModuleID id = ModuleID.createID(module);
            result = myInstanceEnvironment.getFile(id);
        }
        else {
            PosSymbol conceptName = new PosSymbol(null, Symbol.symbol(name));
            ModuleID id = ModuleID.createConceptID(conceptName);
            result = myInstanceEnvironment.getFile(id);
        }
        return result;
    }

    /**
     *
Given a File object, this hacky little method returns a
     * list whose elements consist of the directory names of the input file's
     * absolute path.

     *
     *
For example, given file (with directory path) :
     *
Resolve-Workspace/RESOLVE/Main/X.fa

     *
     *
this method will return :
     *
[RESOLVE, Main, X]

     *
     *
Note that any directories prior to the root "RESOLVE" directory are
     * stripped, along with source's file extension.

     *
     * @param source The input File.
     * @return A list whose elements correspond to the path directories
     *         of source.
     */
    protected List<String> getPathList(File source) {
        String currentToken;
        boolean rootDirectoryFound = false;

        List<String> result = new LinkedList<String>();
        StringTokenizer stTok =
                new StringTokenizer(source.getAbsolutePath(), File.separator);

        while (stTok.hasMoreTokens()) {
            currentToken = stTok.nextToken();

            if (currentToken.equalsIgnoreCase("RESOLVE") || rootDirectoryFound) {
                rootDirectoryFound = true;

                if (currentToken.contains(".")) {
                    currentToken =
                            currentToken
                                    .substring(0, currentToken.indexOf('.'));
                }
                result.add(currentToken);
            }
        }
        // this needs some more thought, though imports are likely to be
        // adjusted quite a bit in the near future.
        result.remove(result.size() - 1);
        return result;
    }

    public boolean onNoCompileList(File file) {
        Pattern p = null;
        String fileName = file.toString();
        for (String s : noTranslate) {
            p = Pattern.compile(s);
            if (p.matcher(fileName).find()) {
                return true;
            }
        }
        return false;
    }

    public static void emitDebug(String msg) {
        if (PRINT_DEBUG) {
            System.out.println(msg);
        }
    }

    public void outputCode(File outputFile) {
        if (!myInstanceEnvironment.flags.isFlagSet(ResolveCompiler.FLAG_WEB)
                || myInstanceEnvironment.flags.isFlagSet(Archiver.FLAG_ARCHIVE)) {
            outputAsFile(outputFile.getAbsolutePath(), myActiveTemplates.peek()
                    .render());
            // System.out.println(myActiveTemplates.peek().render());
        }
        else {
            outputToReport(myActiveTemplates.peek().render());
        }
    }

    private void outputToReport(String fileContents) {
        CompileReport report = myInstanceEnvironment.getCompileReport();
        report.setTranslateSuccess();
        report.setOutput(fileContents);
    }

    // TODO : Redo this and make it appropriate for the abstract translator.
    private void outputAsFile(String fileName, String fileContents) {
        String[] temp = fileName.split("\\.");
        fileName = temp[0] + ".java";
        if (fileContents != null && fileContents.length() > 0) {
            try {
                File outputJavaFile = new File(fileName);
                if (!outputJavaFile.exists()) {
                    outputJavaFile.createNewFile();
                }
                byte buf[] = fileContents.getBytes();
                OutputStream outFile = new FileOutputStream(outputJavaFile);
                outFile.write(buf);
                outFile.close();
            }
            catch (IOException ex) {
                //FIX: Something should be done with this exception - ya think?
            }
        }
        else {
            System.out.println("No translation available for " + fileName);
        }
    }
}


text:
using System;
using DataGenerator.Sources;
using Xunit;
using Xunit.Abstractions;

namespace DataGenerator.Tests.Sources
{
    public class PasswordSourceTest
    {
        private readonly ITestOutputHelper _output;

        public PasswordSourceTest(ITestOutputHelper output)
        {
            _output = output;
        }

        [Fact]
        public void NextValue()
        {
            var source = new PasswordSource();

            for (int i = 0; i < 10; i++)
            {
                var nextValue = source.NextValue(null);
                _output.WriteLine($"Value {i}: {nextValue}");
            }

        }
    }
}


text:
package com.pengrad.telegrambot.model;

import java.io.Serializable;
import java.util.Objects;

/**
 * stas
 * 5/3/16.
 */
public class MessageEntity implements Serializable {
    private final static long serialVersionUID = 0L;

    public enum Type {
        mention, hashtag, cashtag, bot_command, url, email, phone_number, bold, italic, code, pre, text_link,
        text_mention, underline, strikethrough, spoiler, custom_emoji
    }

    private Type type;
    private Integer offset;
    private Integer length;
    private String url;
    private User user;
    private String language;
    private String custom_emoji_id;

    private MessageEntity() {
    }

    public MessageEntity(Type type, Integer offset, Integer length) {
        this.type = type;
        this.offset = offset;
        this.length = length;
    }

    public Type type() {
        return type;
    }

    public Integer offset() {
        return offset;
    }

    public Integer length() {
        return length;
    }

    public String url() {
        return url;
    }

    public User user() {
        return user;
    }

    public String language() {
        return language;
    }

    public String customEmojiId() {
        return custom_emoji_id;
    }

    public MessageEntity url(String url) {
        this.url = url;
        return this;
    }

    public MessageEntity user(User user) {
        this.user = user;
        return this;
    }

    public MessageEntity language(String language) {
        this.language = language;
        return this;
    }

    public MessageEntity customEmojiId(String custom_emoji_id) {
        this.custom_emoji_id = custom_emoji_id;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MessageEntity that = (MessageEntity) o;
        return type == that.type &&
                Objects.equals(offset, that.offset) &&
                Objects.equals(length, that.length) &&
                Objects.equals(url, that.url) &&
                Objects.equals(user, that.user) &&
                Objects.equals(language, that.language) &&
                Objects.equals(custom_emoji_id, that.custom_emoji_id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, offset, length, url, user, language, custom_emoji_id);
    }

    @Override
    public String toString() {
        return "MessageEntity{" +
                "type=" + type +
                ", offset=" + offset +
                ", length=" + length +
                ", url='" + url + '\'' +
                ", user=" + user +
                ", language='" + language + '\'' +
                ", custom_emoji_id='" + custom_emoji_id + '\'' +
                '}';
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<Benchmark xmlns="http://checklists.nist.gov/xccdf/1.2" id="xccdf_moc.elpmaxe.www_benchmark_test">
  <status>accepted</status>
  <plain-text id="my_filename">test_file</plain-text>
  <version>1.0</version>
  <Rule selected="true" id="xccdf_moc.elpmaxe.www_rule_1">
    <title>Ensure that file exists and it is not executable</title>
    <fix system="urn:xccdf:fix:script:sh">
      touch
      chmod a-x
    </fix>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
      <check-content-ref href="test_remediation_simple.oval.xml" name="oval:moc.elpmaxe.www:def:1"/>
    </check>
  </Rule>
</Benchmark>


text:
using System.Reflection;
using System;
using NetRuntimeSystem = System;
using System.ComponentModel;
using NetOffice.Attributes;

namespace NetOffice.OfficeApi
{
	/// <summary>
	/// DispatchInterface CommandBarPopup
	/// SupportByVersion Office, 9,10,11,12,14,15,16
	/// </summary>
	/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.CommandBarPopup"/> </remarks>
	[SupportByVersion("Office", 9,10,11,12,14,15,16)]
	[EntityType(EntityType.IsDispatchInterface)]
 	public class CommandBarPopup : CommandBarControl
    {
		#pragma warning disable

		#region Type Information

		/// <summary>
		/// Instance Type
		/// </summary>
		[EditorBrowsable(EditorBrowsableState.Advanced), Browsable(false), Category("NetOffice"), CoreOverridden]
		public override Type InstanceType
		{
			get
			{
				return LateBindingApiWrapperType;
			}
		}

        private static Type _type;

		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
        public static Type LateBindingApiWrapperType
        {
            get
            {
                if (null == _type)
                    _type = typeof(CommandBarPopup);
                return _type;
            }
        }

        #endregion

		#region Ctor

		/// <param name="factory">current used factory core</param>
		/// <param name="parentObject">object there has created the proxy</param>
		/// <param name="proxyShare">proxy share instead if com proxy</param>
		public CommandBarPopup(Core factory, ICOMObject parentObject, COMProxyShare proxyShare) : base(factory, parentObject, proxyShare)
		{
		}

		///<param name="factory">current used factory core</param>
		///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
		public CommandBarPopup(Core factory, ICOMObject parentObject, object comProxy) : base(factory, parentObject, comProxy)
		{

		}

        ///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
        [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public CommandBarPopup(ICOMObject parentObject, object comProxy) : base(parentObject, comProxy)
		{
		}

		///<param name="factory">current used factory core</param>
		///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
        ///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public CommandBarPopup(Core factory, ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(factory, parentObject, comProxy, comProxyType)
		{

		}

		///<param name="parentObject">object there has created the proxy</param>
        ///<param name="comProxy">inner wrapped COM proxy</param>
        ///<param name="comProxyType">Type of inner wrapped COM proxy"</param>
        [EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public CommandBarPopup(ICOMObject parentObject, object comProxy, NetRuntimeSystem.Type comProxyType) : base(parentObject, comProxy, comProxyType)
		{
		}

		///<param name="replacedObject">object to replaced. replacedObject are not usable after this action</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public CommandBarPopup(ICOMObject replacedObject) : base(replacedObject)
		{
		}

		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public CommandBarPopup() : base()
		{
		}

		/// <param name="progId">registered progID</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public CommandBarPopup(string progId) : base(progId)
		{
		}

		#endregion

		#region Properties

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// Get
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.CommandBarPopup.CommandBar"/> </remarks>
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public NetOffice.OfficeApi.CommandBar CommandBar
		{
			get
			{
				return Factory.ExecuteKnownReferencePropertyGet<NetOffice.OfficeApi.CommandBar>(this, "CommandBar", NetOffice.OfficeApi.CommandBar.LateBindingApiWrapperType);
			}
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// Get
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.CommandBarPopup.Controls"/> </remarks>
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public NetOffice.OfficeApi.CommandBarControls Controls
		{
			get
			{
				return Factory.ExecuteKnownReferencePropertyGet<NetOffice.OfficeApi.CommandBarControls>(this, "Controls", NetOffice.OfficeApi.CommandBarControls.LateBindingApiWrapperType);
			}
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// Get/Set
		/// </summary>
		/// <remarks> Docs: <see href="https://docs.microsoft.com/en-us/office/vba/api/Office.CommandBarPopup.OLEMenuGroup"/> </remarks>
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public NetOffice.OfficeApi.Enums.MsoOLEMenuGroup OLEMenuGroup
		{
			get
			{
				return Factory.ExecuteEnumPropertyGet<NetOffice.OfficeApi.Enums.MsoOLEMenuGroup>(this, "OLEMenuGroup");
			}
			set
			{
				Factory.ExecuteEnumPropertySet(this, "OLEMenuGroup", value);
			}
		}

		/// <summary>
		/// SupportByVersion Office 14, 15, 16
		/// Get
		/// </summary>
		[SupportByVersion("Office", 14,15,16)]
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		public object InstanceIdPtr
		{
			get
			{
				return Factory.ExecuteVariantPropertyGet(this, "InstanceIdPtr");
			}
		}

		#endregion

		#region Methods

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="flagsSelect">Int32 flagsSelect</param>
		/// <param name="varChild">optional object varChild</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public void accSelect(Int32 flagsSelect, object varChild)
		{
			 Factory.ExecuteMethod(this, "accSelect", flagsSelect, varChild);
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="flagsSelect">Int32 flagsSelect</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[CustomMethod]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public void accSelect(Int32 flagsSelect)
		{
			 Factory.ExecuteMethod(this, "accSelect", flagsSelect);
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="pxLeft">Int32 pxLeft</param>
		/// <param name="pyTop">Int32 pyTop</param>
		/// <param name="pcxWidth">Int32 pcxWidth</param>
		/// <param name="pcyHeight">Int32 pcyHeight</param>
		/// <param name="varChild">optional object varChild</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public void accLocation(out Int32 pxLeft, out Int32 pyTop, out Int32 pcxWidth, out Int32 pcyHeight, object varChild)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true,true,true,true,false);
			pxLeft = 0;
			pyTop = 0;
			pcxWidth = 0;
			pcyHeight = 0;
			object[] paramsArray = Invoker.ValidateParamsArray(pxLeft, pyTop, pcxWidth, pcyHeight, varChild);
			Invoker.Method(this, "accLocation", paramsArray, modifiers);
			pxLeft = (Int32)paramsArray[0];
			pyTop = (Int32)paramsArray[1];
			pcxWidth = (Int32)paramsArray[2];
			pcyHeight = (Int32)paramsArray[3];
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="pxLeft">Int32 pxLeft</param>
		/// <param name="pyTop">Int32 pyTop</param>
		/// <param name="pcxWidth">Int32 pcxWidth</param>
		/// <param name="pcyHeight">Int32 pcyHeight</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[CustomMethod]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public void accLocation(out Int32 pxLeft, out Int32 pyTop, out Int32 pcxWidth, out Int32 pcyHeight)
		{
			ParameterModifier[] modifiers = Invoker.CreateParamModifiers(true,true,true,true);
			pxLeft = 0;
			pyTop = 0;
			pcxWidth = 0;
			pcyHeight = 0;
			object[] paramsArray = Invoker.ValidateParamsArray(pxLeft, pyTop, pcxWidth, pcyHeight);
			Invoker.Method(this, "accLocation", paramsArray, modifiers);
			pxLeft = (Int32)paramsArray[0];
			pyTop = (Int32)paramsArray[1];
			pcxWidth = (Int32)paramsArray[2];
			pcyHeight = (Int32)paramsArray[3];
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="navDir">Int32 navDir</param>
		/// <param name="varStart">optional object varStart</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public object accNavigate(Int32 navDir, object varStart)
		{
			return Factory.ExecuteVariantMethodGet(this, "accNavigate", navDir, varStart);
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="navDir">Int32 navDir</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[CustomMethod]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public object accNavigate(Int32 navDir)
		{
			return Factory.ExecuteVariantMethodGet(this, "accNavigate", navDir);
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="xLeft">Int32 xLeft</param>
		/// <param name="yTop">Int32 yTop</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public object accHitTest(Int32 xLeft, Int32 yTop)
		{
			return Factory.ExecuteVariantMethodGet(this, "accHitTest", xLeft, yTop);
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		/// <param name="varChild">optional object varChild</param>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public void accDoDefaultAction(object varChild)
		{
			 Factory.ExecuteMethod(this, "accDoDefaultAction", varChild);
		}

		/// <summary>
		/// SupportByVersion Office 9, 10, 11, 12, 14, 15, 16
		/// </summary>
		[EditorBrowsable(EditorBrowsableState.Never), Browsable(false)]
		[CustomMethod]
		[SupportByVersion("Office", 9,10,11,12,14,15,16)]
		public void accDoDefaultAction()
		{
			 Factory.ExecuteMethod(this, "accDoDefaultAction");
		}

		#endregion

		#pragma warning restore
	}
}


text:
<?php foreach($find as $data): ?>

Kegiatan Ekstrakulikuler

					<img src="<?php echo base_url('gambar/upload/') ?><?php echo $data->photo ?>" class="img-responsive" alt="Image">

	<?php echo form_open_multipart('kegiatan/update')?>

					<input name="id" type="hidden" value="<?php echo $data->id ?>">

					Pilih File :
					<input name="poto" type="file" class="form-control" required>

					<input type="submit" class="btn btn-primary">

	<?php echo form_close()?>
<?php endforeach; ?>


text:
package app.models;

import org.javalite.activejdbc.Model;
import org.javalite.activejdbc.annotations.IdName;
import org.javalite.activejdbc.annotations.Table;

@Table("ssbp_tbl")
@IdName("KDSSBP")
public class MdSsbpTbl extends Model{

}


text:
layout: post
author:
    name: Audrey So
    url: https://twitter.com/aud_rey_so
title:  "Cordova-Common@2.1.0 Released!"
date: 2017-09-05
categories: news
tags: release tools cordova-common
---

We just released some changes to `cordova-common`!

* [cordova-common@2.1.0](https://www.npmjs.com/package/cordova-common)

Release Highlights:
* Support added for `<config-file>` in `config.xml`.
* `allows-arbitrary-loads-for-media` attribute parsing added for `getAccesses`.
* Added variable replacing the `framework` tag.
* `JSON` uses 2 spaces for indentation.

Watch for this release to start rolling into upcoming platform and `cordova-cli` releases.

<!--more-->
# Changes include:

## cordova-common

* [CB-13145](https://issues.apache.org/jira/browse/CB-13145) Added variable replacing the `framework` tag.
* [CB-13211](https://issues.apache.org/jira/browse/CB-13211) Added `allows-arbitrary-loads-for-media` attribute parsing for `getAccesses`.
* [CB-11968](https://issues.apache.org/jira/browse/CB-11968) Added support for `<config-file>` in `config.xml`.
* [CB-12895](https://issues.apache.org/jira/browse/CB-12895) Set up `eslint` and removed `jshint`.
* [CB-12785](https://issues.apache.org/jira/browse/CB-12785) Added `.gitignore`, `travis`, and `appveyor` support.
* [CB-12250](https://issues.apache.org/jira/browse/CB-12250) & [CB-12409](https://issues.apache.org/jira/browse/CB-12409) *iOS*: Fixed bug with escaping properties from `plist` file.
* [CB-12762](https://issues.apache.org/jira/browse/CB-12762) Updated `common`, `fetch`, and `serve` `pkgJson` to point `pkgJson` repo items to github mirrors.
* [CB-12766](https://issues.apache.org/jira/browse/CB-12766) Consistently write `JSON` with 2 spaces indentation.


text:
Aria.classDefinition({
    $classpath : "test.aria.widgets.container.dialog.keymap.DialogTestCase",
    $extends : "aria.jsunit.TemplateTestCase",
    $dependencies : ["aria.utils.FireDomEvent", "aria.utils.Json", "aria.core.Timer",
            "aria.templates.NavigationManager"],
    $constructor : function () {
        this.$TemplateTestCase.constructor.call(this);
        this.data = {
            dialogVisible : false
        };
        this._testEnvOne = {
            template : "test.aria.widgets.container.dialog.keymap.DialogTestCaseTpl",
            data : this.data
        };
        this.setTestEnv(this._testEnvOne);
    },
    $prototype : {
        runTemplateTest : function () {

            aria.templates.NavigationManager.addGlobalKeyMap({
                kay : "F4"
            });

            this.assertErrorInLogs(aria.templates.NavigationManager.INVALID_GLOBAL_KEYMAP_CFG);
            this.assertErrorInLogs(aria.core.JsonValidator.MISSING_MANDATORY, 2);
            this.assertErrorInLogs(aria.core.JsonValidator.UNDEFINED_PROPERTY);

            // add a non-modal keymap
            aria.templates.NavigationManager.addGlobalKeyMap({
                key : "F4",
                callback : {
                    fn : function () {
                        this.data.firstNonModalCallback = (!this.data.firstNonModalCallback)
                                ? 1
                                : this.data.firstNonModalCallback + 1;
                    },
                    scope : this
                }
            });

            aria.templates.NavigationManager.addGlobalKeyMap({
                key : "F3",
                modal : true,
                callback : {
                    fn : function () {
                        this.data.firstModalCallback = (!this.data.firstModalCallback)
                                ? 1
                                : this.data.firstModalCallback + 1;
                    },
                    scope : this
                }
            });

            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_F4
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_F3
            });

            // check that both callbacks are called before the dialog is opened
            this.assertTrue(this.data.firstNonModalCallback == 1, "The callback of the non-modal keymap has not been called without a modal dialog");
            this.data.firstNonModalCallback = 1;
            this.assertTrue(this.data.firstModalCallback == 1, "The callback of the modal keymap has not been called without a modal dialog");
            this.data.firstModalCallback = 1;

            // now open the dialog
            aria.utils.Json.setValue(this.data, "dialogVisible", true);
            aria.core.Timer.addCallback({
                fn : this._afterDialogOpen,
                scope : this,
                delay : 50
            });

        },

        _afterDialogOpen : function () {
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_F4
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_F3
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf3'), {
                keyCode : 39
            });

            // check that only the callback of the modal keymap is called
            this.assertTrue(this.data.firstNonModalCallback == 1, "The callback of the non-modal keymap has been called with a modal dialog");
            this.data.firstNonModalCallback = 1;
            this.assertTrue(this.data.firstModalCallback == 2, "The callback of the modal keymap has not been called with a modal dialog");
            this.data.firstModalCallback = 2;

            // check that section callbacks are called anyhow
            this.assertTrue(this.data.sectionCallback == 1, "The section keymap has been ignored");
            this.data.sectionCallback = 1;

            // test that the escape works on dialog
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_ESCAPE
            });

            aria.core.Timer.addCallback({
                fn : this._afterDialogClose,
                scope : this,
                delay : 50
            });

        },

        _afterDialogClose : function () {
            // test that the dialog has been closed
            this.assertTrue(this.data.dialogVisible === false, "The modal dialog has not been closed after pressing escape");

            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_F4
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_F3
            });

            // check that both callbacks are called after the dialog is closed
            this.assertTrue(this.data.firstNonModalCallback == 2, "The callback of the non-modal keymap has not been called without a modal dialog");
            this.data.firstNonModalCallback = 2;
            this.assertTrue(this.data.firstModalCallback == 3, "The callback of the modal keymap has not been called without a modal dialog");
            this.data.firstModalCallback = 3;

            // open a dialog and add/remove modal/non-modal keymaps
            aria.utils.Json.setValue(this.data, "dialogVisible", true);
            aria.core.Timer.addCallback({
                fn : this._afterDialogSecondOpen,
                scope : this,
                delay : 50
            });
        },

        _afterDialogSecondOpen : function () {
            aria.templates.NavigationManager.addGlobalKeyMap({
                key : 38,
                callback : {
                    fn : function () {
                        this.data.secondNonModalCallback = (!this.data.secondNonModalCallback)
                                ? 1
                                : this.data.secondNonModalCallback + 1;
                    },
                    scope : this
                }
            });

            aria.templates.NavigationManager.addGlobalKeyMap({
                key : 40,
                modal : true,
                callback : {
                    fn : function () {
                        this.data.secondModalCallback = (!this.data.secondModalCallback)
                                ? 1
                                : this.data.secondModalCallback + 1;
                    },
                    scope : this
                }
            });

            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_UP
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_DOWN
            });

            // check that the new callbacks added?removed when the dialog is open are taken into account
            this.assertFalse(this.data.secondNonModalCallback == 1, "The callback of the second non-modal keymap has been called with a modal dialog");
            this.data.secondNonModalCallback = 0;
            this.assertTrue(this.data.secondModalCallback == 1, "The callback of the second modal keymap has not been called with a modal dialog");
            this.data.secondModalCallback = 1;

            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_F4
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_F3
            });

            // check that only the callback of the modal keymap is called
            this.assertTrue(this.data.firstNonModalCallback == 2, "The callback of the first non-modal keymap has been called with a modal dialog");
            this.data.firstNonModalCallback = 2;
            this.assertTrue(this.data.firstModalCallback == 4, "The callback of the first modal keymap has not been called with a modal dialog");
            this.data.firstModalCallback = 4;

            aria.templates.NavigationManager.removeGlobalKeyMap({
                key : "F3",
                modal : true
            });
            aria.templates.NavigationManager.removeGlobalKeyMap({
                key : "F4"
            });

            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_F3
            });

            // check that the modal keymap has been removed
            this.assertTrue(this.data.firstModalCallback == 4, "The modal keymap for F3 has not been removed while the dialog was open");
            this.data.firstModalCallback = 4;

            // test that the escape works on dialog
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf2'), {
                keyCode : aria.DomEvent.KC_ESCAPE
            });

            aria.core.Timer.addCallback({
                fn : this._afterDialogSecondClose,
                scope : this,
                delay : 50
            });
        },

        _afterDialogSecondClose : function () {
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_UP
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_DOWN
            });

            // check that the new callbacks added?removed when the dialog is open are taken into account
            this.assertTrue(this.data.secondNonModalCallback == 1, "The callback of the second non-modal keymap has not been called without a modal dialog");
            this.data.secondNonModalCallback = 1;
            this.assertTrue(this.data.secondModalCallback == 2, "The callback of the second modal keymap has not been called without a modal dialog");
            this.data.secondModalCallback = 2;

            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_F4
            });
            aria.utils.FireDomEvent.fireEvent('keydown', this.getInputField('tf1'), {
                keyCode : aria.DomEvent.KC_F3
            });

            // check that the non-modal keymap has been removed
            this.assertTrue(this.data.firstNonModalCallback == 2, "The first non-modal keymap associated to F4 has nott been removed");
            this.data.firstNonModalCallback = 2;

            this.end();
        }

    }
});


text:
package java.nio.channels;

/**
 * @author Michael Koch
 * @since 1.4
 */
public class NotYetBoundException extends IllegalStateException
{
  private static final long serialVersionUID = 4640999303950202242L;

  /**
   * Creates the exception
   */
  public NotYetBoundException()
  {
  }
}


text:
using System;

class Program
{
    static string CompareCharArrays(char[]firstArray, char[] secondArray)
    {
        string result = string.Empty;
        if (firstArray.Length > secondArray.Length)
        {
            result =  ">";
        }
        else if(firstArray.Length < secondArray.Length)
        {
            result = "<";
        }
        else
        {
            int length = firstArray.Length;
            for (int i = 0; i < length; i++)
            {
                int currentCharFromOne = firstArray[i] - 'a';
                int currentCharFromTwo = secondArray[i] - 'a';
                if (currentCharFromOne > currentCharFromTwo)
                {
                    result = ">";
                    break;
                }
                else if (currentCharFromOne < currentCharFromTwo)
                {
                    result = "<";
                    break;
                }
                else
                {
                    result = "=";
                }
            }
        }

        return result;
    }

    static void Main()
    {
        string inputOne = Console.ReadLine().ToLower();
        string inputTwo = Console.ReadLine().ToLower();

        var firstArray = inputOne.ToCharArray();
        var secondArray = inputTwo.ToCharArray();

        Console.WriteLine(CompareCharArrays(firstArray,secondArray));

        //Console.WriteLine(string.Join(" ,", firstArray));
    }
}


text:
using System.Reflection;
using NUnit.Framework;

namespace AmplaData.Attributes.Calendar
{
    [TestFixture]
    [Ignore("Calendar still to be implemented")]
    public class AmplaCalendarValueAttributeUnitTests : TestFixture
    {
        public class ModelNoAttributes {}

        public class ModelWithField
        {
            [AmplaCalendarValue(Calendar = "Area.Tonnes.Target")]
            public virtual double TargetTonnes { get; set; }

            [AmplaCalendarValue("Area.Tonnes.Budget")]
            public double BudgetTonnes { get; set; }
        }

        public class InheritedModelWithField : ModelWithField
        {
        }

        public class ModelWithOverriddenField : ModelWithField
        {
            [AmplaCalendarValue("Another.Area.Tonnes.Target")]
            public override double TargetTonnes { get; set; }
        }

        public class ModelWithEmptyField
        {
            [AmplaCalendarValue]
            public virtual double PlannedTonnes { get; set; }
        }

        public class ModelWithDefaultField
        {
            [AmplaCalendarValue]
            public virtual double PlannedTonnes { get; set; }
        }

        [AmplaCalendar(BaseName = "Site.Area.")]
        public class BaseModelWithDefaultField
        {
            [AmplaCalendarValue]
            public virtual double PlannedTonnes { get; set; }
        }

        [Test]
        public void TryGetWithField()
        {
            string calendar;
            bool result = TryGetCalendar<ModelWithField>("TargetTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("Area.Tonnes.Target"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetInheritedWithField()
        {
            string calendar;
            bool result = TryGetCalendar<InheritedModelWithField>("TargetTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("Area.Tonnes.Target"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetModelWithOverriddenField()
        {
            string calendar;
            bool result = TryGetCalendar<ModelWithOverriddenField>("TargetTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("Another.Area.Tonnes.Target"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetModelWithField()
        {
            string calendar;
            bool result = TryGetCalendar<ModelWithField>("TargetTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("Area.Tonnes.Target"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetModelWithEmptyField()
        {
            string calendar;
            bool result = TryGetCalendar<ModelWithEmptyField>("PlannedTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("PlannedTonnes"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetModelWithDefaultField()
        {
            string calendar;
            bool result = TryGetCalendar<ModelWithDefaultField>("PlannedTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("ModelWithDefaultField.PlannedTonnes"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetBaseModelWithDefaultField()
        {
            string calendar;
            bool result = TryGetCalendar<BaseModelWithDefaultField>("PlannedTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo("Site.Area.PlannedTonnes"));
            Assert.That(result, Is.True);
        }

        [Test]
        public void TryGetBaseModelGetInvalidField()
        {
            string calendar;
            bool result = TryGetCalendar<BaseModelWithDefaultField>("InvalidProperty", out calendar);

            Assert.That(calendar, Is.EqualTo(null));
            Assert.That(result, Is.False);
        }

        [Test]
        public void TryGetModelNoAttribute()
        {
            string calendar;
            bool result = TryGetCalendar<ModelNoAttributes>("PlannedTonnes", out calendar);

            Assert.That(calendar, Is.EqualTo(null));
            Assert.That(result, Is.False);
        }

        private bool TryGetCalendar<TModel>(string propertyName, out string calendar)
        {
            foreach (PropertyInfo property in typeof (TModel).GetProperties())
            {
                if (property.Name == propertyName)
                {
                    return AmplaCalendarValueAttribute.TryGetCalendar(property, out calendar);
                }
            }
            calendar = null;
            return false;
        }
    }
}


text:
using global::System;
using global::System.Reflection;
using global::System.Diagnostics;
using global::System.Reflection.Runtime.Assemblies;
using global::System.Collections.Generic;

using global::Internal.Reflection.Extensibility;

using global::Internal.Metadata.NativeFormat;

namespace System.Reflection.Runtime.Modules
{
    //
    // The runtime's implementation of a Module.
    //
    // Modules are quite meaningless in ProjectN but we have to keep up the appearances since they still exist in Win8P's surface area.
    // As far as ProjectN is concerned, each Assembly has one module whose name is "<Unknown>".
    //
    internal sealed partial class RuntimeModule : ExtensibleModule
    {
        private RuntimeModule(RuntimeAssembly assembly)
            : base()
        {
            _assembly = assembly;
        }

        public sealed override Assembly Assembly
        {
            get
            {
                return _assembly;
            }
        }

        public sealed override IEnumerable<CustomAttributeData> CustomAttributes
        {
            get
            {
                return Empty<CustomAttributeData>.Enumerable;
            }
        }

        public sealed override String FullyQualifiedName
        {
            get
            {
                return "<Unknown>";
            }
        }

        public sealed override String Name
        {
            get
            {
                return this.Assembly.GetName().Name;
            }
        }

        public sealed override bool Equals(Object o)
        {
            RuntimeModule other = o as RuntimeModule;
            if (other == null)
                return false;
            return this._assembly.Equals(other._assembly);
        }

        public sealed override int GetHashCode()
        {
            return _assembly.GetHashCode();
        }

        public sealed override Type GetType(String name, bool throwOnError, bool ignoreCase)
        {
            return _assembly.GetType(name, throwOnError, ignoreCase);
        }

        public sealed override String ToString()
        {
            return "<Unknown>";
        }

        private Assembly _assembly;
    }
}


text:
.class Lo/pu$if$if;
.super Ljava/lang/Object;

# interfaces
.implements Lo/pu;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lo/pu$if;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = "if"
.end annotation

# instance fields
.field private ˊ:Landroid/os/IBinder;

# direct methods
.method constructor <init>(Landroid/os/IBinder;)V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lo/pu$if$if;->ˊ:Landroid/os/IBinder;

    return-void
.end method

# virtual methods
.method public asBinder()Landroid/os/IBinder;
    .locals 1

    iget-object v0, p0, Lo/pu$if$if;->ˊ:Landroid/os/IBinder;

    return-object v0
.end method

.method public ˊ(ILandroid/os/Bundle;ILandroid/content/Intent;)V
    .locals 6

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v3

    invoke-static {}, Landroid/os/Parcel;->obtain()Landroid/os/Parcel;

    move-result-object v4

    const-string v0, "com.google.android.gms.panorama.internal.IPanoramaCallbacks"

    :try_start_0
    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInterfaceToken(Ljava/lang/String;)V

    invoke-virtual {v3, p1}, Landroid/os/Parcel;->writeInt(I)V

    if-eqz p2, :cond_0

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p2, v3, v0}, Landroid/os/Bundle;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_0
    invoke-virtual {v3, p3}, Landroid/os/Parcel;->writeInt(I)V

    if-eqz p4, :cond_1

    const/4 v0, 0x1

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    const/4 v0, 0x0

    invoke-virtual {p4, v3, v0}, Landroid/content/Intent;->writeToParcel(Landroid/os/Parcel;I)V

    goto :goto_1

    :cond_1
    const/4 v0, 0x0

    invoke-virtual {v3, v0}, Landroid/os/Parcel;->writeInt(I)V

    :goto_1
    iget-object v0, p0, Lo/pu$if$if;->ˊ:Landroid/os/IBinder;

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-interface {v0, v1, v3, v4, v2}, Landroid/os/IBinder;->transact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z

    invoke-virtual {v4}, Landroid/os/Parcel;->readException()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    goto :goto_2

    :catchall_0
    move-exception v5

    invoke-virtual {v4}, Landroid/os/Parcel;->recycle()V

    invoke-virtual {v3}, Landroid/os/Parcel;->recycle()V

    throw v5

    :goto_2
    return-void
.end method


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

    <TITLE>
        org.apache.jmeter.protocol.tcp.config.gui (Apache JMeter API)
    </TITLE>

    <META NAME="keywords" CONTENT="org.apache.jmeter.protocol.tcp.config.gui package">

    <LINK REL="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">

    org.apache.jmeter.protocol.tcp.config.gui

            Classes

                TCPConfigGui


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/shape_loading_dialog"
    android:gravity="center"
    android:minHeight="60dp"
    android:minWidth="180dp"
    android:orientation="vertical"
    android:padding="10dp" >

    <ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:indeterminateDrawable="@drawable/loading_dialog_progressbar" />

    <TextView
        android:id="@+id/id_tv_loading_dialog_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:text="请稍后"
        android:textSize="14sp" />

</LinearLayout>


text:
@interface ConcurrencyViewController : FeatureManagerViewController

@property (weak, nonatomic) IBOutlet UILabel *nstimer;
@property (weak, nonatomic) IBOutlet UILabel *nsobject;
@property (weak, nonatomic) IBOutlet UILabel *nsthread;
@property (weak, nonatomic) IBOutlet UILabel *nsoperationqueue;
@property (weak, nonatomic) IBOutlet UILabel *gcd;

@end


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package th.co.geniustree.inventory.lazyload;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import th.co.geniustree.inventory.model.Customer;
import th.co.geniustree.inventory.service.CustomerService;
import th.co.geniustree.inventory.util.JSFSpringUtils;

/**
 *
 * @author toy
 */
public class CustomerLazyLoad extends LazyLoad<Customer>{
    private final CustomerService customerService = JSFSpringUtils.getBean(CustomerService.class);

    @Override
    public Page<Customer> load(Pageable page) {
        return customerService.findAll(page);
    }

}