text:
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 *
DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *
 * @generated
 */
package com.xjeffrose.xio.marshall.thrift;

import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Generated;
import org.apache.thrift.protocol.TTupleProtocol;
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.server.AbstractNonblockingServer.*;

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

  private static final org.apache.thrift.protocol.TField BLACKLIST_HOSTS_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "blacklistHosts", org.apache.thrift.protocol.TType.SET, (short) 1);
  private static final org.apache.thrift.protocol.TField WHITELIST_HOSTS_FIELD_DESC =
      new org.apache.thrift.protocol.TField(
          "whitelistHosts", org.apache.thrift.protocol.TType.SET, (short) 2);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes =
      new HashMap<Class<? extends IScheme>, SchemeFactory>();

  static {
    schemes.put(StandardScheme.class, new HostnameRulesetStandardSchemeFactory());
    schemes.put(TupleScheme.class, new HostnameRulesetTupleSchemeFactory());
  }

  public Set<String> blacklistHosts; // required
  public Set<String> whitelistHosts; // 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 {
    BLACKLIST_HOSTS((short) 1, "blacklistHosts"),
    WHITELIST_HOSTS((short) 2, "whitelistHosts");

    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: // BLACKLIST_HOSTS
          return BLACKLIST_HOSTS;
        case 2: // WHITELIST_HOSTS
          return WHITELIST_HOSTS;
        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.BLACKLIST_HOSTS,
        new org.apache.thrift.meta_data.FieldMetaData(
            "blacklistHosts",
            org.apache.thrift.TFieldRequirementType.REQUIRED,
            new org.apache.thrift.meta_data.SetMetaData(
                org.apache.thrift.protocol.TType.SET,
                new org.apache.thrift.meta_data.FieldValueMetaData(
                    org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(
        _Fields.WHITELIST_HOSTS,
        new org.apache.thrift.meta_data.FieldMetaData(
            "whitelistHosts",
            org.apache.thrift.TFieldRequirementType.REQUIRED,
            new org.apache.thrift.meta_data.SetMetaData(
                org.apache.thrift.protocol.TType.SET,
                new org.apache.thrift.meta_data.FieldValueMetaData(
                    org.apache.thrift.protocol.TType.STRING))));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(
        HostnameRuleset.class, metaDataMap);
  }

  public HostnameRuleset() {}

  public HostnameRuleset(Set<String> blacklistHosts, Set<String> whitelistHosts) {
    this();
    this.blacklistHosts = blacklistHosts;
    this.whitelistHosts = whitelistHosts;
  }

  /** Performs a deep copy on other. */
  public HostnameRuleset(HostnameRuleset other) {
    if (other.isSetBlacklistHosts()) {
      Set<String> __this__blacklistHosts = new HashSet<String>(other.blacklistHosts);
      this.blacklistHosts = __this__blacklistHosts;
    }
    if (other.isSetWhitelistHosts()) {
      Set<String> __this__whitelistHosts = new HashSet<String>(other.whitelistHosts);
      this.whitelistHosts = __this__whitelistHosts;
    }
  }

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

  @Override
  public void clear() {
    this.blacklistHosts = null;
    this.whitelistHosts = null;
  }

  public int getBlacklistHostsSize() {
    return (this.blacklistHosts == null) ? 0 : this.blacklistHosts.size();
  }

  public java.util.Iterator<String> getBlacklistHostsIterator() {
    return (this.blacklistHosts == null) ? null : this.blacklistHosts.iterator();
  }

  public void addToBlacklistHosts(String elem) {
    if (this.blacklistHosts == null) {
      this.blacklistHosts = new HashSet<String>();
    }
    this.blacklistHosts.add(elem);
  }

  public Set<String> getBlacklistHosts() {
    return this.blacklistHosts;
  }

  public HostnameRuleset setBlacklistHosts(Set<String> blacklistHosts) {
    this.blacklistHosts = blacklistHosts;
    return this;
  }

  public void unsetBlacklistHosts() {
    this.blacklistHosts = null;
  }

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

  public void setBlacklistHostsIsSet(boolean value) {
    if (!value) {
      this.blacklistHosts = null;
    }
  }

  public int getWhitelistHostsSize() {
    return (this.whitelistHosts == null) ? 0 : this.whitelistHosts.size();
  }

  public java.util.Iterator<String> getWhitelistHostsIterator() {
    return (this.whitelistHosts == null) ? null : this.whitelistHosts.iterator();
  }

  public void addToWhitelistHosts(String elem) {
    if (this.whitelistHosts == null) {
      this.whitelistHosts = new HashSet<String>();
    }
    this.whitelistHosts.add(elem);
  }

  public Set<String> getWhitelistHosts() {
    return this.whitelistHosts;
  }

  public HostnameRuleset setWhitelistHosts(Set<String> whitelistHosts) {
    this.whitelistHosts = whitelistHosts;
    return this;
  }

  public void unsetWhitelistHosts() {
    this.whitelistHosts = null;
  }

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

  public void setWhitelistHostsIsSet(boolean value) {
    if (!value) {
      this.whitelistHosts = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
      case BLACKLIST_HOSTS:
        if (value == null) {
          unsetBlacklistHosts();
        } else {
          setBlacklistHosts((Set<String>) value);
        }
        break;

      case WHITELIST_HOSTS:
        if (value == null) {
          unsetWhitelistHosts();
        } else {
          setWhitelistHosts((Set<String>) value);
        }
        break;
    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
      case BLACKLIST_HOSTS:
        return getBlacklistHosts();

      case WHITELIST_HOSTS:
        return getWhitelistHosts();
    }
    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 BLACKLIST_HOSTS:
        return isSetBlacklistHosts();
      case WHITELIST_HOSTS:
        return isSetWhitelistHosts();
    }
    throw new IllegalStateException();
  }

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

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

    boolean this_present_blacklistHosts = true && this.isSetBlacklistHosts();
    boolean that_present_blacklistHosts = true && that.isSetBlacklistHosts();
    if (this_present_blacklistHosts || that_present_blacklistHosts) {
      if (!(this_present_blacklistHosts && that_present_blacklistHosts)) return false;
      if (!this.blacklistHosts.equals(that.blacklistHosts)) return false;
    }

    boolean this_present_whitelistHosts = true && this.isSetWhitelistHosts();
    boolean that_present_whitelistHosts = true && that.isSetWhitelistHosts();
    if (this_present_whitelistHosts || that_present_whitelistHosts) {
      if (!(this_present_whitelistHosts && that_present_whitelistHosts)) return false;
      if (!this.whitelistHosts.equals(that.whitelistHosts)) return false;
    }

    return true;
  }

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

    boolean present_blacklistHosts = true && (isSetBlacklistHosts());
    list.add(present_blacklistHosts);
    if (present_blacklistHosts) list.add(blacklistHosts);

    boolean present_whitelistHosts = true && (isSetWhitelistHosts());
    list.add(present_whitelistHosts);
    if (present_whitelistHosts) list.add(whitelistHosts);

    return list.hashCode();
  }

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

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetBlacklistHosts()).compareTo(other.isSetBlacklistHosts());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBlacklistHosts()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.blacklistHosts, other.blacklistHosts);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWhitelistHosts()).compareTo(other.isSetWhitelistHosts());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWhitelistHosts()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.whitelistHosts, other.whitelistHosts);
      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("HostnameRuleset(");
    boolean first = true;

    sb.append("blacklistHosts:");
    if (this.blacklistHosts == null) {
      sb.append("null");
    } else {
      sb.append(this.blacklistHosts);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("whitelistHosts:");
    if (this.whitelistHosts == null) {
      sb.append("null");
    } else {
      sb.append(this.whitelistHosts);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (blacklistHosts == null) {
      throw new org.apache.thrift.protocol.TProtocolException(
          "Required field 'blacklistHosts' was not present! Struct: " + toString());
    }
    if (whitelistHosts == null) {
      throw new org.apache.thrift.protocol.TProtocolException(
          "Required field 'whitelistHosts' 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 {
      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 HostnameRulesetStandardSchemeFactory implements SchemeFactory {
    public HostnameRulesetStandardScheme getScheme() {
      return new HostnameRulesetStandardScheme();
    }
  }

  private static class HostnameRulesetStandardScheme extends StandardScheme<HostnameRuleset> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, HostnameRuleset 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: // BLACKLIST_HOSTS
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set0 = iprot.readSetBegin();
                struct.blacklistHosts = new HashSet<String>(2 * _set0.size);
                String _elem1;
                for (int _i2 = 0; _i2 < _set0.size; ++_i2) {
                  _elem1 = iprot.readString();
                  struct.blacklistHosts.add(_elem1);
                }
                iprot.readSetEnd();
              }
              struct.setBlacklistHostsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // WHITELIST_HOSTS
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set3 = iprot.readSetBegin();
                struct.whitelistHosts = new HashSet<String>(2 * _set3.size);
                String _elem4;
                for (int _i5 = 0; _i5 < _set3.size; ++_i5) {
                  _elem4 = iprot.readString();
                  struct.whitelistHosts.add(_elem4);
                }
                iprot.readSetEnd();
              }
              struct.setWhitelistHostsIsSet(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, HostnameRuleset struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.blacklistHosts != null) {
        oprot.writeFieldBegin(BLACKLIST_HOSTS_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.STRING, struct.blacklistHosts.size()));
          for (String _iter6 : struct.blacklistHosts) {
            oprot.writeString(_iter6);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.whitelistHosts != null) {
        oprot.writeFieldBegin(WHITELIST_HOSTS_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.STRING, struct.whitelistHosts.size()));
          for (String _iter7 : struct.whitelistHosts) {
            oprot.writeString(_iter7);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
  }

  private static class HostnameRulesetTupleSchemeFactory implements SchemeFactory {
    public HostnameRulesetTupleScheme getScheme() {
      return new HostnameRulesetTupleScheme();
    }
  }

  private static class HostnameRulesetTupleScheme extends TupleScheme<HostnameRuleset> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, HostnameRuleset struct)
        throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      {
        oprot.writeI32(struct.blacklistHosts.size());
        for (String _iter8 : struct.blacklistHosts) {
          oprot.writeString(_iter8);
        }
      }
      {
        oprot.writeI32(struct.whitelistHosts.size());
        for (String _iter9 : struct.whitelistHosts) {
          oprot.writeString(_iter9);
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, HostnameRuleset struct)
        throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      {
        org.apache.thrift.protocol.TSet _set10 =
            new org.apache.thrift.protocol.TSet(
                org.apache.thrift.protocol.TType.STRING, iprot.readI32());
        struct.blacklistHosts = new HashSet<String>(2 * _set10.size);
        String _elem11;
        for (int _i12 = 0; _i12 < _set10.size; ++_i12) {
          _elem11 = iprot.readString();
          struct.blacklistHosts.add(_elem11);
        }
      }
      struct.setBlacklistHostsIsSet(true);
      {
        org.apache.thrift.protocol.TSet _set13 =
            new org.apache.thrift.protocol.TSet(
                org.apache.thrift.protocol.TType.STRING, iprot.readI32());
        struct.whitelistHosts = new HashSet<String>(2 * _set13.size);
        String _elem14;
        for (int _i15 = 0; _i15 < _set13.size; ++_i15) {
          _elem14 = iprot.readString();
          struct.whitelistHosts.add(_elem14);
        }
      }
      struct.setWhitelistHostsIsSet(true);
    }
  }
}


text:
from .. import helpers
import NSURLResponse
import NSHTTPURLResponseInternal

class NSHTTPURLResponseSyntheticProvider(NSURLResponse.NSURLResponseSyntheticProvider):
    """
    Class representing NSHTTPURLResponse.
    """
    def __init__(self, value_obj, internal_dict):
        super(NSHTTPURLResponseSyntheticProvider, self).__init__(value_obj, internal_dict)
        self.type_name = "NSHTTPURLResponse"

        self.register_child_value("http_response_internal", ivar_name="_httpInternal",
                                  provider_class=NSHTTPURLResponseInternal.NSHTTPURLResponseInternalSyntheticProvider,
                                  summary_function=self.get_http_response_internal_summary)

    @staticmethod
    def get_http_response_internal_summary(provider):
        """
        :param NSHTTPURLResponseInternal.NSHTTPURLResponseInternalSyntheticProvider provider: NSHTTPURLResponseInternal provider.
        """
        return provider.summary()

    def summaries_parts(self):
        return self.response_internal_provider.summaries_parts()

def summary_provider(value_obj, internal_dict):
    return helpers.generic_summary_provider(value_obj, internal_dict, NSHTTPURLResponseSyntheticProvider)

redpajama_set_name: RedPajamaGithub


text:
package base.entity.kv.mock

import base.entity.kv.KeyLogger

/**
 * {{ Describe the high level purpose of KeyLoggerMock here. }}
 * {{ Include relevant details here. }}
 * {{ Do not skip writing good doc! }}
 * @author rconrad
 */
object KeyLoggerMock extends KeyLogger {

  private[kv] def log(cmd: String, msg: String) {}

  private[kv] def log(cmd: String, token: String, msg: String) {}

}


text:
@implementation SFAConsumerConnectorAuthParser

- (SFAHTTPAuthenticationChallenge *)authChallengeWithResponseContainer:(SFAHttpRequestResponseDataContainer *)container
                                                           authContext:(SFAuthenticationContext *)authContext {
    if (container && [container.response isUnauthorizedCode]) {
        NSString *formsURLString = nil;
        NSString *tokenURLString = nil;

        NSString *authHeaderValue = container.response.allHeaderFields[SFAWWWAuthenticate];

        if (authHeaderValue.length > 0) {
            NSArray *authFields = [authHeaderValue componentsSeparatedByString:@" "];
            if (authFields.count == 4) {
                if ([(NSString *)[authFields objectAtIndex:0] compare:@"forms" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
                    formsURLString = (NSString *)[authFields objectAtIndex:1];
                }
                if ([(NSString *)[authFields objectAtIndex:2] compare:@"token" options:NSCaseInsensitiveSearch] == NSOrderedSame) {
                    tokenURLString = (NSString *)[authFields objectAtIndex:3];
                }
                if (formsURLString.length > 0 && tokenURLString.length > 0) {
                    SFAHTTPAuthenticationChallenge *challenge = [[SFAHTTPAuthenticationChallenge alloc]
                                                                 initWithAuthMethod:kSFNSURLAuthenticationMethodConsumerConnector
                                                                 originalRequestURL:[authContext.originalRequestURL copy]
                                                                        andFormsURL:[formsURLString URL]
                                                                        andTokenURL:[tokenURLString URL]
                                                                            isProxy:[[container.response URL] isProxy]];
                    return challenge;
                }
            }
        }
    }

    return nil;
}

@end


text:
/*if(window.location.pathname.length > 1){
			var title = window.location.pathname.substr(1);
			document.title = title + ' definition';
}*/
jQuery(document).ready(function($) {
    var initialpop = true;
    var typeList = ["Adjective", "Noun", "Verb", "Adverb", "Pronoun", "Proper noun", "Article", "Determiner", "Preposition", "Interjection", "Initialism"];
    var myResultsList = new Array();

    if (window.location.pathname.length > 1) {
        if ($('.search').length) {
            $('.search').val(unescape(window.location.pathname.substr(1)).replace(/_+/g, ' '));
            $('#result').animate({
                opacity: 0
            });
            // executeSearch(unescape(window.location.pathname.substr(1)).replace(/_+/g,' '));
            checkFavoriteButton(unescape(window.location.pathname.substr(1)).replace(/_+/g, ' '));
            checkWhoElseLiked(unescape(window.location.pathname.substr(1)).replace(/_+/g, ' '));
            $('#result').animate({
                opacity: 1
            }, 100);
            rebindClick();
        }
    } else {

    }

    $('#post-comment').click(function(e) {

        var url = document.location.origin + '/services/posthandler.php';
        var btn = this;
        var textArea = $('#comment-textarea')[0];

        btn.innerHTML = 'Posting Comment...';

        $('.search').val(unescape(window.location.pathname.substr(1)).replace(/_+/g, ' '));
        var word = $('.search').val();

        if (textArea.value.trim().length > 0) {
            var mydata = {
                comment: textArea.value,
                word: word,
                mywlaction: 'postComment',
                ajax: 1
            };
            $.post(url, mydata, function(data) {
                if (data == 'comment_posted') {
                    textArea.value = '';
                    btn.innerHTML = 'Comment Posted';
                    checkWhoElseLiked(word);
                    var timeout = setTimeout(function() {
                        btn.innerHTML = 'Post';
                        clearTimeout(timeout);
                    }, 1000);
                } else {
                    textArea.value = textArea.value;
                    btn.innerHTML = 'Comment Failed';
                    btn.style.border = '1px dashed salmon';
                    btn.style.color = 'salmon';
                    var timeout = setTimeout(function() {
                        btn.innerHTML = 'Post';
                        btn.style.border = '1px dashed #6ef1b2';
                        btn.style.color = '#6ef1b2';
                        clearTimeout(timeout);
                    }, 1000);
                }
            });
        } else {
            textArea.value = textArea.value;
            btn.innerHTML = 'Empty Comment';
            btn.style.border = '1px dashed salmon';
            btn.style.color = 'salmon';
            var timeout = setTimeout(function() {
                btn.innerHTML = 'Post';
                btn.style.border = '1px dashed #6ef1b2';
                btn.style.color = '#6ef1b2';
                clearTimeout(timeout);
            }, 1000);
        }

    });

    $('#foo').submit(function(e) {

        $('#result').css('opacity', 0);
        $('.notes').hide();
        $('#word-likes-tab-header').css('opacity', 0);

        //$('#result').animate({opacity: 0},1000);

        //window.location.href=$('#foo .search').val();
        //This is where we update the address bar with the 'url' parameter
        // .trim().replace(/ +/g,'-')
        window.history.pushState('', document.title, $('#foo .search').val().trim().replace(/ +/g, '_'));

        //This stops the browser from actually following the link
        e.preventDefault();
        executeSearch(($('#foo .search').val()).replace(/_+/g, ' '));
        return false;
    });

    function checkFavoriteButton(word) {
        var url = document.location.origin + '/services/posthandler.php';

        var mydata = {
            word: word,
            mywlaction: 'check',
            ajax: 1
        };
        $.post(url, mydata, function(data) {
            //loadingImg = $('.mywl-img');
            if (data == 'favorite') {
                //$('.mywl-link').addClass('favorited');
                //loadingImg.hide();
                $('.mywl-link .liked-heart').show();
                $('.mywl-link .unliked-heart').hide();
            } else {
                //$('.mywl-link').removeClass('favorited');
                //loadingImg.hide();
                $('.mywl-link .unliked-heart').show();
                $('.mywl-link .liked-heart').hide();
            }
        });
    }

    function checkWhoElseLiked(word) {
        var url = document.location.origin + '/services/posthandler.php';

        var mydata = {
            word: word,
            mywlaction: 'whoElseLiked',
            ajax: 1
        };
        var log = $('#word-likes-tab');
        log.html('');
        $.post(url, mydata, function(data) {
            log = $('#word-likes-tab');
            log.html('');
            if (data == 'none-guest') {
                $('.notes').hide();
                $('#word-likes-tab-header').text('');
                $('#word-likes-tab-header').animate({
                    opacity: 0
                }, 100);
                log.html('');
            } else if (data == 'none') {
                $('.notes').show(100);
                $('#word-likes-tab-header').text('Likes & Comments');
                $('.comment-box').length && $('.comment-box').show();
                $('#word-likes-tab-header').animate({
                    opacity: 1
                }, 100);

            } else {
                $('.notes').show(100);
                var parsedResponse = JSON.parse(data);
                $('#word-likes-tab-header').text(parsedResponse.likes + ' Likes & ' + parsedResponse.comments + ' Comments');
                $('.comment-box').length && $('.comment-box').show();
                $('#word-likes-tab-header').animate({
                    opacity: 1
                }, 100);
                log.html(parsedResponse.contents);
            }
            jQuery("time.timeago").timeago();
        });
    }

    function executeSearch(word) {
        initialpop = false;
        var title = word;

        //console.log("wlp = "+window.location.pathname);
        //$('div.share a.twitter')[0].href;
        var nwt = $('div.share a.twitter')[0].href.substring(0, $('div.share a.twitter')[0].href.indexOf("http://wordo.co") + 15) + window.location.pathname;
        //console.log("nwt = "+nwt);
        $('div.share a.twitter')[0].href = nwt;

        //$('div.share a.facebook')[0].href;
        var nwf = $('div.share a.facebook')[0].href.substring(0, $('div.share a.facebook')[0].href.indexOf("http://wordo.co") + 15) + window.location.pathname;
        //console.log("nwf = "+nwf);
        $('div.share a.facebook')[0].href = nwf;

        document.title = word + ' definition by Wordo';
        //document.title = title + ' definition';
        //$('#foo .search').val(title.replace(/_/g," "));
        //http://en.wiktionary.org/w/api.php?format=jsonfm&action=query&titles=Homo_sapiens&prop=revisions&rvprop=content
        $.getJSON("https://en.wiktionary.org/w/api.php?format=json&action=query&titles=" + title + "&prop=revisions&rvprop=content&callback=?", function(data) {
            //$('body').append('
' + data);
            //alert('test');

            var mydata = data['query']['pages'];
            for (var first in mydata) break;

            //alert(first);

            mydata = mydata[first]['revisions'];
            for (first in mydata) break;

            if (mydata !== undefined) {
                mydata = mydata[first]['*'];
                resultSelect(mydata);
                checkFavoriteButton(word);
                checkWhoElseLiked(word);

            } else {
                //noresultfound
                $('.notes').hide();
                $('#word-likes-tab-header').text('');
                $('#word-likes-tab-header').animate({
                    opacity: 0
                }, 100);
                noSearchResult();
            }
        });

    }

    function resultSelect(x10) {
        myResultsList = new Array();
        $('#result').html('');
        var newResult = x10;
        var m_result;
        var m_temp;
        var result = x10;
        var myIndex = -1;
        //var counter = 0;
        //while(myIndex < 0 && counter < typeList.length){
        m_result = x10.match(/==English==[\s\S]*?----/g);
        if (m_result == null) {
            m_result = x10.match(/==English==[\s\S]*/g);
        }

        if (m_result != null) {
            x10 = m_result[0];
            for (var i = 0; i < typeList.length; i++) {
                var re = new RegExp("={3,4}" + typeList[i] + "={3,4}", "g");
                myIndex = x10.search(re);
                //myconsole(x10.match(re));
                if (myIndex >= 0) {
                    var x101 = x10;
                    x101 = x101.substr(myIndex);

                    //go to the first #
                    x101 = x101.substr(x101.indexOf('#') + 1);

                    //get the first definition
                    if (x101.indexOf('\n') != -1) {
                        x101 = x101.substr(0, x101.indexOf('\n'));
                    }

                    myResultsList.push(x101);
                    x101 = wordoReplaceLinks(x101);
                    if (x101.replace(' ', '') != '') {
                        $('#result').append('

' + typeList[i] + '

' + x101 + '
');

                        $('.mywl-link').show();
                    }
                }
                //counter++;
            }
            /*
      if(myResultsList.length == 1){
				var myres = myResultsList[0];
				myres = myres.replace(/.*{{(.*?)\|(.*?)}}/,'$2');
				//myconsole('myres3: ' + myres);
				if(myres.match(/\[/) == null && myres.match(/\s/) == null ){
					window.history.pushState(myres, document.title, myres.trim().replace(/ +/g,'_'));
					//myconsole(myres);
					executeSearch(myres.replace(/_+/g,' '));
				}
			}
      */
        } else {
            //myconsole('is null');
        }

        rebindClick();
    }

    $(window).bind('popstate', function(event) {
        if (!initialpop) {
            if (window.location.pathname.length > 1) {
                var currentpage = window.location.pathname.substr(1);
                executeSearch(currentpage.replace(/_+/g, ' '));
                $('#foo .search').val(currentpage);
            }
        }
        initialpop = false;
    });

    function myconsole(logObj) {
        try {
            console.log(logObj);
        } catch (e) {

        }
    }

    function noSearchResult() {
        $('#foo').effect("bounce", {
            direction: 'right'
        });
        $('.mywl-link').hide();
        $('.comment-box').hide();
    }

    function wordoReplaceLinks(data) {
        //remove the {{}} stuff
        data = data.replace(/\{\{.*?\}\}/g, '');

        //replace all anchors
        data = data.replace(/\[\[.*?([A-z ]+?)\]\]/g, '[[$1]]');

        //try to replace all spaces

        var links = data.match(/\[\[([A-z ]+?)\]\]/g);
        if (links != null) {
            $.each(links, function(index, value) {
                var value = value.replace(/[\[\]]/g, '');
                value = value.replace(/ /g, '-');
                data = data.replace(/\[\[([A-z ]+?)\]\]/, value);
            });

        }
        //replace the rest of the words

        data = wordoReplaceRegularWords(data);
        return data;
    }

    function wordoReplaceRegularWords(data) {
        var allWords = data.match(/[\w-]+/g);
        var uniquestring = Math.random().toString(36).substr(2);
        data = data.replace(/[\w-]+/g, uniquestring);

        if (allWords != null) {
            //var newData = '';
            $.each(allWords, function(index, value) {
                var value = value.replace(/-/g, ' ');
                if (value == 'mdash') {
                    var regex = new RegExp(uniquestring);
                    data = data.replace(regex, value);
                    return true;
                }
                value = value.replace(/(.*)/, '
$1
');
                var regex = new RegExp(uniquestring);
                data = data.replace(regex, value);
            });

            //newData = newData.replace(/\/div>
 <div');
            //data = newData;
        }

        return data;
    }

    function rebindClick() {
        //alert('i try');
        $('div.a').off('click');
        $('div.a').click(function(event) {
            var linktext = $(this).text();
            $('#foo .search').val(linktext);
            $('#result').animate({
                opacity: 0
            }, 100, function() {
                //window.location.href = '/' + linktext;
                window.history.pushState(linktext, document.title, linktext.trim().replace(/ +/g, '_'));
                executeSearch(linktext.replace(/_+/g, ' '));

            });
            event.preventDefault();
        });
        $('#result').animate({
            opacity: 1
        }, 200);
    }

    // broken images
    $('img').error(function() {
        $(this).attr('src', '/assets/images/broken.png');
    });

});

function imgError(image) {
    image.onerror = "";
    image.src = "/assets/images/broken.png";
    return true;
}


text:
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using UnityEngine;
using UnityEngine.EventSystems;
using TMPro;

namespace Microsoft.MixedReality.Toolkit.Experimental.UI
{
    /// <summary>
    /// A derived class of TMP's InputField to workaround with some issues of typing on HoloLens 2 specific to Unity 2018.4
    /// </summary>
    /// <remarks>
    /// <para>If using Unity 2019 or 2020, make sure the version >= 2019.4.25 or 2020.3.2 to ensure the latest fixes for Unity keyboard bugs are present.</para>
    /// <para>There is a known Unity/TMP issue preventing the caret from showing up. Please see https://github.com/microsoft/MixedRealityToolkit-Unity/issues/9056 for updates.</para>
    /// </remarks>
    public class MRTKTMPInputField : TMP_InputField
    {
#if !UNITY_2019_3_OR_NEWER
        public int SelectionPosition
        {
            get => caretSelectPositionInternal;
            set
            {
                caretSelectPositionInternal = value;
                selectionStringFocusPosition = value;
                selectionStringAnchorPosition = value;
            }
        }
        public override void OnUpdateSelected(BaseEventData eventData) { }
#endif
    }
}


text:
package com.amazonaws.services.licensemanagerusersubscriptions.model;

import javax.annotation.Generated;

/**
 * <p>
 * The request couldn't be completed because it conflicted with the current state of the resource.
 * </p>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ConflictException extends com.amazonaws.services.licensemanagerusersubscriptions.model.AWSLicenseManagerUserSubscriptionsException {
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new ConflictException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public ConflictException(String message) {
        super(message);
    }

}


text:
#pragma once
#include <aws/waf-regional/WAFRegional_EXPORTS.h>
#include <aws/waf-regional/model/ChangeAction.h>
#include <aws/waf-regional/model/SizeConstraint.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace WAFRegional
{
namespace Model
{

  /**
   *
This is AWS WAF Classic documentation. For more information,
   * see AWS
   * WAF Classic in the developer guide.

 For the latest version of AWS
   * WAF, use the AWS WAFV2 API and see the AWS
   * WAF Developer Guide. With the latest version, AWS WAF has a single set of
   * endpoints for regional and global use.

Specifies the part of a
   * web request that you want to inspect the size of and indicates whether you want
   * to add the specification to a SizeConstraintSet or delete it from a
   * SizeConstraintSet.

See Also:
   AWS
   * API Reference

   */
  class AWS_WAFREGIONAL_API SizeConstraintSetUpdate
  {
  public:
    SizeConstraintSetUpdate();
    SizeConstraintSetUpdate(Aws::Utils::Json::JsonView jsonValue);
    SizeConstraintSetUpdate& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
Specify INSERT to add a SizeConstraintSetUpdate to a
     * SizeConstraintSet. Use DELETE to remove a
     * SizeConstraintSetUpdate from a SizeConstraintSet.

     */
    inline const ChangeAction& GetAction() const{ return m_action; }

    /**
     *
Specify INSERT to add a SizeConstraintSetUpdate to a
     * SizeConstraintSet. Use DELETE to remove a
     * SizeConstraintSetUpdate from a SizeConstraintSet.

     */
    inline bool ActionHasBeenSet() const { return m_actionHasBeenSet; }

    /**
     *
Specify INSERT to add a SizeConstraintSetUpdate to a
     * SizeConstraintSet. Use DELETE to remove a
     * SizeConstraintSetUpdate from a SizeConstraintSet.

     */
    inline void SetAction(const ChangeAction& value) { m_actionHasBeenSet = true; m_action = value; }

    /**
     *
Specify INSERT to add a SizeConstraintSetUpdate to a
     * SizeConstraintSet. Use DELETE to remove a
     * SizeConstraintSetUpdate from a SizeConstraintSet.

     */
    inline void SetAction(ChangeAction&& value) { m_actionHasBeenSet = true; m_action = std::move(value); }

    /**
     *
Specify INSERT to add a SizeConstraintSetUpdate to a
     * SizeConstraintSet. Use DELETE to remove a
     * SizeConstraintSetUpdate from a SizeConstraintSet.

     */
    inline SizeConstraintSetUpdate& WithAction(const ChangeAction& value) { SetAction(value); return *this;}

    /**
     *
Specify INSERT to add a SizeConstraintSetUpdate to a
     * SizeConstraintSet. Use DELETE to remove a
     * SizeConstraintSetUpdate from a SizeConstraintSet.

     */
    inline SizeConstraintSetUpdate& WithAction(ChangeAction&& value) { SetAction(std::move(value)); return *this;}

    /**
     *
Specifies a constraint on the size of a part of the web request. AWS WAF uses
     * the Size, ComparisonOperator, and
     * FieldToMatch to build an expression in the form of
     * "Size ComparisonOperator size in bytes of
     * FieldToMatch". If that expression is true, the
     * SizeConstraint is considered to match.

     */
    inline const SizeConstraint& GetSizeConstraint() const{ return m_sizeConstraint; }

    /**
     *
Specifies a constraint on the size of a part of the web request. AWS WAF uses
     * the Size, ComparisonOperator, and
     * FieldToMatch to build an expression in the form of
     * "Size ComparisonOperator size in bytes of
     * FieldToMatch". If that expression is true, the
     * SizeConstraint is considered to match.

     */
    inline bool SizeConstraintHasBeenSet() const { return m_sizeConstraintHasBeenSet; }

    /**
     *
Specifies a constraint on the size of a part of the web request. AWS WAF uses
     * the Size, ComparisonOperator, and
     * FieldToMatch to build an expression in the form of
     * "Size ComparisonOperator size in bytes of
     * FieldToMatch". If that expression is true, the
     * SizeConstraint is considered to match.

     */
    inline void SetSizeConstraint(const SizeConstraint& value) { m_sizeConstraintHasBeenSet = true; m_sizeConstraint = value; }

    /**
     *
Specifies a constraint on the size of a part of the web request. AWS WAF uses
     * the Size, ComparisonOperator, and
     * FieldToMatch to build an expression in the form of
     * "Size ComparisonOperator size in bytes of
     * FieldToMatch". If that expression is true, the
     * SizeConstraint is considered to match.

     */
    inline void SetSizeConstraint(SizeConstraint&& value) { m_sizeConstraintHasBeenSet = true; m_sizeConstraint = std::move(value); }

    /**
     *
Specifies a constraint on the size of a part of the web request. AWS WAF uses
     * the Size, ComparisonOperator, and
     * FieldToMatch to build an expression in the form of
     * "Size ComparisonOperator size in bytes of
     * FieldToMatch". If that expression is true, the
     * SizeConstraint is considered to match.

     */
    inline SizeConstraintSetUpdate& WithSizeConstraint(const SizeConstraint& value) { SetSizeConstraint(value); return *this;}

    /**
     *
Specifies a constraint on the size of a part of the web request. AWS WAF uses
     * the Size, ComparisonOperator, and
     * FieldToMatch to build an expression in the form of
     * "Size ComparisonOperator size in bytes of
     * FieldToMatch". If that expression is true, the
     * SizeConstraint is considered to match.

     */
    inline SizeConstraintSetUpdate& WithSizeConstraint(SizeConstraint&& value) { SetSizeConstraint(std::move(value)); return *this;}

  private:

    ChangeAction m_action;
    bool m_actionHasBeenSet;

    SizeConstraint m_sizeConstraint;
    bool m_sizeConstraintHasBeenSet;
  };

} // namespace Model
} // namespace WAFRegional
} // namespace Aws


text:
import ctrlModName, {ctrlName as controller} from './controller';

let ngModName = 'ds.pages.games.router';
let template = require('./template.jade');
let url = '/games';

export default ngModName;

angular

  .module(ngModName, [
    'ui.router',
    ctrlModName
  ])

  .config(['$stateProvider', ($stateProvider) => {
    $stateProvider
      .state('games', {
        controller,
        controllerAs: 'gamesCtrl',
        template,
        url
      });
  }]);


text:
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.iot_hub_resource_operations import IotHubResourceOperations
from . import models

class IotHubClientConfiguration(AzureConfiguration):
    """Configuration for IotHubClient
    Note that all parameters used to create this instance are saved as instance
    attributes.

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: The subscription identifier.
    :type subscription_id: str
    :param api_version: The version of the API.
    :type api_version: str
    :param accept_language: Gets or sets the preferred language for the
     response.
    :type accept_language: str
    :param long_running_operation_retry_timeout: Gets or sets the retry
     timeout in seconds for Long Running Operations. Default value is 30.
    :type long_running_operation_retry_timeout: int
    :param generate_client_request_id: When set to true a unique
     x-ms-client-request-id value is generated and included in each request.
     Default is true.
    :type generate_client_request_id: bool
    :param str base_url: Service URL
    :param str filepath: Existing config
    """

    def __init__(
            self, credentials, subscription_id, api_version='2016-02-03', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):

        if credentials is None:
            raise ValueError("Parameter 'credentials' must not be None.")
        if subscription_id is None:
            raise ValueError("Parameter 'subscription_id' must not be None.")
        if not isinstance(subscription_id, str):
            raise TypeError("Parameter 'subscription_id' must be str.")
        if api_version is not None and not isinstance(api_version, str):
            raise TypeError("Optional parameter 'api_version' must be str.")
        if accept_language is not None and not isinstance(accept_language, str):
            raise TypeError("Optional parameter 'accept_language' must be str.")
        if not base_url:
            base_url = 'https://management.azure.com'

        super(IotHubClientConfiguration, self).__init__(base_url, filepath)

        self.add_user_agent('iothubclient/{}'.format(VERSION))
        self.add_user_agent('Azure-SDK-For-Python')

        self.credentials = credentials
        self.subscription_id = subscription_id
        self.api_version = api_version
        self.accept_language = accept_language
        self.long_running_operation_retry_timeout = long_running_operation_retry_timeout
        self.generate_client_request_id = generate_client_request_id

class IotHubClient(object):
    """Use this API to manage the IoT hubs in your subscription.

    :ivar config: Configuration for client.
    :vartype config: IotHubClientConfiguration

    :ivar iot_hub_resource: IotHubResource operations
    :vartype iot_hub_resource: .operations.IotHubResourceOperations

    :param credentials: Credentials needed for the client to connect to Azure.
    :type credentials: :mod:`A msrestazure Credentials
     object<msrestazure.azure_active_directory>`
    :param subscription_id: The subscription identifier.
    :type subscription_id: str
    :param api_version: The version of the API.
    :type api_version: str
    :param accept_language: Gets or sets the preferred language for the
     response.
    :type accept_language: str
    :param long_running_operation_retry_timeout: Gets or sets the retry
     timeout in seconds for Long Running Operations. Default value is 30.
    :type long_running_operation_retry_timeout: int
    :param generate_client_request_id: When set to true a unique
     x-ms-client-request-id value is generated and included in each request.
     Default is true.
    :type generate_client_request_id: bool
    :param str base_url: Service URL
    :param str filepath: Existing config
    """

    def __init__(
            self, credentials, subscription_id, api_version='2016-02-03', accept_language='en-US', long_running_operation_retry_timeout=30, generate_client_request_id=True, base_url=None, filepath=None):

        self.config = IotHubClientConfiguration(credentials, subscription_id, api_version, accept_language, long_running_operation_retry_timeout, generate_client_request_id, base_url, filepath)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

        self.iot_hub_resource = IotHubResourceOperations(
            self._client, self.config, self._serialize, self._deserialize)


text:
<?php
/**
 * TOP API: taobao.product.img.delete request
 *
 * @author auto create
 * @since 1.0, 2012.10.15
 */
class ProductImgDeleteRequest
{
	/**
	 * 非主图ID
	 **/
	private $id;

	/**
	 * 产品ID.Product的id,通过taobao.product.add接口新增产品的时候会返回id.
	 **/
	private $productId;

	private $apiParas = array();

	public function setId($id)
	{
		$this->id = $id;
		$this->apiParas["id"] = $id;
	}

	public function getId()
	{
		return $this->id;
	}

	public function setProductId($productId)
	{
		$this->productId = $productId;
		$this->apiParas["product_id"] = $productId;
	}

	public function getProductId()
	{
		return $this->productId;
	}

	public function getApiMethodName()
	{
		return "taobao.product.img.delete";
	}

	public function getApiParas()
	{
		return $this->apiParas;
	}

	public function check()
	{

		RequestCheckUtil::checkNotNull($this->id,"id");
		RequestCheckUtil::checkNotNull($this->productId,"productId");
	}

	public function putOtherTextParam($key, $value) {
		$this->apiParas[$key] = $value;
		$this->$key = $value;
	}
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Ges. Naturf. Freunde Berlin Mag. Neuesten Entdeck. Gesammten Naturk. 2:25. 1808

#### Original name
null

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>
<PersonName xmlns="http://ns.hr-xml.org/2007-04-15" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ns.hr-xml.org/2007-04-15
../PersonName.xsd">
	<FormattedName>Hanako Yamada</FormattedName>
	<GivenName>Hanako</GivenName>
	<FamilyName>Yamada</FamilyName>
	<AlternateScript script="Kana">
		<FormattedName>ヤマダ ハナコ</FormattedName>
		<GivenName>ハナコ</GivenName>
		<FamilyName>ヤマダ</FamilyName>
	</AlternateScript>
	<AlternateScript script="Hani">
		<FormattedName>山田 はな子</FormattedName>
		<GivenName>はな子</GivenName>
		<FamilyName>山田</FamilyName>
	</AlternateScript>
</PersonName>


text:
package fr.esgi.meteoland.model;

public class Temperature {

	private float temp;
	private float minTemp;
	private float maxTemp;

	public float getTemp() {
		return temp;
	}

	public void setTemp(float temp) {
		this.temp = temp;
	}

	public float getMinTemp() {
		return minTemp;
	}

	public void setMinTemp(float minTemp) {
		this.minTemp = minTemp;
	}

	public float getMaxTemp() {
		return maxTemp;
	}

	public void setMaxTemp(float maxTemp) {
		this.maxTemp = maxTemp;
	}

}


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

<title>Uses of Interface javax.sound.sampled.Mixer (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
javax.sound.sampled.Mixer

Packages that use Mixer

Package
Description

javax.sound.sampled

Provides interfaces and classes for capture, processing, and playback of sampled audio data.

javax.sound.sampled.spi

Supplies abstract classes for service providers to subclass when
offering new audio devices, sound file readers and writers, or audio format converters.

Uses of Mixer in javax.sound.sampled

Methods in javax.sound.sampled that return Mixer

Modifier and Type
Method and Description

static Mixer
AudioSystem.getMixer(Mixer.Info info)

Obtains the requested audio mixer.

Uses of Mixer in javax.sound.sampled.spi

Methods in javax.sound.sampled.spi that return Mixer

Modifier and Type
Method and Description

abstract Mixer
MixerProvider.getMixer(Mixer.Info info)

Obtains an instance of the mixer represented by the info object.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
<?php

declare(strict_types=1);

namespace Barryvdh\LaravelIdeHelper\Tests;

use Barryvdh\LaravelIdeHelper\UsesResolver;
use PHPUnit\Framework\TestCase;

class UsesResolverTest extends TestCase
{
    /**
     * Test that we can correctly load uses from supplied code
     */
    public function testLoadFromCode()
    {
        $usesResolver = new UsesResolver();

        $code = <<<'DOC'
<?php
namespace Barryvdh\LaravelIdeHelper\Tests;

use Barryvdh\LaravelIdeHelper\UsesResolver as MyUsesResolver;
use PHPUnit\Framework\TestCase;

class UsesResolverTest extends TestCase
{
    //
}
DOC;

        $this->assertEquals(
            $usesResolver->loadFromCode('Barryvdh\\LaravelIdeHelper\\Tests\\UsesResolverTest', $code),
            [
                'MyUsesResolver' => '\\Barryvdh\\LaravelIdeHelper\\UsesResolver',
                'TestCase' => '\\PHPUnit\Framework\TestCase',
            ]
        );
    }

    /**
     * Test that we can correctly load uses from a class
     */
    public function testLoadFromClass()
    {
        $usesResolver = new UsesResolver();

        $this->assertEquals(
            $usesResolver->loadFromClass(self::class),
            [
                'UsesResolver' => '\\Barryvdh\\LaravelIdeHelper\\UsesResolver',
                'TestCase' => '\\PHPUnit\Framework\TestCase',
            ]
        );
    }
}


text:
class MapException(Exception):
    """
    Generic MuxMap exception class.
    """

    def __init__(self, map, value):
        self.value = value
        self.map = map

    def __str__(self):
        return repr(self.value)

class InvalidHex(Exception):
    def __init__(self, x, y):
        self.hex_x = x
        self.hex_y = y

    def __str__(self):
        return repr("Hex out of bounds: %d,%d" % (self.hex_x, self.hex_y))

class ViewportWidthTooBig(Exception):
    def __str__(self):
        return repr("The width of your viewport exceeds the map's width.")

class ViewportHeightTooBig(Exception):
    def __str__(self):
        return repr("The height of your viewport exceeds the map's width.")

class MapDimsNotSet(Exception):
    def __str__(self):
        return repr("Map dimensions have not been set yet.")

class TerrainListNotSet(Exception):
    def __str__(self):
        return repr("The terrain list has not been populated yet.")

class ElevationListNotSet(Exception):
    def __str__(self):
        return repr("The elevation list has not been populated yet.")


text:
<?php

namespace Front\Controllers;

use Core\Form\Form;
use Core\Utils\PasswordUtils;
use Silex\Application;
use SocioChat\DAO\ActivationsDAO;
use SocioChat\DAO\MailQueueDAO;
use SocioChat\DAO\UserDAO;
use SocioChat\Forms\Rules;
use Symfony\Component\HttpFoundation\Request;

class ActivationController extends BaseController
{
    private $config;

    public function activation(Request $request)
    {
        $app = $this->app;
        $config = $app['config'];
        $this->config = $config;

        $password = $request->get('password', '');
        $passwordRepeat = $request->get('password-repeat', '');
        $email = $request->get('email', '');
        $code = $request->get('code', '');

        $form = new Form();
        $form->import(['email' => $email]);
        $form
            ->addRule(ActivationsDAO::EMAIL, Rules::email(), '', 'emailPattern')
            ->addRule(ActivationsDAO::EMAIL, function ($val) {
                $user = UserDAO::create()->getByEmail($val);
                return (bool)$user->getId();
            }, '', 'userSearch');

        $validation = $form->validate();

        if (!$validation) {
            return $this->errorResponse();
        }

        $activation = ActivationsDAO::create();
        if (!$result = $activation->getActivation($email, $code)) {
            return $this->errorResponse();
        }
        $activation = $result[0];
        /* @var $activation ActivationsDAO */

        if (!$activation->getId() || $activation->getIsUsed()) {
            return $this->errorResponse();
        }

        if ($activation->getCode() !== $code) {
            return $this->errorResponse();
        }

        if (strtotime($activation->getTimestamp()) + $config->activationTTL < time()) {
            $activation->setIsUsed(true);
            $activation->save();
            return $this->errorResponse();
        }

        if (!$password) {
            return $this->prepareResponse(new Form(), false, $email, $code);
        }

        $form = new Form();
        $form->import($request->request->all());
        $form
            ->addRule('password', Rules::password(), $app->trans('Activation.PasswordComplexity'))
            ->addRule('password-repeat', Rules::password(), $app->trans('Activation.PasswordComplexity'));

        $validation = $form->validate();

        if (!$validation) {
            return $this->prepareResponse($form, $validation, $email, $code);
        }

        if ($password !== $passwordRepeat) {
            $validation = false;
            $form->markWrong('password', $app->trans('Activation.PasswordsNotEqual'));
            return $this->prepareResponse($form, $validation, $email, $code);
        }

        $user = UserDAO::create()->getByEmail($email);
        $user->setPassword(password_hash($password, PASSWORD_BCRYPT));
        $user->save();

        $activation->setIsUsed(true);
        $activation->save();

        return $app['twig']->render('common_page.twig', [
                'title' => $app->trans('Success'),
                'heading' => $app->trans('Success'),
                'message' => $this->app->trans('Activation.PasswordHasChanged'),
                'config' => $config,
            ]
        );

    }

    public function recovery(Request $request)
    {
        $app = $this->app;
        $config = $app['config'];
        $this->config = $config;

        $app['session']->start();
        $email = $request->get('email', '');
        $token = $request->get('token', '');

        $sessionToken = $request->getSession()->get('token');

        if (!$email || !$token) {
            return $this->showFirst($email);
        }

        $form = new Form();
        $form->import($request->request->all());
        $form
            ->addRule(ActivationsDAO::EMAIL, Rules::email(), 'email в таком формате не может существовать.', 'emailPattern')
            ->addRule(
                ActivationsDAO::EMAIL,
                function ($val) {
                    $user = UserDAO::create()->getByEmail($val);
                    return (bool)$user->getId();
                }, 'Такой email не найден в системе.', 'userSearch');

        $validation = $form->validate();

        if (!$validation || $sessionToken != $token) {
            return $this->showFirst($email, $validation, $form);
        }

        $activation = ActivationsDAO::create();
        $activation->getByEmail($email);

        if ($activation->getId() && !$activation->getIsUsed()) {
            $activation->setIsUsed(true);
            $activation->save();
        }

        $activation = ActivationsDAO::create();
        $activation->fillParams(
            [
                ActivationsDAO::EMAIL => $email,
                ActivationsDAO::CODE => substr(base64_encode(PasswordUtils::get(64)), 0, 64),
                ActivationsDAO::TIMESTAMP => date('Y-m-d H:i:s'),
                ActivationsDAO::USED => false
            ]
        );
        $activation->save();

        $msg = "
Восстановление пароля

Была произведена процедура восстановления пароля с использованием вашего email.

Для подтверждения сброса пароля перейдите по domain->protocol . $config->domain->web . "/activation?email=$email&code=".$activation->getCode() . "\">ссылке

Данная ссылка действительна до " . date('Y-m-d H:i', time() + $config->activationTTL) . "
";

        $mailer = MailQueueDAO::create();
        $mailer
            ->setEmail($email)
            ->setTopic($config->mail->name.' - Восстановление пароля')
            ->setMessage($msg);
        $mailer->save();

        return $this->app['twig']->render(
            'recovery/recovery2.twig',
            [
                'title' => $app->trans('Activation.PasswordRecovery'),
                'heading' => $app->trans('Activation.PasswordRecovery'),
                'hasError' => '',
                'email' => $email,
                'config' => $config,
            ]
        );
    }

    private function showFirst($email, $validation = null, Form $form = null)
    {
        $token = PasswordUtils::get(20);
        $this->app['session']->set('token', $token);

        return $this->app['twig']->render(
            'recovery/recovery1.twig',
            [
                'title' => $this->app->trans('Activation.PasswordRecovery'),
                'heading' => $this->app->trans('Activation.PasswordRecovery'),
                'hasError' => $validation === false ?  : '',
                'email' => $email,
                'errors' => $form ? $form->getErrors() : [],
                'config' => $this->config,
                'token' => $token
            ]
        );
    }

    private function prepareResponse(Form $form, $validation, $email, $code)
    {
        return $this->app['twig']->render(
            'activation/prepare.twig',
            [
                'title' => $this->app->trans('Activation.PasswordRecovery'),
                'heading' => $this->app->trans('Activation.PasswordRecovery'),
                'hasError' => $validation === false ?  : '',
                'message' => $this->app->trans('Activation.ErrorText'),
                'errors' => $form->getErrors(),
                'config' => $this->config,
                'email' => $email,
                'code' => $code,
            ]
        );
    }

    private function errorResponse()
    {
        return $this->app['twig']->render(
            'common_page.twig',
            [
                'title' => $this->app->trans('Error'),
                'heading' => $this->app->trans('Error'),
                'message' => $this->app->trans('Activation.ErrorText'),
                'config' => $this->app['config'],
            ]
        );
    }
}


text:
namespace Site.Areas.Portal.Controllers
{
	using System.Web.Mvc;
	using System.Web.UI;
	using Adxstudio.Xrm.AspNet.Cms;

	public class ResourcesController : Controller
	{

		[HttpGet]
		[OutputCache(Duration = 86400, VaryByParam = "lang", Location = OutputCacheLocation.ServerAndClient)]
		public ActionResult ResourceManager()
		{
			var languageFormat = "lang={0}";
			string fallbackCode;
			string code = this.HttpContext.Request.QueryString["lang"];
			if (!string.IsNullOrWhiteSpace(code) && ContextLanguageInfo.ResolveCultureCode(code, out fallbackCode))
			{
				var current = this.Request.QueryString["lang"];
				var url = this.Request.Url.AbsoluteUri.Replace(string.Format(languageFormat, current), string.Format(languageFormat, fallbackCode));
				return this.Redirect(url);
			}

			Response.Cache.SetOmitVaryStar(true);
			Response.ContentType = "text/javascript";
			return View("ResourceManager");
		}
	}
}


text:
using namespace std;

bool KernelProfileResult::GetAvailableResultNames(size_t nRowIdx, std::vector<std::string>& availableResNames) const
{
    SpAssertRet(nRowIdx < m_results.size()) false;

    const CSVRow& row = *m_results[nRowIdx];
    const vector<string>& cols = row.GetColumns();

    for (vector<string>::const_iterator it = cols.begin(); it != cols.end(); ++it)
    {
        if (!row.GetRowData(*it).empty())
        {
            availableResNames.push_back(*it);
        }
    }

    return true;
}

bool KernelProfileResult::GetValue(size_t nRowIdx, const std::string& resultName, std::string& outValue) const
{
    SpAssertRet(nRowIdx < m_results.size()) false;
    const CSVRow& row = *m_results[nRowIdx];
    outValue = row.GetRowData(resultName);
    return !outValue.empty();
}

KernelProfileResultParser::KernelProfileResultParser(void)
    : m_bDoneParsing(false)
{
}

KernelProfileResultParser::~KernelProfileResultParser(void)
{
    for (std::list<KernelProfileResult*>::iterator it = m_ProfileResults.begin(); it != m_ProfileResults.end(); ++it)
    {
        SAFE_DELETE(*it);
    }

    m_ProfileResults.clear();
}

bool KernelProfileResultParser::Parse(const std::string& strFilename)
{
    if (!m_parser.LoadFile(strFilename.c_str()))
    {
        return false;
    }

    m_parser.AddListener(this);

    m_bDoneParsing = m_parser.Parse();
    m_parser.Close();

    return m_bDoneParsing;
}

void KernelProfileResultParser::OnParse(CSVRow* pCSVRow, bool& stopParsing)
{
    SpAssertRet(pCSVRow != NULL);
    stopParsing = false;

    CSVRow& row = *pCSVRow;
    KernelProfileResult* pResult;

    SP_TODO("rename Method to Kernel Name in perf counter mode.");
    string kernelName = row.GetRowData("Method");

    if (kernelName.empty())
    {
        kernelName = row.GetRowData("Kernel Name");
    }

    if (kernelName.empty())
    {
        // Sub kernel result
        SpAssertRet(!m_ProfileResults.empty());
        pResult = m_ProfileResults.front();
    }
    else
    {
        // new kernel result
        pResult = new KernelProfileResult(kernelName);
        m_ProfileResults.push_back(pResult);
    }

    SpAssertRet(pResult != NULL);
    pResult->AddResultRow(pCSVRow);
}


text:
package umiker9.stardust2d;

/**
 * Created by miker9 on 07/12/2015.
 */
public class FollowingCamera extends Camera {
    private Sprite target;
    private boolean followRotation;

    public FollowingCamera(Sprite target) {
        this.target = target;
    }

    public FollowingCamera(boolean followRotation, Sprite target) {
        this(target);
        this.followRotation = followRotation;
    }

    @Override
    public void update(double delta) {
        this.x = target.getX();
        this.y = target.getY();
        if (followRotation) {
            this.rotation = target.getRotation();
        }
    }

    public boolean doesFollowRotation() {
        return followRotation;
    }

    public void setFollowRotation(boolean followRotation) {
        this.followRotation = followRotation;
    }
}


text:
EvRec
=====

Simple application showing how to record, serialize and replay Qt4.8 events.


text:
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns

from .provider import HubicProvider

urlpatterns = default_urlpatterns(HubicProvider)


text:
htdocs=$(dirname $0)
cd $htdocs
grunt


text:
package org.apache.storm.messaging.netty;

import java.io.IOException;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SaslStormServerHandler extends SimpleChannelUpstreamHandler {

    private static final Logger LOG = LoggerFactory
        .getLogger(SaslStormServerHandler.class);
    ISaslServer server;
    /**
     * Used for client or server's token to send or receive from each other.
     */
    private byte[] token;
    private String topologyName;

    public SaslStormServerHandler(ISaslServer server) throws IOException {
        this.server = server;
        getSASLCredentials();
    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {
        Object msg = e.getMessage();
        if (msg == null) {
            return;
        }

        Channel channel = ctx.getChannel();

        if (msg instanceof ControlMessage
            && e.getMessage() == ControlMessage.SASL_TOKEN_MESSAGE_REQUEST) {
            // initialize server-side SASL functionality, if we haven't yet
            // (in which case we are looking at the first SASL message from the
            // client).
            SaslNettyServer saslNettyServer = SaslNettyServerState.getSaslNettyServer
                .get(channel);
            if (saslNettyServer == null) {
                LOG.debug("No saslNettyServer for " + channel
                          + " yet; creating now, with topology token: ");
                try {
                    saslNettyServer = new SaslNettyServer(topologyName, token);
                } catch (IOException ioe) {
                    LOG.error("Error occurred while creating saslNettyServer on server "
                              + channel.getLocalAddress()
                              + " for client "
                              + channel.getRemoteAddress());
                    saslNettyServer = null;
                }

                SaslNettyServerState.getSaslNettyServer.set(channel,
                                                            saslNettyServer);
            } else {
                LOG.debug("Found existing saslNettyServer on server:"
                          + channel.getLocalAddress() + " for client "
                          + channel.getRemoteAddress());
            }

            LOG.debug("processToken:  With nettyServer: " + saslNettyServer
                      + " and token length: " + token.length);

            SaslMessageToken saslTokenMessageRequest;
            saslTokenMessageRequest = new SaslMessageToken(
                saslNettyServer.response(new byte[0]));
            // Send response to client.
            channel.write(saslTokenMessageRequest);
            // do not send upstream to other handlers: no further action needs
            // to be done for SASL_TOKEN_MESSAGE_REQUEST requests.
            return;
        }

        if (msg instanceof SaslMessageToken) {
            // initialize server-side SASL functionality, if we haven't yet
            // (in which case we are looking at the first SASL message from the
            // client).
            SaslNettyServer saslNettyServer = SaslNettyServerState.getSaslNettyServer
                .get(channel);
            if (saslNettyServer == null) {
                throw new Exception("saslNettyServer was unexpectedly "
                                    + "null for channel: " + channel);
            }
            SaslMessageToken saslTokenMessageRequest = new SaslMessageToken(
                saslNettyServer.response(((SaslMessageToken) msg)
                                             .getSaslToken()));

            // Send response to client.
            channel.write(saslTokenMessageRequest);

            if (saslNettyServer.isComplete()) {
                // If authentication of client is complete, we will also send a
                // SASL-Complete message to the client.
                LOG.debug("SASL authentication is complete for client with "
                          + "username: " + saslNettyServer.getUserName());
                channel.write(ControlMessage.SASL_COMPLETE_REQUEST);
                LOG.debug("Removing SaslServerHandler from pipeline since SASL "
                          + "authentication is complete.");
                ctx.getPipeline().remove(this);
                server.authenticated(channel);
            }
        } else {
            // Client should not be sending other-than-SASL messages before
            // SaslServerHandler has removed itself from the pipeline. Such
            // non-SASL requests will be denied by the Authorize channel handler
            // (the next handler upstream in the server pipeline) if SASL
            // authentication has not completed.
            LOG.warn("Sending upstream an unexpected non-SASL message :  "
                     + msg);
            Channels.fireMessageReceived(ctx, msg);
        }
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) {
        if (server != null) {
            server.closeChannel(e.getChannel());
        }
    }

    private void getSASLCredentials() throws IOException {
        String secretKey;
        topologyName = server.name();
        secretKey = server.secretKey();

        if (secretKey != null) {
            token = secretKey.getBytes();
        }

        LOG.debug("SASL credentials for storm topology {} is {}",
                  topologyName, secretKey);
    }
}


text:
<?php

require_once 'Expression.php';

/**
 * Created by PhpStorm.
 * User: patrick.johnmeyer
 * Date: 7/13/15
 * Time: 11:47 PM
 */
class Money implements Expression
{
    public $amount;
    public $currency;

    public function __construct($amount, $currency)
    {
        $this->amount = $amount;
        $this->currency = $currency;
    }

    static public function dollar($amount)
    {
        return new Money($amount, 'USD');
    }

    static public function franc($amount)
    {
        return new Money($amount, 'CHF');
    }

    public function currency()
    {
        return $this->currency;
    }

    public function times($multiplier)
    {
        return new Money($this->amount * $multiplier, $this->currency);
    }

    public function plus(Expression $addend)
    {
        return new Sum($this, $addend);
    }

    public function reduce(Bank $bank, $to)
    {
        $rate = $bank->rate($this->currency, $to);
        return new Money($this->amount / $rate, $to);
    }
}


text:
workers 4
threads_count = 1
threads threads_count, threads_count

preload_app!

rackup      DefaultRackup

port        ENV['PORT'] || 3000
environment ENV['RAILS_ENV'] || 'development'

on_worker_boot do
  # Worker specific setup for Rails 4.1+
  # See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
  ActiveRecord::Base.establish_connection
  if defined?(Resque)
    Resque.redis = ENV["REDISCLOUD_URL"] || "redis://127.0.0.1:6379"
  end
end


text:
package org.apache.oodt.cas.filemgr.datatransfer;

//OODT imports
import org.apache.oodt.cas.filemgr.catalog.Catalog;
import org.apache.oodt.cas.filemgr.structs.FileTransferStatus;
import org.apache.oodt.cas.filemgr.structs.Product;
import org.apache.oodt.cas.filemgr.structs.Reference;
import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;

//JDK imports
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * @author mattmann
 * @author bfoster
 * @version $Revision$
 *
 *

 * An abstract base class for data transfers that uses an in-memory HashMap to
 * keep track of data transfer status information.
 *

 *
 */
public class TransferStatusTracker {
    /* HashMap containing a list of current product transfers */
    protected HashMap<String, Product> currentProductTransfers = new HashMap<String, Product>();

    /* our catalog object */
    private Catalog catalog = null;

    /* our log stream */
    private static final Logger LOG = Logger.getLogger(TransferStatusTracker.class
            .getName());

    /**
     *

     * Default Constructor
     *
.
     *
     * @param catalog
     *            The Catalog interface handed to it by the File Manager. It
     *            needs this object to look up reference information.
     */
    public TransferStatusTracker(Catalog catalog) {
        this.catalog = catalog;
    }

    public FileTransferStatus getCurrentFileTransfer() {
        List<FileTransferStatus> transfers = getCurrentFileTransfers();

        if (transfers != null && transfers.size() > 0) {
            return (FileTransferStatus) transfers.get(0);
        } else
            return null;
    }

    public void transferringProduct(Product product) {
        currentProductTransfers.put(product.getProductId(), product);
    }

    public List<FileTransferStatus> getCurrentFileTransfers() {
        List<FileTransferStatus> currTransfers = new Vector<FileTransferStatus>();

        for (Iterator<String> i = currentProductTransfers.keySet().iterator(); i
                .hasNext();) {
            String productId = i.next();
            Product p = (Product) currentProductTransfers.get(productId);

            // get its references
            List<Reference> refs = quietGetReferences(p);

            if (refs != null && refs.size() > 0) {
                for (Iterator<Reference> j = refs.iterator(); j.hasNext();) {
                    Reference r = j.next();

                    long bytesTransferred = getBytesTransferred(r);

                    if (bytesTransferred > 0
                            && bytesTransferred < r.getFileSize() && !isDir(r)) {
                        FileTransferStatus status = new FileTransferStatus();
                        status.setBytesTransferred(bytesTransferred);
                        status.setFileRef(r);
                        status.setParentProduct(p);
                        currTransfers.add(status);
                    }
                }
            }
        }

        return currTransfers;
    }

    public double getPctTransferred(Product product) {
        // get its references
        List<Reference> refs = quietGetReferences(product);
        long totalBytesTransferred = 0L;
        long totalProductSize = 0L;

        if (refs.size() > 0) {
            for (Iterator<Reference> j = refs.iterator(); j.hasNext();) {
                Reference r = (Reference) j.next();

                long bytesTransferred = getBytesTransferred(r);

                if (!isDir(r)) {
                    // only add this if > 0
                    if (bytesTransferred > 0) {
                        totalBytesTransferred += bytesTransferred;
                    }

                    // add this no matter what
                    totalProductSize += r.getFileSize();
                }

            }
        }

        return ((double) ((1.0 * totalBytesTransferred) / (1.0 * totalProductSize)));

    }

    public double getPctTransferred(Reference ref) {
        long bytesTransferred = getBytesTransferred(ref);
        return ((double) ((1.0 * bytesTransferred) / (1.0 * ref.getFileSize())));
    }

    public void removeProductTransferStatus(Product product) {
        if (currentProductTransfers.get(product.getProductId()) != null) {
            currentProductTransfers.remove(product.getProductId());
        }
    }

    public boolean isTransferComplete(Product product) {
        return getPctTransferred(product) == 1.0;
    }

    private long getBytesTransferred(Reference r) {
        File destFile = null;

        try {
            destFile = new File(new URI(r.getDataStoreReference()));
            long bytesTransferred = destFile.length();
            return bytesTransferred;
        } catch (URISyntaxException e) {
            LOG.log(Level.WARNING,
                    "URISyntaxException when checking size of destFile: ["
                            + r.getDataStoreReference() + "]: Message: "
                            + e.getMessage());
            return -1L;
        }
    }

    private List<Reference> quietGetReferences(Product p) {
        List<Reference> refs = null;

        try {
            refs = catalog.getProductReferences(p);
        } catch (CatalogException e) {
            e.printStackTrace();
            LOG.log(Level.WARNING, "Error retreiving references for product: ["
                    + p.getProductId()
                    + "] from catalog in transfer status tracker: Message: "
                    + e.getMessage());
            refs = new Vector<Reference>();
        }

        return refs;
    }

    private boolean isDir(Reference r) {
        File fileRef = null;

        try {
            fileRef = new File(new URI(r.getDataStoreReference()));
            return fileRef.isDirectory();
        } catch (URISyntaxException e) {
            return false;
        }
    }
}


text:
<?php
/*--------------------------------------------------------------------------------------------
|    @desc:      Exactly Facebook like url parsing using jquery and php
|    @author:    Aravind Buddha
|    @url:       http://www.techumber.com
|    @date:      6 NOV 2012
|    @email:     aravind@techumber.com
|    @license:   Free! to Share,copy, distribute and transmit ,
|               but i'll be glad if my name listed in the credits'
---------------------------------------------------------------------------------------------*/
if($_GET['iurl'])
{
$url=htmlentities(stripslashes($_GET['iurl']));
$str = file_get_contents($url);
//to get the title
function getTitle($str){
    if(strlen($str)>0){
        preg_match("/\<title\>(.*)\<\/title\>/",$str,$title);
        return $title[1];
    }
}
//to get meta description
function getMetaDesc($url) {
	$metas = get_meta_tags($url);
	return $metas["description"];
}
//to get the img.
function getImg($str){
	if(strlen($str)>0){
        preg_match('/<img[^>]*'.'src=[\"|\'](.*)[\"|\']/Ui',$str,$img);
        return $img[1];
    }
}
//json formation
echo '{"title":"'.getTitle($str).'","meta":"'.getMetaDesc($url).'","img":"'.getImg($str).'"}';
}
?>


text:
using NMF.Collections.Generic;
using NMF.Collections.ObjectModel;
using NMF.Expressions;
using NMF.Expressions.Linq;
using NMF.Models;
using NMF.Models.Collections;
using NMF.Models.Expressions;
using NMF.Models.Meta;
using NMF.Models.Repository;
using NMF.Serialization;
using NMF.Utilities;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using TTC2017.SmartGrids.CIM;
using TTC2017.SmartGrids.CIM.IEC61968.Common;
using TTC2017.SmartGrids.CIM.IEC61970.Contingency;
using TTC2017.SmartGrids.CIM.IEC61970.Core;
using TTC2017.SmartGrids.CIM.IEC61970.Generation.Production;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.EnergyScheduling;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.Financial;
using TTC2017.SmartGrids.CIM.IEC61970.Informative.InfERPSupport;
using TTC2017.SmartGrids.CIM.IEC61970.LoadModel;
using TTC2017.SmartGrids.CIM.IEC61970.Meas;
using TTC2017.SmartGrids.CIM.IEC61970.Wires;

namespace TTC2017.SmartGrids.CIM.IEC61970.Informative.MarketOperations
{

    /// <summary>
    /// The public interface for RegisteredLoad
    /// </summary>
    [DefaultImplementationTypeAttribute(typeof(RegisteredLoad))]
    [XmlDefaultImplementationTypeAttribute(typeof(RegisteredLoad))]
    public interface IRegisteredLoad : IModelElement, IRegisteredResource
    {

        /// <summary>
        /// The LoadArea property
        /// </summary>
        ILoadGroup LoadArea
        {
            get;
            set;
        }

        /// <summary>
        /// The LoadBids property
        /// </summary>
        IOrderedSetExpression<ILoadBid> LoadBids
        {
            get;
        }

        /// <summary>
        /// Gets fired before the LoadArea property changes its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> LoadAreaChanging;

        /// <summary>
        /// Gets fired when the LoadArea property changed its value
        /// </summary>
        event System.EventHandler<ValueChangedEventArgs> LoadAreaChanged;
    }
}


text:
#include "paddle/operators/math/selected_rows_functor.h"
#include "paddle/operators/math/math_function.h"

namespace paddle {
namespace operators {
namespace math {
template <typename T>
struct SelectedRowsAdd<platform::CPUPlace, T> {
  void operator()(const platform::DeviceContext& context,
                  const framework::SelectedRows& input1,
                  const framework::SelectedRows& input2,
                  framework::SelectedRows* output) {
    auto in1_height = input1.height();
    PADDLE_ENFORCE_EQ(in1_height, input2.height());
    output->set_height(in1_height);

    auto& in1_rows = input1.rows();
    auto& in2_rows = input2.rows();
    std::vector<int64_t> out_rows;
    out_rows.reserve(in1_rows.size() + in2_rows.size());

    // concat rows
    out_rows.insert(out_rows.end(), in1_rows.begin(), in1_rows.end());
    out_rows.insert(out_rows.end(), in2_rows.begin(), in2_rows.end());
    output->set_rows(out_rows);

    auto* out_value = output->mutable_value();
    auto& in1_value = input1.value();
    auto& in2_value = input2.value();

    auto in1_row_numel = in1_value.numel() / in1_rows.size();
    PADDLE_ENFORCE_EQ(in1_row_numel, in2_value.numel() / in2_rows.size());
    PADDLE_ENFORCE_EQ(in1_row_numel, out_value->numel() / out_rows.size());

    auto in1_place = input1.place();
    PADDLE_ENFORCE(platform::is_cpu_place(in1_place));
    auto in2_place = input2.place();
    PADDLE_ENFORCE(platform::is_cpu_place(in2_place));
    auto out_place = context.GetPlace();
    PADDLE_ENFORCE(platform::is_cpu_place(out_place));

    auto* out_data = out_value->data<T>();
    auto* in1_data = in1_value.data<T>();
    memory::Copy(boost::get<platform::CPUPlace>(out_place), out_data,
                 boost::get<platform::CPUPlace>(in1_place), in1_data,
                 in1_value.numel() * sizeof(T));

    auto* in2_data = in2_value.data<T>();
    memory::Copy(boost::get<platform::CPUPlace>(out_place),
                 out_data + in1_value.numel(),
                 boost::get<platform::CPUPlace>(in2_place), in2_data,
                 in2_value.numel() * sizeof(T));
  }
};

template struct SelectedRowsAdd<platform::CPUPlace, float>;
template struct SelectedRowsAdd<platform::CPUPlace, double>;

template <typename T>
struct SelectedRowsAddTensor<platform::CPUPlace, T> {
  void operator()(const platform::DeviceContext& context,
                  const framework::SelectedRows& input1,
                  const framework::Tensor& input2, framework::Tensor* output) {
    auto in1_height = input1.height();
    auto in2_dims = input2.dims();
    auto out_dims = output->dims();
    PADDLE_ENFORCE_EQ(in1_height, in2_dims[0]);
    PADDLE_ENFORCE_EQ(in1_height, out_dims[0]);

    auto& in1_value = input1.value();
    auto& in1_rows = input1.rows();

    int64_t in1_row_numel = in1_value.numel() / in1_rows.size();
    PADDLE_ENFORCE_EQ(in1_row_numel, input2.numel() / in1_height);
    PADDLE_ENFORCE_EQ(in1_row_numel, output->numel() / in1_height);

    SetConstant<platform::CPUPlace, T> functor;
    functor(context, output, 0.0);

    auto* in1_data = in1_value.data<T>();
    auto* out_data = output->data<T>();

    for (size_t i = 0; i < in1_rows.size(); i++) {
      for (int64_t j = 0; j < in1_row_numel; j++) {
        out_data[in1_rows[i] * in1_row_numel + j] +=
            in1_data[i * in1_row_numel + j];
      }
    }

    auto out_eigen = framework::EigenVector<T>::Flatten(*output);
    auto in2_eigen = framework::EigenVector<T>::Flatten(input2);
    out_eigen.device(*context.GetEigenDevice<platform::CPUPlace>()) =
        out_eigen + in2_eigen;
  }
};

template struct SelectedRowsAddTensor<platform::CPUPlace, float>;
template struct SelectedRowsAddTensor<platform::CPUPlace, double>;

template <typename T>
struct SelectedRowsAddTo<platform::CPUPlace, T> {
  void operator()(const platform::DeviceContext& context,
                  const framework::SelectedRows& input1,
                  const int64_t input2_offset,
                  framework::SelectedRows* input2) {
    auto in1_height = input1.height();
    PADDLE_ENFORCE_EQ(in1_height, input2->height());

    auto& in1_rows = input1.rows();
    auto& in2_rows = *(input2->mutable_rows());

    auto& in1_value = input1.value();
    auto* in2_value = input2->mutable_value();

    // concat rows
    in2_rows.insert(in2_rows.end(), in1_rows.begin(), in1_rows.end());

    auto in1_place = input1.place();
    PADDLE_ENFORCE(platform::is_cpu_place(in1_place));
    auto in2_place = input2->place();
    PADDLE_ENFORCE(platform::is_cpu_place(in2_place));

    auto* in1_data = in1_value.data<T>();
    auto* in2_data = in2_value->data<T>();
    memory::Copy(boost::get<platform::CPUPlace>(in2_place),
                 in2_data + input2_offset,
                 boost::get<platform::CPUPlace>(in1_place), in1_data,
                 in1_value.numel() * sizeof(T));
  }
};

template struct SelectedRowsAddTo<platform::CPUPlace, float>;
template struct SelectedRowsAddTo<platform::CPUPlace, double>;

template <typename T>
struct SelectedRowsAddToTensor<platform::CPUPlace, T> {
  void operator()(const platform::DeviceContext& context,
                  const framework::SelectedRows& input1,
                  framework::Tensor* input2) {
    auto in1_height = input1.height();
    auto in2_dims = input2->dims();
    PADDLE_ENFORCE_EQ(in1_height, in2_dims[0]);

    auto& in1_value = input1.value();
    auto& in1_rows = input1.rows();

    int64_t in1_row_numel = in1_value.numel() / in1_rows.size();
    PADDLE_ENFORCE_EQ(in1_row_numel, input2->numel() / in1_height);

    auto* in1_data = in1_value.data<T>();
    auto* input2_data = input2->data<T>();

    for (size_t i = 0; i < in1_rows.size(); i++) {
      for (int64_t j = 0; j < in1_row_numel; j++) {
        input2_data[in1_rows[i] * in1_row_numel + j] +=
            in1_data[i * in1_row_numel + j];
      }
    }
  }
};

template struct SelectedRowsAddToTensor<platform::CPUPlace, float>;
template struct SelectedRowsAddToTensor<platform::CPUPlace, double>;

}  // namespace math
}  // namespace operators
}  // namespace paddle


text:
/**
 * The package for the task:
 * 6.1. Classic search by over.
 *
 * @author Alex Proshak (olexandr_proshak@ukr.net)
 */
package ru.job4j.task1;


text:
<?php

/**
 * @file
 * Contains \Drupal\views\Routing\ViewPageController.
 */

namespace Drupal\views\Routing;

use Drupal\Component\Utility\SafeMarkup;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\views\ViewExecutableFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

/**
 * Defines a page controller to execute and render a view.
 */
class ViewPageController implements ContainerInjectionInterface {

  /**
   * The entity storage.
   *
   * @var \Drupal\Core\Entity\EntityStorageInterface
   */
  protected $storage;

  /**
   * The view executable factory.
   *
   * @var \Drupal\views\ViewExecutableFactory
   */
  protected $executableFactory;

  /**
   * Constructs a ViewPageController object.
   *
   * @param \Drupal\Core\Entity\EntityStorageInterface $storage
   *   The entity storage.
   * @param \Drupal\views\ViewExecutableFactory $executable_factory
   *   The view executable factory
   */
  public function __construct(EntityStorageInterface $storage, ViewExecutableFactory $executable_factory) {
    $this->storage = $storage;
    $this->executableFactory = $executable_factory;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static(
      $container->get('entity.manager')->getStorage('view'),
      $container->get('views.executable')
    );
  }

  /**
   * Handler a response for a given view and display.
   *
   * @param string $view_id
   *   The ID of the view
   * @param string $display_id
   *   The ID of the display.
   * @param \Symfony\Component\HttpFoundation\Request $request
   *   The request.
   * @param \Drupal\Core\Routing\RouteMatchInterface $route_match
   *   The route match.
   * @return null|void
   */
  public function handle($view_id, $display_id, Request $request, RouteMatchInterface $route_match) {
    $entity = $this->storage->load($view_id);
    if (empty($entity)) {
      throw new NotFoundHttpException(SafeMarkup::format('Page controller for view %id requested, but view was not found.', array('%id' => $view_id)));
    }
    $view = $this->executableFactory->get($entity);
    $view->setRequest($request);
    $view->setDisplay($display_id);
    $view->initHandlers();

    $args = array();
    $map = $route_match->getRouteObject()->getOption('_view_argument_map', array());
    $arguments_length = count($view->argument);
    for ($argument_index = 0; $argument_index < $arguments_length; $argument_index++) {
      // Allow parameters be pulled from the request.
      // The map stores the actual name of the parameter in the request. Views
      // which override existing controller, use for example 'node' instead of
      // arg_nid as name.
      $attribute = 'arg_' . $argument_index;
      if (isset($map[$attribute])) {
        $attribute = $map[$attribute];
      }
      if ($arg = $route_match->getRawParameter($attribute)) {
      }
      else {
        $arg = $route_match->getParameter($attribute);
      }

      if (isset($arg)) {
        $args[] = $arg;
      }
    }

    $plugin_definition = $view->display_handler->getPluginDefinition();
    if (!empty($plugin_definition['returns_response'])) {
      return $view->executeDisplay($display_id, $args);
    }
    else {
      return $view->buildRenderable($display_id, $args);
    }
  }

}


text:
import { DropdownsPo } from '../support/dropdowns.po';

describe('Dropdowns demo page testing suite', () => {
  const dropdowns = new DropdownsPo();

  beforeEach(() => {
    dropdowns.navigateTo();
    dropdowns.scrollToMenu('Basic');
  });

  describe('Basic', () => {
    const basic = dropdowns.exampleDemosArr.basic;

    it(`example contains "Button dropdown" which not expanded by default`, () => {
      dropdowns.isBtnTxtEqual(basic, ' Button dropdown ');
      dropdowns.isDropdownExpanded(basic, 'button', false);
    });

    it(`when user clicks on "Button dropdown", then dropdown opened and there are 4 items, 1 of them is separated
                   when user clicks on any item, then dropdown closes`,   () => {
      dropdowns.clickOnBtn(basic);
      dropdowns.isDropdownExpanded(basic, 'button', true);
      dropdowns.isDropdownItemsLengthEqual(basic, 4);
      dropdowns.isSeparatorExist(basic, true);
      dropdowns.clickOnDropdownItem(basic);
      dropdowns.isDropdownExpanded(basic, 'button', false);
    });
  });
});