text:
// File generated from our OpenAPI spec
package com.stripe.param;

import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Getter;

@Getter
public class PromotionCodeCreateParams extends ApiRequestParams {
  /** Whether the promotion code is currently active. */
  @SerializedName("active")
  Boolean active;

  /**
   * The customer-facing code. Regardless of case, this code must be unique across all active
   * promotion codes for a specific customer. If left blank, we will generate one automatically.
   */
  @SerializedName("code")
  String code;

  /** The coupon for this promotion code. */
  @SerializedName("coupon")
  String coupon;

  /**
   * The customer that this promotion code can be used by. If not set, the promotion code can be
   * used by all customers.
   */
  @SerializedName("customer")
  String customer;

  /** Specifies which fields in the response should be expanded. */
  @SerializedName("expand")
  List<String> expand;

  /**
   * The timestamp at which this promotion code will expire. If the coupon has specified a {@code
   * redeems_by}, then this value cannot be after the coupon's {@code redeems_by}.
   */
  @SerializedName("expires_at")
  Long expiresAt;

  /**
   * Map of extra parameters for custom features not available in this client library. The content
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
   * param object. Effectively, this map is flattened to its parent instance.
   */
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
  Map<String, Object> extraParams;

  /**
   * A positive integer specifying the number of times the promotion code can be redeemed. If the
   * coupon has specified a {@code max_redemptions}, then this value cannot be greater than the
   * coupon's {@code max_redemptions}.
   */
  @SerializedName("max_redemptions")
  Long maxRedemptions;

  /**
   * Set of key-value pairs that you can attach
   * to an object. This can be useful for storing additional information about the object in a
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
   * be unset by posting an empty value to {@code metadata}.
   */
  @SerializedName("metadata")
  Map<String, String> metadata;

  /** Settings that restrict the redemption of the promotion code. */
  @SerializedName("restrictions")
  Restrictions restrictions;

  private PromotionCodeCreateParams(
      Boolean active,
      String code,
      String coupon,
      String customer,
      List<String> expand,
      Long expiresAt,
      Map<String, Object> extraParams,
      Long maxRedemptions,
      Map<String, String> metadata,
      Restrictions restrictions) {
    this.active = active;
    this.code = code;
    this.coupon = coupon;
    this.customer = customer;
    this.expand = expand;
    this.expiresAt = expiresAt;
    this.extraParams = extraParams;
    this.maxRedemptions = maxRedemptions;
    this.metadata = metadata;
    this.restrictions = restrictions;
  }

  public static Builder builder() {
    return new Builder();
  }

  public static class Builder {
    private Boolean active;

    private String code;

    private String coupon;

    private String customer;

    private List<String> expand;

    private Long expiresAt;

    private Map<String, Object> extraParams;

    private Long maxRedemptions;

    private Map<String, String> metadata;

    private Restrictions restrictions;

    /** Finalize and obtain parameter instance from this builder. */
    public PromotionCodeCreateParams build() {
      return new PromotionCodeCreateParams(
          this.active,
          this.code,
          this.coupon,
          this.customer,
          this.expand,
          this.expiresAt,
          this.extraParams,
          this.maxRedemptions,
          this.metadata,
          this.restrictions);
    }

    /** Whether the promotion code is currently active. */
    public Builder setActive(Boolean active) {
      this.active = active;
      return this;
    }

    /**
     * The customer-facing code. Regardless of case, this code must be unique across all active
     * promotion codes for a specific customer. If left blank, we will generate one automatically.
     */
    public Builder setCode(String code) {
      this.code = code;
      return this;
    }

    /** The coupon for this promotion code. */
    public Builder setCoupon(String coupon) {
      this.coupon = coupon;
      return this;
    }

    /**
     * The customer that this promotion code can be used by. If not set, the promotion code can be
     * used by all customers.
     */
    public Builder setCustomer(String customer) {
      this.customer = customer;
      return this;
    }

    /**
     * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
     * subsequent calls adds additional elements to the original list. See {@link
     * PromotionCodeCreateParams#expand} for the field documentation.
     */
    public Builder addExpand(String element) {
      if (this.expand == null) {
        this.expand = new ArrayList<>();
      }
      this.expand.add(element);
      return this;
    }

    /**
     * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and
     * subsequent calls adds additional elements to the original list. See {@link
     * PromotionCodeCreateParams#expand} for the field documentation.
     */
    public Builder addAllExpand(List<String> elements) {
      if (this.expand == null) {
        this.expand = new ArrayList<>();
      }
      this.expand.addAll(elements);
      return this;
    }

    /**
     * The timestamp at which this promotion code will expire. If the coupon has specified a {@code
     * redeems_by}, then this value cannot be after the coupon's {@code redeems_by}.
     */
    public Builder setExpiresAt(Long expiresAt) {
      this.expiresAt = expiresAt;
      return this;
    }

    /**
     * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
     * call, and subsequent calls add additional key/value pairs to the original map. See {@link
     * PromotionCodeCreateParams#extraParams} for the field documentation.
     */
    public Builder putExtraParam(String key, Object value) {
      if (this.extraParams == null) {
        this.extraParams = new HashMap<>();
      }
      this.extraParams.put(key, value);
      return this;
    }

    /**
     * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
     * See {@link PromotionCodeCreateParams#extraParams} for the field documentation.
     */
    public Builder putAllExtraParam(Map<String, Object> map) {
      if (this.extraParams == null) {
        this.extraParams = new HashMap<>();
      }
      this.extraParams.putAll(map);
      return this;
    }

    /**
     * A positive integer specifying the number of times the promotion code can be redeemed. If the
     * coupon has specified a {@code max_redemptions}, then this value cannot be greater than the
     * coupon's {@code max_redemptions}.
     */
    public Builder setMaxRedemptions(Long maxRedemptions) {
      this.maxRedemptions = maxRedemptions;
      return this;
    }

    /**
     * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call,
     * and subsequent calls add additional key/value pairs to the original map. See {@link
     * PromotionCodeCreateParams#metadata} for the field documentation.
     */
    public Builder putMetadata(String key, String value) {
      if (this.metadata == null) {
        this.metadata = new HashMap<>();
      }
      this.metadata.put(key, value);
      return this;
    }

    /**
     * Add all map key/value pairs to `metadata` map. A map is initialized for the first
     * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
     * See {@link PromotionCodeCreateParams#metadata} for the field documentation.
     */
    public Builder putAllMetadata(Map<String, String> map) {
      if (this.metadata == null) {
        this.metadata = new HashMap<>();
      }
      this.metadata.putAll(map);
      return this;
    }

    /** Settings that restrict the redemption of the promotion code. */
    public Builder setRestrictions(PromotionCodeCreateParams.Restrictions restrictions) {
      this.restrictions = restrictions;
      return this;
    }
  }

  @Getter
  public static class Restrictions {
    /**
     * Promotion codes defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.
     */
    @SerializedName("currency_options")
    Map<String, PromotionCodeCreateParams.Restrictions.CurrencyOption> currencyOptions;

    /**
     * Map of extra parameters for custom features not available in this client library. The content
     * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
     * key/value pair is serialized as if the key is a root-level field (serialized) name in this
     * param object. Effectively, this map is flattened to its parent instance.
     */
    @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
    Map<String, Object> extraParams;

    /**
     * A Boolean indicating if the Promotion Code should only be redeemed for Customers without any
     * successful payments or invoices.
     */
    @SerializedName("first_time_transaction")
    Boolean firstTimeTransaction;

    /**
     * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be
     * $100 or more to work).
     */
    @SerializedName("minimum_amount")
    Long minimumAmount;

    /** Three-letter ISO code for minimum_amount */
    @SerializedName("minimum_amount_currency")
    String minimumAmountCurrency;

    private Restrictions(
        Map<String, PromotionCodeCreateParams.Restrictions.CurrencyOption> currencyOptions,
        Map<String, Object> extraParams,
        Boolean firstTimeTransaction,
        Long minimumAmount,
        String minimumAmountCurrency) {
      this.currencyOptions = currencyOptions;
      this.extraParams = extraParams;
      this.firstTimeTransaction = firstTimeTransaction;
      this.minimumAmount = minimumAmount;
      this.minimumAmountCurrency = minimumAmountCurrency;
    }

    public static Builder builder() {
      return new Builder();
    }

    public static class Builder {
      private Map<String, PromotionCodeCreateParams.Restrictions.CurrencyOption> currencyOptions;

      private Map<String, Object> extraParams;

      private Boolean firstTimeTransaction;

      private Long minimumAmount;

      private String minimumAmountCurrency;

      /** Finalize and obtain parameter instance from this builder. */
      public PromotionCodeCreateParams.Restrictions build() {
        return new PromotionCodeCreateParams.Restrictions(
            this.currencyOptions,
            this.extraParams,
            this.firstTimeTransaction,
            this.minimumAmount,
            this.minimumAmountCurrency);
      }

      /**
       * Add a key/value pair to `currencyOptions` map. A map is initialized for the first
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
       * See {@link PromotionCodeCreateParams.Restrictions#currencyOptions} for the field
       * documentation.
       */
      public Builder putCurrencyOption(
          String key, PromotionCodeCreateParams.Restrictions.CurrencyOption value) {
        if (this.currencyOptions == null) {
          this.currencyOptions = new HashMap<>();
        }
        this.currencyOptions.put(key, value);
        return this;
      }

      /**
       * Add all map key/value pairs to `currencyOptions` map. A map is initialized for the first
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
       * See {@link PromotionCodeCreateParams.Restrictions#currencyOptions} for the field
       * documentation.
       */
      public Builder putAllCurrencyOption(
          Map<String, PromotionCodeCreateParams.Restrictions.CurrencyOption> map) {
        if (this.currencyOptions == null) {
          this.currencyOptions = new HashMap<>();
        }
        this.currencyOptions.putAll(map);
        return this;
      }

      /**
       * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
       * call, and subsequent calls add additional key/value pairs to the original map. See {@link
       * PromotionCodeCreateParams.Restrictions#extraParams} for the field documentation.
       */
      public Builder putExtraParam(String key, Object value) {
        if (this.extraParams == null) {
          this.extraParams = new HashMap<>();
        }
        this.extraParams.put(key, value);
        return this;
      }

      /**
       * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
       * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
       * See {@link PromotionCodeCreateParams.Restrictions#extraParams} for the field documentation.
       */
      public Builder putAllExtraParam(Map<String, Object> map) {
        if (this.extraParams == null) {
          this.extraParams = new HashMap<>();
        }
        this.extraParams.putAll(map);
        return this;
      }

      /**
       * A Boolean indicating if the Promotion Code should only be redeemed for Customers without
       * any successful payments or invoices.
       */
      public Builder setFirstTimeTransaction(Boolean firstTimeTransaction) {
        this.firstTimeTransaction = firstTimeTransaction;
        return this;
      }

      /**
       * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must
       * be $100 or more to work).
       */
      public Builder setMinimumAmount(Long minimumAmount) {
        this.minimumAmount = minimumAmount;
        return this;
      }

      /**
       * Three-letter ISO code for minimum_amount
       */
      public Builder setMinimumAmountCurrency(String minimumAmountCurrency) {
        this.minimumAmountCurrency = minimumAmountCurrency;
        return this;
      }
    }

    @Getter
    public static class CurrencyOption {
      /**
       * Map of extra parameters for custom features not available in this client library. The
       * content in this map is not serialized under this field's {@code @SerializedName} value.
       * Instead, each key/value pair is serialized as if the key is a root-level field (serialized)
       * name in this param object. Effectively, this map is flattened to its parent instance.
       */
      @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
      Map<String, Object> extraParams;

      /**
       * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must
       * be $100 or more to work).
       */
      @SerializedName("minimum_amount")
      Long minimumAmount;

      private CurrencyOption(Map<String, Object> extraParams, Long minimumAmount) {
        this.extraParams = extraParams;
        this.minimumAmount = minimumAmount;
      }

      public static Builder builder() {
        return new Builder();
      }

      public static class Builder {
        private Map<String, Object> extraParams;

        private Long minimumAmount;

        /** Finalize and obtain parameter instance from this builder. */
        public PromotionCodeCreateParams.Restrictions.CurrencyOption build() {
          return new PromotionCodeCreateParams.Restrictions.CurrencyOption(
              this.extraParams, this.minimumAmount);
        }

        /**
         * Add a key/value pair to `extraParams` map. A map is initialized for the first
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
         * map. See {@link PromotionCodeCreateParams.Restrictions.CurrencyOption#extraParams} for
         * the field documentation.
         */
        public Builder putExtraParam(String key, Object value) {
          if (this.extraParams == null) {
            this.extraParams = new HashMap<>();
          }
          this.extraParams.put(key, value);
          return this;
        }

        /**
         * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
         * `put/putAll` call, and subsequent calls add additional key/value pairs to the original
         * map. See {@link PromotionCodeCreateParams.Restrictions.CurrencyOption#extraParams} for
         * the field documentation.
         */
        public Builder putAllExtraParam(Map<String, Object> map) {
          if (this.extraParams == null) {
            this.extraParams = new HashMap<>();
          }
          this.extraParams.putAll(map);
          return this;
        }

        /**
         * Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase
         * must be $100 or more to work).
         */
        public Builder setMinimumAmount(Long minimumAmount) {
          this.minimumAmount = minimumAmount;
          return this;
        }
      }
    }
  }
}


text:
/*
 * These are globally available services in any component or any other service
 */

// Angular 2
import { PathLocationStrategy, LocationStrategy } from '@angular/common';
// Angular 2 Http
import { HTTP_PROVIDERS } from '@angular/http';
// Angular 2 Forms
import { disableDeprecatedForms, provideForms } from '@angular/forms';
// Angular 2 Material
// TODO(gdi2290): replace with @angular2-material/all
import { MATERIAL_PROVIDERS } from './material';

/*
* Application Providers/Directives/Pipes
* providers/directives/pipes that only live in our browser environment
*/
export const APPLICATION_PROVIDERS = [
  disableDeprecatedForms(),
  provideForms(),
  ...HTTP_PROVIDERS,
  ...MATERIAL_PROVIDERS,
  { provide: LocationStrategy, useClass: PathLocationStrategy }
];

export const PROVIDERS = [
  ...APPLICATION_PROVIDERS
];

redpajama_set_name: RedPajamaGithub


text:
/* Extra for the CKEditor CodeMirror Plugin */

.CodeMirror {font:13px/1.4em monospace;text-align:left;}

.CodeMirror .activeline { background: #e8f2ff; }

.CodeMirror .CodeMirror-foldmarker {
	color: blue;
	text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
	font-family: arial;
	line-height: .3;
	cursor: pointer;
}

.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }

/* Source Dialog Buttons */
.searchCodeButton span,
.autoFormat span,
.CommentSelectedRange span,
.UncommentSelectedRange span {width:16px;height:16px;margin-left:6px}

.searchCodeButton span {background: url("../icons/SearchCode.png") no-repeat}
.autoFormat span {background: url("../icons/AutoFormat.png") no-repeat}
.CommentSelectedRange span {background: url("../icons/CommentSelectedRange.png") no-repeat}
.UncommentSelectedRange span {background: url("../icons/UncommentSelectedRange.png") no-repeat}

/* Fixes for the sourceDialog */
.cke_reset_all .CodeMirror-scroll * { white-space:normal}

.cke_reset_all .cm-s-cobalt *,
.cke_reset_all .cm-s-erlang-dark *,
.cke_reset_all .cm-s-lesser-dark *,
.cke_reset_all .cm-s-monokai *,
.cke_reset_all .cm-s-night *,
.cke_reset_all .cm-s-rubyblue *,
.cke_reset_all .cm-s-twilight *,
.cke_reset_all .cm-s-xq-dark *,
.cke_reset_all .cm-s-base16-dark *,
.cke_reset_all .cm-s-3024-night *,
.cke_reset_all .cm-s-the-matrix *,
.cke_reset_all .cm-s-paraiso-dark *,
.cke_reset_all .cm-s-paraiso-light * { color:inherit;font:inherit }

/* Fixes for themes */
.cm-s-cobalt .CodeMirror-selected { background: #b36539 !important; }
.cm-s-erlang-dark .CodeMirror-selected { background: #b36539 !important; }
.cm-s-lesser-dark .CodeMirror-selected {background: #45443B !important;}
.cm-s-monokai .CodeMirror-selected {background: #49483E !important;}
.cm-s-night .CodeMirror-selected { background: #447 !important; }
.cm-s-rubyblue .CodeMirror-selected { background: #38566F !important; }
.cm-s-twilight .CodeMirror-selected { background: #323232 !important; }
.cm-s-xq-dark .CodeMirror-selected { background: #a8f !important; }
.cm-s-the-matrix .CodeMirror-selected { background:rgba(255, 150, 0, .3) !important; }
.cm-s-mbo .CodeMirror-selected {
	background: #716C62 !important;
}

.cm-s-blackboard .activeline,
.cm-s-cobalt .activeline,
.cm-s-erlang-dark .activeline,
.cm-s-lesser-dark .activeline,
.cm-s-monokai .activeline,
.cm-s-night .activeline,
.cm-s-rubyblue .activeline,
.cm-s-vibrant-ink .activeline,
.cm-s-xq-dark .activeline,
.cm-s-base16-dark .activeline,
.cm-s-3024-night .activeline,
.cm-s-paraiso-light .activeline,
.cm-s-paraiso-dark .activeline {
	 background: #757575;
}

.cm-s-mbo .activeline {
	 background: #716C62;
}

.cm-s-twilight .activeline { background:#494949; }

.cm-s-the-matrix .activeline { background:#060; }

.CodeMirror-focused .cm-matchhighlight {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
    background-position: bottom;
    background-repeat: repeat-x;
}

/* Dialog Addon */
.CodeMirror-dialog {
  position: absolute;
  left: 0; right: 0;
  background: white;
  z-index: 15;
  padding: .1em .8em;
  overflow: hidden;
  color: #333;
}

.CodeMirror-dialog-top {
  border-bottom: 1px solid #eee;
  top: 0;
}

.CodeMirror-dialog-bottom {
  border-top: 1px solid #eee;
  bottom: 0;
}

.CodeMirror-dialog input {
  border: none;
  outline: none;
  background: transparent;
  width: 20em;
  color: inherit;
  font-family: monospace;
}

.CodeMirror-dialog button {
  font-size: 70%;
}
.CodeMirror-hints {
  position: absolute;
  z-index: 10;
  overflow: hidden;
  list-style: none;

  margin: 0;
  padding: 2px;

  -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
  -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
  box-shadow: 2px 3px 5px rgba(0,0,0,.2);
  border-radius: 3px;
  border: 1px solid silver;

  background: white;
  font-size: 90%;
  font-family: monospace;

  max-height: 20em;
  overflow-y: auto;
}

.CodeMirror-hint {
  margin: 0;
  padding: 0 4px;
  border-radius: 2px;
  max-width: 19em;
  overflow: hidden;
  white-space: pre;
  color: black;
  cursor: pointer;
}

.CodeMirror-hint-active {
  background: #08f;
  color: white;
}

.cm-trailingspace {
	background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);
	background-position: bottom left;
	background-repeat: repeat-x;
}


text:
package com.google.javascript.rhino.jstype;

/**
 * An object type with a declared default index type.
 *
 * For example, Object.<number, string> can take only numbers as
 * keys.
 *
 */
final class IndexedType extends ProxyObjectType {
  private static final long serialVersionUID = 1L;

  final JSType indexType;

  IndexedType(
      JSTypeRegistry registry, ObjectType objectType, JSType indexType) {
    callSuper(registry, objectType);
    this.indexType = indexType;
  }

  @Override
  public JSType getIndexType() {
    return indexType;
  }
}


text:
namespace feature_engagement {
namespace stats {

// Enum used in the metrics to record the result when in-product help UI is
// going to be triggered.
// Most of the fields maps to |ConditionValidator::Result|.
// The failure reasons are not mutually exclusive.
// Out-dated entries shouldn't be deleted but marked as obselete.
// Keep this synced with the enum in //tools/metrics/histograms/enums.xml.
enum class TriggerHelpUIResult {
  // The help UI is triggered.
  SUCCESS = 0,

  // The help UI is not triggered.
  FAILURE = 1,

  // Event model is not ready.
  FAILURE_EVENT_MODEL_NOT_READY = 2,

  // Some other help UI is currently showing.
  FAILURE_CURRENTLY_SHOWING = 3,

  // The feature is disabled.
  FAILURE_FEATURE_DISABLED = 4,

  // Configuration can not be parsed.
  FAILURE_CONFIG_INVALID = 5,

  // Used event precondition is not satisfied.
  FAILURE_USED_PRECONDITION_UNMET = 6,

  // Trigger event precondition is not satisfied.
  FAILURE_TRIGGER_PRECONDITION_UNMET = 7,

  // Other event precondition is not satisfied.
  FAILURE_OTHER_PRECONDITION_UNMET = 8,

  // Session rate does not meet the requirement.
  FAILURE_SESSION_RATE = 9,

  // Availability model is not ready.
  FAILURE_AVAILABILITY_MODEL_NOT_READY = 10,

  // Availability precondition is not satisfied.
  FAILURE_AVAILABILITY_PRECONDITION_UNMET = 11,

  // Same as |SUCCESS|, but feature configuration was set to tracking only.
  SUCCESS_TRACKING_ONLY = 12,

  // Display of help UI is locked.
  FAILURE_DISPLAY_LOCK = 13,

  // Last entry for the enum.
  COUNT = 14,
};

// Used in the metrics to track the configuration parsing event.
// The failure reasons are not mutually exclusive.
// Out-dated entries shouldn't be deleted but marked as obsolete.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
// Keep this synced with the enum in //tools/metrics/histograms/enums.xml.
enum class ConfigParsingEvent {
  // The configuration is parsed correctly.
  SUCCESS = 0,

  // The configuration is invalid after parsing.
  FAILURE = 1,

  // Fails to parse the feature config because no field trial is found,
  // and there was no checked in configuration.
  FAILURE_NO_FIELD_TRIAL = 2,

  // Fails to parse the used event.
  FAILURE_USED_EVENT_PARSE = 3,

  // Used event is missing.
  FAILURE_USED_EVENT_MISSING = 4,

  // Fails to parse the trigger event.
  FAILURE_TRIGGER_EVENT_PARSE = 5,

  // Trigger event is missing.
  FAILURE_TRIGGER_EVENT_MISSING = 6,

  // Fails to parse other events.
  FAILURE_OTHER_EVENT_PARSE = 7,

  // Fails to parse the session rate comparator.
  FAILURE_SESSION_RATE_PARSE = 8,

  // Fails to parse the availability comparator.
  FAILURE_AVAILABILITY_PARSE = 9,

  // UnKnown key in configuration parameters.
  FAILURE_UNKNOWN_KEY = 10,

  // Fails to parse the session rate impact.
  FAILURE_SESSION_RATE_IMPACT_PARSE = 11,

  // Fails to parse the session rate impact.
  FAILURE_SESSION_RATE_IMPACT_UNKNOWN_FEATURE = 12,

  // Fails to parse the tracking only flag.
  FAILURE_TRACKING_ONLY_PARSE = 13,

  // Successfully read checked in configuration.
  SUCCESS_FROM_SOURCE = 14,

  // Fails to parse the snooze parameters.
  FAILURE_SNOOZE_PARAMS_PARSE = 15,

  // Fails to parse the blocked_by parameters.
  FAILURE_BLOCKED_BY_PARSE = 16,

  // Fails to parse the blocked_by feature list.
  FAILURE_BLOCKED_BY_UNKNOWN_FEATURE = 17,

  // Fails to parse the blocking parameters.
  FAILURE_BLOCKING_PARSE = 18,

  // Last entry for the enum.
  COUNT = 19,
};

// Used in metrics to track database states. Each type will match to a suffix
// in the histograms to identify the database.
enum class StoreType {
  // Events store.
  EVENTS_STORE = 0,

  // Availability store.
  AVAILABILITY_STORE = 1,
};

// Helper function that converts a store type to histogram suffix string.
std::string ToDbHistogramSuffix(StoreType type);

// Records the feature engagement events. Used event will be tracked
// separately.
void RecordNotifyEvent(const std::string& event,
                       const Configuration* config,
                       bool is_model_ready);

// Records user action and the result histogram when in-product help will be
// shown to the user.
void RecordShouldTriggerHelpUI(const base::Feature& feature,
                               const FeatureConfig& feature_config,
                               const ConditionValidator::Result& result);

// Records when the user dismisses the in-product help UI.
void RecordUserDismiss();

// Records when the user dismisses or snoozes the snoozable in-product help UI.
void RecordUserSnoozeAction(Tracker::SnoozeAction snooze_action);

// Records the result of database updates.
void RecordDbUpdate(bool success, StoreType type);

// Record database init.
void RecordDbInitEvent(bool success, StoreType type);

// Records events database load event.
void RecordEventDbLoadEvent(bool success, const std::vector<Event>& events);

// Records availability database load event.
void RecordAvailabilityDbLoadEvent(bool success);

// Records configuration parsing event.
void RecordConfigParsingEvent(ConfigParsingEvent event);

}  // namespace stats
}  // namespace feature_engagement

#endif  // COMPONENTS_FEATURE_ENGAGEMENT_INTERNAL_STATS_H_


text:
//
//       Copyright DataStax, Inc.
//
//    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.
//

using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Cassandra.Tests.MetadataHelpers.TestHelpers
{
    internal class FakeSchemaParser : SchemaParser
    {
        private readonly ConcurrentDictionary<string, KeyspaceMetadata> _keyspaces;

        public FakeSchemaParser(ConcurrentDictionary<string, KeyspaceMetadata> keyspaces) : base(new Metadata(new Configuration()))
        {
            _keyspaces = keyspaces;
        }

        protected override string SelectAggregates => throw new System.NotImplementedException();

        protected override string SelectFunctions => throw new System.NotImplementedException();

        protected override string SelectTables => throw new System.NotImplementedException();

        protected override string SelectUdts => throw new System.NotImplementedException();

        public override Task<AggregateMetadata> GetAggregateAsync(string keyspaceName, string aggregateName, string signatureString)
        {
            throw new System.NotImplementedException();
        }

        public override Task<ICollection<string>> GetKeyspacesNamesAsync()
        {
            throw new System.NotImplementedException();
        }

        public override Task<FunctionMetadata> GetFunctionAsync(string keyspaceName, string functionName, string signatureString)
        {
            throw new System.NotImplementedException();
        }

        public override Task<KeyspaceMetadata> GetKeyspaceAsync(string name)
        {
            _keyspaces.TryGetValue(name, out var keyspace);
            return Task.FromResult(keyspace);
        }

        public override Task<IEnumerable<KeyspaceMetadata>> GetKeyspacesAsync(bool retry)
        {
            return Task.FromResult(_keyspaces.ToArray().Select(kvp => kvp.Value));
        }

        public override Task<TableMetadata> GetTableAsync(string keyspaceName, string tableName)
        {
            throw new System.NotImplementedException();
        }

        public override Task<UdtColumnInfo> GetUdtDefinitionAsync(string keyspaceName, string typeName)
        {
            throw new System.NotImplementedException();
        }

        public override Task<MaterializedViewMetadata> GetViewAsync(string keyspaceName, string viewName)
        {
            throw new System.NotImplementedException();
        }
    }
}


text:
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View, Button } from 'react-native'
import Dimensions from 'Dimensions'
import Game from './classes/Game'
import Grid from './components/Grid'
import ScoreCard from './components/ScoreCard'
import Timer from './components/Timer'
import Popup from 'react-native-popup'

const game = new Game()
game.deal()
const { width, height } = Dimensions.get('window')

export default class Board extends Component {
  constructor( props ) {
    super( props )
    this.state = {
      game: game,
      time: 10,
      isOver: false
    }
    this.touchCard = this.touchCard.bind( this )
    this.startNewGame = this.startNewGame.bind( this )
    this.gameOver = this.gameOver.bind(this)
  }

  touchCard( card ) {
    if (!this.state.isOver) {
      let game = this.state.game
      let currentSelection = game.player.selectedCards

      if ( game.player.selectionIsEmpty() ) {
        game.player.addCard( card )
        game.grid.toggleSelectOnCard( card )
        this.setState({ game })
        return
      }

      if ( game.player.checkIfCardIsSelected( card ) ) {
        game.player.removeCard( card )
        game.grid.toggleSelectOnCard( card )
      } else {
        game.player.addCard( card )
        game.grid.toggleSelectOnCard( card )
      }

      if ( currentSelection.length === 3 ) {
        game.handleSet()
        game.player.clearSet()
        game.deal()
        game.grid.resetSelected()
      }

      this.setState({ game })
    }

  }

  startNewGame() {
    let game = this.state.game
    game.setNewGame()
    game.deal()
    this.setState({ game: game, isOver: false})
    this._child.resetTime()
  }

  handleReDeal() {
    let game = this.state.game
    game.reDeal()
    this.setState({ game })
  }

  cardStyleFunc( color ) {
    return {
      justifyContent: 'center',
      alignItems: 'center',
      height: height * .175, // 110,
      width: width * .25,// 75,
      margin: 1,
      borderWidth: 2,
      borderColor: color,
    }
  }

  gameOver() {
    this.setState( {isOver: true})
    console.log(this.state.isOver);
    this._popup.confirm({
      content: 'Your score brings great dishonor to your family. Would you like to play again?',
      ok: {
        callback: () => {
          this.startNewGame()
        },
      },
    });
  }

  render() {
    let game = this.state.game
    return (
      <View style={boardStyles.board}>

        <View style={boardStyles.scoreBoard}>
          <ScoreCard score={game.player.score}/>
          <Timer ref={child => { this._child = child }} time={this.state.time} gameOver={this.gameOver}/>
        </View>

        <Grid grid={game.grid} touchCard={this.touchCard} cardStyle={this.cardStyleFunc} />

        <View style={boardStyles.buttonRack}>
          <Button onPress={this.startNewGame} title="New Game" color="#841584"/>
          <Button onPress={this.handleReDeal.bind( this )} title="redeal" color="#841584"/>
        </View>
        <Popup ref={popup => this._popup = popup }/>
      </View>
    )
  }
}

const boardStyles = StyleSheet.create({
  board: {
    height: height*.90,
    width: width*.85,
    flexDirection: 'column',
    justifyContent: 'space-between',
  },
  scoreBoard: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    width: width*.85,
    height: height*.05,
  },
  buttonRack: {
    flexDirection: 'row',
    justifyContent: 'space-between'
  }
})


text:
package org.apache.sling.distribution.trigger.impl;

import javax.annotation.Nonnull;
import java.util.Map;

import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.ConfigurationPolicy;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.commons.osgi.PropertiesUtil;
import org.apache.sling.commons.scheduler.Scheduler;
import org.apache.sling.distribution.component.impl.DistributionComponentConstants;
import org.apache.sling.distribution.common.DistributionException;
import org.apache.sling.distribution.transport.DistributionTransportSecretProvider;
import org.apache.sling.distribution.trigger.DistributionRequestHandler;
import org.apache.sling.distribution.trigger.DistributionTrigger;
import org.osgi.framework.BundleContext;

@Component(metatype = true,
        label = "Apache Sling Distribution Trigger - Remote Event Triggers Factory",
        configurationFactory = true,
        specVersion = "1.1",
        policy = ConfigurationPolicy.REQUIRE
)
@Service(DistributionTrigger.class)
@Property(name="webconsole.configurationFactory.nameHint", value="Trigger name: {name}")
public class RemoteEventDistributionTriggerFactory implements DistributionTrigger {

    @Property(label = "Name", description = "The name of the trigger.")
    public static final String NAME = DistributionComponentConstants.PN_NAME;

    /**
     * remote event endpoint property
     */
    @Property(label = "Endpoint", description = "The endpoint from which the remote requests should be polled.")
    private static final String ENDPOINT = "endpoint";

    @Property(name = "transportSecretProvider.target")
    @Reference(name = "transportSecretProvider")
    private
    DistributionTransportSecretProvider transportSecretProvider;

    @Reference
    private Scheduler scheduler;

    private RemoteEventDistributionTrigger trigger;

    @Activate
    public void activate(BundleContext bundleContext, Map<String, Object> config) {
        String endpoint = PropertiesUtil.toString(config.get(ENDPOINT), null);
        trigger = new RemoteEventDistributionTrigger(endpoint, transportSecretProvider, scheduler);
    }

    @Deactivate
    public void deactivate() {
        trigger.disable();

    }

    public void register(@Nonnull DistributionRequestHandler requestHandler) throws DistributionException {
        trigger.register(requestHandler);
    }

    public void unregister(@Nonnull DistributionRequestHandler requestHandler) throws DistributionException {
        trigger.unregister(requestHandler);
    }
}


text:
from v1 import artifact as art1
from v2 import artifact as art2

MY_ARTIFACT = [art1.MyArtifact, art2.MyArtifact]


text:
Sample application for spring-boot.

Run with

    mvn spring-boot:run

Browse hawtio using the url: http://localhost:10000/hawtio/index.html


text:
<?php
/**
 * Piwik - Open source web analytics
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @category Piwik_Plugins
 * @package Piwik_MobileMessaging
 */

/**
 *
 * @package Piwik_MobileMessaging
 */
class Piwik_MobileMessaging extends Piwik_Plugin
{
    const DELEGATED_MANAGEMENT_OPTION = 'MobileMessaging_DelegatedManagement';
    const PROVIDER_OPTION = 'Provider';
    const API_KEY_OPTION = 'APIKey';
    const PHONE_NUMBERS_OPTION = 'PhoneNumbers';
    const PHONE_NUMBER_VALIDATION_REQUEST_COUNT_OPTION = 'PhoneNumberValidationRequestCount';
    const SMS_SENT_COUNT_OPTION = 'SMSSentCount';
    const DELEGATED_MANAGEMENT_OPTION_DEFAULT = 'false';
    const USER_SETTINGS_POSTFIX_OPTION = '_MobileMessagingSettings';

    const PHONE_NUMBERS_PARAMETER = 'phoneNumbers';

    const MOBILE_TYPE = 'mobile';
    const SMS_FORMAT = 'sms';

    static private $availableParameters = array(
        self::PHONE_NUMBERS_PARAMETER => true,
    );

    static private $managedReportTypes = array(
        self::MOBILE_TYPE => 'plugins/MobileMessaging/images/phone.png'
    );

    static private $managedReportFormats = array(
        self::SMS_FORMAT => 'plugins/MobileMessaging/images/phone.png'
    );

    static private $availableReports = array(
        array(
            'module' => 'MultiSites',
            'action' => 'getAll',
        ),
        array(
            'module' => 'MultiSites',
            'action' => 'getOne',
        ),
    );

    /**
     * Return information about this plugin.
     *
     * @see Piwik_Plugin
     *
     * @return array
     */
    public function getInformation()
    {
        return array(
            'name'             => 'Mobile Messaging Plugin',
            'description'      => Piwik_Translate('MobileMessaging_PluginDescription'),
            'homepage'         => 'http://piwik.org/',
            'author'           => 'Piwik',
            'author_homepage'  => 'http://piwik.org/',
            'license'          => 'GPL v3 or later',
            'license_homepage' => 'http://www.gnu.org/licenses/gpl.html',
            'version'          => Piwik_Version::VERSION,
        );
    }

    function getListHooksRegistered()
    {
        return array(
            'AdminMenu.add'                       => 'addMenu',
            'AssetManager.getJsFiles'             => 'getJsFiles',
            'PDFReports.getReportParameters'      => 'getReportParameters',
            'PDFReports.validateReportParameters' => 'validateReportParameters',
            'PDFReports.getReportMetadata'        => 'getReportMetadata',
            'PDFReports.getReportTypes'           => 'getReportTypes',
            'PDFReports.getReportFormats'         => 'getReportFormats',
            'PDFReports.getRendererInstance'      => 'getRendererInstance',
            'PDFReports.getReportRecipients'      => 'getReportRecipients',
            'PDFReports.allowMultipleReports'     => 'allowMultipleReports',
            'PDFReports.sendReport'               => 'sendReport',
            'template_reportParametersPDFReports' => 'template_reportParametersPDFReports',
        );
    }

    function addMenu()
    {
        Piwik_AddAdminMenu(
            'MobileMessaging_SettingsMenu',
            array('module' => 'MobileMessaging', 'action' => 'index'),
            true
        );
    }

    /**
     * Get JavaScript files
     *
     * @param Piwik_Event_Notification $notification notification object
     */
    function getJsFiles($notification)
    {
        $jsFiles = & $notification->getNotificationObject();

        $jsFiles[] = "plugins/MobileMessaging/scripts/MobileMessagingSettings.js";
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function validateReportParameters($notification)
    {
        if (self::manageEvent($notification)) {
            $parameters = & $notification->getNotificationObject();

            // phone number validation
            $availablePhoneNumbers = Piwik_MobileMessaging_API::getInstance()->getActivatedPhoneNumbers();

            $phoneNumbers = $parameters[self::PHONE_NUMBERS_PARAMETER];
            foreach ($phoneNumbers as $key => $phoneNumber) {
                //when a wrong phone number is supplied we silently discard it
                if (!in_array($phoneNumber, $availablePhoneNumbers)) {
                    unset($phoneNumbers[$key]);
                }
            }

            // 'unset' seems to transform the array to an associative array
            $parameters[self::PHONE_NUMBERS_PARAMETER] = array_values($phoneNumbers);
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function getReportMetadata($notification)
    {
        if (self::manageEvent($notification)) {
            $availableReportMetadata = & $notification->getNotificationObject();

            $notificationInfo = $notification->getNotificationInfo();
            $idSite = $notificationInfo[Piwik_PDFReports_API::ID_SITE_INFO_KEY];

            foreach (self::$availableReports as $availableReport) {
                $reportMetadata = Piwik_API_API::getInstance()->getMetadata(
                    $idSite,
                    $availableReport['module'],
                    $availableReport['action']
                );

                if ($reportMetadata != null) {
                    $reportMetadata = reset($reportMetadata);
                    $availableReportMetadata[] = $reportMetadata;
                }
            }
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function getReportTypes($notification)
    {
        $reportTypes = & $notification->getNotificationObject();
        $reportTypes = array_merge($reportTypes, self::$managedReportTypes);
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function getReportFormats($notification)
    {
        if (self::manageEvent($notification)) {
            $reportFormats = & $notification->getNotificationObject();
            $reportFormats = array_merge($reportFormats, self::$managedReportFormats);
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function getReportParameters($notification)
    {
        if (self::manageEvent($notification)) {
            $availableParameters = & $notification->getNotificationObject();
            $availableParameters = self::$availableParameters;
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function getRendererInstance($notification)
    {
        if (self::manageEvent($notification)) {
            $reportRenderer = & $notification->getNotificationObject();

            if (Piwik_PluginsManager::getInstance()->isPluginActivated('MultiSites')) {
                $reportRenderer = new Piwik_MobileMessaging_ReportRenderer_Sms();
            } else {
                $reportRenderer = new Piwik_MobileMessaging_ReportRenderer_Exception(
                    Piwik_Translate('MobileMessaging_MultiSites_Must_Be_Activated')
                );
            }
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function allowMultipleReports($notification)
    {
        if (self::manageEvent($notification)) {
            $allowMultipleReports = & $notification->getNotificationObject();
            $allowMultipleReports = false;
        }
    }

    function getReportRecipients($notification)
    {
        if (self::manageEvent($notification)) {
            $recipients = & $notification->getNotificationObject();
            $notificationInfo = $notification->getNotificationInfo();

            $report = $notificationInfo[Piwik_PDFReports_API::REPORT_KEY];
            $recipients = $report['parameters'][self::PHONE_NUMBERS_PARAMETER];
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    function sendReport($notification)
    {
        if (self::manageEvent($notification)) {
            $notificationInfo = $notification->getNotificationInfo();
            $report = $notificationInfo[Piwik_PDFReports_API::REPORT_KEY];
            $contents = $notificationInfo[Piwik_PDFReports_API::REPORT_CONTENT_KEY];
            $reportSubject = $notificationInfo[Piwik_PDFReports_API::REPORT_SUBJECT_KEY];

            $parameters = $report['parameters'];
            $phoneNumbers = $parameters[self::PHONE_NUMBERS_PARAMETER];

            // 'All Websites' is one character above the limit, use 'Reports' instead
            if ($reportSubject == Piwik_Translate('General_MultiSitesSummary')) {
                $reportSubject = Piwik_Translate('General_Reports');
            }

            $mobileMessagingAPI = Piwik_MobileMessaging_API::getInstance();
            foreach ($phoneNumbers as $phoneNumber) {
                $mobileMessagingAPI->sendSMS(
                    $contents,
                    $phoneNumber,
                    $reportSubject
                );
            }
        }
    }

    /**
     * @param Piwik_Event_Notification $notification notification object
     */
    static public function template_reportParametersPDFReports($notification)
    {
        if (Piwik::isUserIsAnonymous()) {
            return;
        }

        $out =& $notification->getNotificationObject();
        $view = Piwik_View::factory('ReportParameters');
        $view->reportType = self::MOBILE_TYPE;
        $view->phoneNumbers = Piwik_MobileMessaging_API::getInstance()->getActivatedPhoneNumbers();
        $out .= $view->render();
    }

    private static function manageEvent($notification)
    {
        $notificationInfo = $notification->getNotificationInfo();
        return in_array($notificationInfo[Piwik_PDFReports_API::REPORT_TYPE_INFO_KEY], array_keys(self::$managedReportTypes));
    }

    function install()
    {
        $delegatedManagement = Piwik_GetOption(self::DELEGATED_MANAGEMENT_OPTION);
        if (empty($delegatedManagement)) {
            Piwik_SetOption(self::DELEGATED_MANAGEMENT_OPTION, self::DELEGATED_MANAGEMENT_OPTION_DEFAULT);
        }
    }

    function deactivate()
    {
        // delete all mobile reports
        $pdfReportsAPIInstance = Piwik_PDFReports_API::getInstance();
        $reports = $pdfReportsAPIInstance->getReports();

        foreach ($reports as $report) {
            if ($report['type'] == Piwik_MobileMessaging::MOBILE_TYPE) {
                $pdfReportsAPIInstance->deleteReport($report['idreport']);
            }
        }
    }

    public function uninstall()
    {
        // currently the UI does not allow to delete a plugin
        // when it becomes available, all the MobileMessaging settings (API credentials, phone numbers, etc..) should be removed from the option table
        return;
    }
}


text:
require 'test_helper'

class PluginTest < Minitest::Test
  def test_minitest_has_the_plugin_included
    assert_includes Minitest::Test.included_modules, Minitest::Perf::Plugin
  end
end


text:
#include "../kd_library.h"

static mach_timebase_info_data_t     l_timebase;

// xmPlatformGetTimeUST : Get the current unadjusted system time in platform specific.
KDust xmPlatformGetTimeUST ( KDvoid )
{
	uint64_t      time = 0;

	mach_timebase_info ( &l_timebase );

	time  = mach_absolute_time ( );
	time *= l_timebase.numer;
	time /= l_timebase.denom;

	return (KDust) time;
}

// xmPlatformUSTAtEpoch : Get the UST corresponding to KDtime 0 in platform specific.
KDust xmPlatformUSTAtEpoch ( KDvoid )
{
	return xmPlatformGetTimeUST ( );
}


text:
set(SRC_CPP_FILES
)

set(INTERNAL_CPP_FILES
  org_mitk_gui_qt_properties_Activator.cpp
  QmitkPropertiesPreferencePage.cpp
  QmitkPropertyItemDelegate.cpp
  QmitkPropertyItem.cpp
  QmitkPropertyItemModel.cpp
  QmitkPropertyItemSortFilterProxyModel.cpp
  QmitkPropertyTreeView.cpp
)

set(UI_FILES
  src/internal/QmitkPropertiesPreferencePage.ui
  src/internal/QmitkPropertyTreeView.ui
)

set(MOC_H_FILES
  src/internal/QmitkPropertiesPreferencePage.h
  src/internal/org_mitk_gui_qt_properties_Activator.h
  src/internal/QmitkPropertyItemDelegate.h
  src/internal/QmitkPropertyItemModel.h
  src/internal/QmitkPropertyItemSortFilterProxyModel.h
  src/internal/QmitkPropertyTreeView.h
)

set(CACHED_RESOURCE_FILES
  resources/icon.png
  plugin.xml
)

set(QRC_FILES
)

set(CPP_FILES
)

foreach(file ${SRC_CPP_FILES})
  set(CPP_FILES ${CPP_FILES} src/${file})
endforeach()

foreach(file ${INTERNAL_CPP_FILES})
  set(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach()


text:
namespace iroha {
namespace writer {
namespace verilog {

VerilogWriter::VerilogWriter(const IDesign *design, const Connection &conn,
                             const string &flavor, bool debug, ostream &os)
    : design_(design),
      conn_(conn),
      flavor_(flavor),
      debug_(debug),
      final_os_(os),
      embedded_modules_(new EmbeddedModules),
      with_self_contained_(false),
      output_vcd_(false),
      names_root_(new Names(nullptr)),
      reset_polarity_(false) {}

VerilogWriter::~VerilogWriter() {}

bool VerilogWriter::Write() {
  names_root_->ReservePrefix("insn");
  names_root_->ReservePrefix("st");
  names_root_->ReservePrefix("task");
  names_root_->ReservePrefix("S");
  // Resource related.
  names_root_->ReservePrefix("fifo");
  names_root_->ReservePrefix("mem");
  // e.g. shared_reg
  names_root_->ReservePrefix("shared");
  // SystemVerilog keyword.
  names_root_->ReservePrefix("always");

  DebugMarker::SetEnable(debug_);

  os_ << "// Generated from " << PACKAGE << "-" << VERSION << ".\n";

  IModule *root = DesignUtil::GetRootModule(design_);
  if (root == nullptr) {
    LOG(ERROR) << "Failed to determine a root module";
    return false;
  }
  PrepareModulesRec(root);
  ResolveResetPolarity(root);
  BuildModules(root);
  // * MODULE-NAME-PREFIX is specified.
  //  prefix_rawName
  // * Not specifed.
  //  shellModuleName_rawName
  string prefix = design_->GetParams()->GetModuleNamePrefix();
  if (prefix.empty()) {
    prefix = shell_module_name_ + "_";
  }
  for (auto *mod : ordered_modules_) {
    mod->Write(prefix, os_);
  }
  if (!shell_module_name_.empty()) {
    Module *root_mod = modules_[root];
    WriteShellModule(root_mod);
  }
  if (!embedded_modules_->Write(GetResetPolarity(), os_)) {
    LOG(ERROR) << "Failed to write embedded modules.";
    return false;
  }
  STLDeleteSecondElements(&modules_);
  string s = os_.str();
  Indent indent(s);
  final_os_ << indent.DoIndent();
  return true;
}

void VerilogWriter::SetShellModuleName(const string &n,
                                       bool with_self_contained,
                                       bool output_vcd) {
  shell_module_name_ = n;
  with_self_contained_ = with_self_contained;
  output_vcd_ = output_vcd;
}

Module *VerilogWriter::GetByIModule(const IModule *mod) const {
  auto it = modules_.find(mod);
  if (it != modules_.end()) {
    return it->second;
  }
  return nullptr;
}

bool VerilogWriter::GetResetPolarity() const { return reset_polarity_; }

void VerilogWriter::ResolveResetPolarity(const IModule *root) {
  if (root->GetParams()->HasResetPolarity()) {
    reset_polarity_ = root->GetParams()->GetResetPolarity();
    return;
  }
  // This may return the default value.
  reset_polarity_ = design_->GetParams()->GetResetPolarity();
}

void VerilogWriter::PrepareModulesRec(const IModule *imod) {
  vector<IModule *> children = DesignUtil::GetChildModules(imod);
  for (IModule *child : children) {
    PrepareModulesRec(child);
  }
  Module *mod = new Module(imod, this, conn_, embedded_modules_.get(),
                           names_root_->NewChildNames());
  modules_[imod] = mod;
  ordered_modules_.push_back(mod);
}

void VerilogWriter::BuildModules(const IModule *imod) {
  for (auto *mod : ordered_modules_) {
    const IModule *imod = mod->GetIModule();
    IModule *iparent = imod->GetParentModule();
    if (iparent != nullptr) {
      Module *parent = modules_[iparent];
      mod->SetParentModule(parent);
    }
  }
  for (auto *mod : ordered_modules_) {
    mod->PrepareTables();
  }
  for (auto *mod : ordered_modules_) {
    mod->Build();
  }
  BuildChildModuleSection();
}

void VerilogWriter::BuildChildModuleSection() {
  for (auto *mod : ordered_modules_) {
    vector<IModule *> child_imods =
        DesignUtil::GetChildModules(mod->GetIModule());
    vector<Module *> mods;
    for (auto *imod : child_imods) {
      mods.push_back(modules_[imod]);
    }
    mod->BuildChildModuleInstSection(mods);
  }
}

void VerilogWriter::WriteShellModule(const Module *root_mod) {
  const PortSet *ports = root_mod->GetPortSet();
  os_ << "`ifndef STRIP_SHELL\n";
  os_ << "module " << shell_module_name_ << "(";
  if (!with_self_contained_) {
    ports->Output(PortSet::PORT_MODULE_HEAD_DIRECTION, os_);
  }
  os_ << ");\n";
  if (with_self_contained_) {
    WriteSelfClockGenerator(root_mod);
  }
  std::unique_ptr<SelfShell> shell;
  if (with_self_contained_) {
    shell.reset(new SelfShell(design_, ports, reset_polarity_,
                              embedded_modules_.get()));
    shell->WriteWireDecl(os_);
  }
  string name = root_mod->GetName();
  if (design_->GetParams()->GetModuleNamePrefix().empty()) {
    name = shell_module_name_ + "_" + name;
  } else {
    name = design_->GetParams()->GetModuleNamePrefix() + name;
  }
  os_ << "  " << name << " " << name << "_inst(";
  if (with_self_contained_) {
    WriteSelfClockConnection(root_mod);
    shell->WritePortConnection(os_);
  } else {
    ports->Output(PortSet::PORT_CONNECTION, os_);
  }
  os_ << ");\n";
  if (with_self_contained_) {
    shell->WriteShellFSM(os_);
  }
  if (output_vcd_) {
    os_ << "\n"
        << "initial begin\n"
        << "    $dumpfile(\"/tmp/" << shell_module_name_ << ".vcd\");\n"
        << "    $dumpvars(0, " << name << "_inst);\n"
        << "  end\n";
  }
  os_ << "\nendmodule  // " << shell_module_name_ << "\n";
  os_ << "`endif  // STRIP_SHELL\n";

  os_ << "\n// NOTE: Please copy the follwoing line to your design.\n"
      << "// " << shell_module_name_ << " " << shell_module_name_ << "_inst(";
  ports->OutputWithFlavor(PortSet::PORT_CONNECTION_TEMPLATE, flavor_, os_);
  os_ << ");\n";
  os_ << "//";
  ports->OutputWithFlavor(PortSet::AXI_USER_ASSIGN_TEMPLATE, flavor_, os_);
  os_ << "\n";
  os_ << "// NOTE: This can be used by your script to auto generate the "
         "instantiation and connections.\n"
      << "// :connection: " << shell_module_name_ << ":" << shell_module_name_
      << "_inst ";
  ports->Output(PortSet::PORT_CONNECTION_DATA, os_);
  os_ << "\n";
}

void VerilogWriter::WriteSelfClockGenerator(const Module *root_mod) {
  const PortSet *ports = root_mod->GetPortSet();
  const string &clk = ports->GetClk();
  const string &rst = ports->GetReset();
  os_ << "  reg " << clk << ", " << rst << ";\n\n"
      << "  initial begin\n"
      << "    " << clk << " <= 0;\n"
      << "    " << rst << " <= " << (reset_polarity_ ? "1" : "0") << ";\n"
      << "    #15\n"
      << "    " << rst << " <= ~" << rst << ";\n"
      << "    #10000\n"
      << "    $finish;\n"
      << "  end\n\n";
  os_ << "  always begin\n"
      << "    #10 " << clk << " = ~" << clk << ";\n"
      << "  end\n\n";
}

void VerilogWriter::WriteSelfClockConnection(const Module *root_mod) {
  const PortSet *ports = root_mod->GetPortSet();
  const string &clk = ports->GetClk();
  const string &rst = ports->GetReset();
  os_ << "." << clk << "(" << clk << "), ." << rst << "(" << rst << ")";
}

}  // namespace verilog
}  // namespace writer
}  // namespace iroha


text:
<?xml version="1.0" encoding="UTF-8"?>
<conversion-settings>
    <project id="dlg">
    <project-name value="Dolgan"/>
    <speaker-code position="1"/>
    <text-name from-item="title-abbreviation" from-lang="en"/>
    <tiers>
        <baseline lang="dlg"/>
        <!-- Tier parameters -->
        <!-- name: used as tier name in EXMARaLDA ('display'), also as 'cat' -->
        <!-- template: template to call for creating this tier -->
        <!-- itemtype: item/@type in flextext, passed as template param; default='txt' -->
        <!-- lang: item/@lang in flextext, passed as template param; default=baseline -->
        <!-- Sentence tiers -->
        <tier name="ref" template="tier-sent" itemtype="segnum" lang="en" cleanup="renum"/>
        <tier name="st" template="tier-sent" itemtype="lit" lang="dlg-x-source" cleanup="brackets"/>
        <tier name="ts" template="tier-sent-join" cleanup="brackets"/>
        <tier name="tx" template="tier-tx" itemtype="txt" cleanup="tx"/>
        <tier name="mb" template="tier-morph" sep="" cleanup="morph"/>
        <tier name="mp" template="tier-morph" itemtype="cf" sep="" cleanup="morph"/>
        <tier name="ge" template="tier-morph" itemtype="gls" lang="en" sep="-" cleanup="gloss"/>
        <tier name="gr" template="tier-morph" itemtype="gls" lang="ru" sep="-" cleanup="gloss"/>
        <tier name="gd" template="tier-morph" itemtype="gls" lang="de" sep="-" cleanup="gloss"/>
        <tier name="hn" template="tier-morph" itemtype="hn" lang="en" sep="-" cleanup="none"/>
        <tier name="mc" template="tier-morph" itemtype="msa" lang="en" sep="-" cleanup="none"/>
        <tier name="ps" template="tier-word" itemtype="pos" lang="en" cleanup="none"/>
        <tier name="SeR" template="tier-word-new" />
        <tier name="SyF" template="tier-word-new" />
        <tier name="IST" template="tier-word-new" />
        <tier name="Top" template="tier-word-new" />
        <tier name="Foc" template="tier-word-new" />
        <tier name="fe" template="tier-sent" itemtype="gls" lang="en" cleanup="brackets"/>
        <tier name="fg" template="tier-sent" itemtype="gls" lang="de" cleanup="brackets"/>
        <tier name="fr" template="tier-sent" itemtype="gls" lang="ru" cleanup="brackets"/>
        <tier name="ltr" template="tier-sent" itemtype="lit" lang="ru" cleanup="brackets"/>
        <tier name="nt" template="tier-sent" itemtype="note" lang="en" cleanup="brackets"/>
    </tiers>
    </project>
    <project id="xas">
    <project-name value="Kamassian"/>
    <speaker-code position="1"/>
    <text-name from-item="title-abbreviation" from-lang="en"/>
    <tiers>
        <baseline lang="xas"/>
        <tier name="ref" template="tier-sent" itemtype="segnum" lang="en" cleanup="renum"/>
        <tier name="st" template="tier-sent" itemtype="lit" lang="xas-x-source" cleanup="brackets"/>
        <tier name="ts" template="tier-sent-join" cleanup="brackets"/>
        <tier name="tx" template="tier-tx" itemtype="txt" cleanup="tx"/>
        <tier name="mb" template="tier-morph" sep="" cleanup="morph"/>
        <tier name="mp" template="tier-morph" itemtype="cf" sep="" cleanup="morph"/>
        <tier name="ge" template="tier-morph" itemtype="gls" lang="en" sep="-" cleanup="gloss"/>
        <tier name="hn" template="tier-morph" itemtype="hn" lang="en" sep="-" cleanup="none"/>
        <tier name="mc" template="tier-morph" itemtype="msa" lang="en" sep="-" cleanup="none"/>
        <tier name="ps" template="tier-word" itemtype="pos" lang="en" cleanup="none"/>
        <tier name="SeR" template="tier-word-new" />
        <tier name="SyF" template="tier-word-new" />
        <tier name="IST" template="tier-word-new" />
        <tier name="Top" template="tier-word-new" />
        <tier name="Foc" template="tier-word-new" />
        <tier name="fe" template="tier-sent" itemtype="gls" lang="en" cleanup="brackets"/>
        <tier name="fg" template="tier-sent" itemtype="gls" lang="de" cleanup="brackets"/>
        <tier name="fr" template="tier-sent" itemtype="gls" lang="ru" cleanup="brackets"/>
        <tier name="fo" template="tier-sent" itemtype="lit" lang="de-x-source" cleanup="brackets"/>
        <tier name="nt" template="tier-sent" itemtype="note" lang="en" cleanup="brackets"/>
    </tiers>
    </project>
    <project id="sel">
    <project-name value="Selkup"/>
    <speaker-code position="1"/>
    <text-name from-item="title-abbreviation" from-lang="en"/>
        <tiers>
        <baseline lang="sel"/>
        <!-- Tier parameters -->
        <!-- name: used as tier name in EXMARaLDA ('display'), also as 'cat' -->
        <!-- template: template to call for creating this tier -->
        <!-- itemtype: item/@type in flextext, passed as template param; default='txt' -->
        <!-- lang: item/@lang in flextext, passed as template param; default=baseline -->
        <!-- Sentence tiers -->
        <tier name="ref" template="tier-sent" itemtype="segnum" lang="en" cleanup="renum"/>
        <tier name="st" template="tier-sent" itemtype="lit" lang="sel-Cyrl-x-source" cleanup="brackets"/>
        <tier name="stl" template="tier-sent" itemtype="lit" lang="sel-Latn-x-source" cleanup="brackets"/>
        <tier name="ts" template="tier-sent-join" cleanup="brackets"/>
        <tier name="tx" template="tier-tx" itemtype="txt" cleanup="tx"/>
        <tier name="mb" template="tier-morph" sep="" cleanup="morph"/>
        <tier name="mp" template="tier-morph" itemtype="cf" sep="" cleanup="morph"/>
        <tier name="ge" template="tier-morph" itemtype="gls" lang="en" sep="-" cleanup="gloss"/>
        <tier name="gr" template="tier-morph" itemtype="gls" lang="ru" sep="-" cleanup="gloss"/>
        <tier name="hn" template="tier-morph" itemtype="hn" lang="en" sep="-" cleanup="none"/>
        <tier name="mc" template="tier-morph" itemtype="msa" lang="en" sep="-" cleanup="none"/>
        <tier name="ps" template="tier-word" itemtype="pos" lang="en" cleanup="none"/>
        <tier name="SeR" template="tier-word-new" />
        <tier name="SyF" template="tier-word-new" />
        <tier name="IST" template="tier-word-new" />
        <tier name="fr" template="tier-sent" itemtype="gls" lang="ru" cleanup="brackets"/>
        <tier name="fe" template="tier-sent" itemtype="gls" lang="en" cleanup="brackets"/>
        <tier name="fg" template="tier-sent" itemtype="gls" lang="de" cleanup="brackets"/>
        <tier name="ltr" template="tier-sent" itemtype="lit" lang="ru" cleanup="brackets"/>
        <tier name="lto" template="tier-sent" itemtype="gls" lang="sel-Cyrl-x-source" cleanup="brackets"/>
        <tier name="nt" template="tier-sent" itemtype="note" lang="en" cleanup="brackets"/>
        <tier name="nto" template="tier-sent" itemtype="note" lang="sel-Cyrl-x-source" cleanup="brackets"/>
    </tiers>
    </project>
    <project id="kca">
    <project-name value="Khanty"/>
    <speaker-code position="1"/>
    <text-name from-item="title-abbreviation" from-lang="en"/>
        <tiers>
        <baseline lang="kca"/>
        <!-- Tier parameters -->
        <!-- name: used as tier name in EXMARaLDA ('display'), also as 'cat' -->
        <!-- template: template to call for creating this tier -->
        <!-- itemtype: item/@type in flextext, passed as template param; default='txt' -->
        <!-- lang: item/@lang in flextext, passed as template param; default=baseline -->
        <!-- Sentence tiers -->
        <tier name="ref" template="tier-sent" itemtype="segnum" lang="en" cleanup="renum"/>
        <tier name="st" template="tier-sent" itemtype="lit" lang="sel-Cyrl-x-source" cleanup="brackets"/>
        <tier name="stl" template="tier-sent" itemtype="lit" lang="sel-Latn-x-source" cleanup="brackets"/>
        <tier name="ts" template="tier-sent-join" cleanup="brackets"/>
        <tier name="tx" template="tier-tx" itemtype="txt" cleanup="tx"/>
        <tier name="mb" template="tier-morph" sep="" cleanup="morph"/>
        <tier name="mp" template="tier-morph" itemtype="cf" sep="" cleanup="morph"/>
        <tier name="ge" template="tier-morph" itemtype="gls" lang="en" sep="-" cleanup="gloss"/>
        <tier name="gd" template="tier-morph" itemtype="gls" lang="de" sep="-" cleanup="gloss"/>
        <tier name="hn" template="tier-morph" itemtype="hn" lang="en" sep="-" cleanup="none"/>
        <tier name="mc" template="tier-morph" itemtype="msa" qlang="en" sep="-" cleanup="none"/>
        <tier name="ps" template="tier-word" itemtype="pos" lang="en" cleanup="none"/>
        <tier name="SeR" template="tier-word-new" />
        <tier name="SyF" template="tier-word-new" />
        <tier name="IST" template="tier-word-new" />
        <tier name="fr" template="tier-sent" itemtype="gls" lang="ru" cleanup="brackets"/>
        <tier name="fe" template="tier-sent" itemtype="gls" lang="en" cleanup="brackets"/>
        <tier name="fg" template="tier-sent" itemtype="gls" lang="de" cleanup="brackets"/>
        <tier name="ltr" template="tier-sent" itemtype="lit" lang="ru" cleanup="brackets"/>
        <tier name="lto" template="tier-sent" itemtype="gls" lang="sel-Cyrl-x-source" cleanup="brackets"/>
        <tier name="nt" template="tier-sent" itemtype="note" lang="en" cleanup="brackets"/>
        <tier name="nto" template="tier-sent" itemtype="note" lang="de" cleanup="brackets"/>
    </tiers>
    </project>
</conversion-settings>


text:
<?php
declare(strict_types=1);

namespace Tests\CarbonImmutable;

use Carbon\CarbonImmutable as Carbon;
use DateTime;
use DateTimeZone;
use Tests\AbstractTestCase;

class NowAndOtherStaticHelpersTest extends AbstractTestCase
{
    public function testNow()
    {
        $dt = Carbon::now();
        $this->assertSame($this->immutableNow->getTimestamp(), $dt->timestamp);

        Carbon::setTestNow();
        $before = $this->getTimestamp();
        $dt = Carbon::now();
        $after = $this->getTimestamp();
        $this->assertGreaterThanOrEqual($before, $dt->timestamp);
        $this->assertLessThanOrEqual($after, $dt->timestamp);
    }

    public function testGetPreciseTimestamp()
    {
        $dt = Carbon::parse('2018-01-06 12:34:10.987126');
        $this->assertSame(1515260.0, $dt->getPreciseTimestamp(-3));
        $this->assertSame(151526005.0, $dt->getPreciseTimestamp(-1));
        $this->assertSame(1515260051.0, $dt->getPreciseTimestamp(0));
        $this->assertSame(15152600510.0, $dt->getPreciseTimestamp(1));
        $this->assertSame(151526005099.0, $dt->getPreciseTimestamp(2));
        $this->assertSame(1515260050987.0, $dt->valueOf());
        $this->assertSame(15152600509871.0, $dt->getPreciseTimestamp(4));
        $this->assertSame(151526005098713.0, $dt->getPreciseTimestamp(5));
        $this->assertSame(1515260050987126.0, $dt->getPreciseTimestamp(6));
        $this->assertSame(151526005098712600.0, $dt->getPreciseTimestamp(8));
        $this->assertSame(1515260050987126000.0, $dt->getPreciseTimestamp(9));
    }

    public function testNowWithTimezone()
    {
        $dt = Carbon::now('Europe/London');
        $this->assertSame($this->immutableNow->getTimestamp(), $dt->timestamp);

        Carbon::setTestNow();
        $before = $this->getTimestamp();
        $dt = Carbon::now('Europe/London');
        $after = $this->getTimestamp();
        $this->assertGreaterThanOrEqual($before, $dt->timestamp);
        $this->assertLessThanOrEqual($after, $dt->timestamp);
        $this->assertSame('Europe/London', $dt->tzName);
    }

    public function testToday()
    {
        $dt = Carbon::today();
        $this->assertSame(date('Y-m-d 00:00:00'), $dt->toDateTimeString());
    }

    public function testTodayWithTimezone()
    {
        $dt = Carbon::today('Europe/London');
        $dt2 = new DateTime('now', new DateTimeZone('Europe/London'));
        $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString());
    }

    public function testTomorrow()
    {
        $dt = Carbon::tomorrow();
        $dt2 = new DateTime('tomorrow');
        $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString());
    }

    public function testTomorrowWithTimezone()
    {
        $dt = Carbon::tomorrow('Europe/London');
        $dt2 = new DateTime('tomorrow', new DateTimeZone('Europe/London'));
        $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString());
    }

    public function testYesterday()
    {
        $dt = Carbon::yesterday();
        $dt2 = new DateTime('yesterday');
        $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString());
    }

    public function testYesterdayWithTimezone()
    {
        $dt = Carbon::yesterday('Europe/London');
        $dt2 = new DateTime('yesterday', new DateTimeZone('Europe/London'));
        $this->assertSame($dt2->format('Y-m-d 00:00:00'), $dt->toDateTimeString());
    }

    public function testMinValue()
    {
        $this->assertLessThanOrEqual(-2147483647, Carbon::minValue()->getTimestamp());
    }

    public function testMaxValue()
    {
        $this->assertGreaterThanOrEqual(2147483647, Carbon::maxValue()->getTimestamp());
    }
}


text:
    {{> checkSessionIframe}}

<template name="checkSessionIframe">
    {{#if checkSession}}

        {{setOrder}}
    {{/if}}
</template>


text:
namespace naive {
namespace wayland {

TextInput::TextInput(wl_resource* resource) : text_input_resource_{resource} {}

void TextInput::SetSurface(Surface* surface) {
  if (surface_ == surface)
    return;
  if (surface_)
    surface_->RemoveSurfaceObserver(this);
  surface_ = surface;
  if (!surface_)
    return;
  surface->AddSurfaceObserver(this);
}

TextInput::~TextInput() {
  if (surface_)
    surface_->RemoveSurfaceObserver(this);
  if (input_method_context_)
    input_method_context_->NotifyTextInputDestroyed(this);
}

void TextInput::SetInputMethodContext(
    InputMethodContext* input_method_context) {
  input_method_context_ = input_method_context;
}

void TextInput::SendEnter() {
  zwp_text_input_v1_send_enter(text_input_resource_, surface_->resource());
}

void TextInput::SendLeave() {
  zwp_text_input_v1_send_leave(text_input_resource_);
}

void TextInput::OnSurfaceDestroyed(Surface* surface) {
  if (surface == surface_)
    surface_ = nullptr;
}

InputMethodContext::InputMethodContext(wl_resource* resource,
                                       TextInput* text_input,
                                       InputMethod* input_method)
    : text_input_{text_input},
      context_resource_{resource},
      input_method_{input_method} {}

InputMethodContext::~InputMethodContext() {
  TRACE();
  input_method_->NotifyInputContextDestroyed(this);
  if (text_input_ && text_input_->input_method_context() == this) {
    text_input_->SetInputMethodContext(nullptr);
    text_input_->SendLeave();
  }
}

void InputMethodContext::Reset() {
  zwp_input_method_context_v1_send_reset(context_resource_);
}

void InputMethodContext::Leave() {
  if (text_input_)
    text_input_->SendLeave();
}

void InputMethodContext::Enter() {
  if (text_input_)
    text_input_->SendEnter();
}

void InputMethodContext::NotifyTextInputDestroyed(TextInput* text_input) {
  if (text_input == text_input_)
    text_input_ = nullptr;
}

InputMethod::InputMethod(Seat* seat) : seat_{seat} {}

void InputMethod::ShowPanels(bool show) {
  auto* top_level = wm::WindowManager::Get()->input_panel_top_level();
  auto* overlay = wm::WindowManager::Get()->input_panel_overlay();
  if (top_level && overlay) {
    overlay->set_visible(show);
    top_level->set_visible(show);
  }
}

void InputMethod::Activate(InputMethodContext* context) {
  TRACE();
  if (context == input_method_context_)
    return;
  if (input_method_context_)
    input_method_context_->Leave();
  input_method_context_ = context;
  if (!context)
    return;
  zwp_input_method_v1_send_activate(input_method_resource_,
                                    context->resource());
  context->Enter();
}

void InputMethod::Deactivate() {
  if (input_method_context_) {
    input_method_context_->Leave();
    zwp_input_method_v1_send_deactivate(input_method_resource_,
                                        input_method_context_->resource());
  }
}

void InputMethod::NotifyInputContextDestroyed(InputMethodContext* context) {
  if (context == input_method_context_)
    input_method_context_ = nullptr;
}

void InputMethod::NotifyFocusedSurfaceChanged(Surface* surface) {
  if (input_method_context_ && input_method_context_->text_input() &&
      input_method_context_->text_input()->surface() != surface) {
    Deactivate();
  }
}

void InputMethod::SetBinding(wl_resource* resource) {
  TRACE("Binding %p", resource);
  input_method_resource_ = resource;
}

}  // namespace wayland
}  // namespace naive


text:
layout:     	post
officer: 		true
name:      		Ellie Cheng
position: 		Webmaster
hometown: 		Folsom, CA
alma_mater:
advisor:
header-img: 	"img/officers/ellie.jpg"
active: 		false
year:  			2020
email:
department: 	Computer Science
---

# Bio and Interests
I'm a 3nd year Computer Science and Engineering undergrad student interested in Artificial Intelligence. I like reading novels, drawing, and parrots.


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

<meta name="generator" content="JDiff v1.1.0">

<meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared.">
<meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet">
<TITLE>
API Change Statistics
</TITLE>
<link href="../../../../assets/android-developer-docs.css" rel="stylesheet" type="text/css" />
<link href="../stylesheet-jdiff.css" rel="stylesheet" type="text/css" />

<nobr>Android Developers | Android.com</nobr>

        API Diff Specification

        To Level:
        16

        From Level:
        15

        Generated
        2012.07.16 10:58

        Top of Report

API Change Statistics

The overall difference between API Levels 15 and 16 is approximately 2.52%.

Total of Differences, by Number and Type

The table below lists the numbers of program elements (packages, classes, constructors, methods, and fields) that were added, changed, or removed. The table includes only the highest-level program elements — that is, if a class with two methods was added, the number of methods added does not include those two methods, but the number of classes added does include that class.

  Type
  Additions
  Changes
  Removals
  Total

  Packages
  4
  39
  0
  43

  Classes and Interfaces
  57
  211
  0
  268

  Constructors
  12
  22
  4
  38

  Methods
  381
  151
  20
  552

  Fields
  171
  46
  4
  221

  Total
  625
  469
  28
  1122

Changed Packages, Sorted by Percentage Difference

  Percentage Difference*
  Package

  34
  android.accessibilityservice

  23
  android.media

  20
  android.renderscript

  17
  android.view.textservice

  16
  android.net.wifi.p2p

  12
  android.view.accessibility

  11
  junit.framework

  10
  android.nfc

  7
  android.database.sqlite

  7
  android.appwidget

  7
  android.media.audiofx

  6
  android.animation

  5
  android.app

  4
  android.drm

  4
  android.database

  4
  android.view

  3
  android.os

  3
  android.test

  2
  android.service.textservice

  2
  android.webkit

  2
  android.hardware

  2
  android.content

  1
  android.security

  1
  android.graphics

  1
  junit.runner

  1
  android.widget

  1
  android.util

  1
  android.content.pm

  <1
  android.nfc.tech

  <1
  android.provider

  <1
  android.speech

  <1
  android.net

  <1
  android.text

  <1
  android.content.res

  <1
  android.test.mock

  <1
  android.graphics.drawable

  <1
  android

  <1
  android.view.inputmethod

  <1
  android.bluetooth

* See Calculation of Change Percentages, below.

Changed Classes and Interfaces, Sorted by Percentage Difference

  Percentage
Difference*
  Class or Interface

  100

android.renderscript.ProgramVertex

  100

android.renderscript.ProgramVertexFixedFunction

  77

android.renderscript.Mesh.Builder

  75

android.os.Vibrator

  70

android.renderscript.Font

  66

android.renderscript.FileA3D

  66

android.renderscript.RenderScriptGL.SurfaceConfig

  62

android.renderscript.ProgramRaster

  60

android.accessibilityservice.AccessibilityService

  59

android.renderscript.Mesh.TriangleMeshBuilder

  59

android.renderscript.RSSurfaceView

  58

android.renderscript.RSTextureView

  52

android.renderscript.ProgramStore

  50

android.drm.DrmStore

  50

android.graphics.AvoidXfermode

  50

android.graphics.PixelXorXfermode

  50

android.renderscript.FileA3D.IndexEntry

  50

android.renderscript.Mesh

  50

android.renderscript.Mesh.AllocationBuilder

  50

android.renderscript.ProgramFragment.Builder

  50

android.renderscript.ProgramFragmentFixedFunction.Builder

  50

android.renderscript.ProgramRaster.Builder

  50

android.renderscript.ProgramVertex.Builder

  50

android.renderscript.ProgramVertexFixedFunction.Builder

  50

android.renderscript.ProgramVertexFixedFunction.Constants

  50

android.renderscript.RenderScriptGL

  50

android.test.ComparisonFailure

  50

android.view.ViewDebug

  50

junit.framework.ComparisonFailure

  46

android.view.ActionProvider

  45

android.renderscript.Program

  44

android.database.ContentObservable

  40

android.database.ContentObserver

  40

android.database.sqlite.SQLiteProgram

  38

android.widget.CalendarView

  35

android.widget.Switch

  33

android.view.textservice.SpellCheckerSession

  33

android.view.textservice.SpellCheckerSession.SpellCheckerSessionListener

  33

android.webkit.JsResult

  31

junit.framework.TestSuite

  29

android.renderscript.Sampler

  29

android.widget.Spinner

  26

android.net.wifi.p2p.WifiP2pManager

  25

android.app.KeyguardManager

  25

android.renderscript.FileA3D.EntryType

  25

android.renderscript.Font.Style

  25

android.renderscript.Mesh.Primitive

  25

android.renderscript.ProgramFragmentFixedFunction.Builder.EnvMode

  25

android.renderscript.ProgramFragmentFixedFunction.Builder.Format

  25

android.renderscript.ProgramRaster.CullMode

  25

android.test.AssertionFailedError

  25

android.view.ViewDebug.HierarchyTraceType

  25

android.view.ViewDebug.RecyclerTraceType

  25

junit.framework.AssertionFailedError

  23

android.content.ClipData.Item

  23

android.content.AsyncTaskLoader

  23

android.content.ComponentCallbacks2

  23

android.database.sqlite.SQLiteClosable

  22

android.view.accessibility.AccessibilityNodeInfo

  21

android.provider.UserDictionary.Words

  20

android.appwidget.AppWidgetManager

  20

android.database.SQLException

  20

android.database.sqlite.SQLiteException

  20

android.media.MediaRecorder.AudioEncoder

  20

android.nfc.FormatException

  17

android.animation.LayoutTransition

  16

android.view.ViewTreeObserver

  16

android.widget.ImageView

  15

android.media.MediaRecorder.OutputFormat

  14

android.provider.ContactsContract.PhoneLookupColumns

  14

android.test.InstrumentationTestSuite

  14

android.text.Html

  13

android.widget.GridView

  13

android.content.pm.PermissionInfo

  13

android.drm.DrmSupportInfo

  12

android.app.Notification.Builder

  12

android.graphics.SurfaceTexture

  12

android.nfc.NdefMessage

  12

android.provider.MediaStore.MediaColumns

  12

android.nfc.NdefRecord

  11

android.nfc.NfcAdapter

  11

android.media.MediaPlayer

  11

android.graphics.Camera

  11

android.provider.CalendarContract

  11

android.view.View.AccessibilityDelegate

  11

android.view.textservice.SpellCheckerSubtype

  11

android.widget.CheckedTextView

  10

android.view.accessibility.AccessibilityEvent

  10

android.drm.DrmStore.DrmObjectType

  10

android.drm.DrmStore.Playback

  10

android.drm.DrmStore.RightsStatus

  9

android.content.Loader

  9

android.app.Notification

  9

android.appwidget.AppWidgetHostView

  9

android.database.sqlite.SQLiteOpenHelper

  9

android.view.ActionMode

  9

android.view.InputEvent

  9

android.view.ViewStub

  8

android.graphics.PixelFormat

  8

android.database.sqlite.SQLiteStatement

  8

android.accessibilityservice.AccessibilityServiceInfo

  8

android.database.sqlite.SQLiteDatabase

  8

android.media.audiofx.Visualizer

  7

android.renderscript.Element

  7

android.appwidget.AppWidgetProvider

  7

android.provider.ContactsContract.DataUsageFeedback

  7

android.webkit.GeolocationPermissions

  7

android.renderscript.Allocation

  7

android.content.ClipData

  7

android.webkit.WebIconDatabase

  7

android.widget.SearchView

  6

android.net.SSLCertificateSocketFactory

  6

android.nfc.tech.IsoDep

  6

android.webkit.WebStorage

  6

android.content.pm.PackageInfo

  6

android.widget.TextView

  5

android.app.ActivityManager.MemoryInfo

  5

android.content.pm.ServiceInfo

  5

android.graphics.drawable.GradientDrawable

  5

android.os.TokenWatcher

  5

android.provider.CalendarContract.RemindersColumns

  5

android.renderscript.Program.BaseProgramBuilder

  5

android.security.KeyChain

  5

android.service.textservice.SpellCheckerService.Session

  5

android.widget.AbsSeekBar

  5

android.widget.AdapterViewFlipper

  5

android.view.View

  5

android.drm.DrmStore.Action

  5

junit.framework.Assert

  5

android.provider.ContactsContract.CommonDataKinds.Phone

  5

android.view.KeyCharacterMap

  5

android.view.ViewPropertyAnimator

  5

android.widget.RemoteViews

  5

junit.runner.BaseTestRunner

  4

android.media.AudioManager

  4

android.provider.CalendarContract.AttendeesColumns

  4

android.view.ViewParent

  4

android.widget.FrameLayout

  4

junit.framework.TestResult

  4

android.app.Activity

  4

android.webkit.CookieManager

  4

android.app.ActivityManager

  4

android.app.PendingIntent

  4

android.graphics.Canvas

  4

android.os.StrictMode.VmPolicy.Builder

  4

android.view.Display

  4

android.app.WallpaperManager

  4

android.webkit.WebView.HitTestResult

  4

android.renderscript.Script

  3

android.content.ContentProviderClient

  3

android.widget.Gallery

  3

android.content.ClipDescription

  3

android.view.InputDevice

  3

android.net.ConnectivityManager

  3

android.media.AudioRecord

  3

android.speech.RecognizerIntent

  3

android.provider.ContactsContract.Contacts

  3

android.util.DisplayMetrics

  2

android.os.Build.VERSION_CODES

  2

android.widget.GridLayout

  2

android.media.MediaRecorder

  2

android.Manifest.permission

  2

android.database.sqlite.SQLiteQueryBuilder

  2

android.provider.CalendarContract.EventsColumns

  2

android.view.TextureView

  2

android.content.Context

  2

android.app.DownloadManager.Request

  2

android.content.ContentResolver

  2

android.webkit.WebView

  2

android.content.res.Resources

  2

android.app.ActivityManager.RunningAppProcessInfo

  2

android.app.SearchManager

  2

android.os.ParcelFileDescriptor

  1

android.test.mock.MockContext

  1

android.webkit.WebSettings

  1

android.widget.RelativeLayout

  1

android.content.ContextWrapper

  1

android.content.res.Configuration

  1

android.database.AbstractCursor

  1

android.widget.AdapterViewAnimator

  1

android.content.Intent

  1

android.widget.LinearLayout

  1

android.content.ContentProvider

  1

android.os.Process

  1

android.drm.DrmManagerClient

  1

android.database.CursorWindow

  1

android.view.Gravity

  1

android.app.Fragment

  1

android.hardware.Camera

  1

android.view.KeyEvent

  1

android.view.inputmethod.EditorInfo

  1

android.provider.Settings

  1

android.net.Uri

  1

android.view.inputmethod.InputMethodManager

  1

android.database.Cursor

  1

android.widget.AutoCompleteTextView

  1

android.view.accessibility.AccessibilityRecord

  1

android.bluetooth.BluetoothAdapter

  1

android.graphics.Paint

  <1

android.content.pm.ActivityInfo

  <1

android.view.ViewGroup

  <1

android.provider.Settings.Secure

  <1

android.hardware.SensorManager

  <1

android.R.attr

  <1

android.media.ToneGenerator

  <1

android.R.style

  <1

android.provider.Settings.System

  <1

android.content.pm.PackageManager

  <1

android.database.sqlite.SQLiteQuery

  <1

android.renderscript.ProgramFragment

  <1

android.renderscript.ProgramFragmentFixedFunction

* See Calculation of Change Percentages, below.

Calculation of Change Percentages

The percent change statistic reported for all elements in the "to" API Level specification is defined recursively as follows:

Percentage difference = 100 * (added + removed + 2*changed)
                        -----------------------------------
                        sum of public elements in BOTH APIs

where added is the number of packages added, removed is the number of packages removed, and changed is the number of packages changed.
This definition is applied recursively for the classes and their program elements, so the value for a changed package will be less than 1, unless every class in that package has changed.
The definition ensures that if all packages are removed and all new packages are
added, the change will be 100%.

        Except as noted, this content is licensed under
         Creative Commons Attribution 2.5.
        For details and restrictions, see the Content License.

        Site Terms of Service -
        Privacy Policy -
        Brand Guidelines


text:
require('./angular-locale_kl-gl');
module.exports = 'ngLocale';