text:
package de.hpi.bpmn2_0.model.event;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;

import de.hpi.bpmn2_0.transformation.Visitor;

/**
 *
Java class for tThrowEvent complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="tThrowEvent">
 *   <complexContent>
 *     <extension base="{http://www.omg.org/bpmn20}tEvent">
 *       <sequence>
 *         <element ref="{http://www.omg.org/bpmn20}dataInput" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.omg.org/bpmn20}dataInputAssociation" maxOccurs="unbounded" minOccurs="0"/>
 *         <element ref="{http://www.omg.org/bpmn20}inputSet" minOccurs="0"/>
 *         <element ref="{http://www.omg.org/bpmn20}eventDefinition" maxOccurs="unbounded" minOccurs="0"/>
 *         <element name="eventDefinitionRef" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "tThrowEvent", propOrder = {
//    "dataInput",
//    "dataInputAssociation",
//    "inputSet",
//    "eventDefinition",
//    "eventDefinitionRef"
})
@XmlSeeAlso({
    IntermediateThrowEvent.class,
    ImplicitThrowEvent.class,
    EndEvent.class
})
public abstract class ThrowEvent
    extends Event
{

	/* Constructors */

	public ThrowEvent() {}

	public ThrowEvent(ThrowEvent endEvent) {
		super(endEvent);
	}

//    protected List<DataInput> dataInput;
//    protected List<DataInputAssociation> dataInputAssociation;
//    protected TInputSet inputSet;
//    @XmlElementRef(name = "eventDefinition", namespace = "http://www.omg.org/bpmn20", type = JAXBElement.class)
//    protected List<JAXBElement<? extends EventDefinition>> eventDefinition;
//    protected List<QName> eventDefinitionRef;

	public void acceptVisitor(Visitor v){
		v.visitThrowEvent(this);
	}

    /**
     * Gets the value of the dataInput property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the dataInput property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getDataInput().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link DataInput }
     *
     *
     */
//    public List<DataInput> getDataInput() {
//        if (dataInput == null) {
//            dataInput = new ArrayList<DataInput>();
//        }
//        return this.dataInput;
//    }

    /**
     * Gets the value of the dataInputAssociation property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the dataInputAssociation property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getDataInputAssociation().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link DataInputAssociation }
     *
     *
     */
//    public List<DataInputAssociation> getDataInputAssociation() {
//        if (dataInputAssociation == null) {
//            dataInputAssociation = new ArrayList<DataInputAssociation>();
//        }
//        return this.dataInputAssociation;
//    }

    /**
     * Gets the value of the inputSet property.
     *
     * @return
     *     possible object is
     *     {@link TInputSet }
     *
     */
//    public TInputSet getInputSet() {
//        return inputSet;
//    }

    /**
     * Sets the value of the inputSet property.
     *
     * @param value
     *     allowed object is
     *     {@link TInputSet }
     *
     */
//    public void setInputSet(TInputSet value) {
//        this.inputSet = value;
//    }

    /**
     * Gets the value of the eventDefinition property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the eventDefinition property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getEventDefinition().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link JAXBElement }{@code <}{@link CompensateEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TMessageEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TErrorEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TTimerEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link EventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TConditionalEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TLinkEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TCancelEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TEscalationEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TSignalEventDefinition }{@code >}
     * {@link JAXBElement }{@code <}{@link TTerminateEventDefinition }{@code >}
     *
     *
     */
//    public List<JAXBElement<? extends EventDefinition>> getEventDefinition() {
//        if (eventDefinition == null) {
//            eventDefinition = new ArrayList<JAXBElement<? extends EventDefinition>>();
//        }
//        return this.eventDefinition;
//    }

    /**
     * Gets the value of the eventDefinitionRef property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the eventDefinitionRef property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getEventDefinitionRef().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link QName }
     *
     *
     */
//    public List<QName> getEventDefinitionRef() {
//        if (eventDefinitionRef == null) {
//            eventDefinitionRef = new ArrayList<QName>();
//        }
//        return this.eventDefinitionRef;
//    }

}


text:
import unittest

from mailem import Message, Attachment, ImageAttachment

from future.utils import PY2

class MessageTest(unittest.TestCase):
    def test_html(self):
        msg = Message(
            ['kolypto@gmail.com'],
            u"Mail'em test °C",
            u"yeah baby, it works!",
            attachments=[
                Attachment(u'test.txt', 'abc')
            ],
            sender=('a@b', 'A'),
            cc=[('a@b', 'A'), 'b@b'],
            bcc=[('a@b', 'A'), 'b@b'],
            reply_to='z@b',
            headers={'Custom': 'Test'}
        )
        msg_str = str(msg)

        self.assertIn('multipart/mixed', msg_str)
        self.assertNotIn('multipart/alternative', msg_str)
        self.assertIn('text/html', msg_str)
        self.assertNotIn('text/plain', msg_str)

        self.assertIn('application/octet-stream', msg_str)
        self.assertIn('Content-Disposition: attachment; filename="test.txt"', msg_str)

        self.assertIn('Subject: =?utf-8?q?Mail=27em_test_=C2=B0C?=', msg_str)
        self.assertIn('To: kolypto@gmail.com', msg_str)
        if PY2:
            self.assertIn('From: =?utf-8?q?A?= ', msg_str)
            self.assertIn('Cc: =?utf-8?q?A?= , b@b', msg_str)
            self.assertIn('Bcc: =?utf-8?q?A?= , b@b', msg_str)
        else:
            self.assertIn('From: A ', msg_str)
            self.assertIn('Cc: A , b@b', msg_str)
            self.assertIn('Bcc: A , b@b', msg_str)
        self.assertIn('Reply-To: z@b', msg_str)
        self.assertIn('Message-ID:', msg_str)
        self.assertIn('Custom: Test', msg_str)
        self.assertIn('', msg_str)

    def test_html_text(self):
        msg = Message(
            ['kolypto@gmail.com'],
            u"Mail'em test",
            u'Mailtest',
            u"yeah baby, it works!",
            attachments=[
                Attachment(u'test.txt', 'abc')
            ]
        )
        msg_str = str(msg)

        self.assertIn('multipart/mixed', msg_str)
        self.assertIn('multipart/alternative', msg_str)
        self.assertIn('text/html', msg_str)
        self.assertIn('text/plain', msg_str)

        self.assertIn('Content-Type: application/octet-stream', msg_str)
        self.assertIn('Content-Disposition: attachment; filename="test.txt"', msg_str)

    def test_html_image(self):
        msg = Message(
            ['kolypto@gmail.com'],
            u"Mail'em test with inline images",
            u"Cute: ",  # cid:<filename>
            attachments=[
                ImageAttachment('cute.jpg', b'\xff\xd8\xff\xe0\x00\x10JFIF', 'inline')
            ]
        )
        msg_str = str(msg)

        self.assertIn('multipart/mixed', msg_str)
        self.assertNotIn('multipart/alternative', msg_str)
        self.assertIn('text/html', msg_str)
        self.assertNotIn('text/plain', msg_str)

        self.assertIn('Content-Type: image/jpeg', msg_str)
        self.assertIn('Content-ID: <cute.jpg>', msg_str)
        if PY2:
            self.assertIn('Content-Disposition: inline; filename="=?utf-8?q?cute=2Ejpg?="', msg_str)
        else:
            self.assertIn('Content-Disposition: inline; filename="cute.jpg"', msg_str)

redpajama_set_name: RedPajamaGithub


text:
SE Calculator is a single page app designed to help University of Waterloo
Software Engineering students estimate their potential financial situation
during their university careers. Engineering students (and CS students, too)
often find themselves in a position to graduate with little to no debt - and
this tool is designed to help calculate how much debt or profit you'll leave
school with.

See it live at [http://petersobot.com/secalculator](http://petersobot.com/secalculator).

## Installation

    git clone git@github.com:psobot/secalculator

    #   If you use Pow for local dev servers, this
    #   will link up the project to secalculator.dev
    ln -s `pwd`/secalculator ~/.pow/secalculator

## Building & Developing

SE Calculator uses a [Gulp](http://gulpjs.com/)-based build system
and includes a Makefile for convenience. The resulting static HTML
is placed in `public/`. The frontend is an Angular.js app, with a
custom graphing directive to interface with D3.js.

    make # to build (downloads deps as required)
    make watch # to build every time you change a file

    bin/gulp build # if you feel like calling gulp yourself

    #   Gulp sub-tasks you can run manually if you want
    bin/gulp js
    bin/gulp styles
    bin/gulp haml

## Data

Data is generated based on a bunch of generator functions in `src/js/data.js`.
Modify functions in there to change the default values, add more presets,
change dropdown options or whatever you'd like.

## Legal Disclaimer

**This calculator is not a financial advisor.**

The information on this website is provided for education and informational
purposes only, without any express or implied warranty of any kind, including
warranties of accuracy, completeness, or fitness for any particular purpose.

## Technical Disclaimer

I wrote this late at night with little concern for best practises, instead
trying to get something out before Frosh Week was over so that the 2019 frosh
could use this tool. If you're reading the code, my apologies for its quality.

Having said that, please feel free to jump in and make changes! I'll gladly
review pull requests and fix issues.


text:
using namespace std;

namespace NLP {

  const string PREFACE_HEADER = "# this file was generated by the following command(s):";

  string
  read_preface(const string &uri, istream &in, ulong &nlines, bool mandatory){
    char c = in.peek();
    if(c != '#'){
      if(mandatory)
	throw NLP::IOException("the stream does not start with the mandatory preface", uri);
      return "";
    }

    string res;
    string line;
    while(getline(in, line)){
      ++nlines;
      if(line.length() == 0)
	break;

      if(line[0] != '#')
	throw NLP::IOException("uncommented line inside comment preface", uri);

      if(line.find(PREFACE_HEADER) == 0)
	continue;

      res += line;
      res += '\n';
    }

    return res;
  }

  string
  start_preface(int argc, char **argv){
    string res = PREFACE_HEADER;
    res += "\n#   ";
    res += argv[0];
    for(int i = 1; i < argc; ++i){
      res += ' ';
      res += argv[i];
    }
    res += '\n';
    return res;
  }

}


text:
import os
import platform
import onedrivesdk
from onedrivesdk.helpers import GetAuthCodeServer
from onedrivesdk.helpers.resource_discovery import ResourceDiscoveryRequest

class OneDriveEngine():

    client = None

    '''
    Ottiene una lista di stringhe che contiene tutte le cartelle che formano il percorso del parametro path.
    '''
    def get_path_components(self, path):
        return [x for x in os.path.normpath(path).split(os.path.sep) if x != ''] if path else []

    def get_basename(self, path):
        return os.path.basename(path).replace(os.path.sep, '')

    def get_common_path(self, path1, path2):
        common_path = ''
        path1_len = len(path1)
        path2_len = len(path2)
        for i in range(path1_len if path1_len >= path1_len else path2_len):
            if path1[i] == path2[i]:
                common_path = common_path + path1[i]
            else:
                break
        return common_path

    def get_diff_paths(self, path1, path2, root_path=''):
        if path1[-1] == os.path.sep:
            path1 = path1[:-1]
        if path2[-1] == os.path.sep:
            path2 = path2[:-1]
        path1 = path1.replace(root_path, '')
        path2 = path2.replace(root_path, '')
        common_path = self.get_common_path(path1, path2)
        path1 = path1.replace(common_path, '')
        path2 = path2.replace(common_path, '')
        path1_depth = len(self.get_path_components(path1))
        path2_depth = len(self.get_path_components(path2))
        if path1_depth == path2_depth:
            return (0, '', 0)
        elif path1_depth > path2_depth:
            path_diff = path1.replace(path2, '')
            return (1, path_diff, len(self.get_path_components(path_diff)))
        elif path2_depth > path1_depth:
            path_diff = path2.replace(path1, '')
            return (2, path_diff, len(self.get_path_components(path_diff)))

    '''
    Ottiene una lista di stringhe che contiene tutte le cartelle contenute nella cartella specificata nel parametro path.
    ATTENZIONE: La ricerca avviene su tutti i livelli, partendo dal livello più esterno specificato nel parametro path
    e proseguendo fino alla cartella più interna.
    '''
    def get_all_dirs(self, path):
        return [root for root, subdirs, files in os.walk(path)]

    '''
    Ottiene un oggetto di tipo cartella da OneDrive il cui id corrisponde all'id specificato nel parametro id.
    '''
    def get_object_by_id(self, id, drive='me'):
        return self.client.item(drive=drive, id=id)

    '''
    Ottiene l'oggetto di tipo cartella da OneDrive il cui id è root.
    '''
    def get_root_folder(self):
        return self.get_object_by_id('root')

    '''
    Ottiene un oggetto di tipo cartella da OneDrive dato il nome della cartella da trovare ed eventualmente
    un oggetto di tipo cartella da cui partire (nel caso non sia specificato sarà utilizzato l'oggetto root).
    ATTENZIONE: Questa funzione analizza solo un livello, che può essere il root o quello diversamente specificato
    dal parametro start_folder. Il parametro start_folder deve essere un oggetto di tipo cartella.
    '''
    def get_folder_by_name(self, name, start_folder=None):
        current_folder = start_folder if start_folder != None else self.get_root_folder()
        if current_folder.children != None:
            for item in current_folder.children.get():
                if item.folder != None and name == item.name:
                    return self.get_object_by_id(item.id)
        return None

    '''
    Ottiene un oggetto di tipo cartella da OneDrive dato il path della cartella da trovare ed eventualmente
    un oggetto di tipo cartella da cui partire (nel caso non sia specificato sarà utilizzato l'oggetto root).
    ATTENZIONE: Il dato ritornato non è un oggetto di tipo cartella, ma una tupla contente tre elementi:
    1) Valore booleano, se impostato a True significa che il secondo oggetto della tupla è l'oggetto di tipo
    cartella cercato, se invece è impostato a False significa che il secondo oggetto della tupla è il primo
    oggetto di tipo cartella di livello superiore a quello cercato.
    2) Oggetto, è l'oggetto di tipo cartella recuperato da OneDrive. Il suo significato dipende dal valore
    booleano del primo elemento della tupla.
    3) Lista di stringhe, è la sequenza di cartelle che NON sono state trovate, quindi non esistono su OneDrive.
    '''
    def get_folder_by_path(self, path, start_folder=None):
        current_folder = start_folder if start_folder != None else self.get_root_folder()
        path_components = self.get_path_components(path)
        while len(path_components) > 0:
            temp_folder = self.get_folder_by_name(path_components[0], current_folder)
            if temp_folder == None:
                return (False, current_folder, path_components)
            current_folder = temp_folder
            path_components.pop(0)
        return (True, current_folder, None)

    '''
    Crea un oggetto di tipo cartella il cui valore della proprietà name è quello specificato nel parametro name
    e lo inserisce tra gli oggetti figli dell'oggetto specificato nel parametro parent.
    Il dato ritornato è l'oggetto di tipo cartella appena inserito.
    '''
    def create_folder_by_name(self, name, parent=None, ignore_exists=True):
        parent = parent if parent != None else self.get_root_folder()
        if (not ignore_exists) and self.get_folder_by_name(name, parent) != None:
            raise Exception('Folder already exists and overwrite flag is set to false.')
        f = onedrivesdk.Folder()
        i = onedrivesdk.Item()
        i.name = name
        i.folder = f
        new_folder = parent.children.add(i)
        return self.get_object_by_id(new_folder.id)

    def create_folder_by_path(self, path, start_folder=None, ignore_exists=True):
        current_folder = start_folder if start_folder != None else self.get_root_folder()
        path_components = self.get_path_components(path)
        created = False
        for folder_name in path_components:
            current_folder_temp = self.get_folder_by_name(folder_name, current_folder) # creato allo scopo di non far eseguire il codice due volte nella prossima riga
            if folder_name == path_components[-1]:
                if current_folder_temp != None:
                    current_folder = current_folder_temp
                    created = False
                    if not ignore_exists:
                        raise Exception('Folder already exists and overwrite flag is set to false.')
                else:
                    current_folder = self.create_folder_by_name(folder_name, current_folder)
                    created = True
        return [created, current_folder]

    '''
    Crea l'intera struttura ad albero delle cartelle partendo dalla cartella specificata nel parametro dir_path all'interno
    della root o eventualmente all'interno dell'oggetto di tipo cartella specificato nel parametro start_folder.
    '''
    def create_folder_structure(self, dir_path, start_folder_path=None, ignore_exists=True):
        current_folder = self.get_folder_by_path(start_folder_path) if start_folder_path != None else self.get_root_folder()
        folders_cache = list()
        all_dirs = self.get_all_dirs(dir_path)
        current_folder_path = all_dirs[0]
        folder_name = self.get_basename(current_folder_path)
        current_folder = self.create_folder_by_name(folder_name, current_folder, ignore_exists)
        all_dirs = all_dirs[1:]
        for i in range(len(all_dirs)):
            folder_name = self.get_basename(all_dirs[i])
            self.create_folder_by_name(folder_name, current_folder, ignore_exists)
            if i < len(all_dirs)-1:
                path_diff = self.get_diff_paths(current_folder_path, all_dirs[i+1], dir_path)
                if path_diff[0] == 2 and path_diff[2] > 1:
                    current_folder_path = all_dirs[i]
                    folders_cache.append(current_folder)
                    current_folder = self.get_folder_by_name(folder_name, current_folder)
                elif path_diff[0] == 0:
                    current_folder_path = current_folder_path.replace(os.path.sep + self.get_path_components(current_folder_path)[-1], '')
                    current_folder = folders_cache[-1]
                    folders_cache = folders_cache[:-1]
                elif path_diff[0] == 1 and path_diff[2] > 1:
                    current_folder_path = current_folder_path.replace(path_diff[1], '')
                    current_folder = folders_cache[-path_diff[2]]
                    folders_cache = folders_cache[:-path_diff[2]]

    def login_business(self, redirect_uri, client_id, client_secret, discovery_uri, auth_server_url, auth_token_url):
        http = onedrivesdk.HttpProvider()
        auth = onedrivesdk.AuthProvider(http,
                                        client_id,
                                        auth_server_url=auth_server_url,
                                        auth_token_url=auth_token_url)
        auth_url = auth.get_auth_url(redirect_uri)
        code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri)
        auth.authenticate(code, redirect_uri, client_secret, resource=discovery_uri)
        services = ResourceDiscoveryRequest().get_service_info(auth.access_token)
        for service in services:
            if service.service_id == 'O365_SHAREPOINT':
                auth.redeem_refresh_token(service.service_resource_id)
                client = onedrivesdk.OneDriveClient(service.service_resource_id + '/_api/v2.0/', auth, http)
                self.client = client
                return True
        return False

    def login(self, redirect_uri, client_id, client_secret):
        scopes = ['wl.signin', 'wl.offline_access', 'onedrive.readwrite']
        client = onedrivesdk.get_default_client(client_id=client_id, scopes=scopes)
        auth_url = client.auth_provider.get_auth_url(redirect_uri)
        code = GetAuthCodeServer.get_auth_code(auth_url, redirect_uri)
        client.auth_provider.authenticate(code, redirect_uri, client_secret)
        self.client = client
        return True

    def upload_file(self, path):
        folders = self.get_folders_from_path(path)
        filename = os.path.basename(path)
        client.item(drive='me', id='root').children[file_info[1]].upload(file_info[0])


text:
extern "C" {

WEAK int halide_error_bounds_inference_call_failed(void *user_context, const char *extern_stage_name, int result) {
    error(user_context)
        << "Bounds inference call to external stage " << extern_stage_name
        << " returned non-zero value: " << result;
    return result;
}

WEAK int halide_error_extern_stage_failed(void *user_context, const char *extern_stage_name, int result) {
    error(user_context)
        << "Call to external stage " << extern_stage_name
        << " returned non-zero value: " << result;
    return result;
}

WEAK int halide_error_explicit_bounds_too_small(void *user_context, const char *func_name, const char *var_name,
                                                int min_bound, int max_bound, int min_required, int max_required) {
    error(user_context)
        << "Bounds given for " << var_name << " in " << func_name
        << " (from " << min_bound << " to " << max_bound
        << ") do not cover required region (from " << min_required
        << " to " << max_required << ")";
    return halide_error_code_explicit_bounds_too_small;
}

WEAK int halide_error_bad_elem_size(void *user_context, const char *func_name,
                                    const char *type_name, int elem_size_given, int correct_elem_size) {
    error(user_context)
        << func_name << " has type " << type_name
        << " but elem_size of the buffer passed in is "
        << elem_size_given << " instead of " << correct_elem_size;
    return halide_error_code_bad_elem_size;
}

WEAK int halide_error_access_out_of_bounds(void *user_context, const char *func_name,
                                           int dimension, int min_touched, int max_touched,
                                           int min_valid, int max_valid) {
    if (min_touched < min_valid) {
        error(user_context)
            << func_name << " is accessed at " << min_touched
            << ", which is before the min (" << min_valid
            << ") in dimension " << dimension;
    } else if (max_touched > max_valid) {
        error(user_context)
            << func_name << " is accessed at " << max_touched
            << ", which is beyond the max (" << max_valid
            << ") in dimension " << dimension;
    }
    return halide_error_code_access_out_of_bounds;
}

WEAK int halide_error_buffer_allocation_too_large(void *user_context, const char *buffer_name, uint64_t allocation_size, uint64_t max_size) {
    error(user_context)
        << "Total allocation for buffer " << buffer_name
        << " is " << allocation_size
        << ", which exceeds the maximum size of " << max_size;
    return halide_error_code_buffer_allocation_too_large;
}

WEAK int halide_error_buffer_extents_too_large(void *user_context, const char *buffer_name, int64_t actual_size, int64_t max_size) {
    error(user_context)
        << "Product of extents for buffer " << buffer_name
        << " is " << actual_size
        << ", which exceeds the maximum size of " << max_size;
    return halide_error_code_buffer_extents_too_large;
}

WEAK int halide_error_constraints_make_required_region_smaller(void *user_context, const char *buffer_name,
                                                               int dimension,
                                                               int constrained_min, int constrained_extent,
                                                               int required_min, int required_extent) {
    int required_max = required_min + required_extent - 1;
    int constrained_max = constrained_min + required_extent - 1;
    error(user_context)
        << "Applying the constraints on " << buffer_name
        << " to the required region made it smaller. "
        << "Required size: " << required_min << " to " << required_max << ". "
        << "Constrained size: " << constrained_min << " to " << constrained_max << ".";
    return halide_error_code_constraints_make_required_region_smaller;
}

WEAK int halide_error_constraint_violated(void *user_context, const char *var, int val,
                                          const char *constrained_var, int constrained_val) {
    error(user_context)
        << "Constraint violated: " << var << " (" << val
        << ") == " << constrained_var << " (" << constrained_var << ")";
    return halide_error_code_constraint_violated;
}

WEAK int halide_error_param_too_small_i64(void *user_context, const char *param_name,
                                          int64_t val, int64_t min_val) {
    error(user_context)
        << "Parameter " << param_name
        << " is " << val
        << " but must be at least " << min_val;
    return halide_error_code_param_too_small;
}

WEAK int halide_error_param_too_small_u64(void *user_context, const char *param_name,
                                          uint64_t val, uint64_t min_val) {
    error(user_context)
        << "Parameter " << param_name
        << " is " << val
        << " but must be at least " << min_val;
    return halide_error_code_param_too_small;
}

WEAK int halide_error_param_too_small_f64(void *user_context, const char *param_name,
                                          double val, double min_val) {
    error(user_context)
        << "Parameter " << param_name
        << " is " << val
        << " but must be at least " << min_val;
    return halide_error_code_param_too_small;
}

WEAK int halide_error_param_too_large_i64(void *user_context, const char *param_name,
                                          int64_t val, int64_t max_val) {
    error(user_context)
        << "Parameter " << param_name
        << " is " << val
        << " but must be at most " << max_val;
    return halide_error_code_param_too_large;
}

WEAK int halide_error_param_too_large_u64(void *user_context, const char *param_name,
                                          uint64_t val, uint64_t max_val) {
    error(user_context)
        << "Parameter " << param_name
        << " is " << val
        << " but must be at most " << max_val;
    return halide_error_code_param_too_large;
}

WEAK int halide_error_param_too_large_f64(void *user_context, const char *param_name,
                                          double val, double max_val) {
    error(user_context)
        << "Parameter " << param_name
        << " is " << val
        << " but must be at most " << max_val;
    return halide_error_code_param_too_large;
}

WEAK int halide_error_out_of_memory(void *user_context) {
    // The error message builder uses malloc, so we can't use it here.
    halide_error(user_context, "Out of memory (halide_malloc returned NULL)");
    return halide_error_code_out_of_memory;
}

WEAK int halide_error_buffer_argument_is_null(void *user_context, const char *buffer_name) {
    error(user_context)
        << "Buffer argument " << buffer_name << " is NULL";
    return halide_error_code_buffer_argument_is_null;
}

WEAK int halide_error_debug_to_file_failed(void *user_context, const char *func,
                                           const char *filename, int error_code) {
    error(user_context)
        << "Failed to dump function " << func
        << " to file " << filename
        << " with error " << error_code;
    return halide_error_code_debug_to_file_failed;
}

WEAK int halide_error_unaligned_host_ptr(void *user_context, const char *func,
                                         int alignment) {
    error(user_context)
        << "The host pointer of " << func
        << " is not aligned to a " << alignment
        << " bytes boundary.";
    return halide_error_code_unaligned_host_ptr;
}
}


text:
package com.ray3k.skincomposer.dialog.scenecomposer.undoables;

import com.ray3k.skincomposer.dialog.scenecomposer.DialogSceneComposer;
import com.ray3k.skincomposer.dialog.scenecomposer.DialogSceneComposerModel;

public class ScrollPaneVariableSizeKnobsUndoable implements SceneComposerUndoable {
    private DialogSceneComposerModel.SimScrollPane scrollPane;
    private DialogSceneComposer dialog;
    private boolean variableSizeKnobs;
    private boolean previousVariableSizeKnobs;

    public ScrollPaneVariableSizeKnobsUndoable(boolean variableSizeKnobs) {
        this.variableSizeKnobs = variableSizeKnobs;
        dialog = DialogSceneComposer.dialog;
        scrollPane = (DialogSceneComposerModel.SimScrollPane) dialog.simActor;
        previousVariableSizeKnobs = scrollPane.variableSizeKnobs;
    }

    @Override
    public void undo() {
        scrollPane.variableSizeKnobs = previousVariableSizeKnobs;

        if (dialog.simActor != scrollPane) {
            dialog.simActor = scrollPane;
            dialog.populateProperties();
            dialog.populatePath();
        }
        dialog.model.updatePreview();
    }

    @Override
    public void redo() {
        scrollPane.variableSizeKnobs = variableSizeKnobs;

        if (dialog.simActor != scrollPane) {
            dialog.simActor = scrollPane;
            dialog.populateProperties();
            dialog.populatePath();
        }
        dialog.model.updatePreview();
    }

    @Override
    public String getRedoString() {
        return "Redo \"ScrollPane variable size knobs " + variableSizeKnobs + "\"";
    }

    @Override
    public String getUndoString() {
        return "Undo \"ScrollPane variable size knobs " + variableSizeKnobs + "\"";
    }
}


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

<title>Uses of Class com.mpatric.mp3agic.FileWrapper</title>
<meta name="date" content="2012-12-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.mpatric.mp3agic.FileWrapper

Packages that use FileWrapper

Package
Description

com.mpatric.mp3agic

Uses of FileWrapper in com.mpatric.mp3agic

Subclasses of FileWrapper in com.mpatric.mp3agic

Modifier and Type
Class and Description

class
Mp3File

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
namespace geode {

static bool geode_sse_enabled() {
#ifdef GEODE_SSE
  return true;
#else
  return false;
#endif
}

#ifdef GEODE_SSE
static Vector<double,2> sse_pack_unpack(const Vector<double,2> a) {
  return unpack(pack<double>(a.x,a.y));
}
#endif

}
using namespace geode;

void wrap_sse() {
  GEODE_FUNCTION(geode_sse_enabled)
#ifdef GEODE_SSE
  GEODE_FUNCTION(sse_pack_unpack)
#endif
}


text:
using System;
using Chiro.Cdf.Ioc;
using Chiro.CiviCrm.Api;
using Chiro.CiviCrm.Api.DataContracts;
using Chiro.CiviCrm.Api.DataContracts.Entities;
using Chiro.CiviCrm.Api.DataContracts.Requests;
using Chiro.CiviSync.Mapping;
using Chiro.Gap.UpdateApi.Client;
using Chiro.Kip.ServiceContracts.DataContracts;
using Moq;
using NUnit.Framework;

namespace Chiro.CiviSync.Services.Test
{
    [TestFixture]
    public class PersonenBewarenTest: SyncTest
    {
        private static int _nextId = 1;

        /// <summary>
        /// Als een nieuwe persoon al gevonden is in de CiviCRM-database, dan wordt het GAP-ID
        /// van die persoon aangepast. Voor die call verwacht CiviCRM een ContactType.
        /// </summary>
        [Test]
        public void ContactTypeBijGematchtLid()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (IDiContainer factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05),
                out civiApiMock, out updateHelperMock))
            {

                // Onze nepdatabase bevat 1 organisatie (TST/0000) en 1 contact (Kees Flodder)
                var ploeg = new Contact
                {
                    ExternalIdentifier = "TST/0001",
                    Id = 1,
                    ContactType = ContactType.Organization
                };
                var persoon = new Contact
                {
                    ExternalIdentifier = "2",
                    FirstName = "Kees",
                    LastName = "Flodder",
                    GapId = 3,
                    Id = 5,
                    // Voor het gemak heeft ons contact nog geen bestaande releationships.
                    RelationshipResult = new ApiResultValues<Relationship>(),
                };

                // Een request om 1 of meerdere contacts op te leveren, levert voor het gemak altijd
                // dezelfde persoon en dezelfde ploeg.

                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(
                                    cr =>
                                        cr.ExternalIdentifier == ploeg.ExternalIdentifier ||
                                        cr.ContactType == ContactType.Organization)))
                    .Returns(new ApiResultValues<Contact>(ploeg));

                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(
                                    cr =>
                                        cr.ExternalIdentifier == persoon.ExternalIdentifier ||
                                        cr.ContactType == ContactType.Individual || cr.GapId == persoon.GapId)))
                    .Returns(new ApiResultValues<Contact>(persoon));

                // RelationshipSave moet gewoon doen of het werkt.
                civiApiMock.Setup(
                        src => src.RelationshipSave(It.IsAny<string>(), It.IsAny<string>(),
                            It.IsAny<RelationshipRequest>()))
                    .Returns((string key1, string key2, RelationshipRequest r) =>
                        TestHelper.Map<RelationshipRequest, ApiResultValues<Relationship>>(r));

                // Voor deze test moet elke 'ContactSave' een individual aanmaken.
                civiApiMock.Setup(src => src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                        It.Is<ContactRequest>(r => r.ContactType == ContactType.Individual)))
                    .Returns(
                        (string key1, string key2, ContactRequest r) => SomeSaveResult(r))
                    .Verifiable();

                var service = factory.Maak<SyncService>();

                // ACT

                service.NieuwLidBewaren(
                    new PersoonDetails
                    {
                        Adres = new Adres {Straat = "Kipdorp", HuisNr = 30, PostNr = "2000", WoonPlaats = "Antwerpen"},
                        AdresType = AdresTypeEnum.Thuis,
                        Communicatie =
                            new[]
                            {
                                new CommunicatieMiddel
                                {
                                    IsBulk = false,
                                    Type = CommunicatieType.TelefoonNummer,
                                    Waarde = "03-231 07 95"
                                }
                            },
                        Persoon =
                            new Persoon
                            {
                                AdNummer = null,
                                GeboorteDatum = new DateTime(2003, 11, 8),
                                Geslacht = GeslachtsEnum.Vrouw,
                                ID = persoon.GapId ?? 0,
                                Naam = persoon.LastName,
                                VoorNaam = persoon.FirstName
                            }
                    },
                    new LidGedoe
                    {
                        EindeInstapPeriode = new DateTime(2015, 02, 27),
                        LidType = LidTypeEnum.Kind,
                        OfficieleAfdelingen = new[] {AfdelingEnum.Rakwis},
                        StamNummer = ploeg.ExternalIdentifier
                    });

                // ASSERT

                civiApiMock.Verify(src => src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                    It.Is<ContactRequest>(r => r.ContactType == ContactType.Individual)), Times.AtLeastOnce);
            }
        }

        /// <summary>
        /// Als CiviSync persoonsgegevens krijgt zonder AD-nummer of GAP-ID, dan probeert CiviSync zelf
        /// te matchen. We checken even of CiviSync op zoek gaat naar een persoon van het juiste geslacht
        /// (want dat deden we al wel eens mis.)
        /// </summary>
        [Test]
        public void CorrectGeslachtBijTeMatchenLid()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (var factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05), out civiApiMock,
                out updateHelperMock))
            {
                // We zullen straks de persoon kunnen matchen op zijn telefoonnummer.
                const string somePhoneNumber = "03-231 07 95";

                // Onze nepdatabase bevat 1 organisatie (TST/0000) en 1 contact (Kees Flodder)
                var ploeg = new Contact
                {
                    ExternalIdentifier = "TST/0001",
                    Id = 1,
                    ContactType = ContactType.Organization
                };
                var persoon = new Contact
                {
                    // De persoon in civi heeft uiteraard wel een AD-nummer
                    ExternalIdentifier = "2",
                    FirstName = "Kees",
                    LastName = "Flodder",
                    Gender = Gender.Female,
                    Id = 3,
                    RelationshipResult = new ApiResultValues<Relationship>
                    {
                        Count = 0,
                        IsError = 0
                    },
                    PhoneResult =
                        new ApiResultValues<Phone>
                        {
                            Count = 1,
                            IsError = 0,
                            Values = new[] {new Phone {PhoneNumber = somePhoneNumber}}
                        }
                };

                // Een request om 1 of meerdere contacts op te leveren, levert voor het gemak altijd
                // dezelfde persoon en dezelfde ploeg.

                // Zoeken op het gevraagde stamnummer levert de ploeg op.
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.ExternalIdentifier == ploeg.ExternalIdentifier)))
                    .Returns(
                        new ApiResultValues<Contact> {Count = 1, IsError = 0, Values = new[] {ploeg}});

                // Als er gezocht wordt op AD-nummer, vinden we de persoon:
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.ExternalIdentifier == persoon.ExternalIdentifier)))
                    .Returns(
                        new ApiResultValues<Contact> {Count = 1, IsError = 0, Values = new[] {persoon}})
                    .Verifiable();

                // Verwacht dat er zeker op gender gezocht wordt. Lever persoon op.
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.Gender == persoon.Gender &&
                                                           r.ContactType == ContactType.Individual)))
                    .Returns(
                        new ApiResultValues<Contact> {Count = 1, IsError = 0, Values = new[] {persoon}})
                    .Verifiable();

                // RelationshipSave moet gewoon doen of het werkt.
                civiApiMock.Setup(
                        src => src.RelationshipSave(It.IsAny<string>(), It.IsAny<string>(),
                            It.IsAny<RelationshipRequest>()))
                    .Returns((string key1, string key2, RelationshipRequest r) =>
                        TestHelper.Map<RelationshipRequest, ApiResultValues<Relationship>>(r));

                // Voor deze test moet elke 'ContactSave' een individual aanmaken.
                civiApiMock.Setup(src => src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                        It.IsAny<ContactRequest>()))
                    .Returns(
                        (string key1, string key2, ContactRequest r) =>
                        {
                            Assert.AreEqual(ContactType.Individual, r.ContactType);
                            return SomeSaveResult(r);
                        });

                var service = factory.Maak<SyncService>();

                // ACT

                service.NieuwLidBewaren(
                    new PersoonDetails
                    {
                        Adres = new Adres {Straat = "Kipdorp", HuisNr = 30, PostNr = "2000", WoonPlaats = "Antwerpen"},
                        AdresType = AdresTypeEnum.Thuis,
                        Communicatie =
                            new[]
                            {
                                new CommunicatieMiddel
                                {
                                    IsBulk = false,
                                    Type = CommunicatieType.TelefoonNummer,
                                    Waarde = somePhoneNumber
                                }
                            },
                        Persoon =
                            new Persoon
                            {
                                AdNummer = null,
                                GeboorteDatum = new DateTime(2003, 11, 8),
                                Geslacht = GeslachtsEnum.Vrouw,
                                ID = persoon.GapId ?? 0,
                                Naam = persoon.LastName,
                                VoorNaam = persoon.FirstName
                            }
                    },
                    new LidGedoe
                    {
                        EindeInstapPeriode = new DateTime(2015, 02, 27),
                        LidType = LidTypeEnum.Kind,
                        OfficieleAfdelingen = new[] {AfdelingEnum.Rakwis},
                        StamNummer = ploeg.ExternalIdentifier
                    });

                // ASSERT

                civiApiMock.Verify(
                    src =>
                        src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                            It.Is<ContactRequest>(r => r.Gender == persoon.Gender &&
                                                       r.ContactType == ContactType.Individual)),
                    Times.AtLeastOnce);
            }
        }

        /// <summary>
        /// Doet 'PersoonUpdaten' een ContactSave op de API?
        /// </summary>
        [Test]
        public void PersoonUpdaten()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (var factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05), out civiApiMock,
                out updateHelperMock))
            {

                const int adNummer = 2;
                var persoon = new Contact
                {
                    Id = 4,
                    ExternalIdentifier = adNummer.ToString(),
                    FirstName = "Kees",
                    LastName = "Flodder",
                    GapId = 3
                };

                civiApiMock.Setup(
                        src => src.ContactGet(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ContactRequest>()))
                    .Returns(new ApiResultValues<Contact>(persoon));
                civiApiMock.Setup(
                        src =>
                            src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.ExternalIdentifier == persoon.ExternalIdentifier)))
                    .Returns(
                        (string key1, string key2, ContactRequest request) =>
                            TestHelper.Map<ContactRequest, ApiResultValues<Contact>>(request))
                    .Verifiable();

                var service = factory.Maak<SyncService>();

                // ACT

                service.PersoonUpdaten(new Persoon
                {
                    AdNummer = adNummer,
                    GeboorteDatum = new DateTime(1977, 03, 08)
                });

                // ASSERT

                civiApiMock.Verify(
                    src =>
                        src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                            It.Is<ContactRequest>(r => r.ExternalIdentifier == persoon.ExternalIdentifier)),
                    Times.AtLeastOnce);
            }
        }

        /// <summary>
        /// Werkt PersoonUpdaten ook als het GAP geen AD-nummer kent? (#3684)
        /// </summary>
        [Test]
        public void PersoonUpdatenZonderAd()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (var factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05), out civiApiMock,
                out updateHelperMock))
            {

                const int adNummer = 2;
                var persoon = new Contact
                {
                    Id = 4,
                    ExternalIdentifier = adNummer.ToString(),
                    FirstName = "Kees",
                    LastName = "Flodder",
                    GapId = 3
                };

                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.ExternalIdentifier == persoon.ExternalIdentifier)))
                    .Returns(new ApiResultValues<Contact>(persoon));
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.GapId == persoon.GapId)))
                    .Returns(TestHelper.Map<Contact, ApiResultValues<Contact>>(persoon));
                civiApiMock.Setup(
                        src =>
                            src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                                It.Is<ContactRequest>(r => r.ExternalIdentifier == persoon.ExternalIdentifier)))
                    .Returns(
                        (string key1, string key2, ContactRequest request) =>
                            TestHelper.Map<ContactRequest, ApiResultValues<Contact>>(request))
                    .Verifiable();

                var service = factory.Maak<SyncService>();

                // ACT

                Assert.IsNotNull(persoon.GapId);
                service.PersoonUpdaten(new Persoon
                {
                    AdNummer = null,
                    ID = persoon.GapId.Value,
                    GeboorteDatum = new DateTime(1977, 03, 08)
                });

                // ASSERT

                civiApiMock.Verify(
                    src =>
                        src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                            It.Is<ContactRequest>(r => r.ExternalIdentifier == persoon.ExternalIdentifier)),
                    Times.AtLeastOnce);
            }
        }

        /// <summary>
        /// UpdatenOfMaken moet kunnen maken als er geen adres is. (#4111)
        /// </summary>
        [Test]
        public void UpdatenOfMakenZonderAdres()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (var factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05), out civiApiMock,
                out updateHelperMock))
            {

                var persoon = new PersoonDetails
                {
                    Persoon = new Persoon
                    {
                        Naam = "Flodder",
                        VoorNaam = "Kees",
                        GeboorteDatum = new DateTime(1977, 03, 08)
                    }
                };

                // Zorg ervoor dat de persoon niet gevonden wordt.
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.IsAny<ContactRequest>()))
                    .Returns(new ApiResultValues<Contact>());

                // Zet dummy save op.
                civiApiMock.Setup(
                        src =>
                            src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                                It.IsAny<ContactRequest>()))
                    .Returns(
                        (string key1, string key2, ContactRequest request) =>
                            TestHelper.Map<ContactRequest, ApiResultValues<Contact>>(request))
                    .Verifiable();

                var service = factory.Maak<SyncService>();

                // ACT

                service.PersoonUpdatenOfMaken(persoon);

                // ASSERT

                civiApiMock.Verify(
                    src => src.ContactSave(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ContactRequest>()),
                    Times.AtLeastOnce);
            }
        }

        /// <summary>
        /// PersoonUpdaten voor een onbekend persoon moet een error loggen. (#3684)
        /// </summary>
        [Test]
        public void PersoonUpdatenOnbekend()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (var factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05), out civiApiMock,
                out updateHelperMock))
            {

                // De API levert niets op:
                civiApiMock.Setup(
                        src => src.ContactGetSingle(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ContactRequest>()))
                    .Returns(new Contact());
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.IsAny<ContactRequest>()))
                    .Returns(new ApiResultValues<Contact>());

                // Bewaren verifiable maken, zodat we kunnen controleren dat het niet gebeurt.
                civiApiMock.Setup(
                        src =>
                            src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                                It.IsAny<ContactRequest>()))
                    .Returns(
                        (string key1, string key2, ContactRequest request) =>
                            TestHelper.Map<ContactRequest, ApiResultValues<Contact>>(request))
                    .Verifiable();

                var service = factory.Maak<SyncService>();

                // ACT

                service.PersoonUpdaten(new Persoon
                {
                    AdNummer = null,
                    ID = 1,
                    GeboorteDatum = new DateTime(1977, 03, 08)
                });

                // ASSERT

                civiApiMock.Verify(
                    src =>
                        src.ContactSave(It.IsAny<string>(), It.IsAny<string>(),
                            It.IsAny<ContactRequest>()),
                    Times.Never);
            }
        }

        /// <summary>
        /// PersoonUpdaten voor een persoon met fout AD-nummer (#3688)
        /// </summary>
        [Test]
        public void PersoonUpdatenFoutAd()
        {
            // ARRANGE

            Mock<ICiviCrmApi> civiApiMock;
            Mock<IGapUpdateClient> updateHelperMock;
            using (var factory = TestHelper.IocOpzetten(new DateTime(2015, 02, 05), out civiApiMock,
                out updateHelperMock))
            {

                // Zo gezegd ongeldig AD-nummer
                const int adNummer = 1;

                // De API levert niets op:
                civiApiMock.Setup(
                        src => src.ContactGetSingle(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<ContactRequest>()))
                    .Returns(new Contact());
                civiApiMock.Setup(
                        src =>
                            src.ContactGet(It.IsAny<string>(), It.IsAny<string>(),
                                It.IsAny<ContactRequest>()))
                    .Returns(new ApiResultValues<Contact>());

                // We mocken ook GapUpdateClient.
                updateHelperMock.Setup(src => src.OngeldigAdNaarGap(It.Is<Int32>(ad => ad == adNummer))).Verifiable();

                var service = factory.Maak<SyncService>();

                // ACT

                service.PersoonUpdaten(new Persoon
                {
                    AdNummer = adNummer,
                    ID = 1,
                    GeboorteDatum = new DateTime(1977, 03, 08)
                });

                // ASSERT

                updateHelperMock.Verify(src => src.OngeldigAdNaarGap(It.Is<Int32>(ad => ad == adNummer)),
                    Times.AtLeastOnce);
            }
        }

        private ApiResultValues<Contact> SomeSaveResult(ContactRequest contactRequest)
        {
            return new ApiResultValues<Contact>
            {
                Count = 1,
                ErrorMessage = String.Empty,
                Id = _nextId++,
                IsError = 0,
                Values = new Contact[] {TestHelper.Map<ContactRequest, Contact>(contactRequest)}
            };
        }
    }
}


text:
"""
Senlin API Server.
"""
import sys

from oslo_config import cfg
from oslo_i18n import _lazy
from oslo_log import log as logging
from oslo_service import systemd
import six

from senlin.api.common import wsgi
from senlin.common.i18n import _LI
from senlin.common import messaging
from senlin import version

_lazy.enable_lazy()

LOG = logging.getLogger('senlin.api')

def main():
    try:
        logging.register_options(cfg.CONF)
        cfg.CONF(project='senlin', prog='senlin-api',
                 version=version.version_info.version_string())
        logging.setup(cfg.CONF, 'senlin-api')
        messaging.setup()

        app = wsgi.load_paste_app()

        host = cfg.CONF.senlin_api.bind_host
        port = cfg.CONF.senlin_api.bind_port
        LOG.info(_LI('Starting Senlin API on %(host)s:%(port)s'),
                 {'host': host, 'port': port})
        server = wsgi.Server('senlin-api', cfg.CONF.senlin_api)
        server.start(app, default_port=port)
        systemd.notify_once()
        server.wait()
    except RuntimeError as ex:
        sys.exit("ERROR: %s" % six.text_type(ex))


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('music', '0018_remove_music_date'),
    ]

    operations = [
        migrations.AlterField(
            model_name='playlisttrack',
            name='room',
            field=models.ForeignKey(related_name='playlist', to='player.Room', on_delete=models.CASCADE),
            preserve_default=True,
        ),
        migrations.RemoveField(
            model_name='music',
            name='dead_link',
        ),
        migrations.AlterUniqueTogether(
            name='music',
            unique_together=set([('music_id', 'room')]),
        ),
    ]


text:
module.exports = {
  exportPathMap: function () {
    return {
      '/': { page: '/' },
      '/about': { page: '/about' },
      '/button-link': { page: '/button-link' },
      '/get-initial-props-with-no-query': { page: '/get-initial-props-with-no-query' },
      '/counter': { page: '/counter' },
      '/dynamic-imports': { page: '/dynamic-imports' },
      '/dynamic': { page: '/dynamic', query: { text: 'cool dynamic text' } },
      '/dynamic/one': { page: '/dynamic', query: { text: 'next export is nice' } },
      '/dynamic/two': { page: '/dynamic', query: { text: 'zeit is awesome' } }
    }
  }
}


text:
/* Commentary:
 *
 */

/* Change log:
 *
 */

#ifndef DTKCOMPOSERNODEMATRIXSQUAREREALEXTRACTOR_H
#define DTKCOMPOSERNODEMATRIXSQUAREREALEXTRACTOR_H

#include <dtkComposerSupportExport.h>
#include "dtkComposerNodeLeaf.h"

class dtkComposerNodeMatrixSquareRealExtractorPrivate;

class DTKCOMPOSERSUPPORT_EXPORT dtkComposerNodeMatrixSquareRealExtractor : public dtkComposerNodeLeaf
{
public:
    dtkComposerNodeMatrixSquareRealExtractor(void);
    ~dtkComposerNodeMatrixSquareRealExtractor(void);

public:
    void run(void);

public:
    inline QString type(void) {
        return "matrixSquare_real_extractor";
    }

    inline QString titleHint(void) {
        return "MatrixSquare Real Extractor";
    }

public:
    QString  inputLabelHint(int port);
    QString outputLabelHint(int port);

private:
    dtkComposerNodeMatrixSquareRealExtractorPrivate *d;
};

#endif


text:
package hello

import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.annotation.JsonIgnoreProperties
import scala.beans.BeanProperty

@JsonIgnoreProperties(ignoreUnknown = true)
class routeDetails (){

@JsonProperty("customer_name")
var customer_name: String = _
@JsonProperty("routing_number")
var routing_number: String = _
@JsonProperty("change_date")
var change_date: String = _
@JsonProperty("data_view_code")
var data_view_code: String = _
@JsonProperty("message")
var message: String = _
@JsonProperty("record_type_code")
var record_type_code: String = _
@JsonProperty("zip")
var zip: String = _
@JsonProperty("office_code")
var office_code: String = _
@JsonProperty("telephone")
var telephone: String = _
@JsonProperty("rn")
var rn: String = _
@JsonProperty("address")
var address: String = _
@JsonProperty("code")
var code: String = _
@JsonProperty("state")
var state: String = _
@JsonProperty("new_routing_number")
var new_routing_number: String = _
@JsonProperty("institution_status_code")
var institution_status_code: String = _
@JsonProperty("city")
var city: String = _
def this(customer_name:String,routing_number:String) {
this()
this.customer_name = customer_name
this.routing_number = routing_number
}

}


text:
namespace wl {

// Manages zaura_output object.
class TestZAuraOutput : public ServerObject {
 public:
  explicit TestZAuraOutput(wl_resource* resource);

  TestZAuraOutput(const TestZAuraOutput&) = delete;
  TestZAuraOutput& operator=(const TestZAuraOutput&) = delete;

  ~TestZAuraOutput() override;

  int64_t display_id() const { return display_id_; }

  const gfx::Insets& GetInsets() const { return insets_; }
  void SetInsets(const gfx::Insets& insets) { pending_insets_ = insets; }

  int32_t GetLogicalTransform() const { return logical_transform_; }
  void SetLogicalTransform(int32_t logical_transform) {
    pending_logical_transform_ = logical_transform;
  }

  // Send display id, activated events, immediately.
  void SendActivated();

  void Flush();

 private:
  int64_t display_id_;
  gfx::Insets insets_;
  absl::optional<gfx::Insets> pending_insets_;

  int32_t logical_transform_ = WL_OUTPUT_TRANSFORM_NORMAL;
  absl::optional<int32_t> pending_logical_transform_;
};

}  // namespace wl

#endif  // UI_OZONE_PLATFORM_WAYLAND_TEST_TEST_ZAURA_OUTPUT_H_


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    android:id="@+id/fab_item_main_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1">

        <android.support.v7.widget.CardView
            android:id="@+id/fab_tag_item_card"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginEnd="@dimen/fab_list_item_tag_margin"
            android:layout_marginRight="@dimen/fab_list_item_tag_margin"
            android:clickable="true"
            android:layout_gravity="end"
            android:foreground="?android:attr/selectableItemBackground"
            card_view:cardCornerRadius="2dp"
            card_view:cardElevation="2dp">

            <TextView
                android:id="@+id/fab_tag_item"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@android:color/black"
                android:layout_margin="5dp"
                android:text="New Text" />

        </android.support.v7.widget.CardView>

    </FrameLayout>

    <com.vicmns.stackerviewlib.FloatingActionButton
        android:id="@+id/fab_item"
        android:layout_width="@dimen/fab_size"
        android:layout_height="@dimen/fab_size"
        android:layout_gravity="center"
        android:elevation="@dimen/fab_elevation"
        android:stateListAnimator="@animator/fab_anim" />

</LinearLayout>


text:
(function (global, factory) {
  if (typeof module === 'object' && typeof module.exports === 'object') {
    module.exports = global.document
      ? factory(global, true)
      : function (w) {
        if (!w.document) {
          throw new Error('RXS: Reactive CSS requires a window with a document')
        }
        return factory(w)
      }
  } else {
    factory(global)
  }
}(typeof window !== 'undefined' ? window : this, function (window, noGlobal) {
  'use strict'
  var document = window.document

  var RXSRule = function (selector) {
    this.selector = selector
    this.styleSheet = this.getStyleSheet()
    this.rule = this.getRule()
    this.ruleIndex = this.getRuleIndex()
    return this
  }

  RXSRule.prototype.addStyleSheet = function () {
    var style = document.createElement('style')
    style.appendChild(document.createTextNode(''))
    document.head.appendChild(style)
    return style.sheet
  }

  RXSRule.prototype.getStyleSheet = function () {
    return this.styleSheet || document.styleSheets[document.styleSheets.length - 1] || this.addStyleSheet()
  }

  RXSRule.prototype.getRules = function () {
    var sheet = this.getStyleSheet()
    return sheet.cssRules || sheet.rules
  }

  RXSRule.prototype.getRuleIndex = function () {
    if (!this.ruleIndex) {
      if (this.rule) {
        this.ruleIndex = this.findRuleIndex()
      } else {
        var len = this.getRules().length
        this.ruleIndex = len ? len - 1 : 0
      }
    }
    return this.ruleIndex
  }

  RXSRule.prototype.addRule = function () {
    var index = this.getRuleIndex()
    this.getStyleSheet().insertRule(this.selector + ' { }', index)
    return this.getRules()[index]
  }

  RXSRule.prototype.removeRule = function () {
    if (this.findRule()) {
      this.getStyleSheet().deleteRule(this.getRuleIndex())
    }
    return this
  }

  RXSRule.prototype.findRuleIndex = function () {
    var rules = this.getRules()
    var index = false
    for (var i = 0, len = Object.keys(rules).length; i < len; i++) {
      if (rules[i].selectorText === this.selector) {
        index = i; break
      }
    }
    return index
  }

  RXSRule.prototype.findRule = function () {
    var rules = this.getRules()
    var index = this.findRuleIndex()
    var rule = index !== false ? rules[index] : false
    return rule
  }

  RXSRule.prototype.getRule = function () {
    this.rule = this.findRule() || this.addRule()
    return this.rule
  }

  RXSRule.prototype.isImportant = function (prop) {
    return prop.toString().indexOf('!important') >= 0 ? 'important' : ''
  }

  RXSRule.prototype.set = function (styleProps, important) {
    var self = this
    Object.keys(styleProps).forEach(function (k) {
      var prop = styleProps[k]
      var p = typeof prop === 'string' ? prop.replace(' !important', '') : prop
      var i = important === 'important' ? 'important' : self.isImportant(prop)
      self.getRule().style.setProperty(k, p, i)
    })
    return this
  }

  RXSRule.prototype.inspect = function () {
    var style = this.getRule().style
    return Object.keys(style).reduce(function (props, r) {
      if (style[r].length && isNaN(parseInt(r, 10))) {
        props[r] = style[r]
      }
      return props
    }, {})
  }

  RXSRule.prototype.remove = function () {
    return this.removeRule()
  }

  var RXS = function (selector, props) {
    if (!selector || typeof selector !== 'string') {
      return false
    }
    var rule = new RXSRule(selector)
    if (props && typeof props === 'object') {
      rule.set(props)
    }
    return rule
  }

  window.RXSRule = RXSRule
  window.rxs = window.RXS = RXS

  return RXS
}))


text:
from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('voting', '0003_vote_created_at'),
        ('voting', '0003_votetoken'),
    ]

    operations = [
    ]


text:
SCENARIO( "httpClient can make post", "[httpClient]" ) {

    GIVEN( "An httpClient" ) {
        httpClient client;

        WHEN( "a post is generated" ) {
            std::string host = "test.com";
            std::string path = "/path";
            std::string data = "{\"test\": \"test\"";
            std::string contentLength = std::to_string(data.length());
            std::string request = client.generateHttpPost(host, path, data);

            THEN( "it is a valid request" ) {
                std::string expected = "POST " + path + " HTTP/1.1\r\n" +
                        "Host: " + host + "\r\n" +
                        "Connection: close\r\n" +
                        "Content-Type: application/json\r\n" +
                        "Content-Length: " + contentLength + "\r\n" +
                        "\r\n" + data;
                REQUIRE( expected == request );
            }
        }
    }
}


text:
'use strict';
module.exports = function(config){
  config.set({

    basePath : './',

    files : [
      'app/bower_components/angular/angular.js',
      'app/bower_components/angular-route/angular-route.js',
      'app/bower_components/angular-mocks/angular-mocks.js',
      'app/js/servuces/*.js',
      'app/js/**/*.js',
      'app/test/*.js'
    ],

    autoWatch : true,

    frameworks: ['jasmine'],

    browsers : ['Chrome'],

    plugins : [
            'karma-chrome-launcher',
            'karma-firefox-launcher',
            'karma-jasmine',
            'karma-junit-reporter'
            ],

    junitReporter : {
      outputFile: 'test_out/unit.xml',
      suite: 'unit'
    }

  });
};


text:
from model.basetest import BaseTest

class Test(BaseTest):

    name = 'Delete All Todos'

    def run(self, **kwargs):
        self.app.nav.go_to_home()

        for i in range(20):
            self.app.create_todo('Test {i}'.format(i=i))

        self.app.delete_all()

        self.pdriver.assert_not_visible('sv:todo_root', '#6')


text:
require "rails_helper"

RSpec.describe AdminMailer, type: :mailer do
  describe "#import_completed" do
    xit "should send email to the named recipient" do
    end

    xit "should attach the errors file if it exists" do
    end
  end

  describe "#import_failed" do
    xit "should send email to the named recipient" do
    end

    xit "should include the exception details" do
    end
  end
end


text:
package org.bitcoins.core.consensus

import org.bitcoins.core.currency.{CurrencyUnit, Satoshis}
import org.bitcoins.core.number.Int64

/**
  * Created by chris on 5/13/16.
  */
sealed abstract class Consensus {

  def maxBlockSize: Long = 1000000

  def weightScalar: Long = 4

  def maxBlockWeight: Long = maxBlockSize * weightScalar

  /**
    * BIP141 changes this from 20,000 -> 80,000, to see how sigops are counted please see BIP 141
    * [[https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#sigops]]
    */
  def maxSigOps = 80000

  def maxMoney: CurrencyUnit = Satoshis(Int64(2100000000000000L))

  /**
    * A integer representing the maximum number of public keys you can have in a
    * OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY operation
    * https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L903
    * @return
    */
  def maxPublicKeysPerMultiSig = 20
}

object Consensus extends Consensus


text:
package com.datatorrent.stram.engine;

import com.datatorrent.api.Attribute.AttributeMap;
import com.datatorrent.stram.api.BaseContext;
import com.datatorrent.api.Context;

/**
 *
PortContext class.

 *
 * @since 0.3.2
 */
public class PortContext extends BaseContext implements Context.PortContext
{

  public PortContext(AttributeMap attributes, Context parentContext)
  {
    super(attributes, parentContext);
  }

  @SuppressWarnings("FieldNameHidesFieldInSuperclass")
  private static final long serialVersionUID = 201306071424L;
}


text:
window.w = window.w || {};

(function(w) {
    var _ids = {};

    w.id = function id (id) {
        if (!(id in _ids)) {
            var el = document.getElementById(id);
            if (!el) {
                return el;
            } else {
                _ids[id] = el;
            }
        }

        return _ids[id];
    };

    w.cl = function cl(cl) {
        return document.getElementsByClassName(cl).toArray();
    };

    w.newDom = function newDom(tagName, properties) {
        var el = document.createElement(tagName);
        for (var prop in properties) {
            el[prop] = properties[prop];
        }

        return el;
    };

    w.html = document.getElementsByTagName('html')[0];
    w.body = document.getElementsByTagName('body')[0];

    w.go = function go (fn) {
        window.onload = fn;
    };

    w.range = function range(start, stop, step) {
        if (!stop) {
            stop = start;
            start = 0;
        }

        if (!step) step = 1;

        var r = [];

        for (var i = start; i < stop; i += step) {
            r.push(i);
        }

        return r;
    };

    w.pick = function pick(array) {
        return array[w.rand(array.length)];
    };

    w.rand = function rand(start, stop) {
        if (!stop) {
            stop = start;
            start = 0;
        }

        return Math.floor(Math.random() * (stop - start) + start);
    };

    w.randExclude = function randExclude(start, stop, exclusions) {
        // if there's only one exclusion, make an array of one
        exclusions.numSort();
        var realEx = [];
        exclusions.forEach(function(x) {
            if (x >= start && x < stop && realEx.indexOf(x) < 0) {
                realEx.push(x);
            }
        });

        var value = w.rand(start, stop - realEx.length);

        realEx.forEach(function(x) {
            if (value < x) {
                return value;
            }
            value ++;
        });

        return value;
    };

    w.test = function test(message, times, fn) {
        if (times instanceof Function) {
            fn = times;
            times = 1;
        }

        var tests = w.id('bedrock-tests');
        if (tests === null) {
            tests = w.newDom('ol', { id: 'bedrock-tests' });
            w.body.append(tests);
        }

        var testLi = w.newDom('li');
        var state = w.newDom('span');
        var messageDom = w.newDom('span');

        var pass;
        try {
            pass = w.range(times).all(fn);
            messageDom.appendText(message);
        }
        catch (e) {
            pass = false;
            console.error(e.stack);
            var errorDom = w.newDom('span');
            errorDom.style.color = 'red';
            errorDom.style.fontWeight = 'bold';
            errorDom.appendText('[{0}: {1}]'.format(e.name, e.message));

            messageDom.append(errorDom);
            messageDom.appendText(' ({0})'.format(message));
        }

        state.style.fontWeight = 'bold';

        if (pass){
            state.style.color = 'green';
            state.textContent = 'Pass';
        } else {
            state.style.color = 'red';
            state.textContent = 'FAIL';
        }

        testLi.append(state);
        testLi.appendText(' : ');
        testLi.append(messageDom);
        tests.append(testLi);
    };
})(window.w);

function MaxQueue(maxSize) {
    this.Add = function(item) {
        if (this.length == maxSize)
            this.pop();

        this.unshift(item);
    }
}

MaxQueue.prototype = new Array()

Object.defineProperties(Object.prototype, { extend: { enumerable: false, value: function(options) {
    for (var opt in options) {
        Object.defineProperty(this.prototype, opt, { enumerable: false, value: options[opt] });
    }
}}});

Object.extend({
    map: function(func) {
        var newObj = {};
        for (var o in this) {
            newObj[o] = func(this[o]);
        }
        return newObj;
    },
    in: function(arr) {
        if (arguments.length > 1)
            arr = Array.prototype.slice.call(arguments);

        arr.any(function(item) { return this === item; });
    }
});

Array.extend({
    reduce: function(func) {
        var best = this[0];
        for (var i = 1; i < this.length; i++) {
            best = func(best, this[i]);
        }
        return best;
    },
    mult: function(multiplier) {
        return this.map(function(n){
            return n * multiplier;
        });
    },
    numSort: function() {
        this.sort(function(a, b) { return a - b; });
    },
    pushArray: function(array) {
        Array.prototype.push.apply(this, array);
    },
    all: function(predicate) {
        this.forEach(function(item) {
            if (!predicate(item)) return false;
        });

        return true;
    },
    any: function(predicate) {
        this.forEach(function(item) {
            if (predicate(item)) return true;
        });

        return false;
    }
});

String.extend({
    format: function() {
        var args = arguments;
        return this.replace(/{(\d+)}/g, function(match, number) {
          return typeof args[number] != 'undefined'
            ? args[number]
            : match
          ;
        });
    }
});

NodeList.extend({
    toArray: function() {
        // http://jsperf.com/nodelist-to-array
        var arr = [];
        for (var i = 0, ref = arr.length = this.length; i < ref; i++) {
            arr[i] = this[i];
        }
        return arr;
    }
});

HTMLCollection.extend({
    toArray: function() {
        // http://jsperf.com/nodelist-to-array
        var arr = [];
        for (var i = 0, ref = arr.length = this.length; i < ref; i++) {
            arr[i] = this[i];
        }
        return arr;
    }
});

Node.extend({
    append: Node.prototype.appendChild
})

HTMLElement.extend ({
    appendText: function(text) {
        this.appendChild(document.createTextNode(text));
    },
    removeAll: function() {
        while(this.firstChild) {
            this.removeChild(this.firstChild);
        }
    },
    setText: function(text) {
        this.removeAll();
        this.appendText(text);
    }
})

Number.extend ({
    times: function(f) {
        var times = this;
        while (times--) {
            f();
        }
    }
})


text:
FORMAT: 1A

# nohu

# Group user

### GET /users{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + users (array[user])

### /users/{id}

+ Parameter

    + id: 1 (number) - user_id

### GET

+ Response 200 (application/json)
    + Attributes (base)
        + user (user)

### PUT

+ Response 200 (application/json)
    + Attributes (base)
        + user (user)

### GET /users/{id}/questions{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + questions (array[question])

### GET /users/{id}/answers{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + answers (array[answer])

### GET /user/{id}/comments{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + comments (array[comment])

### GET /user/{id}/favorite{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + questions (array[question])

### GET /user/{id}/inbox

+ Response 200 (application/json)
    + Attributes (base)
        + inbox (array[inbox])

### GET /user/{id}/inbox/unread

+ Response 200 (application/json)
    + Attributes (base)
        + inbox (array[inbox])

# Group question

### GET /questions{?tag,sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + questions (array[question])

### POST /questions

+ Response 200 (application/json)
    + Attributes (base)
        + question (question)

## /questions/{id}

+ Parameter

    + id: 1 (number) - question_id

### GET

+ Response 200 (application/json)
    + Attributes (base)
        + question (question)

### PUT

+ Response 200 (application/json)

### DELETE

+ Response 200 (application/json)
    + Attributes (base)
        + question (question)

### GET /questions/{id}/answers{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + answers (array[answer])

### POST /questions/{id}/answers

+ Response 200 (application/json)
    + Attributes (base)
        + answer (answer)

### GET /questions/{id}/comments{order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + comments (array[comment])

### POST /questions/{id}/comments

+ Response 200 (application/json)
    + Attributes (base)
        + comment (comment)

### POST /questions/{id}/votes

+ Response 200 (application/json)
    + Attributes (base)
        + question (question)

### POST /questions/{id}/favorite

+ Response 200 (application/json)
    + Attributes (base)
        + question (question)

# Group answer

### GET /answers{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + answers (array[answer])

## /answers/{id}

### GET

+ Response 200 (applicaion/json)
    + Attributes (base)
        + answer (answer)

### PUT

+ Response 200 (application/json)
    + Attributes (base)
        + answer (answer)

### DELETE

+ Response 200 (application/json)

### POST /answers/{id}/accept

+ Response 200 (application/json)
    + Attributes (base)
        + answer (answer)

### GET /answers/{id}/comments{order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + answers (array[answer])

### POST /answers/{id}/comments

+ Response 200 (application/json)
    + Attributes (base)
        + answer (answer)

### POST /answers/{id}/vote

+ Response 200 (application/json)
    + Attributes (base)
        + answer(answer)

### GET /answers/{id}/question

+ Response 200 (application/json)
    + Attributes (base)
        + question (question)

# Group comment

### GET /comments{?sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + comments (array[comment])

## /comments/{id}

### GET

+ Response 200 (application/json)
    + Attributes (base)
        + comment (comment)

### PUT

+ Response 200 (application/json)
    + Attributes (base)
        + comment (comment)

### DELETE

+ Response 200 (application/json)

### POST /comments/{id}/votes

+ Response 200 (application/json)
    + Attributes (base)
        + comment (comment)

# Group search

### GET /search{?intitle,body,answer,comment,sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + posts (array[post])

### GET /similar{?id,sort,order,page,page_size}

+ Response 200 (application/json)
    + Attributes (base)
        + questions (array[question])

# Group auth

### POST /auth/login

+ Response 200 (application/json)
    + Attributes (base)
        + tokens
            + access_token: 1232312314232 (string)
            + expire_in: 3600 (number) - seconds
            + refresh_token: sfjsaflksdjfl (string)

### GET /auth/logout

+ Response 200 (application/json)

### POST /auth/signup

+ Response 200 (application/json)
    + Attributes (base)
        + tokens
            + access_token: 1232312314232 (string)
            + expire_in: 3600 (number) - seconds
            + refresh_token: sfjsaflksdjfl (string)

### POST /auth/refresh_token

+ Response 200 (application/json)
    + Attributes (base)
        + tokens
            + access_token: 1232312314232 (string)
            + expire_in: 3600 (number) - seconds
            + refresh_token: sfjsaflksdjfl (string)

# Data Structures

## base (object)
+ status: 200 (number)
+ message: message (string)

## user (object)
+ uesr_id: 123456 (number)
+ username: spacelan (string)
+ email: spacelan@example.com (string)
+ avater: http://www.example.com/avater/1 (string)
+ display_name: spacelan (string)
+ reputation: 2333 (number)
+ accept_rate: 40 (number)
+ user_type: registed (string)
+ tags (tags)
+ signature: i love spacelan (string)
+ introduction: i love spacelan (string)
+ create_date: 1431879819 (number)
+ last_modified_date: 1431879819 (number)
+ last_access_date: 1431879819 (number)

## shallow_user (object)
+ uesr_id: 123456 (number)
+ user_type: registed (string)
+ reputation: 233 (number)
+ accept_rate: 40 (number)
+ avater: http://www.example.com/avater/1 (string)
+ display_name: spacelan (string)

## tags (array)
+ teeth (string)
+ eye (string)

## comment (object)
+ body: i love spacelan (string)
+ comment_id: 23423 (number)
+ create_date: 1431879819 (number)
+ owner (shallow_user)
+ reply_to_user (shallow_user)
+ relay_to
    + type: question (string) - question or answer or comment
    + id: 123213 (number)

## question (object)
+ tags (tags)
+ owner (shallow_user)
+ question_id: 123243 (number)
+ create_date: 1431879819 (number)
+ last_edit_date: 1431879819 (number)
+ last_editor (shallow_user)
+ last_activity_date: 1431879819 (number)
+ view_count: 10 (number)
+ down_vote_count: 2 (number)
+ up_vote_count: 2 (number)
+ favorite_count: 2 (number)
+ vote: 0 (number)
+ accept_answer_id: 12312 (number)
+ title: who am i (string)
+ body: who am i (string)
+ comments (object)
    + count: 123 (number)
    + ids (array)
        + 123456 (number)
        + 232323 (number)
+ answers (object)
    + count: 123 (number)
    + ids (array)
        + 123456 (number)
        + 232323 (number)
+ favorited: fasle (string) - private
+ upvoted: false (string) - private
+ downvoted: fasle (string) - private

## answer (object)
+ answer_id: 123145 (number)
+ question_id: 123123 (number)
+ owner (shallow_user)
+ create_date: 1431879819 (number)
+ last_edit_date: 1431879819 (number)
+ last_editor (shallow_user)
+ last_edit_reason why (string)
+ last_activity_date: 1431879819 (number)
+ is_accepted: false (string)
+ up_vote_count: 1 (number)
+ down_vote_count: 0 (number)
+ vote: 1 (number)
+ is_accepted: false (string)
+ body: who am i (string)
+ comments (array)
    + count: 123 (number)
    + ids (array)
        + 123456 (number)
        + 232323 (number)
+ upvoted: false (string) - private
+ downvoted: false (string) - private

## post (object)
+ post_id: 3214 (number)
+ post_type: question (string)
+ vote: 12 (number)
+ title: i love spacelan (string)
+ body: i love spacelan (string)
+ create_date: 1431879819 (number)
+ last_activity_date: 1431879819 (number)
+ last_edit_date: 1431879819 (number)

## inbox (object)
+ title: i love spacelan (string)
+ body: i love spaclan (string)
+ create_date: 1431879819 (number)
+ is_unread: false (string)
+ type: new answer (string)
+ answer_id: 134234 (number)
+ question_id: 1231 (number)
+ comment_id: 12312 (number)


text:
// automatically generated by the FlatBuffers compiler, do not modify

package com.google.ar.sceneform.lullmodel;

import java.nio.*;

import java.util.*;
import com.google.flatbuffers.*;

@SuppressWarnings("unused")
/**
 * ArcDef defines a portion of a circulur annulus.
 */
public final class ArcDef extends Struct {
  public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; }
  public ArcDef __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  /**
   * The angle (in radians) in which the start of the arc should be poised at.
   * 0 = vertical [0,1]. PI = [0,-1], PI/2 = [1,0].
   */
  public float startAngle() { return bb.getFloat(bb_pos + 0); }
  /**
   * Size of the arc measured in radians. PI = half circle, 2 PI = full circle.
   */
  public float angleSize() { return bb.getFloat(bb_pos + 4); }
  /**
   * Inner radius of the arc.
   */
  public float innerRadius() { return bb.getFloat(bb_pos + 8); }
  /**
   * Outer radius of the arc.
   */
  public float outerRadius() { return bb.getFloat(bb_pos + 12); }
  /**
   * Number of samples used for drawing the arc.
   */
  public int numSamples() { return bb.getInt(bb_pos + 16); }

  public static int createArcDef(FlatBufferBuilder builder, float startAngle, float angleSize, float innerRadius, float outerRadius, int numSamples) {
    builder.prep(4, 20);
    builder.putInt(numSamples);
    builder.putFloat(outerRadius);
    builder.putFloat(innerRadius);
    builder.putFloat(angleSize);
    builder.putFloat(startAngle);
    return builder.offset();
  }
}