text:
"""
Similar to the memory subsystem, this is a unified way to
access information about objects which contain registers
"""

import envi.exc as e_exc
from envi.const import *

class RegisterContext:

    def __init__(self, regdef=(), metas=(), pcindex=None, spindex=None, srindex=None):
        """
        Hand in a register definition which consists of
        a list of (<name>, <width>) tuples.
        """
        self.loadRegDef(regdef)
        self.loadRegMetas(metas)
        self.setRegisterIndexes(pcindex, spindex, srindex=srindex)

        self._rctx_dirty = False

    def getRegisterSnap(self):
        """
        Use this to bulk save off the register state.
        """
        return list(self._rctx_vals)

    def setRegisterSnap(self, snap):
        """
        Use this to bulk restore the register state.

        NOTE: This may only be used under the assumption that the
              RegisterContext has been initialized the same way
              (like context switches in tracers, or emulaction snaps)
        """
        self._rctx_vals = list(snap)

    def isDirty(self):
        """
        Returns true if registers in this context have been modififed
        since their import.
        """
        return self._rctx_dirty

    def setIsDirty(self, bool):
        self._rctx_dirty = bool

    def setRegisterIndexes(self, pcindex, spindex, srindex=None):
        self._rctx_pcindex = pcindex
        self._rctx_spindex = spindex
        self._rctx_srindex = srindex

    def loadRegDef(self, regdef, defval=0):
        """
        Load a register definition.  A register definition consists
        of a list of tuples with the following format:
        (regname, regwidth)

        NOTE: All widths in envi RegisterContexts are in bits.
        """
        self._rctx_regdef = regdef # Save this for snaps etc..
        self._rctx_names = {}
        self._rctx_ids = {}
        self._rctx_widths = []
        self._rctx_vals  = []
        self._rctx_masks = []

        for i, (name, width) in enumerate(regdef):
            self._rctx_names[name] = i
            self._rctx_ids[i] = name
            self._rctx_widths.append(width)
            self._rctx_masks.append((2**width)-1)
            self._rctx_vals.append(defval)

    def getRegDef(self):
        return self._rctx_regdef

    def loadRegMetas(self, metas, statmetas=None):
        """
        Load a set of defined "meta" registers for this architecture.  Meta
        registers are defined as registers who exist as a subset of the bits
        in some other "real" register. The argument metas is a list of tuples
        with the following format:
        (regname, regidx, reg_shift_offset, reg_width)
        The given example is for the AX register in the i386 subsystem
        regname: "ax"
        reg_shift_offset: 0
        reg_width: 16

        Optionally a set of status meta registers can be loaded as well.
        The argument is a list of tuples with the following format:
        (regname, regidx, reg_shift_offset, reg_width, description)
        """
        self._rctx_regmetas = metas
        for name, idx, offset, width in metas:
            self.addMetaRegister(name, idx, offset, width)

        self._rctx_statmetas = statmetas

    def addMetaRegister(self, name, idx, offset, width):
        """
        Meta registers are registers which are really just directly
        addressable parts of already existing registers (eax -> al).

        To add a meta register, you give the name, the idx of the *real*
        register, the width of the meta reg, and it's left shifted (in bits)
        offset into the real register value.  The RegisterContext will take
        care of accesses after that.
        """
        newidx = (offset << 24) + (width << 16) + idx
        self._rctx_names[name] = newidx
        self._rctx_ids[newidx] = name

    def isMetaRegister(self, index):
        return (index & 0xffff) != index

    def _rctx_Import(self, sobj):
        """
        Given an object with attributes with the same names as
        registers in our context, populate our values from it.

        NOTE: This also clears the dirty flag
        """
        # On import from a structure, we are clean again.
        self._rctx_dirty = False
        for name,idx in self._rctx_names.items():
            # Skip meta registers
            if (idx & 0xffff) != idx:
                continue
            x = getattr(sobj, name, None)
            if x is not None:
                self._rctx_vals[idx] = x

    def _rctx_Export(self, sobj):
        """
        Given an object with attributes with the same names as
        registers in our context, set the ones he has to match
        our values.
        """
        for name,idx in self._rctx_names.items():
            # Skip meta registers
            if (idx & 0xffff) != idx:
                continue
            if hasattr(sobj, name):
                setattr(sobj, name, self._rctx_vals[idx])

    def getRegisterInfo(self, meta=False):
        """
        Return an object which can be stored off, and restored
        to re-initialize a register context.  (much like snapshot
        but it takes the definitions with it)
        """
        regdef = self._rctx_regdef
        regmeta = self._rctx_regmetas
        pcindex = self._rctx_pcindex
        spindex = self._rctx_spindex
        snap = self.getRegisterSnap()

        return (regdef, regmeta, pcindex, spindex, snap)

    def setRegisterInfo(self, info):
        regdef, regmeta, pcindex, spindex, snap = info
        self.loadRegDef(regdef)
        self.loadRegMetas(regmeta)
        self.setRegisterIndexes(pcindex, spindex)
        self.setRegisterSnap(snap)

    def getRegisterName(self, index):
        return self._rctx_ids.get(index,"REG%.8x" % index)

    def getProgramCounter(self):
        """
        Get the value of the program counter for this register context.
        """
        return self.getRegister(self._rctx_pcindex)

    def setProgramCounter(self, value):
        """
        Set the value of the program counter for this register context.
        """
        self.setRegister(self._rctx_pcindex, value)

    def getStackCounter(self):
        return self.getRegister(self._rctx_spindex)

    def setStackCounter(self, value):
        self.setRegister(self._rctx_spindex, value)

    def hasStatusRegister(self):
        '''
        Returns True if this context is aware of a status register.
        '''
        if self._rctx_srindex is None:
            return False

        return True

    def getStatusRegNameDesc(self):
        '''
        Return a list of status register names and descriptions.
        '''
        return [(name, desc) for name, idx, offset, width, desc in self._rctx_statmetas]

    def getStatusRegister(self):
        '''
        Gets the status register for this register context.
        '''
        return self.getRegister(self._rctx_srindex)

    def setStatusRegister(self, value):
        '''
        Sets the status register for this register context.
        '''
        self.setRegister(self._rctx_srindex, value)

    def getStatusFlags(self):
        '''
        Return a dictionary of reg name and reg value for the meta registers
        that are part of the status register.
        '''
        ret = {}
        for name, idx, offset, width, desc in self._rctx_statmetas:
            ret[name] = self.getRegisterByName(name)

        return ret

    def getRegisterByName(self, name):
        idx = self._rctx_names.get(name)
        if idx is None:
            raise e_exc.InvalidRegisterName("Unknown Register: %s" % name)
        return self.getRegister(idx)

    def setRegisterByName(self, name, value):
        idx = self._rctx_names.get(name)
        if idx is None:
            raise e_exc.InvalidRegisterName("Unknown Register: %s" % name)
        self.setRegister(idx, value)

    def getRegisterNames(self):
        '''
        Returns a list of the 'real' (non meta) registers.
        '''
        regs = [rname for rname, ridx in self._rctx_names.items()
                if not self.isMetaRegister(ridx)]
        return regs

    def getRegisterNameIndexes(self):
        '''
        Return a list of all the 'real' (non meta) registers and their indexes.

        Example: for regname, regidx in x.getRegisterNameIndexes():
        '''
        regs = [(rname, ridx) for rname, ridx in self._rctx_names.items()
                if not self.isMetaRegister(ridx)]
        return regs

    def getRegisters(self):
        """
        Get all the *real* registers from this context as a dictionary of name
        value pairs.
        """
        ret = {}
        for name,idx in self._rctx_names.items():
            if (idx & 0xffff) != idx:
                continue
            ret[name] = self.getRegister(idx)
        return ret

    def setRegisters(self, regdict):
        """
        For any name value pairs in the specified dictionary, set the current
        register values in this context.
        """
        for name,value in regdict.items():
            self.setRegisterByName(name, value)

    def getRegisterIndex(self, name):
        """
        Get a register index by name.
        (faster to use the index multiple times)
        """
        return self._rctx_names.get(name)

    def getRegisterWidth(self, index):
        """
        Return the width of the register which lives at the specified
        index (width is always in bits).
        """
        ridx = index & 0xffff
        if ridx == index:
            return self._rctx_widths[index]
        width  = (index >> 16) & 0xff
        return width

    def getRegister(self, index):
        """
        Return the current value of the specified register index.
        """
        ridx = index & 0xffff
        value = self._rctx_vals[ridx]
        if ridx != index:
            value = self._xlateToMetaReg(index, value)
        return value

    def getMetaRegInfo(self, index):
        '''
        Return the appropriate realreg, shift, mask info
        for the specified metareg idx (or None if it's not
        meta).

        Example:
            real_reg, lshift, mask = r.getMetaRegInfo(x)
        '''
        ridx = index & 0xffff
        if ridx == index:
            return None

        offset = (index >> 24) & 0xff
        width  = (index >> 16) & 0xff

        mask = (2**width)-1
        return ridx, offset, mask

    def _xlateToMetaReg(self, index, value):
        '''
        Translate a register value to the meta register value
        (used when getting a meta register)
        '''
        ridx = index & 0xffff
        offset = (index >> 24) & 0xff
        width  = (index >> 16) & 0xff

        mask = (2**width)-1

        if offset != 0:
            value >>= offset

        return value & mask

    def _xlateToNativeReg(self, index, value):
        '''
        Translate a register value to the native register value
        (used when setting a meta register)
        '''
        ridx = index & 0xffff
        width = (index >> 16) & 0xff
        offset = (index >> 24) & 0xff

        # FIXME is it faster to generate or look these up?
        mask = (2 ** width) - 1
        mask = mask << offset

        # NOTE: basewidth is in *bits*
        basewidth = self._rctx_widths[ridx]
        basemask = (2 ** basewidth) - 1

        # cut a whole in basemask at the size/offset of mask
        finalmask = basemask ^ mask

        curval = self._rctx_vals[ridx]

        if offset:
            value <<= offset

        return (value & mask) | (curval & finalmask)

    def setRegister(self, index, value):
        """
        Set a register value by index.
        """
        self._rctx_dirty = True

        ridx = index & 0xffff

        # If it's a meta register index, lets mask it into
        # the real thing...
        if ridx != index:
            value = self._xlateToNativeReg(index, value)

        self._rctx_vals[ridx] = (value & self._rctx_masks[ridx])

    def getRealRegisterNameByIdx(self, regidx):
        """
        Returns the Name of the Containing register (in the case
        of meta-registers) or the name of the register.
        (by Index)
        """
        return self.getRegisterName(regidx & RMETA_NMASK)

    def getRealRegisterName(self, regname):
        """
        Returns the Name of the Containing register (in the case
        of meta-registers) or the name of the register.
        """
        ridx = self.getRegisterIndex(regname)
        if ridx is not None:
            return self.getRegisterName(ridx & RMETA_NMASK)
        return regname

def addLocalEnums(l, regdef):
    """
    Update a dictionary (or module locals) with REG_FOO index
    values for all the base registers defined in regdef.
    """
    for i,(rname,width) in enumerate(regdef):
        l["REG_%s" % rname.upper()] = i

def addLocalStatusMetas(l, metas, statmetas, regname):
    '''
    Dynamically create data based on the status register meta register
    definition.
    Adds new meta registers and bitmask constants.
    '''
    for metaname, idx, offset, width, desc in statmetas:
        # create meta registers
        metas.append( (metaname, idx, offset, width) )

        # create local bitmask constants (EFLAGS_%)
        l['%s_%s' % (regname, metaname)] = 1 << offset # TODO: fix for arbitrary width

def addLocalMetas(l, metas):
    """
    Update a dictionary (or module locals) with REG_FOO index
    values for all meta registers defined in metas.
    """
    for name, idx, offset, width in metas:
        l["REG_%s" % name.upper()] = (offset << 24) | (width << 16) | idx


text:
export class ValidationResult {
  constructor() {
    this.isValid = true;
    this.properties = {};
    this.onValidate = null;
  }
  addProperty(name) {
    if (!this.properties[name]) {
      this.properties[name] = new ValidationResultProperty(this);
    }
    return this.properties[name];
  }

  addPropertyValidationCallback(callback) {
    this.onValidate = callback;
    for (var propertyName in this.properties)
      this.properties[propertyName].onValidate(callback);
  }

  checkValidity() {
    for (let propertyName in this.properties) {
      if (!this.properties[propertyName].isValid) {
        this.isValid = false;
        return;
      }
    }
    this.isValid = true;
  }
  clear() {
    this.isValid = true;
  }
}

export class ValidationResultProperty {
  constructor(group) {
    this.group = group;
    this.onValidateCallbacks = [];
    if( group.onValidate )
        this.onValidate(group.onValidate);
    this.clear();
  }
  clear() {
    this.isValid = true;
    this.isDirty = false;
    this.message = '';
    this.failingRule = null;
    this.latestValue = null;
    this.notifyObserversOfChange();
  }
  onValidate(onValidateCallback) {
    this.onValidateCallbacks.push(onValidateCallback);
  }
  notifyObserversOfChange() {
    for (let i = 0; i < this.onValidateCallbacks.length; i++) {
      let callback = this.onValidateCallbacks[i];
      callback(this);
    }
  }
  setValidity(validationResponse, shouldBeDirty) {
    let notifyObservers = (!this.isDirty && shouldBeDirty)
      || (this.isValid !== validationResponse.isValid)
      || (this.message !== validationResponse.message);

    if (shouldBeDirty) {
      this.isDirty = true;
    }
    this.message = validationResponse.message;
    this.failingRule = validationResponse.failingRule;
    this.isValid = validationResponse.isValid; //Set isValid last in case someone has observed 'isValid'
    this.latestValue = validationResponse.latestValue;
    if (this.isValid !== this.group.isValid) {
      this.group.checkValidity();
    }
    if (notifyObservers) {
      this.notifyObserversOfChange();
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * Adyen Checkout API
 *
 * The version of the OpenAPI document: 69
 * Contact: developer-experience@adyen.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

package com.adyen.model.checkout;

import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import com.adyen.model.checkout.JSON;

/**
 * Avs
 */

public class Avs {
  public static final String SERIALIZED_NAME_ADDRESS_EDITABLE = "addressEditable";
  @SerializedName(SERIALIZED_NAME_ADDRESS_EDITABLE)
  private Boolean addressEditable;

  /**
   * Specifies whether the shopper should enter their billing address during checkout.  Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks.
   */
  @JsonAdapter(EnabledEnum.Adapter.class)
  public enum EnabledEnum {
    YES("yes"),

    NO("no"),

    AUTOMATIC("automatic");

    private String value;

    EnabledEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static EnabledEnum fromValue(String value) {
      for (EnabledEnum b : EnabledEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<EnabledEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final EnabledEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public EnabledEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return EnabledEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_ENABLED = "enabled";
  @SerializedName(SERIALIZED_NAME_ENABLED)
  private EnabledEnum enabled;

  public Avs() {
  }

  public Avs addressEditable(Boolean addressEditable) {

    this.addressEditable = addressEditable;
    return this;
  }

   /**
   * Indicates whether the shopper is allowed to modify the billing address for the current payment request.
   * @return addressEditable
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Indicates whether the shopper is allowed to modify the billing address for the current payment request.")

  public Boolean getAddressEditable() {
    return addressEditable;
  }

  public void setAddressEditable(Boolean addressEditable) {
    this.addressEditable = addressEditable;
  }

  public Avs enabled(EnabledEnum enabled) {

    this.enabled = enabled;
    return this;
  }

   /**
   * Specifies whether the shopper should enter their billing address during checkout.  Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks.
   * @return enabled
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Specifies whether the shopper should enter their billing address during checkout.  Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks.")

  public EnabledEnum getEnabled() {
    return enabled;
  }

  public void setEnabled(EnabledEnum enabled) {
    this.enabled = enabled;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Avs avs = (Avs) o;
    return Objects.equals(this.addressEditable, avs.addressEditable) &&
        Objects.equals(this.enabled, avs.enabled);
  }

  @Override
  public int hashCode() {
    return Objects.hash(addressEditable, enabled);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Avs {\n");
    sb.append("    addressEditable: ").append(toIndentedString(addressEditable)).append("\n");
    sb.append("    enabled: ").append(toIndentedString(enabled)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

  public static HashSet<String> openapiFields;
  public static HashSet<String> openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet<String>();
    openapiFields.add("addressEditable");
    openapiFields.add("enabled");

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet<String>();
  }

 /**
  * Validates the JSON Object and throws an exception if issues found
  *
  * @param jsonObj JSON Object
  * @throws IOException if the JSON Object is invalid with respect to Avs
  */
  public static void validateJsonObject(JsonObject jsonObj) throws IOException {
      if (jsonObj == null) {
        if (Avs.openapiRequiredFields.isEmpty()) {
          return;
        } else { // has required fields
          throw new IllegalArgumentException(String.format("The required field(s) %s in Avs is not found in the empty JSON string", Avs.openapiRequiredFields.toString()));
        }
      }

      Set<Entry<String, JsonElement>> entries = jsonObj.entrySet();
      // check to see if the JSON string contains additional fields
      for (Entry<String, JsonElement> entry : entries) {
        if (!Avs.openapiFields.contains(entry.getKey())) {
          throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Avs` properties. JSON: %s", entry.getKey(), jsonObj.toString()));
        }
      }
      // ensure the field enabled can be parsed to an enum value
      if (jsonObj.get("enabled") != null) {
        if(!jsonObj.get("enabled").isJsonPrimitive()) {
          throw new IllegalArgumentException(String.format("Expected the field `enabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enabled").toString()));
        }
        EnabledEnum.fromValue(jsonObj.get("enabled").getAsString());
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
       if (!Avs.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'Avs' and its subtypes
       }
       final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter<Avs> thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(Avs.class));

       return (TypeAdapter<T>) new TypeAdapter<Avs>() {
           @Override
           public void write(JsonWriter out, Avs value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             elementAdapter.write(out, obj);
           }

           @Override
           public Avs read(JsonReader in) throws IOException {
             JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject();
             validateJsonObject(jsonObj);
             return thisAdapter.fromJsonTree(jsonObj);
           }

       }.nullSafe();
    }
  }

 /**
  * Create an instance of Avs given an JSON string
  *
  * @param jsonString JSON string
  * @return An instance of Avs
  * @throws IOException if the JSON string is invalid with respect to Avs
  */
  public static Avs fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, Avs.class);
  }

 /**
  * Convert an instance of Avs to an JSON string
  *
  * @return JSON string
  */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}


text:
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/include/usr/util/utilmbox_scratch.H $                     */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2012,2020                        */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
#ifndef UTILMBOX_SCRATCH_H
#define UTILMBOX_SCRATCH_H

/**
 * @file utilmbox_scratch.H
 *
 * @brief Utilies to manipulate mbox scratch debug communication
 *
 * Used for creating and manipulating memory streams
 *
 */

/*****************************************************************************/
// I n c l u d e s
/*****************************************************************************/
#include <initservice/mboxRegs.H>
#include <targeting/common/targetservice.H>

// Utility Includes

/*****************************************************************************/
// Forwards
/*****************************************************************************/

//*****************************************************************************/
// C o n s t a n t s
/*****************************************************************************/
namespace Util
{
    enum
    {
        MSG_TYPE_MASK           =       0xE0000000,
        MSG_COUNT_MASK          =       0x1F000000,
        MSG_USAGE_MASK          =       MSG_TYPE_MASK | MSG_COUNT_MASK,
        MSG_USAGE_SHIFT         =       24,
        MSG_DATA_SIZE_MASK      =        ~MSG_USAGE_MASK,

        MSG_TYPE_TRACE          =       0x00,
        MSG_TYPE_ATTRDUMP       =       0x01,
        MSG_TYPE_ATTROVERRIDE   =       0x02,
        MSG_TYPE_ATTRGET        =       0x03,

        //ATTR GET control words
        DEBUG_ATTRGET_FAPI_TYPE =       0x0,
        DEBUG_ATTRGET_FAPI_POS  =       0x1,
        DEBUG_ATTRGET_HASH      =       0x2,
    };

    /**
     * @brief This places the address and buffer size for the debug tool
     * into the mailbox scratch regs in a synchronous fashion.  It will also
     * wait for the tool to ack the reciept of data before returning
     *
     * @param[in] i_usage       1 byte of "usage" data.  Caller defined
     * @param[in] i_addr        Physical real address of buffer
     * @param[in] i_size        Size of data in bytes
     *
     * @return none
     */
    void writeDebugCommRegs(uint8_t i_usage, uint32_t i_addr, uint32_t i_size);

    /**
     * @brief This function writes data to mailbox scratch reg
     *  These scom addresses are always accessible and any errors are commited
     *  internally
     * @param[in] i_addr        Scom address of mailbox reg to write
     * @param[in] i_data        Data to write to mailbox
     * @param[in] i_target      Processor target to write to
     *
     * @return none
     */
    void writeScratchReg(uint64_t i_addr, uint32_t i_data,
                         TARGETING::Target* i_target
                             = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL);

    /**
     * @brief This function reads data to mailbox scratch reg
     *  These scom addresses are always accessible and any errors are commited
     *  internally
     * @param[in] i_addr        Scom address of mailbox reg to read
     * @param[in] i_target      Processor target to read from
     *
     * @return Data in mailbox scratch reg
     */
    uint32_t readScratchReg(uint64_t i_addr,
                            TARGETING::Target* i_target
                                = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL);

    /**
     * @brief This function reads all the mailbox scratch registers from a given
     *        processor target using readScratchReg

     * @param[in] i_target      Processor target to read from
     *
     * @return Mailbox scratch registers
     */
    TARGETING::ATTR_MASTER_MBOX_SCRATCH_typeStdArr
        readScratchRegs(TARGETING::Target* i_target
                            = TARGETING::MASTER_PROCESSOR_CHIP_TARGET_SENTINEL);

    /**
     * @brief This uses the stashed away mbox scratch regs to
     *         determine the frequency the SBE booted the nest
     *         at
     *
     * @return uint32_t -- Nest freq SBE booted with in Mhz
     */
    uint32_t getBootNestFreqMhz( void);

};

#endif //UTILMEM_H


text:
import { A } from '@ember/array';
import Controller from '@ember/controller';

export default Controller.extend({
    breakdowns: A([]),
});


text:
<?php

namespace ConsoleHelpers\SVNBuddy\Command;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class UpdateCommand extends AbstractCommand implements IAggregatorAwareCommand
{

	/**
	 * {@inheritdoc}
	 */
	protected function configure()
	{
		$description = <<<TEXT
TODO
TEXT;

		$this
			->setName('update')
			->setDescription('Bring changes from the repository into the working copy.')
			->setHelp($description)
			->setAliases(array('up'))
			->addArgument(
				'path',
				InputArgument::OPTIONAL,
				'Working copy path',
				'.'
			);

		parent::configure();
	}

	/**
	 * {@inheritdoc}
	 */
	protected function execute(InputInterface $input, OutputInterface $output)
	{
		$wc_path = $this->getWorkingCopyPath();

		$this->io->writeln('Updating working copy ... ');
		$command = $this->repositoryConnector->getCommand('update', '{' . $wc_path . '}');
		$command->runLive(array(
			$wc_path => '.',
		));
		$this->io->writeln('<info>Done</info>');
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2016-2018 Testify Project.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.testifyproject</groupId>
        <artifactId>modules</artifactId>
        <version>1.0.7-SNAPSHOT</version>
    </parent>

    <groupId>org.testifyproject.junit4</groupId>
    <artifactId>junit4</artifactId>
    <packaging>pom</packaging>

    <name>[JUnit 4]</name>
    <description>Parent module of Testify's custom JUnit test runners implementations</description>

    <modules>
        <module>junit4-core</module>
        <module>unit-test</module>
        <module>integration-test</module>
        <module>system-test</module>
        <module>spring-integration-test</module>
        <module>spring-system-test</module>
        <module>spring-boot-system-test</module>
        <module>hk2-integration-test</module>
        <module>jersey2-system-test</module>
        <module>grpc-system-test</module>
        <module>guice-integration-test</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>compile</scope>
        </dependency>
    </dependencies>
</project>


text:
class User < ActiveRecord::Base
  has_many :users_video
  has_many :videos, through: :users_video
end


text:
package parking.business.facture.Fabrique;

/***************************************************************/
/*						Import						   		   */
/***************************************************************/
import parking.business.facture.Calcul.CalculerTarif;
import parking.exception.business.MethodeNonGeree;

/**
 * Class IFabriqueCalculerTarif, fait appel au constructeur de CalculerTarifHeure ou
 * un autre type de calcul selon les parametres avec lesquels est appelee la fonction creer.
 *
 * @author Chergui, Coadalen, Corfa, Corral
 */
public interface IFabriqueCalculerTarif {
    /***************************************************************/
	/*						Profil methodes						   */
    /***************************************************************/
    /**
     * Profil de la methode creer(), le corps de cette
     * methode se trouve dans la classe FabriqueCalculerTarif.
     *
     */
    public CalculerTarif creer(String nom) throws MethodeNonGeree;

} // IFabriqueCalculerTarif interface


text:
module Middleman
  module Test
    class Extension

      class TestResource < ::Middleman::Sitemap::Resource
      end

    end
  end
end


text:
using System;
using Pliant.Grammars;
using Pliant.Utilities;

namespace Pliant.Forest
{
    public class SymbolForestNode : InternalForestNode, ISymbolForestNode
    {
        public ISymbol Symbol { get; private set; }

        public SymbolForestNode(ISymbol symbol, int origin, int location)
            : base(origin, location)
        {
            Symbol = symbol;
            _hashCode = ComputeHashCode();
        }

        public override ForestNodeType NodeType
        {
            get { return ForestNodeType.Symbol; }
        }

        public override string ToString()
        {
            return $"({Symbol}, {Origin}, {Location})";
        }

        public override void Accept(IForestNodeVisitor visitor)
        {
            visitor.Visit(this);
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;

            var symbolNode = obj as ISymbolForestNode;
            if (symbolNode == null)
                return false;

            return Location == symbolNode.Location
                && NodeType == symbolNode.NodeType
                && Origin == symbolNode.Origin
                && Symbol.Equals(symbolNode.Symbol);
        }

        private readonly int _hashCode;

        private int ComputeHashCode()
        {
            return HashCode.Compute(
                ((int)NodeType).GetHashCode(),
                Location.GetHashCode(),
                Origin.GetHashCode(),
                Symbol.GetHashCode());
        }

        public override int GetHashCode()
        {
            return _hashCode;
        }
    }
}


text:
package org.openqa.selenium;

import org.openqa.selenium.environment.GlobalTestEnvironment;

import static org.openqa.selenium.Ignore.Driver.FIREFOX;
import static org.openqa.selenium.Ignore.Driver.HTMLUNIT;
import static org.openqa.selenium.Ignore.Driver.IE;
import static org.openqa.selenium.Ignore.Driver.IPHONE;
import static org.openqa.selenium.Ignore.Driver.SELENESE;

public class I18nTest extends AbstractDriverTestCase {

  /**
   * The Hebrew word shalom (peace) encoded in order Shin (sh) Lamed (L) Vav (O) final-Mem (M).
   */
  private static final String shalom = "\u05E9\u05DC\u05D5\u05DD";

  /**
   * The Hebrew word tmunot (images) encoded in order Taf (t) Mem (m) Vav (u) Nun (n) Vav (o) Taf
   * (t).
   */
  private static final String tmunot = "\u05EA\u05DE\u05D5\u05E0\u05D5\u05EA";

  @Ignore({HTMLUNIT, IE, FIREFOX, IPHONE})
  public void testCn() {
    driver.get(chinesePage);
    driver.findElement(By.linkText(Messages.getString("I18nTest.link1"))).click();
  }

  public void testEnteringHebrewTextFromLeftToRight() {
    driver.get(chinesePage);
    WebElement input = driver.findElement(By.name("i18n"));

    input.sendKeys(shalom);

    assertEquals(shalom, input.getValue());
  }

  public void testEnteringHebrewTextFromRightToLeft() {
    driver.get(chinesePage);
    WebElement input = driver.findElement(By.name("i18n"));

    input.sendKeys(tmunot);

    assertEquals(tmunot, input.getValue());
  }

  @Ignore(value = {IE, SELENESE})
  public void testShouldBeAbleToReturnTheTextInAPage() {
    String url = GlobalTestEnvironment.get()
        .getAppServer()
        .whereIs("encoding");
    driver.get(url);

    String text = driver.findElement(By.tagName("body")) .getText();

    assertEquals(shalom, text);
  }
}


text:
package web

import (
	"fmt"
	"net/http"

	"github.com/gravitational/teleport/lib/reversetunnel"
	"github.com/gravitational/teleport/lib/services"
	"github.com/gravitational/teleport/lib/session"
	"github.com/gravitational/teleport/lib/sshutils"
	"github.com/gravitational/teleport/lib/utils"

	log "github.com/Sirupsen/logrus"
	"github.com/gravitational/trace"
	"golang.org/x/crypto/ssh"
	"golang.org/x/net/websocket"
)

// connectReq is a request to open interactive SSH
// connection to remote server
type connectReq struct {
	// ServerID is a server id to connect to
	ServerID string `json:"server_id"`
	// User is linux username to connect as
	Login string `json:"login"`
	// Term sets PTY params like width and height
	Term session.TerminalParams `json:"term"`
	// SessionID is a teleport session ID to join as
	SessionID session.ID `json:"sid"`
	// Namespace is node namespace
	Namespace string `json:"namespace"`
}

func newConnectHandler(req connectReq, ctx *SessionContext, site reversetunnel.RemoteSite) (*connectHandler, error) {
	clt, err := site.GetClient()
	if err != nil {
		return nil, trace.Wrap(err)
	}
	servers, err := clt.GetNodes(req.Namespace)
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var server *services.Server
	for i := range servers {
		node := servers[i]
		if node.ID == req.ServerID {
			server = &node
		}
	}
	if server == nil {
		return nil, trace.NotFound("node '%v' not found", req.ServerID)
	}
	if req.Login == "" {
		return nil, trace.BadParameter("login: missing login")
	}
	if req.Term.W <= 0 || req.Term.H <= 0 {
		return nil, trace.BadParameter("term: bad term dimensions")
	}
	return &connectHandler{
		req:    req,
		ctx:    ctx,
		site:   site,
		server: *server,
	}, nil
}

// connectHandler is a websocket to SSH proxy handler
type connectHandler struct {
	ctx    *SessionContext
	site   reversetunnel.RemoteSite
	up     *sshutils.Upstream
	req    connectReq
	ws     *websocket.Conn
	server services.Server
}

func (w *connectHandler) String() string {
	return fmt.Sprintf("connectHandler(%#v)", w.req)
}

func (w *connectHandler) Close() error {
	if w.ws != nil {
		w.ws.Close()
	}
	if w.up != nil {
		return w.up.Close()
	}
	return nil
}

// connect is called when a web browser wants to start piping an active terminal session
// io/out via the provided websocket
func (w *connectHandler) connect(ws *websocket.Conn) {
	// connectUpstream establishes an SSH connection to a requested node
	up, err := w.connectUpstream()
	if err != nil {
		log.Errorf("wsHandler: failed: %v", err)
		return
	}
	w.up = up
	w.ws = ws

	// PipeShell will be piping inputs/output to/from SSH connection (to the node)
	// and the websocket (to a browser)
	err = w.up.PipeShell(utils.NewWebSockWrapper(ws, utils.WebSocketTextMode),
		&sshutils.PTYReqParams{
			W: uint32(w.req.Term.W),
			H: uint32(w.req.Term.H),
		})

	log.Infof("pipe shell finished with: %v", err)
}

// resizePTYWindow is called when a brower resizes its window. Now the node
// needs to be notified via SSH
func (w *connectHandler) resizePTYWindow(params session.TerminalParams) error {
	_, err := w.up.GetSession().SendRequest(
		// send SSH "window resized" SSH request:
		sshutils.WindowChangeReq, false,
		ssh.Marshal(sshutils.WinChangeReqParams{
			W: uint32(params.W),
			H: uint32(params.H),
		}))
	return trace.Wrap(err)
}

// connectUpstream establishes the SSH connection to a requested SSH server (node)
func (w *connectHandler) connectUpstream() (*sshutils.Upstream, error) {
	agent, err := w.ctx.GetAgent()
	if err != nil {
		return nil, trace.Wrap(err)
	}
	defer agent.Close()
	signers, err := agent.Signers()
	if err != nil {
		return nil, trace.Wrap(err)
	}
	client, err := w.site.ConnectToServer(
		w.server.Addr, w.req.Login, []ssh.AuthMethod{ssh.PublicKeys(signers...)})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	up, err := sshutils.NewUpstream(client)
	if err != nil {
		return nil, trace.Wrap(err)
	}

	// this goroutine receives terminal window size changes in real time
	// and stores the last size (example: "100:25") as a special "prefix"
	// which gets added to future SSH reads by web clients.
	go func() {
		buff := make([]byte, 16)
		sshChan, _, err := up.GetClient().OpenChannel("x-teleport-request-resize-events", nil)
		for err == nil {
			n, err := sshChan.Read(buff)
			if err != nil {
				break
			}
			up.SetPrefix(buff[:n])
		}
		if err != nil {
			log.Error(err)
		}
	}()

	up.GetSession().SendRequest(
		sshutils.SetEnvReq, false,
		ssh.Marshal(sshutils.EnvReqParams{
			Name:  sshutils.SessionEnvVar,
			Value: string(w.req.SessionID),
		}))
	return up, nil
}

func (w *connectHandler) Handler() http.Handler {
	// TODO(klizhentas)
	// we instantiate a server explicitly here instead of using
	// websocket.HandlerFunc to set empty origin checker
	// make sure we check origin when in prod mode
	return &websocket.Server{
		Handler: w.connect,
	}
}

func newWSHandler(host string, auth []string) *connectHandler {
	return &connectHandler{}
}


text:
'use strict';

angular.module('arachne.controllers')

/**
 * Handles password reset requests.
 *
 * @author: Daniel M. de Oliveira
 */
    .controller('PwdResetController', ['$scope', '$location', 'PwdReset', 'messageService',
        function ($scope, $location, PwdReset, messages) {

            var handleResetError = function (data) {
                if (data.data.message != undefined)
                    messages.add(data.data.message, 'danger', false);
                else
                    messages.add('ui.passwordreset.unkownuser', 'danger', false)
            };

            var handleResetSuccess = function (data) {
                messages.dontClearOnNextLocationChange();
                messages.add('ui.passwordreset.success', 'success');
                $location.path("/");
            };

            $scope.submit = function () {

                if ($scope.user == undefined) {
                    messages.add('ui.passwordreset.fieldMissing.all', 'danger', false);
                    return;
                }

                PwdReset.save({},
                    $scope.user,
                    handleResetSuccess,
                    handleResetError
                );
            }
        }]);


text:
namespace iControl {
	using System.Xml.Serialization;
	using System.Web.Services;
	using System.ComponentModel;
	using System.Web.Services.Protocols;
	using System;
	using System.Diagnostics;

	/// <remarks/>
	[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
	[System.Diagnostics.DebuggerStepThroughAttribute()]
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	[System.Web.Services.WebServiceBindingAttribute(Name="Networking.ProfileIPIPBinding", Namespace="urn:iControl")]
	[System.Xml.Serialization.SoapIncludeAttribute(typeof(CommonProfileEnabledState))]
	[System.Xml.Serialization.SoapIncludeAttribute(typeof(NetworkingProfileTunnelProtocol))]
	public partial class NetworkingProfileIPIP : iControlInterface {
		public NetworkingProfileIPIP() {
			this.Url = "https://url_to_service";
		}

	//=======================================================================
	// Operations
	//=======================================================================
	//-----------------------------------------------------------------------
	// create
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void create(
		string [] profile_names
	) {
		this.Invoke("create", new object [] {
				profile_names});

	}
	public System.IAsyncResult Begincreate(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("create", new object[] {
			profile_names}, callback, asyncState);
	}
	public void Endcreate(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	//-----------------------------------------------------------------------
	// delete_all_profiles
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void delete_all_profiles(

	) {
		this.Invoke("delete_all_profiles", new object [0]);

	}
	public System.IAsyncResult Begindelete_all_profiles(System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("delete_all_profiles", new object[0], callback, asyncState);
	}
	public void Enddelete_all_profiles(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	//-----------------------------------------------------------------------
	// delete_profile
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void delete_profile(
		string [] profile_names
	) {
		this.Invoke("delete_profile", new object [] {
				profile_names});

	}
	public System.IAsyncResult Begindelete_profile(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("delete_profile", new object[] {
			profile_names}, callback, asyncState);
	}
	public void Enddelete_profile(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	//-----------------------------------------------------------------------
	// get_default_profile
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public string [] get_default_profile(
		string [] profile_names
	) {
		object [] results = this.Invoke("get_default_profile", new object [] {
				profile_names});
		return ((string [])(results[0]));
	}
	public System.IAsyncResult Beginget_default_profile(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("get_default_profile", new object[] {
			profile_names}, callback, asyncState);
	}
	public string [] Endget_default_profile(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((string [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// get_description
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public string [] get_description(
		string [] profile_names
	) {
		object [] results = this.Invoke("get_description", new object [] {
				profile_names});
		return ((string [])(results[0]));
	}
	public System.IAsyncResult Beginget_description(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("get_description", new object[] {
			profile_names}, callback, asyncState);
	}
	public string [] Endget_description(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((string [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// get_ds_lite_state
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public CommonProfileEnabledState [] get_ds_lite_state(
		string [] profile_names
	) {
		object [] results = this.Invoke("get_ds_lite_state", new object [] {
				profile_names});
		return ((CommonProfileEnabledState [])(results[0]));
	}
	public System.IAsyncResult Beginget_ds_lite_state(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("get_ds_lite_state", new object[] {
			profile_names}, callback, asyncState);
	}
	public CommonProfileEnabledState [] Endget_ds_lite_state(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((CommonProfileEnabledState [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// get_list
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public string [] get_list(

	) {
		object [] results = this.Invoke("get_list", new object [0]);
		return ((string [])(results[0]));
	}
	public System.IAsyncResult Beginget_list(System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("get_list", new object[0], callback, asyncState);
	}
	public string [] Endget_list(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((string [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// get_protocol
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public NetworkingProfileTunnelProtocol [] get_protocol(
		string [] profile_names
	) {
		object [] results = this.Invoke("get_protocol", new object [] {
				profile_names});
		return ((NetworkingProfileTunnelProtocol [])(results[0]));
	}
	public System.IAsyncResult Beginget_protocol(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("get_protocol", new object[] {
			profile_names}, callback, asyncState);
	}
	public NetworkingProfileTunnelProtocol [] Endget_protocol(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((NetworkingProfileTunnelProtocol [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// get_version
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public string get_version(

	) {
		object [] results = this.Invoke("get_version", new object [] {
});
		return ((string)(results[0]));
	}
	public System.IAsyncResult Beginget_version(System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("get_version", new object[] {
}, callback, asyncState);
	}
	public string Endget_version(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((string)(results[0]));
	}

	//-----------------------------------------------------------------------
	// is_base_profile
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public bool [] is_base_profile(
		string [] profile_names
	) {
		object [] results = this.Invoke("is_base_profile", new object [] {
				profile_names});
		return ((bool [])(results[0]));
	}
	public System.IAsyncResult Beginis_base_profile(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("is_base_profile", new object[] {
			profile_names}, callback, asyncState);
	}
	public bool [] Endis_base_profile(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((bool [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// is_system_profile
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	[return: System.Xml.Serialization.SoapElementAttribute("return")]
	public bool [] is_system_profile(
		string [] profile_names
	) {
		object [] results = this.Invoke("is_system_profile", new object [] {
				profile_names});
		return ((bool [])(results[0]));
	}
	public System.IAsyncResult Beginis_system_profile(string [] profile_names, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("is_system_profile", new object[] {
			profile_names}, callback, asyncState);
	}
	public bool [] Endis_system_profile(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
		return ((bool [])(results[0]));
	}

	//-----------------------------------------------------------------------
	// set_default_profile
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void set_default_profile(
		string [] profile_names,
		string [] defaults
	) {
		this.Invoke("set_default_profile", new object [] {
				profile_names,
				defaults});

	}
	public System.IAsyncResult Beginset_default_profile(string [] profile_names,string [] defaults, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("set_default_profile", new object[] {
			profile_names,
			defaults}, callback, asyncState);
	}
	public void Endset_default_profile(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	//-----------------------------------------------------------------------
	// set_description
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void set_description(
		string [] profile_names,
		string [] descriptions
	) {
		this.Invoke("set_description", new object [] {
				profile_names,
				descriptions});

	}
	public System.IAsyncResult Beginset_description(string [] profile_names,string [] descriptions, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("set_description", new object[] {
			profile_names,
			descriptions}, callback, asyncState);
	}
	public void Endset_description(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	//-----------------------------------------------------------------------
	// set_ds_lite_state
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void set_ds_lite_state(
		string [] profile_names,
		CommonProfileEnabledState [] states
	) {
		this.Invoke("set_ds_lite_state", new object [] {
				profile_names,
				states});

	}
	public System.IAsyncResult Beginset_ds_lite_state(string [] profile_names,CommonProfileEnabledState [] states, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("set_ds_lite_state", new object[] {
			profile_names,
			states}, callback, asyncState);
	}
	public void Endset_ds_lite_state(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	//-----------------------------------------------------------------------
	// set_protocol
	//-----------------------------------------------------------------------
	[System.Web.Services.Protocols.SoapRpcMethodAttribute("urn:iControl:Networking/ProfileIPIP",
		RequestNamespace="urn:iControl:Networking/ProfileIPIP", ResponseNamespace="urn:iControl:Networking/ProfileIPIP")]
	public void set_protocol(
		string [] profile_names,
		NetworkingProfileTunnelProtocol [] protocols
	) {
		this.Invoke("set_protocol", new object [] {
				profile_names,
				protocols});

	}
	public System.IAsyncResult Beginset_protocol(string [] profile_names,NetworkingProfileTunnelProtocol [] protocols, System.AsyncCallback callback, object asyncState) {
		return this.BeginInvoke("set_protocol", new object[] {
			profile_names,
			protocols}, callback, asyncState);
	}
	public void Endset_protocol(System.IAsyncResult asyncResult) {
		object [] results = this.EndInvoke(asyncResult);
	}

	}
	//=======================================================================
	// Enums
	//=======================================================================

	//=======================================================================
	// Structs
	//=======================================================================

}


text:
package nonapi.io.github.classgraph.classloaderhandler;

import nonapi.io.github.classgraph.classpath.ClassLoaderOrder;
import nonapi.io.github.classgraph.classpath.ClasspathOrder;
import nonapi.io.github.classgraph.reflection.ReflectionUtils;
import nonapi.io.github.classgraph.scanspec.ScanSpec;
import nonapi.io.github.classgraph.utils.LogNode;

/** Extract classpath entries from the Uno-Jar's JarClassLoader and One-Jar's JarClassLoader. */
class UnoOneJarClassLoaderHandler implements ClassLoaderHandler {
    /** Class cannot be constructed. */
    private UnoOneJarClassLoaderHandler() {
    }

    /**
     * Check whether this {@link ClassLoaderHandler} can handle a given {@link ClassLoader}.
     *
     * @param classLoaderClass
     *            the {@link ClassLoader} class or one of its superclasses.
     * @param log
     *            the log
     * @return true if this {@link ClassLoaderHandler} can handle the {@link ClassLoader}.
     */
    public static boolean canHandle(final Class<?> classLoaderClass, final LogNode log) {
        return "com.needhamsoftware.unojar.JarClassLoader".equals(classLoaderClass.getName())
                || "com.simontuffs.onejar.JarClassLoader".equals(classLoaderClass.getName());
    }

    /**
     * Find the {@link ClassLoader} delegation order for a {@link ClassLoader}.
     *
     * @param classLoader
     *            the {@link ClassLoader} to find the order for.
     * @param classLoaderOrder
     *            a {@link ClassLoaderOrder} object to update.
     * @param log
     *            the log
     */
    public static void findClassLoaderOrder(final ClassLoader classLoader, final ClassLoaderOrder classLoaderOrder,
            final LogNode log) {
        classLoaderOrder.delegateTo(classLoader.getParent(), /* isParent = */ true, log);
        classLoaderOrder.add(classLoader, log);
    }

    /**
     * Find the classpath entries for the associated {@link ClassLoader}.
     *
     * @param classLoader
     *            the {@link ClassLoader} to find the classpath entries order for.
     * @param classpathOrder
     *            a {@link ClasspathOrder} object to update.
     * @param scanSpec
     *            the {@link ScanSpec}.
     * @param log
     *            the log.
     */
    public static void findClasspathOrder(final ClassLoader classLoader, final ClasspathOrder classpathOrder,
            final ScanSpec scanSpec, final LogNode log) {

        // For Uno-Jar:

        final String unoJarOneJarPath = (String) ReflectionUtils.invokeMethod(false, classLoader, "getOneJarPath");
        classpathOrder.addClasspathEntry(unoJarOneJarPath, classLoader, scanSpec, log);

        // If this property is defined, Uno-Jar jar path was specified on commandline. Otherwise, jar path
        // should be contained in java.class.path (which will be separately picked up by ClassGraph, as
        // long as classloaders/classpath are not overloaded and parent classloaders are not ignored).
        final String unoJarJarPath = System.getProperty("uno-jar.jar.path");
        classpathOrder.addClasspathEntry(unoJarJarPath, classLoader, scanSpec, log);

        // For One-Jar:

        // If this property is defined, One-Jar jar path was specified on commandline. Otherwise, jar path
        // should be contained in java.class.path (which will be separately picked up by ClassGraph, as
        // long as classloaders/classpath are not overloaded and parent classloaders are not ignored).
        final String oneJarJarPath = System.getProperty("one-jar.jar.path");
        classpathOrder.addClasspathEntry(oneJarJarPath, classLoader, scanSpec, log);

        // If this property is defined, additional classpath entries were specified in OneJar format
        // on the commandline, with '|' as a separator
        final String oneJarClassPath = System.getProperty("one-jar.class.path");
        if (oneJarClassPath != null) {
            classpathOrder.addClasspathEntryObject(oneJarClassPath.split("\\|"), classLoader, scanSpec, log);
        }

        // For both UnoJar and OneJar, "libs/" and "main/" will be automatically picked up as library roots
        // for nested jars, based on ClassLoaderHandlerRegistry.AUTOMATIC_LIB_DIR_PREFIXES.
        // ("main/" contains "main.jar".)
    }
}


text:
package org.globus.gsi;

import org.globus.gsi.provider.GlobusProvider;

import java.security.Security;

public class ProviderLoader {
	private GlobusProvider provider;

	public ProviderLoader(){
		provider = new GlobusProvider();
		Security.addProvider(provider);
	}

	public GlobusProvider getProvider(){
		return provider;
	}
}


text:
<!DOCTYPE html>

		<title>SLI Util Test Suite</title>
		<link rel="stylesheet" href="css/qunit.css" />

		<link rel="stylesheet" type="text/css" href="../../main/webapp/static/js/libs/jquery-ui/css/custom/jquery-ui-1.8.18.custom.css" media="screen" />

SLI Util Test Suite


text:
@interface WeiboTableViewCell(){
    UIImageView *_avatar;//头像
    UIImageView *_mbType;//会员类型
    UILabel *_userName;
    UILabel *_createAt;
    UILabel *_source;
    UILabel *_text;
}
@end

@implementation WeiboTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initSubView];
    }
    return self;
}

#pragma mark 初始化视图
-(void)initSubView{
    //头像控件
    _avatar=[[UIImageView alloc]init];
    [self addSubview:_avatar];
    //用户名
    _userName=[[UILabel alloc]init];
    _userName.textColor = WeiboGrayColor;
    _userName.font=[UIFont systemFontOfSize:WeiboTableViewCellUserNameFontSize];
    [self addSubview:_userName];
    //会员类型
    _mbType=[[UIImageView alloc]init];
    [self addSubview:_mbType];
    //日期
    _createAt=[[UILabel alloc]init];
    _createAt.textColor=WeiboLightGrayColor;
    _createAt.font=[UIFont systemFontOfSize:WeiboTableViewCellCreateAtFontSize];
    [self addSubview:_createAt];
    //设备
    _source=[[UILabel alloc]init];
    _source.textColor=WeiboLightGrayColor;
    _source.font=[UIFont systemFontOfSize:WeiboTableViewCellSourceFontSize];
    [self addSubview:_source];
    //内容
    _text=[[UILabel alloc]init];
    _text.textColor=WeiboGrayColor;
    _text.font=[UIFont systemFontOfSize:WeiboTableViewCellTextFontSize];
    _text.numberOfLines=0;
    //    _text.lineBreakMode=NSLineBreakByWordWrapping;
    [self addSubview:_text];
}

#pragma mark 设置微博
-(void)setWeibo:(Weibo *)weibo{
    //设置头像大小和位置
    CGFloat avatarX=10,avatarY=10;
    CGRect avatarRect=CGRectMake(avatarX, avatarY, WeiboTableViewCellAvatarWidth, WeiboTableViewCellAvatarHeight);
    _avatar.image=[UIImage imageNamed:weibo.iconURL];
    _avatar.frame=avatarRect;

    //设置会员图标大小和位置
    CGFloat userNameX = CGRectGetMaxX(_avatar.frame) + WeiboTableViewCellControlSpacing ;
    CGFloat userNameY = avatarY;
    //根据文本内容取得文本占用空间大小
    CGSize userNameSize=[weibo.userName sizeWithAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:WeiboTableViewCellUserNameFontSize]}];
    CGRect userNameRect=CGRectMake(userNameX, userNameY, userNameSize.width,userNameSize.height);
    _userName.text=weibo.userName;
    _userName.frame=userNameRect;

    //设置会员图标大小和位置
    CGFloat mbTypeX=CGRectGetMaxX(_userName.frame) + WeiboTableViewCellControlSpacing;
    CGFloat mbTypeY=avatarY;
    CGRect mbTypeRect=CGRectMake(mbTypeX, mbTypeY, WeiboTableViewCellMbTypeWidth, WeiboTableViewCellMbTypeHeight);
    _mbType.image=[UIImage imageNamed:weibo.mbtype];
    _mbType.frame=mbTypeRect;

    //设置发布日期大小和位置
    CGSize createAtSize=[weibo.createdAt sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:WeiboTableViewCellCreateAtFontSize]}];
    CGFloat createAtX=userNameX;
    CGFloat createAtY=CGRectGetMaxY(_avatar.frame)-createAtSize.height;
    CGRect createAtRect=CGRectMake(createAtX, createAtY, createAtSize.width, createAtSize.height);
    _createAt.text=weibo.createdAt;
    _createAt.frame=createAtRect;

    //设置设备信息大小和位置
    CGSize sourceSize=[weibo.source sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:WeiboTableViewCellSourceFontSize]}];
    CGFloat sourceX=CGRectGetMaxX(_createAt.frame)+WeiboTableViewCellControlSpacing;
    CGFloat sourceY=createAtY;
    CGRect sourceRect=CGRectMake(sourceX, sourceY, sourceSize.width,sourceSize.height);
    _source.text=weibo.source;
    _source.frame=sourceRect;

    //设置微博内容大小和位置
    CGFloat textX=avatarX;
    CGFloat textY=CGRectGetMaxY(_avatar.frame) + WeiboTableViewCellControlSpacing;
    CGFloat textWidth=self.frame.size.width - WeiboTableViewCellControlSpacing*2;
    CGSize textSize=[weibo.text boundingRectWithSize:CGSizeMake(textWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: [UIFont systemFontOfSize:WeiboTableViewCellTextFontSize]} context:nil].size;
    CGRect textRect=CGRectMake(textX, textY, textSize.width, textSize.height);
    _text.text=weibo.text;
    _text.frame=textRect;

    _height=CGRectGetMaxY(_text.frame) + WeiboTableViewCellControlSpacing;
}

#pragma mark 重写选择事件,取消选中
-(void)setSelected:(BOOL)selected animated:(BOOL)animated{

}

@end


text:
#region Apache Notice

#endregion

#region Using

using System;
using System.Data;
using IBatisNet.DataMapper.Configuration.ParameterMapping;
using IBatisNet.DataMapper.Configuration.ResultMapping;
#endregion

namespace IBatisNet.DataMapper.TypeHandlers
{
	/// <summary>
	/// Summary description for Int32TypeHandler.
	/// </summary>
	internal class Int32TypeHandler : BaseTypeHandler
	{

		/// <summary>
		///
		/// </summary>
		/// <param name="mapping"></param>
		/// <param name="dataReader"></param>
		/// <returns></returns>
		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
		{
			int index = dataReader.GetOrdinal(mapping.ColumnName);

			if (dataReader.IsDBNull(index) == true)
			{
				return DBNull.Value;
			}
			else
			{
				// Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
				return Convert.ToInt32(dataReader.GetValue(index));
			}
		}

		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
		{
			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
			{
				return DBNull.Value;
			}
			else
			{
				// Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
				return Convert.ToInt32(dataReader.GetValue(mapping.ColumnIndex));
			}
		}

		public override object GetDataBaseValue(object outputValue, Type parameterType )
		{
			return Convert.ToInt32(outputValue);
		}

		public override object ValueOf(Type type, string s)
		{
			return Convert.ToInt32(s);
		}

		public override bool IsSimpleType
		{
			get
			{
				return true;
			}
		}

	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Uromyces devoluensis Gäum.

### Remarks
null


text:
/*
 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
 * a choice of LGPL license versions is made available with the language indicating
 * that LGPLv2 or any later version may be used, or where a choice of which version
 * of the LGPL is applied is otherwise unspecified.
 */

#ifndef SVRAPI_INCLUDED
#define SVRAPI_INCLUDED

#include <lmcons.h>
#include <lmerr.h>

#include <pshpack1.h>

typedef struct _share_info_1 {
       char shi1_netname[LM20_NNLEN+1];
       char shi1_pad1;
       unsigned short shi1_type;
       char* shi1_remark;
} share_info_1;

typedef struct _share_info_50 {
       char shi50_netname[LM20_NNLEN+1];
       unsigned char shi50_type;
       unsigned short shi50_flags;
       char* shi50_remark;
       char* shi50_path;
       char shi50_rw_password[SHPWLEN+1];
       char shi50_ro_password[SHPWLEN+1];
} share_info_50;

#include <poppack.h>

#endif /* SVRAPI_INCLUDED */


text:
var http    = require('http'),
    express = require('express'),
    app     = express(),
    server  = http.Server(app),
    io      = require('socket.io')(server);

app.use(express.static(__dirname + '/public'));

app.get('/', function (req, res) {
  res.sendStatus(200);
});

var eventState = {};
var eventList = [];
var insiderToEventMap = {};

io.on('connection', function (socket) {
  //triggered when the join button on landing.html is clicked
  socket.on('join', function (event) {
    //server side socket will join the event passed in
    eventList.forEach(function(item) {
      if (item === event) {
        socket.join(event);
        insiderToEventMap[socket.id] = event;
        socket.emit('success', true);
        return;
      }
    });
    socket.emit('success', false);
  });

  //triggered when someone enters the event
  socket.on('joined', function () {
    //send the state of the event to the client
    socket.emit('joined', eventState[insiderToEventMap[socket.id]]);
  });

  //triggered when the create button is clicked on create.html
  socket.on('create', function (event) {
    //server side socket joins the event that is passed in
    if (eventList.indexOf(event) === -1) {
      socket.join(event);
      //push the event to the events list
      eventList.push(event);
      //create a prop on eventState object with name of the event. Init w/ empty array
      eventState[event] = [];
      //map socket id to event
      insiderToEventMap[socket.id] = event;
      socket.emit('createable', true);
      return;
    }

    socket.emit('createable', false);
  });
  //triggered when someone clicks add in search.html
  socket.on('addSong', function (song) {
    console.log(song);
    //add the song to the event state for the event of the socket
    eventState[insiderToEventMap[socket.id]].push(song);
    //broadcast to all insiders the added song
    io.to(insiderToEventMap[socket.id]).emit('songAdded', song);
  });
});

var port = process.env.PORT || 3030;
server.listen(port, function() {
  console.log('Listening on ' + port);
});