text:
import store from '../../store';
import googleHelper from './helpers/googleHelper';
import providerUtils from './providerUtils';
import providerRegistry from './providerRegistry';
import utils from '../utils';

export default providerRegistry.register({
  id: 'googleDrive',
  getToken(location) {
    const token = store.getters['data/googleTokens'][location.sub];
    return token && token.isDrive ? token : null;
  },
  getUrl(location) {
    return `https://docs.google.com/file/d/${location.driveFileId}/edit`;
  },
  getDescription(location) {
    const token = this.getToken(location);
    return `${location.driveFileId} — ${token.name}`;
  },
  initAction() {
    const state = googleHelper.driveState || {};
    return state.userId && Promise.resolve()
      .then(() => {
        // Try to find the token corresponding to the user ID
        const token = store.getters['data/googleTokens'][state.userId];
        // If not found or not enough permission, popup an OAuth2 window
        return token && token.isDrive ? token : store.dispatch('modal/open', {
          type: 'googleDriveAccount',
          onResolve: () => googleHelper.addDriveAccount(
            !store.getters['data/localSettings'].googleDriveRestrictedAccess,
            state.userId,
          ),
        });
      })
      .then((token) => {
        const openWorkspaceIfExists = (file) => {
          const folderId = file
            && file.appProperties
            && file.appProperties.folderId;
          if (folderId) {
            // See if we have the corresponding workspace
            const workspaceParams = {
              providerId: 'googleDriveWorkspace',
              folderId,
            };
            const workspaceId = utils.makeWorkspaceId(workspaceParams);
            const workspace = store.getters['data/sanitizedWorkspaces'][workspaceId];
            // If we have the workspace, open it by changing the current URL
            if (workspace) {
              utils.setQueryParams(workspaceParams);
            }
          }
        };

        switch (state.action) {
          case 'create':
          default:
            // See if folder is part of a workspace we can open
            return googleHelper.getFile(token, state.folderId)
              .then((folder) => {
                folder.appProperties = folder.appProperties || {};
                googleHelper.driveActionFolder = folder;
                openWorkspaceIfExists(folder);
              }, (err) => {
                if (!err || err.status !== 404) {
                  throw err;
                }
                // We received an HTTP 404 meaning we have no permission to read the folder
                googleHelper.driveActionFolder = { id: state.folderId };
              });

          case 'open': {
            const getOneFile = (ids = state.ids || []) => {
              const id = ids.shift();
              return id && googleHelper.getFile(token, id)
                .then((file) => {
                  file.appProperties = file.appProperties || {};
                  googleHelper.driveActionFiles.push(file);
                  return getOneFile(ids);
                });
            };

            return getOneFile()
              // Check if first file is part of a workspace
              .then(() => openWorkspaceIfExists(googleHelper.driveActionFiles[0]));
          }
        }
      });
  },
  performAction() {
    return Promise.resolve()
      .then(() => {
        const state = googleHelper.driveState || {};
        const token = store.getters['data/googleTokens'][state.userId];
        switch (token && state.action) {
          case 'create':
            return store.dispatch('createFile')
              .then((file) => {
                store.commit('file/setCurrentId', file.id);
                // Return a new syncLocation
                return this.makeLocation(token, null, googleHelper.driveActionFolder.id);
              });
          case 'open':
            return store.dispatch('queue/enqueue',
              () => this.openFiles(token, googleHelper.driveActionFiles));
          default:
            return null;
        }
      });
  },
  downloadContent(token, syncLocation) {
    return googleHelper.downloadFile(token, syncLocation.driveFileId)
      .then(content => providerUtils.parseContent(content, syncLocation));
  },
  uploadContent(token, content, syncLocation, ifNotTooLate) {
    const file = store.state.file.itemMap[syncLocation.fileId];
    const name = utils.sanitizeName(file && file.name);
    const parents = [];
    if (syncLocation.driveParentId) {
      parents.push(syncLocation.driveParentId);
    }
    return googleHelper.uploadFile(
      token,
      name,
      parents,
      undefined,
      providerUtils.serializeContent(content),
      undefined,
      syncLocation.driveFileId,
      ifNotTooLate,
    )
      .then(driveFile => ({
        ...syncLocation,
        driveFileId: driveFile.id,
      }));
  },
  publish(token, html, metadata, publishLocation) {
    return googleHelper.uploadFile(
      token,
      metadata.title,
      [],
      undefined,
      html,
      publishLocation.templateId ? 'text/html' : undefined,
      publishLocation.driveFileId,
    )
      .then(driveFile => ({
        ...publishLocation,
        driveFileId: driveFile.id,
      }));
  },
  openFiles(token, driveFiles) {
    const openOneFile = () => {
      const driveFile = driveFiles.shift();
      if (!driveFile) {
        return null;
      }
      if (providerUtils.openFileWithLocation(store.getters['syncLocation/items'], {
        providerId: this.id,
        driveFileId: driveFile.id,
      })) {
        // File exists and has just been opened. Next...
        return openOneFile();
      }
      // Download content from Google Drive and create the file
      const syncLocation = {
        driveFileId: driveFile.id,
        providerId: this.id,
        sub: token.sub,
      };
      return this.downloadContent(token, syncLocation)
        .then((content) => {
          const id = utils.uid();
          delete content.history;
          store.commit('content/setItem', {
            ...content,
            id: `${id}/content`,
          });
          store.commit('file/setItem', {
            id,
            name: utils.sanitizeName(driveFile.name),
            parentId: store.getters['file/current'].parentId,
          });
          store.commit('syncLocation/setItem', {
            ...syncLocation,
            id: utils.uid(),
            fileId: id,
          });
          store.commit('file/setCurrentId', id);
          store.dispatch('notification/info', `${store.getters['file/current'].name} was imported from Google Drive.`);
        }, () => {
          store.dispatch('notification/error', `Could not open file ${driveFile.id}.`);
        })
        .then(() => openOneFile());
    };
    return Promise.resolve()
      .then(() => openOneFile());
  },
  makeLocation(token, fileId, folderId) {
    const location = {
      providerId: this.id,
      sub: token.sub,
    };
    if (fileId) {
      location.driveFileId = fileId;
    }
    if (folderId) {
      location.driveParentId = folderId;
    }
    return location;
  },
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>WSU_Kyou_QueueEntry__c</members>
        <members>WSU_Kyou_Options__c</members>
        <members>WSU_Kyou_Info__c</members>
        <members>WSU_Kyou_Open_Slots__c</members>
        <members>WSU_Kyou_Saved_Add__c</members>
        <name>CustomObject</name>
    </types>
    <version>31.0</version>
</Package>

redpajama_set_name: RedPajamaGithub


text:
mkdir -p ./rpmbuild/{BUILD/x86_64,RPMS,SOURCES,SPECS,SRPMS}

rpmbuild -bb rpmbuild/SPECS/shibboleth.spec --with fastcgi
cp /tmp/rpms/* rpmbuild/RPMS/x86_64


text:
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.hadoop.hive.metastore.api;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)")
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class GetRoleGrantsForPrincipalResponse implements org.apache.thrift.TBase<GetRoleGrantsForPrincipalResponse, GetRoleGrantsForPrincipalResponse._Fields>, java.io.Serializable, Cloneable, Comparable<GetRoleGrantsForPrincipalResponse> {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetRoleGrantsForPrincipalResponse");

  private static final org.apache.thrift.protocol.TField PRINCIPAL_GRANTS_FIELD_DESC = new org.apache.thrift.protocol.TField("principalGrants", org.apache.thrift.protocol.TType.LIST, (short)1);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetRoleGrantsForPrincipalResponseStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetRoleGrantsForPrincipalResponseTupleSchemeFactory();

  private @org.apache.thrift.annotation.Nullable java.util.List<RolePrincipalGrant> principalGrants; // 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 {
    PRINCIPAL_GRANTS((short)1, "principalGrants");

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

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

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // PRINCIPAL_GRANTS
          return PRINCIPAL_GRANTS;
        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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

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

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.PRINCIPAL_GRANTS, new org.apache.thrift.meta_data.FieldMetaData("principalGrants", org.apache.thrift.TFieldRequirementType.REQUIRED,
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RolePrincipalGrant.class))));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetRoleGrantsForPrincipalResponse.class, metaDataMap);
  }

  public GetRoleGrantsForPrincipalResponse() {
  }

  public GetRoleGrantsForPrincipalResponse(
    java.util.List<RolePrincipalGrant> principalGrants)
  {
    this();
    this.principalGrants = principalGrants;
  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public GetRoleGrantsForPrincipalResponse(GetRoleGrantsForPrincipalResponse other) {
    if (other.isSetPrincipalGrants()) {
      java.util.List<RolePrincipalGrant> __this__principalGrants = new java.util.ArrayList<RolePrincipalGrant>(other.principalGrants.size());
      for (RolePrincipalGrant other_element : other.principalGrants) {
        __this__principalGrants.add(new RolePrincipalGrant(other_element));
      }
      this.principalGrants = __this__principalGrants;
    }
  }

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

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

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

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator<RolePrincipalGrant> getPrincipalGrantsIterator() {
    return (this.principalGrants == null) ? null : this.principalGrants.iterator();
  }

  public void addToPrincipalGrants(RolePrincipalGrant elem) {
    if (this.principalGrants == null) {
      this.principalGrants = new java.util.ArrayList<RolePrincipalGrant>();
    }
    this.principalGrants.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List<RolePrincipalGrant> getPrincipalGrants() {
    return this.principalGrants;
  }

  public void setPrincipalGrants(@org.apache.thrift.annotation.Nullable java.util.List<RolePrincipalGrant> principalGrants) {
    this.principalGrants = principalGrants;
  }

  public void unsetPrincipalGrants() {
    this.principalGrants = null;
  }

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

  public void setPrincipalGrantsIsSet(boolean value) {
    if (!value) {
      this.principalGrants = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case PRINCIPAL_GRANTS:
      if (value == null) {
        unsetPrincipalGrants();
      } else {
        setPrincipalGrants((java.util.List<RolePrincipalGrant>)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case PRINCIPAL_GRANTS:
      return getPrincipalGrants();

    }
    throw new java.lang.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 java.lang.IllegalArgumentException();
    }

    switch (field) {
    case PRINCIPAL_GRANTS:
      return isSetPrincipalGrants();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof GetRoleGrantsForPrincipalResponse)
      return this.equals((GetRoleGrantsForPrincipalResponse)that);
    return false;
  }

  public boolean equals(GetRoleGrantsForPrincipalResponse that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_principalGrants = true && this.isSetPrincipalGrants();
    boolean that_present_principalGrants = true && that.isSetPrincipalGrants();
    if (this_present_principalGrants || that_present_principalGrants) {
      if (!(this_present_principalGrants && that_present_principalGrants))
        return false;
      if (!this.principalGrants.equals(that.principalGrants))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + ((isSetPrincipalGrants()) ? 131071 : 524287);
    if (isSetPrincipalGrants())
      hashCode = hashCode * 8191 + principalGrants.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetPrincipalGrants(), other.isSetPrincipalGrants());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrincipalGrants()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.principalGrants, other.principalGrants);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

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

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

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("GetRoleGrantsForPrincipalResponse(");
    boolean first = true;

    sb.append("principalGrants:");
    if (this.principalGrants == null) {
      sb.append("null");
    } else {
      sb.append(this.principalGrants);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (!isSetPrincipalGrants()) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'principalGrants' is unset! 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, java.lang.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 GetRoleGrantsForPrincipalResponseStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public GetRoleGrantsForPrincipalResponseStandardScheme getScheme() {
      return new GetRoleGrantsForPrincipalResponseStandardScheme();
    }
  }

  private static class GetRoleGrantsForPrincipalResponseStandardScheme extends org.apache.thrift.scheme.StandardScheme<GetRoleGrantsForPrincipalResponse> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, GetRoleGrantsForPrincipalResponse 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: // PRINCIPAL_GRANTS
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
                struct.principalGrants = new java.util.ArrayList<RolePrincipalGrant>(_list134.size);
                @org.apache.thrift.annotation.Nullable RolePrincipalGrant _elem135;
                for (int _i136 = 0; _i136 < _list134.size; ++_i136)
                {
                  _elem135 = new RolePrincipalGrant();
                  _elem135.read(iprot);
                  struct.principalGrants.add(_elem135);
                }
                iprot.readListEnd();
              }
              struct.setPrincipalGrantsIsSet(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();
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.principalGrants != null) {
        oprot.writeFieldBegin(PRINCIPAL_GRANTS_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.principalGrants.size()));
          for (RolePrincipalGrant _iter137 : struct.principalGrants)
          {
            _iter137.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class GetRoleGrantsForPrincipalResponseTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public GetRoleGrantsForPrincipalResponseTupleScheme getScheme() {
      return new GetRoleGrantsForPrincipalResponseTupleScheme();
    }
  }

  private static class GetRoleGrantsForPrincipalResponseTupleScheme extends org.apache.thrift.scheme.TupleScheme<GetRoleGrantsForPrincipalResponse> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, GetRoleGrantsForPrincipalResponse struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      {
        oprot.writeI32(struct.principalGrants.size());
        for (RolePrincipalGrant _iter138 : struct.principalGrants)
        {
          _iter138.write(oprot);
        }
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, GetRoleGrantsForPrincipalResponse struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      {
        org.apache.thrift.protocol.TList _list139 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
        struct.principalGrants = new java.util.ArrayList<RolePrincipalGrant>(_list139.size);
        @org.apache.thrift.annotation.Nullable RolePrincipalGrant _elem140;
        for (int _i141 = 0; _i141 < _list139.size; ++_i141)
        {
          _elem140 = new RolePrincipalGrant();
          _elem140.read(iprot);
          struct.principalGrants.add(_elem140);
        }
      }
      struct.setPrincipalGrantsIsSet(true);
    }
  }

  private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}


text:
<meta charset="utf-8">
<title>{{ page.titlename }} | {{ site.title }}</title>
<meta name="author" content="{{ site.author.name }}">
{% if page.keywords %}
  <meta name="keywords" content="{{ page.keywords }}">
{% endif %}
{% if page.description  %}
  <meta name="description " content="{{ page.description  }}">
{% endif %}
<link rel="shortcut icon" href="{{ site.favicon }}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/public/css/bootstrap.css">
<link rel="stylesheet" href="/public/css/font-awesome.css">
<link rel="stylesheet" href="/public/js/prettify/prettify.css">
<link rel="stylesheet" href="/public/css/base.css">
<link href="/pages/atom.xml" rel="alternate" title="{{site.title}}" type="application/atom+xml">
<script type="text/javascript">var duoshuoQuery = {short_name:"pingqunnayang"};</script>
<script src="http://static.duoshuo.com/embed.js"></script>


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

<TITLE>
com.sun.squawk.platform.posix.natives (2013 FRC Java API)
</TITLE>

<META NAME="date" CONTENT="2013-01-03">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package com.sun.squawk.platform.posix.natives

Interface Summary

Ioctl
java wrapper around #include <sys/ioctl.h>

LibC
Import common functions variables and constants from libc.

NetDB
java wrapper around #include <netdb.h>

Select
java wrapper around #include <sys/select.h>

Socket
java wrapper around BSD sockets

Time
java wrapper around #include <sys/time.h>

Class Summary

IoctlImpl

LibC.stat
C struct stat
 //    struct stat {
 //        dev_t                st_dev;         /* [XSI] ID of device containing file             4 0
 //        ino_t                st_ino;         /* [XSI] File serial number                       4 4
 //        mode_t               st_mode;        /* [XSI] Mode of file (see below)             2 8
 //        nlink_t              st_nlink;       /* [XSI] Number of hard links                 2 10
 //        uid_t                st_uid;         /* [XSI] User ID of the file                      4 12
 //        gid_t                st_gid;         /* [XSI] Group ID of the file                     4 16
 //        dev_t                st_rdev;        /* [XSI] Device ID                                4 20
 //        time_t               st_atime;       /* [XSI] Time of last access                  4 24
 //        long         st_atimensec;   /* nsec of last access                        4 28
 //        time_t               st_mtime;       /* [XSI] Last data modification time          4 32
 //        long         st_mtimensec;   /* last data modification nsec                4 36
 //        time_t               st_ctime;       /* [XSI] Time of last status change           4 40
 //        long         st_ctimensec;   /* nsec of last status change                 4 44
 //        off_t                st_size;        /* [XSI] file size, in bytes                      8 48
 //        blkcnt_t     st_blocks;      /* [XSI] blocks allocated for file                8
 //        blksize_t    st_blksize;     /* [XSI] optimal blocksize for I/O                4
 //        __uint32_t   st_flags;       /* user defined flags for file                4
 //        __uint32_t   st_gen;         /* file generation number                     4
 //        __int32_t    st_lspare;      /* RESERVED: DO NOT USE!                          4
 //        __int64_t    st_qspare[2];   /* RESERVED: DO NOT USE!                      16
 //     };

LibCImpl

LibCImpl.statImpl

NetDB.hostent
C STRUCTURE HostEnt
            struct  hostent {
                     char    *h_name;         official name of host
                     char    **h_aliases;     alias list
                     int     h_addrtype;      host address type
                     int     h_length;        length of address
                     char    **h_addr_list;   list of addresses from name server
             };
             #define h_addr  h_addr_list[0]  address, for backward compatibility

NetDBImpl

NetDBImpl.hostentImpl

SelectImpl

Socket.sockaddr_in
C STRUCTURE sockaddr_in  /
     struct sockaddr_in {
        u_char  sin_len;     1
        u_char  sin_family;  1
        u_short sin_port;    2
        struct  in_addr sin_addr; 4
        char    sin_zero[8];     8
     };

     struct sockaddr {
        __uint8_t       sa_len;         /* total length
        sa_family_t     sa_family;      /* [XSI] address family
        char            sa_data[14];    /* [XSI] addr value (actually larger)
};

SocketImpl

SocketImpl.sockaddr_inImpl

Time.timeval
struct timeval {
             time_t       tv_sec;   // seconds since Jan.

TimeImpl

TimeImpl.timevalImpl

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

"For updated information see the Java FRC site"


text:
'use strict';

angular.module('core').controller('HomeController', ['$scope', 'Authentication',
	function($scope, Authentication) {
		// This provides Authentication context.
		$scope.authentication = Authentication;

		$scope.alerts = [
			{
				icon:'glyphicon-user',
				color:'btn-success',
				total:'20,408',
				description:'TOTAL CUSTOMERS'
			},
			{
				icon:'glyphicon-calendar',
				color:'btn-primary',
				total:'8,382',
				description:'UPCOMING EVENTS'
			},
			{
				icon:'glyphicon-edit',
				color:'btn-success',
				total:'527',
				description:'NEW CUSTOMERS IN 24H'
			},
			{
				icon:'glyphicon-record',
				color:'btn-info',
				total:'85,000',
				description:'EMAILS SENT'
			},
			{
				icon:'glyphicon-eye-open',
				color:'btn-warning',
				total:'20,408',
				description:'FOLLOW UPS REQUIRED'
			},
			{
				icon:'glyphicon-flag',
				color:'btn-danger',
				total:'348',
				description:'REFERRALS TO MODERATE'
			}
		];

		// Date picke
		  $scope.today = function() {
		    $scope.dt = new Date();
		  };

		  $scope.today();

		  $scope.clear = function () {
		    $scope.dt = null;
		  };

		  // Disable weekend selection
		  $scope.disabled = function (date, mode) {
		    return ( mode === 'day' && ( date.getDay() === 0 || date.getDay() === 7 ) );
		  };

		  $scope.toggleMin = function() {
		    $scope.minDate = $scope.minDate ? null : new Date();
		  };
		  $scope.toggleMin();

		  $scope.open = function ($event) {
		    $event.preventDefault();
		    $event.stopPropagation();

		    $scope.opened = true;
		  };

		  $scope.dateOptions = {
		    formatYear: 'yy',
		    startingDay: 1
		  };

		  $scope.initDate = new Date('2016-15-20');
		  $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
		  $scope.format = $scope.formats[0];

		// Timepicker
		  $scope.mytime = new Date();

		  $scope.hstep = 1;
		  $scope.mstep = 1;

		  $scope.options = {
		    hstep: [1, 2, 3],
		    mstep: [1, 5, 10, 15, 25, 30]
		  };

		  $scope.ismeridian = true;
		  $scope.toggleMode = function() {
		    $scope.ismeridian = ! $scope.ismeridian;
		  };

		  $scope.update = function() {
		    var d = new Date();
		    d.setHours( 14 );
		    d.setMinutes( 0 );
		    $scope.mytime = d;
		  };

		  $scope.changed = function () {
		    console.log('Time changed to: ' + $scope.mytime);
		  };

		  $scope.clear = function() {
		    $scope.mytime = null;
		  };
	}
]);


text:
/**
 * This class exposes NativeTable interface controls to JavaScript,
 * @constructor
 */
function NativeTable() {
	this.callBackFunction = null;
}

/**
 * Create a nativeTable instance.
 */
NativeTable.prototype.createTable = function(params) {
    Cordova.exec("NativeTable.createTable", params);
};

/**
 * Set table title.
 */
NativeTable.prototype.setTableTitle = function(tableTitle) {
    Cordova.exec("NativeTable.setTableTitle", tableTitle);
};

/**
 * Set table data.
 */
NativeTable.prototype.setTableData = function(tableData) {
    Cordova.exec("NativeTable.setTableData", tableData);
};

/**
 * show nativeTable.
 */
NativeTable.prototype.showTable = function() {
    Cordova.exec("NativeTable.showTable");
};

/**
 * hide nativeTable.
 */
NativeTable.prototype.hideTable = function() {
    Cordova.exec("NativeTable.hideTable");
};

/**
 * sets CallBackFunction.
 */
NativeTable.prototype.setRowSelectCallBackFunction = function(callBkFunc) {
	this.callBackFunction = callBkFunc;
};

/**
 * gets called from native layer.
 */
NativeTable.prototype._onTableViewRowSelect = function(rowId) {
	if(this.callBackFunction)
		this.callBackFunction(rowId);
};

/** Run the constructor **/
Cordova.addConstructor(function()
                       {
                       if(!window.plugins)
                       {
                       window.plugins = {};
                       }
                       window.plugins.nativeTable = new NativeTable();

                       });


text:
<!DOCTYPE html>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900|Quicksand:400,700|Questrial" rel="stylesheet" />
<link href="http://localhost/ignite/css/default.css" rel="stylesheet" type="text/css" media="all" />
<link href="http://localhost/ignite/fonts/fonts.css" rel="stylesheet" type="text/css" media="all" />

			Alcalde Sergio Prieto Nieto Nº 452.

Viña del Mar

				Telefono:  32 260 3325 - 32 260 3322 .

			 fonoaudiologia.uv.cl

?>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Indulged.API.Utils;
using Indulged.API.Networking.Events;

namespace Indulged.API.Networking
{
    public partial class APIService
    {
        public async Task<APIResponse> GetPopularTagListAsync(Action<string> success = null, Action<string> failure = null)
        {
            var paramDict = new Dictionary<string, string>();
            paramDict["method"] = "flickr.tags.getHotList";

            var retVal = await DispatchRequestAsync("GET", paramDict, true);
            if (retVal.Success)
            {
                if (success != null)
                {
                    success(retVal.Result);
                }

                // Dispatch event
                var evt = new APIEventArgs();
                evt.Response = retVal.Result;
                PopularTagListReturned.DispatchEvent(this, evt);
            }
            else
            {
                if (failure != null)
                {
                    failure(retVal.ErrorMessage);
                }

                // Dispatch event
                var evt = new APIEventArgs();
                evt.ErrorMessage = retVal.ErrorMessage;
                PopularTagListFailedReturn.DispatchEvent(this, evt);
            }

            return retVal;
        }
    }
}


text:
<?php
function whoops_add_stack_frame($callback){
    $callback();
}


text:
<?php

namespace NFe\Entity;

class LacreTest extends \PHPUnit\Framework\TestCase
{
    protected function setUp(): void
    {
    }

    public function testLacre()
    {
        $lacre = new \NFe\Entity\Lacre();
        $lacre->setNumero(123);
        $lacre->fromArray($lacre);
        $lacre->fromArray($lacre->toArray());
        $lacre->fromArray(null);

        $this->assertEquals(123, $lacre->getNumero());
    }
}


text:
{% extends "base.html" %}

{% load mezzanine_tags rating_tags keyword_tags comment_tags drum_tags %}

{% block meta_description %}{% metablock %}{{ object.description }}{% endmetablock %}{% endblock %}
{% block meta_title %}{{ object.title }}{% endblock %}
{% block title %}
{{ object.title }}
{% if link.link %}({{ object.domain }}){% endif %}
{% endblock %}

{% block main %}
<link rel="stylesheet" href="{{ STATIC_URL }}css/details.css">

        {% rating_for object %}

{% if link.link %}{{ object.title }}{% else %}{{ object.title }}{% endif %}

        {{ object.publish_date|short_timesince }}前
        {% if link.link %}({{ link.domain }}){% endif %}

{{ object.description }}

            论坛:{% keywords_for link as tags %}
            {% for tag in tags %}
            {{ tag }} |
            {% endfor %}

    {% order_comments_by_score_for object %}
    {% comments_for object %}

{% endblock %}


text:
package name.etapic.codejam.tictactoetomek;

import name.etapic.codejam.ProblemSolver;
import name.etapic.codejam.Solution;

import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

/**
 * Port of Python implementation at
 * https://code.google.com/codejam/contest/2270488/dashboard#s=a&a=0
 */
public final class ContentAnalysis implements ProblemSolver {

    private static String getText(final List<String> board) {
        for (char c : Arrays.asList('X', 'O')) {
            final Collection<Character> winChars = Arrays.asList(c, 'T');
            boolean wind1 = true;
            boolean wind2 = true;
            for (int x = 0; x < board.size(); x++) {
                boolean winh = true;
                boolean winv = true;
                for (int y = 0; y < board.size(); y++) {
                    if (!winChars.contains(board.get(y).charAt(x))) {
                        winv = false;
                    }
                    if (!winChars.contains(board.get(x).charAt(y))) {
                        winh = false;
                    }
                }
                if (winh || winv) {
                    return c + " won";
                }
                if (!winChars.contains(board.get(x).charAt(x))) {
                    wind1 = false;
                }
                if (!winChars.contains(board.get(board.size() - 1 - x).charAt(x))) {
                    wind2 = false;
                }
            }
            if (wind1 || wind2) {
                return c + " won";
            }
        }
        for (int x = 0; x < board.size(); x++) {
            for (int y = 0; y < board.size(); y++) {
                if (board.get(y).charAt(x) == '.') {
                    return "Game has not completed";
                }
            }
        }
        return "Draw";
    }

    @Override
    public Solution solve(final BufferedReader reader) throws Exception {
        final int boardHeight = 4;
        List<String> board = new ArrayList<>(boardHeight);
        for (int i = 0; i < boardHeight; i++) {
            board.add(reader.readLine());
        }
        reader.readLine();
        return new Solution(getText(board), 16);
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
 [y] hybris Platform

 Copyright (c) 2017 SAP SE or an SAP affiliate company.  All rights reserved.

 This software is the confidential and proprietary information of SAP
 ("Confidential Information"). You shall not disclose such Confidential
 Information and shall use it only in accordance with the terms of the
 license agreement you entered into with SAP.
--><!--
 All hybris buildcallbacks.xml macrodefinitions:

 Build/Documentation

	 before/after ant macro "clean"
		 <macrodef name="adyenv6notification_before_clean"/>
		 <macrodef name="adyenv6notification_after_clean"/>

	 before/after ant macro "build"
		 <macrodef name="adyenv6notification_before_build"/>
		 <macrodef name="adyenv6notification_after_build"/>

	 before/after ant macro "compile_core" - the core module of the extension
		 <macrodef name="adyenv6notification_before_compile_core">
		 <macrodef name="adyenv6notification_after_compile_core">

	 before/after ant macro "compile_web" - the web module of the extension
		 <macrodef name="adyenv6notification_before_compile_web" />
		 <macrodef name="adyenv6notification_after_compile_web" />

	 before/after ant macro "compile_hmc" - the hmc module of the extension
		 <macrodef name="adyenv6notification_before_compile_hmc" />
		 <macrodef name="adyenv6notification_after_compile_hmc" />

 Preparing extension

	 will be called in the beginning of the ant call and only once (also when using multiple
	 ant targets e.g. ant build yunittest)
		 <macrodef name="adyenv6notification_only_once_prepare"/>

 Creating ear module/production

	 before/after ant macro "ear"
		 <macrodef name="adyenv6notification_before_ear"/>
		 <macrodef name="adyenv6notification_after_ear"/>

	 before/after ant macro "production" - for hybris server only
		 <macrodef name="adyenv6notification_before_production" />
		 <macrodef name="adyenv6notification_after_production" />

 JUnit Test

	 before/after ant macro "yunitinit"
		 <macrodef name="adyenv6notification_before_yunitinit" />
		 <macrodef name="adyenv6notification_after_yunitinit" />

	 before/after ant macro "yunit"
		 <macrodef name="adyenv6notification_before_yunit" />
		 <macrodef name="adyenv6notification_after_yunit" />

 Distribution package

 	 before/after ant macro "dist" - internal target; only for use when platform is available in source code
		 <macrodef name="adyenv6notification_after_dist"/>
		 <macrodef name="adyenv6notification_before_dist"/>

	 before/after ant macro "dist_copy" - internal target; only for use when platform is available in source code
		 <macrodef name="adyenv6notification_before_dist_copy"/>
		 <macrodef name="adyenv6notification_after_dist_copy"/>

 	 With these filters you can override the default extension filters defined in platform/resources/ant/dist/filtersets.xml
 	  	 <patternset id="extension.adyenv6notification.binary.filter">
 	  	  	 <patternset refid="extension.filter" />
 	  	  	 <exclude name="**/*-source.jar" />
 	  	 </patternset>
 	  	 <patternset id="extension.adyenv6notification.source.filter">
 	  	  	 <exclude name="**/bin/**" />
 	  	 </patternset>

--><project name="adyenv6notification_buildcallbacks">

	<!--
	    Called whenever 'ant ear' is used. this callback can be used to modify the content of the ear file

	     ${ear.path}: 			path to ear
	 -->
	<macrodef name="adyenv6notification_before_ear">
		<sequential>

			<!-- you can do anything before the EAR file is being packed -->

		</sequential>
	</macrodef>

</project>


text:
package de.javawi.jstun.util;

import java.util.*;
import java.net.*;

public class Address {
	int firstOctet;
	int secondOctet;
	int thirdOctet;
	int fourthOctet;

	public Address(int firstOctet, int secondOctet, int thirdOctet, int fourthOctet) throws UtilityException {
		if ((firstOctet < 0) || (firstOctet > 255) || (secondOctet < 0) || (secondOctet > 255) || (thirdOctet < 0) || (thirdOctet > 255) || (fourthOctet < 0) || (fourthOctet > 255)) {
			throw new UtilityException("Address is malformed.");
		}
		this.firstOctet = firstOctet;
		this.secondOctet = secondOctet;
		this.thirdOctet = thirdOctet;
		this.fourthOctet = fourthOctet;
	}

	public Address(String address) throws UtilityException {
		StringTokenizer st = new StringTokenizer(address, ".");
		if (st.countTokens() != 4) {
			throw new UtilityException("4 octets in address string are required.");
		}
		int i = 0;
		while (st.hasMoreTokens()) {
			int temp = Integer.parseInt(st.nextToken());
			if ((temp < 0) || (temp > 255)) {
				throw new UtilityException("Address is in incorrect format.");
			}
			switch (i) {
			case 0: firstOctet = temp; ++i; break;
			case 1: secondOctet = temp; ++i; break;
			case 2: thirdOctet = temp; ++i; break;
			case 3: fourthOctet = temp; ++i; break;
			}
		}
	}

	public Address(byte[] address) throws UtilityException {
		if (address.length < 4) {
			throw new UtilityException("4 bytes are required.");
		}
		firstOctet = Utility.oneByteToInteger(address[0]);
		secondOctet = Utility.oneByteToInteger(address[1]);
		thirdOctet = Utility.oneByteToInteger(address[2]);
		fourthOctet = Utility.oneByteToInteger(address[3]);
	}

	public String toString() {
		return firstOctet + "." + secondOctet + "." + thirdOctet + "." + fourthOctet;
	}

	public byte[] getBytes() throws UtilityException {
		byte[] result = new byte[4];
		result[0] = Utility.integerToOneByte(firstOctet);
		result[1] = Utility.integerToOneByte(secondOctet);
		result[2] = Utility.integerToOneByte(thirdOctet);
		result[3] = Utility.integerToOneByte(fourthOctet);
		return result;
	}

	public InetAddress getInetAddress() throws UtilityException, UnknownHostException {
		byte[] address = new byte[4];
		address[0] = Utility.integerToOneByte(firstOctet);
		address[1] = Utility.integerToOneByte(secondOctet);
		address[2] = Utility.integerToOneByte(thirdOctet);
		address[3] = Utility.integerToOneByte(fourthOctet);
		return InetAddress.getByAddress(address);
	}

	public boolean equals(Object obj) {
		if (obj == null) return false;
		try {
			byte[] data1 = this.getBytes();
			byte[] data2 = ((Address) obj).getBytes();
			if ((data1[0] == data2[0]) && (data1[1] == data2[1]) &&
			    (data1[2] == data2[2]) && (data1[3] == data2[3])) return true;
			return false;
		} catch (UtilityException ue) {
			return false;
		}
	}

	public int hashCode() {
		return (firstOctet << 24) + (secondOctet << 16) + (thirdOctet << 8) + fourthOctet;
	}

}


text:
Implementasi Webservice berbasis REST pada studi kasus konversi warna citra.

## Penjelasan
to do


text:
For testing and development deployments, the quickest and easiest way is to set up a local cluster. For a production deployment, refer to the [clustering][clustering] section.

## Local standalone cluster

Deploying an etcd cluster as a standalone cluster is straightforward. Start it with just one command:

```
$ ./etcd
...
```

The started etcd member listens on `localhost:2379` for client requests.

To interact with the started cluster by using etcdctl:

```
# use API version 3
$ export ETCDCTL_API=3

$ ./etcdctl put foo bar
OK

$ ./etcdctl get foo
bar
```

## Local multi-member cluster

A Procfile is provided to easily set up a local multi-member cluster. Start a multi-member cluster with a few commands:

```
# install goreman program to control Profile-based applications.
$ go get github.com/mattn/goreman
$ goreman -f Procfile start
...
```

The started members listen on `localhost:12379`, `localhost:22379`, and `localhost:32379` for client requests respectively.

To interact with the started cluster by using etcdctl:

```
# use API version 3
$ export ETCDCTL_API=3

$ etcdctl --write-out=table --endpoints=localhost:12379 member list
+------------------+---------+--------+------------------------+------------------------+
|        ID        | STATUS  |  NAME  |       PEER ADDRS       |      CLIENT ADDRS      |
+------------------+---------+--------+------------------------+------------------------+
| 8211f1d0f64f3269 | started | infra1 | http://127.0.0.1:12380 | http://127.0.0.1:12379 |
| 91bc3c398fb3c146 | started | infra2 | http://127.0.0.1:22380 | http://127.0.0.1:22379 |
| fd422379fda50e48 | started | infra3 | http://127.0.0.1:32380 | http://127.0.0.1:32379 |
+------------------+---------+--------+------------------------+------------------------+

$ etcdctl --endpoints=localhost:12379 put foo bar
OK
```

To exercise etcd's fault tolerance, kill a member:

```
# kill etcd2
$ goreman run stop etcd2

$ etcdctl --endpoints=localhost:12379 put key hello
OK

$ etcdctl --endpoints=localhost:12379 get key
hello

# try to get key from the killed member
$ etcdctl --endpoints=localhost:22379 get key
2016/04/18 23:07:35 grpc: Conn.resetTransport failed to create client transport: connection error: desc = "transport: dial tcp 127.0.0.1:22379: getsockopt: connection refused"; Reconnecting to "localhost:22379"
Error:  grpc: timed out trying to connect

# restart the killed member
$ goreman run restart etcd2

# get the key from restarted member
$ etcdctl --endpoints=localhost:22379 get key
hello
```

To learn more about interacting with etcd, read [interacting with etcd section][interacting].

[interacting]: ./interacting_v3.md
[clustering]: ../op-guide/clustering.md


text:
using System;
using System.Diagnostics;
using JetBrains.Annotations;

namespace BayesianClassifier
{
    /// <summary>
    /// Class ClassBase.
    /// </summary>
    [DebuggerDisplay("Class {Name}, base P = {Probability}")]
    public abstract class ClassBase : IClass
    {
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; private set; }

        /// <summary>
        /// Gets the class' base probability.
        /// </summary>
        /// <value>The probability.</value>
        public double Probability { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="ClassBase" /> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="probability">The probability.</param>
        /// <exception cref="System.ArgumentNullException">name</exception>
        /// <exception cref="System.ArgumentOutOfRangeException">
        /// probability;Class base probability must be greater than or equal to zero.
        /// or
        /// probability;Class base probability must be less than or equal to one.
        /// </exception>
        protected ClassBase([NotNull] string name, double probability)
        {
            if (ReferenceEquals(name, null)) throw new ArgumentNullException("name");
            if (probability < 0) throw new ArgumentOutOfRangeException("probability", "Class base probability must be greater than or equal to zero.");
            if (probability > 1) throw new ArgumentOutOfRangeException("probability", "Class base probability must be less than or equal to one.");

            Name = name;
            Probability = probability;
        }

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
        public abstract bool Equals([NotNull] IClass other);
    }
}


text:
<img src="<?php echo base_url(); ?>images/logo.png" class="img-responsive" alt="logo">

Kontakt

Küsimuste või probleemide korral palume ühendust võtta e-maili või telefoni teel.

p2pkuulutused@p2p.ee

+372 5858585

				Aadress:

				<?php
				$feed = new SimpleXMLElement("http://localhost/P2P/xml/file.xml",NULL,TRUE);
				$namespaces = $feed->getNamespaces(true);

				$getChildren=$feed->children($namespaces["k"]);
				echo $getChildren->TÄNAV."
";
				echo $getChildren->LINN."
";
				echo $getChildren->RIIK."
";
				echo $getChildren->POSTIINDEKS."
";

				//Ilma namespace'ita
				$feed2=simplexml_load_file("http://localhost/P2P/xml/file.xml");
				echo $feed2->POSTIINDEKS;
				?>

<?php
include('alaosa.php')
?>


text:
module.exports = function ( opt )
{
	var lo = require('lodash');
		path = require('path');

	opt = opt || {};

	// Disable file reads - we only need paths!
	opt.srcRead = false;
	opt.srcBuffer = false;

	// When true, merge function doesn't look for tags, but overwrites the whole file
	opt.overwrite = lo.isUndefined(opt.overwrite) ? false : opt.overwrite;
	// Tags to insert merged contents inbetween
	opt.openTag = opt.openTag || "/* Packetizer Enumerate START */";
	opt.closeTag = opt.closeTag || "/* Packetizer Enumerate END */";
	// When true, will append to the target file if correct tags were not found, otherwise will throw an error
	opt.appendWhenNoTags = lo.isUndefined(opt.appendWhenNoTags) ? true : opt.appendWhenNoTags;

	// The below will only be used if default filenameFunction used
	opt.filenameTemplate = opt.filenameTemplate || '{{filename}}';
	opt.filePathOffset = opt.filePathOffset || './';
	opt.fixWindowsSlashes = lo.isUndefined(opt.fixWindowsSlashes) ? true : opt.fixWindowsSlashes;
	opt.appendLineBreak = lo.isUndefined(opt.appendLineBreak) ? true : opt.appendLineBreak;

	var filenameFunction = lo.isFunction(opt.filenameFunction) ? opt.filenameFunction : function ( file, pkg, sequence, isLast, lineBreak )
	{
		var filename = path.relative(path.resolve(pkg.exportsAbsolutePath, opt.filePathOffset), file.path);

		if (opt.fixWindowsSlashes) filename = filename.replace(/\\/g, "/").replace(/^[a-zA-Z]:/, "");

		if (opt.appendLineBreak) filename += lineBreak;

		return opt.filenameTemplate.replace(/{{filename}}/gm, filename);
	};

	opt.mergeFunction = function ( contents, files )
	{
		contents = contents || '';

		var lineBreak = '\n';

		if (contents.indexOf('\r\n') > -1) lineBreak = '\r\n';
		else if (contents.indexOf('\n\r') > -1) lineBreak = '\n\r';
		else if (contents.indexOf('\r') > -1) lineBreak = '\r';

		var mergedFilenames = '';

		for (var i = 0; i < files.length; ++i) mergedFilenames += filenameFunction(files[i].file, files[i].pkg, i, (i + 1) == files.length, lineBreak);

		var posOpen, posClose,
			contentsBefore, contentsAfter;

		if (opt.overwrite)
		{
			contentsBefore = '';
			contentsAfter = '';
		}
		else if ((posOpen = contents.indexOf(opt.openTag)) > -1 && (posClose = contents.indexOf(opt.closeTag)) > -1)
		{
			contentsBefore = contents.substr(0, posOpen + opt.openTag.length);
			contentsAfter = contents.substr(posClose);
		}
		else if (opt.appendWhenNoTags)
		{
			contentsBefore = contents + opt.openTag;
			contentsAfter = opt.closeTag;
		}
		else throw new Error('Tags not found');

		if (opt.appendLineBreak) contentsBefore += lineBreak;

		return Promise.resolve(contentsBefore + mergedFilenames + contentsAfter);
	};

	return require('./merge')(opt);
};


text:
using System;
using ReminderService.Common;
using ReminderService.Messages;
using ReminderService.Core.Persistence;
using ReminderService.Core.Persistence.Npgsql;
using System.Data;
using Npgsql;
using System.Web.Script.Serialization;

namespace ReminderService.Core.Persistence.Postgres
{
	public class CurrentRemindersReplayer : IReplayEvents
	{
		private readonly string _connectionString;
		private readonly ICommandFactory _commandFactory;
		private readonly Func<IDataReader, JournaledEnvelope<ReminderMessage.Schedule>> _reminderMapper;

		public CurrentRemindersReplayer (
			ICommandFactory commandFactory,
			string connectionString,
			Func<IDataReader, JournaledEnvelope<ReminderMessage.Schedule>> reminderMapper = null)
		{
			Ensure.NotNull (commandFactory, "commandFactory");
			Ensure.NotNullOrEmpty (connectionString, "connectionString");

			_commandFactory = commandFactory;
			_connectionString = connectionString;

			if (reminderMapper == null)
				_reminderMapper = ScheduleMap;
			else
				_reminderMapper = reminderMapper;
		}

		public IObservable<T> Replay<T> (DateTime from)
		{
			var connection = new NpgsqlConnection (_connectionString);
			var command = _commandFactory.GetCurrentRemindersCommand ();
			return (IObservable<T>)command.ExecuteAsObservable (connection, _reminderMapper);
		}

		public static Func<IDataReader, JournaledEnvelope<ReminderMessage.Schedule>> ScheduleMap {
			get {
				return (reader) => {
					var serializer = new JavaScriptSerializer();
					var raw = reader["message"].ToString();
					return new JournaledEnvelope<ReminderMessage.Schedule>(
						serializer.Deserialize<ReminderMessage.Schedule>(raw));
				};
			}
		}
	}
}


text:
/**
 * Module dependencies.
 */
const passport = require('passport')
  , LocalStrategy = require('passport-local').Strategy
  , BasicStrategy = require('passport-http').BasicStrategy
  , ClientPasswordStrategy = require('passport-oauth2-client-password').Strategy
  , BearerStrategy = require('passport-http-bearer').Strategy
  , utils = require('../helpers/utils')
  , config = require('config')
  , User = require('../models/user')
  , Accesstoken = require('../models/accesstoken')
  , Client = require('../models/client');

passport.serializeUser(function(user, done) {
  done(null, user.username);
});

passport.deserializeUser(function(username, done) {
  User.findOne({username: username}, function(err, user) {
    if (err) { return done(err); }
    if (!user) { return done(null, false, { message: 'Unknow User' }); }
    return done(null, user);
  });
});

/**
 * LocalStrategy
 *
 * This strategy is used to authenticate users based on a username and password.
 * Anytime a request is made to authorize an application, we must ensure that
 * a user is logged in before asking them to approve the request.
 */
passport.use(new LocalStrategy(
  function(username, password, done) {
    User.findOne({username: username}, function(err, user) {
      if (err) { return done(err); }
      if (!user) { return done(null, false, { message: 'Unknow User' }); }
      if (!utils.validEncrypt(password, user.password)) { return done(null, false); }
      return done(null, user);
    });
  }
));

/**
 * BasicStrategy & ClientPasswordStrategy
 *
 * These strategies are used to authenticate registered OAuth clients.  They are
 * employed to protect the `token` endpoint, which consumers use to obtain
 * access tokens.  The OAuth 2.0 specification suggests that clients use the
 * HTTP Basic scheme to authenticate.  Use of the client password strategy
 * allows clients to send the same credentials in the request body (as opposed
 * to the `Authorization` header).  While this approach is not recommended by
 * the specification, in practice it is quite common.
 */
passport.use(new BasicStrategy(
  function(clientId, clientSecret, done) {
    Client.findOne({clientId: clientId}, function(err, client) {
      if (err) { return done(err); }
      if (!client) { return done(null, false, { message: 'Unknow Client' }); }
      if (client.clientSecret != clientSecret) { return done(null, false); }
      return done(null, client);
    });
  }
));

passport.use(new ClientPasswordStrategy(
  function(clientId, clientSecret, done) {
    Client.findOne({clientId: clientId}, function(err, client) {
      if (err) { return done(err); }
      if (!client) { return done(null, false, { message: 'Unknow Client' }); }
      if (client.clientSecret != clientSecret) { return done(null, false); }
      return done(null, client);
    });
  }
));

/**
 * BearerStrategy
 *
 * This strategy is used to authenticate either users or clients based on an access token
 * (aka a bearer token).  If a user, they must have previously authorized a client
 * application, which is issued an access token to make requests on behalf of
 * the authorizing user.
 */
passport.use(new BearerStrategy(
  function(accessToken, done) {
    Accesstoken.findOne({value: accessToken }, function (err, token) {
      if (err) { return done(err); }
      if (!token) { return done(null, false); }
      if( Math.round((Date.now()-token.created) / 1000) > config.get('security').tokenLife ) {
        Accesstoken.remove({ value: accessToken }, function (err) {
          if (err) return done(err);
        });
        return done(null, false, { message: 'Token expired' });
      }

      if (token.username != null) {
        User.findOne({username: token.username}, function(err, user) {
          if (err) { return done(err); }
          if (!user) { return done(null, false, { message: 'Unknow User' }); }
          return done(null, user, { scope: '*' });
        });
      } else {
        Client.findOne({_id: token.clientId}, function(err, client) {
          if(err) { return done(err); }
          if(!client) { return done(null, false, { message: 'Unknow Client' }); }
          done(null, client, { scope: '*' });
        });
      }
    });
  }
));


text:
<?php

namespace Application\Service;

class CartService extends ModelService {

    private $_cartKey = '_usr_cart';
    private $_ttl = array(
       'sec' => 0,
       'min' => 0,
       'hours' => 12, //12 Hours cart.
       'days' => 0
    );

    public function __construct(){
        //echo 'constructed!';
    }

    /**************************************************************************/
    //All business methods for category will be stored in here.

    public function verify()
    {
        //Fetching a cart instance.
        $cart = $this->getCart();
        //Updating all carts to disable if expired
        $query = $this->getEntityManager()->createQuery(
                        'SELECT c FROM \Application\Entity\Cart c
                        WHERE c.Expire < :today AND c.Status <> :disabled')
                    ->setParameter('today', new \DateTime())
                    ->setParameter('disabled', \Application\Response\Status::DISABLED)
                    ;

        $result = $query->getResult();
        foreach($result as $exp)
        {
            $exp->setStatus(\Application\Response\Status::DISABLED);
            $this->getEntityManager()->persist($exp);
        }
        $this->getEntityManager()->flush();

    }

    /**
     * Returns the cart.
     */
    public function getCart()
    {
        $cookiesrv = \Utils\Misc\Cookie::getInstance();
        $guid = $cookiesrv->get($this->_cartKey);

        $cart = $this->getRepository()->findBy(array('GUID' => $guid , 'Status' => \Application\Response\Status::ACTIVE));

        if(isset($cart[0])){
            $cart = $cart[0];
            return $cart;
        }
        //Generate new cart;
        return $this->generateCart();
    }

    public function addItem($Item , $Options = array())
    {
        $quantity = isset($Options['quantity']) ? $Options['quantity'] : 1;
        $cart = $this->getCart();

        foreach($cart->getCartItems() as $cartItem){

            if($cartItem->getItem()->getItemId() == $Item->getItemId()){
                //exit('duplicate');
                $cartItem->setQuantity($cartItem->getQuantity() + 1);
                $this->getEntityManager()->persist($cartItem);
                $this->getEntityManager()->flush();
                return true;
            }
        }

        $cartItem = new \Application\Entity\CartItem();
        $cartItem->setCart($cart);
        $cartItem->setItem($Item);
        $cartItem->setQuantity($quantity);
        $cartItem->setVoucher(null);

        $this->getEntityManager()->persist($cartItem);
        $this->getEntityManager()->flush();
        return true;
    }

    /**
     * Clear all items from current cart
     */
    public function clear()
    {
        $cart = $this->getCart();
        $cart->setStatus( \Application\Response\Status::DISABLED);
        $cookiesrv = \Utils\Misc\Cookie::getInstance();
        $cookiesrv->remove($this->_cartKey);
        $this->getEntityManager()->persist($cart);
        $this->getEntityManager()->flush();
    }

    /**
     * Returns the GUID stored in the browser.
     */
    private function getBrowserGUID()
    {

    }

    /**
     * Returns a brand new cart
     */
    private function generateCart()
    {
        $cookiesrv = \Utils\Misc\Cookie::getInstance();
        $guid = $this->generateToken();
        //Setting the desired time to live from configs
        $addTime = 0;
        $addTime += $this->_ttl['sec'] ; //add seconds
        $addTime += 60 * $this->_ttl['min'] ; //add minutes
        $addTime += 60 * 60 * $this->_ttl['hours'] ; //add hours
        $addTime += 60 * 60 * 24 * $this->_ttl['days'] ; //add days
        $ttl = time() + $addTime;

        $expire = new \DateTime(date('Y-m-d H:i:s' , $ttl));
        $cart = new \Application\Entity\Cart();
        $cart->setGUID($guid);
        $cart->setTtl($ttl);
        $cart->setExpire($expire);
        $this->getEntityManager()->persist($cart);
        $this->getEntityManager()->flush();

        $cookiesrv->set($this->_cartKey , $guid , $ttl);
        return $cart;
    }

    private function generateToken()
    {
        $chars = array(
            0,1,2,3,4,5,6,7,8,9,
            'A','B','C','D','E','F','G','H','I','J','K','L','M','N',
            'O','P','Q','R','S','T','U','V','W','X','Y','Z',
            // 'a','b','c','d','e','f','g','h','i','j','k','l','m','n',
            // 'o','p','q','r','s','t','u','v','w','x','y','z'
            );
        $serial = '';
        $max = count($chars)-1;
        for($i=0;$i<30;$i++){
            $serial .= (!($i % 5) && $i ? '-' : '').$chars[rand(0, $max)];
        }

        return $serial;
    }

    /**************************************************************************/

    public function getRepository()
    {
        return $this->getEntityManager()->getRepository('Application\Entity\Cart');
    }
}


text:
package framework

import (
	"bufio"
	"bytes"
	"encoding/base64"
	"encoding/json"
	"encoding/xml"
	"fmt"
	"io"
	"io/ioutil"
	"mime"
	"mime/multipart"
	"net/http"
	"strconv"
	"strings"
)

// MIME types
const (
	MIMEApplicationJSON                  = "application/json"
	MIMEApplicationJSONCharsetUTF8       = MIMEApplicationJSON + "; " + charsetUTF8
	MIMEApplicationJavaScript            = "application/javascript"
	MIMEApplicationJavaScriptCharsetUTF8 = MIMEApplicationJavaScript + "; " + charsetUTF8
	MIMEApplicationXML                   = "application/xml"
	MIMEApplicationXMLCharsetUTF8        = MIMEApplicationXML + "; " + charsetUTF8
	MIMEApplicationForm                  = "application/x-www-form-urlencoded"
	MIMEApplicationProtobuf              = "application/protobuf"
	MIMEApplicationMsgpack               = "application/msgpack"
	MIMETextHTML                         = "text/html"
	MIMETextHTMLCharsetUTF8              = MIMETextHTML + "; " + charsetUTF8
	MIMETextPlain                        = "text/plain"
	MIMETextPlainCharsetUTF8             = MIMETextPlain + "; " + charsetUTF8
	MIMEMultipartForm                    = "multipart/form-data"
	MIMEOctetStream                      = "application/octet-stream"
)

const (
	charsetUTF8 = "charset=utf-8"
)

// Headers
const (
	HeaderAcceptEncoding                = "Accept-Encoding"
	HeaderAllow                         = "Allow"
	HeaderAuthorization                 = "Authorization"
	HeaderContentDisposition            = "Content-Disposition"
	HeaderContentEncoding               = "Content-Encoding"
	HeaderContentLength                 = "Content-Length"
	HeaderContentType                   = "Content-Type"
	HeaderCookie                        = "Cookie"
	HeaderSetCookie                     = "Set-Cookie"
	HeaderIfModifiedSince               = "If-Modified-Since"
	HeaderLastModified                  = "Last-Modified"
	HeaderLocation                      = "Location"
	HeaderUpgrade                       = "Upgrade"
	HeaderVary                          = "Vary"
	HeaderWWWAuthenticate               = "WWW-Authenticate"
	HeaderXForwardedProto               = "X-Forwarded-Proto"
	HeaderXHTTPMethodOverride           = "X-HTTP-Method-Override"
	HeaderXForwardedFor                 = "X-Forwarded-For"
	HeaderXRealIP                       = "X-Real-IP"
	HeaderServer                        = "Server"
	HeaderOrigin                        = "Origin"
	HeaderAccessControlRequestMethod    = "Access-Control-Request-Method"
	HeaderAccessControlRequestHeaders   = "Access-Control-Request-Headers"
	HeaderAccessControlAllowOrigin      = "Access-Control-Allow-Origin"
	HeaderAccessControlAllowMethods     = "Access-Control-Allow-Methods"
	HeaderAccessControlAllowHeaders     = "Access-Control-Allow-Headers"
	HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"
	HeaderAccessControlExposeHeaders    = "Access-Control-Expose-Headers"
	HeaderAccessControlMaxAge           = "Access-Control-Max-Age"

	// Security
	HeaderStrictTransportSecurity = "Strict-Transport-Security"
	HeaderXContentTypeOptions     = "X-Content-Type-Options"
	HeaderXXSSProtection          = "X-XSS-Protection"
	HeaderXFrameOptions           = "X-Frame-Options"
	HeaderContentSecurityPolicy   = "Content-Security-Policy"
	HeaderXCSRFToken              = "X-CSRF-Token"
)

// JSON sends a JSON response with status code.
func (res *APIGatewayProxyResponse) JSON(status int, body interface{}) {
	res.SetStatus(status)
	res.SetHeader(HeaderContentType, MIMEApplicationJSONCharsetUTF8)

	data, err := json.Marshal(body)
	if err == nil {
		res.Body = string(data)
	}
}

// JSONP sends a JSONP response with status code.
func (res *APIGatewayProxyResponse) JSONP(status int, callback string, body interface{}) {
	res.SetStatus(status)
	res.SetHeader(HeaderContentType, MIMEApplicationJSONCharsetUTF8)

	data, err := json.Marshal(body)
	if err == nil {
		var buffer bytes.Buffer
		buffer.WriteString(callback)
		buffer.WriteString("(")
		buffer.WriteString(string(data))
		buffer.WriteString(")")
		res.Body = buffer.String()
		buffer.Reset()
	}
}

// XML sends an XML response with status code.
func (res *APIGatewayProxyResponse) XML(status int, i interface{}) {
	res.SetStatus(status)
	res.SetHeader(HeaderContentType, MIMEApplicationXMLCharsetUTF8)

	b, err := xml.Marshal(i)
	if err != nil {
		// TODO: Figure out what to do with error now that it's not on struct
		// res.err = err
	} else {
		res.Body = formatXML(b)
	}
}

// XMLPretty sends an indented XML response with status code.
func (res *APIGatewayProxyResponse) XMLPretty(status int, i interface{}, indent string) {
	res.SetStatus(status)
	res.SetHeader(HeaderContentType, MIMEApplicationXMLCharsetUTF8)

	b, err := xml.MarshalIndent(i, "", indent)
	if err != nil {
		// TODO: Figure out what to do with error now that it's not on struct
		// res.err = err
	} else {
		res.Body = formatXML(b)
	}
}

// formatXML joins together an XML header and marshalled XML bytes for a completely formatted response.
func formatXML(b []byte) string {
	var buffer bytes.Buffer
	buffer.WriteString(xml.Header)
	buffer.WriteString(string(b))
	xmlString := buffer.String()
	buffer.Reset()
	return xmlString
}

// HTML sets an HTML header and returns a response with status code.
func (res *APIGatewayProxyResponse) HTML(status int, html string) {
	res.SetStatus(status)
	res.SetHeader(HeaderContentType, MIMETextHTMLCharsetUTF8)
	res.Body = html
}

// String returns a plain text response with status code.
func (res *APIGatewayProxyResponse) String(status int, s string) {
	res.SetStatus(status)
	res.SetHeader(HeaderContentType, MIMETextPlainCharsetUTF8)
	res.Body = s
}

// Error returns an error message with a status code, format based on content type header.
func (res *APIGatewayProxyResponse) Error(status int, e error) {
	res.SetStatus(status)
	res.SetBodyError(e)
}

// JSONError will return an error message in a simple JSON object with a status code.
func (res *APIGatewayProxyResponse) JSONError(status int, e error) {
	res.SetHeader(HeaderContentType, MIMEApplicationJSONCharsetUTF8)
	res.Error(status, e)
}

// HTMLError will return an error message in HTML with a status code.
func (res *APIGatewayProxyResponse) HTMLError(status int, e error) {
	res.SetHeader(HeaderContentType, MIMETextHTMLCharsetUTF8)
	res.Error(status, e)
}

// XMLError will return an error message in XML with a status code.
func (res *APIGatewayProxyResponse) XMLError(status int, e error) {
	res.SetHeader(HeaderContentType, MIMEApplicationXMLCharsetUTF8)
	res.Error(status, e)
}

// Redirect redirects the request with status code.
func (res *APIGatewayProxyResponse) Redirect(status int, url string) {
	if status < http.StatusMultipleChoices || status > http.StatusTemporaryRedirect {
		// TODO: Figure out how to handle error now that it's not on the struct
		//res.err = errors.New("Invalid redirect status code")
	} else {
		res.SetHeader(HeaderLocation, url)
		res.SetStatus(status)
	}
}

// SetHeader will set a APIGatewayProxyResponse header replacing any existing value.
func (res *APIGatewayProxyResponse) SetHeader(key string, value string) {
	if res.Headers == nil {
		res.Headers = make(map[string]string)
	}
	res.Headers[key] = value
}

// SetStatus will set the status code for the response.
func (res *APIGatewayProxyResponse) SetStatus(status int) {
	res.StatusCode = status
}

// SetBodyError will set an error response body based on header content type (plain text if no content type set)
// This function defines what the body format will be. One can choose to not use this helper function to return custom errors.
func (res *APIGatewayProxyResponse) SetBodyError(e error) {
	switch res.GetHeader(HeaderContentType) {
	case MIMEApplicationJSON, MIMEApplicationJSONCharsetUTF8:
		data, err := json.Marshal(map[string]string{"error": e.Error()})
		if err == nil {
			res.Body = string(data)
		}
	case MIMEApplicationXML, MIMEApplicationXMLCharsetUTF8:
		type xmlError struct {
			XMLName xml.Name `xml:"error"`
			Message string   `xml:"message"`
		}
		data, err := xml.MarshalIndent(xmlError{
			Message: e.Error(),
		}, "  ", "    ")
		if err == nil {
			var buffer bytes.Buffer
			buffer.WriteString(xml.Header)
			buffer.WriteString("\n")
			buffer.WriteString(string(data))
			res.Body = buffer.String()
			buffer.Reset()
		}
	case MIMETextHTML, MIMETextHTMLCharsetUTF8:
		var buffer bytes.Buffer
		buffer.WriteString("
Error
")
		buffer.WriteString("
Status Code: ")
		buffer.WriteString(strconv.Itoa(res.StatusCode))
		buffer.WriteString("
Error: ")
		buffer.WriteString(e.Error())
		buffer.WriteString("
")
		res.Body = buffer.String()
		buffer.Reset()
	default:
		res.Body = e.Error()
	}
}

// TODO: add more response helpers like echo
// File? Attachment?

// GetHeader will return the value for a given header key (case insensitive).
// If there are no values associated with the key, GetHeader returns "".
func (req *APIGatewayProxyRequest) GetHeader(key string) string {
	value := ""
	for k, v := range req.Headers {
		if strings.ToLower(key) == strings.ToLower(k) {
			value = v
		}
	}
	return value
}

// GetHeader will return the value for a given response header key (case insensitive).
// Works the same as GetHeader() for request.
func (res *APIGatewayProxyResponse) GetHeader(key string) string {
	value := ""
	for k, v := range res.Headers {
		if strings.ToLower(key) == strings.ToLower(k) {
			value = v
		}
	}
	return value
}

// IP returns the visitor's IP address from the request event struct.
func (req *APIGatewayProxyRequest) IP() string {
	return req.RequestContext.Identity.SourceIP
}

// UserAgent returns the visitor's browser agent.
func (req *APIGatewayProxyRequest) UserAgent() string {
	return req.RequestContext.Identity.UserAgent
}

// GetParam returns a querystring parameter given its key name or empty string if not set.
func (req *APIGatewayProxyRequest) GetParam(key string) string {
	param := ""
	if val, ok := req.QueryStringParameters[key]; ok {
		param = val
	}
	return param
}

// GetForm will return a Form struct from a form-data body if passed in the request event.
func (req *APIGatewayProxyRequest) GetForm() (map[string]interface{}, error) {
	formData := map[string]interface{}{}
	mediaType, params, err := mime.ParseMediaType(req.GetHeader(HeaderContentType))
	if err == nil {
		if strings.HasPrefix(mediaType, "multipart/") {
			body := strings.NewReader(req.Body)
			mr := multipart.NewReader(body, params["boundary"])
			for {
				p, readerErr := mr.NextPart()
				if readerErr == io.EOF {
					return formData, nil
				}
				if readerErr != nil {
					return formData, readerErr
				}
				b, readPartsErr := ioutil.ReadAll(p)
				// Not bothering with the error here, it shouldn't really ever occur
				// if it were to, I think it'd be a buffer overflow...but that couldn't
				// happen because AWS Lambda has a POST limit that's far below that.
				// Other read errors would have already been seen by this point (above).
				if readPartsErr == nil {
					formData[p.FormName()] = string(b)
				}
			}
		}
	}

	return formData, err
}

// GetBody will return the request body if passed in the event. It's base64 encoded.
func (req *APIGatewayProxyRequest) GetBody() (string, error) {
	s := ""
	b, err := base64.StdEncoding.DecodeString(req.Body)
	if err == nil {
		s = string(b[:])
	}
	return s, err
}

// GetJSONBody will return the request body as map if passed in the event as a JSON string (which would be base64 encoded).
func (req *APIGatewayProxyRequest) GetJSONBody() (map[string]interface{}, error) {
	var m map[string]interface{}
	b, err := base64.StdEncoding.DecodeString(req.Body)
	if err == nil {
		err = json.Unmarshal([]byte(b), &m)
	}
	return m, err
}

// getHTTPRequestWithCookies will return a new *http.Request (fake) with cookies, exposing functions for getting cookies.
func (req *APIGatewayProxyRequest) getHTTPRequestWithCookies() (*http.Request, error) {
	// log.Println("Cookie header:", req.GetHeader("Cookie"))
	return http.ReadRequest(bufio.NewReader(strings.NewReader(fmt.Sprintf("GET / HTTP/1.0\r\nCookie: %s\r\n\r\n", req.GetHeader("Cookie")))))
}

// Cookie will get a cookie from the APIGatewayProxyRequest by parsing the header using Go's http package.
func (req *APIGatewayProxyRequest) Cookie(name string) (*http.Cookie, error) {
	fakeReq, err := req.getHTTPRequestWithCookies()
	// log.Println("fake request:", fakeReq)
	if err != nil {
		return nil, err
	}
	return fakeReq.Cookie(name)
}

// Cookies will get all cookies from the APIGatewayProxyRequest by parsing the header using Go's http package.
func (req *APIGatewayProxyRequest) Cookies() ([]*http.Cookie, error) {
	fakeReq, err := req.getHTTPRequestWithCookies()
	if err != nil {
		return nil, err
	}
	return fakeReq.Cookies(), nil
}


text:
int main( int argc, char* argv[] )
{
	Daemon.init(argc, argv);
	if (Daemon.start())
	{
		while (Daemon.running)
		{
			//TODO Meeh: Find something better to do here.
			std::this_thread::sleep_for (std::chrono::seconds(1));
		}
	}
	Daemon.stop();
	return EXIT_SUCCESS;
}


text:
package com.cezarykluczynski.stapi.etl.weapon.creation.processor;

import com.cezarykluczynski.stapi.sources.mediawiki.dto.PageHeader;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.item.support.ListItemReader;

import java.util.List;

@Slf4j
public class WeaponReader extends ListItemReader<PageHeader> {

	public WeaponReader(List<PageHeader> list) {
		super(list);
		log.info("Initial size of weapon list: {}", list.size());
	}

}


text:
// create KMenu class
function KMenu(options) {
	this.init(options);
}
_extend(KMenu, KWidget, {
	init : function(options) {
		var self = this;
		options.z = options.z || 811213;
		KMenu.parent.init.call(self, options);
		self.centerLineMode = _undef(options.centerLineMode, true);
		self.div.addClass('ke-menu').bind('click,mousedown', function(e){
			e.stopPropagation();
		}).attr('unselectable', 'on');
	},
	addItem : function(item) {
		var self = this;
		if (item.title === '-') {
			self.div.append(K('

'));
			return;
		}
		var itemDiv = K('

'),
			leftDiv = K('

'),
			rightDiv = K('

'),
			height = _addUnit(item.height),
			iconClass = _undef(item.iconClass, '');
		self.div.append(itemDiv);
		if (height) {
			itemDiv.css('height', height);
			rightDiv.css('line-height', height);
		}
		var centerDiv;
		if (self.centerLineMode) {
			centerDiv = K('

');
			if (height) {
				centerDiv.css('height', height);
			}
		}
		itemDiv.mouseover(function(e) {
			K(this).addClass('ke-menu-item-on');
			if (centerDiv) {
				centerDiv.addClass('ke-menu-item-center-on');
			}
		})
		.mouseout(function(e) {
			K(this).removeClass('ke-menu-item-on');
			if (centerDiv) {
				centerDiv.removeClass('ke-menu-item-center-on');
			}
		})
		.click(function(e) {
			item.click.call(K(this));
			e.stopPropagation();
		})
		.append(leftDiv);
		if (centerDiv) {
			itemDiv.append(centerDiv);
		}
		itemDiv.append(rightDiv);
		if (item.checked) {
			iconClass = 'ke-icon-checked';
		}
		if (iconClass !== '') {
			leftDiv.html('');
		}
		rightDiv.html(item.title);
		return self;
	},
	remove : function() {
		var self = this;
		if (self.options.beforeRemove) {
			self.options.beforeRemove.call(self);
		}
		K('.ke-menu-item', self.div[0]).unbind();
		KMenu.parent.remove.call(self);
		return self;
	}
});

function _menu(options) {
	return new KMenu(options);
}

K.MenuClass = KMenu;
K.menu = _menu;


text:
* [Practice](#practice-problems)
  * [Language specific](#language-specific)
  * [Problem lists and contest archives](#problem-lists-and-contest-archives)
  * [Online judges or automatic assessment](#online-judges-or-automatic-assessment)
  * [Communities and Blogs](#communities-and-blogs)
  * [Game sites and ongoing contests](game-sites-and-ongoing-contests)
  * [Books](#books)
  * [Security oriented](#security-oriented)

## Practice problems
While nested under language category some of the projects/problems are in fact language independent so feel to take a look at all of these links. Furthermore most of the links in other categories will have solutions available in some popular programming language (usually Python, Java, JavaScript or C++). You can use this fact to your advantage and learn how things work in other languages by comparing your solutions with provided ones.

### Language specific

#### Python
* [CheckiO](https://checkio.org/) — Python programming challenges. Custom "Missions" can be created by members.
* [Python Challenge](http://www.pythonchallenge.com/) — "Python Challenge is a game in which each level can be solved by a bit of (Python) programming."
* [Intermediate Python Workshop/Projects](http://wiki.openhatch.org/Intermediate_Python_Workshop/Projects) — Practice solving problems in Python from scratch. These projects will guide you through breaking down the problem into steps and help you check your work along the way.

#### C
* [IOCCC](http://www.ioccc.org/) —  "A contest to write the most obscure/obfuscated C program. (Fun to try to understand the previous year's entries, or to submit a new one.)"

* [Underhanded C Contest](http://www.underhanded-c.org/) —  "contest to turn out code that is malicious, but passes a rigorous inspection, and looks like an honest mistake. (Try to understand previous year's entries, and learn to find similar mistakes in other people's code)"

#### C\++
* [programmr](http://www.programmr.com/zone/cpp) — C++ Projects, Challenges & Examples

#### Clojure
* [4Clojure](http://www.4clojure.com/) — "4Clojure is a resource to help fledgling clojurians learn the language through interactive problems. The first few problems are easy enough that even someone with no prior experience should find the learning curve forgiving. See 'Help' for more information."

#### Ruby
* [Ruby Quiz](http://rubyquiz.com/) — "Ruby Quiz is a weekly programming challenge for Ruby programmers in the spirit of the Perl Quiz of the Week. A new Ruby Quiz is sent to the Ruby Talk mailing list each Friday."

#### Prolog
* [Prolog Problems](https://sites.google.com/site/prologsite/prolog-problems) — "The purpose of this problem collection is to give you the opportunity to practice your skills in logic programming. Your goal should be to find the most elegant solution of the given problems. Efficiency is important, but logical clarity is even more crucial. Some of the (easy) problems can be trivially solved using built-in predicates. However, in these cases, you learn more if you try to find your own solution."

#### Perl
* [Perl Quiz](https://perl.plover.com/qotw/#archives) — Every Wednesday I send out a Perl quiz, usually a request to write a program or function to perform a certain task.

### Problem lists and contest archives

### Online judges or automatic assessment

### Communities and Blogs

### Game sites and ongoing contests

### Books
* [Algorithms for Interviews](https://www.amazon.com/dp/1453792996/?tag=stackoverflow17-20) — by Adnan Aziz
* [Cracking the Coding Interview (6th Edition)](https://www.amazon.com/dp/0984782850/?tag=stackoverflow17-20) — by Gayle Laakmann
* [Programming Challenges](https://www.amazon.com/dp/0387001638/?tag=stackoverflow17-20) — by Steven S. Skiena
* [The Art of Computer Programming](https://www.amazon.com/dp/0321751043/?tag=stackoverflow17-20) — by Donald E. Knuth

### Security oriented
* [Smashthestack](http://smashthestack.org/)
* [Bright shadows](http://bright-shadows.net/) — various challenges, security and programming themed.

---
* [Project Based Learning](https://github.com/tuvtran/project-based-learning#python) — A list of programming tutorials in which learners build an application from scratch. These tutorials are divided into different primary programming languages. Some have intermix technologies and languages.
* [programmr.com projects](http://www.programmr.com/drigg_home) | [programmr.com user submitted projects](http://www.programmr.com/drigg_home) — Huge collection of project ideas.

* [LeetCode problem sets](https://leetcode.com/problemset/all/) — Problems collection ranging from algorithms to system design
---
# Sites:
### c++
x http://www.programmr.com/zone/cpp
- https://github.com/kamyu104/LeetCode
- http://www.cppforschool.com/projects.html

### python:
#### flask
- http://charlesleifer.com/blog/dont-sweat-small-stuff-use-flask-blueprints/
- https://github.com/Jahaja/psdash
- https://gist.github.com/coleifer/632d3c9aa6b2ea519384

#### other
- http://mattscodecave.com/posts/simple-python-framework-from-scratch.html
- http://codingbat.com/python
- https://github.com/kamyu104/LeetCode
- https://github.com/gregmalcolm/python_koans
- http://rosalind.info/problems/locations/
- http://pythonpracticeprojects.com/
- http://inventwithpython.com/blog/2012/02/20/i-need-practice-programming-49-ideas-for-game-clones-to-code/
- https://knightlab.northwestern.edu/2014/06/05/five-mini-programming-projects-for-the-python-beginner/
- http://www.practicepython.org/
- https://github.com/zhiwehu/Python-programming-exercises/blob/master/100%2B%20Python%20challenging%20programming%20exercises.txt
- http://www.openbookproject.net/pybiblio/practice/wilson/
- http://www.openbookproject.net/pybiblio/practice/elkner/
- http://www.openbookproject.net/pybiblio/practice/schellenberg/
- https://nedbatchelder.com/code/utilities/
x https://github.com/tuvtran/project-based-learning#python
x https://checkio.org/
x http://wiki.openhatch.org/Intermediate_Python_Workshop/Projects

### lua
- http://www.codebymath.com/index.php/welcome/challenges

### other / lang independent / unsorted
- https://codefights.com/challenges
- https://projecteuler.net/archives
- https://github.com/karan/Projects
- http://aosabook.org/en/index.html
- http://www.codeabbey.com/
- http://nifty.stanford.edu/
- http://www.dreamincode.net/forums/topic/78802-martyr2s-mega-project-ideas-list/
- https://github.com/collections
- http://rosettacode.org/wiki/Category:Programming_Tasks
- https://programmingpraxis.com/
- http://codekata.com/
- https://www.codewars.com/
- http://exercism.io/
- https://www.hackerrank.com/
- https://www.interviewcake.com/
- https://github.com/gamontal/awesome-katas
- https://www.ideserve.co.in/#all
- http://lintcode.com/

------

### Programming languages
- [brainfuck](lang/bf/readme.md)

### VMs, emulators and simulators
- [Blog: Stack based vs Register based Virtual Machine Architecture](https://markfaction.wordpress.com/2012/07/15/stack-based-vs-register-based-virtual-machine-architecture-and-the-dalvik-vm/)
- [Blog: Virtual Machines For Abstraction: The Dalvik VM](http://opensourceforu.com/2011/06/virtual-machines-for-abstraction-dalvik-vm/)
- [Wikipedia: stack machine](https://en.wikipedia.org/wiki/Stack_machine#Virtual_stack_machines)
- [Paper: Stack Versus Registers](https://www.usenix.org/legacy/events/vee05/full_papers/p153-yunhe.pdf)
- [StackOverflow: How do emulators work and how are they written](https://stackoverflow.com/questions/448673/how-do-emulators-work-and-how-are-they-written)
- [NES emulator development guide](http://nesdev.com/NES%20emulator%20development%20guide.txt)

## list of projects
### VM's
- [nanoVM - extremely small and simple Virtual Machine](vm/nanoVM/readme.md)
- [microVM - small and simple Virtual Machine](vm/microVM/readme.md)

### hardware emulation
- [nanoCPU - tiny CPU prototype emulator](hdw/nanoCPU/readme.md)
- [4001 - Virtual CPU in C++](hdw/4001/readme.md)
- [6502 ?](?)

### Programming languages
- [brainfuck](lang/bf/readme.md)

## references
### VMs, emulators and simulators
- [Blog: Stack based vs Register based Virtual Machine Architecture](https://markfaction.wordpress.com/2012/07/15/stack-based-vs-register-based-virtual-machine-architecture-and-the-dalvik-vm/)
- [Blog: Virtual Machines For Abstraction: The Dalvik VM](http://opensourceforu.com/2011/06/virtual-machines-for-abstraction-dalvik-vm/)
- [Wikipedia: stack machine](https://en.wikipedia.org/wiki/Stack_machine#Virtual_stack_machines)
- [Paper: Stack Versus Registers](https://www.usenix.org/legacy/events/vee05/full_papers/p153-yunhe.pdf)
- [StackOverflow: How do emulators work and how are they written](https://stackoverflow.com/questions/448673/how-do-emulators-work-and-how-are-they-written)
- [NES emulator development guide](http://nesdev.com/NES%20emulator%20development%20guide.txt)

### 6502 processor
- [obelisk.demon.co.uk/6502](https://web.archive.org/web/20150607180215/http://www.obelisk.demon.co.uk:80/6502/)
- [http://6502.org/](http://6502.org/)
- [Wikipedia: MOS Technology 6502](https://en.wikipedia.org/wiki/MOS_Technology_6502)
- [6502 assembly tutorial](https://skilldrick.github.io/easy6502/)
- [NMOS 6502 Opcodes](http://www.6502.org/tutorials/6502opcodes.html)
- [6502 Instruction reference](http://www.obelisk.me.uk/6502/reference.html)
- [Instruction set](http://www.masswerk.at/6502/6502_instruction_set.html)
- [Visual Transistor-level Simulation of the 6502 CPU](http://visual6502.org/)

### atari 2600
- [Wikipedia: atari 2600](https://en.wikipedia.org/wiki/Atari_2600)

## 4001 - Virtual CPU in C++
Quick navigation:
- [Intro](#intro)
- [CPU](#cpu)
- [References](#references)

### Intro
Why? I love the idea of working on lower level applications
e.g. compilers, interpreters, parsers, virtual machines, etc.
So I decided to learn how to implement simple CPU/write VM as
a way to introduce myself into the general realm of lower
level programming! The 4001 is very simplistic processor, as
it can only perform addition, and contains just four independent
NOR gates, each with two inputs.

### Cpu

### references
http://www.cpu-zone.com/4001.htm
https://en.wikibooks.org/w/index.php?title=Practical_Electronics/IC/4001&oldid=3262973


text:
ACCEPTED

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

#### Published in
Stud. Mycol. 9: 11 (1975)

#### Original name
Sphaeria puccinioides DC., 1815

### Remarks
null