text:
package io.electrum.prepaidutility.model;

import io.electrum.vas.Utils;
import io.electrum.vas.model.Customer;
import io.electrum.vas.model.LedgerAmount;
import io.electrum.vas.model.Transaction;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/**
 * Represents a response to a meter lookup request
 */
@ApiModel(description = "Represents a response to a meter lookup request")
@JsonInclude(Include.NON_NULL)
public class MeterLookupResponse extends Transaction {

   private Meter meter = null;
   private Customer customer = null;
   private Utility utility = null;
   private LedgerAmount minAmount = null;
   private LedgerAmount maxAmount = null;
   private LedgerAmount arrearsAmount = null;
   private Boolean bsstDue = null;

   public MeterLookupResponse meter(Meter meter) {
      this.meter = meter;
      return this;
   }

   /**
    * Details of the meter.
    *
    * @return meter
    **/
   @ApiModelProperty(required = true, value = "Details of the meter.")
   @NotNull
   @Valid
   public Meter getMeter() {
      return meter;
   }

   public void setMeter(Meter meter) {
      this.meter = meter;
   }

   public MeterLookupResponse customer(Customer customer) {
      this.customer = customer;
      return this;
   }

   /**
    * Details of the person or organization to whom the meter belongs.
    *
    * @return customer
    **/
   @ApiModelProperty(required = true, value = "Details of the person or organization to whom the meter belongs.")
   @NotNull
   @Valid
   public Customer getCustomer() {
      return customer;
   }

   public void setCustomer(Customer customer) {
      this.customer = customer;
   }

   public MeterLookupResponse utility(Utility utility) {
      this.utility = utility;
      return this;
   }

   /**
    * Details of the utility which manages this meter's account.
    *
    * @return utility
    **/
   @ApiModelProperty(required = true, value = "Details of the utility which manages this meter's account.")
   @NotNull
   @Valid
   public Utility getUtility() {
      return utility;
   }

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

   public MeterLookupResponse minAmount(LedgerAmount minAmount) {
      this.minAmount = minAmount;
      return this;
   }

   /**
    * Minimum purchase amount that can be requested by the customer.
    *
    * @return minAmount
    **/
   @ApiModelProperty(value = "Minimum purchase amount that can be requested by the customer.")
   @Valid
   public LedgerAmount getMinAmount() {
      return minAmount;
   }

   public void setMinAmount(LedgerAmount minAmount) {
      this.minAmount = minAmount;
   }

   public MeterLookupResponse maxAmount(LedgerAmount maxAmount) {
      this.maxAmount = maxAmount;
      return this;
   }

   /**
    * Maximum purchase amount that can be requested by the customer.
    *
    * @return maxAmount
    **/
   @ApiModelProperty(value = "Maximum purchase amount that can be requested by the customer.")
   @Valid
   public LedgerAmount getMaxAmount() {
      return maxAmount;
   }

   public void setMaxAmount(LedgerAmount maxAmount) {
      this.maxAmount = maxAmount;
   }

   public MeterLookupResponse arrearsAmount(LedgerAmount arrearsAmount) {
      this.arrearsAmount = arrearsAmount;
      return this;
   }

   /**
    * Returned arrears amount from provider.
    *
    * @return arrearsAmount
    **/
   @ApiModelProperty(value = "Returned arrears amount from provider. Encapsulates the total debt outstanding.")
   @Valid
   public LedgerAmount getArrearsAmount() {
      return arrearsAmount;
   }

   public void setArrearsAmount(LedgerAmount arrearsAmount) {
      this.arrearsAmount = arrearsAmount;
   }

   public MeterLookupResponse bsstDue(Boolean bsstDue) {
      this.bsstDue = bsstDue;
      return this;
   }

   /**
    * Boolean flag indicating whether a free basic service support token is owing on this meter. Not all meters support
    * this and typically only one free token is issued per calendar month. If the value of this field is true, then a
    * purchase request with an amount of 0 can be sent and the response will contain the free token.
    *
    * @return bsstDue
    **/
   @ApiModelProperty(value = "Boolean flag indicating whether a free basic service support token is owing on this meter. Not all meters support this and typically only one free token is issued per calendar month. If the value of this field is true, then a purchase request with an amount of 0 can be sent and the response will contain the free token.")
   public Boolean getBsstDue() {
      return bsstDue;
   }

   public void setBsstDue(Boolean bsstDue) {
      this.bsstDue = bsstDue;
   }

   @Override
   public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class MeterLookupResponse {\n");
      sb.append("    id: ").append(Utils.toIndentedString(id)).append("\n");
      sb.append("    time: ").append(Utils.toIndentedString(time)).append("\n");
      sb.append("    originator: ").append(Utils.toIndentedString(originator)).append("\n");
      sb.append("    client: ").append(Utils.toIndentedString(client)).append("\n");
      sb.append("    settlementEntity: ").append(Utils.toIndentedString(settlementEntity)).append("\n");
      sb.append("    receiver: ").append(Utils.toIndentedString(receiver)).append("\n");
      sb.append("    thirdPartyIdentifiers: ").append(Utils.toIndentedString(thirdPartyIdentifiers)).append("\n");
      sb.append("    meter: ").append(Utils.toIndentedString(meter)).append("\n");
      sb.append("    customer: ").append(Utils.toIndentedString(customer)).append("\n");
      sb.append("    utility: ").append(Utils.toIndentedString(utility)).append("\n");
      sb.append("    minAmount: ").append(Utils.toIndentedString(minAmount)).append("\n");
      sb.append("    maxAmount: ").append(Utils.toIndentedString(maxAmount)).append("\n");
      sb.append("    arrearsAmount: ").append(Utils.toIndentedString(arrearsAmount)).append("\n");
      sb.append("    bsstDue: ").append(Utils.toIndentedString(bsstDue)).append("\n");
      sb.append("}");
      return sb.toString();
   }
}


text:
MultipleHeaderRecyclerView
==============================
Just a way to manage multiple sections with different heads and different ViewHolder inside the same RecyclerView, Thanks to [Dario Martín] (https://twitter.com/darymlo), a crack in Android UI and fanatic of Material Design.

What is it?
-------------
__MultipleHeaderRecyclerView__ is a library for allowing you to create a RecyclerView with differents kind of sections (ViewHolders) and it's own titles in an easy way. As you can see in the example below, we have a RecyclerView with three differents kind of sections (Event, Comic and Character) and it's own titles:

![alt text](https://github.com/pabloazana/marvelsample/raw/master/multipleheaderrecyclerview/doc/ezgif.com-video-to-gif.gif "MultipleHeaderRecyclerView example")

Why?
------
Because I would like to provide an easy way to create one of this elements __without need to override__ the same methods again. I've created this __generic module__ which we could use in differents projects.

How?
------
For using MultipleHeaderRecyclerView you should follow the next steps:

* Import the MultipleHeaderRecycleView module (sorry for the obvious).
* Make the models you want to use __extends__ from __RecycleBaseModel__
* __Asign a type__ to the model. This type should be and Integer starting by 0 and it will __stablish the order__. In our example Event is the type 0, Comic the type 1 and Character the type 2.
* Create your __adapter__ extending from __RecycleBaseAdapter__ and override its methods.
* Create as much __ViewHolders__ as you need extending from __HeaderAndItemViewHolder__

In the example code you can see how I've used the module. In this [post] (http://www.agiledeveloper.ninja/2015/06/recyclerviews-with-multiple-sections.html) of my blog, you can find more details about.

Contribute, carajo!
-------------------
Please, I'm quite sure that we can do it in a more __efficient__ and __easy way__. Feel free to __contribute__!

License
-------
This project is licensed under the Apache Software License, Version 2.0.

    Copyright (c) 2015 Pablo Azaña

    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.

redpajama_set_name: RedPajamaGithub


text:
package com.google.cloud.spanner;

import com.google.cloud.ByteArray;
import com.google.cloud.Date;
import com.google.cloud.Timestamp;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.protobuf.ListValue;
import com.google.protobuf.NullValue;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;

/**
 * Represents a value to be consumed by the Cloud Spanner API. A value can be {@code NULL} or
 * non-{@code NULL}; regardless, values always have an associated type.
 *
 *
The {@code Value} API is optimized for construction, since this is the majority use-case when
 * using this class with the Cloud Spanner libraries. The factory method signatures and internal
 * representations are design to minimize memory usage and object creation while still maintaining
 * the immutability contract of this class. In particular, arrays of primitive types can be
 * constructed without requiring boxing into collections of wrapper types. The getters in this class
 * are intended primarily for test purposes, and so do not share the same performance
 * characteristics; in particular, getters for array types may be expensive.
 *
 *
{@code Value} instances are immutable.
 */
@Immutable
public abstract class Value implements Serializable {
  private static final int MAX_DEBUG_STRING_LENGTH = 32;
  private static final String ELLIPSIS = "...";
  private static final String NULL_STRING = "NULL";
  private static final char LIST_SEPERATOR = ',';
  private static final char LIST_OPEN = '[';
  private static final char LIST_CLOSE = ']';
  private static final long serialVersionUID = -5289864325087675338L;

  /**
   * Returns a {@code BOOL} value.
   *
   * @param v the value, which may be null
   */
  public static Value bool(@Nullable Boolean v) {
    return new BoolImpl(v == null, v == null ? false : v);
  }

  /** Returns a {@code BOOL} value. */
  public static Value bool(boolean v) {
    return new BoolImpl(false, v);
  }

  /**
   * Returns an {@code INT64} value.
   *
   * @param v the value, which may be null
   */
  public static Value int64(@Nullable Long v) {
    return new Int64Impl(v == null, v == null ? 0 : v);
  }

  /** Returns an {@code INT64} value. */
  public static Value int64(long v) {
    return new Int64Impl(false, v);
  }

  /**
   * Returns a {@code FLOAT64} value.
   *
   * @param v the value, which may be null
   */
  public static Value float64(@Nullable Double v) {
    return new Float64Impl(v == null, v == null ? 0 : v);
  }

  /** Returns a {@code FLOAT64} value. */
  public static Value float64(double v) {
    return new Float64Impl(false, v);
  }

  /**
   * Returns a {@code STRING} value.
   *
   * @param v the value, which may be null
   */
  public static Value string(@Nullable String v) {
    return new StringImpl(v == null, v);
  }

  /**
   * Returns a {@code BYTES} value.
   *
   * @param v the value, which may be null
   */
  public static Value bytes(@Nullable ByteArray v) {
    return new BytesImpl(v == null, v);
  }

  /** Returns a {@code TIMESTAMP} value. */
  public static Value timestamp(@Nullable Timestamp v) {
    return new TimestampImpl(v == null, v);
  }

  /**
   * Returns a {@code DATE} value. The range [1678-01-01, 2262-01-01) is the legal interval for
   * cloud spanner dates. A write to a date column is rejected if the value is outside of that
   * interval.
   */
  public static Value date(@Nullable Date v) {
    return new DateImpl(v == null, v);
  }

  // TODO(user): Implement struct()/structArray().

  /**
   * Returns an {@code ARRAY<BOOL>} value.
   *
   * @param v the source of element values, which may be null to produce a value for which {@code
   *     isNull()} is {@code true}
   */
  public static Value boolArray(@Nullable boolean[] v) {
    return boolArray(v, 0, v == null ? 0 : v.length);
  }

  /**
   * Returns an {@code ARRAY<BOOL>} value that takes its elements from a region of an array.
   *
   * @param v the source of element values, which may be null to produce a value for which {@code
   *     isNull()} is {@code true}
   * @param pos the start position of {@code v} to copy values from. Ignored if {@code v} is {@code
   *     null}.
   * @param length the number of values to copy from {@code v}. Ignored if {@code v} is {@code
   *     null}.
   */
  public static Value boolArray(@Nullable boolean[] v, int pos, int length) {
    return boolArrayFactory.create(v, pos, length);
  }

  /**
   * Returns an {@code ARRAY<BOOL>} value.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value boolArray(@Nullable Iterable<Boolean> v) {
    // TODO(user): Consider memory optimizing boolArray() to use BitSet instead of boolean[].
    return boolArrayFactory.create(v);
  }

  /**
   * Returns an {@code ARRAY<INT64>} value.
   *
   * @param v the source of element values, which may be null to produce a value for which {@code
   *     isNull()} is {@code true}
   */
  public static Value int64Array(@Nullable long[] v) {
    return int64Array(v, 0, v == null ? 0 : v.length);
  }

  /**
   * Returns an {@code ARRAY<INT64>} value that takes its elements from a region of an array.
   *
   * @param v the source of element values, which may be null to produce a value for which {@code
   *     isNull()} is {@code true}
   * @param pos the start position of {@code v} to copy values from. Ignored if {@code v} is {@code
   *     null}.
   * @param length the number of values to copy from {@code v}. Ignored if {@code v} is {@code
   *     null}.
   */
  public static Value int64Array(@Nullable long[] v, int pos, int length) {
    return int64ArrayFactory.create(v, pos, length);
  }

  /**
   * Returns an {@code ARRAY<INT64>} value.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value int64Array(@Nullable Iterable<Long> v) {
    return int64ArrayFactory.create(v);
  }

  /**
   * Returns an {@code ARRAY<FLOAT64>} value.
   *
   * @param v the source of element values, which may be null to produce a value for which {@code
   *     isNull()} is {@code true}
   */
  public static Value float64Array(@Nullable double[] v) {
    return float64Array(v, 0, v == null ? 0 : v.length);
  }

  /**
   * Returns an {@code ARRAY<FLOAT64>} value that takes its elements from a region of an array.
   *
   * @param v the source of element values, which may be null to produce a value for which {@code
   *     isNull()} is {@code true}
   * @param pos the start position of {@code v} to copy values from. Ignored if {@code v} is {@code
   *     null}.
   * @param length the number of values to copy from {@code v}. Ignored if {@code v} is {@code
   *     null}.
   */
  public static Value float64Array(@Nullable double[] v, int pos, int length) {
    return float64ArrayFactory.create(v, pos, length);
  }

  /**
   * Returns an {@code ARRAY<FLOAT64>} value.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value float64Array(@Nullable Iterable<Double> v) {
    return float64ArrayFactory.create(v);
  }

  /**
   * Returns an {@code ARRAY<STRING>} value.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value stringArray(@Nullable Iterable<String> v) {
    return new StringArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
  }

  /**
   * Returns an {@code ARRAY<BYTES>} value.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value bytesArray(@Nullable Iterable<ByteArray> v) {
    return new BytesArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
  }

  /**
   * Returns an {@code ARRAY<TIMESTAMP>} value.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value timestampArray(@Nullable Iterable<Timestamp> v) {
    return new TimestampArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
  }

  /**
   * Returns an {@code ARRAY<DATE>} value. The range [1678-01-01, 2262-01-01) is the legal interval
   * for cloud spanner dates. A write to a date column is rejected if the value is outside of that
   * interval.
   *
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  public static Value dateArray(@Nullable Iterable<Date> v) {
    return new DateArrayImpl(v == null, v == null ? null : immutableCopyOf(v));
  }

  private Value() {}

  /** Returns the type of this value. This will return a type even if {@code isNull()} is true. */
  public abstract Type getType();

  /** Returns {@code true} if this instance represents a {@code NULL} value. */
  public abstract boolean isNull();

  /**
   * Returns the value of a {@code BOOL}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract boolean getBool();

  /**
   * Returns the value of a {@code INT64}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract long getInt64();

  /**
   * Returns the value of a {@code FLOAT64}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract double getFloat64();

  /**
   * Returns the value of a {@code STRING}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract String getString();

  /**
   * Returns the value of a {@code BYTES}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract ByteArray getBytes();

  /**
   * Returns the value of a {@code TIMESTAMP}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract Timestamp getTimestamp();

  /**
   * Returns the value of a {@code DATE}-typed instance.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract Date getDate();

  /**
   * Returns the value of an {@code ARRAY<BOOL>}-typed instance. While the returned list itself will
   * never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<Boolean> getBoolArray();

  /**
   * Returns the value of an {@code ARRAY<INT64>}-typed instance. While the returned list itself
   * will never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<Long> getInt64Array();

  /**
   * Returns the value of an {@code ARRAY<FLOAT64>}-typed instance. While the returned list itself
   * will never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<Double> getFloat64Array();

  /**
   * Returns the value of an {@code ARRAY<STRING>}-typed instance. While the returned list itself
   * will never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<String> getStringArray();

  /**
   * Returns the value of an {@code ARRAY<BYTES>}-typed instance. While the returned list itself
   * will never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<ByteArray> getBytesArray();

  /**
   * Returns the value of an {@code ARRAY<TIMESTAMP>}-typed instance. While the returned list itself
   * will never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<Timestamp> getTimestampArray();

  /**
   * Returns the value of an {@code ARRAY<DATE>}-typed instance. While the returned list itself will
   * never be {@code null}, elements of that list may be null.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  public abstract List<Date> getDateArray();

  @Override
  public String toString() {
    StringBuilder b = new StringBuilder();
    toString(b);
    return b.toString();
  }

  // END OF PUBLIC API.

  /**
   * Returns an {@code ARRAY<STRUCT<...>>} value.
   *
   *
This method is intentionally not in the public API for Value: {@code ARRAY<STRUCT<...>>}
   * values are not accepted by the backend.
   *
   * @param fieldTypes the types of the fields in the array elements. All non-null elements must
   *     conform to this type.
   * @param v the source of element values. This may be {@code null} to produce a value for which
   *     {@code isNull()} is {@code true}. Individual elements may also be {@code null}.
   */
  static Value structArray(Iterable<Type.StructField> fieldTypes, @Nullable Iterable<Struct> v) {
    Type elementType = Type.struct(fieldTypes);
    if (v == null) {
      return new StructArrayImpl(elementType, null);
    }
    List<Struct> values = immutableCopyOf(v);
    for (Struct value : values) {
      if (value != null && !value.getType().equals(elementType)) {
        throw new IllegalArgumentException(
            "Members of v must have type " + elementType + " (found " + value.getType() + ")");
      }
    }
    return new StructArrayImpl(elementType, values);
  }

  /**
   * Returns the value of an {@code ARRAY<STRUCT<...>>}-typed instance. While the returned list
   * itself will never be {@code null}, elements of that list may be null.
   *
   *
This method is intentionally not in the public API for Value: {@code ARRAY<STRUCT<...>>}
   * values are not accepted by the backend.
   *
   * @throws IllegalStateException if {@code isNull()} or the value is not of the expected type
   */
  abstract List<Struct> getStructArray();

  abstract void toString(StringBuilder b);

  abstract com.google.protobuf.Value toProto();

  private static <T> List<T> immutableCopyOf(Iterable<T> v) {
    ArrayList<T> copy = new ArrayList<>();
    Iterables.addAll(copy, v);
    return Collections.unmodifiableList(copy);
  }

  private abstract static class PrimitiveArrayValueFactory {
    Value create(A v, int pos, int length) {
      if (v == null) {
        return newValue(true, null, null);
      }
      A copy = newArray(length);
      System.arraycopy(v, pos, copy, 0, length);
      return newValue(false, null, copy);
    }

    Value create(@Nullable Iterable<T> v) {
      if (v == null) {
        return newValue(true, null, null);
      }
      Collection<T> values;
      if (v instanceof Collection) {
        values = (Collection<T>) v;
      } else {
        // The wrapper objects already exist (or would be created in our iterator below), and we
        // need to do the same amount of array buffering to come up with a backing array of the
        // correct size; it is as CPU-efficient to simply copy into an ArrayList (except in the rare
        // case where the underlying ArrayList buffer is exactly the size of the data - in that
        // case, we incur an additional buffer copy over managing the array ourselves).  Note that
        // this simpler strategy does use more memory for booleans though as Boolean[] uses more
        // memory than a boolean[] of the same size.
        values = Lists.newArrayList(v);
      }
      BitSet nulls = null;
      A arr = newArray(values.size());
      int i = 0;
      for (T element : values) {
        if (element == null) {
          if (nulls == null) {
            nulls = new BitSet();
          }
          nulls.set(i);
        } else {
          set(arr, i, element);
        }
        ++i;
      }
      return newValue(false, nulls, arr);
    }

    abstract A newArray(int size);

    abstract void set(A arr, int i, T value);

    abstract Value newValue(boolean isNull, BitSet nulls, A values);
  }

  private static final PrimitiveArrayValueFactory<long[], Long> int64ArrayFactory =
      new PrimitiveArrayValueFactory<long[], Long>() {
        @Override
        long[] newArray(int size) {
          return new long[size];
        }

        @Override
        void set(long[] arr, int i, Long value) {
          arr[i] = value;
        }

        @Override
        Value newValue(boolean isNull, BitSet nulls, long[] values) {
          return new Int64ArrayImpl(isNull, nulls, values);
        }
      };
  private static final PrimitiveArrayValueFactory<double[], Double> float64ArrayFactory =
      new PrimitiveArrayValueFactory<double[], Double>() {
        @Override
        double[] newArray(int size) {
          return new double[size];
        }

        @Override
        void set(double[] arr, int i, Double value) {
          arr[i] = value;
        }

        @Override
        Value newValue(boolean isNull, BitSet nulls, double[] values) {
          return new Float64ArrayImpl(isNull, nulls, values);
        }
      };
  private static final PrimitiveArrayValueFactory<boolean[], Boolean> boolArrayFactory =
      new PrimitiveArrayValueFactory<boolean[], Boolean>() {
        @Override
        boolean[] newArray(int size) {
          return new boolean[size];
        }

        @Override
        void set(boolean[] arr, int i, Boolean value) {
          arr[i] = value;
        }

        @Override
        Value newValue(boolean isNull, BitSet nulls, boolean[] values) {
          return new BoolArrayImpl(isNull, nulls, values);
        }
      };

  /** Template class for {@code Value} implementations. */
  private abstract static class AbstractValue extends Value {
    static final com.google.protobuf.Value NULL_PROTO =
        com.google.protobuf.Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build();

    private final boolean isNull;
    private final Type type;

    private AbstractValue(boolean isNull, Type type) {
      this.isNull = isNull;
      this.type = type;
    }

    @Override
    public Type getType() {
      return type;
    }

    @Override
    public final boolean isNull() {
      return isNull;
    }

    @Override
    public boolean getBool() {
      throw defaultGetter(Type.bool());
    }

    @Override
    public long getInt64() {
      throw defaultGetter(Type.int64());
    }

    @Override
    public double getFloat64() {
      throw defaultGetter(Type.float64());
    }

    @Override
    public String getString() {
      throw defaultGetter(Type.string());
    }

    @Override
    public ByteArray getBytes() {
      throw defaultGetter(Type.bytes());
    }

    @Override
    public Timestamp getTimestamp() {
      throw defaultGetter(Type.timestamp());
    }

    @Override
    public Date getDate() {
      throw defaultGetter(Type.date());
    }

    @Override
    public List<Boolean> getBoolArray() {
      throw defaultGetter(Type.array(Type.bool()));
    }

    @Override
    public List<Long> getInt64Array() {
      throw defaultGetter(Type.array(Type.int64()));
    }

    @Override
    public List<Double> getFloat64Array() {
      throw defaultGetter(Type.array(Type.float64()));
    }

    @Override
    public List<String> getStringArray() {
      throw defaultGetter(Type.array(Type.string()));
    }

    @Override
    public List<ByteArray> getBytesArray() {
      throw defaultGetter(Type.array(Type.bytes()));
    }

    @Override
    public List<Timestamp> getTimestampArray() {
      throw defaultGetter(Type.array(Type.timestamp()));
    }

    @Override
    public List<Date> getDateArray() {
      throw defaultGetter(Type.array(Type.date()));
    }

    @Override
    List<Struct> getStructArray() {
      if (getType().getCode() != Type.Code.ARRAY
          || getType().getArrayElementType().getCode() != Type.Code.STRUCT) {
        throw new IllegalStateException(
            "Illegal call to getter of incorrect type.  Expected: ARRAY<STRUCT<...>> actual: "
                + getType());
      }
      throw new AssertionError("Should have been overridden");
    }

    @Override
    final void toString(StringBuilder b) {
      // TODO(user): Truncate long arrays.
      if (isNull()) {
        b.append(NULL_STRING);
      } else {
        valueToString(b);
      }
    }

    /**
     * Appends a representation of {@code this} to {@code b}. {@code this} is guaranteed to
     * represent a non-null value.
     */
    abstract void valueToString(StringBuilder b);

    @Override
    final com.google.protobuf.Value toProto() {
      return isNull() ? NULL_PROTO : valueToProto();
    }

    /**
     * Returns a proto representation of this value. {@code this} is guaranteed to represent a
     * non-null value.
     */
    abstract com.google.protobuf.Value valueToProto();

    @Override
    public final boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (o == null || getClass() != o.getClass()) {
        return false;
      }

      AbstractValue that = (AbstractValue) o;
      if (!getType().equals(that.getType()) || isNull != that.isNull) {
        return false;
      }

      return isNull || valueEquals(that);
    }

    /**
     * Returns true if {@code v} has the same value as {@code this}. {@code v} is guaranteed to have
     * the same Java class as {@code this}, and both {@code this} and {@code v} are guaranteed to
     * represent a non-null values.
     */
    abstract boolean valueEquals(Value v);

    @Override
    public final int hashCode() {
      int result = Objects.hash(getType(), isNull);
      if (!isNull) {
        result = 31 * result + valueHash();
      }
      return result;
    }

    /**
     * Returns a hash code for the underlying value. {@code this} is guaranteed to represent a
     * non-null value.
     */
    abstract int valueHash();

    private AssertionError defaultGetter(Type expectedType) {
      checkType(expectedType);
      throw new AssertionError("Should have been overridden");
    }

    final void checkType(Type expected) {
      if (!getType().equals(expected)) {
        throw new IllegalStateException(
            "Illegal call to getter of incorrect type.  Expected: "
                + expected
                + " actual: "
                + getType());
      }
    }

    final void checkNotNull() {
      Preconditions.checkState(!isNull(), "Illegal call to getter of null value.");
    }
  }

  private static class BoolImpl extends AbstractValue {
    private final boolean value;

    private BoolImpl(boolean isNull, boolean value) {
      super(isNull, Type.bool());
      this.value = value;
    }

    @Override
    public boolean getBool() {
      checkType(Type.bool());
      checkNotNull();
      return value;
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      return com.google.protobuf.Value.newBuilder().setBoolValue(value).build();
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(value);
    }

    @Override
    boolean valueEquals(Value v) {
      return ((BoolImpl) v).value == value;
    }

    @Override
    int valueHash() {
      return Boolean.valueOf(value).hashCode();
    }
  }

  private static class Int64Impl extends AbstractValue {
    private final long value;

    private Int64Impl(boolean isNull, long value) {
      super(isNull, Type.int64());
      this.value = value;
    }

    @Override
    public long getInt64() {
      checkType(Type.int64());
      checkNotNull();
      return value;
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      return com.google.protobuf.Value.newBuilder().setStringValue(Long.toString(value)).build();
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(value);
    }

    @Override
    boolean valueEquals(Value v) {
      return ((Int64Impl) v).value == value;
    }

    @Override
    int valueHash() {
      return Long.valueOf(value).hashCode();
    }
  }

  private static class Float64Impl extends AbstractValue {
    private final double value;

    private Float64Impl(boolean isNull, double value) {
      super(isNull, Type.float64());
      this.value = value;
    }

    @Override
    public double getFloat64() {
      checkType(Type.float64());
      checkNotNull();
      return value;
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      return com.google.protobuf.Value.newBuilder().setNumberValue(value).build();
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(value);
    }

    @Override
    boolean valueEquals(Value v) {
      return ((Float64Impl) v).value == value;
    }

    @Override
    int valueHash() {
      return Double.valueOf(value).hashCode();
    }
  }

  abstract static class AbstractObjectValue<T> extends AbstractValue {
    final T value;

    private AbstractObjectValue(boolean isNull, Type type, T value) {
      super(isNull, type);
      this.value = value;
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      return com.google.protobuf.Value.newBuilder().setStringValue(value.toString()).build();
    }

    @SuppressWarnings("unchecked")
    @Override
    boolean valueEquals(Value v) {
      return ((AbstractObjectValue<T>) v).value.equals(value);
    }

    @Override
    int valueHash() {
      return value.hashCode();
    }
  }

  private static class StringImpl extends AbstractObjectValue<String> {

    private StringImpl(boolean isNull, @Nullable String value) {
      super(isNull, Type.string(), value);
    }

    @Override
    public String getString() {
      checkType(Type.string());
      checkNotNull();
      return value;
    }

    @Override
    void valueToString(StringBuilder b) {
      if (value.length() > MAX_DEBUG_STRING_LENGTH) {
        b.append(value, 0, MAX_DEBUG_STRING_LENGTH - ELLIPSIS.length()).append(ELLIPSIS);
      } else {
        b.append(value);
      }
    }
  }

  private static class BytesImpl extends AbstractObjectValue<ByteArray> {

    private BytesImpl(boolean isNull, ByteArray value) {
      super(isNull, Type.bytes(), value);
    }

    @Override
    public ByteArray getBytes() {
      checkType(Type.bytes());
      checkNotNull();
      return value;
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      return com.google.protobuf.Value.newBuilder()
          .setStringValue(value.toBase64())
          .build();
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(value.toString());
    }
  }

  private static class TimestampImpl extends AbstractObjectValue<Timestamp> {

    private TimestampImpl(boolean isNull, Timestamp value) {
      super(isNull, Type.timestamp(), value);
    }

    @Override
    public Timestamp getTimestamp() {
      checkType(Type.timestamp());
      checkNotNull();
      return value;
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(value);
    }
  }

  private static class DateImpl extends AbstractObjectValue<Date> {

    private DateImpl(boolean isNull, Date value) {
      super(isNull, Type.date(), value);
    }

    @Override
    public Date getDate() {
      checkType(Type.date());
      checkNotNull();
      return value;
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(value);
    }
  }

  private abstract static class PrimitiveArrayImpl<T> extends AbstractValue {
    private final BitSet nulls;

    private PrimitiveArrayImpl(boolean isNull, Type elementType, BitSet nulls) {
      super(isNull, Type.array(elementType));
      this.nulls = nulls;
    }

    boolean isElementNull(int i) {
      return nulls != null && nulls.get(i);
    }

    List<T> getArray() {
      checkType(getType());
      checkNotNull();
      List<T> r = new ArrayList<>(size());
      for (int i = 0; i < size(); ++i) {
        r.add(isElementNull(i) ? null : getValue(i));
      }
      return r;
    }

    abstract int size();

    abstract T getValue(int i);

    abstract com.google.protobuf.Value getValueAsProto(int i);

    @Override
    void valueToString(StringBuilder b) {
      b.append(LIST_OPEN);
      for (int i = 0; i < size(); ++i) {
        if (i > 0) {
          b.append(LIST_SEPERATOR);
        }
        if (nulls != null && nulls.get(i)) {
          b.append(NULL_STRING);
        } else {
          b.append(getValue(i));
        }
      }
      b.append(LIST_CLOSE);
    }

    @Override
    int valueHash() {
      return 31 * Objects.hashCode(nulls) + arrayHash();
    }

    abstract int arrayHash();

    @Override
    com.google.protobuf.Value valueToProto() {
      ListValue.Builder list = ListValue.newBuilder();
      for (int i = 0; i < size(); ++i) {
        if (isElementNull(i)) {
          list.addValues(NULL_PROTO);
        } else {
          list.addValues(getValueAsProto(i));
        }
      }
      return com.google.protobuf.Value.newBuilder().setListValue(list).build();
    }
  }

  private static class BoolArrayImpl extends PrimitiveArrayImpl<Boolean> {
    private final boolean[] values;

    private BoolArrayImpl(boolean isNull, BitSet nulls, boolean[] values) {
      super(isNull, Type.bool(), nulls);
      this.values = values;
    }

    @Override
    public List<Boolean> getBoolArray() {
      return getArray();
    }

    @Override
    boolean valueEquals(Value v) {
      BoolArrayImpl that = (BoolArrayImpl) v;
      return Arrays.equals(values, that.values);
    }

    @Override
    int size() {
      return values.length;
    }

    @Override
    Boolean getValue(int i) {
      return values[i];
    }

    @Override
    com.google.protobuf.Value getValueAsProto(int i) {
      return com.google.protobuf.Value.newBuilder().setBoolValue(values[i]).build();
    }

    @Override
    int arrayHash() {
      return Arrays.hashCode(values);
    }
  }

  private static class Int64ArrayImpl extends PrimitiveArrayImpl<Long> {
    private final long[] values;

    private Int64ArrayImpl(boolean isNull, BitSet nulls, long[] values) {
      super(isNull, Type.int64(), nulls);
      this.values = values;
    }

    @Override
    public List<Long> getInt64Array() {
      return getArray();
    }

    @Override
    boolean valueEquals(Value v) {
      Int64ArrayImpl that = (Int64ArrayImpl) v;
      return Arrays.equals(values, that.values);
    }

    @Override
    int size() {
      return values.length;
    }

    @Override
    Long getValue(int i) {
      return values[i];
    }

    @Override
    com.google.protobuf.Value getValueAsProto(int i) {
      return com.google.protobuf.Value.newBuilder()
          .setStringValue(Long.toString(values[i]))
          .build();
    }

    @Override
    int arrayHash() {
      return Arrays.hashCode(values);
    }
  }

  private static class Float64ArrayImpl extends PrimitiveArrayImpl<Double> {
    private final double[] values;

    private Float64ArrayImpl(boolean isNull, BitSet nulls, double[] values) {
      super(isNull, Type.float64(), nulls);
      this.values = values;
    }

    @Override
    public List<Double> getFloat64Array() {
      return getArray();
    }

    @Override
    boolean valueEquals(Value v) {
      Float64ArrayImpl that = (Float64ArrayImpl) v;
      return Arrays.equals(values, that.values);
    }

    @Override
    int size() {
      return values.length;
    }

    @Override
    Double getValue(int i) {
      return values[i];
    }

    @Override
    com.google.protobuf.Value getValueAsProto(int i) {
      return com.google.protobuf.Value.newBuilder().setNumberValue(values[i]).build();
    }

    @Override
    int arrayHash() {
      return Arrays.hashCode(values);
    }
  }

  abstract static class AbstractArrayValue<T> extends AbstractObjectValue<List<T>> {

    private AbstractArrayValue(boolean isNull, Type elementType, @Nullable List<T> values) {
      super(isNull, Type.array(elementType), values);
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      ListValue.Builder list = ListValue.newBuilder();
      for (T element : value) {
        if (element == null) {
          list.addValues(NULL_PROTO);
        } else {
          list.addValuesBuilder().setStringValue(elementToString(element));
        }
      }
      return com.google.protobuf.Value.newBuilder().setListValue(list).build();
    }

    String elementToString(T element) {
      return element.toString();
    }

    abstract void appendElement(StringBuilder b, T element);

    @Override
    void valueToString(StringBuilder b) {
      b.append(LIST_OPEN);
      for (int i = 0; i < value.size(); ++i) {
        if (i > 0) {
          b.append(LIST_SEPERATOR);
        }
        T v = value.get(i);
        if (v == null) {
          b.append(NULL_STRING);
        } else {
          appendElement(b, v);
        }
      }
      b.append(LIST_CLOSE);
    }
  }

  private static class StringArrayImpl extends AbstractArrayValue<String> {

    private StringArrayImpl(boolean isNull, @Nullable List<String> values) {
      super(isNull, Type.string(), values);
    }

    @Override
    public List<String> getStringArray() {
      checkType(getType());
      checkNotNull();
      return value;
    }

    @Override
    void appendElement(StringBuilder b, String element) {
      b.append(element);
    }
  }

  private static class BytesArrayImpl extends AbstractArrayValue<ByteArray> {
    private BytesArrayImpl(boolean isNull, @Nullable List<ByteArray> values) {
      super(isNull, Type.bytes(), values);
    }

    @Override
    public List<ByteArray> getBytesArray() {
      checkType(getType());
      checkNotNull();
      return value;
    }

    @Override
    String elementToString(ByteArray element) {
      return element.toBase64();
    }

    @Override
    void appendElement(StringBuilder b, ByteArray element) {
      b.append(element.toString());
    }
  }

  private static class TimestampArrayImpl extends AbstractArrayValue<Timestamp> {

    private TimestampArrayImpl(boolean isNull, @Nullable List<Timestamp> values) {
      super(isNull, Type.timestamp(), values);
    }

    @Override
    public List<Timestamp> getTimestampArray() {
      checkType(getType());
      checkNotNull();
      return value;
    }

    @Override
    void appendElement(StringBuilder b, Timestamp element) {
      b.append(element);
    }
  }

  private static class DateArrayImpl extends AbstractArrayValue<Date> {

    private DateArrayImpl(boolean isNull, @Nullable List<Date> values) {
      super(isNull, Type.date(), values);
    }

    @Override
    public List<Date> getDateArray() {
      checkType(getType());
      checkNotNull();
      return value;
    }

    @Override
    void appendElement(StringBuilder b, Date element) {
      b.append(element);
    }
  }

  private static class StructArrayImpl extends AbstractValue {
    private static final Joiner joiner = Joiner.on(LIST_SEPERATOR).useForNull(NULL_STRING);

    private final List<Struct> values;

    private StructArrayImpl(Type elementType, @Nullable List<Struct> values) {
      super(values == null, Type.array(elementType));
      this.values = values;
    }

    @Override
    public List<Struct> getStructArray() {
      checkType(getType());
      checkNotNull();
      return values;
    }

    @Override
    com.google.protobuf.Value valueToProto() {
      throw new UnsupportedOperationException("ARRAY<STRUCT<...>> cannot be serialized to proto");
    }

    @Override
    void valueToString(StringBuilder b) {
      b.append(LIST_OPEN);
      joiner.appendTo(b, values);
      b.append(LIST_CLOSE);
    }

    @Override
    boolean valueEquals(Value v) {
      return ((StructArrayImpl) v).values.equals(values);
    }

    @Override
    int valueHash() {
      return values.hashCode();
    }
  }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.sdorra</groupId>
    <artifactId>buildfrontend-it-script-with-args</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <name>buildfrontend-it</name>
    <packaging>pom</packaging>

    <build>
        <plugins>

            <plugin>
                <groupId>com.github.sdorra</groupId>
                <artifactId>buildfrontend-maven-plugin</artifactId>
                <version>@project.version@</version>
                <configuration>
                    <node>
                        <version>10.15.2</version>
                    </node>
                    <pkgManager>
                        <type>YARN</type>
                        <version>1.13.0</version>
                    </pkgManager>
                </configuration>
                <executions>
                    <execution>
                        <id>install</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>install</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>run</id>
                        <phase>process-resources</phase>
                        <configuration>
                            <script>run</script>
                            <args>
                                <arg>${project.version}</arg>
                            </args>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>


text:
<?php

/**
 * Numeric helper functions
 *
 * @package		Todoyu
 * @subpackage	Core
 */
class TodoyuNumeric {

	/**
	 * Bytes per kilobyte
	 *
	 * @var	Integer
	 */
	const BYTES_KILOBYTE	= 1024;

	/**
	 * Bytes per megabyte
	 *
	 * @var	Integer
	 */
	const BYTES_MEGABYTE	= 1048576;

	/**
	 * Bytes per gigabyte
	 *
	 * @var	Integer
	 */
	const BYTES_GIGABYTE	= 1073741824;

	/**
	 * Make sure an integer is in a range. If the integer is out of range,
	 * set it to one of the boundaries
	 *
	 * @param	Integer		$integer
	 * @param	Integer		$min
	 * @param	Integer		$max
	 * @return	Integer
	 */
	public static function intInRange($integer, $min = 0, $max = 2000000000) {
		$integer = (int) $integer;

		if( $integer < $min ) {
			$integer = $min;
		}

		if( $integer > $max ) {
			$integer = $max;
		}

		return $integer;
	}

	/**
	 * Get the positive integer of a value
	 *
	 * @param	String		$value		A string or integer value
	 * @return	Integer		Integer equal or greater than 0
	 */
	public static function intPositive($value) {
		$integer = (int) $value;

		if( $integer < 0 ) {
			$integer = 0;
		}

		return $integer;
	}

	/**
	 * Check whether given version is same or newer than version to be compared to
	 *
	 * @param	String		$actualVersion
	 * @param	String		$atLeastVersion
	 * @return	Boolean
	 */
	public static function isVersionAtLeast($actualVersion, $atLeastVersion) {
		return version_compare($actualVersion, $atLeastVersion) >= 0;
	}

	/**
	 * Get percent of a value
	 *
	 * @param	Float		$value				Base value
	 * @param	Float		$percent			Percent: 25.0 or 0.25
	 * @param	Boolean		$isFraction			Percent value is already a fraction (<0)
	 * @return	Float
	 */
	public static function percent($value, $percent, $isFraction = false) {
		$value		= floatval($value);
		$percent	= floatval($percent);

		if( $isFraction !== true ) {
			$percent = floatval($percent / 100);
		}

		return floatval($percent * $value);
	}

	/**
	 * Get ratio of two values
	 * Supports rounding and percentage value
	 *
	 * @param	Float			$dividend
	 * @param	Float			$divisor
	 * @param	Boolean			$asPercent
	 * @param	Boolean|Integer	$round
	 * @param	Boolean|Mixed	$default
	 * @return	Float|Boolean|Mixed
	 */
	public static function ratio($dividend, $divisor, $asPercent = false, $round = false, $default = false) {
		$dividend	= floatval($dividend);
		$divisor	= floatval($divisor);

		if( $dividend === 0.0 || $divisor === 0.0 ) {
			return $default;
		}

		$ratio	= $dividend/$divisor;

		if( $asPercent ) {
			$ratio *= 100;
		}

		if( $round !== false ) {
			$ratio = round($ratio, $round);
		}

		return $ratio;
	}

}

?>


text:
<?php

/**
 * The reasons for the setting error.
 * @package    Google_Api_Ads_AdWords_v201605
 * @subpackage v201605
 */
class SettingErrorReason
{

    const WSDL_NAMESPACE = "https://adwords.google.com/api/adwords/cm/v201605";
    const XSI_TYPE = "SettingError.Reason";

    /**
     * Gets the namesapce of this class
     * @return string the namespace of this class
     */
    public function getNamespace()
    {
        return self::WSDL_NAMESPACE;
    }

    /**
     * Gets the xsi:type name of this class
     * @return string the xsi:type name of this class
     */
    public function getXsiTypeName()
    {
        return self::XSI_TYPE;
    }

    public function __construct()
    {
    }

}


text:
import {UserAuthWrapper} from "redux-auth-wrapper";
import {push} from "react-router-redux";

export const requireAuthentication = UserAuthWrapper({
    authSelector: state => state.auth,
    predicate: auth => auth.isAuthenticated,
    redirectAction: push,
    wrapperDisplayName: "UserIsJWTAuthenticated"
});
export const createGroupedArray = (arr, chunkSize) => {
    var groups = [],
        i;
    for (i = 0; i < arr.length; i += chunkSize) {
        groups.push(arr.slice(i, i + chunkSize));
    }
    return groups;
};


text:
extern crate logitech_lcd;

use logitech_lcd::{Driver, MONO_WIDTH, MONO_HEIGHT};
use std::sync::Arc;
use std::thread;
use std::iter;

fn blink(driver: &mut Driver, blank: &[u8], filled: &[u8]) {
    for i in 0..10 {
        match i % 2 == 0 {
            true  => driver.set_mono_background(blank).unwrap(),
            false => driver.set_mono_background(filled).unwrap(),
        }
        driver.update();
        thread::sleep(std::time::Duration::from_millis(500));
    }
}

fn main() {
    let mut driver = Driver::init_mono("Threaded").unwrap();
    let blank = Arc::new(iter::repeat(0u8).take(MONO_WIDTH * MONO_HEIGHT).collect::<Vec<u8>>());
    let filled = Arc::new(iter::repeat(255u8).take(MONO_WIDTH * MONO_HEIGHT).collect::<Vec<u8>>());

    let blank2 = blank.clone();
    let filled2 = filled.clone();

    let child = thread::spawn(move || {
        blink(&mut driver, &(*blank2)[..], &(*filled2)[..]);
        driver
    });

    driver = child.join().unwrap();
    blink(&mut driver, &(*blank)[..], &(*filled)[..]);
}


text:
# UPGRADE FROM 1.x to 2.0

## Change of handling for SystemProperties

Previously, all resources shared a common implementation of the system properties object, located in `Contentful\Management\SystemProperties`. The issue with implementation was that in order to accommodate for all possible resources, the class was unnecessarily big and contained many nullable properties.

To fix this and make the handling of system properties more robust, now every resource declares a specific system properties class, which is enforced through strict typing in their corresponding `->getSystemProperties()` methods:

```php
/** @var \Contentful\Management\SystemProperties\Entry $sys */
$sys = $entry->getSystemProperties();

/** @var \Contentful\Management\SystemProperties\Asset $sys */
$sys = $asset->getSystemProperties();

/** @var \Contentful\Management\SystemProperties\ContentType $sys */
$sys = $contentType->getSystemProperties();
```

The system properties objects will work just like before, but pay attention to two things:

* If you were type hinting against general `Contentful\Management\SystemProperties` class, you need to change that to something more specific. If you still need something generic, you can use the base `Contentful\Core\Resource\SystemPropertiesInterface`, but be careful as it only defines the `getId()` and `getType()` methods.
* Methods that conceptually did not belong to a resource's system properties will no longer exist. For instance, you will not find the `getPublishedAt()` method in the `Contentful\Management\SystemProperties\Space` class.

## Change in handling of object hydration

If implementing a custom mapper (for instance using the code generation capabilities) you need to upgrade your `Mapper::map()` methods:

```php
// Before
return $this->hydrate(...);
// After
return $this->hydrator->hydrate(...);
```

The parameters of the two functions are the same, so no change there is necessary.

## Upgrade of contentful-core.php

The SDK now uses version 2 of the `contentful/core` package. We encourage users to check its [changelog](https://github.com/contentful/contentful-core.php/blob/2.0.0/CHANGELOG.md) and [upgrade guide](https://github.com/contentful/contentful-core.php/blob/2.0.0/UPGRADE-2.0.md).


text:
const static unsigned int g_dwPlayerSessionBuffLen = 64 * 1024;
static char g_pPlayerSessionBuf[g_dwPlayerSessionBuffLen];

CPlayerSession::CPlayerSession()
	: m_oProtoDispatch(*this)
	, m_qwPlayerId(0)
{
	m_oProtoDispatch.RegistFunction(GameProto::PlayerRequestGameTest::descriptor(), &CPlayerSession::OnPlayerRequestGameTest);
	m_oProtoDispatch.RegistFunction(GameProto::PlayerRequestGameEnter::descriptor(), &CPlayerSession::OnPlayerRequestGameEnter);
	m_oProtoDispatch.RegistFunction(GameProto::PlayerRequestMove::descriptor(), &CPlayerSession::OnPlayerRequestMove);
	m_oProtoDispatch.RegistFunction(GameProto::PlayerRequestRotation::descriptor(), &CPlayerSession::OnPlayerRequestRotation);
}

CPlayerSession::~CPlayerSession()
{
}

void CPlayerSession::OnConnect(void)
{
}

void CPlayerSession::OnClose(void)
{
	CPlayerBase* pPlayer = CGameSceneBase::Instance()->GetPlayer(m_qwPlayerId);
	pPlayer->SetPlayerSession(NULL);
	m_qwPlayerId = 0;
}

void CPlayerSession::OnError(unsigned int dwErrorNo)
{
	LogExe(LogLv_Debug, "ip : %s, port : %d, connect addr : %p, error no : %d", GetRemoteIPStr(), GetRemotePort(), (GetConnection()), dwErrorNo);
}

void CPlayerSession::OnRecv(const char* pBuf, unsigned int dwLen)
{
	CNetStream oStream(pBuf, dwLen);
	std::string szProtocolName;
	oStream.ReadString(szProtocolName);
	unsigned int dwProtoLen = oStream.GetDataLength();
	char* pData = oStream.ReadData(dwProtoLen);
	if (!m_oProtoDispatch.Dispatch(szProtocolName.c_str(),
		(const unsigned char*)pData, dwProtoLen, this, *this))
	{
		LogExe(LogLv_Debug, "%s proccess error", szProtocolName.c_str());
	}
}

void CPlayerSession::Release(void)
{
	LogExe(LogLv_Debug, "ip : %s, port : %d, connect addr : %p", GetRemoteIPStr(), GetRemotePort(), GetConnection());
	OnDestroy();

	Init(NULL);
}

bool CPlayerSession::OnPlayerRequestGameTest(CPlayerSession& refSession, google::protobuf::Message& refMsg)
{
	GameProto::PlayerRequestGameTest* pMsg = dynamic_cast<GameProto::PlayerRequestGameTest*>(&refMsg);
	if (pMsg == NULL)
	{
		return false;
	}

	LogExe(LogLv_Debug, "recv : %s", pMsg->sz_test().c_str());

	char* pBuf = NULL;
	unsigned int dwBufLen = 0;
	ProtoUtility::MakeProtoSendBuffer(*pMsg, pBuf, dwBufLen);
	Send(pBuf, dwBufLen);

	return true;
}

bool CPlayerSession::OnPlayerRequestGameEnter(CPlayerSession& refSession, google::protobuf::Message& refMsg)
{
	GameProto::PlayerRequestGameEnter* pMsg = dynamic_cast<GameProto::PlayerRequestGameEnter*>(&refMsg);
	if (pMsg == NULL)
	{
		return false;
	}

	GameProto::GameAckPlayerEnter oResult;
	CPlayerBase* pPlayerBase = CGameSceneBase::Instance()->GetPlayer(pMsg->qw_player_id());
	if (!pPlayerBase)
	{
		LogExe(LogLv_Critical, "player : %llu not in game", pMsg->qw_player_id());
		oResult.set_dw_result(GameProto::EC_CannotFindPlayer);
		char* pBuf = NULL;
		unsigned int dwBufLen = 0;
		ProtoUtility::MakeProtoSendBuffer(oResult, pBuf, dwBufLen);
		Send(pBuf, dwBufLen);
		return true;
	}
	pPlayerBase->SetPlayerSession(this);
	m_qwPlayerId = pMsg->qw_player_id();
	char* pBuf = NULL;
	unsigned int dwBufLen = 0;
	ProtoUtility::MakeProtoSendBuffer(oResult, pBuf, dwBufLen);
	Send(pBuf, dwBufLen);

	GameProto::GameNotifyPlayerGameConfig oNotifyConfig;
	CGameConfigBase::Instance()->FillProtoConfig(oNotifyConfig);
	ProtoUtility::MakeProtoSendBuffer(oNotifyConfig, pBuf, dwBufLen);
	Send(pBuf, dwBufLen);

	GameProto::GameNotifyPlayerGameSceneInfo oSceneInfo;
	oSceneInfo.set_dw_game_type(CGameConfigBase::Instance()->GetGameType());
	oSceneInfo.set_state(CGameSceneBase::Instance()->GetSceneState());
	CGameSceneBase::Instance()->FillProtoScene(oSceneInfo);
	LogExe(LogLv_Debug3, "scene info : %s", oSceneInfo.DebugString().c_str());
	ProtoUtility::MakeProtoSendBuffer(oSceneInfo, pBuf, dwBufLen);
	Send(pBuf, dwBufLen);

	//ÓÎÏ·ÒѾ¿ªÊ¼
	GameProto::GameNotifyPlayerGameTetrisData oData;
	if (CGameSceneBase::Instance()->GetSceneState() == GameProto::ESS_Gaming)
	{
		for (int i = 0; i < MAXCLIENTNUM; i++)
		{
			unsigned long long qwPlayerId = CGameSceneBase::Instance()->GetPlayers()[i];
			if (!qwPlayerId)
			{
				continue;
			}
			CGameSceneBase::Instance()->GetPlayer(qwPlayerId)->GetTetrisData().FillTetrisData(oData);
			ProtoUtility::MakeProtoSendBuffer(oData, pBuf, dwBufLen);
			Send(pBuf, dwBufLen);
		}
	}

	return true;
}

bool CPlayerSession::OnPlayerRequestMove(CPlayerSession& refSession, google::protobuf::Message& refMsg)
{
	GameProto::PlayerRequestMove* pMsg = dynamic_cast<GameProto::PlayerRequestMove*>(&refMsg);
	if (pMsg == NULL)
	{
		return false;
	}

	CPlayerBase* pPlayer = CGameSceneBase::Instance()->GetPlayer(m_qwPlayerId);
	if (pPlayer == NULL)
	{
		LogExe(LogLv_Critical, "can't find player : %llu", m_qwPlayerId);
		return true;
	}
	LogExe(LogLv_Debug, "player tick : %f, server tick : %f, player id : %llu", pMsg->f_tick(), pPlayer->GetTetrisData().GetTick(), m_qwPlayerId);

	switch (pMsg->e_direction())
	{
		case GameProto::EMD_Down:
		{
			pPlayer->GetTetrisData().DownTetris();
		}
		break;
		case GameProto::EMD_Left:
		{
			pPlayer->GetTetrisData().LeftTetris();
		}
		break;
		case GameProto::EMD_Right:
		{
			pPlayer->GetTetrisData().RightTetris();
		}
		break;
		default:
			LogExe(LogLv_Critical, "error move player : %llu", m_qwPlayerId);
			break;
	}

	return true;
}

bool CPlayerSession::OnPlayerRequestRotation(CPlayerSession& refSession, google::protobuf::Message& refMsg)
{
	GameProto::PlayerRequestRotation* pMsg = dynamic_cast<GameProto::PlayerRequestRotation*>(&refMsg);
	if (pMsg == NULL)
	{
		return false;
	}

	CPlayerBase* pPlayer = CGameSceneBase::Instance()->GetPlayer(m_qwPlayerId);
	if (pPlayer == NULL)
	{
		LogExe(LogLv_Critical, "can't find player : %llu", m_qwPlayerId);
		return true;
	}
	LogExe(LogLv_Debug, "player tick : %f, server tick : %f, player id : %llu", pMsg->f_tick(), pPlayer->GetTetrisData().GetTick(), m_qwPlayerId);

	switch (pMsg->e_direction())
	{
		case GameProto::ERD_Left:
		{
			pPlayer->GetTetrisData().LeftRotation();
		}
		break;
		case GameProto::ERD_Right:
		{
			pPlayer->GetTetrisData().RightRotation();
		}
		break;
		default:
			LogExe(LogLv_Critical, "error rotate player : %llu", m_qwPlayerId);
			break;
	}

	return true;
}

//////////////////////////////////////////////////////////////////////////
CWebSocketPlayerSession::CWebSocketPlayerSession()
{
}

CWebSocketPlayerSession::~CWebSocketPlayerSession()
{
}

void CWebSocketPlayerSession::Release(void)
{
	LogExe(LogLv_Debug, "ip : %s, port : %d, connect addr : %p", GetRemoteIPStr(), GetRemotePort(), GetConnection());
	OnDestroy();

	Init(NULL);
}

//////////////////////////////////////////////////////////////////////////
WebSocketPlayerSessionManager::WebSocketPlayerSessionManager()
{
}

WebSocketPlayerSessionManager::~WebSocketPlayerSessionManager()
{
}

FxSession * WebSocketPlayerSessionManager::CreateSession()
{
	FxSession* pSession = NULL;
	m_oLock.Lock();
	for (int i = 0; i < MAXCLIENTNUM; ++i)
	{
		if (m_oWebSocketPlayerSessions[i].GetConnection() == NULL)
		{
			m_oWebSocketPlayerSessions[i].Init((FxConnection*)0xFFFFFFFF);
			pSession = &m_oWebSocketPlayerSessions[i];
			break;
		}
	}
	m_oLock.UnLock();
	return pSession;
}

void WebSocketPlayerSessionManager::Release(FxSession * pSession)
{
	Assert(0);
}

void WebSocketPlayerSessionManager::Release(CWebSocketPlayerSession* pSession)
{
	m_oLock.Lock();
	for (int i = 0; i < MAXCLIENTNUM; ++i)
	{
		if (&m_oWebSocketPlayerSessions[i] == pSession)
		{
			m_oWebSocketPlayerSessions[i].Init(NULL);
			break;
		}
	}
	m_oLock.UnLock();
}


text:
title: Cookie Policy
name: legal-cookie
permalink: /en/legal/cookie/
type: pages
layout: page
lang: en
share: false
version: 1
---
## Introduction

A cookie is a small text file which can be sent by a web-server to your web-browser when you request a page. This file is stored on your computer and it sent back to the website when you make another page request. Only the sending website can access it's cookies.

Session cookies are deleted from your browser when you close your browser window or tab. Persistent cookies are deleted automatically by your browser when their expiry date is reached.

3rd party cookies are cookies that are sent and retrieved by 3rd services used by this website.

## Consent

Users can configure their web browser to accept or refuse cookies. By using this website with your browser set to accepting cookies, you consent to cookies being set on your computer. If you do not consent either do not use this website, or disable cookies which may degrade or break your website experience.

This website uses cookies to provide essential functionality. 3rd party DDOS protection services may also set a cookie in order to deliver protected pages.

Last updated on 2015-01-15.


text:
package io.nanodbc;

import java.sql.JDBCType;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;

public interface Result extends AutoCloseable {

    boolean next();

    short getNumColumns();

    long getAffectedRows();

    String getColumnName(short column);

    JDBCType getColumnType(short column);

    JDBCType getColumnType(String columnName);

    boolean isNull(short column);

    boolean isNull(String columnName);

    int getInt(short column);

    int getInt(String columnName);

    long getLong(short column);

    long getLong(String columnName);

    float getFloat(short column);

    float getFloat(String columnName);

    double getDouble(short column);

    double getDouble(String columnName);

    String getString(short column);

    String getString(String columnName);

    LocalDate getDate(short column);

    LocalDate getDate(String columnName);

    LocalTime getTime(short column);

    LocalTime getTime(String columnName);

    LocalDateTime getDateTime(short column);

    LocalDateTime getDateTime(String columnName);

    @Override
    void close();

}


text:
'use strict';

const boom = require('boom');
const hoek = require('hoek');
const _ = require('lodash');

const register = server => {
  server.decorate('handler', 'bullishStatus', (route, options) => {
    return async req => {

      // get queue from bullish if options.job is set
      if (options.job !== undefined && options.queue === undefined) {
        options.queue = server.bullish.queues[options.job];
      }
      const job = await options.queue.getJob(req.params.id);

      if (job === null) return boom.notFound();
      let status = 'queued';
      if (job._progress && job._progress > 0) status = 'running';
      if (job.finishedOn) status = 'completed';
      else if (job.stacktrace.length !== 0) status = 'errored';

      const res = {
        data: options.stripData ? undefined : job.data,
        progress: job._progress,
        delay: job.delay,
        timestamp: job.timestamp,
        attempts: job.attempts,
        result: job.returnvalue,
        attemptsMade: job.attemptsMade,
        id: job.id,
        status,
      };
      if (req.auth.isAuthenticated) {
        res.stacktrace = job.stacktrace;
      }
      return res;
    };
  });

  server.decorate('handler', 'bullishCreate', (route, options) => {
    return async (req, h) => {
      const qOpts = req.payload.options || {};
      qOpts._bullishValidation = false; // data was already validated by hapi

      const job = await options.queue.add(req.payload.data, qOpts);

      // reply what was sent. add created header to status endpoint
      req.payload.id = job.id;
      const response = options.stripData ? _.omit(req.payload, 'data') : req.payload;
      return h.response(response).created(`/jobs/${options.queue.name}/${job.id}`);
    };
  });

  server.decorate('handler', 'bullishList', (route, options) => {
    return () => {
      const q = options.queue;
      let res = Promise.all([
        q.getActive(),
        q.getDelayed(),
        q.getWaiting(),
        q.getCompleted(),
        q.getFailed(),
      ]).then(hoek.flatten);

      if (options.stripData) {
        res = res.then(jobs => _.omit(jobs, 'data'));
      }
      res = res.then(jobs => _.sortBy(jobs, 'id'));

      return res;
    };
  });

  server.decorate('handler', 'bullishSimulate', (route, options) => {
    return async req => {
      req.payload.simulated = true;
      return server.bullish.inject(options.queue.name, req.payload).then(result => {
        return {
          simulated: true,
          result,
        };
      }).catch((e) => {
        if (e.isJoi) return boom.badRequest(e);
        else return e;
      });
    };
  });
};

module.exports.plugin = {
  name: 'bullish-handlers',
  register,
};


text:
<?php
class Roles extends ActiveRecord{

}

 ?>


text:
@interface WTMGlyphDetector : NSObject {

    id<WTMGlyphDelegate> __unsafe_unretained delegate;

    NSMutableArray *points;
    NSMutableArray *glyphs;

    NSInteger timeoutSeconds;
    NSTimeInterval lastPointTime;

}

@property (nonatomic, unsafe_unretained) id delegate;
@property (nonatomic, strong) NSMutableArray *points;
@property (nonatomic, strong) NSMutableArray *glyphs;
@property (nonatomic, assign) NSInteger timeoutSeconds;

+ (id)detector;
+ (id)defaultDetector;
- (id)init;
- (id)initWithGlyphs:(NSArray *)_glyphs;
- (id)initWithDefaultGlyphs;

- (void)addGlyph:(WTMGlyph *)glyph;
- (void)addGlyphFromJSON:(NSData *)jsonData name:(NSString *)name;
- (void)removeGlyphByName:(NSString *)name;

- (void)addPoint:(CGPoint)point;
- (void)removeAllPoints;
- (void)removeAllGlyphs;

- (WTMDetectionResult*)detectGlyph;

- (NSArray *)resample:(NSArray *)_points;
- (NSArray *)translate:(NSArray *)_points;
- (NSArray *)vectorize:(NSArray *)_points;

- (void)detectIfTimedOut;
- (void)resetIfTimedOut;
- (void)reset;
- (BOOL)hasTimedOut;
- (BOOL)hasEnoughPoints;

@end


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

#include "net/http2/decoder/payload_decoders/altsvc_payload_decoder.h"

#include <stddef.h>

#include <string>

#include "base/logging.h"
#include "net/http2/decoder/frame_parts.h"
#include "net/http2/decoder/frame_parts_collector.h"
#include "net/http2/decoder/http2_frame_decoder_listener.h"
#include "net/http2/decoder/payload_decoders/payload_decoder_base_test_util.h"
#include "net/http2/http2_constants.h"
#include "net/http2/http2_structures_test_util.h"
#include "net/http2/tools/http2_frame_builder.h"
#include "net/http2/tools/http2_random.h"
#include "net/http2/tools/random_decoder_test.h"
#include "testing/gtest/include/gtest/gtest.h"

using std::string;

namespace net {
namespace test {

// Provides friend access to an instance of the payload decoder, and also
// provides info to aid in testing.
class AltSvcPayloadDecoderPeer {
 public:
  static constexpr Http2FrameType FrameType() { return Http2FrameType::ALTSVC; }

  // Returns the mask of flags that affect the decoding of the payload (i.e.
  // flags that that indicate the presence of certain fields or padding).
  static constexpr uint8_t FlagsAffectingPayloadDecoding() { return 0; }

  static void Randomize(AltSvcPayloadDecoder* p, RandomBase* rng) {
    CorruptEnum(&p->payload_state_, rng);
    test::Randomize(&p->altsvc_fields_, rng);
    VLOG(1) << "AltSvcPayloadDecoderPeer::Randomize altsvc_fields_="
            << p->altsvc_fields_;
  }
};

namespace {

struct Listener : public FramePartsCollector {
  void OnAltSvcStart(const Http2FrameHeader& header,
                     size_t origin_length,
                     size_t value_length) override {
    VLOG(1) << "OnAltSvcStart header: " << header
            << "; origin_length=" << origin_length
            << "; value_length=" << value_length;
    StartFrame(header)->OnAltSvcStart(header, origin_length, value_length);
  }

  void OnAltSvcOriginData(const char* data, size_t len) override {
    VLOG(1) << "OnAltSvcOriginData: len=" << len;
    CurrentFrame()->OnAltSvcOriginData(data, len);
  }

  void OnAltSvcValueData(const char* data, size_t len) override {
    VLOG(1) << "OnAltSvcValueData: len=" << len;
    CurrentFrame()->OnAltSvcValueData(data, len);
  }

  void OnAltSvcEnd() override {
    VLOG(1) << "OnAltSvcEnd";
    EndFrame()->OnAltSvcEnd();
  }

  void OnFrameSizeError(const Http2FrameHeader& header) override {
    VLOG(1) << "OnFrameSizeError: " << header;
    FrameError(header)->OnFrameSizeError(header);
  }
};

class AltSvcPayloadDecoderTest
    : public AbstractPayloadDecoderTest<AltSvcPayloadDecoder,
                                        AltSvcPayloadDecoderPeer,
                                        Listener> {};

// Confirm we get an error if the payload is not long enough to hold
// Http2AltSvcFields and the indicated length of origin.
TEST_F(AltSvcPayloadDecoderTest, Truncated) {
  Http2FrameBuilder fb;
  fb.Append(Http2AltSvcFields{0xffff});  // The longest possible origin length.
  fb.Append("Too little origin!");
  EXPECT_TRUE(
      VerifyDetectsFrameSizeError(0, fb.buffer(), /*approve_size*/ nullptr));
}

class AltSvcPayloadLengthTests : public AltSvcPayloadDecoderTest,
                                 public ::testing::WithParamInterface<
                                     ::testing::tuple<uint16_t, uint32_t>> {
 protected:
  AltSvcPayloadLengthTests()
      : origin_length_(::testing::get<0>(GetParam())),
        value_length_(::testing::get<1>(GetParam())) {
    VLOG(1) << "################  origin_length_=" << origin_length_
            << "   value_length_=" << value_length_ << "  ################";
  }

  const uint16_t origin_length_;
  const uint32_t value_length_;
};

INSTANTIATE_TEST_CASE_P(VariousOriginAndValueLengths,
                        AltSvcPayloadLengthTests,
                        ::testing::Combine(::testing::Values(0, 1, 3, 65535),
                                           ::testing::Values(0, 1, 3, 65537)));

TEST_P(AltSvcPayloadLengthTests, ValidOriginAndValueLength) {
  string origin = Random().RandString(origin_length_);
  string value = Random().RandString(value_length_);
  Http2FrameBuilder fb;
  fb.Append(Http2AltSvcFields{origin_length_});
  fb.Append(origin);
  fb.Append(value);
  Http2FrameHeader header(fb.size(), Http2FrameType::ALTSVC, RandFlags(),
                          RandStreamId());
  set_frame_header(header);
  FrameParts expected(header);
  expected.SetAltSvcExpected(origin, value);
  ASSERT_TRUE(DecodePayloadAndValidateSeveralWays(fb.buffer(), expected));
}

}  // namespace
}  // namespace test
}  // namespace net


text:
package edu.northwestern.bioinformatics.studycalendar.restlets.representations;

import edu.northwestern.bioinformatics.studycalendar.domain.Gender;
import edu.northwestern.bioinformatics.studycalendar.domain.Subject;
import edu.northwestern.bioinformatics.studycalendar.domain.SubjectProperty;
import edu.northwestern.bioinformatics.studycalendar.restlets.AbstractPscResource;
import org.codehaus.jackson.JsonGenerator;
import org.json.JSONArray;
import org.json.JSONObject;
import org.restlet.data.Reference;
import org.restlet.data.Status;
import org.restlet.resource.ResourceException;

import java.io.IOException;
import java.text.ParseException;
import java.util.LinkedList;
import java.util.List;

import static edu.northwestern.bioinformatics.studycalendar.restlets.representations.JacksonTools.*;

/**
 * @author Rhett Sutphin
 */
public class SubjectJsonRepresentation extends StreamingJsonRepresentation {
    private final Subject subject;
    private Reference rootRef;

    public SubjectJsonRepresentation(Subject subject, Reference rootReference) {
        this.subject = subject;
        this.rootRef = rootReference;
    }

    public SubjectJsonRepresentation(JSONObject jsonIn) {
        this.subject = new Subject();
        readJson(jsonIn);
    }

    ////// WRITE

    @Override
    public void generate(JsonGenerator g) throws IOException {
        g.writeStartObject();

            writeBasicSubjectAttributes(g);
            writeSubjectIdentifiers(g);
            writeProperties(g);
            writeLinks(g);

        g.writeEndObject();
    }

    private String getSubjectIdentifier() {
        return getSubject().getPersonId() == null ?
            getSubject().getGridId() : getSubject().getPersonId();
    }

    private void writeBasicSubjectAttributes(JsonGenerator g) throws IOException {
        nullSafeWriteStringField(g, "first_name", getSubject().getFirstName());
        nullSafeWriteStringField(g, "last_name", getSubject().getLastName());
        nullSafeWriteStringField(g, "full_name", getSubject().getFullName());
        nullSafeWriteStringField(g, "last_first", getSubject().getLastFirst());
        nullSafeWriteDateField(g, "birth_date", getSubject().getDateOfBirth());
        if (getSubject().getGender() != null) {
            g.writeStringField("gender", getSubject().getGender().getDisplayName());
        }
    }

    private void writeSubjectIdentifiers(JsonGenerator g) throws IOException {
        nullSafeWriteStringField(g, "person_id", getSubject().getPersonId());
        nullSafeWriteStringField(g, "subject_identifier", getSubjectIdentifier());
    }

    private void writeProperties(JsonGenerator g) throws IOException {
        g.writeArrayFieldStart("properties");
        for (SubjectProperty property : getSubject().getProperties()) {
            g.writeStartObject();
                nullSafeWriteStringField(g, "name", property.getName());
                nullSafeWriteStringField(g, "value", property.getValue());
            g.writeEndObject();
        }
        g.writeEndArray();
    }

    private void writeLinks(JsonGenerator g) throws IOException {
        Reference schedulesHref = getRootRef().clone().
            addSegment("subjects").
            addSegment(getSubjectIdentifier()).
            addSegment("schedules");

        g.writeObjectFieldStart("href");
            g.writeStringField("schedules", schedulesHref.toString());
        g.writeEndObject();
    }

    ////// READ

    // TODO: use something more declarative for this.  Maybe Jackson.

    private void readJson(JSONObject json) {
        if (json.has("first_name")) {
            getSubject().setFirstName(json.optString("first_name"));
        }
        if (json.has("last_name")) {
            getSubject().setLastName(json.optString("last_name"));
        }
        if (json.has("person_id")) {
            getSubject().setPersonId(json.optString("person_id"));
        }
        if (json.has("gender")) {
            getSubject().setGender(Gender.getByCode(json.optString("gender")));
        }
        if (json.has("properties")) {
            List<SubjectProperty> properties = new LinkedList<SubjectProperty>();
            JSONArray inProps = json.optJSONArray("properties");
            for (int i = 0 ; i < inProps.length() ; i++) {
                JSONObject entry = inProps.optJSONObject(i);
                properties.add(new SubjectProperty(
                    entry.optString("name"), entry.optString("value")));
            }
            getSubject().setProperties(properties);
        }
        if (json.has("birth_date")) {
            try {
                getSubject().setDateOfBirth(
                    AbstractPscResource.getApiDateFormat().parse(json.optString("birth_date")));
            } catch (ParseException e) {
                throw new ResourceException(Status.CLIENT_ERROR_NOT_ACCEPTABLE, "Misformatted birth_date", e);
            }
        }
    }

    ////// BEAN PROPERTIES

    public Subject getSubject() {
        return subject;
    }

    public Reference getRootRef() {
        return rootRef;
    }
}


text:
using System;
using System.Linq;
using stellar_dotnet_sdk.xdr;

namespace stellar_dotnet_sdk.responses.results
{
    /// <summary>
    /// Operation successful.
    /// </summary>
    public class ManageBuyOfferSuccess : ManageBuyOfferResult
    {
        public override bool IsSuccess => true;

        /// <summary>
        /// Offers that got claimed while creating this offer.
        /// </summary>
        public ClaimOfferAtom[] OffersClaimed { get; set; }

        public static ManageBuyOfferSuccess FromXdr(xdr.ManageOfferSuccessResult result)
        {
            var offersClaimed = result.OffersClaimed.Select(ClaimOfferAtom.FromXdr).ToArray();

            switch (result.Offer.Discriminant.InnerValue)
            {
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_CREATED:
                    var createdOffer = OfferEntry.FromXdr(result.Offer.Offer);
                    return new ManageBuyOfferCreated
                    {
                        OffersClaimed = offersClaimed,
                        Offer = createdOffer,
                    };
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_UPDATED:
                    var updatedOffer = OfferEntry.FromXdr(result.Offer.Offer);
                    return new ManageBuyOfferUpdated
                    {
                        OffersClaimed = offersClaimed,
                        Offer = updatedOffer,
                    };
                case ManageOfferEffect.ManageOfferEffectEnum.MANAGE_OFFER_DELETED:
                    return new ManageBuyOfferDeleted
                    {
                        OffersClaimed = offersClaimed
                    };
                default:
                    throw new SystemException("Unknown ManageBuyOfferSuccess type");
            }
        }
    }
}


text:
import React from 'react';
import styles from './Footer.module.scss';

import classNames from 'classnames/bind';

import { TwitterIcon } from '../../icons/Twitter';
import { LinkedInIcon } from '../../icons/LinkedIn';
import { GitHubIcon } from '../../icons/GitHub';

import { Button } from '../Local/Button/Button';

const cx = classNames.bind(styles);

const Footer = (): JSX.Element => {
  return (

        Brian Hamilton © 2016-{new Date().getFullYear()}

        <Button type="link" to="/">
          Home
        </Button>
        <Button type="link" to="/resume">
          Resume
        </Button>
        <Button type="link" to="/portfolio">
          Portfolio
        </Button>
        <Button type="link" to="/contact">
          Contact
        </Button>

          phone

          email

          <TwitterIcon />

          <LinkedInIcon />

          <GitHubIcon />

  );
};

export default Footer;


text:
int main()
{
        initscr();

        printw("Upper left corner           "); addch(ACS_ULCORNER); printw("\n");
        printw("Lower left corner           "); addch(ACS_LLCORNER); printw("\n");
        printw("Lower right corner          "); addch(ACS_LRCORNER); printw("\n");
        printw("Tee pointing right          "); addch(ACS_LTEE); printw("\n");
        printw("Tee pointing left           "); addch(ACS_RTEE); printw("\n");
        printw("Tee pointing up             "); addch(ACS_BTEE); printw("\n");
        printw("Tee pointing down           "); addch(ACS_TTEE); printw("\n");
        printw("Horizontal line             "); addch(ACS_HLINE); printw("\n");
        printw("Vertical line               "); addch(ACS_VLINE); printw("\n");
        printw("Large Plus or cross over    "); addch(ACS_PLUS); printw("\n");
        printw("Scan Line 1                 "); addch(ACS_S1); printw("\n");
        printw("Scan Line 3                 "); addch(ACS_S3); printw("\n");
        printw("Scan Line 7                 "); addch(ACS_S7); printw("\n");
        printw("Scan Line 9                 "); addch(ACS_S9); printw("\n");
        printw("Diamond                     "); addch(ACS_DIAMOND); printw("\n");
        printw("Checker board (stipple)     "); addch(ACS_CKBOARD); printw("\n");
        printw("Degree Symbol               "); addch(ACS_DEGREE); printw("\n");
        printw("Plus/Minus Symbol           "); addch(ACS_PLMINUS); printw("\n");
        printw("Bullet                      "); addch(ACS_BULLET); printw("\n");
        printw("Arrow Pointing Left         "); addch(ACS_LARROW); printw("\n");
        printw("Arrow Pointing Right        "); addch(ACS_RARROW); printw("\n");
        printw("Arrow Pointing Down         "); addch(ACS_DARROW); printw("\n");
        printw("Arrow Pointing Up           "); addch(ACS_UARROW); printw("\n");
        printw("Board of squares            "); addch(ACS_BOARD); printw("\n");
        printw("Lantern Symbol              "); addch(ACS_LANTERN); printw("\n");
        printw("Solid Square Block          "); addch(ACS_BLOCK); printw("\n");
        printw("Less/Equal sign             "); addch(ACS_LEQUAL); printw("\n");
        printw("Greater/Equal sign          "); addch(ACS_GEQUAL); printw("\n");
        printw("Pi                          "); addch(ACS_PI); printw("\n");
        printw("Not equal                   "); addch(ACS_NEQUAL); printw("\n");
        printw("UK pound sign               "); addch(ACS_STERLING); printw("\n");

        refresh();
        getch();
        endwin();

    return 0;
}