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

<title>Principal (Java Platform SE 7 )</title>
<meta name="date" content="2014-12-18">
<meta name="keywords" content="org.omg.CORBA.Principal class">
<meta name="keywords" content="name()">
<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

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.omg.CORBA

Class Principal

java.lang.Object

org.omg.CORBA.Principal

Deprecated.

Deprecated by CORBA 2.2.

@Deprecated
public class Principal
extends Object

A class that contains information about the identity of
 the client, for access control
 and other purposes. It contains a single attribute, the name of the
 Principal, encoded as a sequence of bytes.

Constructor Summary

Constructors

Constructor and Description

Principal()

Deprecated.

Method Summary

Methods

Modifier and Type
Method and Description

byte[]
name()

Deprecated.

Deprecated by CORBA 2.2.

void
name(byte[] value)

Deprecated.

Deprecated by CORBA 2.2.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

Principal

public Principal()

Deprecated.

Method Detail

name

@Deprecated
public void name(byte[] value)

Deprecated. Deprecated by CORBA 2.2.

Sets the name of this Principal object to the given value.

Parameters:

value - the value to be set in the Principal

name

@Deprecated
public byte[] name()

Deprecated. Deprecated by CORBA 2.2.

Gets the name of this Principal object.

Returns:

the name of this Principal object

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 7

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

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


text:
namespace Hik.Communication.Scs.Communication
{
    /// <summary>
    ///     Communication states.
    /// </summary>
    public enum CommunicationStates
    {
        /// <summary>
        ///     Connected.
        /// </summary>
        Connected,

        /// <summary>
        ///     Disconnected.
        /// </summary>
        Disconnected
    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.appservice.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.appservice.fluent.models.WorkflowTriggerHistoryInner;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in WorkflowTriggerHistoriesClient. */
public interface WorkflowTriggerHistoriesClient {
    /**
     * Gets a list of workflow trigger histories.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param top The number of items to be included in the result.
     * @param filter The filter to apply on the operation. Options for filters include: Status, StartTime, and
     *     ClientTrackingId.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of workflow trigger histories as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<WorkflowTriggerHistoryInner> listAsync(
        String resourceGroupName, String name, String workflowName, String triggerName, Integer top, String filter);

    /**
     * Gets a list of workflow trigger histories.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of workflow trigger histories as paginated response with {@link PagedFlux}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedFlux<WorkflowTriggerHistoryInner> listAsync(
        String resourceGroupName, String name, String workflowName, String triggerName);

    /**
     * Gets a list of workflow trigger histories.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of workflow trigger histories as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<WorkflowTriggerHistoryInner> list(
        String resourceGroupName, String name, String workflowName, String triggerName);

    /**
     * Gets a list of workflow trigger histories.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param top The number of items to be included in the result.
     * @param filter The filter to apply on the operation. Options for filters include: Status, StartTime, and
     *     ClientTrackingId.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a list of workflow trigger histories as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<WorkflowTriggerHistoryInner> list(
        String resourceGroupName,
        String name,
        String workflowName,
        String triggerName,
        Integer top,
        String filter,
        Context context);

    /**
     * Gets a workflow trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a workflow trigger history along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<WorkflowTriggerHistoryInner>> getWithResponseAsync(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Gets a workflow trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a workflow trigger history on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<WorkflowTriggerHistoryInner> getAsync(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Gets a workflow trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a workflow trigger history.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    WorkflowTriggerHistoryInner get(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Gets a workflow trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a workflow trigger history along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<WorkflowTriggerHistoryInner> getWithResponse(
        String resourceGroupName,
        String name,
        String workflowName,
        String triggerName,
        String historyName,
        Context context);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Response<Flux<ByteBuffer>>> resubmitWithResponseAsync(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link PollerFlux} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    PollerFlux<PollResult<Void>, Void> beginResubmitAsync(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginResubmit(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginResubmit(
        String resourceGroupName,
        String name,
        String workflowName,
        String triggerName,
        String historyName,
        Context context);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return A {@link Mono} that completes when a successful response is received.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Mono<Void> resubmitAsync(
        String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void resubmit(String resourceGroupName, String name, String workflowName, String triggerName, String historyName);

    /**
     * Resubmits a workflow run based on the trigger history.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param name Site name.
     * @param workflowName The workflow name.
     * @param triggerName The workflow trigger name.
     * @param historyName The workflow trigger history name. Corresponds to the run name for triggers that resulted in a
     *     run.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void resubmit(
        String resourceGroupName,
        String name,
        String workflowName,
        String triggerName,
        String historyName,
        Context context);
}


text:
<?php

namespace Hautzi\SystemMailBundle\SystemMailer;

class ParsedMessage
{
    private $from = [];
    private $replyTo;

    private $to  = [];
    private $cc  = [];
    private $bcc = [];

    private $subject;

    private $messageHtml;

    private $messageText;

    /**
     * @param string $email
     * @param string $name
     *
     * @return array
     */
    protected function transformEmailName($email, $name = '')
    {
        if (!$name) {
            return [$email];
        }

        return [$email => $name];
    }

    /**
     * Gets from
     *
     * @return array
     */
    public function getFrom()
    {
        return $this->from;
    }

    /**
     * Sets from
     *
     * @param string $email
     * @param string $name
     *
     * @return static
     */
    public function setFrom($email, $name = null)
    {
        $this->from = $this->transformEmailName($email, $name);

        return $this;
    }

    /**
     * Gets replyTo
     *
     * @return string
     */
    public function getReplyTo()
    {
        return $this->replyTo;
    }

    /**
     * Sets replyTo
     *
     * @param mixed $replyTo
     *
     * @return static
     */
    public function setReplyTo($replyTo)
    {
        $this->replyTo = $replyTo;

        return $this;
    }

    /**
     * Gets to
     *
     * @return array
     */
    public function getTo()
    {
        return $this->to;
    }

    /**
     * Sets to
     *
     * @param string $email
     * @param string $name
     *
     * @return static
     */
    public function addTo($email, $name = null)
    {
        $this->to = array_merge($this->to, $this->transformEmailName($email, $name));

        return $this;
    }

    /**
     * Gets cc
     *
     * @return array
     */
    public function getCc()
    {
        return $this->cc;
    }

    /**
     * Sets cc
     *
     * @param string $email
     * @param string $name
     *
     * @return static
     */
    public function addCc($email, $name = null)
    {
        $this->cc = array_merge($this->cc, $this->transformEmailName($email, $name));

        return $this;
    }

    /**
     * Gets bcc
     *
     * @return array
     */
    public function getBcc()
    {
        return $this->bcc;
    }

    /**
     * Sets bcc
     *
     * @param string $email
     * @param string $name
     *
     * @return static
     */
    public function addBcc($email, $name = null)
    {
        $this->bcc = array_merge($this->bcc, $this->transformEmailName($email, $name));

        return $this;
    }

    /**
     * Gets subject
     *
     * @return string
     */
    public function getSubject()
    {
        return $this->subject;
    }

    /**
     * Sets subject
     *
     * @param string $subject
     *
     * @return static
     */
    public function setSubject($subject)
    {
        $this->subject = $subject;

        return $this;
    }

    /**
     * Gets messageHtml
     *
     * @return string
     */
    public function getMessageHtml()
    {
        return $this->messageHtml;
    }

    /**
     * Sets messageHtml
     *
     * @param string $messageHtml
     *
     * @return static
     */
    public function setMessageHtml($messageHtml)
    {
        $this->messageHtml = $messageHtml;

        return $this;
    }

    /**
     * Gets messageText
     *
     * @return string
     */
    public function getMessageText()
    {
        return $this->messageText;
    }

    /**
     * Sets messageText
     *
     * @param string $messageText
     *
     * @return static
     */
    public function setMessageText($messageText)
    {
        $this->messageText = $messageText;

        return $this;
    }
}


text:
from __future__ import absolute_import

from sentry.testutils import TestCase

from .util import invalid_schema
from sentry.api.validators.sentry_apps.schema import validate_component

class TestTextareaSchemaValidation(TestCase):
    def setUp(self):
        self.schema = {"type": "textarea", "name": "title", "label": "Title"}

    def test_valid_schema(self):
        validate_component(self.schema)

    def test_with_a_valid_default(self):
        self.schema["default"] = "issue.title"
        validate_component(self.schema)

    @invalid_schema
    def test_missing_name(self):
        del self.schema["name"]
        validate_component(self.schema)

    @invalid_schema
    def test_missing_label(self):
        del self.schema["label"]
        validate_component(self.schema)

    @invalid_schema
    def test_invalid_label_type(self):
        self.schema["label"] = 1
        validate_component(self.schema)

    @invalid_schema
    def test_invalid_name_type(self):
        self.schema["name"] = 1
        validate_component(self.schema)

    @invalid_schema
    def test_invalid_default_option(self):
        self.schema["default"] = "issue.id"
        validate_component(self.schema)


text:
package com.codeandstrings.niohttp.sessions;

import com.codeandstrings.niohttp.data.IdealBlockSize;
import com.codeandstrings.niohttp.data.Parameters;
import com.codeandstrings.niohttp.exceptions.http.HttpException;
import com.codeandstrings.niohttp.exceptions.tcp.CloseConnectionException;
import com.codeandstrings.niohttp.request.Request;
import com.codeandstrings.niohttp.response.Response;
import com.codeandstrings.niohttp.response.ResponseContent;
import com.codeandstrings.niohttp.response.ResponseMessage;

import java.io.IOException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.*;

public abstract class Session {

    /*
     * Session ID Management
     */
    protected static long lastSessionId = 0;
    protected long sessionId;

    /*
     * Our channel and selector
     */
    protected SocketChannel channel;
    protected Selector selector;
    protected Parameters parameters;
    protected long nextRequestId;

    /*
     * Request acceptance data
     */
    protected int maxRequestSize;

    /* Response Management */
    protected Queue<Request> requestQueue;
    protected Queue<Response> responseQueue;
    protected Queue<ResponseContent> contentQueue;

    /* Maps */
    protected Map<Long,Request> requestMap;
    protected Map<Long,Response> responseMap;

    /* Constructor */
    protected Session(SocketChannel channel, Selector selector, Parameters parameters) {

        this.sessionId = Session.lastSessionId;
        this.channel = channel;
        this.selector = selector;
        this.parameters = parameters;

        Session.lastSessionId++;

        this.maxRequestSize = IdealBlockSize.VALUE;
        this.nextRequestId = 0;

        this.requestMap = new HashMap<>();
        this.responseMap = new HashMap<>();

        this.requestQueue = new LinkedList<>();
        this.contentQueue = new LinkedList<>();
        this.responseQueue = new LinkedList<>();

    }

    public long getSessionId() {
        return sessionId;
    }

    protected long getNextRequestId() {
        long r = this.nextRequestId;
        this.nextRequestId++;
        return r;
    }

    public SocketChannel getChannel() {
        return this.channel;
    }

    protected void setSelectionRequest(boolean write)
            throws ClosedChannelException {

        int ops;

        if (write) {
            ops = SelectionKey.OP_READ | SelectionKey.OP_WRITE;
        } else {
            ops = SelectionKey.OP_READ;
        }

        this.channel.register(this.selector, ops, this);

    }

    public void queueMessage(ResponseMessage message) throws IOException {

        if (this.channel == null)
            return;

        if (!this.channel.isOpen() || !this.channel.isConnected())
            return;

        if (message instanceof Response) {

            Response response = (Response)message;
            this.responseQueue.add(response);

            if (response.getRequest() != null) {
                this.responseMap.put(response.getRequest().getRequestId(), response);
            }

        } else {
            this.contentQueue.add((ResponseContent)message);
        }

        this.setSelectionRequest(true);
    }

    public void removeRequest(Request request) {
        this.requestQueue.remove(request);
        this.requestMap.remove(request.getRequestId());
    }

    public Request getRequest(long requestId) {
        return this.requestMap.get(requestId);
    }

    public Response getResponse(long requestId) { return this.responseMap.get(requestId); }

    public abstract void resetHeaderReads();
    public abstract void socketWriteEvent() throws IOException, CloseConnectionException;
    public abstract Request socketReadEvent() throws IOException, CloseConnectionException, HttpException;
}


text:
package org.apache.ddlutils.platform.interbase;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections.map.ListOrderedMap;
import org.apache.ddlutils.Platform;
import org.apache.ddlutils.model.Column;
import org.apache.ddlutils.model.ForeignKey;
import org.apache.ddlutils.model.Index;
import org.apache.ddlutils.model.Table;
import org.apache.ddlutils.model.TypeMap;
import org.apache.ddlutils.platform.DatabaseMetaDataWrapper;
import org.apache.ddlutils.platform.JdbcModelReader;

/**
 * The Jdbc Model Reader for Interbase.
 *
 * @version $Revision: $
 */
public class InterbaseModelReader extends JdbcModelReader
{
    /**
     * Creates a new model reader for Interbase databases.
     *
     * @param platform The platform that this model reader belongs to
     */
    public InterbaseModelReader(Platform platform)
    {
        super(platform);
        setDefaultCatalogPattern(null);
        setDefaultSchemaPattern(null);
        setDefaultTablePattern("%");
        setDefaultColumnPattern("%");
    }

    /**
     * {@inheritDoc}
     */
    protected Table readTable(DatabaseMetaDataWrapper metaData, Map values) throws SQLException
    {
        Table table = super.readTable(metaData, values);

        if (table != null)
        {
            determineExtraColumnInfo(table);
            determineAutoIncrementColumns(table);
            adjustColumns(table);
        }

        return table;
    }

    /**
     * {@inheritDoc}
     */
    protected Collection readColumns(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        ResultSet columnData = null;

        try
        {
            List columns = new ArrayList();

            if (getPlatform().isDelimitedIdentifierModeOn())
            {
                // Jaybird has a problem when delimited identifiers are used as
                // it is not able to find the columns for the table
                // So we have to filter manually below
                columnData = metaData.getColumns(getDefaultTablePattern(), getDefaultColumnPattern());

                while (columnData.next())
                {
                    Map values = readColumns(columnData, getColumnsForColumn());

                    if (tableName.equals(values.get("TABLE_NAME")))
                    {
                        columns.add(readColumn(metaData, values));
                    }
                }
            }
            else
            {
                columnData = metaData.getColumns(tableName, getDefaultColumnPattern());

                while (columnData.next())
                {
                    Map values = readColumns(columnData, getColumnsForColumn());

                    columns.add(readColumn(metaData, values));
                }
            }

            return columns;
        }
        finally
        {
            closeResultSet(columnData);
        }
    }

    /**
     * Helper method that determines extra column info from the system tables: default value, precision, scale.
     *
     * @param table The table
     */
    protected void determineExtraColumnInfo(Table table) throws SQLException
    {
        final String query =
            "SELECT a.RDB$FIELD_NAME, a.RDB$DEFAULT_SOURCE, b.RDB$FIELD_PRECISION, b.RDB$FIELD_SCALE," +
            " b.RDB$FIELD_TYPE, b.RDB$FIELD_SUB_TYPE FROM RDB$RELATION_FIELDS a, RDB$FIELDS b" +
            " WHERE a.RDB$RELATION_NAME=? AND a.RDB$FIELD_SOURCE=b.RDB$FIELD_NAME";

        PreparedStatement prepStmt = null;

        try
        {
            prepStmt = getConnection().prepareStatement(query);
            prepStmt.setString(1, getPlatform().isDelimitedIdentifierModeOn() ? table.getName() : table.getName().toUpperCase());

            ResultSet rs = prepStmt.executeQuery();

            while (rs.next())
            {
                String columnName = rs.getString(1).trim();
                Column column     = table.findColumn(columnName, getPlatform().isDelimitedIdentifierModeOn());

                if (column != null)
                {
                    String defaultValue = rs.getString(2);

                    if (!rs.wasNull() && (defaultValue != null))
                    {
                        defaultValue = defaultValue.trim();
                        if (defaultValue.startsWith("DEFAULT "))
                        {
                            defaultValue = defaultValue.substring("DEFAULT ".length());
                        }
                        column.setDefaultValue(defaultValue);
                    }

                    short   precision          = rs.getShort(3);
                    boolean precisionSpecified = !rs.wasNull();
                    short   scale              = rs.getShort(4);
                    boolean scaleSpecified     = !rs.wasNull();

                    if (precisionSpecified)
                    {
                        // for some reason, Interbase stores the negative scale
                        column.setSizeAndScale(precision, scaleSpecified ? -scale : 0);
                    }

                    short dbType      = rs.getShort(5);
                    short blobSubType = rs.getShort(6);

                    // CLOBs are returned by the driver as VARCHAR
                    if (!rs.wasNull() && (dbType == 261) && (blobSubType == 1))
                    {
                        column.setTypeCode(Types.CLOB);
                    }
                }
            }
        }
        finally
        {
            closeStatement(prepStmt);
        }
    }

    /**
     * Helper method that determines the auto increment status using Interbase's system tables.
     *
     * @param table The table
     */
    protected void determineAutoIncrementColumns(Table table) throws SQLException
    {
        // Since for long table and column names, the generator name will be shortened
        // we have to determine for each column whether there is a generator for it
        final String query = "SELECT RDB$GENERATOR_NAME FROM RDB$GENERATORS";

        InterbaseBuilder builder = (InterbaseBuilder)getPlatform().getSqlBuilder();
        Column[]         columns = table.getColumns();
        HashMap          names   = new HashMap();
        String           name;

        for (int idx = 0; idx < columns.length; idx++)
        {
            name = builder.getGeneratorName(table, columns[idx]);
            if (!getPlatform().isDelimitedIdentifierModeOn())
            {
                name = name.toUpperCase();
            }
            names.put(name, columns[idx]);
        }

        Statement stmt = null;

        try
        {
            stmt = getConnection().createStatement();

            ResultSet rs = stmt.executeQuery(query);

            while (rs.next())
            {
                String generatorName = rs.getString(1).trim();
                Column column        = (Column)names.get(generatorName);

                if (column != null)
                {
                    column.setAutoIncrement(true);
                }
            }
        }
        finally
        {
            closeStatement(stmt);
        }
    }

    /**
     * Adjusts the columns in the table by fixing types and default values.
     *
     * @param table The table
     */
    protected void adjustColumns(Table table)
    {
        Column[] columns = table.getColumns();

        for (int idx = 0; idx < columns.length; idx++)
        {
            if (columns[idx].getTypeCode() == Types.FLOAT)
            {
                columns[idx].setTypeCode(Types.REAL);
            }
            else if ((columns[idx].getTypeCode() == Types.NUMERIC) || (columns[idx].getTypeCode() == Types.DECIMAL))
            {
                if ((columns[idx].getTypeCode() == Types.NUMERIC) && (columns[idx].getSizeAsInt() == 18) && (columns[idx].getScale() == 0))
                {
                    columns[idx].setTypeCode(Types.BIGINT);
                }
            }
            else if (TypeMap.isTextType(columns[idx].getTypeCode()))
            {
                columns[idx].setDefaultValue(unescape(columns[idx].getDefaultValue(), "'", "''"));
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    protected Collection readPrimaryKeyNames(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        List      pks   = new ArrayList();
        ResultSet pkData = null;

        try
        {
            if (getPlatform().isDelimitedIdentifierModeOn())
            {
                // Jaybird has a problem when delimited identifiers are used as
                // it is not able to find the primary key info for the table
                // So we have to filter manually below
                pkData = metaData.getPrimaryKeys(getDefaultTablePattern());
                while (pkData.next())
                {
                    Map values = readColumns(pkData, getColumnsForPK());

                    if (tableName.equals(values.get("TABLE_NAME")))
                    {
                        pks.add(readPrimaryKeyName(metaData, values));
                    }
                }
            }
            else
            {
                pkData = metaData.getPrimaryKeys(tableName);
                while (pkData.next())
                {
                    Map values = readColumns(pkData, getColumnsForPK());

                    pks.add(readPrimaryKeyName(metaData, values));
                }
            }
        }
        finally
        {
            closeResultSet(pkData);
        }
        return pks;
    }

    /**
     * {@inheritDoc}
     */
    protected Collection readForeignKeys(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
    {
        Map       fks    = new ListOrderedMap();
        ResultSet fkData = null;

        try
        {
            if (getPlatform().isDelimitedIdentifierModeOn())
            {
                // Jaybird has a problem when delimited identifiers are used as
                // it is not able to find the foreign key info for the table
                // So we have to filter manually below
                fkData = metaData.getForeignKeys(getDefaultTablePattern());
                while (fkData.next())
                {
                    Map values = readColumns(fkData, getColumnsForFK());

                    if (tableName.equals(values.get("FKTABLE_NAME")))
                    {
                        readForeignKey(metaData, values, fks);
                    }
                }
            }
            else
            {
                fkData = metaData.getForeignKeys(tableName);
                while (fkData.next())
                {
                    Map values = readColumns(fkData, getColumnsForFK());

                    readForeignKey(metaData, values, fks);
                }
            }
        }
        finally
        {
            closeResultSet(fkData);
        }
        return fks.values();
    }

    /**
     * {@inheritDoc}
     */
    protected boolean isInternalPrimaryKeyIndex(DatabaseMetaDataWrapper metaData, Table table, Index index) throws SQLException
    {
        final String query =
            "SELECT RDB$CONSTRAINT_NAME FROM RDB$RELATION_CONSTRAINTS " +
            "WHERE RDB$RELATION_NAME=? AND RDB$CONSTRAINT_TYPE=? AND RDB$INDEX_NAME=?";

        String            tableName = getPlatform().getSqlBuilder().getTableName(table);
        String            indexName = getPlatform().getSqlBuilder().getIndexName(index);
        PreparedStatement stmt      = null;

        try
        {
            stmt = getConnection().prepareStatement(query);
            stmt.setString(1, getPlatform().isDelimitedIdentifierModeOn() ? tableName : tableName.toUpperCase());
            stmt.setString(2, "PRIMARY KEY");
            stmt.setString(3, indexName);

            ResultSet resultSet = stmt.executeQuery();

            return resultSet.next();
        }
        finally
        {
            closeStatement(stmt);
        }
    }

    /**
     * {@inheritDoc}
     */
    protected boolean isInternalForeignKeyIndex(DatabaseMetaDataWrapper metaData, Table table, ForeignKey fk, Index index) throws SQLException
    {
        final String query =
            "SELECT RDB$CONSTRAINT_NAME FROM RDB$RELATION_CONSTRAINTS " +
            "WHERE RDB$RELATION_NAME=? AND RDB$CONSTRAINT_TYPE=? AND RDB$CONSTRAINT_NAME=? AND RDB$INDEX_NAME=?";

        String            tableName = getPlatform().getSqlBuilder().getTableName(table);
        String            indexName = getPlatform().getSqlBuilder().getIndexName(index);
        String            fkName    = getPlatform().getSqlBuilder().getForeignKeyName(table, fk);
        PreparedStatement stmt      = null;

        try
        {
            stmt = getConnection().prepareStatement(query);
            stmt.setString(1, getPlatform().isDelimitedIdentifierModeOn() ? tableName : tableName.toUpperCase());
            stmt.setString(2, "FOREIGN KEY");
            stmt.setString(3, fkName);
            stmt.setString(4, indexName);

            ResultSet resultSet = stmt.executeQuery();

            return resultSet.next();
        }
        finally
        {
            closeStatement(stmt);
        }
    }

    /**
     * {@inheritDoc}
     */
    public String determineSchemaOf(Connection connection, String schemaPattern, Table table) throws SQLException
    {
        ResultSet tableData  = null;
        ResultSet columnData = null;

        try
        {
            DatabaseMetaDataWrapper metaData = new DatabaseMetaDataWrapper();

            metaData.setMetaData(connection.getMetaData());
            metaData.setCatalog(getDefaultCatalogPattern());
            metaData.setSchemaPattern(schemaPattern == null ? getDefaultSchemaPattern() : schemaPattern);
            metaData.setTableTypes(getDefaultTableTypes());

            String tablePattern = table.getName();

            if (getPlatform().isDelimitedIdentifierModeOn())
            {
                tablePattern = tablePattern.toUpperCase();
            }

            tableData = metaData.getTables(tablePattern);

            boolean found  = false;
            String  schema = null;

            while (!found && tableData.next())
            {
                Map    values    = readColumns(tableData, getColumnsForTable());
                String tableName = (String)values.get("TABLE_NAME");

                if ((tableName != null) && (tableName.length() > 0))
                {
                    schema = (String)values.get("TABLE_SCHEM");
                    found  = true;

                    if (getPlatform().isDelimitedIdentifierModeOn())
                    {
                        // Jaybird has a problem when delimited identifiers are used as
                        // it is not able to find the columns for the table
                        // So we have to filter manually below
                        columnData = metaData.getColumns(getDefaultTablePattern(), getDefaultColumnPattern());
                    }
                    else
                    {
                        columnData = metaData.getColumns(tableName, getDefaultColumnPattern());
                    }

                    while (found && columnData.next())
                    {
                        values = readColumns(columnData, getColumnsForColumn());

                        if (getPlatform().isDelimitedIdentifierModeOn() &&
                            !tableName.equals(values.get("TABLE_NAME")))
                        {
                            continue;
                        }

                        if (table.findColumn((String)values.get("COLUMN_NAME"),
                                             getPlatform().isDelimitedIdentifierModeOn()) == null)
                        {
                            found = false;
                        }
                    }
                    columnData.close();
                    columnData = null;
                }
            }
            return found ? schema : null;
        }
        finally
        {
            closeResultSet(columnData);
            closeResultSet(tableData);
        }
    }
}


text:
namespace cc {

AnimationWorkletInput::AddAndUpdateState::AddAndUpdateState(
    WorkletAnimationId worklet_animation_id,
    std::string name,
    double current_time,
    std::unique_ptr<AnimationOptions> options,
    std::unique_ptr<AnimationEffectTimings> effect_timings)
    : worklet_animation_id(worklet_animation_id),
      name(name),
      current_time(current_time),
      options(std::move(options)),
      effect_timings(std::move(effect_timings)) {}
AnimationWorkletInput::AddAndUpdateState::AddAndUpdateState(
    AddAndUpdateState&&) = default;
AnimationWorkletInput::AddAndUpdateState::~AddAndUpdateState() = default;

#if DCHECK_IS_ON()
bool AnimationWorkletInput::ValidateId(int worklet_id) const {
  return base::ranges::all_of(added_and_updated_animations,
                              [worklet_id](auto& it) {
                                return it.worklet_animation_id.worklet_id ==
                                       worklet_id;
                              }) &&
         base::ranges::all_of(updated_animations,
                              [worklet_id](auto& it) {
                                return it.worklet_animation_id.worklet_id ==
                                       worklet_id;
                              }) &&
         base::ranges::all_of(removed_animations, [worklet_id](auto& it) {
           return it.worklet_id == worklet_id;
         });
}
#endif

AnimationWorkletInput::AnimationWorkletInput() = default;
AnimationWorkletInput::~AnimationWorkletInput() = default;

MutatorInputState::MutatorInputState() = default;
MutatorInputState::~MutatorInputState() = default;

bool MutatorInputState::IsEmpty() const {
  // If there is an AnimationWorkletInput entry in the map then that entry is
  // guranteed to be non-empty. So checking |inputs_| map emptiness is
  // sufficient.
  return inputs_.empty();
}

AnimationWorkletInput& MutatorInputState::EnsureWorkletEntry(int id) {
  auto it = inputs_.find(id);
  if (it == inputs_.end())
    it = inputs_.emplace_hint(it, id, new AnimationWorkletInput);

  return *it->second;
}

void MutatorInputState::Add(AnimationWorkletInput::AddAndUpdateState&& state) {
  AnimationWorkletInput& worklet_input =
      EnsureWorkletEntry(state.worklet_animation_id.worklet_id);
  worklet_input.added_and_updated_animations.push_back(std::move(state));
}
void MutatorInputState::Update(AnimationWorkletInput::UpdateState&& state) {
  AnimationWorkletInput& worklet_input =
      EnsureWorkletEntry(state.worklet_animation_id.worklet_id);
  worklet_input.updated_animations.push_back(std::move(state));
}
void MutatorInputState::Remove(WorkletAnimationId worklet_animation_id) {
  AnimationWorkletInput& worklet_input =
      EnsureWorkletEntry(worklet_animation_id.worklet_id);
  worklet_input.removed_animations.push_back(worklet_animation_id);
}

std::unique_ptr<AnimationWorkletInput> MutatorInputState::TakeWorkletState(
    int worklet_id) {
  auto it = inputs_.find(worklet_id);
  if (it == inputs_.end())
    return nullptr;

  std::unique_ptr<AnimationWorkletInput> result = std::move(it->second);
  inputs_.erase(it);
  return result;
}

AnimationWorkletOutput::AnimationWorkletOutput() = default;
AnimationWorkletOutput::~AnimationWorkletOutput() = default;

AnimationWorkletOutput::AnimationState::AnimationState(WorkletAnimationId id)
    : worklet_animation_id(id) {}
AnimationWorkletOutput::AnimationState::AnimationState(const AnimationState&) =
    default;
AnimationWorkletOutput::AnimationState::~AnimationState() = default;

}  // namespace cc


text:
<?php namespace Behinddesign\Chalkboard\Drivers;

use Behinddesign\Chalkboard\AbstractDriver;
use Behinddesign\Chalkboard\DriverInterface;
use Behinddesign\Chalkboard\Exceptions\ArrayNotExpectedException;

/**
 * Class DotEnv
 *
 * DotEnv is a simple KEV=value reader and writer.
 *
 * Alternative read syntax versions :
 * key = value
 * key = 'value'
 * key = "value"
 * key = "value' (Eww)
 *
 * Write syntax :
 * KEY=value
 *
 * This is useful for reading and writing system environment sh files for use with "source"
 * Please use ini driver if you wish to retain multi dimensional arrays.
 *
 * NOTE : this driver will not store multidimensional arrays, and will strip out any comments.
 *
 * @package Behinddesign\Chalkboard\Drivers
 */
class DotEnv extends AbstractDriver implements DriverInterface
{
    protected $registerExtensionHandling = [
        'env',
        'sh'
    ];

    /**
     * {@inheritdoc}
     */
    public function parse()
    {
        $regex = "/(?<var>[a-z0-9_]+)\\s*=\\s*(?:'|\")?(?<val>.+?)(?:'|\")?$/mi";

        preg_match_all($regex, $this->rawString, $matches);

        return array_combine($matches['var'], $this->boolHandling('bool', $matches['val']));
    }

    /**
     * {@inheritdoc}
     */
    public function process()
    {
        if (empty($this->processConfig)) {
            return '';
        }

        $lines = '';
        foreach ($this->processConfig as $key => $val) {
            if (is_array($val)) {
                throw new ArrayNotExpectedException($key . '\'s value should not be an array. DotEnv driver does not ' .
                    'support multiple dimension arrays.');
            }
            $lines .= $key . '=' . $this->boolHandling('string', $val) . "\n";
        }

        $lines = trim($lines);

        return $lines;
    }
}


text:
<?php

namespace SimpleLifestream\Providers;

/**
 * A provider for Twitter
 * @link http://stackoverflow.com/questions/12916539/simplest-php-example-for-retrieving-user-timeline-with-twitter-api-version-1-1
 */
class Twitter extends Adapter
{
    /** inline {@inheritdoc} */
    protected $url = 'https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=%s&count=%d';

    /** inline {@inheritdoc} */
    protected $settings = array(
        'consumer_key' => '',
        'consumer_secret' => '',
        'access_token' => '',
        'access_token_secret' => '',
        'resource' => '',
        'count' => 50,
    );

    /** inline {@inheritdoc} */
    public function getApiData()
    {
        $url = $this->getApiUrl();
        $oauth = array(
            'oauth_consumer_key' => $this->settings['consumer_key'],
            'oauth_token' => $this->settings['access_token'],
            'oauth_nonce' => uniqid(),
            'oauth_signature_method' => 'HMAC-SHA1',
            'oauth_timestamp' => time(),
            'oauth_version' => '1.0',
            'screen_name' => $this->settings['resource'],
            'count' => $this->settings['count'],
        );

        $baseInfo = $this->buildBaseString($url, 'GET', $oauth);
        $compositeKey = rawurlencode($this->settings['consumer_secret']) . '&' . rawurlencode($this->settings['access_token_secret']);
        $oauthSignature = base64_encode(hash_hmac('sha1', $baseInfo, $compositeKey, true));
        $oauth = array_merge($oauth, array('oauth_signature' => $oauthSignature));
        $header = array($this->buildAuthorizationHeader($oauth), 'Expect:');

        $options = $this->createRequestOptions($header);
        $response = $this->http->fetch($url, $options);
        $response = json_decode($response, true);

        if (!empty($response)) {
            return array_map(array($this, 'filterResponse'), $response);
        }

        return null;
    }

    /**
     * Creates the required parameters for the http wrapper.
     *
     * @link http://curl.haxx.se/docs/caextract.html
     * @link https://dev.twitter.com/docs/security/using-ssl
     *
     * @param array $header
     * @return array
     *
     * @throws RuntimeException when no cacert.pem was found
     */
    protected function createRequestOptions($header)
    {
        if (!file_exists($cert = __DIR__ . '/../Certificates/cacert.pem')) {
            throw new \RuntimeException(
                sprintf('The Twitter could not find the certificate in "%s"', $cert)
            );
        }

        $curl = array();
        if (function_exists('curl_init')) {
            $curl = array(
                CURLOPT_HTTPHEADER => $header,
                CURLOPT_CAINFO => $cert,
                CURLOPT_SSL_VERIFYPEER => true,
                CURLOPT_SSL_VERIFYHOST => 2,
            );
        }

        $fopen =  array(
            'http' => array(
                'header' => $header
            ),
            'ssl' => array(
                'verify_peer'   => true,
                'cafile'        => $cert,
                'verify_depth'  => 9,
                'CN_match'      => 'api.twitter.com'
            )
        );

        return array(
            'curl' => $curl,
            'fopen' => $fopen,
        );
    }

    /**
     * Method to generate the base string used by cURL
     *
     * @param string $baseURI
     * @param string $method
     * @param array $params
     * @return string Built base string
     */
    protected function buildBaseString($baseURI, $method, array $params = array())
    {
        // Strip querystring from url
        $baseURI = preg_replace('~\?.*~i', '', $baseURI);

        $r = array();
        ksort($params);
        foreach($params as $key => $value) {
            $r[] = $key . '=' . rawurlencode($value);
        }

        return $method . '&' . rawurlencode($baseURI). '&' . rawurlencode(implode('&', $r));
    }

    /**
     * Method to generate authorization header used by cURL
     *
     * @param array $oauth
     * @return string $return Header used by cURL/file_get_contents for request
     */
    protected function buildAuthorizationHeader(array $oauth = array())
    {
        $values = array();
        foreach($oauth as $key => $value) {
            $values[] = $key . '="' . rawurlencode($value) . '"';
        }

        return 'Authorization: OAuth ' . implode(', ', $values);
    }

    /** inline {@inheritdoc} */
    public function getApiUrl()
    {
        return sprintf($this->url, $this->settings['resource'], $this->settings['count']);
    }

    /**
     * Extracts media entities from a tweet response
     *
     * @param array $value
     * @return array
     */
    protected function getMedia(array $value)
    {
        $return = array();
        if (!isset($value['entities']) || !isset($value['entities']['media'])) {
            return $return;
        }

        foreach ((array) $value['entities']['media'] as $media) {
            $url = (isset($media['media_url_https']) ? $media['media_url_https'] : $media['media_url']);
            $extension = strtolower(pathinfo(parse_url($url, PHP_URL_PATH),PATHINFO_EXTENSION));
            if (in_array($extension, array('jpg', 'jpeg', 'png', 'gif'))) {
                $return[] = sprintf('', $url, $url, $url);
            } else {
                $return[] = sprintf('%s', $url, $url, $media['display_url']);
            }
        }

        return $return;
    }

    /**
     * Filters and formats the response
     *
     * @param array $value
     * @return array
     */
    protected function filterResponse(array $value = array())
    {
        $tweet = $tweetRaw = $value['text'];
        if (isset($value['retweeted_status'])) {
            $tweet = $tweetRaw = 'RT @' . $value['retweeted_status']['user']['screen_name'] . ': ' . $value['retweeted_status']['text'];
        }

        $tweet = preg_replace_callback('~\bhttp(s)?://([\w#$%&\~/=?@\/\.])+\b/?~i', function ($matches) {
            $url = $matches[0];
            if (!filter_var($url, FILTER_VALIDATE_URL)) {
                return $url;
            }

            return sprintf('%s', $url, $url);
        }, $tweet);

        $tweet = preg_replace('~#([\pL-_+]+)~ui', ' #$1', $tweet);
        $tweet = preg_replace('~@([\pL-_+]+)~ui', ' @$1', $tweet);

        $callbackReturn = $this->applyCallbacks($value);
        return array_merge($callbackReturn, array(
            'service'  => 'twitter',
            'type'     => 'tweeted',
            'resource' => $this->settings['resource'],
            'stamp'    => (int) strtotime($value['created_at']),
            'url'      => 'http://twitter.com/#!/' . $this->settings['resource'] . '/status/' . $value['id_str'],
            'text'     => $tweetRaw,
            'tweet_html' => $tweet,
            'tweet_media' => $this->getMedia($value),
        ));
    }

}
?>


text:
export * from './model/user';
export * from './repos/user';


text:
using System;
using System.IO;
using System.Reflection;
using System.Threading;

using Belikov.GenuineChannels.BroadcastEngine;
using Belikov.GenuineChannels.BufferPooling;
using Belikov.GenuineChannels.Messaging;
using Belikov.GenuineChannels.Parameters;
using Belikov.GenuineChannels.TransportContext;
using Belikov.GenuineChannels.Security;

namespace Belikov.GenuineChannels.Logbook
{
	/// <summary>
	/// Writes down debug records into the provided stream writer.
	/// </summary>
	public class BinaryLogWriter
	{
		/// <summary>
		/// Constructs an instance of the BinaryLogWriter class.
		/// </summary>
		/// <param name="stream">The destination stream.</param>
		public BinaryLogWriter(Stream stream)
		{
			this._stream = stream;
			this._binaryWriter = new BinaryWriter(this._stream);

			this.levels = new int[(int) LogCategory.TotalCategories];
			for ( int i = 0; i < this.levels.Length; i++ )
				this.levels[i] = 2;

			this.WriteVersionInformationEvent();
		}

		/// <summary>
		/// The target stream.
		/// </summary>
		public Stream Stream
		{
			get
			{
				return this._stream;
			}
		}
		private Stream _stream;

		/// <summary>
		/// Gets or sets a level of details of event representation.
		/// </summary>
		public int this[LogCategory logCategory]
		{
			get
			{
				return this.levels[(int) logCategory];
			}
			set
			{
				this.levels[(int) logCategory] = value;
			}
		}
		private int[] levels;

		/// <summary>
		/// The binary writer created on the stream.
		/// </summary>
		public BinaryWriter BinaryWriter
		{
			get
			{
				return this._binaryWriter;
			}
		}
		private BinaryWriter _binaryWriter;

		/// <summary>
		/// The lock to the stream.
		/// </summary>
		private object _streamLock
		{
			get
			{
				return this._stream;
			}
		}

		/// <summary>
		/// The header magic code: 0xAA, 0x4B, 0xE7, 0x78
		/// </summary>
		public const int StreamHeaderMagicCode = 0x78E74BAA;

		#region -- Helper operations ---------------------------------------------------------------

		/// <summary>
		/// Puts down a string or an empty string if the specified value is null.
		/// </summary>
		/// <param name="str">The string or a null reference.</param>
		private void WriteString(string str)
		{
			if (str == null)
				this.BinaryWriter.Write(string.Empty);
			else
				this.BinaryWriter.Write(str);
		}

		/// <summary>
		/// Puts down a string with parameters or an empty string if the specified value is null.
		/// </summary>
		/// <param name="str">The string or a null reference.</param>
		/// <param name="parameters">String parameters.</param>
		private void WriteStringWithParameters(string str, params object[] parameters)
		{
			this.WriteString(string.Format(str, parameters));
		}

		/// <summary>
		/// Puts down a string representation of the provided object or an empty string if the specified value is null.
		/// </summary>
		/// <param name="obj">The object or a null reference.</param>
		private void WriteObjectAsString(object obj)
		{
			if (obj == null)
				this.BinaryWriter.Write(string.Empty);
			else
				this.BinaryWriter.Write(obj.ToString());
		}

		/// <summary>
		/// Puts down a record represending the specified exception and all inner exceptions.
		/// </summary>
		/// <param name="exception">The exception.</param>
		private void WriteException(Exception exception)
		{
			if (exception == null)
				this.BinaryWriter.Write( (bool) false );
			else
			{
				this.BinaryWriter.Write( (bool) true );

				this.WriteString( exception.GetType().FullName );
				this.WriteString( exception.Message );
				this.WriteString( exception.StackTrace );

				this.WriteException(exception.InnerException);
			}
		}

		/// <summary>
		/// Puts down a structure describing the specified remote host.
		/// </summary>
		/// <param name="remote">The HostInformation.</param>
		private void WriteHostInformation(HostInformation remote)
		{
			if (remote == null)
				this.BinaryWriter.Write( (bool) false );
			else
			{
				this.BinaryWriter.Write( (bool) true );

				this.BinaryWriter.Write((int) remote.LocalHostUniqueIdentifier);
				this.BinaryWriter.Write((int) remote.RemoteHostUniqueIdentifier);
				this.WriteString(remote.Url);
				this.WriteString(remote.Uri);
				this.WriteString(remote.PrimaryUri);
				this.BinaryWriter.Write((int) GenuineUtility.GetMillisecondsLeft(remote.ExpireTime));
				this.WriteObjectAsString(remote.LocalPhysicalAddress);
				this.WriteObjectAsString(remote.PhysicalAddress);
			}
		}

		/// <summary>
		/// Puts down the ID of the remote host.
		/// </summary>
		/// <param name="remote">The remote host.</param>
		private void WriteHostInformationId(HostInformation remote)
		{
			this.BinaryWriter.Write( (bool) (remote != null) );
			if (remote != null)
				this.BinaryWriter.Write( (int) remote.LocalHostUniqueIdentifier );
		}

		/// <summary>
		/// Puts down a structure describing the specified message.
		/// </summary>
		/// <param name="message">The message.</param>
		/// <param name="isSent">Whether it will be executed on a remote host.</param>
		/// <param name="invocationTarget">The target of the invocation.</param>
		/// <param name="methodName">The name of the method.</param>
		private void WriteMessage(Message message, bool isSent, string invocationTarget, string methodName)
		{
			this.BinaryWriter.Write((int) message.SeqNo);
			this.BinaryWriter.Write((int) message.MessageId);
			this.BinaryWriter.Write((int) message.ReplyToId);
			this.BinaryWriter.Write( (bool) isSent);
			this.BinaryWriter.Write( (bool) message.IsOneWay);
			this.BinaryWriter.Write( (bool) message.IsSynchronous);
			this.BinaryWriter.Write( (int) message.GenuineMessageType);
			this.BinaryWriter.Write( (int) GenuineUtility.GetMillisecondsLeft(message.FinishTime));
			this.WriteString(invocationTarget);
			this.WriteString(methodName);

			// the size of the message
			if (message.Stream != null && message.Stream.CanSeek)
			{
				try
				{
					this.BinaryWriter.Write( (int) message.Stream.Length);
				}
				catch
				{
					this.BinaryWriter.Write( (int) 0);
				}
			}
			else
				this.BinaryWriter.Write( (int) 0);
		}

		/// <summary>
		/// Puts down the message id.
		/// </summary>
		/// <param name="message">The message.</param>
		private void WriteMessageSeqNo(Message message)
		{
			this.BinaryWriter.Write( (bool) (message != null) );
			if (message != null)
				this.BinaryWriter.Write( (int) message.SeqNo );
		}

		/// <summary>
		/// Puts down Security Session Parameters.
		/// </summary>
		/// <param name="parameters">The Security Session Parameters.</param>
		private void WriteSecuritySessionParameters(SecuritySessionParameters parameters)
		{
			this.BinaryWriter.Write( (bool) (parameters != null));
			if (parameters != null)
			{
				this.WriteString( parameters.Name);
				this.BinaryWriter.Write( (int) parameters.GenuineConnectionType);
				this.WriteString( parameters.ConnectionName);
				this.BinaryWriter.Write( (long) parameters.Timeout.Ticks);
				this.BinaryWriter.Write( (int) parameters.Attributes );
				this.BinaryWriter.Write( (long) parameters.CloseAfterInactivity.Ticks );
			}
		}

		/// <summary>
		/// Puts down the Security Session Identifier.
		/// </summary>
		/// <param name="securitySession">The Security Session.</param>
		private void WriteSecuritySessionId(SecuritySession securitySession)
		{
			this.BinaryWriter.Write( (bool) (securitySession != null) );
			if (securitySession != null)
				this.BinaryWriter.Write( (int) securitySession.SecuritySessionId );
		}

		/// <summary>
		/// Puts down a content of the stream.
		/// </summary>
		/// <param name="stream">The stream containing content.</param>
		private void WriteBinaryContent(Stream stream)
		{
			if (stream == null)
				this.BinaryWriter.Write( (bool) false );
			else
			{
				this.BinaryWriter.Write( (bool) true );

				using (BufferKeeper bufferKeeper = new BufferKeeper(0))
				{
					for ( ; ; )
					{
						int bytesRead = stream.Read(bufferKeeper.Buffer, 0, bufferKeeper.Buffer.Length);

						// if the end of the stream has been reached
						if (bytesRead <= 0)
						{
							this.BinaryWriter.Write( (int) 0);
							stream.Position = 0;
							return ;
						}

						this.BinaryWriter.Write( (int) bytesRead);
						this.BinaryWriter.Write(bufferKeeper.Buffer, 0, bytesRead);
					}
				}

			}
		}

		/// <summary>
		/// The lifetime id of the current execution.
		/// </summary>
		public static long LifetimeId
		{
			get
			{
				return _lifetimeId;
			}
		}
		private static long _lifetimeId = DateTime.Now.Ticks;

		/// <summary>
		/// Puts down a record header containing the magic code, type of the record, and current DateTime.
		/// </summary>
		/// <param name="binaryRecordVersion">The version of the record.</param>
		/// <param name="logCategory">The log category.</param>
		/// <param name="type">The type of the event.</param>
		/// <param name="author">The author.</param>
		public void WriteRecordHeader(BinaryRecordVersion binaryRecordVersion, LogCategory logCategory, LogMessageType type, string author)
		{
			this.BinaryWriter.Write(StreamHeaderMagicCode);
			this.BinaryWriter.Write((long) BinaryLogWriter.LifetimeId);
			this.BinaryWriter.Write((int) binaryRecordVersion);
			this.BinaryWriter.Write((int) logCategory);
			this.BinaryWriter.Write((long) DateTime.Now.Ticks);
			this.BinaryWriter.Write((int) type);
			this.WriteString( author);
		}

		/// <summary>
		/// Puts down all parameters from the specified parameter provider.
		/// </summary>
		/// <param name="iParameterProvider">The parameter provider.</param>
		public void WriteConnectionParameters(IParameterProvider iParameterProvider)
		{
			Type enumType = typeof(GenuineParameter);

			foreach (FieldInfo fieldInfo in enumType.GetFields())
				if (fieldInfo.FieldType == enumType)
				{
					GenuineParameter theCurrentParameter = (GenuineParameter) fieldInfo.GetValue(null);

					this.BinaryWriter.Write(true);
					this.WriteString( Enum.Format(enumType, theCurrentParameter, "g") );
					this.WriteString( iParameterProvider[theCurrentParameter] == null ? "<<null>>" : iParameterProvider[theCurrentParameter].ToString() );
				}

			this.BinaryWriter.Write(false);
		}

		/// <summary>
		/// Puts down a record describing a broadcast dispatcher.
		/// </summary>
		/// <param name="writeDispatcherSettings">A value indicating whether it is necessary to put down dispatcher's settings.</param>
		/// <param name="dispatcher">The broadcast dispatcher.</param>
		public void WriteDispatcherSettings(bool writeDispatcherSettings, Dispatcher dispatcher)
		{
			this.BinaryWriter.Write( (bool) writeDispatcherSettings );
			this.BinaryWriter.Write( (int) dispatcher.DbgDispatcherId );
			this.WriteString( dispatcher.DbgDispatcherName );

			if (! writeDispatcherSettings)
				return ;

			this.BinaryWriter.Write( true );
			this.WriteString("Interface");
			this.WriteString( dispatcher.SupportedInterface.ToString() );

			this.BinaryWriter.Write( true );
			this.WriteString("ReceiveResultsTimeOut");
			this.WriteString( dispatcher.ReceiveResultsTimeOut.TotalMilliseconds.ToString() );

			this.BinaryWriter.Write( true );
			this.WriteString("CallIsAsync");
			this.WriteString( dispatcher.CallIsAsync.ToString() );

			this.BinaryWriter.Write( true );
			this.WriteString("MaximumNumberOfConsecutiveFailsToExcludeReceiverAutomatically");
			this.WriteString( dispatcher.MaximumNumberOfConsecutiveFailsToExcludeReceiverAutomatically.ToString() );

			this.BinaryWriter.Write( true );
			this.WriteString("MaximumNumberOfConsecutiveFailsToEnableSimulationMode");
			this.WriteString( dispatcher.MaximumNumberOfConsecutiveFailsToEnableSimulationMode.ToString() );

			this.BinaryWriter.Write( true );
			this.WriteString("IgnoreRecurrentCalls");
			this.WriteString( dispatcher.IgnoreRecurrentCalls.ToString() );

			this.BinaryWriter.Write( true );
			this.WriteString("Local URI base");
			this.WriteString( GenuineUtility.DefaultHostIdentifier.ToString("N") );

			this.BinaryWriter.Write( false );
		}

		/// <summary>
		/// Puts down a record containing a reference to the specified ResultCollected.
		/// </summary>
		/// <param name="resultCollector">ResultCollector.</param>
		public void WriteResultCollectorId(ResultCollector resultCollector)
		{
			this.BinaryWriter.Write( (bool) (resultCollector != null) );
			if (resultCollector != null)
				this.BinaryWriter.Write( (int) resultCollector.DbgResultCollectorId);
		}

		/// <summary>
		/// Puts down a record containing information about the specified broadcast recipient.
		/// </summary>
		/// <param name="writeFullInformation">True if it is necessary to write all settings of the ReceiverInfo.</param>
		/// <param name="receiverInfo">The ReceiverInfo.</param>
		public void WriteReceiverInfo(bool writeFullInformation, ReceiverInfo receiverInfo)
		{
			this.BinaryWriter.Write( receiverInfo != null );
			if (receiverInfo == null)
				return ;

			this.BinaryWriter.Write( (int) receiverInfo.DbgRecipientId );
			this.BinaryWriter.Write( (bool) writeFullInformation );

			if (! writeFullInformation)
				return ;

			this.WriteString( receiverInfo.MbrUri);
			this.BinaryWriter.Write((bool) receiverInfo.Local);

			if (receiverInfo.GeneralBroadcastSender != null)
				this.WriteString( receiverInfo.GeneralBroadcastSender.Court);
			else
				this.BinaryWriter.Write(string.Empty);
		}

		#endregion

		#region -- Events --------------------------------------------------------------------------

		/// <summary>
		/// Puts down a record describing an implementation warning.
		/// </summary>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event.</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="sourceThreadId">The id of the thread.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteImplementationWarningEvent(string author, LogMessageType type, Exception exception,
			int sourceThreadId, string sourceThreadName, string description, params object[] parameters)
		{
			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.ImplementationWarning, LogCategory.ImplementationWarning, type, author);

				this.WriteException( exception );
				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString(sourceThreadName);

				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record describing a general Genuine Channels event.
		/// </summary>
		/// <param name="logCategory">The category of the event.</param>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="message">The message associated with the event.</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="content">The content associated with the record.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="securitySession">The Security Session.</param>
		/// <param name="securitySessionName">The name of the Security Session</param>
		/// <param name="connectionId">The identifier of the connection.</param>
		/// <param name="number1">An additional integer parameter.</param>
		/// <param name="number2">An additional integer parameter.</param>
		/// <param name="number3">An additional integer parameter.</param>
		/// <param name="string1">The first string that elaborates the current event.</param>
		/// <param name="string2">The second string that elaborates the current event.</param>
		/// <param name="string3">The third string that elaborates the current event.</param>
		/// <param name="string4">The fourth string that elaborates the current event.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteEvent(LogCategory logCategory, string author, LogMessageType type, Exception exception,
			Message message, HostInformation remote, Stream content, int sourceThreadId, string sourceThreadName,
			SecuritySession securitySession, string securitySessionName,
			int connectionId, int number1, int number2, int number3, string string1, string string2, string string3, string string4, string description, params object[] parameters)
		{
			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.GeneralRecord, logCategory, type, author);
				this.WriteException( exception );

				this.WriteMessageSeqNo( message );
				this.WriteHostInformationId( remote );
				this.WriteBinaryContent( content );

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.WriteSecuritySessionId( securitySession );
				this.WriteString( securitySessionName );

				this.BinaryWriter.Write( (int) connectionId );

				this.BinaryWriter.Write( (int) number1 );
				this.BinaryWriter.Write( (int) number2 );
				this.BinaryWriter.Write( (int) number3 );

				this.WriteString( string1 );
				this.WriteString( string2 );
				this.WriteString( string3 );
				this.WriteString( string4 );

				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record representing an event describing a Message Processing event.
		/// </summary>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="message">The message associated with the event.</param>
		/// <param name="isSent">Whether the message is a request to the remote service (or a response from that service).</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="content">The content associated with the record.</param>
		/// <param name="invocationTarget">The target of the request (a null reference if it's a response).</param>
		/// <param name="methodName">The name of the method.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="transportName">The name of the transport.</param>
		/// <param name="connectionId">The identifier of the connection.</param>
		/// <param name="clssId">The identifier of the Security Session used on the connection level.</param>
		/// <param name="clssName">The name of the Security Session used on the connection level.</param>
		/// <param name="ilssId">The identifier of the Security Session used on the invocation level.</param>
		/// <param name="ilssName">The name of the Security Session used on the invocation level.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteMessageCreatedEvent(string author, LogMessageType type, Exception exception, Message message, bool isSent,
			HostInformation remote, Stream content, string invocationTarget, string methodName, int sourceThreadId,
			string sourceThreadName, string transportName, int connectionId,
			int clssId, string clssName, int ilssId, string ilssName, string description, params object[] parameters)
		{
			if (message == null)
			{
				this.WriteImplementationWarningEvent("BinaryLogWriter.WriteMessageCreatedEvent", LogMessageType.Error, null,
					sourceThreadId, sourceThreadName, "The message is not provided. Stack trace: " + Environment.StackTrace);
				return ;
			}

			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.MessageRecord, LogCategory.MessageProcessing, type, author);
				this.WriteException( exception );

				this.WriteMessage( message, isSent, invocationTarget, methodName );
				this.WriteHostInformationId( remote );
				this.WriteBinaryContent( content );

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.WriteString( transportName);
				this.BinaryWriter.Write( (int) connectionId );
				this.BinaryWriter.Write( (int) clssId );
				this.WriteString( clssName );
				this.BinaryWriter.Write( (int) ilssId );
				this.WriteString( ilssName );
				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record representing an event connected with the specified Security Session Parameters.
		/// </summary>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="message">The message associated with the event.</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="securitySessionParameters">The Security Session Parameters.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteSecuritySessionParametersEvent(string author, LogMessageType type, Exception exception,
			Message message, HostInformation remote, int sourceThreadId, string sourceThreadName,
			SecuritySessionParameters securitySessionParameters, string description, params object[] parameters)
		{
			if (message == null || securitySessionParameters == null)
			{
				this.WriteImplementationWarningEvent("BinaryLogWriter.WriteMessageCreatedEvent", LogMessageType.Error, null,
					sourceThreadId, sourceThreadName, "The message or SSP is not provided. Stack trace: " + Environment.StackTrace);
				return ;
			}

			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.SecuritySessionParameters, LogCategory.Security, type, author);
				this.WriteException( exception );

				this.WriteMessageSeqNo(message);
				this.WriteHostInformationId(remote);

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.WriteSecuritySessionParameters( securitySessionParameters );
				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}

		}

		/// <summary>
		/// Puts down detailed information about the specified instance of the HostInformation class.
		/// </summary>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="securitySession">The Security Session.</param>
		/// <param name="securitySessionName">The name of the Security Session</param>
		/// <param name="connectionId">The connection identifier.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteHostInformationEvent(string author, LogMessageType type, Exception exception,
			HostInformation remote, int sourceThreadId, string sourceThreadName,
			SecuritySession securitySession, string securitySessionName, int connectionId,
			string description, params object[] parameters)
		{
			if (remote == null)
			{
				this.WriteImplementationWarningEvent("BinaryLogWriter.WriteHostInformationCreatedEvent", LogMessageType.Error, null,
					sourceThreadId, sourceThreadName, "The reference is null. Stack trace: " + Environment.StackTrace);
				return ;
			}

			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.HostInformationInfo, LogCategory.HostInformation, type, author);
				this.WriteException( exception );

				this.WriteHostInformation(remote);

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.WriteSecuritySessionId( securitySession );
				this.WriteString( securitySessionName );

				this.BinaryWriter.Write( (int) connectionId );
				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record containing Connection Parameters.
		/// </summary>
		/// <param name="logCategory">The category of the event.</param>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="iParameterProvider">The connection parameters.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="connectionId">The identifier of the connection.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteConnectionParameterEvent(LogCategory logCategory, string author, LogMessageType type, Exception exception,
			HostInformation remote, IParameterProvider iParameterProvider, int sourceThreadId, string sourceThreadName,
			int connectionId, string description, params object[] parameters)
		{
			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.ConnectionParametersRecord, logCategory, type, author);
				this.WriteException( exception );

				this.WriteHostInformationId( remote );
				this.BinaryWriter.Write( (int) connectionId );
				this.WriteConnectionParameters(iParameterProvider);

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record describing the transport sending or receiving content actions.
		/// </summary>
		/// <param name="logCategory">The category of the event.</param>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="message">The message associated with the event.</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="content">The content associated with the record.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="connectionId">The identifier of the connection.</param>
		/// <param name="contentSize">The size of the content.</param>
		/// <param name="remoteHostAddress">The address of the remote host.</param>
		/// <param name="string1">The first string that elaborates the current event.</param>
		/// <param name="string2">The second string that elaborates the current event.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteTransportContentEvent(LogCategory logCategory, string author, LogMessageType type, Exception exception,
			Message message, HostInformation remote, Stream content, int sourceThreadId, string sourceThreadName,
			int connectionId, int contentSize, string remoteHostAddress, string string1, string string2,
			string description, params object[] parameters)
		{
			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.TransportContentRecord, logCategory, type, author);
				this.WriteException( exception );

				this.WriteMessageSeqNo( message );
				this.WriteHostInformationId( remote );
				this.WriteBinaryContent( content );

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.BinaryWriter.Write( (int) connectionId );
				this.BinaryWriter.Write( (int) contentSize );
				this.WriteString( remoteHostAddress );

				this.WriteString( string1 );
				this.WriteString( string2 );
				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record describing a general Genuine Channels event.
		/// </summary>
		/// <param name="logCategory">The category of the event.</param>
		/// <param name="author">The author.</param>
		/// <param name="type">The type of the event(Subcategory).</param>
		/// <param name="exception">The exception associated with the event.</param>
		/// <param name="message">The message associated with the event.</param>
		/// <param name="remote">The remote host participating in the event.</param>
		/// <param name="content">The content associated with the record.</param>
		/// <param name="sourceThreadId">The id of the thread where the invocation was made.</param>
		/// <param name="sourceThreadName">The name of the thread.</param>
		/// <param name="securitySession">The Security Session.</param>
		/// <param name="securitySessionName">The name of the Security Session</param>
		/// <param name="writeDispatcherSettings">A value indicating whether it is necessary to put down broadcast dispatcher's settings.</param>
		/// <param name="dispatcher">The broadcast dispatcher.</param>
		/// <param name="resultCollector">The broadcast result collector.</param>
		/// <param name="writeReceiverInfoSettings">A value indicating whether it is necessary to put down information about the specified broadcast recipient.</param>
		/// <param name="receiverInfo">The broadcast recipient.</param>
		/// <param name="string1">The first string that elaborates the current event.</param>
		/// <param name="string2">The second string that elaborates the current event.</param>
		/// <param name="description">The description of the event.</param>
		/// <param name="parameters">Parameters to the description.</param>
		public void WriteBroadcastEngineEvent(LogCategory logCategory, string author, LogMessageType type, Exception exception,
			Message message, HostInformation remote, Stream content, int sourceThreadId, string sourceThreadName,
			SecuritySession securitySession, string securitySessionName,
			bool writeDispatcherSettings, Dispatcher dispatcher, ResultCollector resultCollector, bool writeReceiverInfoSettings,
			ReceiverInfo receiverInfo, string string1, string string2, string description, params object[] parameters)
		{
			if (dispatcher == null)
			{
				this.WriteImplementationWarningEvent("BinaryLogWriter.WriteBroadcastEngineEvent", LogMessageType.Error, null,
					sourceThreadId, sourceThreadName, "The reference is null. Stack trace: " + Environment.StackTrace);
				return ;
			}

			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.TransportBroadcastEngineRecord, logCategory, type, author);
				this.WriteException( exception );

				this.WriteMessageSeqNo( message );
				this.WriteHostInformationId( remote );
				this.WriteBinaryContent( content );

				this.BinaryWriter.Write( (int) sourceThreadId);
				this.WriteString( sourceThreadName );

				this.WriteSecuritySessionId( securitySession );
				this.WriteString( securitySessionName );

				this.WriteResultCollectorId(resultCollector);
				this.WriteDispatcherSettings(writeDispatcherSettings, dispatcher);
				this.WriteReceiverInfo(writeReceiverInfoSettings, receiverInfo);

				this.WriteString( string1 );
				this.WriteString( string2 );
				this.WriteStringWithParameters( description, parameters);

				this.BinaryWriter.Flush();
			}
		}

		/// <summary>
		/// Puts down a record containing information about the current environment.
		/// </summary>
		protected void WriteVersionInformationEvent()
		{
			lock (this._streamLock)
			{
				this.WriteRecordHeader(BinaryRecordVersion.VersionRecord, LogCategory.Version, LogMessageType.Warning, "BinaryLogWriter.WriteVersionInformationEvent");

				this.BinaryWriter.Write( (bool) true );
				this.WriteString("Genuine Channels Version");
				this.WriteString(this.GetType().AssemblyQualifiedName);

				this.BinaryWriter.Write( (bool) true );
				this.WriteString("Is Genuine Channels in GAC");
				this.WriteString(this.GetType().Assembly.GlobalAssemblyCache.ToString());

				this.BinaryWriter.Write( (bool) true );
				this.WriteString("Location of Genuine Channels");
				this.WriteString(this.GetType().Assembly.Location);

				// Framework 1.1 only
//				this.BinaryWriter.Write( (bool) true );
//				this.WriteString("Image Runtime Version");
//				this.WriteString(this.GetType().Assembly.ImageRuntimeVersion);

				this.BinaryWriter.Write( (bool) true );
				this.WriteString("OS version");
				this.WriteString(Environment.OSVersion.ToString());

				this.BinaryWriter.Write( (bool) true );
				this.WriteString("CLR version");
				this.WriteString(Environment.Version.ToString());

				this.BinaryWriter.Write( (bool) false );

				this.BinaryWriter.Flush();
			}
		}

		#endregion

		#region -- Utility functions ---------------------------------------------------------------

		/// <summary>
		/// Parses and returns the invocation target.
		/// </summary>
		/// <param name="methodName">The name of the method.</param>
		/// <param name="typeName">The name of the type.</param>
		/// <returns>The invocation target.</returns>
		public static string ParseInvocationMethod(string methodName, string typeName)
		{
			if (methodName == null)
				methodName = string.Empty;
			if (typeName == null)
				typeName = string.Empty;

			int commaPos = typeName.IndexOf(',');

			if (commaPos > 0)
				return typeName.Substring(0, commaPos) + "." + methodName;
			return typeName + "; " + methodName;
		}

		#endregion

	}
}


text:
shellty
=======

Typesafe programming language that compiles to bash


text:
package org.zoomeye.api;

public class ErrorBody {
/*
  "url": "https://www.zoomeye.org/api/doc#authenticate",
  "message": "Invalid JWT header, May miss JWT prefix",
  "error": "unauthorized"
 */
  private String url;
  private String message;
  private String error;

  public String getUrl() {
    return url;
  }

  public String getMessage() {
    return message;
  }

  public String getError() {
    return error;
  }

  public ErrorBody() {
  }

  public ErrorBody(String url, String message, String error) {
    this.url = url;
    this.message = message;
    this.error = error;
  }
}


text:
package apple.healthkit;

import apple.NSObject;
import apple.foundation.NSArray;
import apple.foundation.NSCoder;
import apple.foundation.NSMethodSignature;
import apple.foundation.NSSet;
import apple.foundation.protocol.NSCopying;
import apple.foundation.protocol.NSSecureCoding;
import org.moe.natj.c.ann.FunctionPtr;
import org.moe.natj.general.NatJ;
import org.moe.natj.general.Pointer;
import org.moe.natj.general.ann.Generated;
import org.moe.natj.general.ann.Library;
import org.moe.natj.general.ann.Mapped;
import org.moe.natj.general.ann.MappedReturn;
import org.moe.natj.general.ann.NInt;
import org.moe.natj.general.ann.NUInt;
import org.moe.natj.general.ann.Owned;
import org.moe.natj.general.ann.Runtime;
import org.moe.natj.general.ptr.VoidPtr;
import org.moe.natj.objc.Class;
import org.moe.natj.objc.ObjCRuntime;
import org.moe.natj.objc.SEL;
import org.moe.natj.objc.ann.ObjCClassBinding;
import org.moe.natj.objc.ann.ProtocolClassMethod;
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.map.ObjCObjectMapper;

/**
 * HKWorkoutConfiguration
 *

 * An HKWorkoutConfiguration is an object that can be used to describe the workout activity.
 */
@Generated
@Library("HealthKit")
@Runtime(ObjCRuntime.class)
@ObjCClassBinding
public class HKWorkoutConfiguration extends NSObject implements NSCopying, NSSecureCoding {
    static {
        NatJ.register();
    }

    @Generated
    protected HKWorkoutConfiguration(Pointer peer) {
        super(peer);
    }

    @Generated
    @Selector("accessInstanceVariablesDirectly")
    public static native boolean accessInstanceVariablesDirectly();

    @Generated
    @Owned
    @Selector("alloc")
    public static native HKWorkoutConfiguration alloc();

    @Owned
    @Generated
    @Selector("allocWithZone:")
    public static native HKWorkoutConfiguration allocWithZone(VoidPtr zone);

    @Generated
    @Selector("automaticallyNotifiesObserversForKey:")
    public static native boolean automaticallyNotifiesObserversForKey(String key);

    @Generated
    @Selector("cancelPreviousPerformRequestsWithTarget:")
    public static native void cancelPreviousPerformRequestsWithTarget(@Mapped(ObjCObjectMapper.class) Object aTarget);

    @Generated
    @Selector("cancelPreviousPerformRequestsWithTarget:selector:object:")
    public static native void cancelPreviousPerformRequestsWithTargetSelectorObject(
            @Mapped(ObjCObjectMapper.class) Object aTarget, SEL aSelector,
            @Mapped(ObjCObjectMapper.class) Object anArgument);

    @Generated
    @Selector("classFallbacksForKeyedArchiver")
    public static native NSArray<String> classFallbacksForKeyedArchiver();

    @Generated
    @Selector("classForKeyedUnarchiver")
    public static native Class classForKeyedUnarchiver();

    @Generated
    @Selector("debugDescription")
    public static native String debugDescription_static();

    @Generated
    @Selector("description")
    public static native String description_static();

    @Generated
    @Selector("hash")
    @NUInt
    public static native long hash_static();

    @Generated
    @Selector("instanceMethodForSelector:")
    @FunctionPtr(name = "call_instanceMethodForSelector_ret")
    public static native NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(SEL aSelector);

    @Generated
    @Selector("instanceMethodSignatureForSelector:")
    public static native NSMethodSignature instanceMethodSignatureForSelector(SEL aSelector);

    @Generated
    @Selector("instancesRespondToSelector:")
    public static native boolean instancesRespondToSelector(SEL aSelector);

    @Generated
    @Selector("isSubclassOfClass:")
    public static native boolean isSubclassOfClass(Class aClass);

    @Generated
    @Selector("keyPathsForValuesAffectingValueForKey:")
    public static native NSSet<String> keyPathsForValuesAffectingValueForKey(String key);

    @Generated
    @Owned
    @Selector("new")
    public static native HKWorkoutConfiguration new_objc();

    @Generated
    @Selector("resolveClassMethod:")
    public static native boolean resolveClassMethod(SEL sel);

    @Generated
    @Selector("resolveInstanceMethod:")
    public static native boolean resolveInstanceMethod(SEL sel);

    @Generated
    @Selector("setVersion:")
    public static native void setVersion_static(@NInt long aVersion);

    @Generated
    @Selector("superclass")
    public static native Class superclass_static();

    @Generated
    @Selector("supportsSecureCoding")
    public static native boolean supportsSecureCoding();

    @Generated
    @Selector("version")
    @NInt
    public static native long version_static();

    /**
     * [@property] activityType
     *

     * Indicates the type of workout for the configuration.
     */
    @Generated
    @Selector("activityType")
    @NUInt
    public native long activityType();

    @Generated
    @Owned
    @Selector("copyWithZone:")
    @MappedReturn(ObjCObjectMapper.class)
    public native Object copyWithZone(VoidPtr zone);

    @Generated
    @Selector("encodeWithCoder:")
    public native void encodeWithCoder(NSCoder coder);

    @Generated
    @Selector("init")
    public native HKWorkoutConfiguration init();

    @Generated
    @Selector("initWithCoder:")
    public native HKWorkoutConfiguration initWithCoder(NSCoder coder);

    /**
     * [@property] lapLength
     *

     * Indicates the length of the pool, when the workout location type is pool.
     *

     * This metric represents the length of the pool where the workout takes place. It should be a quantity with
     * a unit representing length.
     */
    @Generated
    @Selector("lapLength")
    public native HKQuantity lapLength();

    /**
     * [@property] locationType
     *

     * Indicates the type of location (indoors vs. outdoors) for the configuration.
     */
    @Generated
    @Selector("locationType")
    @NInt
    public native long locationType();

    /**
     * [@property] activityType
     *

     * Indicates the type of workout for the configuration.
     */
    @Generated
    @Selector("setActivityType:")
    public native void setActivityType(@NUInt long value);

    /**
     * [@property] lapLength
     *

     * Indicates the length of the pool, when the workout location type is pool.
     *

     * This metric represents the length of the pool where the workout takes place. It should be a quantity with
     * a unit representing length.
     */
    @Generated
    @Selector("setLapLength:")
    public native void setLapLength(HKQuantity value);

    /**
     * [@property] locationType
     *

     * Indicates the type of location (indoors vs. outdoors) for the configuration.
     */
    @Generated
    @Selector("setLocationType:")
    public native void setLocationType(@NInt long value);

    /**
     * [@property] swimmingLocationType
     *

     * Indicates the type of swimming location (pool vs. open water) where the workout will take place.
     */
    @Generated
    @Selector("setSwimmingLocationType:")
    public native void setSwimmingLocationType(@NInt long value);

    @Generated
    @ProtocolClassMethod("supportsSecureCoding")
    public boolean _supportsSecureCoding() {
        return supportsSecureCoding();
    }

    /**
     * [@property] swimmingLocationType
     *

     * Indicates the type of swimming location (pool vs. open water) where the workout will take place.
     */
    @Generated
    @Selector("swimmingLocationType")
    @NInt
    public native long swimmingLocationType();
}