text:
var selected_traces = {};
var trace_dygraph;

var PlotTraceData = function () {
  var max_samples = 0;
  for (t in selected_traces) {
    max_samples = Math.max(max_samples, selected_traces[t].length);
  }

  // convert traces data to a multidim array:
  // data = [
  //   [1, trace1_sample1, trace2_sample1],
  //   [2, trace1_sample2, trace2_sample2],
  //   [3, trace1_sample3, trace2_sample3],
  // ]
  var data = [];
  for (var i = 0; i < max_samples; i++) {
    var i_samples = [i];

    for (t in selected_traces) {
      if (i < selected_traces[t].length) {
        i_samples.push(selected_traces[t][i]);
      } else {
        i_samples.push(0);
      }
    }

    data.push(i_samples);
  }

  var labels = ["sample"].concat(Object.keys(selected_traces));
  trace_dygraph = new Dygraph(document.getElementById("trace_plot"), data, {
    legend: "always",
    animatedZooms: true,
    title: "Power trace",
    labels: labels,
  });
};

var LoadTraceData = function (trace) {
  $.ajax({
    url: "/data/" + trace,
    method: "GET",
    dataType: "json",
    success: function (d) {
      selected_traces[trace] = d;
      PlotTraceData();
    },
  });
};

var LoadTraces = function () {
  if (trace_dygraph) {
    trace_dygraph.destroy();
    trace_dygraph = null;
    selected_traces = {};
  }
  $.ajax({
    url: "/data",
    method: "GET",
    dataType: "json",
    success: function (d) {
      // Automatically load the first trace.
      if (d["Traces"].length > 0) {
        d["Traces"][0]["Selected"] = true;
        LoadTraceData(d["Traces"][0]["Id"]);
      }
      $("#pk").text(d["Pk"]);
      $("#traces").bootstrapTable("load", d["Traces"]);
    },
    error: function () {
      $("#traces").bootstrapTable("load", []);
    },
  });
};

$(document).ready(function () {
  "use strict";
  $("#traces").bootstrapTable({
    onCheck: function (row, elm) {
      LoadTraceData(row.Id);
    },
    onUncheck: function (row, elm) {
      delete selected_traces[row.Id];
      PlotTraceData();
    },
    onClickRow: function (row, elm, field) {
      if (row.Selected) {
        delete selected_traces[row.Id];
        PlotTraceData();
      } else {
        LoadTraceData(row.Id);
      }
    },
    onCheckAll: function (rows_after, rows_before) {
      rows_after.forEach(function (row, i) {
        if (!(row.Id in selected_traces)) {
          LoadTraceData(row.Id);
        }
      });
    },
    onUncheckAll: function (rows_after, rows_before) {
      rows_before.forEach(function (row, i) {
        if (row.Id in selected_traces) {
          delete selected_traces[row.Id];
          PlotTraceData();
        }
      });
    },
  });
  feather.replace();
  LoadTraces();
});


text:
import { uniqBy } from "lodash";
export = uniqBy;

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" packages="net.beaconpe.magicclient.utility">
    <Appenders>
        <Console name="MCSysOut" target="SYSTEM_OUT">
            <PatternLayout pattern="[%d{HH:mm:ss}] [%level/%t]: %msg%n" />
        </Console>
        <Console name="SysOut" target="SYSTEM_OUT">
            <PatternLayout pattern="[%d{HH:mm:ss}] [%level%t]: %msg%n" />
        </Console>
        <RollingRandomAccessFile name="File" fileName="logs/latest.log" filePattern="logs/%d{yyyy-MM-dd}-%i.log.gz">
            <PatternLayout pattern="[%d{HH:mm:ss}] [%level/%t]: %msg%n" />
            <Policies>
                <TimeBasedTriggeringPolicy />
                <OnStartupTriggeringPolicy />
            </Policies>
        </RollingRandomAccessFile>
        <Routing name="MCFile">
            <Routes pattern="$${ctx:side}">
                <Route>
                    <RollingRandomAccessFile name="MCFile" fileName="logs/mc-${ctx:side}-latest.log" filePattern="logs/mc-${ctx:side}-%i.log">
                        <PatternLayout pattern="[%d{HH:mm:ss}] [%level] [%logger/%X{mod}]: %msg%n" />
                        <DefaultRolloverStrategy max="3" fileIndex="max" />
                        <Policies>
                            <OnStartupTriggeringPolicy />
                        </Policies>
                    </RollingRandomAccessFile>
                </Route>
                <Route key="$${ctx:side}">
                    <RandomAccessFile name="MCFile" fileName="logs/earlystartup.log" >
                        <PatternLayout pattern="[%d{HH:mm:ss}] [%level] [%logger]: %msg%n" />
                    </RandomAccessFile>
                </Route>
            </Routes>
        </Routing>
    </Appenders>
    <Loggers>
        <Logger level="info" name="Client" additivity="false">
            <AppenderRef ref="SysOut" level="INFO" />
            <AppenderRef ref="File" />
        </Logger>
        <Root level="all">
            <AppenderRef ref="MCSysOut" level="DEBUG" />
            <AppenderRef ref="MCFile"/>
        </Root>
    </Loggers>
</Configuration>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WebHookit Docs</title>
<meta http-equiv="REFRESH" content="0;url=docs/index.html"></HEAD>
<BODY>
</BODY>
</HTML>


text:
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.zeppelin.interpreter.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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-8-7")
public class RemoteInterpreterResult implements org.apache.thrift.TBase<RemoteInterpreterResult, RemoteInterpreterResult._Fields>, java.io.Serializable, Cloneable, Comparable<RemoteInterpreterResult> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RemoteInterpreterResult");

  private static final org.apache.thrift.protocol.TField CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("code", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.STRING, (short)2);
  private static final org.apache.thrift.protocol.TField MSG_FIELD_DESC = new org.apache.thrift.protocol.TField("msg", org.apache.thrift.protocol.TType.STRING, (short)3);
  private static final org.apache.thrift.protocol.TField CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("config", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField GUI_FIELD_DESC = new org.apache.thrift.protocol.TField("gui", 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 RemoteInterpreterResultStandardSchemeFactory());
    schemes.put(TupleScheme.class, new RemoteInterpreterResultTupleSchemeFactory());
  }

  public String code; // required
  public String type; // required
  public String msg; // required
  public String config; // required
  public String gui; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    CODE((short)1, "code"),
    TYPE((short)2, "type"),
    MSG((short)3, "msg"),
    CONFIG((short)4, "config"),
    GUI((short)5, "gui");

    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: // CODE
          return CODE;
        case 2: // TYPE
          return TYPE;
        case 3: // MSG
          return MSG;
        case 4: // CONFIG
          return CONFIG;
        case 5: // GUI
          return GUI;
        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
  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.CODE, new org.apache.thrift.meta_data.FieldMetaData("code", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.MSG, new org.apache.thrift.meta_data.FieldMetaData("msg", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.CONFIG, new org.apache.thrift.meta_data.FieldMetaData("config", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.GUI, new org.apache.thrift.meta_data.FieldMetaData("gui", org.apache.thrift.TFieldRequirementType.DEFAULT,
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RemoteInterpreterResult.class, metaDataMap);
  }

  public RemoteInterpreterResult() {
  }

  public RemoteInterpreterResult(
    String code,
    String type,
    String msg,
    String config,
    String gui)
  {
    this();
    this.code = code;
    this.type = type;
    this.msg = msg;
    this.config = config;
    this.gui = gui;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public RemoteInterpreterResult(RemoteInterpreterResult other) {
    if (other.isSetCode()) {
      this.code = other.code;
    }
    if (other.isSetType()) {
      this.type = other.type;
    }
    if (other.isSetMsg()) {
      this.msg = other.msg;
    }
    if (other.isSetConfig()) {
      this.config = other.config;
    }
    if (other.isSetGui()) {
      this.gui = other.gui;
    }
  }

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

  @Override
  public void clear() {
    this.code = null;
    this.type = null;
    this.msg = null;
    this.config = null;
    this.gui = null;
  }

  public String getCode() {
    return this.code;
  }

  public RemoteInterpreterResult setCode(String code) {
    this.code = code;
    return this;
  }

  public void unsetCode() {
    this.code = null;
  }

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

  public void setCodeIsSet(boolean value) {
    if (!value) {
      this.code = null;
    }
  }

  public String getType() {
    return this.type;
  }

  public RemoteInterpreterResult setType(String type) {
    this.type = type;
    return this;
  }

  public void unsetType() {
    this.type = null;
  }

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

  public void setTypeIsSet(boolean value) {
    if (!value) {
      this.type = null;
    }
  }

  public String getMsg() {
    return this.msg;
  }

  public RemoteInterpreterResult setMsg(String msg) {
    this.msg = msg;
    return this;
  }

  public void unsetMsg() {
    this.msg = null;
  }

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

  public void setMsgIsSet(boolean value) {
    if (!value) {
      this.msg = null;
    }
  }

  public String getConfig() {
    return this.config;
  }

  public RemoteInterpreterResult setConfig(String config) {
    this.config = config;
    return this;
  }

  public void unsetConfig() {
    this.config = null;
  }

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

  public void setConfigIsSet(boolean value) {
    if (!value) {
      this.config = null;
    }
  }

  public String getGui() {
    return this.gui;
  }

  public RemoteInterpreterResult setGui(String gui) {
    this.gui = gui;
    return this;
  }

  public void unsetGui() {
    this.gui = null;
  }

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

  public void setGuiIsSet(boolean value) {
    if (!value) {
      this.gui = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case CODE:
      if (value == null) {
        unsetCode();
      } else {
        setCode((String)value);
      }
      break;

    case TYPE:
      if (value == null) {
        unsetType();
      } else {
        setType((String)value);
      }
      break;

    case MSG:
      if (value == null) {
        unsetMsg();
      } else {
        setMsg((String)value);
      }
      break;

    case CONFIG:
      if (value == null) {
        unsetConfig();
      } else {
        setConfig((String)value);
      }
      break;

    case GUI:
      if (value == null) {
        unsetGui();
      } else {
        setGui((String)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case CODE:
      return getCode();

    case TYPE:
      return getType();

    case MSG:
      return getMsg();

    case CONFIG:
      return getConfig();

    case GUI:
      return getGui();

    }
    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 CODE:
      return isSetCode();
    case TYPE:
      return isSetType();
    case MSG:
      return isSetMsg();
    case CONFIG:
      return isSetConfig();
    case GUI:
      return isSetGui();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_code = true && this.isSetCode();
    boolean that_present_code = true && that.isSetCode();
    if (this_present_code || that_present_code) {
      if (!(this_present_code && that_present_code))
        return false;
      if (!this.code.equals(that.code))
        return false;
    }

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type))
        return false;
      if (!this.type.equals(that.type))
        return false;
    }

    boolean this_present_msg = true && this.isSetMsg();
    boolean that_present_msg = true && that.isSetMsg();
    if (this_present_msg || that_present_msg) {
      if (!(this_present_msg && that_present_msg))
        return false;
      if (!this.msg.equals(that.msg))
        return false;
    }

    boolean this_present_config = true && this.isSetConfig();
    boolean that_present_config = true && that.isSetConfig();
    if (this_present_config || that_present_config) {
      if (!(this_present_config && that_present_config))
        return false;
      if (!this.config.equals(that.config))
        return false;
    }

    boolean this_present_gui = true && this.isSetGui();
    boolean that_present_gui = true && that.isSetGui();
    if (this_present_gui || that_present_gui) {
      if (!(this_present_gui && that_present_gui))
        return false;
      if (!this.gui.equals(that.gui))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List<Object> list = new ArrayList<Object>();

    boolean present_code = true && (isSetCode());
    list.add(present_code);
    if (present_code)
      list.add(code);

    boolean present_type = true && (isSetType());
    list.add(present_type);
    if (present_type)
      list.add(type);

    boolean present_msg = true && (isSetMsg());
    list.add(present_msg);
    if (present_msg)
      list.add(msg);

    boolean present_config = true && (isSetConfig());
    list.add(present_config);
    if (present_config)
      list.add(config);

    boolean present_gui = true && (isSetGui());
    list.add(present_gui);
    if (present_gui)
      list.add(gui);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetCode()).compareTo(other.isSetCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.code, other.code);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMsg()).compareTo(other.isSetMsg());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMsg()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.msg, other.msg);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetConfig()).compareTo(other.isSetConfig());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetConfig()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.config, other.config);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGui()).compareTo(other.isSetGui());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGui()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.gui, other.gui);
      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("RemoteInterpreterResult(");
    boolean first = true;

    sb.append("code:");
    if (this.code == null) {
      sb.append("null");
    } else {
      sb.append(this.code);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("type:");
    if (this.type == null) {
      sb.append("null");
    } else {
      sb.append(this.type);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("msg:");
    if (this.msg == null) {
      sb.append("null");
    } else {
      sb.append(this.msg);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("config:");
    if (this.config == null) {
      sb.append("null");
    } else {
      sb.append(this.config);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("gui:");
    if (this.gui == null) {
      sb.append("null");
    } else {
      sb.append(this.gui);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // 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 {
      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 RemoteInterpreterResultStandardSchemeFactory implements SchemeFactory {
    public RemoteInterpreterResultStandardScheme getScheme() {
      return new RemoteInterpreterResultStandardScheme();
    }
  }

  private static class RemoteInterpreterResultStandardScheme extends StandardScheme<RemoteInterpreterResult> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, RemoteInterpreterResult 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: // CODE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.code = iprot.readString();
              struct.setCodeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.type = iprot.readString();
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // MSG
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.msg = iprot.readString();
              struct.setMsgIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // CONFIG
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.config = iprot.readString();
              struct.setConfigIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // GUI
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.gui = iprot.readString();
              struct.setGuiIsSet(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
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.code != null) {
        oprot.writeFieldBegin(CODE_FIELD_DESC);
        oprot.writeString(struct.code);
        oprot.writeFieldEnd();
      }
      if (struct.type != null) {
        oprot.writeFieldBegin(TYPE_FIELD_DESC);
        oprot.writeString(struct.type);
        oprot.writeFieldEnd();
      }
      if (struct.msg != null) {
        oprot.writeFieldBegin(MSG_FIELD_DESC);
        oprot.writeString(struct.msg);
        oprot.writeFieldEnd();
      }
      if (struct.config != null) {
        oprot.writeFieldBegin(CONFIG_FIELD_DESC);
        oprot.writeString(struct.config);
        oprot.writeFieldEnd();
      }
      if (struct.gui != null) {
        oprot.writeFieldBegin(GUI_FIELD_DESC);
        oprot.writeString(struct.gui);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class RemoteInterpreterResultTupleSchemeFactory implements SchemeFactory {
    public RemoteInterpreterResultTupleScheme getScheme() {
      return new RemoteInterpreterResultTupleScheme();
    }
  }

  private static class RemoteInterpreterResultTupleScheme extends TupleScheme<RemoteInterpreterResult> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterResult struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetCode()) {
        optionals.set(0);
      }
      if (struct.isSetType()) {
        optionals.set(1);
      }
      if (struct.isSetMsg()) {
        optionals.set(2);
      }
      if (struct.isSetConfig()) {
        optionals.set(3);
      }
      if (struct.isSetGui()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetCode()) {
        oprot.writeString(struct.code);
      }
      if (struct.isSetType()) {
        oprot.writeString(struct.type);
      }
      if (struct.isSetMsg()) {
        oprot.writeString(struct.msg);
      }
      if (struct.isSetConfig()) {
        oprot.writeString(struct.config);
      }
      if (struct.isSetGui()) {
        oprot.writeString(struct.gui);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, RemoteInterpreterResult struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.code = iprot.readString();
        struct.setCodeIsSet(true);
      }
      if (incoming.get(1)) {
        struct.type = iprot.readString();
        struct.setTypeIsSet(true);
      }
      if (incoming.get(2)) {
        struct.msg = iprot.readString();
        struct.setMsgIsSet(true);
      }
      if (incoming.get(3)) {
        struct.config = iprot.readString();
        struct.setConfigIsSet(true);
      }
      if (incoming.get(4)) {
        struct.gui = iprot.readString();
        struct.setGuiIsSet(true);
      }
    }
  }

}


text:
'use strict';

const logger = require('./log');
const events = require('./events');

let copy = require('recursive-copy'); // eslint-disable-line prefer-const

const copyFile = (p, dest, options) => {
  return copy(p, dest, options)
    .on(copy.events.ERROR, function (error, copyOperation) {
      logger.error('Unable to copy ' + copyOperation.dest);
    })
    .on(copy.events.COPY_FILE_ERROR, (error) => {
      logger.error(error);
    })
    .on(copy.events.COPY_FILE_COMPLETE, () => {
      logger.debug(`Moved ${p} to ${dest}`);
      options.emitter.emit(events.PATTERNLAB_PATTERN_ASSET_CHANGE, {
        file: p,
        dest: dest,
      });
    });
};

module.exports = copyFile;


text:
namespace GFort { namespace Core { namespace Game
{

/// Viewer class of a Game
class GameViewer
{
public:
    /// Constructor
    GameViewer();

    /// Destructor
    ~GameViewer();

    /// Initialize the viewer
    /// @param width The width of the viewer
    /// @param height The height of the viewer
    bool Initialize(const short& width, const short& height);

    /// Update the viewer for the game state
    /// @param gameState The input game state
    void Update(const std::string& gameState);

    /// Invalidate current visual settings.
    /// Next time when display is needed, the system will reset first
    void Invalidate();

    /// Gets the size of viewer
    short Width()               { return width_; }
    short Height()              { return height_; }

    /// Sets the width of viewer
    /// @param width New width
    virtual void SetWidth(const short& width);

    /// Sets the height of viewer
    /// @param height New height
    virtual void SetHeight(const short& height);

    /// Returns true if it needs update
    bool NeedsUpdate()          { return needs_update_; }

    /// Reset all visual settings immediately if update is needed
    virtual void Reset();

protected:
    /// Parse game state and update necessary information
    virtual void ParseGameState();

protected:
    // Stores the input data
    std::string     data_;

    // Stores the width and height of the visual panel
    short           width_;
    short           height_;

private:
    // Stores whether it is needed to update
    bool            needs_update_;

    // Stores the aspect ratio of the region
    float           asepect_ratio_;
};

} } } // namespace

#endif // GFORT_CORE_GAME_GAME_VIEWER_H_


text:
"""
    ============================================
    :mod:`selectors` -- Parent selection methods
    ============================================

    This module provides pre-defined selectors for evolutionary computations.

    All selector functions have the following arguments:

    - *random* -- the random number generator object
    - *population* -- the population of individuals
    - *args* -- a dictionary of keyword arguments

    Each selector function returns the list of selected individuals.

    .. note::

       The *population* is really a shallow copy of the actual population of
       the evolutionary computation. This means that any activities like
       sorting will not affect the actual population.

    .. Copyright 2012 Inspired Intelligence Initiative

    .. This program is free software: you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published by
       the Free Software Foundation, either version 3 of the License, or
       (at your option) any later version.

    .. This program is distributed in the hope that it will be useful,
       but WITHOUT ANY WARRANTY; without even the implied warranty of
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       GNU General Public License for more details.

    .. You should have received a copy of the GNU General Public License
       along with this program.  If not, see <http://www.gnu.org/licenses/>.

    .. module:: selectors
    .. moduleauthor:: Aaron Garrett <aaron.lee.garrett@gmail.com>
"""

def default_selection(random, population, args):
    """Return the population.

    This function acts as a default selection scheme for an evolutionary
    computation. It simply returns the entire population as having been
    selected.

    .. Arguments:
       random -- the random number generator object
       population -- the population of individuals
       args -- a dictionary of keyword arguments

    """
    return population

def truncation_selection(random, population, args):
    """Selects the best individuals from the population.

    This function performs truncation selection, which means that only
    the best individuals from the current population are selected. This
    is a completely deterministic selection mechanism.

    .. Arguments:
       random -- the random number generator object
       population -- the population of individuals
       args -- a dictionary of keyword arguments

    Optional keyword arguments in args:

    - *num_selected* -- the number of individuals to be selected
      (default len(population))

    """
    num_selected = args.setdefault('num_selected', len(population))
    population.sort(reverse=True)
    return population[:num_selected]

def uniform_selection(random, population, args):
    """Return a uniform sampling of individuals from the population.

    This function performs uniform selection by randomly choosing
    members of the population with replacement.

    .. Arguments:
       random -- the random number generator object
       population -- the population of individuals
       args -- a dictionary of keyword arguments

    Optional keyword arguments in args:

    - *num_selected* -- the number of individuals to be selected
      (default 1)

    """
    num_selected = args.setdefault('num_selected', 1)
    selected = []
    for _ in range(num_selected):
        selected.append(population[random.randint(0, len(population)-1)])
    return selected

def fitness_proportionate_selection(random, population, args):
    """Return fitness proportionate sampling of individuals from the population.

    This function stochastically chooses individuals from the population
    with probability proportional to their fitness. This is often
    referred to as "roulette wheel" selection. Note that this selection
    is not valid for minimization problems.

    .. Arguments:
       random -- the random number generator object
       population -- the population of individuals
       args -- a dictionary of keyword arguments

    Optional keyword arguments in args:

    - *num_selected* -- the number of individuals to be selected (default 1)

    """
    num_selected = args.setdefault('num_selected', 1)
    len_pop = len(population)
    psum = [i for i in range(len_pop)]
    pop_max_fit = (max(population)).fitness
    pop_min_fit = (min(population)).fitness

    # If we're actually doing minimimization,
    # fitness proportionate selection is not defined.
    if pop_max_fit < pop_min_fit:
        raise ValueError('Fitness proportionate selection is not valid for minimization.')

    # Set up the roulette wheel
    if pop_max_fit == pop_min_fit:
        psum = [(index + 1) / float(len_pop) for index in range(len_pop)]
    elif (pop_max_fit > 0 and pop_min_fit >= 0) or (pop_max_fit <= 0 and pop_min_fit < 0):
        population.sort(reverse=True)
        psum[0] = population[0].fitness
        for i in range(1, len_pop):
            psum[i] = population[i].fitness + psum[i-1]
        for i in range(len_pop):
            psum[i] /= float(psum[len_pop-1])

    # Select the individuals
    selected = []
    for _ in range(num_selected):
        cutoff = random.random()
        lower = 0
        upper = len_pop - 1
        while(upper >= lower):
            mid = (lower + upper) // 2
            if psum[mid] > cutoff:
                upper = mid - 1
            else:
                lower = mid + 1
        lower = max(0, min(len_pop-1, lower))
        selected.append(population[lower])
    return selected

def rank_selection(random, population, args):
    """Return a rank-based sampling of individuals from the population.

    This function behaves similarly to fitness proportionate selection,
    except that it uses the individual's rank in the population, rather
    than its raw fitness value, to determine its probability. This
    means that it can be used for both maximization and minimization
    problems, since higher rank can be defined correctly for both.

    .. Arguments:
       random -- the random number generator object
       population -- the population of individuals
       args -- a dictionary of keyword arguments

    Optional keyword arguments in args:

    - *num_selected* -- the number of individuals to be selected (default 1)

    """
    num_selected = args.setdefault('num_selected', 1)

    # Set up the roulette wheel
    len_pop = len(population)
    population.sort()
    psum = list(range(len_pop))
    den = (len_pop * (len_pop + 1)) / 2.0
    for i in range(len_pop):
        psum[i] = (i + 1) / den
    for i in range(1, len_pop):
        psum[i] += psum[i-1]

    # Select the individuals
    selected = []
    for _ in range(num_selected):
        cutoff = random.random()
        lower = 0
        upper = len_pop - 1
        while(upper >= lower):
            mid = (lower + upper) // 2
            if psum[mid] > cutoff:
                upper = mid - 1
            else:
                lower = mid + 1
        lower = max(0, min(len_pop-1, lower))
        selected.append(population[lower])
    return selected

def tournament_selection(random, population, args):
    """Return a tournament sampling of individuals from the population.

    This function selects ``num_selected`` individuals from the population.
    It selects each one by using random sampling without replacement
    to pull ``tournament_size`` individuals and adds the best of the
    tournament as its selection. If ``tournament_size`` is greater than
    the population size, the population size is used instead as the size
    of the tournament.

    .. Arguments:
       random -- the random number generator object
       population -- the population of individuals
       args -- a dictionary of keyword arguments

    Optional keyword arguments in args:

    - *num_selected* -- the number of individuals to be selected (default 1)
    - *tournament_size* -- the tournament size (default 2)

    """
    num_selected = args.setdefault('num_selected', 1)
    tournament_size = args.setdefault('tournament_size', 2)
    if tournament_size > len(population):
        tournament_size = len(population)
    selected = []
    for _ in range(num_selected):
        tourn = random.sample(population, tournament_size)
        selected.append(max(tourn))
    return selected


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.bibabo.activity.main.MainActivity">

    <include layout="@layout/app_bar" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.v4.view.ViewPager
            android:id="@+id/vp_2"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <com.flyco.tablayout.CommonTabLayout
            android:id="@+id/tl_2"
            android:layout_width="match_parent"
            android:layout_height="54dp"
            android:layout_gravity="bottom|end"
            android:background="#ffffff"
            app:tl_iconHeight="23dp"
            app:tl_iconWidth="23dp"
            app:tl_indicator_color="#2C97DE"
            app:tl_indicator_height="0dp"
            app:tl_textSelectColor="#2C97DE"
            app:tl_textUnselectColor="#66000000"
            app:tl_textsize="12sp"
            app:tl_underline_color="#DDDDDD"
            app:tl_underline_height="1dp" />
    </LinearLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:visibility="gone"
        app:srcCompat="@android:drawable/ic_dialog_email" />

</android.support.design.widget.CoordinatorLayout>


text:
<bill session="115" type="h" number="719" updated="2017-10-07T07:15:27Z">
  <state datetime="2017-01-27">REFERRED</state>
  <status>
    <introduced datetime="2017-01-27"/>
  </status>
  <introduced datetime="2017-01-27"/>
  <titles>
    <title type="short" as="introduced">A PLUS Act</title>
    <title type="short" as="introduced">A PLUS Act</title>
    <title type="short" as="introduced">Academic Partnerships Lead Us to Success Act</title>
    <title type="short" as="introduced">Academic Partnerships Lead Us to Success Act</title>
    <title type="official" as="introduced">To allow a State to submit a declaration of intent to the Secretary of Education to combine certain funds to improve the academic achievement of students.</title>
    <title type="display">A PLUS Act</title>
  </titles>
  <sponsor bioguide_id="W000819"/>
  <cosponsors>
    <cosponsor bioguide_id="A000374" joined="2017-07-24"/>
    <cosponsor bioguide_id="A000375" joined="2017-06-15"/>
    <cosponsor bioguide_id="B001291" joined="2017-07-24"/>
    <cosponsor bioguide_id="B001299" joined="2017-04-27"/>
    <cosponsor bioguide_id="B001290" joined="2017-01-27"/>
    <cosponsor bioguide_id="B001297" joined="2017-01-27"/>
    <cosponsor bioguide_id="B001305" joined="2017-01-27"/>
    <cosponsor bioguide_id="B001289" joined="2017-07-28"/>
    <cosponsor bioguide_id="D000621" joined="2017-01-27"/>
    <cosponsor bioguide_id="D000616" joined="2017-07-18"/>
    <cosponsor bioguide_id="D000615" joined="2017-01-27"/>
    <cosponsor bioguide_id="D000628" joined="2017-07-28"/>
    <cosponsor bioguide_id="F000460" joined="2017-07-24"/>
    <cosponsor bioguide_id="F000461" joined="2017-04-27"/>
    <cosponsor bioguide_id="F000448" joined="2017-09-25"/>
    <cosponsor bioguide_id="G000552" joined="2017-01-27"/>
    <cosponsor bioguide_id="G000565" joined="2017-07-19"/>
    <cosponsor bioguide_id="G000560" joined="2017-09-06"/>
    <cosponsor bioguide_id="G000576" joined="2017-01-27"/>
    <cosponsor bioguide_id="H001052" joined="2017-09-06"/>
    <cosponsor bioguide_id="H001071" joined="2017-06-06"/>
    <cosponsor bioguide_id="H001067" joined="2017-01-27"/>
    <cosponsor bioguide_id="J000299" joined="2017-07-28"/>
    <cosponsor bioguide_id="K000376" joined="2017-07-19"/>
    <cosponsor bioguide_id="K000388" joined="2017-09-06"/>
    <cosponsor bioguide_id="L000573" joined="2017-05-22"/>
    <cosponsor bioguide_id="L000578" joined="2017-04-27"/>
    <cosponsor bioguide_id="L000564" joined="2017-07-26"/>
    <cosponsor bioguide_id="M001187" joined="2017-07-26"/>
    <cosponsor bioguide_id="M001189" joined="2017-07-24"/>
    <cosponsor bioguide_id="N000190" joined="2017-09-18"/>
    <cosponsor bioguide_id="O000168" joined="2017-09-06"/>
    <cosponsor bioguide_id="P000609" joined="2017-01-27"/>
    <cosponsor bioguide_id="P000606" joined="2017-07-24"/>
    <cosponsor bioguide_id="R000601" joined="2017-06-20"/>
    <cosponsor bioguide_id="R000603" joined="2017-04-27"/>
    <cosponsor bioguide_id="S000244" joined="2017-01-27"/>
    <cosponsor bioguide_id="W000804" joined="2017-10-06"/>
  </cosponsors>
  <actions>
    <action datetime="2017-01-27">
      <text>Introduced in House</text>
    </action>
    <action datetime="2017-01-27" state="REFERRED">
      <text>Referred to the House Committee on Education and the Workforce.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="HSED" name="House Education and the Workforce" activity="Referral"/>
  </committees>
  <relatedbills>
    <bill type="s" session="115" relation="identical" number="221"/>
  </relatedbills>
  <subjects>
    <term name="Education"/>
    <term name="Academic performance and assessments"/>
    <term name="Education of the disadvantaged"/>
    <term name="Education programs funding"/>
    <term name="Elementary and secondary education"/>
    <term name="Government information and archives"/>
    <term name="Intergovernmental relations"/>
    <term name="State and local finance"/>
  </subjects>
  <amendments/>
  <summary date="2017-01-27T05:00:00Z" status="Introduced in House">Academic Partnerships Lead Us to Success Act or the A PLUS Act

This bill allows each state to receive federal elementary and secondary education funds on a consolidated basis and manage the funds to advance the educational policy of the state.

A declaration of intent must be formulated by a combination of specified state officials or by referendum and must list the programs for which consolidated funding is requested. States may use such funds for any educational purpose permitted by state law, but must make certain assurances that they will use fiscal control and fund accounting procedures, abide by federal civil rights laws, advance educational opportunities for the disadvantaged, and use federal funds to supplement rather than supplant state funding.

Each declaration state shall: (1) inform the public about its student achievement assessment system, (2) report annually on student progress toward the state's proficiency standards by specified student groups, and (3) provide for the equitable participation of private school children and teachers in the same manner as provided for under current law.</summary>
  <committee-reports/>
</bill>


text:
(function() {

    var FAN_SOUND_ENTITY_NAME = "home_sfx_ceiling_fan"
    var SEARCH_RADIUS = 100;
    var _this;
    var utilitiesScript = Script.resolvePath('../utils.js');
    Script.include(utilitiesScript);
    Switch = function() {
        _this = this;
        this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav");
        _this.FAN_VOLUME = 0.1;

    };

    Switch.prototype = {
        prefix: 'home_living_room',
        clickReleaseOnEntity: function(entityID, mouseEvent) {
            if (!mouseEvent.isLeftButton) {
                return;
            }
            this.toggle();
        },

        startNearTrigger: function() {
            this.toggle();
        },

        fanRotationOn: function() {
            var success = Entities.editEntity(_this.fan, {
                angularDamping: 0,
                angularVelocity: {
                    x: 0,
                    y: 4,
                    z: 0
                },
            });
        },

        fanRotationOff: function() {
            Entities.editEntity(_this.fan, {
                angularDamping: 0.5,
            })
        },

        fanSoundOn: function() {
            if (!_this.fanSoundEntity) {
                return;
            }
            var soundUserData = getEntityCustomData("soundKey", _this.fanSoundEntity);
            if (!soundUserData) {
                print("NO SOUND USER DATA! RETURNING.");
                return;
            }
            soundUserData.volume = _this.FAN_VOLUME;
            setEntityCustomData("soundKey", _this.fanSoundEntity, soundUserData);

        },

        fanSoundOff: function() {
            print('HOME FAN OFF 1')
            if (!_this.fanSoundEntity) {
                return;
            }
            print('HOME FAN OFF 2')
            var soundUserData = getEntityCustomData("soundKey", _this.fanSoundEntity);
            if (!soundUserData) {
                print("NO SOUND USER DATA! RETURNING.");
                return;
            }
            print('HOME FAN OFF 3')
            soundUserData.volume = 0.0;
            setEntityCustomData("soundKey", _this.fanSoundEntity, soundUserData);
            print('HOME FAN OFF 4')
        },

        findFan: function() {
            var found = [];
            var results = Entities.findEntities(this.position, SEARCH_RADIUS);
            results.forEach(function(result) {
                var properties = Entities.getEntityProperties(result);
                if (properties.name === _this.prefix + "_model_ceiling_fan_blades") {
                    found.push(result);
                }
            });
            return found[0];
        },

        findFanSoundEntity: function() {

            var myProps = Entities.getEntityProperties(this.entityID);
            var entities = Entities.findEntities(myProps.position, SEARCH_RADIUS);

            var fan = null;
            print('HOME LOOKING FOR A FAN')
            print('HOME TOTAL ENTITIES:: ' + entities.length)
            entities.forEach(function(entity) {
                var props = Entities.getEntityProperties(entity);
                if (props.name === FAN_SOUND_ENTITY_NAME) {
                    print('HOME FAN FOUND:: ' + props.id)
                    fan = entity;
                }
            });

            return fan;
        },

        toggle: function() {
            this.fan = this.findFan();
            _this.fanSoundEntity = _this.findFanSoundEntity();

            this._switch = getEntityCustomData('home-switch', this.entityID, {
                state: 'off'
            });

            if (this._switch.state === 'off') {
                this.fanRotationOn();
                this.fanSoundOn();

                setEntityCustomData('home-switch', this.entityID, {
                    state: 'on'
                });

                Entities.editEntity(this.entityID, {
                    "animation": {
                        "currentFrame": 1,
                        "firstFrame": 1,
                        "hold": 1,
                        "lastFrame": 2,
                        "url": "atp:/switches/fanswitch.fbx"
                    },
                })

            } else {
                this.fanRotationOff();
                this.fanSoundOff();

                setEntityCustomData('home-switch', this.entityID, {
                    state: 'off'
                });
                Entities.editEntity(this.entityID, {
                    "animation": {
                        "currentFrame": 3,
                        "firstFrame": 3,
                        "hold": 1,
                        "lastFrame": 4,
                        "url": "atp:/switches/fanswitch.fbx"
                    },
                })

            }

            Audio.playSound(this.switchSound, {
                volume: 0.5,
                position: this.position
            });

        },

        preload: function(entityID) {
            this.entityID = entityID;
            setEntityCustomData('grabbableKey', this.entityID, {
                wantsTrigger: true
            });

            var properties = Entities.getEntityProperties(this.entityID);

            //The light switch is static, so just cache its position once
            this.position = Entities.getEntityProperties(this.entityID, "position").position;
        }
    };

    // entity scripts always need to return a newly constructed object of our type
    return new Switch();
});


text:
/**
 * @file Justify commands.
 */

(function()
{
	var alignRemoveRegex = /(-moz-|-webkit-|start|auto)/i;

	function getState( editor, path )
	{
		var firstBlock = path.block || path.blockLimit;

		if ( !firstBlock || firstBlock.getName() == 'body' )
			return CKEDITOR.TRISTATE_OFF;

		var currentAlign = firstBlock.getComputedStyle( 'text-align' ).replace( alignRemoveRegex, '' );
		if ( ( !currentAlign && this.isDefaultAlign ) || currentAlign == this.value )
			return CKEDITOR.TRISTATE_ON;
		return CKEDITOR.TRISTATE_OFF;
	}

	function onSelectionChange( evt )
	{
		var command = evt.editor.getCommand( this.name );
		command.state = getState.call( this, evt.editor, evt.data.path );
		command.fire( 'state' );
	}

	function justifyCommand( editor, name, value )
	{
		this.name = name;
		this.value = value;

		var contentDir = editor.config.contentsLangDirection;
		this.isDefaultAlign = ( value == 'left' && contentDir == 'ltr' ) ||
			( value == 'right' && contentDir == 'rtl' );

		var classes = editor.config.justifyClasses;
		if ( classes )
		{
			switch ( value )
			{
				case 'left' :
					this.cssClassName = classes[0];
					break;
				case 'center' :
					this.cssClassName = classes[1];
					break;
				case 'right' :
					this.cssClassName = classes[2];
					break;
				case 'justify' :
					this.cssClassName = classes[3];
					break;
			}

			this.cssClassRegex = new RegExp( '(?:^|\\s+)(?:' + classes.join( '|' ) + ')(?=$|\\s)' );
		}
	}

	justifyCommand.prototype = {
		exec : function( editor )
		{
			var selection = editor.getSelection();
			if ( !selection )
				return;

			var bookmarks = selection.createBookmarks(),
				ranges = selection.getRanges();

			var cssClassName = this.cssClassName,
				iterator,
				block;
			for ( var i = ranges.length - 1 ; i >= 0 ; i-- )
			{
				iterator = ranges[ i ].createIterator();
				while ( ( block = iterator.getNextParagraph() ) )
				{
					block.removeAttribute( 'align' );

					if ( cssClassName )
					{
						// Remove any of the alignment classes from the className.
						var className = block.$.className =
							CKEDITOR.tools.ltrim( block.$.className.replace( this.cssClassRegex, '' ) );

						// Append the desired class name.
						if ( this.state == CKEDITOR.TRISTATE_OFF && !this.isDefaultAlign )
							block.addClass( cssClassName );
						else if ( !className )
							block.removeAttribute( 'class' );
					}
					else
					{
						if ( this.state == CKEDITOR.TRISTATE_OFF && !this.isDefaultAlign )
							block.setStyle( 'text-align', this.value );
						else
							block.removeStyle( 'text-align' );
					}
				}

			}

			editor.focus();
			editor.forceNextSelectionCheck();
			selection.selectBookmarks( bookmarks );
		}
	};

	CKEDITOR.plugins.add( 'justify',
	{
		init : function( editor )
		{
			var left = new justifyCommand( editor, 'justifyleft', 'left' ),
				center = new justifyCommand( editor, 'justifycenter', 'center' ),
				right = new justifyCommand( editor, 'justifyright', 'right' ),
				justify = new justifyCommand( editor, 'justifyblock', 'justify' );

			editor.addCommand( 'justifyleft', left );
			editor.addCommand( 'justifycenter', center );
			editor.addCommand( 'justifyright', right );
			editor.addCommand( 'justifyblock', justify );

			editor.ui.addButton( 'JustifyLeft',
				{
					label : editor.lang.justify.left,
					command : 'justifyleft'
				} );
			editor.ui.addButton( 'JustifyCenter',
				{
					label : editor.lang.justify.center,
					command : 'justifycenter'
				} );
			editor.ui.addButton( 'JustifyRight',
				{
					label : editor.lang.justify.right,
					command : 'justifyright'
				} );
			editor.ui.addButton( 'JustifyBlock',
				{
					label : editor.lang.justify.block,
					command : 'justifyblock'
				} );

			editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, left ) );
			editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, right ) );
			editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, center ) );
			editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, justify ) );
		},

		requires : [ 'domiterator' ]
	});
})();

CKEDITOR.tools.extend( CKEDITOR.config,
	{
		justifyClasses : null
	} );


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Hagbis.HSoup.Helper {
    public static class Validate {
        /// <summary>
        /// Validates that the object is not null
        /// </summary>
        /// <param name="obj">object to test</param>
        public static void NotNull(object obj) {
            if(obj == null)
                throw new ArgumentException("Object must not be null");
        }
        /// <summary>
        /// Validates that the object is not null
        /// </summary>
        /// <param name="obj">object to test</param>
        /// <param name="msg">message to output if validation fails</param>
        public static void NotNull(object obj, string msg) {
            if(obj == null)
                throw new ArgumentException(msg);
        }
        /// <summary>
        /// Validates that the value is true
        /// </summary>
        /// <param name="val">object to test</param>
        public static void IsTrue(bool val) {
            if(!val)
                throw new ArgumentException("Must be true");
        }
        /// <summary>
        /// Validates that the value is true
        /// </summary>
        /// <param name="val">object to test</param>
        /// <param name="msg">message to output if validation fail</param>
        public static void IsTrue(bool val, string msg) {
            if(!val)
                throw new ArgumentException(msg);
        }
        /// <summary>
        /// Validates that the value is false
        /// </summary>
        /// <param name="val">object to test</param>
        public static void IsFalse(bool val) {
            if(val)
                throw new ArgumentException("Must be false");
        }
        /// <summary>
        /// Validates that the value is false
        /// </summary>
        /// <param name="val">object to test</param>
        /// <param name="msg">message to output if validation fails</param>
        public static void IsFalse(bool val, string msg) {
            if(val)
                throw new ArgumentException(msg);
        }
        /// <summary>
        /// Validates that the array contains no null elements
        /// </summary>
        /// <param name="objects">the array to test</param>
        public static void NoNullElements(object[] objects) {
            NoNullElements(objects, "Array must not contain any null objects");
        }
        /// <summary>
        /// Validates that the array contains no null elements
        /// </summary>
        /// <param name="objects">the array to test</param>
        /// <param name="msg">message to output if validation fails</param>
        public static void NoNullElements(object[] objects, string msg) {
            foreach(var obj in objects) {
                if(obj == null)
                    throw new ArgumentException(msg);
            }
        }
        /// <summary>
        /// Validates that the string is not empty
        /// </summary>
        /// <param name="str">the string to test</param>
        public static void NotEmpty(string str) {
            if(str == null || str.Length == 0)
                throw new ArgumentException("String must not be empty");
        }
        /// <summary>
        /// Validates that the string is not empty
        /// </summary>
        /// <param name="str">the string to test</param>
        /// <param name="msg">message to output if validation fails</param>
        public static void NotEmpty(string str, string msg) {
            if(str == null || str.Length == 0)
                throw new ArgumentException(msg);
        }
        /// <summary>
        /// Cause a failure.
        /// </summary>
        /// <param name="msg">message to output.</param>
        public static void Fail(string msg) {
            throw new ArgumentException(msg);
        }
    }
}


text:
<?php
App::uses('AppController', 'Controller');
/**
 * References Controller
 *
 */
class ReferencesController extends AppController {

/**
 * Scaffold
 *
 * @var mixed
 */
	public $scaffold;

}


text:
@implementation HomeCategoryModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        [self setValue:value forKey:@"_id"];
    }
}
@end


text:
package com.amber.random.datapoliceuk.model.neighbourhood;

import android.support.annotation.Nullable;

import com.amber.random.datapoliceuk.model.base.ContactDetails;
import com.google.auto.value.AutoValue;
import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.SerializedName;

import java.util.List;

@AutoValue
public abstract class SpecificNeighbourhood {
    public static TypeAdapter<SpecificNeighbourhood> typeAdapter(Gson gson) {
        return new AutoValue_SpecificNeighbourhood.GsonTypeAdapter(gson);
    }

    @SerializedName("url_force")
    public abstract String urlForce();

    @SerializedName("contact_details")
    public abstract ContactDetails contactDetails();

    public abstract String name();

    @SerializedName("welcome_message")
    public abstract String welcomeMessage();

    public abstract List<Link> links();

    public abstract Coordinate centre();

    public abstract List<Location> locations();

    public abstract Integer population();

    public abstract String id();

    @Nullable
    public abstract String description();
}