text:
<template name="visitorInfo">
	{{#if editing}}
		{{> visitorEdit (editDetails)}}
	{{/if}}
	{{#if forwarding}}
		{{> visitorForward (forwardDetails)}}
	{{/if}}

			{{#with user}}

					{{#if name}}

{{name}}

{{username}}

					{{else}}

{{username}}

					{{/if}}

						{{#if utc}}
{{userTime}} (UTC {{utc}})
{{/if}}
						{{#each visitorEmails}}
 {{address}}{{#if verified}} {{/if}}
 {{/each}}
						{{#each phone}}
 {{phoneNumber}}
 {{/each}}
						{{#if lastLogin}}
 {{_ "Created_at"}}: {{createdAt}}
 {{/if}}
						{{#if lastLogin}}
 {{_ "Last_login"}}: {{lastLogin}}
 {{/if}}
						{{#if ip}}
{{ip}}
{{/if}}
						{{#if os}}
{{os}}
{{/if}}
						{{#if browser}}
{{browser}}
{{/if}}
						{{#if customVisitorFields}}
							{{#each customVisitorFields}}
{{label}}: {{value}}
{{/each}}
						{{/if}}

			{{/with}}

{{_ "Conversation"}}

					{{#with room}}
						{{#if servedBy}}
{{_ "Agent"}}: {{servedBy.username}}
{{/if}}
						{{#if facebook}}
{{_ "Facebook_Page"}}: {{facebook.page.name}}
{{/if}}
						{{#if sms}}
{{_ "SMS_Enabled"}}
{{/if}}
						{{#if topic}}
{{_ "Topic"}}: {{{RocketChatMarkdown topic}}}
{{/if}}
						{{#if tags}}
{{_ "Tags"}}: {{joinTags}}
{{/if}}
						{{#if closedAt}}
{{_ "Closed_At"}}: {{roomClosedDateTime}} {{_ "by"}}: {{roomClosedBy}}
{{/if}}
						{{> Template.dynamic template=customInfoTemplate data=roomDataContext}}
					{{/with}}
					{{#with department}}
						{{#if name}}
{{_ "Department"}}: {{name}}
{{/if}}
					{{/with}}
					{{#if customRoomFields}}
						{{#each customRoomFields}}
{{label}}: {{value}}
{{/each}}
					{{/if}}

		{{#if canSeeButtons}}

				{{#if canEditRoom}}
					<button class='button button-block edit-livechat'> {{_ "Edit"}}</button>
				{{/if}}

				{{#if roomOpen}}
					{{#if canCloseRoom}}
						<button class='button button-block close-livechat'> {{_ "Close"}}</button>
					{{/if}}
					{{#if canForwardGuest}}
						<button class="rc-button rc-button--secondary button-block forward-livechat"> {{_ "Forward"}}</button>
					{{/if}}
					{{#if canReturnQueue}}
						<button class="rc-button rc-button--secondary button-block return-inquiry"> {{_ "Return"}}</button>
					{{/if}}
				{{/if}}

		{{/if}}

		{{> visitorNavigation .}}

</template>


text:
using UnityEngine;

namespace TESUnity
{
	public static class Convert
	{
		public const int yardInMWUnits = 64;
		public const float meterInYards = 1.09361f;
		public const float meterInMWUnits = meterInYards * yardInMWUnits;

		public const int exteriorCellSideLengthInMWUnits = 8192;
		public const float exteriorCellSideLengthInMeters = (float)exteriorCellSideLengthInMWUnits / meterInMWUnits;

        public static Quaternion RotationMatrixToQuaternion(Matrix4x4 matrix)
		{
			return Quaternion.LookRotation(matrix.GetColumn(2), matrix.GetColumn(1));
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
module.exports = {
  extends: [
    '@dreipol/stylelint-config',
    '@dreipol/stylelint-config-bem-pattern',
    '@dreipol/stylelint-config-order',
    '@dreipol/stylelint-config-scss',
  ],
};


text:
/**
 * Autogenerated by Thrift Compiler (0.9.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

package com.pivotal.gemfirexd.thrift;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConnectionProperties implements org.apache.thrift.TBase<ConnectionProperties, ConnectionProperties._Fields>, java.io.Serializable, Comparable<ConnectionProperties> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ConnectionProperties");

  private static final org.apache.thrift.protocol.TField CONN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("connId", org.apache.thrift.protocol.TType.I32, (short)1);
  private static final org.apache.thrift.protocol.TField CLIENT_HOST_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("clientHostName", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientID", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)5);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new ConnectionPropertiesStandardSchemeFactory());
    schemes.put(TupleScheme.class, new ConnectionPropertiesTupleSchemeFactory());
  }

  public int connId; // required
  public String clientHostName; // required
  public String clientID; // required
  public String userName; // optional
  public ByteBuffer token; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    CONN_ID((short)1, "connId"),
    CLIENT_HOST_NAME((short)2, "clientHostName"),
    CLIENT_ID((short)3, "clientID"),
    USER_NAME((short)4, "userName"),
    TOKEN((short)5, "token");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // CONN_ID
          return CONN_ID;
        case 2: // CLIENT_HOST_NAME
          return CLIENT_HOST_NAME;
        case 3: // CLIENT_ID
          return CLIENT_ID;
        case 4: // USER_NAME
          return USER_NAME;
        case 5: // TOKEN
          return TOKEN;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __CONNID_ISSET_ID = 0;
  private byte __isset_bitfield = 0;
  private _Fields optionals[] = {_Fields.USER_NAME,_Fields.TOKEN};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.CONN_ID, new org.apache.thrift.meta_data.FieldMetaData("connId", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.CLIENT_HOST_NAME, new org.apache.thrift.meta_data.FieldMetaData("clientHostName", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientID", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", org.apache.thrift.TFieldRequirementType.OPTIONAL,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING        , true)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ConnectionProperties.class, metaDataMap);
  }

  public ConnectionProperties() {
  }

  public ConnectionProperties(
    int connId,
    String clientHostName,
    String clientID)
  {
    this();
    this.connId = connId;
    setConnIdIsSet(true);
    this.clientHostName = clientHostName;
    this.clientID = clientID;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public ConnectionProperties(ConnectionProperties other) {
    __isset_bitfield = other.__isset_bitfield;
    this.connId = other.connId;
    if (other.isSetClientHostName()) {
      this.clientHostName = other.clientHostName;
    }
    if (other.isSetClientID()) {
      this.clientID = other.clientID;
    }
    if (other.isSetUserName()) {
      this.userName = other.userName;
    }
    if (other.isSetToken()) {
      this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token);
;
    }
  }

  public ConnectionProperties deepCopy() {
    return new ConnectionProperties(this);
  }

  @Override
  public void clear() {
    setConnIdIsSet(false);
    this.connId = 0;
    this.clientHostName = null;
    this.clientID = null;
    this.userName = null;
    this.token = null;
  }

  public int getConnId() {
    return this.connId;
  }

  public ConnectionProperties setConnId(int connId) {
    this.connId = connId;
    setConnIdIsSet(true);
    return this;
  }

  public void unsetConnId() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CONNID_ISSET_ID);
  }

  /** Returns true if field connId is set (has been assigned a value) and false otherwise */
  public boolean isSetConnId() {
    return EncodingUtils.testBit(__isset_bitfield, __CONNID_ISSET_ID);
  }

  public void setConnIdIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CONNID_ISSET_ID, value);
  }

  public String getClientHostName() {
    return this.clientHostName;
  }

  public ConnectionProperties setClientHostName(String clientHostName) {
    this.clientHostName = clientHostName;
    return this;
  }

  public void unsetClientHostName() {
    this.clientHostName = null;
  }

  /** Returns true if field clientHostName is set (has been assigned a value) and false otherwise */
  public boolean isSetClientHostName() {
    return this.clientHostName != null;
  }

  public void setClientHostNameIsSet(boolean value) {
    if (!value) {
      this.clientHostName = null;
    }
  }

  public String getClientID() {
    return this.clientID;
  }

  public ConnectionProperties setClientID(String clientID) {
    this.clientID = clientID;
    return this;
  }

  public void unsetClientID() {
    this.clientID = null;
  }

  /** Returns true if field clientID is set (has been assigned a value) and false otherwise */
  public boolean isSetClientID() {
    return this.clientID != null;
  }

  public void setClientIDIsSet(boolean value) {
    if (!value) {
      this.clientID = null;
    }
  }

  public String getUserName() {
    return this.userName;
  }

  public ConnectionProperties setUserName(String userName) {
    this.userName = userName;
    return this;
  }

  public void unsetUserName() {
    this.userName = null;
  }

  /** Returns true if field userName is set (has been assigned a value) and false otherwise */
  public boolean isSetUserName() {
    return this.userName != null;
  }

  public void setUserNameIsSet(boolean value) {
    if (!value) {
      this.userName = null;
    }
  }

  public byte[] getToken() {
    setToken(org.apache.thrift.TBaseHelper.rightSize(token));
    return token == null ? null : token.array();
  }

  public ByteBuffer bufferForToken() {
    return token;
  }

  public ConnectionProperties setToken(byte[] token) {
    setToken(token == null ? (ByteBuffer)null : ByteBuffer.wrap(token));
    return this;
  }

  public ConnectionProperties setToken(ByteBuffer token) {
    this.token = token;
    return this;
  }

  public void unsetToken() {
    this.token = null;
  }

  /** Returns true if field token is set (has been assigned a value) and false otherwise */
  public boolean isSetToken() {
    return this.token != null;
  }

  public void setTokenIsSet(boolean value) {
    if (!value) {
      this.token = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case CONN_ID:
      if (value == null) {
        unsetConnId();
      } else {
        setConnId((Integer)value);
      }
      break;

    case CLIENT_HOST_NAME:
      if (value == null) {
        unsetClientHostName();
      } else {
        setClientHostName((String)value);
      }
      break;

    case CLIENT_ID:
      if (value == null) {
        unsetClientID();
      } else {
        setClientID((String)value);
      }
      break;

    case USER_NAME:
      if (value == null) {
        unsetUserName();
      } else {
        setUserName((String)value);
      }
      break;

    case TOKEN:
      if (value == null) {
        unsetToken();
      } else {
        setToken((ByteBuffer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case CONN_ID:
      return Integer.valueOf(getConnId());

    case CLIENT_HOST_NAME:
      return getClientHostName();

    case CLIENT_ID:
      return getClientID();

    case USER_NAME:
      return getUserName();

    case TOKEN:
      return getToken();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case CONN_ID:
      return isSetConnId();
    case CLIENT_HOST_NAME:
      return isSetClientHostName();
    case CLIENT_ID:
      return isSetClientID();
    case USER_NAME:
      return isSetUserName();
    case TOKEN:
      return isSetToken();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof ConnectionProperties)
      return this.equals((ConnectionProperties)that);
    return false;
  }

  public boolean equals(ConnectionProperties that) {
    if (that == null)
      return false;

    boolean this_present_connId = true;
    boolean that_present_connId = true;
    if (this_present_connId || that_present_connId) {
      if (!(this_present_connId && that_present_connId))
        return false;
      if (this.connId != that.connId)
        return false;
    }

    boolean this_present_clientHostName = true && this.isSetClientHostName();
    boolean that_present_clientHostName = true && that.isSetClientHostName();
    if (this_present_clientHostName || that_present_clientHostName) {
      if (!(this_present_clientHostName && that_present_clientHostName))
        return false;
      if (!this.clientHostName.equals(that.clientHostName))
        return false;
    }

    boolean this_present_clientID = true && this.isSetClientID();
    boolean that_present_clientID = true && that.isSetClientID();
    if (this_present_clientID || that_present_clientID) {
      if (!(this_present_clientID && that_present_clientID))
        return false;
      if (!this.clientID.equals(that.clientID))
        return false;
    }

    boolean this_present_userName = true && this.isSetUserName();
    boolean that_present_userName = true && that.isSetUserName();
    if (this_present_userName || that_present_userName) {
      if (!(this_present_userName && that_present_userName))
        return false;
      if (!this.userName.equals(that.userName))
        return false;
    }

    boolean this_present_token = true && this.isSetToken();
    boolean that_present_token = true && that.isSetToken();
    if (this_present_token || that_present_token) {
      if (!(this_present_token && that_present_token))
        return false;
      if (!this.token.equals(that.token))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    return 0;
  }

  @Override
  public int compareTo(ConnectionProperties other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetConnId()).compareTo(other.isSetConnId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetConnId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.connId, other.connId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetClientHostName()).compareTo(other.isSetClientHostName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClientHostName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientHostName, other.clientHostName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetClientID()).compareTo(other.isSetClientID());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClientID()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientID, other.clientID);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUserName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetToken()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("ConnectionProperties(");
    boolean first = true;

    sb.append("connId:");
    sb.append(this.connId);
    first = false;
    if (!first) sb.append(", ");
    sb.append("clientHostName:");
    if (this.clientHostName == null) {
      sb.append("null");
    } else {
      sb.append(this.clientHostName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("clientID:");
    if (this.clientID == null) {
      sb.append("null");
    } else {
      sb.append(this.clientID);
    }
    first = false;
    if (isSetUserName()) {
      if (!first) sb.append(", ");
      sb.append("userName:");
      if (this.userName == null) {
        sb.append("null");
      } else {
        sb.append(this.userName);
      }
      first = false;
    }
    if (isSetToken()) {
      if (!first) sb.append(", ");
      sb.append("token:");
      if (this.token == null) {
        sb.append("null");
      } else {
        org.apache.thrift.TBaseHelper.toString(this.token, sb);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'connId' because it's a primitive and you chose the non-beans generator.
    if (clientHostName == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientHostName' was not present! Struct: " + toString());
    }
    if (clientID == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientID' was not present! Struct: " + toString());
    }
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class ConnectionPropertiesStandardSchemeFactory implements SchemeFactory {
    public ConnectionPropertiesStandardScheme getScheme() {
      return new ConnectionPropertiesStandardScheme();
    }
  }

  private static class ConnectionPropertiesStandardScheme extends StandardScheme<ConnectionProperties> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ConnectionProperties struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // CONN_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.connId = iprot.readI32();
              struct.setConnIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // CLIENT_HOST_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clientHostName = iprot.readString();
              struct.setClientHostNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // CLIENT_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clientID = iprot.readString();
              struct.setClientIDIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // USER_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.userName = iprot.readString();
              struct.setUserNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // TOKEN
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.token = iprot.readBinary();
              struct.setTokenIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetConnId()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'connId' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, ConnectionProperties struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(CONN_ID_FIELD_DESC);
      oprot.writeI32(struct.connId);
      oprot.writeFieldEnd();
      if (struct.clientHostName != null) {
        oprot.writeFieldBegin(CLIENT_HOST_NAME_FIELD_DESC);
        oprot.writeString(struct.clientHostName);
        oprot.writeFieldEnd();
      }
      if (struct.clientID != null) {
        oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC);
        oprot.writeString(struct.clientID);
        oprot.writeFieldEnd();
      }
      if (struct.userName != null) {
        if (struct.isSetUserName()) {
          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
          oprot.writeString(struct.userName);
          oprot.writeFieldEnd();
        }
      }
      if (struct.token != null) {
        if (struct.isSetToken()) {
          oprot.writeFieldBegin(TOKEN_FIELD_DESC);
          oprot.writeBinary(struct.token);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ConnectionPropertiesTupleSchemeFactory implements SchemeFactory {
    public ConnectionPropertiesTupleScheme getScheme() {
      return new ConnectionPropertiesTupleScheme();
    }
  }

  private static class ConnectionPropertiesTupleScheme extends TupleScheme<ConnectionProperties> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ConnectionProperties struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      oprot.writeI32(struct.connId);
      oprot.writeString(struct.clientHostName);
      oprot.writeString(struct.clientID);
      BitSet optionals = new BitSet();
      if (struct.isSetUserName()) {
        optionals.set(0);
      }
      if (struct.isSetToken()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetUserName()) {
        oprot.writeString(struct.userName);
      }
      if (struct.isSetToken()) {
        oprot.writeBinary(struct.token);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ConnectionProperties struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      struct.connId = iprot.readI32();
      struct.setConnIdIsSet(true);
      struct.clientHostName = iprot.readString();
      struct.setClientHostNameIsSet(true);
      struct.clientID = iprot.readString();
      struct.setClientIDIsSet(true);
      BitSet incoming = iprot.readBitSet(2);
      if (incoming.get(0)) {
        struct.userName = iprot.readString();
        struct.setUserNameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.token = iprot.readBinary();
        struct.setTokenIsSet(true);
      }
    }
  }

}


text:
package com.google.example.eightbitartist;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.widget.ArrayAdapter;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

/**
 * Simple wrapper for an AlertDialog with a list of items, each of which has a display string and
 * and associated value (similar to a "select" tag in HTML).
 */
public class MyListDialog {

    private AlertDialog mDialog;
    private ArrayAdapter<String> mAdapter;
    private HashMap<String, String> mItemMap;

    public MyListDialog(Context context, AlertDialog.Builder builder,
                        DialogInterface.OnClickListener listener) {

        mItemMap = new HashMap<>();
        mAdapter = new ArrayAdapter<>(context, android.R.layout.select_dialog_singlechoice);
        // Create dialog from builder
        builder.setAdapter(mAdapter, listener);
        mDialog = builder.create();
    }

    /**
     * Add an item to the Dialog's list.
     * @param title the human-readable string that should be used to display the item.
     * @param value a value associated with the item that should not be displayed.
     */
    public void addItem(String title, String value) {
        if(mItemMap.put(title, value) == null) {
            mAdapter.add(title);
        }
    }

    /**
     * Remove an item from the list by its title.
     * @param title the title of the item to remove.
     */
    public void removeItemByTitle(String title) {
        mItemMap.remove(title);
        mAdapter.remove(title);
    }

    /**
     * Remove an item from the list by its associated value.
     * Note: this is an O(n) operation.
     * @param value the value of the item to remove.
     */
    public void removeItemByValue(String value) {
        Iterator<Map.Entry<String, String>> iterator = mItemMap.entrySet().iterator();
        while (iterator.hasNext()) {
            Map.Entry<String, String> entry = iterator.next();
            if (entry.getValue().equals(value)) {
                iterator.remove();
                mAdapter.remove(entry.getKey());
                mAdapter.notifyDataSetChanged();
            }
        }
    }

    /**
     * Get the title of the item at an index,
     * @param index the index of the item in the list.
     * @return the item's title.
     */
    public String getItemKey(int index) {
        return mAdapter.getItem(index);
    }

    /**
     * Get the value of an item at an index.
     * @param index the index of the item in the list.
     * @return the item's value.
     */
    public String getItemValue(int index) {
        return mItemMap.get(getItemKey(index));
    }

    /**
     * Show the dialog (calls AlertDialog#show).
     */
    public void show() {
        mDialog.show();
    }

    /**
     * Dismiss the dialog if it is showing (calls AlertDialog#dismiss).
     */
    public void dismiss() {
        if (mDialog.isShowing()) {
            mDialog.dismiss();
        }
    }

}


text:
package com.jme3.scene.control;

import com.jme3.bounding.BoundingVolume;
import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.export.OutputCapsule;
import com.jme3.math.FastMath;
import com.jme3.renderer.Camera;
import com.jme3.renderer.RenderManager;
import com.jme3.renderer.ViewPort;
import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh;
import com.jme3.scene.Spatial;
import java.io.IOException;

/**
 * Determines what Level of Detail a spatial should be, based on how many pixels
 * on the screen the spatial is taking up. The more pixels covered, the more detailed
 * the spatial should be.
 * It calculates the area of the screen that the spatial covers by using its bounding box.
 * When initializing, it will ask the spatial for how many triangles it has for each LOD.
 * It then uses that, along with the trisPerPixel value to determine what LOD it should be at.
 * It requires the camera to do this.
 * The controlRender method is called each frame and will update the spatial's LOD
 * if the camera has moved by a specified amount.
 */
public class LodControl extends AbstractControl implements Cloneable {

    private float trisPerPixel = 1f;
    private float distTolerance = 1f;
    private float lastDistance = 0f;
    private int lastLevel = 0;
    private int numLevels;
    private int[] numTris;

    /**
     * Creates a new LodControl.
     */
    public LodControl(){
    }

    /**
     * Returns the distance tolerance for changing LOD.
     *
     * @return the distance tolerance for changing LOD.
     *
     * @see #setDistTolerance(float)
     */
    public float getDistTolerance() {
        return distTolerance;
    }

    /**
     * Specifies the distance tolerance for changing the LOD level on the geometry.
     * The LOD level will only get changed if the geometry has moved this
     * distance beyond the current LOD level.
     *
     * @param distTolerance distance tolerance for changing LOD
     */
    public void setDistTolerance(float distTolerance) {
        this.distTolerance = distTolerance;
    }

    /**
     * Returns the triangles per pixel value.
     *
     * @return the triangles per pixel value.
     *
     * @see #setTrisPerPixel(float)
     */
    public float getTrisPerPixel() {
        return trisPerPixel;
    }

    /**
     * Sets the triangles per pixel value.
     * The LodControl will use this value as an error metric
     * to determine which LOD level to use based on the geometry's
     * area on the screen.
     *
     * @param trisPerPixel triangles per pixel
     */
    public void setTrisPerPixel(float trisPerPixel) {
        this.trisPerPixel = trisPerPixel;
    }

    @Override
    public void setSpatial(Spatial spatial){
        if (!(spatial instanceof Geometry))
            throw new IllegalArgumentException("LodControl can only be attached to Geometry!");

        super.setSpatial(spatial);
        Geometry geom = (Geometry) spatial;
        Mesh mesh = geom.getMesh();
        numLevels = mesh.getNumLodLevels();
        numTris = new int[numLevels];
        for (int i = numLevels - 1; i >= 0; i--)
            numTris[i] = mesh.getTriangleCount(i);
    }

    public Control cloneForSpatial(Spatial spatial) {
        try {
            LodControl clone = (LodControl) super.clone();
            clone.lastDistance = 0;
            clone.lastLevel = 0;
            clone.numTris = numTris != null ? numTris.clone() : null;
            return clone;
        } catch (CloneNotSupportedException ex) {
            throw new AssertionError();
        }
    }

    @Override
    protected void controlUpdate(float tpf) {
    }

    protected void controlRender(RenderManager rm, ViewPort vp){
        BoundingVolume bv = spatial.getWorldBound();

        Camera cam = vp.getCamera();
        float atanNH = FastMath.atan(cam.getFrustumNear() * cam.getFrustumTop());
        float ratio = (FastMath.PI / (8f * atanNH));
        float newDistance = bv.distanceTo(vp.getCamera().getLocation()) / ratio;
        int level;

        if (Math.abs(newDistance - lastDistance) <= distTolerance)
            level = lastLevel; // we haven't moved relative to the model, send the old measurement back.
        else if (lastDistance > newDistance && lastLevel == 0)
            level = lastLevel; // we're already at the lowest setting and we just got closer to the model, no need to keep trying.
        else if (lastDistance < newDistance && lastLevel == numLevels - 1)
            level = lastLevel; // we're already at the highest setting and we just got further from the model, no need to keep trying.
        else{
            lastDistance = newDistance;

            // estimate area of polygon via bounding volume
            float area = AreaUtils.calcScreenArea(bv, lastDistance, cam.getWidth());
            float trisToDraw = area * trisPerPixel;
            level = numLevels - 1;
            for (int i = numLevels; --i >= 0;){
                if (trisToDraw - numTris[i] < 0){
                    break;
                }
                level = i;
            }
            lastLevel = level;
        }

        spatial.setLodLevel(level);
    }

    @Override
    public void write(JmeExporter ex) throws IOException{
        super.write(ex);
        OutputCapsule oc = ex.getCapsule(this);
        oc.write(trisPerPixel, "trisPerPixel", 1f);
        oc.write(distTolerance, "distTolerance", 1f);
        oc.write(numLevels, "numLevels", 0);
        oc.write(numTris, "numTris", null);
    }

    @Override
    public void read(JmeImporter im) throws IOException{
        super.read(im);
        InputCapsule ic = im.getCapsule(this);
        trisPerPixel = ic.readFloat("trisPerPixel", 1f);
        distTolerance = ic.readFloat("distTolerance", 1f);
        numLevels = ic.readInt("numLevels", 0);
        numTris = ic.readIntArray("numTris", null);
    }

}


text:
/*Created by Muhammad Imran on 4/6/14. */

#import <Foundation/Foundation.h>

@class XMLContextConfiguration;

/*!
 @discussion
    Unmarshals a given XML document to a pre-configured Objective-C object.
 */
@interface XMLUnmarshaller : NSObject {
    /*!
     @discussion
        The current XML context configuration.  Contains type mappers, mapping definitions, etc.
     */
    XMLContextConfiguration *contextConfiguration;
}

@property (nonatomic, strong) XMLContextConfiguration *contextConfiguration;

/*!
 @discussion
    Initializes a new XMLMarshaller instance with the given configuration context.
 @result
    The object instance.
 */
- (id)initWithContextConfiguration:(XMLContextConfiguration *)contextConfiguration;

/*!
 @discussion
    Unmarshals the given XML document to a configured Objective-C object.  The unmarshalling
    framework will automatically select the mapping to use based on the name of the root node.
 @param xml
    The XML to unmarshal.
 @result
    The unmarshalled Objective-C object.
 */
- (id)unmarshal:(NSString *)xml;

/*!
 @discussion
    Unmarshals the given XML document to a configured Objective-C object.  In this case, you must
    provide a mapping to use for the document.  Use this method when there could be multiple
    mappings provided for the same root node, which would make auto selection impossible.
 @param xml
    The XML document to unmarshal
 @param rootNode
    The class that implements the mappings for the root of the document.
 @result
    The unmarshalled Objective-C object.
 */
- (id)unmarshal:(NSString *)xml rootNode:(Class)rootNode;

@end


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

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <defaults autowire="true" autoconfigure="true" public="false" />

        <prototype namespace="Networking\InitCmsBundle\Form\"
                   resource="../../Form"
                   exclude="../../Form/{DataTransformer,ChoiceList}"
                   public="true">
        </prototype>

        <service id="Networking\InitCmsBundle\Form\Extension\ModelTypeExtension">
            <tag name="form.type_extension" extended-type="Sonata\AdminBundle\Form\Type\ModelType"/>
        </service>

        <service id="Networking\InitCmsBundle\Form\Extension\Select2Extension">
            <tag name="form.type_extension" extended-type="Symfony\Component\Form\Extension\Core\Type\ChoiceType"/>
        </service>

        <service id="Networking\InitCmsBundle\Form\Type\IconradioType">
            <argument key="$templates">%networking_init_cms.page.templates%</argument>
        </service>
    </services>
</container>


text:
import * as request from "request";
import { startServer } from "./helper";
import { stopServer } from "./helper";

const PORT = 3200;
const PROTO = "http";
const ADDRESS = "127.0.0.1";
const BASEURI = PROTO + "://" + ADDRESS + ":" + PORT;

function parseBody(body) {
    try {
        return JSON.parse(body);
    } catch (err) {
        return { error: err };
    }
}

describe("operate on /", () => {

    beforeEach((done) => startServer(done));

    afterEach((done) => stopServer(done));

    it("should return a list of services on GET /", (done) => {
        request(BASEURI, { method: "GET" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            const payload = parseBody(body);
            expect(response.statusCode).toBe(200);
            expect(payload.status).toEqual("ok");
            expect(Array.isArray(payload.data)).toBe(true);
            done();
        });
    });
    it("should return an error for none existing elements", (done) => {
        request(BASEURI + "/$/§", { method: "GET" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            expect(response.statusCode).toBe(404);
            done();
        });
    });
    it("should return an error for none existing resource", (done) => {
        request(BASEURI + "/$/", { method: "GET" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            expect(response.statusCode).toBe(404);
            done();
        });
    });
    it("should not implement POST on /", (done) => {
        request(BASEURI, { method: "POST" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            expect(response.statusCode).toBe(404);
            done();
        });
    });
    it("should not implement DELETE on /", (done) => {
        request(BASEURI, { method: "DELETE" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            expect(response.statusCode).toBe(404);
            done();
        });
    });

    it("should return a list of albums /mediacontent/albums", (done) => {
        request(BASEURI + "/mediacontent/albums", { method: "GET" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            expect(JSON.parse(response.body).data.length > 0).toBeTruthy();
            done();
        });
    });

    it("$limit should limit returned elements", (done) => {
        request(BASEURI + "/mediacontent/albums?$limit=2", { method: "GET" }, (error, response, body) => {
            if (error) {
                console.log(error, response, body);
            }
            expect(JSON.parse(response.body).data.length === 2).toBeTruthy();
            done();
        });
    });
});


text:
namespace ash {
namespace file_system_provider {

RegistryInterface::~RegistryInterface() {
}

RegistryInterface::RestoredFileSystem::RestoredFileSystem() {
}

RegistryInterface::RestoredFileSystem::RestoredFileSystem(
    const RestoredFileSystem& other) = default;

RegistryInterface::RestoredFileSystem::~RestoredFileSystem() {
}

}  // namespace file_system_provider
}  // namespace ash


text:
<TITLE>Review for Anywhere But Here (1999)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Anywhere But Here (1999)

reviewed by
Dustin Putman

Anywhere But Here      * * * 1/2 (out of * * * * )

Directed by Wayne Wang.
Cast: Natalie Portman, Susan Sarandon, Shawn Hatosy, Corbin Allred, Hart
Bochner, Thora Birch, Heather McComb, Ashley Johnson, Heather DeLoach,
Elisabeth Moss, Bonnie Bedelia, John Diehl, Caroline Aaron, Eileen Ryan, Paul
Guilfoyle, Ray Baker, Megan Mullally, Bob Sattler.
1999 - 114 minutes
Rated PG-13 (for mild profanity).
Reviewed by Dustin Putman, November 13, 1999.

Wayne Wang is a masterful filmmaker who first proved in 1993's "The Joy Luck
Club" that he has a talent and affinity for telling wonderfully accurate
stories about female characters, and carries that right into "Anywhere But
Here," which is one of the most truthful and affectionate films about a
mother-daughter relationship in many years, and ranks well within the same
league as 1983's "Terms of Endearment" and 1989's "Steel Magnolias." The
fundamental ingredients for a manipulative sap-fest are all in place, and yet
the film never once seems to be pulling at your heartstrings for the main
reason being to get you to cry. The richly textured, multi-layered
screenplay, by Academy Award winner Alvin Sargent (1980's "Ordinary People"),
is too assured to aim for simple melodrama, and the performances by Natalie
Portman and Susan Sarandon are just about as remarkable as two performances
could possibly be. They raise the already-winning material to an even higher
plateau of success.

Based on a 1986 novel by Mona Simpson, "Anywhere But Here" begins as the
eccentric, middle-aged Adele (Susan Sarandon) is driving through the desert
with her 14-year-old daughter Ann (Natalie Portman), headed for Beverly
Hills. Adele, at times a childish and frustrating woman who doesn't listen to
what others tell her, is set on putting her MA degree in early education to
positive use and getting Ann into showbiz. Ann, however, wants nothing to do
with acting, and is distressed to have just been yanked from her hometown of
Bay City, Wisconsin, leaving her relatives and particularly, her soulmate,
and cousin, Benny (Shawn Hatosy). Getting a small apartment "outside of the
posh section of Beverly Hills, but still in the school district," Adele
easily gets a job teaching, while Ann starts school at Beverly Hills High,
where she comments, "everyone looks like they're going to the beach." Longing
to be back east but willing to stick things out for love of her mother, Ann
quickly makes some new friends at school and catches the eye of a charming,
poetry-loving classmate Peter (Corbin Allred).

Refreshingly without a flashy story device, "Anywhere But Here" is that rare,
perceptive Hollywood film that is about the characters and their emotional
growth and conflicts. Admittedly, not a great deal happens plot-wise, but
more occurs underneath the surface than most films would even dream about.

The fate of the film hinges almost completely on its realism and details, and
it gets everything exactly right. The relationship between Adele and Ann is a
complex one, and although the dependent Adele drives her crazy, Ann
unconditionally loves and respects her, even when she wishes things could be
more normal for them. Adele has a big personality, and always is using her
charm to solve problems, sometimes with unfortunate results. Ann often feels
like the mother between the two, as she always seems to be comforting Adele
when things don't go her way. As the years pass by and high school graduation
approaches for Ann, she desperately wants to go to an eastern college, and
knows that it's about time she branches off on her own, but also fears that
her mother may not be able to make it on her own. Adele loves her daughter so
much, and even though she realizes she isn't the perfect, ideal mother, she
confesses at one point that Ann "was the reason I was born."

In "Anywhere But Here," every element converges together to create a film
that is nearly flawless in its authenticity, right down to the smallest
detail. The delineation of teenagers and friendship, despite being a minor
element in the story, is perhaps more genuine than in any other film this
year. When Ann makes several girlfriends, we wisely are not shown when or how
they meet, because it is a trivial detail. Instead, our first scene with Ann
and her new friends, set in gym class as they are running around a track,
captures the exact nuances and conversations that occur between teenagers in
such a situation. Breaking through the wall of cliches, Ann's friends
actually act and speak like kids who are 15 or 16 years old, as they do not
acquire a vocabulary as large as the Webster Dictionary, and are performed
with an air of naturalism that is wholeheartedly believable, by Heather
McComb (1998's "Apt Pupil"), Ashley Johnson (TV's "Growing Pains," 1998's
"Dancer, Texas Pop. 81), and Heather DeLoach (1995's "The Little Princess").
They are small roles, but vitally important and commendable.

Another area in which the film excels in is its depiction of how time changes
things. Spanning a period of four years, one of the most fully touching
interludes occurs midway through when tragedy strikes back in Wisconsin, and
Adele and Ann travel to attend the funeral of a relative. At this point, they
have been gone for two years, and as Ann observes, "the houses seemed
smaller, the streets more narrow." There is a quiet, powerful scene between
Ann and her best friend whom she hasn't seen since they left, Mary (Thora
Birch, 1999's "American Beauty"), and it perfectly shows how people evolve,
for better or worse, over the years. Thora Birch, appearing unbilled, makes
quite a striking impression in only two scenes.

The innocence of young romance is also warmly done, and one scene with Ann
and Peter in which she instructs him to strip, only for them to end up
embracing in a hug, is purely gratifying without being needlessly
exploitative. Corbin Allred is charismatic, funny, and virtuous as Peter, and
works well with Portman. The same goes for the lovely, almost nostalgic,
friendship between Ann and Benny, likably played by Shawn Hatosy (1999's
"Outside Providence"), who may be cousins but truly love each other. One
sequence, in which Benny comes to visit them in California, and he and Ann
stay up late at night chatting away, is filled with such a sense of childhood
purity, as they are on the verge of becoming adults, that it easily
transcends even its aspirations.

Amidst all of the wonderful supporting players, others of which seem to have
been edited down, such as Bonnie Bedelia and Eileen Ryan, as Ann's aunt and
grandmother, respectively, the film always keeps its focus on Ann and Adele.
In a role that could very well be a landmark in her career, Susan Sarandon is
dynamite as the outwardly headstrong, but insecure, Adele. Early on, one
wonders what exactly is wrong with Adele, with a possible personality
disorder looking more and more likely, but we progressively learn that she is
not mentally ill, but simply enraptured in her undying love for her one and
only daughter. Sarandon handles each second she is on screen with the exact
amount of sympathy and idiosyncrasies, and not once allows Adele to appear
"wacky" or exaggerated.

If Sarandon is a marvel to behold, 18-year-old Natalie Portman is nothing
less than extraordinary, and with this film joining her other Oscar-caliber
work in 1994's "The Professional" and 1996's "Beautiful Girls," Portman has
the chance of becoming Gen-Y's answer to Jodie Foster; she's that good. As
with most teenagers, Ann is someone who occasionally can be spiteful and even
a little mean, but whom we grow to care deeply about because she is also an
intelligent, caring young woman whose mother is the most important person in
her life, which makes things even more difficult for her when she wants to
leave for college. In one heartbreaking sequence, she is forced to audition
for a film, and when Adele sneaks in to watch Ann's monologue, she discovers
her daughter making an obvious mockery of the way she acts.

At first glimpse, "Anywhere But Here" may appear to trudge through well-worn
dramatic territory, and it might have had it been put into lesser hands. The
meticulous writing, verifiable direction by Wayne Wang, effective music score
by Danny Elfman, picaresque cinematography by Roger Deakins, and astonishing
performances from every member of the entire cast (even Megan Mullally, of
TV's "Will and Grace," leaves a major impression in one late scene), all add
up to make "Anywhere But Here" an exceptional motion picture that shouldn't
be degraded by being unfairly labeled a "chick flick." It is a true-to-life
examination of the bond between a mother and a daughter, and has universal
appeal for anyone who has ever had a parent. My guess is that that's a fairly
large percentage of the viewing population.

     - Copyright 1999 by Dustin Putman
       Http://www.young-hollywood.com

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package maccommand

import (
	"context"
	"testing"

	"github.com/stretchr/testify/require"
	"github.com/stretchr/testify/suite"

	"github.com/brocaar/chirpstack-api/go/v3/gw"
	"github.com/brocaar/chirpstack-network-server/v3/internal/band"
	"github.com/brocaar/chirpstack-network-server/v3/internal/helpers"
	"github.com/brocaar/chirpstack-network-server/v3/internal/models"
	"github.com/brocaar/chirpstack-network-server/v3/internal/storage"
	"github.com/brocaar/lorawan"
)

type LinkCheckTestSuite struct {
	TestBase
}

func (ts *LinkCheckTestSuite) TestLinkCheckReq() {
	assert := require.New(ts.T())
	ctx := context.Background()

	ds := storage.DeviceSession{
		DevEUI:                [8]byte{1, 2, 3, 4, 5, 6, 7, 8},
		EnabledUplinkChannels: []int{0, 1},
	}
	assert.NoError(storage.SaveDeviceSession(ctx, ds))

	block := storage.MACCommandBlock{
		CID: lorawan.LinkCheckReq,
		MACCommands: storage.MACCommands{
			lorawan.MACCommand{
				CID: lorawan.LinkCheckReq,
			},
		},
	}

	rxPacket := models.RXPacket{
		TXInfo: &gw.UplinkTXInfo{},
		RXInfoSet: []*gw.UplinkRXInfo{
			{
				LoraSnr: 5,
			},
		},
	}

	assert.NoError(helpers.SetUplinkTXInfoDataRate(rxPacket.TXInfo, 2, band.Band()))

	resp, err := Handle(ctx, &ds, storage.DeviceProfile{}, storage.ServiceProfile{}, nil, block, nil, rxPacket)
	assert.NoError(err)

	assert.Len(resp, 1)
	assert.Equal(storage.MACCommandBlock{
		CID: lorawan.LinkCheckAns,
		MACCommands: storage.MACCommands{
			{
				CID: lorawan.LinkCheckAns,
				Payload: &lorawan.LinkCheckAnsPayload{
					GwCnt:  1,
					Margin: 20, // 5 - -15 (see SpreadFactorToRequiredSNRTable)
				},
			},
		},
	}, resp[0])
}

func TestLinkCheck(t *testing.T) {
	suite.Run(t, new(LinkCheckTestSuite))
}


text:
package org.apache.abdera.ext.serializer.impl;

import javax.xml.namespace.QName;

import org.apache.abdera.ext.serializer.Conventions;
import org.apache.abdera.ext.serializer.ObjectContext;
import org.apache.abdera.ext.serializer.SerializationContext;
import org.apache.abdera.writer.StreamWriter;

public class IRISerializer extends ElementSerializer {

    public IRISerializer(QName qname) {
        super(qname);
    }

    public IRISerializer() {
        super(null);
    }

    protected void init(Object source,
                        ObjectContext objectContext,
                        SerializationContext context,
                        Conventions conventions) {
        QName qname = this.qname != null ? this.qname : getQName(objectContext.getAccessor());
        StreamWriter sw = context.getStreamWriter();
        sw.startElement(qname);
    }

    protected void process(Object source,
                           ObjectContext objectContext,
                           SerializationContext context,
                           Conventions conventions) {
        writeAttributes(source, objectContext, context, conventions);
        writeTextValue(source, objectContext, context, conventions);
    }
}


text:
<?php

namespace Telltale\Util\Monolog\Formatter;

use Monolog\Formatter\WildfireFormatter;

class WildfireTableFormatter extends WildfireFormatter
{
    /**
     * {@inheritdoc}
     */
    public function format(array $record)
    {
        if (!isset($record['context']['telltale-table']) ||
            !is_array($record['context']['telltale-table'])
        ) {
            return parent::format($record);
        }

        $record = $this->normalize($record);

        $type = 'TABLE';
        $file = isset($record['extra']['file']) ? $record['extra']['file'] : '';
        $line = isset($record['extra']['line']) ? $record['extra']['line'] : '';
        $label = $record['channel'] . ': ' . $record['message'];
        $message = $record['context']['telltale-table'];
        $handleError = false;

        $json = $this->toJson(
            array(
                array(
                    'Type'  => $type,
                    'File'  => $file,
                    'Line'  => $line,
                    'Label' => $label,
                ),
                $message,
            ),
            $handleError
        );

        return sprintf('%s|%s|', strlen($json), $json);
    }
}


text:
Introduction
============

pgbrewer is a set og Bash scripts to manage multiple PostgreSQL version
with multiple instances, with multiple database in it, without
loosing your temper.

============

Prerequisites
-------------

pgbrewer is a set of bash scripts, so bash is required. Apart from bash,
standard tools found on any Linux server are needed: `grep`, `sed`, `awk`,
`tar`, `gzip`, `ssh`, `scp`
To execute your order pgbrewer needs some more things:
`python-dev`, `perl-dev`, `readline-dev`, `zlib-dev`, `rsync`, `gcc`,
`make`, `ssl-dev`

Installation from the sources
-----------------------------

The latest version of can be downloaded from:

https://github.com/sttachoires/pgbrewer/archive/master.zip

First unpack the zip:

    unzip master.zip

Then, go to the `pgbrewer-master` directory and edit `config.mk` to fit your
system. Once done run `make` (or `gmake`) to replace the interpreter and
paths in the scripts:

    make all

Finally, install it, as root:

    make install

Then

    make checkinstall

By default, the files are installed in `/home/pgbrewer`:

* scripts are installed in `/home/pgbrewer/bin`

* actions used by pgbrewer are installed in `/home/pgbrewer/lib/pgbrewer`

* configuration samples are installed in `/home/pgbrewer/etc/pgbrewer`

* manual pages are installed in `/home/pgbrewer/share/pgbrewer/man`


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.Management.Automation;

namespace Microsoft.Azure.Commands.WebApps.Cmdlets.WebApps
{
    /// <summary>
    ///     Gets the automatic backup configuration for an Azure Web App
    /// </summary>
    [Cmdlet(VerbsCommon.Get, "AzureRmWebAppBackupConfiguration"), OutputType(typeof(AzureWebAppBackupConfiguration))]
    public class GetAzureWebAppBackupConfiguration : WebAppOptionalSlotBaseCmdlet
    {
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            var configuration = WebsitesClient.GetWebAppBackupConfiguration(ResourceGroupName, Name, Slot);
            WriteObject(BackupRestoreUtils.BackupRequestToAppBackupConfiguration(configuration, ResourceGroupName, Name, Slot));
        }
    }
}


text:
package org.wikidata.wdtk.datamodel.json.jackson;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import java.io.IOException;

import org.junit.Test;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

public class TestStatement {

	ObjectMapper mapper = new ObjectMapper();

	@Test
	public void testEmptyStatementToJson() throws JsonProcessingException {
		JacksonStatement statement = JsonTestData.getTestNoValueStatement();

		String result = mapper.writeValueAsString(statement);
		JsonComparator.compareJsonStrings(JsonTestData.JSON_NOVALUE_STATEMENT,
				result);
	}

	@Test
	public void testEmptyStatementNoIdToJson() throws JsonProcessingException {
		JacksonStatement statement = JsonTestData.getTestNoValueNoIdStatement();

		String result = mapper.writeValueAsString(statement);
		JsonComparator.compareJsonStrings(
				JsonTestData.JSON_NOVALUE_NOID_STATEMENT, result);
	}

	@Test
	public void testEmptyStatementToJava() throws
			IOException {
		JacksonStatement result = mapper.readValue(
				JsonTestData.JSON_NOVALUE_STATEMENT, JacksonStatement.class);
		result.setSubject(JsonTestData.getEmtpyTestItemDocument().getEntityId());

		assertNotNull(result);
		assertNull(result.getValue());
		assertNull(result.getClaim().getValue());
		assertEquals(JsonTestData.getTestNoValueStatement(), result);

	}

	@Test
	public void testEquality() {
		JacksonStatement correctStatement = new JacksonStatement(
				JsonTestData.TEST_STATEMENT_ID, JsonTestData.TEST_NOVALUE_SNAK);
		correctStatement.setSubject(JsonTestData.getEmtpyTestItemDocument()
				.getEntityId());
		JacksonStatement wrongId = new JacksonStatement("another id",
				JsonTestData.TEST_NOVALUE_SNAK);
		wrongId.setSubject(JsonTestData.getEmtpyTestItemDocument()
				.getEntityId());

		assertEquals(JsonTestData.getTestNoValueStatement(),
				JsonTestData.getTestNoValueStatement());
		assertEquals(JsonTestData.getTestNoValueStatement(), correctStatement);
		assertFalse(JsonTestData.getTestNoValueStatement().equals(wrongId));
	}

	@Test
	public void testToString() {
		assertNotNull(JsonTestData.getTestNoValueStatement().toString());
	}

	@Test
	public void testHashCode() {
		assertNotNull(JsonTestData.getTestNoValueStatement().hashCode());
	}
}


text:
Acest depozit conține o serie de întrebări pentru interviuri tehnice pe partea
de front-end, care pot fi folosite pentru a verifica un potențial candidat. Nu
este deloc recomandat să fie folosite toate întrebările pentru un singur
candidat ( ar lua câteva ore ). Alegând câteva întrebări din această listă ar
trebui să te ajute în verificarea calităților pe care le urmărești.

Articolul lui [Rebecca Murphey](http://rmurphey.com/) [Baseline For Front-End Developers](http://rmurphey.com/blog/2012/04/12/a-baseline-for-front-end-developers/) este de asemenea o resursă bună de citit înainte de a intra într-un interviu.

**Notă:** Ține în minte că multe dintre întrebări au răspuns liber și ar putea
duce la discuții interesante, care ți-ar putea spune mai multe despre
capacitățile persoanei.

## Cuprins

  1. [Contribuitori inițiali](#contributors)
  1. [Întrebări generale](#general)
  1. [Întrebări despre HTML](#html)
  1. [Întrebări despre CSS](#css)
  1. [Întrebări despre JS](#js)
  1. [Întrebări despre jQuery](#jquery)
  1. [Întrebări despre programare](#jscode)
  1. [Întrebări amuzante](#fun)
  1. [Alte resurse bune](#references)

####[[⬆]](#toc) Contribuitori inițiali:

Majoritatea întrebărilor au fost adunate dintr-un fir de discutie [oksoclap](http://oksoclap.com/) creat de [Paul Irish](http://paulirish.com) ([@paul_irish](http://twitter.com/paul_irish)) la care au contribuit apoi:

* [@bentruyman](http://twitter.com/bentruyman) - http://bentruyman.com
* [@cowboy](http://twitter.com/cowboy) - http://benalman.com
* [@ajpiano](http://ajpiano) - http://ajpiano.com
* [@SlexAxton](http://twitter.com/slexaxton) - http://alexsexton.com
* [@boazsender](http://twitter.com/boazsender) - http://boazsender.com
* [@miketaylr](http://twitter.com/miketaylr) - http://miketaylr.com
* [@vladikoff](http://twitter.com/vladikoff) - http://vladfilippov.com
* [@gf3](http://twitter.com/gf3) - http://gf3.ca
* [@jon_neal](http://twitter.com/jon_neal) - http://twitter.com/jon_neal
* [@wookiehangover](http://twitter.com/wookiehangover) - http://wookiehangover.com
* [@iansym](http://twitter.com/iansym) - http://twitter.com/iansym

####[[⬆]](#toc) Întrebări generale:

* Ce ai învățat ieri / săptămâna asta?
* Ce te fascinează sau interesează la programare?
* Ce aspecte de UI, Securitate, Performanță, SEO, Întreținere sau Tehnologie iei în cosiderare când construiești o aplicație web sau un site?
* Povestește despre mediul de lucru preferat. (OS, Editor, Browsere, Unelte,
  etc.)
* Îți poți descrie fluxul de lucru când creezi o pagină web?
* Poți descrie difereța dintre "progressive enhancement" și "graceful
  degradation"?
  * Puncte bonus pentru descrierea modalităților de detecție
    a capabilităților suportate de browsere
* Explică ce înseamnă "HTML Semantic".
* Cum ai optimiza părțile componente ale unui site web?
  * Sunt urmărite mai multe soluții printre care:
    * Concatenarea fișierelor
    * Minificarea fișierelor
    * Cache
    * etc.
* De ce este mai bine să servești conținutul static din mai multe domenii?
  * Câte resurse va descarca un browser de la un domeniu la un moment dat?
* Numește 3 moduri pentru a scădea timpul de încarcare a paginii. (perceput
  sau chiar timpul de descărcare)
* Dacă intri într-un proiect și se folosesc taburi în loc de spații, ce faci?
  * Sugerezi ca proiectul să folosească ceva de genul EditorConfig (http://editorconfig.org)
  * Te conformezi convențiilor (rămâi consistent)
  * `issue :retab! command`
* Scrie o simplă pagină de slideshow
  * Puncte bonus dacă nu se folosește JS.
* Ce unelte folosești pentru a testa performanța codului tău?
  * Profiler, JSPerf, Dromaeo
* Dacă ai putea învăța o tehnologie anul asta, care ar fi?
* Explică importanța standardelor și a organismelor de standardizare.
* Ce este FOUC? Cum eviți Fouc?

####[[⬆]](#toc) Întrebări HTML:

* La ce este util `doctype`?
* Care este diferența dintre "standards mode" și "quirks mode"?
* Care sunt limitările când servești pagini XHTML?
  * Apar probleme când servești pagini ca `application/xhtml+xml`?
* Cum servești o pagină cu conținut în mai multe limbi?
  * La ce trebuie să fi atent când faci design sau dezvolți pentru site-uri multilingve
* La ce sunt utile atributele `data-`?
* Considerând HTML5 ca o platformă web deschisă, care sunt parțile componente
  alte HTML5?
* Descrie diferența dintre cookies, sessionStorage și localStorage.

####[[⬆]](#toc) Întrebări CSS:

* Descrie ce este un fișier CSS de resetare și la ce este util.
* Descrie 'Float' si cum funcționează.
* Care sunt tehnicile de 'clearing' și care este potrivită pentru ce context
* Explică conceptul de mape CSS și cum le-ai implementa pe o pagină sau un
  site.
* Care sunt tehnicile tale preferate pentru inlocuirea imaginilor și care când
  le folosești?
* Hack-uri de proprietăți CSS, includerea condițională a fișierelor .css,
  sau... altceva?
* Cum servești pagini pentru browsere cu capabilități reduse?
  * Ce procese/tehnici folosești?
* Care sunt diferitele modalități de a ascunde vizual conținut (dar sa-l faci
  disponibil pentru cititoare de ecrane) ?
* Ai folosit vreodată un system 'grid' și dacă da, ce preferi?
* Ai folosit sau implementat 'media queries' sau interfețe/CSS specific pentru
  mobile ?
* Familiarități cu stilizarea unui SVG?
* Cum optimizezi paginile pentru print?
* Ceva 'gotchas' când scrii CSS eficient?
* Care sunt avantajele/dezavantajele folosirii preprocesoarelor CSS (SASS,
  Compass, Stylus, LESS)
  * Descrie ce îți place respectiv nu îți place la preprocesoarele CSS pe care
    le-ai folosit
* Cum ai implementa un design care folosește fonturi non-standard?
  * Webfonts (servicii fonturi ca: Google Webfonts, Typekit etc.)
* Explică cum un browser determina ce elemente se potrivesc unui selector CSS?
* Explică cum întelegi conceptul dea "box model" si cum îi spui browser-ului
  prin CSS cum sa randeze layoutul în modele diferite

####[[⬆]](#toc) Întrebări JS:

* Explică "event delegation".
* Explică cum funcționează `this` în JavaScript.
* Explică cum funcționează moștenirea prototipală.
* Cum procedezi cu testarea codului JavaScript?
* AMD vs. CommonJS?
* Ce este un "hashtable"?
* Explică de ce următoarea nu functionează ca un IIFE: `function foo(){ }();`
  * Ce trebuie schimbat ca să o transformi într-o IIFE?
* Care este diferența dintre o variabilă care este: `null`, `undefined` sau
  `undeclared`?
  * Cum ai face sa verifici după fiecare dintre stările acestea?
* Ce este un "closure" și cum/de ce ai folosi unul?
* Care este un caz în care sunt folosite funcții anonime?
* Explică "Javascript module pattern" și cand l-ai folosi.
  * Puncte bonus pentru menționarea namespace-uri curate.
  * Daca modulele sunt fără namespace?
* Cum îți organizezi codul? (module pattern, moștenire?)
* Care este diferența dintre obiecte host si obiecte native?
* Diferența dintre: `function Person(){}`, `var person = Person()` și `person = new Person()`
* Care este diferența dintre `.call` și `.apply`?
* Explică `Function.prototype.bind`?
* Când îți optimizezi codul?
* Poți explica cum funcționează moștenirea in JavaScript?
* Când ai folosi `document.write()`?
  * Cele mai multe reclame generate încă folosesc `document.write()` deși este
    o soluție neplacută
* Care este diferența dintre 'feature detection', 'feature inference' și
  folosirea șirului User Agent?
* Explică AJAX cât mai detaliat posibil.
* Explică cum funcționează JSONP (și cum nu este AJAX prea mult).
* Ai folosit vreodată template-uri JavaScript?
  * Dacă da, ce librării ai folosit? (Mustache.js, Handlebars etc.)
* Explică "hoisting".
* Descrie "event bubbling".
* Care este diferența dintre un atribut și o proprietate?
* De ce nu este o idee bună extinderea obiectelor JavaScript DOM/"built-in"?
* De ce este extinderea "built in"-urilor o idee bună?
* Care este diferența dintre evenimentul "document load" și "document ready"?
* Care este diferența dintre "==" și "==="?
* Descrie cum poți extrage un parametru de interogare din adresa URL a browser-ului.
* Explică politica "same-origins" în legătură cu JavaScript.
* Descrie pattern-uri de moștenire în JavaScript.
* Fă următorul cod să funcționeze:
```javascript
[1,2,3,4,5].duplicate(); // [1,2,3,4,5,1,2,3,4,5]
```
* Descrie o strategie pentru memoizare (evită repetarea calculelor) în
  JavaScript.
* Ce este o expresie ternară și ce indică cuvântul ternar?
* Ce este aritatea unei funcții?
* Ce este `"use strict;"` și care sunt avantajele si dezavantajele folosirii
  acestuia?

####[[⬆]](#toc) Întrebări jQuery:

* Explică "chaining".
* Explică "deferreds".
* Poți vorbi despre ceva optimizări specifice jQuery pe care le poți
  implementa?
* Ce face `.end()`?
* Când și cum ai folosi un "namespace" pentru a lega un handler de eveniment?
* Numește 4 valori diferite pe care le poți trimite unei metode jQuery.
  * Selector (string), HTML (string), Callback (function), HTMLElement, object, array, element array, jQuery Object etc.
* Ce este coada de efecte - "effects queue"?
* Care este diferența dintre `.get()`, `[]`, și `.eq()`?
* Care este diferența dintre `.bind()`, `.live()`, și `.delegate()`?
* Care este diferența dintre `$` și `$.fn`? Sau doar ce este `$.fn`.
* Optimizează acest selector:
```javascript
$(".foo div#bar:eq(0)")
```

####[[⬆]](#toc) Întrebări despre cod:

```javascript
~~3.14
```
*Întrebare: Ce valoare este returnată de expresia de mai sus?*

**Răspuns: 3**

```javascript
"i'm a lasagna hog".split("").reverse().join("");
```
*Întrebare: Ce valoare este returnată de expresia de mai sus?*

**Răspuns: "goh angasal a m'i"**

```javascript
( window.foo || ( window.foo = "bar" ) );
```
*Întrebare: Care este valoare lui `window.foo`?*

**Răspuns: "bar"** *(doar dacă `window.foo` era "falsey" altfel va returna
valoarea inițială)*

```javascript
var foo = "Hello"; (function() { var bar = " World"; alert(foo + bar); })(); alert(foo + bar);
```
*Întrebare: Care este rezultatul celor două apelări ale funcției alert?*

**Răspuns: "Hello World" & ReferenceError: bar is not defined**

```javascript
var foo = [];
foo.push(1);
foo.push(2);
```
*Întrebare: Care este valoarea lui `foo.length`?*

**Răspuns: `2`**

```javascript
var foo = {};
foo.bar = 'hello';
```
*Întrebare: Care este valoarea lui `foo.length`?*

**Răspuns: `undefined`**

####[[⬆]](#toc) Întrebări amuzante:

* Care este cel mai mișto lucru pe care l-ai programat sau de care ești cel mai
  mândru?
* Ce îți place cel mai mult la uneltele de dezvoltare pe care le folosești?
* Ai proiecte personale? De care?
* Care este funcționalitatea ta preferată din Internet Explorer?

####[[⬆]](#toc) Alte referințe bune:

* http://programmers.stackexchange.com/questions/46716/what-technical-details-should-a-programmer-of-a-web-application-consider-before
* http://www.nczonline.net/blog/2010/01/05/interviewing-the-front-end-engineer/
* http://css-tricks.com/interview-questions-css/


text:
package com.adobe.acs.commons.quickly.results.impl.serializers;

import com.adobe.acs.commons.quickly.results.Result;
import com.adobe.acs.commons.quickly.results.ResultSerializer;
import com.day.cq.wcm.api.AuthoringUIMode;
import com.google.gson.JsonObject;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.api.resource.ValueMap;

/**
 * ACS AEM Commons - Quickly - Open Result Serializer
 */
@Component
@Property(
        name = ResultSerializer.PROP_TYPE,
        value = OpenResultSerializerImpl.TYPE
)
@Service(value = ResultSerializer.class)
public class OpenResultSerializerImpl extends AbstractResultSerializer implements ResultSerializer {
    public static final String TYPE = "OPEN";

    public JsonObject toJSON(final Result result, final ValueMap config) {
        final AuthoringUIMode authoringUIMode = config.get(AuthoringUIMode.class.getName(), AuthoringUIMode.TOUCH);

        if(authoringUIMode != null && AuthoringUIMode.CLASSIC.equals(authoringUIMode)) {
            // Classic
            result.getAction().setUri("/cf#" + result.getPath() + ".html");
        } else {
            // TouchUI
            result.getAction().setUri("/editor.html" + result.getPath() + ".html");
        }

        return super.toJSON(result);
    }
}


text:
package org.venice.piazza.servicecontroller.async;

import static org.mockito.Matchers.any;
import static org.mockito.Mockito.when;

import java.util.ArrayList;
import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import org.venice.piazza.servicecontroller.data.accessor.DatabaseAccessor;
import org.venice.piazza.servicecontroller.messaging.handlers.ExecuteServiceHandler;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import model.data.DataType;
import model.data.type.TextDataType;
import model.job.result.type.DataResult;
import model.job.result.type.ErrorResult;
import model.job.type.ExecuteServiceJob;
import model.response.JobResponse;
import model.service.async.AsyncServiceInstance;
import model.service.metadata.ExecuteServiceData;
import model.service.metadata.Service;
import model.status.StatusUpdate;
import util.PiazzaLogger;
import util.UUIDFactory;

/**
 * Unit tests for the asynchronous service worker, which handles the requests for asynchronous services related to
 * polling status, execution, and result handling.
 *
 * @author Patrick.Doody
 *
 */
public class AsyncServiceWorkerTest {
	@Mock
	private DatabaseAccessor accessor;
	@Mock
	private PiazzaLogger logger;
	@Mock
	private ExecuteServiceHandler executeServiceHandler;
	@Mock
	private UUIDFactory uuidFactory;
	@Mock
	private RestTemplate restTemplate;
	@Mock
	private RabbitTemplate rabbitTemplate;
	@Mock
	private Queue updateJobsQueue;

	@InjectMocks
	private AsynchronousServiceWorker worker;

	private ObjectMapper objectMapper = new ObjectMapper();
	private ExecuteServiceJob mockJob = new ExecuteServiceJob("jobId");
	private AsyncServiceInstance mockInstance = new AsyncServiceInstance();
	private Service mockService = new Service();

	/**
	 * Test initialization
	 */
	@Before
	public void setup() {
		MockitoAnnotations.initMocks(this);

		// UUID Factory always generates a specific GUID
		when(uuidFactory.getUUID()).thenReturn("123456");

		// Mocking Execute Data
		mockJob.data = new ExecuteServiceData();
		mockJob.data.setServiceId("serviceId");
		List<DataType> dataOutput = new ArrayList<DataType>();
		dataOutput.add(new TextDataType());
		mockJob.data.setDataOutput(dataOutput);

		// Mock an Instance we can use
		mockInstance.setInstanceId("instanceId");
		mockInstance.setJobId("jobId");
		mockInstance.setNumberErrorResponses(0);
		mockInstance.setOutputType("geojson");
		mockInstance.setServiceId("serviceId");
		mockInstance.setStatus(new StatusUpdate(StatusUpdate.STATUS_RUNNING));

		// Mock a Service to grab URL and other things from
		mockService.setUrl("test.local");
		mockService.setMethod("GET");
		mockService.setIsAsynchronous(true);
		mockService.setServiceId("serviceId");

		// Mock the property variables for URL
		ReflectionTestUtils.setField(worker, "STATUS_ENDPOINT", "status");
		ReflectionTestUtils.setField(worker, "RESULTS_ENDPOINT", "results");
		ReflectionTestUtils.setField(worker, "DELETE_ENDPOINT", "delete");
		ReflectionTestUtils.setField(worker, "STATUS_ERROR_LIMIT", 10);
		ReflectionTestUtils.setField(worker, "SPACE", "test");
	}

	/**
	 * Test service execution with successful response
	 *
	 * @throws InterruptedException
	 */
	@Test
	public void testExecute() throws JsonProcessingException, InterruptedException {
		// Mock the Response
		JobResponse mockResponse = new JobResponse("instanceId");
		Mockito.doReturn(new ResponseEntity<String>(objectMapper.writeValueAsString(mockResponse), HttpStatus.OK))
				.when(executeServiceHandler).handle(any(ExecuteServiceJob.class));
		// Test
		worker.executeService(mockJob);
		// Verify that the database attempted to insert the newly created Instance
		Mockito.verify(accessor, Mockito.times(1)).addAsyncServiceInstance(any(AsyncServiceInstance.class));
	}

	/**
	 * Test error handling for service returning a 500 error
	 *
	 * @throws InterruptedException
	 */
	@Test
	public void testExecutionErrorResponse() throws InterruptedException {
		// Mock an error coming from the execution service
		Mockito.doReturn(new ResponseEntity<String>("Error.", HttpStatus.INTERNAL_SERVER_ERROR)).when(executeServiceHandler)
				.handle(any(ExecuteServiceJob.class));
		// Test
		worker.executeService(mockJob);
		// Verify that the error was processed by the worker
		Mockito.verify(accessor, Mockito.times(1)).deleteAsyncServiceInstance(Mockito.eq(mockJob.getJobId()));
	}

	/**
	 * Tests a Service returning an invalid payload
	 *
	 * @throws InterruptedException
	 */
	@Test
	public void testExecutionErrorFormat() throws InterruptedException {
		// Mock the Response
		Mockito.doReturn(new ResponseEntity<String>("Everything is fine.", HttpStatus.OK)).when(executeServiceHandler)
				.handle(any(ExecuteServiceJob.class));
		// Test
		worker.executeService(mockJob);
		// Verify that the error was processed by the worker
		Mockito.verify(accessor, Mockito.times(1)).deleteAsyncServiceInstance(Mockito.eq(mockJob.getJobId()));
	}

	/**
	 * Tests a polling of Status with a RUNNING response
	 */
	@Test
	public void testPollRunningStatus() {
		// Mock
		Mockito.doReturn(mockService).when(accessor).getServiceById(Mockito.eq(mockInstance.getServiceId()));
		String url = String.format("%s/%s/%s", mockService.getUrl(), "status", mockInstance.getInstanceId());
		StatusUpdate mockStatus = new StatusUpdate(StatusUpdate.STATUS_RUNNING);
		Mockito.doReturn(mockStatus).when(restTemplate).getForObject(Mockito.eq(url), Mockito.any());

		// Test
		worker.pollStatus(mockInstance);

		// Verify
		Mockito.verify(accessor, Mockito.times(1)).updateAsyncServiceInstance(Mockito.any(AsyncServiceInstance.class));
	}

	/**
	 * Tests a polling of Status with a ERROR response
	 */
	@Test
	public void testPollErrorStatus() {
		// Mock - return an Error Status
		Mockito.doReturn(mockService).when(accessor).getServiceById(Mockito.eq(mockInstance.getServiceId()));
		String url = String.format("%s/%s/%s", mockService.getUrl(), "status", mockInstance.getInstanceId());
		StatusUpdate mockStatus = new StatusUpdate(StatusUpdate.STATUS_ERROR);
		mockStatus.setResult(new ErrorResult("Uh Oh", "Things went wrong."));
		Mockito.doReturn(mockStatus).when(restTemplate).getForObject(Mockito.eq(url), Mockito.eq(StatusUpdate.class));

		// Test
		worker.pollStatus(mockInstance);

		// Verify
		Mockito.verify(accessor, Mockito.times(1)).deleteAsyncServiceInstance(Mockito.eq(mockInstance.getJobId()));
	}

	/**
	 * Tests a polling of Status with a SUCCESS response
	 */
	@Test
	public void testPollSuccessStatus() throws RestClientException, JsonProcessingException {
		// Mock - return an Error Status
		Mockito.doReturn(mockService).when(accessor).getServiceById(Mockito.eq(mockInstance.getServiceId()));
		String url = String.format("%s/%s/%s", mockService.getUrl(), "status", mockInstance.getInstanceId());
		StatusUpdate mockStatus = new StatusUpdate(StatusUpdate.STATUS_SUCCESS);
		// Mock the status fetch
		Mockito.doReturn(mockStatus).when(restTemplate).getForObject(Mockito.eq(url), Mockito.eq(StatusUpdate.class));
		// Mock the result fetch
		String getResultUrl = String.format("%s/%s/%s", mockService.getUrl(), "results", mockInstance.getServiceId());
		Mockito.doReturn(new ResponseEntity<String>(objectMapper.writeValueAsString(new DataResult()), HttpStatus.OK)).when(restTemplate)
				.getForEntity(Mockito.eq(getResultUrl), Mockito.eq(String.class));

		// Test
		worker.pollStatus(mockInstance);

		// Verify
		Mockito.verify(accessor, Mockito.times(1)).deleteAsyncServiceInstance(Mockito.eq(mockInstance.getJobId()));
	}

	/**
	 * Tests updating the failure count of an Instance
	 */
	@Test
	public void testFailureCount() {
		// Mock an instance that is not above the threshold
		AsyncServiceInstance instance = new AsyncServiceInstance();
		instance.setInstanceId("instanceId");
		instance.setJobId("jobId");
		instance.setNumberErrorResponses(0);
		instance.setOutputType("geojson");
		instance.setServiceId("serviceId");
		instance.setStatus(new StatusUpdate(StatusUpdate.STATUS_RUNNING));
		worker.updateFailureCount(instance);

		// Mock an instance that is above the threshold
		instance.setNumberErrorResponses(15);
		worker.updateFailureCount(instance);
	}

	/**
	 * Tests cancelling an instance
	 */
	@Test
	public void testCancellationStatus() {
		// Mock
		Mockito.doReturn(mockService).when(accessor).getServiceById(Mockito.eq(mockService.getServiceId()));

		// Test
		worker.sendCancellationStatus(mockInstance);

		// Test when an error is encountered from the service
		Mockito.doThrow(new RestClientException("Error")).when(restTemplate).delete(Mockito.any());
		worker.sendCancellationStatus(mockInstance);
	}

}


text:
/* eslint-disable */

export const INCREMENT_LIKES = 'INCREMENT_LIKES'
export const ADD_COMMENT = 'ADD_COMMENT'
export const REMOVE_COMMENT = 'REMOVE_COMMENT'


text:
require 'spec_helper'

describe Rdm::CLI::DependenciesController do
  include ExampleProjectHelper

  subject { described_class }

  before { initialize_example_project }
  after  { reset_example_project }

  let(:stdout) { SpecLogger.new }

  context ":run" do
    it "returns array of dependencies names" do
      subject.run(
        package_name: 'web',
        project_path: example_project_path,
        stdout:       stdout
      )

      mod = Rdm::Handlers::DependenciesHandler

      expect(stdout.output.last).to match(
        [
          "web",
          "#{mod::MIDDLE_CORNER}core",
          "|   #{mod::CORNER}repository",
          "#{mod::CORNER}repository (test)"
        ]
      )
    end

    it "returns no dependencies message" do
      subject.run(
        package_name: 'repository',
        project_path: example_project_path,
        stdout:       stdout
      )

      expect(stdout.output).to include("Package `repository` has no dependencies")
    end

    it "show error message if package_name not specified" do
      subject.run(
        package_name: '',
        project_path: example_project_path,
        stdout:       stdout
      )

      expect(stdout.output).to include("Type package name, ex: rdm gen.deps repository")
    end
  end
end


text:
package com.amazonaws.services.opsworks.model.transform;

import static com.amazonaws.util.StringUtils.UTF8;
import static com.amazonaws.util.StringUtils.COMMA_SEPARATOR;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.regex.Pattern;

import com.amazonaws.AmazonClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.opsworks.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.BinaryUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.util.json.*;

/**
 * UpdateRdsDbInstanceRequest Marshaller
 */
public class UpdateRdsDbInstanceRequestMarshaller
        implements
        Marshaller<Request<UpdateRdsDbInstanceRequest>, UpdateRdsDbInstanceRequest> {

    public Request<UpdateRdsDbInstanceRequest> marshall(
            UpdateRdsDbInstanceRequest updateRdsDbInstanceRequest) {

        if (updateRdsDbInstanceRequest == null) {
            throw new AmazonClientException(
                    "Invalid argument passed to marshall(...)");
        }

        Request<UpdateRdsDbInstanceRequest> request = new DefaultRequest<UpdateRdsDbInstanceRequest>(
                updateRdsDbInstanceRequest, "AWSOpsWorks");
        request.addHeader("X-Amz-Target",
                "OpsWorks_20130218.UpdateRdsDbInstance");

        request.setHttpMethod(HttpMethodName.POST);

        request.setResourcePath("");

        try {
            final SdkJsonGenerator jsonGenerator = new SdkJsonGenerator();

            jsonGenerator.writeStartObject();

            if (updateRdsDbInstanceRequest.getRdsDbInstanceArn() != null) {
                jsonGenerator.writeFieldName("RdsDbInstanceArn").writeValue(
                        updateRdsDbInstanceRequest.getRdsDbInstanceArn());
            }
            if (updateRdsDbInstanceRequest.getDbUser() != null) {
                jsonGenerator.writeFieldName("DbUser").writeValue(
                        updateRdsDbInstanceRequest.getDbUser());
            }
            if (updateRdsDbInstanceRequest.getDbPassword() != null) {
                jsonGenerator.writeFieldName("DbPassword").writeValue(
                        updateRdsDbInstanceRequest.getDbPassword());
            }

            jsonGenerator.writeEndObject();

            byte[] content = jsonGenerator.getBytes();
            request.setContent(new ByteArrayInputStream(content));
            request.addHeader("Content-Length",
                    Integer.toString(content.length));
            request.addHeader("Content-Type", "application/x-amz-json-1.1");
        } catch (Throwable t) {
            throw new AmazonClientException(
                    "Unable to marshall request to JSON: " + t.getMessage(), t);
        }

        return request;
    }

}


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/certificatemanager/v1/certificate_issuance_config.proto

package com.google.cloud.certificatemanager.v1;

public interface ListCertificateIssuanceConfigsResponseOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.certificatemanager.v1.ListCertificateIssuanceConfigsResponse)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * A list of certificate configs for the parent resource.
   *

   *
   *
   * repeated .google.cloud.certificatemanager.v1.CertificateIssuanceConfig certificate_issuance_configs = 1;
   *
   */
  java.util.List<com.google.cloud.certificatemanager.v1.CertificateIssuanceConfig>
      getCertificateIssuanceConfigsList();
  /**
   *
   *
   *

   * A list of certificate configs for the parent resource.
   *

   *
   *
   * repeated .google.cloud.certificatemanager.v1.CertificateIssuanceConfig certificate_issuance_configs = 1;
   *
   */
  com.google.cloud.certificatemanager.v1.CertificateIssuanceConfig getCertificateIssuanceConfigs(
      int index);
  /**
   *
   *
   *

   * A list of certificate configs for the parent resource.
   *

   *
   *
   * repeated .google.cloud.certificatemanager.v1.CertificateIssuanceConfig certificate_issuance_configs = 1;
   *
   */
  int getCertificateIssuanceConfigsCount();
  /**
   *
   *
   *

   * A list of certificate configs for the parent resource.
   *

   *
   *
   * repeated .google.cloud.certificatemanager.v1.CertificateIssuanceConfig certificate_issuance_configs = 1;
   *
   */
  java.util.List<
          ? extends com.google.cloud.certificatemanager.v1.CertificateIssuanceConfigOrBuilder>
      getCertificateIssuanceConfigsOrBuilderList();
  /**
   *
   *
   *

   * A list of certificate configs for the parent resource.
   *

   *
   *
   * repeated .google.cloud.certificatemanager.v1.CertificateIssuanceConfig certificate_issuance_configs = 1;
   *
   */
  com.google.cloud.certificatemanager.v1.CertificateIssuanceConfigOrBuilder
      getCertificateIssuanceConfigsOrBuilder(int index);

  /**
   *
   *
   *

   * If there might be more results than those appearing in this response, then
   * `next_page_token` is included. To get the next set of results, call this
   * method again using the value of `next_page_token` as `page_token`.
   *

   *
   * string next_page_token = 2;
   *
   * @return The nextPageToken.
   */
  java.lang.String getNextPageToken();
  /**
   *
   *
   *

   * If there might be more results than those appearing in this response, then
   * `next_page_token` is included. To get the next set of results, call this
   * method again using the value of `next_page_token` as `page_token`.
   *

   *
   * string next_page_token = 2;
   *
   * @return The bytes for nextPageToken.
   */
  com.google.protobuf.ByteString getNextPageTokenBytes();

  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @return A list containing the unreachable.
   */
  java.util.List<java.lang.String> getUnreachableList();
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @return The count of unreachable.
   */
  int getUnreachableCount();
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @param index The index of the element to return.
   * @return The unreachable at the given index.
   */
  java.lang.String getUnreachable(int index);
  /**
   *
   *
   *

   * Locations that could not be reached.
   *

   *
   * repeated string unreachable = 3;
   *
   * @param index The index of the value to return.
   * @return The bytes of the unreachable at the given index.
   */
  com.google.protobuf.ByteString getUnreachableBytes(int index);
}


text:
package org.apache.poi.ss.formula.functions;

import java.io.IOException;

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.CellValue;
import org.apache.poi.ss.usermodel.FormulaEvaluator;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellReference;

import junit.framework.TestCase;

/**
 * LogicalFunction unit tests.
 */
public class TestLogicalFunction extends TestCase {

    private FormulaEvaluator evaluator;
    private Row row3;
    private Cell cell1;
    private Cell cell2;

    @Override
    public void setUp() throws IOException {
        Workbook wb = new HSSFWorkbook();
        try {
            buildWorkbook(wb);
        } finally {
            wb.close();
        }
    }

    private void buildWorkbook(Workbook wb) {
        Sheet sh = wb.createSheet();
        Row row1 = sh.createRow(0);
        Row row2 = sh.createRow(1);
        row3 = sh.createRow(2);

        row1.createCell(0, CellType.NUMERIC);
        row1.createCell(1, CellType.NUMERIC);

        row2.createCell(0, CellType.NUMERIC);
        row2.createCell(1, CellType.NUMERIC);

        row3.createCell(0);
        row3.createCell(1);

        CellReference a1 = new CellReference("A1");
        CellReference a2 = new CellReference("A2");
        CellReference b1 = new CellReference("B1");
        CellReference b2 = new CellReference("B2");

        sh.getRow(a1.getRow()).getCell(a1.getCol()).setCellValue(35);
        sh.getRow(a2.getRow()).getCell(a2.getCol()).setCellValue(0);
        sh.getRow(b1.getRow()).getCell(b1.getCol()).setCellFormula("A1/A2");
        sh.getRow(b2.getRow()).getCell(b2.getCol()).setCellFormula("NA()");

        evaluator = wb.getCreationHelper().createFormulaEvaluator();
    }

    public void testIsErr() {
        cell1 = row3.createCell(0);
        cell1.setCellFormula("ISERR(B1)"); // produces #DIV/0!
        cell2 = row3.createCell(1);
        cell2.setCellFormula("ISERR(B2)"); // produces #N/A

        CellValue cell1Value = evaluator.evaluate(cell1);
        CellValue cell2Value = evaluator.evaluate(cell2);

        assertEquals(true, cell1Value.getBooleanValue());
        assertEquals(false, cell2Value.getBooleanValue());
    }

    public void testIsError() {
        cell1 = row3.createCell(0);
        cell1.setCellFormula("ISERROR(B1)"); // produces #DIV/0!
        cell2 = row3.createCell(1);
        cell2.setCellFormula("ISERROR(B2)"); // produces #N/A

        CellValue cell1Value = evaluator.evaluate(cell1);
        CellValue cell2Value = evaluator.evaluate(cell2);

        assertEquals(true, cell1Value.getBooleanValue());
        assertEquals(true, cell2Value.getBooleanValue());
    }
}


text:
<?php

get_header();
if (have_posts()) :
   while (have_posts()) :
      the_post(); ?>

						<?php //work; ?>
						<?php echo do_shortcode('[metaslider id=543]'); ?>
						<?php //home ?>
						<?php echo do_shortcode('[metaslider id=53]'); ?>

Educational
 Espressos

"Get slicker with a clicker: roam around and get in amongst your learners — free yourself up with a clicker, you deserve it!"

						Get updated with @osirisedu

    <?php endwhile;
endif; ?>
<?php get_footer() ?>