text:
<TITLE>Use of general datatypes in communication</TITLE>

3.12.5. Use of general datatypes in communication

Up:  Derived datatypes
Next:  Correct use of addresses
Previous:  Commit and free

Handles to derived datatypes can be passed to a communication call wherever a
datatype argument is required.
A call of the form  MPI_SEND(buf, count, datatype , ...), where

, is interpreted as if the call was passed a new datatype
which is the
concatenation of  count copies of  datatype.
Thus,
 MPI_SEND(buf, count, datatype, dest, tag, comm) is equivalent to,

<tt>MPI_TYPE_CONTIGUOUS(count, datatype, newtype)
MPI_TYPE_COMMIT(newtype)
MPI_SEND(buf, 1, newtype, dest, tag, comm).
</tt>

Similar statements apply to all other communication functions that have a
 count and  datatype argument.

Suppose that a send operation  MPI_SEND(buf, count,
datatype, dest, tag, comm) is executed, where
 datatype has type map,

and extent extent.  (Empty entries of ``pseudo-type''
MPI_UB and   MPI_LB are not listed in the type map, but
they affect the value of extent.)
The send
operation sends
 entries, where entry
 is at location

and has type typej,
for
 and j = 0 ,..., n-1.
These entries need not be contiguous, nor distinct; their order can be
arbitrary.

The variable stored at address addri,j in the calling program
should be of a type that matches typej, where
type matching is defined as in section Type matching rules
.
The message sent contains
 entries, where entry

 has type typej.

Similarly, suppose that a receive operation
 MPI_RECV(buf, count, datatype, source, tag, comm, status) is
executed, where  datatype has type map,

with extent extent.  (Again, empty entries of ``pseudo-type''
MPI_UB and   MPI_LB are not listed in the type map, but
they affect the value of extent.)
This receive operation receives

 entries, where entry
 is at location

and has type typej.  If the incoming message consists of k
elements, then we must have
; the
-th element of the message should have a type that matches typej.

Type matching is defined according to the type signature of
the corresponding datatypes, that is, the sequence of basic type
components.  Type matching does not depend on some aspects of the
datatype definition, such as the displacements (layout in memory) or the
intermediate types used.

 Example

This example shows that type matching is defined in terms of
the basic types that a derived type consists of.

<tt>...
CALL MPI_TYPE_CONTIGUOUS( 2, MPI_REAL, type2, ...)
CALL MPI_TYPE_CONTIGUOUS( 4, MPI_REAL, type4, ...)
CALL MPI_TYPE_CONTIGUOUS( 2, type2, type22, ...)
...
CALL MPI_SEND( a, 4, MPI_REAL, ...)
CALL MPI_SEND( a, 2, type2, ...)
CALL MPI_SEND( a, 1, type22, ...)
CALL MPI_SEND( a, 1, type4, ...)
...
CALL MPI_RECV( a, 4, MPI_REAL, ...)
CALL MPI_RECV( a, 2, type2, ...)
CALL MPI_RECV( a, 1, type22, ...)
CALL MPI_RECV( a, 1, type4, ...)
</tt>

Each of the sends matches any of the receives.

A datatype may specify overlapping entries. The use of such a
datatype in a receive operation is erroneous. (This is erroneous even
if the actual message received is short enough not to write any entry
more than once.)

A datatype may specify overlapping entries.  If such a datatype is used
in a receive operation, that is, if some part of the receive buffer
is written more than once by the receive operation, then the
call is erroneous.

Suppose that
 MPI_RECV(buf, count, datatype, dest, tag, comm, status) is
executed, where  datatype has type map,

The received message need not fill all the receive buffer, nor does it
need to fill a number of locations which is a multiple of n.
Any number, k, of basic
elements can be received, where
.
The number of basic elements received can be retrieved from
 status using the query function  MPI_GET_ELEMENTS.

     MPI_GET_ELEMENTS( status, datatype, count)

[  IN   status] return status of receive operation (Status)

[  IN   datatype] datatype used by receive operation (handle)

[  OUT   count] number of received basic elements (integer)

 <tt> int MPI_Get_elements(MPI_Status *status, MPI_Datatype datatype, int *count)
</tt>

 <tt> MPI_GET_ELEMENTS(STATUS, DATATYPE, COUNT, IERROR)
 INTEGER  STATUS(MPI_STATUS_SIZE), DATATYPE, COUNT, IERROR
</tt>

The previously defined
function,  MPI_GET_COUNT (Sec. Return status
), has
a different behavior.

It returns the number of ``top-level
entries'' received, i.e. the number of ``copies'' of type
 datatype.

In the previous example,  MPI_GET_COUNT
may return any integer value k, where
.
If  MPI_GET_COUNT returns k, then the number of basic
elements received (and the value returned by

 MPI_GET_ELEMENTS)
is
.   If the number of basic elements received is not a
multiple of n, that is, if the receive operation has not received an
integral number of  datatype ``copies,'' then
 MPI_GET_COUNT returns the value  MPI_UNDEFINED.

 Example

Usage of  MPI_GET_COUNT and  MPI_GET_ELEMENT.

<tt>...
CALL MPI_TYPE_CONTIGUOUS(2, MPI_REAL, Type2, ierr)
CALL MPI_TYPE_COMMIT(Type2, ierr)
...
CALL MPI_COMM_RANK(comm, rank, ierr)
IF(rank.EQ.0) THEN
      CALL MPI_SEND(a, 2, MPI_REAL, 1, 0, comm, ierr)
      CALL MPI_SEND(a, 3, MPI_REAL, 1, 0, comm, ierr)
ELSE
      CALL MPI_RECV(a, 2, Type2, 0, 0, comm, stat, ierr)
      CALL MPI_GET_COUNT(stat, Type2, i, ierr)     ! returns i=1
      CALL MPI_GET_ELEMENTS(stat, Type2, i, ierr)  ! returns i=2
      CALL MPI_RECV(a, 2, Type2, 0, 0, comm, stat, ierr)
      CALL MPI_GET_COUNT(stat, Type2, i, ierr)     ! returns i=MPI_UNDEFINED
      CALL MPI_GET_ELEMENTS(stat, Type2, i, ierr)  ! returns i=3
END IF
</tt>

The function  MPI_GET_ELEMENTS can also be used after a probe
to find the number of elements in the probed message.
Note that the two functions  MPI_GET_COUNT and
 MPI_GET_ELEMENTS return the same values when they are used
with basic datatypes.

[] Rationale.

The extension given to the definition of  MPI_GET_COUNT seems
natural: one would expect this function to return the value of the
 count argument, when the receive buffer is filled.
Sometimes  datatype represents
a basic unit of data one wants to transfer,
for example, a record in an array of records (structures).
One should be able to find out how many components were received
without bothering to divide by the number of elements in each
component.   However, on other occasions,  datatype is used to
define a complex layout of data in the receiver memory, and does not represent
a basic unit of data for transfers.  In such cases, one needs to use
the function  MPI_GET_ELEMENTS.
 ( End of rationale.)

[] Advice
 to implementors.

The definition implies that a receive cannot change the value of
storage outside the entries defined to compose the communication
buffer.
In particular, the definition implies that padding space in a structure
should not be modified when such a structure is copied from one process to
another. This would
prevent the obvious optimization of copying the structure, together
with the padding, as one contiguous block.
The implementation is free to do this optimization when it does not
impact the outcome of the computation.
The user can ``force'' this optimization by explicitly including
padding as part of the message.
 ( End of advice to implementors.)

Up:  Derived datatypes
Next:  Correct use of addresses
Previous:  Commit and free

Return to MPI 1.1 Standard Index

Return to MPI-2 Standard Index

Return to MPI Forum Home Page

MPI-1.1 of June 12, 1995

HTML Generated on August 6, 1997


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>App Engine Python SDK: google.appengine._internal.django.template.Variable Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="common.css" rel="stylesheet" type="text/css"/>

App Engine Python SDK
    v1.6.9 rev.445

The Python runtime is available as an experimental Preview feature.

google

appengine

_internal

django

template

Variable

Public Member Functions |
Public Attributes |
List of all members

google.appengine._internal.django.template.Variable Class Reference

Inheritance diagram for google.appengine._internal.django.template.Variable:

  <map id="google.appengine._internal.django.template.Variable_map" name="google.appengine._internal.django.template.Variable_map">
</map>

Public Member Functions

def 	__init__

def 	resolve

def 	__repr__

def 	__str__

Public Attributes

 	var

 	literal

 	lookups

 	translate

Member Function Documentation

          def google.appengine._internal.django.template.Variable.resolve
          (

          self,

          context

          )

Resolve this variable against a given context.

The documentation for this class was generated from the following file:

code/googleappengine-read-only/python/google/appengine/_internal/django/template/__init__.py

<address class="footer">
    Maintained by tzmartin
</address>

redpajama_set_name: RedPajamaGithub


text:
package org.gradle.integtests.fixtures.timeout;

import org.spockframework.runtime.extension.ExtensionAnnotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

/**
 * Indicates that the execution of a method should time out
 * after the given duration has elapsed. The default time unit is seconds.
 *
 * This annotation can be used in similar way with {@link spock.lang.Timeout}, but shouldn't
 * be used together with {@link spock.lang.Timeout}. It should be annotated on
 * {@link org.gradle.integtests.fixtures.AbstractIntegrationSpec}. Upon timeout,
 * all threads' stack traces of current JVM (embedded executer) or forked JVM (forking executer)
 * are printed to help us debug deadlock issues.
 */

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@ExtensionAnnotation(IntegrationTestTimeoutExtension.class)
public @interface IntegrationTestTimeout {
    int DEFAULT_TIMEOUT_SECONDS = 600;
    /**
     * Returns the duration after which the execution of the annotated feature or fixture
     * method times out.
     *
     * @return the duration after which the execution of the annotated feature or
     * fixture method times out
     */
    int value();

    /**
     * Returns the duration's time unit.
     *
     * @return the duration's time unit
     */
    TimeUnit unit() default TimeUnit.SECONDS;
}


text:
var resultDiv = document.querySelector('div#result');

function showMessage(message) {
  resultDiv.innerHTML += '<br/>' + message;
  resultDiv.scrollTop = resultDiv.scrollHeight;
}

function handleResponseAsync(response) {
  return Promise.resolve()
    .then(function () {
      if (response.ok) {
        response.json()
          .then(function (json) {
            showMessage(JSON.stringify(json, null, 2))
          });
      } else {
        showMessage('Network error');
      }
    })
}
function openSession() {
  fetch('/session', {credentials: 'same-origin'})
    .then(function (response) {
      handleResponseAsync(response)
    });
}
function closeSession() {
  fetch('/session', {method: 'DELETE', credentials: 'same-origin'})
    .then(function (response) {
      handleResponseAsync(response)
    });
}
function connectToWs() {
  var hostname = window.location.hostname;
  var port = window.location.port;
  var Socket = new WebSocket('ws://' + hostname + ':' + port);
  Socket.onerror = function () {
    showMessage('Error in web socket');
  };
  Socket.onopen = function () {
    showMessage('Web socket is opened');
  };
  Socket.onclose = function () {
    showMessage('Web socket is closed');
  }
}


text:
https://secure.meetup.com/meetup_api/console/?path=/2/events
http://www.meetup.com/meetup_api/console/?path=/:urlname/events/:id/attendance
213261022
Backbone-js-Hackers

http://www.meetup.com/meetup_api/console/?path=/2/rsvps
204708292


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.Communication.JobRouter
{
    public partial class RuleEngineQueueSelectorAttachment : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("rule");
            writer.WriteObjectValue(Rule);
            writer.WritePropertyName("kind");
            writer.WriteStringValue(Kind);
            writer.WriteEndObject();
        }

        internal static RuleEngineQueueSelectorAttachment DeserializeRuleEngineQueueSelectorAttachment(JsonElement element)
        {
            RouterRule rule = default;
            string kind = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("rule"))
                {
                    rule = RouterRule.DeserializeRouterRule(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
            }
            return new RuleEngineQueueSelectorAttachment(kind, rule);
        }
    }
}


text:
package com.ibm.test.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
    @RequestMapping("/")
    public String index() {
        return "Hello!";
    }
}


text:
export interface FeathersErrorJSON {
    readonly name: string;
    readonly message: string;
    readonly code: number;
    readonly className: string;
    readonly data: any;
    readonly errors: any;
}

export class FeathersError extends Error {
    readonly code: number;
    readonly className: string;
    readonly data: any;
    readonly errors: any;
    constructor(msg: string | Error, name: string, code: number, className: string, data: any);
    toJSON(): FeathersErrorJSON;
}

export class BadRequest extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class NotAuthenticated extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class PaymentError extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class Forbidden extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class NotFound extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class MethodNotAllowed extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class NotAcceptable extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class Timeout extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class Conflict extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class LengthRequired extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class Unprocessable extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class TooManyRequests extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class GeneralError extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class NotImplemented extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class BadGateway extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export class Unavailable extends FeathersError {
    constructor(msg?: string | Error, data?: any);
}

export interface Errors {
    FeathersError: FeathersError;
    BadRequest: BadRequest;
    NotAuthenticated: NotAuthenticated;
    PaymentError: PaymentError;
    Forbidden: Forbidden;
    NotFound: NotFound;
    MethodNotAllowed: MethodNotAllowed;
    NotAcceptable: NotAcceptable;
    Timeout: Timeout;
    Conflict: Conflict;
    LengthRequired: LengthRequired;
    Unprocessable: Unprocessable;
    TooManyRequests: TooManyRequests;
    GeneralError: GeneralError;
    NotImplemented: NotImplemented;
    BadGateway: BadGateway;
    Unavailable: Unavailable;
}

export function convert(error: any): FeathersError;

export const types: Errors;
export const errors: Errors;


text: exports.GridCsvImport = require('./lib/gridcsvimport').GridCsvImport


text:
namespace Microsoft.Azure.CognitiveServices.Vision.Face
{
    using Microsoft.Rest;
    using Models;
    using System.Collections;
    using System.Collections.Generic;
    using System.IO;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// LargePersonGroupPerson operations.
    /// </summary>
    public partial interface ILargePersonGroupPerson
    {
        /// <summary>
        /// Create a new person in a specified large person group.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='name'>
        /// User defined name, maximum length is 128.
        /// </param>
        /// <param name='userData'>
        /// User specified data. Length should not exceed 16KB.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse<Person>> CreateWithHttpMessagesAsync(string largePersonGroupId, string name = default(string), string userData = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// List all persons in a large person group, and retrieve person
        /// information (including personId, name, userData and
        /// persistedFaceIds of registered faces of the person).
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='start'>
        /// Starting person id to return (used to list a range of persons).
        /// </param>
        /// <param name='top'>
        /// Number of persons to return starting with the person id indicated
        /// by the 'start' parameter.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse<IList<Person>>> ListWithHttpMessagesAsync(string largePersonGroupId, string start = default(string), int? top = default(int?), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Delete an existing person from a large person group. All stored
        /// person data, and face features in the person entry will be deleted.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse> DeleteWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Retrieve a person's information, including registered persisted
        /// faces, name and userData.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse<Person>> GetWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Update name or userData of a person.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='name'>
        /// User defined name, maximum length is 128.
        /// </param>
        /// <param name='userData'>
        /// User specified data. Length should not exceed 16KB.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse> UpdateWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, string name = default(string), string userData = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Delete a face from a person. Relative feature for the persisted
        /// face will also be deleted.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='persistedFaceId'>
        /// Id referencing a particular persistedFaceId of an existing face.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse> DeleteFaceWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, System.Guid persistedFaceId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Retrieve information about a persisted face (specified by
        /// persistedFaceId, personId and its belonging largePersonGroupId).
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='persistedFaceId'>
        /// Id referencing a particular persistedFaceId of an existing face.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse<PersistedFace>> GetFaceWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, System.Guid persistedFaceId, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Update a person persisted face's userData field.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='persistedFaceId'>
        /// Id referencing a particular persistedFaceId of an existing face.
        /// </param>
        /// <param name='userData'>
        /// User-provided data attached to the face. The size limit is 1KB.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse> UpdateFaceWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, System.Guid persistedFaceId, string userData = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Add a representative face to a person for identification. The input
        /// face is specified as an image with a targetFace rectangle.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='url'>
        /// Publicly reachable URL of an image
        /// </param>
        /// <param name='userData'>
        /// User-specified data about the face for any purpose. The maximum
        /// length is 1KB.
        /// </param>
        /// <param name='targetFace'>
        /// A face rectangle to specify the target face to be added to a person
        /// in the format of "targetFace=left,top,width,height". E.g.
        /// "targetFace=10,10,100,100". If there is more than one face in the
        /// image, targetFace is required to specify which face to add. No
        /// targetFace means there is only one face detected in the entire
        /// image.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse<PersistedFace>> AddFaceFromUrlWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, string url, string userData = default(string), IList<int> targetFace = default(IList<int>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
        /// <summary>
        /// Add a representative face to a person for identification. The input
        /// face is specified as an image with a targetFace rectangle.
        /// </summary>
        /// <param name='largePersonGroupId'>
        /// Id referencing a particular large person group.
        /// </param>
        /// <param name='personId'>
        /// Id referencing a particular person.
        /// </param>
        /// <param name='image'>
        /// An image stream.
        /// </param>
        /// <param name='userData'>
        /// User-specified data about the face for any purpose. The maximum
        /// length is 1KB.
        /// </param>
        /// <param name='targetFace'>
        /// A face rectangle to specify the target face to be added to a person
        /// in the format of "targetFace=left,top,width,height". E.g.
        /// "targetFace=10,10,100,100". If there is more than one face in the
        /// image, targetFace is required to specify which face to add. No
        /// targetFace means there is only one face detected in the entire
        /// image.
        /// </param>
        /// <param name='customHeaders'>
        /// The headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="APIErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        Task<HttpOperationResponse<PersistedFace>> AddFaceFromStreamWithHttpMessagesAsync(string largePersonGroupId, System.Guid personId, Stream image, string userData = default(string), IList<int> targetFace = default(IList<int>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
    }
}


text:
/**
 */
package COSEM.COSEMObjects;

import COSEM.InterfaceClasses.Data;

/**
 *
 * A representation of the model object 'IO Control Signals Manufacturer'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link COSEM.COSEMObjects.IOControlSignalsManufacturer#getValue Value}

 *

 *
 * @see COSEM.COSEMObjects.COSEMObjectsPackage#getIOControlSignalsManufacturer()
 * @model
 * @generated
 */
public interface IOControlSignalsManufacturer extends Data {
	/**
	 * Returns the value of the 'Value' attribute.
	 *
	 *

	 * If the meaning of the 'Value' attribute isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Value' attribute.
	 * @see #setValue(String)
	 * @see COSEM.COSEMObjects.COSEMObjectsPackage#getIOControlSignalsManufacturer_Value()
	 * @model
	 * @generated
	 */
	String getValue();

	/**
	 * Sets the value of the '{@link COSEM.COSEMObjects.IOControlSignalsManufacturer#getValue Value}' attribute.
	 *
	 *
	 * @param value the new value of the 'Value' attribute.
	 * @see #getValue()
	 * @generated
	 */
	void setValue(String value);

} // IOControlSignalsManufacturer


text:
class BaseApiController < ApplicationController
	before_filter :parse_request, :authenticate_user_from_token!

	def parse_request
		@json = JSON.parse(request.body.read)
	end

	private
	def authenticate_user_from_token!
		if !@json['access_token']
			render nothing: true, status: :unauthorized
		else
			@user = nil
			User.find_each{ |u| @user = u if Devise.secure_compare(u.access_token, @json['access_token']) }
			render nothing: true, status: :unauthorized if @user.nil?
		end
	end
end