text:
"""The test for the data filter sensor platform."""
from datetime import timedelta
from unittest.mock import patch

import pytest

from homeassistant import config as hass_config
from homeassistant.components.filter.sensor import (
    DOMAIN,
    LowPassFilter,
    OutlierFilter,
    RangeFilter,
    ThrottleFilter,
    TimeSMAFilter,
    TimeThrottleFilter,
)
from homeassistant.components.sensor import (
    ATTR_STATE_CLASS,
    SensorDeviceClass,
    SensorStateClass,
)
from homeassistant.const import (
    ATTR_DEVICE_CLASS,
    SERVICE_RELOAD,
    STATE_UNAVAILABLE,
    STATE_UNKNOWN,
)
import homeassistant.core as ha
from homeassistant.helpers import entity_registry as er
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util

from tests.common import assert_setup_component, get_fixture_path

@pytest.fixture
def values():
    """Fixture for a list of test States."""
    values = []
    raw_values = [20, 19, 18, 21, 22, 0]
    timestamp = dt_util.utcnow()
    for val in raw_values:
        values.append(ha.State("sensor.test_monitored", val, last_updated=timestamp))
        timestamp += timedelta(minutes=1)
    return values

async def test_setup_fail(hass):
    """Test if filter doesn't exist."""
    config = {
        "sensor": {
            "platform": "filter",
            "entity_id": "sensor.test_monitored",
            "filters": [{"filter": "nonexisting"}],
        }
    }
    with assert_setup_component(0):
        assert await async_setup_component(hass, "sensor", config)
        await hass.async_block_till_done()

async def test_chain(hass, recorder_mock, values):
    """Test if filter chaining works."""
    config = {
        "sensor": {
            "platform": "filter",
            "name": "test",
            "entity_id": "sensor.test_monitored",
            "filters": [
                {"filter": "outlier", "window_size": 10, "radius": 4.0},
                {"filter": "lowpass", "time_constant": 10, "precision": 2},
                {"filter": "throttle", "window_size": 1},
            ],
        }
    }

    with assert_setup_component(1, "sensor"):
        assert await async_setup_component(hass, "sensor", config)
        await hass.async_block_till_done()

        for value in values:
            hass.states.async_set(config["sensor"]["entity_id"], value.state)
            await hass.async_block_till_done()

        state = hass.states.get("sensor.test")
        assert state.state == "18.05"

@pytest.mark.parametrize("missing", (True, False))
async def test_chain_history(hass, recorder_mock, values, missing):
    """Test if filter chaining works, when a source is and isn't recorded."""
    config = {
        "sensor": {
            "platform": "filter",
            "name": "test",
            "entity_id": "sensor.test_monitored",
            "filters": [
                {"filter": "outlier", "window_size": 10, "radius": 4.0},
                {"filter": "lowpass", "time_constant": 10, "precision": 2},
                {"filter": "throttle", "window_size": 1},
            ],
        },
    }

    t_0 = dt_util.utcnow() - timedelta(minutes=1)
    t_1 = dt_util.utcnow() - timedelta(minutes=2)
    t_2 = dt_util.utcnow() - timedelta(minutes=3)
    t_3 = dt_util.utcnow() - timedelta(minutes=4)

    if missing:
        fake_states = {}
    else:
        fake_states = {
            "sensor.test_monitored": [
                ha.State("sensor.test_monitored", 18.0, last_changed=t_0),
                ha.State("sensor.test_monitored", "unknown", last_changed=t_1),
                ha.State("sensor.test_monitored", 19.0, last_changed=t_2),
                ha.State("sensor.test_monitored", 18.2, last_changed=t_3),
            ]
        }

    with patch(
        "homeassistant.components.recorder.history.state_changes_during_period",
        return_value=fake_states,
    ), patch(
        "homeassistant.components.recorder.history.get_last_state_changes",
        return_value=fake_states,
    ):
        with assert_setup_component(1, "sensor"):
            assert await async_setup_component(hass, "sensor", config)
            await hass.async_block_till_done()

        for value in values:
            hass.states.async_set(config["sensor"]["entity_id"], value.state)
            await hass.async_block_till_done()

        state = hass.states.get("sensor.test")
        if missing:
            assert state.state == "18.05"
        else:
            assert state.state == "17.05"

async def test_source_state_none(hass, recorder_mock, values):
    """Test is source sensor state is null and sets state to STATE_UNKNOWN."""

    config = {
        "sensor": [
            {
                "platform": "template",
                "sensors": {
                    "template_test": {
                        "value_template": "{{ states.sensor.test_state.state }}"
                    }
                },
            },
            {
                "platform": "filter",
                "name": "test",
                "entity_id": "sensor.template_test",
                "filters": [
                    {
                        "filter": "time_simple_moving_average",
                        "window_size": "00:01",
                        "precision": "2",
                    }
                ],
            },
        ]
    }
    await async_setup_component(hass, "sensor", config)
    await hass.async_block_till_done()

    hass.states.async_set("sensor.test_state", 0)

    await hass.async_block_till_done()
    state = hass.states.get("sensor.template_test")
    assert state.state == "0"

    await hass.async_block_till_done()
    state = hass.states.get("sensor.test")
    assert state.state == "0.0"

    # Force Template Reload
    yaml_path = get_fixture_path("sensor_configuration.yaml", "template")
    with patch.object(hass_config, "YAML_CONFIG_FILE", yaml_path):
        await hass.services.async_call(
            "template",
            SERVICE_RELOAD,
            {},
            blocking=True,
        )
        await hass.async_block_till_done()

    # Template state gets to None
    state = hass.states.get("sensor.template_test")
    assert state is None

    # Filter sensor ignores None state setting state to STATE_UNKNOWN
    state = hass.states.get("sensor.test")
    assert state.state == STATE_UNKNOWN

async def test_history_time(hass, recorder_mock):
    """Test loading from history based on a time window."""
    config = {
        "sensor": {
            "platform": "filter",
            "name": "test",
            "entity_id": "sensor.test_monitored",
            "filters": [{"filter": "time_throttle", "window_size": "00:01"}],
        },
    }

    t_0 = dt_util.utcnow() - timedelta(minutes=1)
    t_1 = dt_util.utcnow() - timedelta(minutes=2)
    t_2 = dt_util.utcnow() - timedelta(minutes=3)

    fake_states = {
        "sensor.test_monitored": [
            ha.State("sensor.test_monitored", 18.0, last_changed=t_0),
            ha.State("sensor.test_monitored", 19.0, last_changed=t_1),
            ha.State("sensor.test_monitored", 18.2, last_changed=t_2),
        ]
    }
    with patch(
        "homeassistant.components.recorder.history.state_changes_during_period",
        return_value=fake_states,
    ), patch(
        "homeassistant.components.recorder.history.get_last_state_changes",
        return_value=fake_states,
    ):
        with assert_setup_component(1, "sensor"):
            assert await async_setup_component(hass, "sensor", config)
            await hass.async_block_till_done()

        await hass.async_block_till_done()
        state = hass.states.get("sensor.test")
        assert state.state == "18.0"

async def test_setup(hass, recorder_mock):
    """Test if filter attributes are inherited."""
    config = {
        "sensor": {
            "platform": "filter",
            "name": "test",
            "unique_id": "uniqueid_sensor_test",
            "entity_id": "sensor.test_monitored",
            "filters": [
                {"filter": "outlier", "window_size": 10, "radius": 4.0},
            ],
        }
    }

    with assert_setup_component(1, "sensor"):
        assert await async_setup_component(hass, "sensor", config)
        await hass.async_block_till_done()

        hass.states.async_set(
            "sensor.test_monitored",
            1,
            {
                "icon": "mdi:test",
                ATTR_DEVICE_CLASS: SensorDeviceClass.TEMPERATURE,
                ATTR_STATE_CLASS: SensorStateClass.TOTAL_INCREASING,
            },
        )
        await hass.async_block_till_done()
        state = hass.states.get("sensor.test")
        assert state.attributes["icon"] == "mdi:test"
        assert state.attributes[ATTR_DEVICE_CLASS] == SensorDeviceClass.TEMPERATURE
        assert state.attributes[ATTR_STATE_CLASS] is SensorStateClass.TOTAL_INCREASING
        assert state.state == "1.0"

        entity_reg = er.async_get(hass)
        entity_id = entity_reg.async_get_entity_id(
            "sensor", DOMAIN, "uniqueid_sensor_test"
        )
        assert entity_id == "sensor.test"

async def test_invalid_state(hass, recorder_mock):
    """Test if filter attributes are inherited."""
    config = {
        "sensor": {
            "platform": "filter",
            "name": "test",
            "entity_id": "sensor.test_monitored",
            "filters": [
                {"filter": "outlier", "window_size": 10, "radius": 4.0},
            ],
        }
    }

    with assert_setup_component(1, "sensor"):
        assert await async_setup_component(hass, "sensor", config)
        await hass.async_block_till_done()

        hass.states.async_set("sensor.test_monitored", STATE_UNAVAILABLE)
        await hass.async_block_till_done()

        state = hass.states.get("sensor.test")
        assert state.state == STATE_UNAVAILABLE

        hass.states.async_set("sensor.test_monitored", "invalid")
        await hass.async_block_till_done()

        state = hass.states.get("sensor.test")
        assert state.state == STATE_UNAVAILABLE

async def test_timestamp_state(hass, recorder_mock):
    """Test if filter state is a datetime."""
    config = {
        "sensor": {
            "platform": "filter",
            "name": "test",
            "entity_id": "sensor.test_monitored",
            "filters": [
                {"filter": "time_throttle", "window_size": "00:02"},
            ],
        }
    }

    with assert_setup_component(1, "sensor"):
        assert await async_setup_component(hass, "sensor", config)
        await hass.async_block_till_done()

        hass.states.async_set(
            "sensor.test_monitored",
            "2022-02-01T23:04:05+00:00",
            {ATTR_DEVICE_CLASS: SensorDeviceClass.TIMESTAMP},
        )
        await hass.async_block_till_done()

        state = hass.states.get("sensor.test")
        assert state.state == "2022-02-01T23:04:05+00:00"
        assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.TIMESTAMP

async def test_outlier(values):
    """Test if outlier filter works."""
    filt = OutlierFilter(window_size=3, precision=2, entity=None, radius=4.0)
    for state in values:
        filtered = filt.filter_state(state)
    assert filtered.state == 21

def test_outlier_step(values):
    """
    Test step-change handling in outlier.

    Test if outlier filter handles long-running step-changes correctly.
    It should converge to no longer filter once just over half the
    window_size is occupied by the new post step-change values.
    """
    filt = OutlierFilter(window_size=3, precision=2, entity=None, radius=1.1)
    values[-1].state = 22
    for state in values:
        filtered = filt.filter_state(state)
    assert filtered.state == 22

def test_initial_outlier(values):
    """Test issue #13363."""
    filt = OutlierFilter(window_size=3, precision=2, entity=None, radius=4.0)
    out = ha.State("sensor.test_monitored", 4000)
    for state in [out] + values:
        filtered = filt.filter_state(state)
    assert filtered.state == 21

def test_unknown_state_outlier(values):
    """Test issue #32395."""
    filt = OutlierFilter(window_size=3, precision=2, entity=None, radius=4.0)
    out = ha.State("sensor.test_monitored", "unknown")
    for state in [out] + values + [out]:
        try:
            filtered = filt.filter_state(state)
        except ValueError:
            assert state.state == "unknown"
    assert filtered.state == 21

def test_precision_zero(values):
    """Test if precision of zero returns an integer."""
    filt = LowPassFilter(window_size=10, precision=0, entity=None, time_constant=10)
    for state in values:
        filtered = filt.filter_state(state)
    assert isinstance(filtered.state, int)

def test_lowpass(values):
    """Test if lowpass filter works."""
    filt = LowPassFilter(window_size=10, precision=2, entity=None, time_constant=10)
    out = ha.State("sensor.test_monitored", "unknown")
    for state in [out] + values + [out]:
        try:
            filtered = filt.filter_state(state)
        except ValueError:
            assert state.state == "unknown"
    assert filtered.state == 18.05

def test_range(values):
    """Test if range filter works."""
    lower = 10
    upper = 20
    filt = RangeFilter(entity=None, precision=2, lower_bound=lower, upper_bound=upper)
    for unf_state in values:
        unf = float(unf_state.state)
        filtered = filt.filter_state(unf_state)
        if unf < lower:
            assert lower == filtered.state
        elif unf > upper:
            assert upper == filtered.state
        else:
            assert unf == filtered.state

def test_range_zero(values):
    """Test if range filter works with zeroes as bounds."""
    lower = 0
    upper = 0
    filt = RangeFilter(entity=None, precision=2, lower_bound=lower, upper_bound=upper)
    for unf_state in values:
        unf = float(unf_state.state)
        filtered = filt.filter_state(unf_state)
        if unf < lower:
            assert lower == filtered.state
        elif unf > upper:
            assert upper == filtered.state
        else:
            assert unf == filtered.state

def test_throttle(values):
    """Test if lowpass filter works."""
    filt = ThrottleFilter(window_size=3, precision=2, entity=None)
    filtered = []
    for state in values:
        new_state = filt.filter_state(state)
        if not filt.skip_processing:
            filtered.append(new_state)
    assert [20, 21] == [f.state for f in filtered]

def test_time_throttle(values):
    """Test if lowpass filter works."""
    filt = TimeThrottleFilter(
        window_size=timedelta(minutes=2), precision=2, entity=None
    )
    filtered = []
    for state in values:
        new_state = filt.filter_state(state)
        if not filt.skip_processing:
            filtered.append(new_state)
    assert [20, 18, 22] == [f.state for f in filtered]

def test_time_sma(values):
    """Test if time_sma filter works."""
    filt = TimeSMAFilter(
        window_size=timedelta(minutes=2), precision=2, entity=None, type="last"
    )
    for state in values:
        filtered = filt.filter_state(state)
    assert filtered.state == 21.5

async def test_reload(hass, recorder_mock):
    """Verify we can reload filter sensors."""
    hass.states.async_set("sensor.test_monitored", 12345)
    await async_setup_component(
        hass,
        "sensor",
        {
            "sensor": {
                "platform": "filter",
                "name": "test",
                "entity_id": "sensor.test_monitored",
                "filters": [
                    {"filter": "outlier", "window_size": 10, "radius": 4.0},
                    {"filter": "lowpass", "time_constant": 10, "precision": 2},
                    {"filter": "throttle", "window_size": 1},
                ],
            }
        },
    )
    await hass.async_block_till_done()
    await hass.async_start()
    await hass.async_block_till_done()

    assert len(hass.states.async_all()) == 2

    assert hass.states.get("sensor.test")

    yaml_path = get_fixture_path("configuration.yaml", "filter")

    with patch.object(hass_config, "YAML_CONFIG_FILE", yaml_path):
        await hass.services.async_call(
            DOMAIN,
            SERVICE_RELOAD,
            {},
            blocking=True,
        )
        await hass.async_block_till_done()

    assert len(hass.states.async_all()) == 2

    assert hass.states.get("sensor.test") is None
    assert hass.states.get("sensor.filtered_realistic_humidity")


text:
#include <aws/storagegateway/model/DeleteChapCredentialsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::StorageGateway::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DeleteChapCredentialsResult::DeleteChapCredentialsResult()
{
}

DeleteChapCredentialsResult::DeleteChapCredentialsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DeleteChapCredentialsResult& DeleteChapCredentialsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("TargetARN"))
  {
    m_targetARN = jsonValue.GetString("TargetARN");

  }

  if(jsonValue.ValueExists("InitiatorName"))
  {
    m_initiatorName = jsonValue.GetString("InitiatorName");

  }

  return *this;
}

redpajama_set_name: RedPajamaGithub


text:
================================================================================
HostListSummary
================================================================================

.. describe:: Property of

    :py:class:`~pyvisdk.do.host_connect_info.HostConnectInfo`,
    :py:class:`~pyvisdk.do.host_system.HostSystem`

.. describe:: See also

    :py:class:`~pyvisdk.do.custom_field_value.CustomFieldValue`,
    :py:class:`~pyvisdk.do.host_config_summary.HostConfigSummary`,
    :py:class:`~pyvisdk.do.host_hardware_summary.HostHardwareSummary`,
    :py:class:`~pyvisdk.do.host_list_summary_quick_stats.HostListSummaryQuickStats`,
    :py:class:`~pyvisdk.do.host_runtime_info.HostRuntimeInfo`,
    :py:class:`~pyvisdk.do.host_system.HostSystem`,
    :py:class:`~pyvisdk.do.managed_entity_status.ManagedEntityStatus`

.. describe:: Extends

    :py:class:`~pyvisdk.mo.dynamic_data.DynamicData`

.. class:: pyvisdk.do.host_list_summary.HostListSummary

    .. py:attribute:: config

        Basic configuration information, if known.

    .. py:attribute:: currentEVCModeKey

        The Enhanced VMotion Compatibility mode that is currently in effect for this host. If the host is in a cluster where EVC is active, this will match the cluster's EVC mode; otherwise this will be unset.See supportedEVCMode

    .. py:attribute:: customValue

        The customized field values.

    .. py:attribute:: hardware

        Basic hardware information, if known.

    .. py:attribute:: host

        The reference to the host-managed object.

    .. py:attribute:: managementServerIp

        IP address of the VirtualCenter server managing this host, if any.

    .. py:attribute:: maxEVCModeKey

        The most capable Enhanced VMotion Compatibility mode supported by the host hardware and software; unset if this host cannot participate in any EVC mode.See supportedEVCMode

    .. py:attribute:: overallStatus

        The overall alarm status of the host.

    .. py:attribute:: quickStats

        Basic host statistics.

    .. py:attribute:: rebootRequired

        Indicates whether or not the host requires a reboot due to a configuration change.

    .. py:attribute:: runtime

        Basic runtime information, if known.


text:
<?php

use PHPUnit\Framework\TestCase;
use SAREhub\Component\Worker\Command\CommandRequest;

class CommandRequestTest extends TestCase {

	private $request;

	protected function setUp() {
		parent::setUp();
		$this->request = CommandRequest::newInstance();
	}

	public function testIsSentThenReturnFalse() {
		$this->assertFalse($this->request->isSent());
	}

	public function testMarkAsSentThenIsSentReturnTrue() {
		$this->request->markAsSent(time());
		$this->assertTrue($this->request->isSent());
	}

	public function testIsReplyTimeoutWhenNotSentThenReturnFalse() {
		$this->assertFalse($this->request->isReplyTimeout(time()));
	}

	public function testIsReplyTimeoutWhenSentAndNotTimeoutThenReturnFalse() {
		$now = time();
		$this->request->markAsSent($now);
		$this->assertFalse($this->request->isReplyTimeout($now));
	}
}


text:
<?php

	require_once(TOOLKIT . '/class.datasource.php');

	Class datasourceimages_entries_by_tag extends SectionDatasource {

		public $dsParamROOTELEMENT = 'images-entries-by-tag';
		public $dsParamORDER = 'desc';
		public $dsParamPAGINATERESULTS = 'no';
		public $dsParamLIMIT = '20';
		public $dsParamSTARTPAGE = '1';
		public $dsParamREDIRECTONEMPTY = 'no';
		public $dsParamREQUIREDPARAM = '$pt1:43';
		public $dsParamSORT = 'system:id';
		public $dsParamHTMLENCODE = 'yes';
		public $dsParamASSOCIATEDENTRYCOUNTS = 'no';
		public $dsParamCACHE = '0';

		public $dsParamFILTERS = array(
				'139' => '{$ds-tags-filtered.system-id:43}',
				'207' => 'no',
		);

		public $dsParamINCLUDEDELEMENTS = array(
				'image',
				'position',
				'height',
				'full-bleed'
		);

		public function __construct($env=NULL, $process_params=true) {
			parent::__construct($env, $process_params);
			$this->_dependencies = array('$ds-tags-filtered.system-id');
		}

		public function about() {
			return array(
				'name' => 'Images: Entries by tag',
				'author' => array(
					'name' => 'Brian Zerangue',
					'website' => 'http://churchdeploy.site',
					'email' => 'brian.zerangue@gmail.com'),
				'version' => 'Symphony 2.3.2',
				'release-date' => '2013-07-24T10:23:49+00:00'
			);
		}

		public function getSource() {
			return '8';
		}

		public function allowEditorToParse() {
			return true;
		}

		public function execute(array &$param_pool = null) {
			$result = new XMLElement($this->dsParamROOTELEMENT);

			try{
				$result = parent::execute($param_pool);
			}
			catch(FrontendPageNotFoundException $e){
				// Work around. This ensures the 404 page is displayed and
				// is not picked up by the default catch() statement below
				FrontendPageNotFoundExceptionHandler::render($e);
			}
			catch(Exception $e){
				$result->appendChild(new XMLElement('error', $e->getMessage()));
				return $result;
			}

			if($this->_force_empty_result) $result = $this->emptyXMLSet();

			return $result;
		}

	}


text:
@implementation ReviewsDataController

@end


text:
package io.spine.server.entity;

import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import io.spine.annotation.Internal;
import io.spine.base.Error;
import io.spine.core.Event;
import io.spine.core.MessageId;
import io.spine.core.Signal;
import io.spine.logging.Logging;
import io.spine.protobuf.AnyPacker;
import io.spine.validate.NonValidated;
import io.spine.validate.ValidationError;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;

import java.util.List;
import java.util.Set;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

/**
 * An implementation of {@link TransactionListener} which monitors the transaction flow and
 * triggers the {@link EntityLifecycle}.
 *
 *
On a successful {@link Phase}, memoizes the ID of the applied message. After a successful
 * transaction commit, passes the memoized IDs to the {@link EntityLifecycle} of the entity under
 * transaction, along with the information about the mutations performed under the transaction - an
 * {@link EntityRecordChange}.
 *
 *
An instance of this {@link TransactionListener} is meant to serve for a single
 * {@link Transaction}. When trying to reuse a listener for multiple transactions,
 * an {@link IllegalStateException} is thrown.
 *
 * @param
 *         ID type of the entity under transaction
 */
@Internal
public final class EntityLifecycleMonitor implements TransactionListener, Logging {

    private final Repository repository;
    private final List<MessageId> acknowledgedMessages;
    private final I entityId;
    private @MonotonicNonNull Signal<?, ?, ?> lastMessage;

    private EntityLifecycleMonitor(Repository repository, I id) {
        this.repository = repository;
        this.acknowledgedMessages = Lists.newArrayList();
        this.entityId = id;
    }

    /**
     * Creates a new instance of {@code EntityLifecycleMonitor}.
     *
     * @param repository
     *         the repository of the entity under transaction
     * @param id
     *         the entity ID
     */
    public static  EntityLifecycleMonitor newInstance(Repository repository, I id) {
        checkNotNull(repository);
        checkNotNull(id);
        return new EntityLifecycleMonitor<>(repository, id);
    }

    /**
     * Creates a new instance with a single {@linkplain #acknowledgedMessages acknowledged} message.
     *
     * @param repository
     *         the repository of the entity under transaction
     * @param id
     *         the entity ID
     * @param message
     *         the artificially injected acknowledged message
     */
    static  EntityLifecycleMonitor
    withAcknowledgedMessage(Repository repository, I id, Signal<?, ?, ?> message) {
        var monitor = newInstance(repository, id);
        monitor.lastMessage = message;
        monitor.acknowledgedMessages.add(message.messageId());
        return monitor;
    }

    /**
     * {@inheritDoc}
     *
     *
Memoizes the dispatched message for diagnostics in case of a failure.
     */
    @Override
    public void onBeforePhase(Phase phase) {
        lastMessage = phase.signal();
    }

    /**
     * {@inheritDoc}
     *
     *
Memoizes the ID of the event applied by the given phase. The received event IDs will be
     * reported to the {@link EntityLifecycle} after a successful commit.
     */
    @Override
    public void onAfterPhase(Phase phase) {
        checkSameEntity(phase.entityId());
        var messageId = phase.signal().messageId();
        acknowledgedMessages.add(messageId);
    }

    @Override
    public void onBeforeCommit(@NonValidated EntityRecord entityRecord) {
        // NOP.
    }

    /**
     * {@inheritDoc}
     *
     *
Notifies the {@link EntityLifecycle} of the entity state change.
     */
    @Override
    public void onAfterCommit(EntityRecordChange change) {
        Set<MessageId> signalIds = ImmutableSet.copyOf(acknowledgedMessages);
        if (lastMessage != null) {
            // If lastMessage is null, then no messages have been applied, hence no changes
            // performed.
            repository.lifecycleOf(entityId)
                      .onStateChanged(change, signalIds, lastMessage.asMessageOrigin());
        }
    }

    /**
     * {@inheritDoc}
     *
     *
Notifies the {@link EntityLifecycle} of the failure.
     */
    @Override
    public void onTransactionFailed(Error cause, EntityRecord entityRecord) {
        if (!cause.hasDetails()) {
            return;
        }
        var details = AnyPacker.unpack(cause.getDetails());
        if (details instanceof ValidationError) {
            var error = (ValidationError) details;
            checkState(lastMessage != null, "Transaction failed but no messages were propagated.");
            var causeMessage = lastMessage.messageId();
            var rootMessage = lastMessage.rootMessage();
            repository.lifecycleOf(entityId)
                      .onInvalidEntity(causeMessage,
                                       rootMessage,
                                       error,
                                       entityRecord.getVersion());
        }
    }

    @Override
    public void onTransactionFailed(Event cause, @NonValidated EntityRecord entityRecord) {
        // NOP.
    }

    /**
     * Ensures that the given entity is the same that was given the previous time.
     *
     *
An instance of {@code EntityLifecycleMonitor} should not be reused for multiple entity
     * transactions. Thus, if the given entity is not the same as seen before,
     * an {@link IllegalStateException} is thrown
     *
     * @param entityId
     *         the ID of the entity to check
     * @throws IllegalStateException
     *         if the check fails
     */
    private void checkSameEntity(I entityId) throws IllegalStateException {
        checkState(this.entityId.equals(entityId),
                   "Tried to reuse an instance of %s for multiple transactions.",
                   EntityLifecycleMonitor.class.getSimpleName());
    }
}


text:
<?php

namespace Lounaslippu\Repository;

use Lounaslippu\Model\Invoice;
use Tsoha\DB;

/**
 * Class InvoiceRepository
 * @package Lounaslippu\Repository
 */
class InvoiceRepository extends EntityRepository
{

    /**
     * @param $referenceNumber
     * @return Invoice
     */
    public function getInvoiceByReferenceNumber($referenceNumber)
    {

        $query = DB::connection()->prepare('select * from invoice where reference_number = :reference_number');
        $query->execute(array('reference_number' => $referenceNumber));
        $result = $query->fetch();
        $invoice = new Invoice($result);
        return $invoice;

    }
}


text:
package domala.jdbc.models

trait PersonDao {
  def create(): Unit

  def drop(): Unit

  def findAll: List[Person]

  def findById(id: ID[Person]): Option[Person]
}

import domala.jdbc.Config

object PersonDao {
  def impl(implicit config: Config): PersonDao = new PersonDaoImpl
}

import domala._

class PersonDaoImpl(implicit config: Config) extends PersonDao {
  def create(): Unit = script"""
    create table department(
        id int not null identity primary key,
        name varchar(25),
        version int not null
    );

    create table person(
        id int not null identity primary key,
        name varchar(25),
        age int,
        city varchar(20) not null,
        street varchar(20) not null,
        department_id int,
        version int not null,
        constraint fk_department_id foreign key(department_id) references department(id)
    );

    insert into department (id, name, version) values(1, 'ACCOUNTING', 0);
    insert into department (id, name, version) values(2, 'SALES', 0);

    insert into person (id, name, age, city, street, department_id, version) values(1, 'SMITH', 10, 'Tokyo', 'Yaesu', 2, 0);
    insert into person (id, name, age, city, street, department_id, version) values(2, 'ALLEN', 20, 'Kyoto', 'Karasuma', 1, 0);
  """.execute()

  def drop(): Unit = script"""
      drop table person;
      drop table department;
    """.execute()

  def findAll: List[Person] = select"select /*%expand*/* from person".getList[Person]

  def findByIds[R](ids: Iterable[ID[Person]], mapper: Iterator[Person] => R): R = select"select /*%expand*/* from person where id in ($ids)".apply(mapper)

  def findById(id: ID[Person]): Option[Person] = findByIds(Seq(id), _.toStream.headOption)

}


text:
using System;
using Newtonsoft.Json;

namespace Facepunch.Entities
{
    internal class FPList<T> : FPEntity, IFPPlaintextEntity where T : FPEntity
    {
        public T[] Result;

        public void HandlePlaintext(string plaintext)
        {
            try
            {
                Result = JsonConvert.DeserializeObject<T[]>(plaintext);
            }
            catch (JsonException)
            {
                throw new FPException("Error parsing list");
            }
        }

        internal override void ApplyContext(FPContext context)
        {
            this.Context = context;

            foreach(var item in Result)
            {
                item.ApplyContext(context);
            }
        }
    }
}


text:
package com.mapswithme.maps.ads;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.my.target.ads.CustomParams;
import com.my.target.nativeads.NativeAd;
import com.my.target.nativeads.banners.NativePromoBanner;
import com.my.target.nativeads.models.ImageData;

import java.util.Map;

class MyTargetNativeAd extends CachedMwmNativeAd
{
  @NonNull
  private final NativeAd mAd;
  @NonNull
  private final String mBannerId;

  MyTargetNativeAd(@NonNull NativeAd ad, long timestamp)
  {
    super(timestamp);
    mAd = ad;
    CustomParams params = mAd.getCustomParams();
    Map<String, String> data = params.getData();
    mBannerId = data.get(MyTargetAdsLoader.ZONE_KEY_PARAMETER);
  }

  @NonNull
  @Override
  public String getBannerId()
  {
    return mBannerId;
  }

  @NonNull
  @Override
  public String getTitle()
  {
    return mAd.getBanner().getTitle();
  }

  @NonNull
  @Override
  public String getDescription()
  {
    return mAd.getBanner().getDescription();
  }

  @NonNull
  @Override
  public String getAction()
  {
    return mAd.getBanner().getCtaText();
  }

  @Override
  public void loadIcon(@NonNull View view)
  {
    NativePromoBanner banner = mAd.getBanner();
    ImageData icon = banner.getIcon();
    if (icon != null)
      NativeAd.loadImageToView(icon, (ImageView) view);
  }

  @Override
  public void unregister(@NonNull View view)
  {
    mAd.unregisterView();
  }

  @Override
  void register(@NonNull View view)
  {
    mAd.registerView(view);
  }

  @NonNull
  @Override
  public String getProvider()
  {
    return Providers.MY_TARGET;
  }

  @Nullable
  @Override
  public String getPrivacyInfoUrl()
  {
    return null;
  }

  @Override
  void detachAdListener()
  {
    mAd.setListener(null);
  }

  @Override
  void attachAdListener(@NonNull Object listener)
  {
    if (!(listener instanceof NativeAd.NativeAdListener))
      throw new AssertionError("A listener for myTarget ad must be instance of " +
                               "NativeAd.NativeAdListener class! Not '" + listener.getClass() + "'!");
    mAd.setListener((NativeAd.NativeAdListener) listener);
  }

  @NonNull
  @Override
  public NetworkType getNetworkType()
  {
    return NetworkType.MYTARGET;
  }
}


text:
package com.viviframework.petapojo;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 葛劲 on 2016/5/11 0011.
 */
public class Sql {

    private String _sql;
    private Object[] _args;
    private Sql _rhs;
    private String _sqlFinal;
    private Object[] _argsFinal;

    public Sql() {

    }

    public Sql(String sql, Object... params) {
        _sql = sql;
        _args = params;
    }

    public static Sql create() {
        return new Sql();
    }

    public Sql append(Sql sql) {
        if (_rhs != null) {
            _rhs.append(sql);
        } else {
            _rhs = sql;
        }

        return this;
    }

    public Sql append(String sql, Object... params) {
        return append(new Sql(sql, params));
    }

    public Sql where(String sql, Object... params) {
        return append(new Sql("WHERE " + sql, params));
    }

    public Sql whereIn(String sql, Object[] paras) {
        if (sql == null || sql.length() == 0)
            throw new PetaPojoException("sql error: must have 'IN' word");
        if (paras == null || paras.length == 0)
            throw new PetaPojoException("paras error");
        if (!sql.contains("?"))
            throw new PetaPojoException("sql error: must have ?");

        String temp = "";
        for (Object ignored : paras) {
            temp = temp + "?,";
        }
        temp = temp.substring(0, temp.length() - 1);
        sql = sql.replace("?", temp);
        return where(sql, paras);
    }

    public Sql select(String columns) {
        return append(new Sql("SELECT " + columns));
    }

    public Sql from(String tables) {
        return append(new Sql("FROM " + tables));
    }

    public Sql orderBy(String columns) {
        return append(new Sql("ORDER BY " + columns));
    }

    public Sql groupBy(String columns) {
        return append(new Sql("GROUP BY " + columns));
    }

    private void build() {
        if (_sqlFinal != null && _sqlFinal.length() > 0)
            return;

        StringBuilder sb = new StringBuilder();
        List<Object> args = new ArrayList<Object>();

        build(sb, args, null);

        _sqlFinal = sb.toString();
        _argsFinal = args.toArray();
    }

    private void build(StringBuilder sb, List<Object> args, Sql lhs) {
        if (_sql != null && _sql.length() > 0) {
            if (sb.length() > 0) {
                sb.append("\n");
            }

            String sql = _sql;
            if (is(lhs, "WHERE ") && is(this, "WHERE "))
                sql = "AND " + sql.substring(6);
            if (is(lhs, "ORDER BY ") && is(this, "ORDER BY "))
                sql = ", " + sql.substring(9);

            for (Object arg : _args) {
                args.add(arg);
            }
            sb.append(sql);
        }

        if (_rhs != null)
            _rhs.build(sb, args, this);
    }

    private static boolean is(Sql sql, String sqlType) {
        return sql != null
                && sql._sql != null
                && sql._sql.toLowerCase().startsWith(sqlType.toLowerCase());
    }

    public String getFinalSql() {
        build();
        return _sqlFinal;
    }

    public Object[] getFinalArgs() {
        build();
        return _argsFinal;
    }
}


text:
  println(STDOUT, "\n\tEffective Hamiltonian model\n")

  using DataFrames
#  using Gadfly

  include("input.jl")
  include("lib/kpoints.jl")
  include("lib/diagonalize.jl")
  include("lib/spin_texture.jl")
#  include("lib/io_dat.jl")

  println(STDOUT, "\n\t..:: Total time ::..")
  println(STDOUT, "\tsetting input:\t\t\t\t", t_input, " s")
  println(STDOUT, "\tsetting k-points:\t\t\t", t_kpoints, " s")
  println(STDOUT, "\tdiagonalizing hamiltonian:\t\t", t_diagonalize, " s")


text:
<?php
namespace fuel;
/**
 * Custom Post Type
 *
 * @author Kyeong Jun Lee<eric@fuelmultimedia.ca>
 *
 * Usage:
 *
 * require get_template_directory() . '/inc/cpt.php';
 * $arg = array( 'menu_icon' => 'dashicons-admin-multisite' );
 * $cpt = new \fuel\CPT('test','tests','textdomain',$arg);
 *
 *
 */
class CPT
{
    /**
     * @var {string} $single      - singular post type name
     * @var {string} $plural      - plural post type name
     * @var {string} $text_domain - text domain
     * @var {array()} $arg        - options for the post type
     * @var {string}   $post_type - post type
     */
    public $single;
    public $plural;
    public $text_domain;
    public $arg;
    public $post_type;

    /**
     * @param {string} $s      - singular post type name
     * @param {string} $p      - plural post type name
     * @param {string} $td     - text domain
     * @param {array()} $arg   - options for the post type
     */
    public function __construct($s, $p, $td, $arg = array() ) {
        // Make it sure to have 'name' as plural
        $this->single       = $s;
        $this->plural       = $p;
        $this->text_domain  = $td;
        $this->arg          = $arg;

        /**
         * Regular expression to repalce spaces with '_'
         * @var {pattern}
         */
        $find_space = '/\s/';
        /**
         * generated post type name with all the blanks replaced with '_'
         * @var {string}
         */
        $this->post_type = strtolower( preg_replace( $find_space, '_',$this->plural ) );

        $this->addAction();

        /**
         * Add Sortable Menu Order Column
         */
        $this->show_menu_order();
    }

    /**
     * Show sortable menu order column in the list view.
     */
    public function show_menu_order() {
        if(!$this->post_type) {
            throw new \Exception('The current custom post type has not been initialized');
        }
        add_action('manage_edit-'.$this->post_type.'_columns', array($this,'add_sortable_column_menu_order') );
        add_action('manage_'.$this->post_type.'_posts_custom_column',array($this,'show_order_column') );
        add_filter('manage_edit-'.$this->post_type.'_sortable_columns',array($this,'order_column_register_sortable') );
    }

    function add_sortable_column_menu_order($_columns) {
        $_columns['menu_order'] = __("Order");
        return $_columns;
    }

    /**
    * show custom order column values
    */
    function show_order_column($name){
      global $post;

      switch ($name) {
        case 'menu_order':
          $order = $post->menu_order;
          echo $order;
          break;
       default:
          break;
       }
    }

    /**
    * make column sortable
    */
    function order_column_register_sortable($columns){
        $columns['menu_order'] = 'menu_order';
        return $columns;
    }

    function addAction() {
        //Add Custom Post Type
        add_action( 'init', array( $this, 'custom_post_type'), 0 );
    }
    // Register Custom Post Type
    function custom_post_type() {
        /**
         * A local variable for post type name
         * @var {string}
         */
        $_post_type = $this->post_type;
        /**
         * A local variable for singular post type name
         * @var {string}
         */
        $_single = $this->single;
        /**
         * A local variable for plural post type name
         * @var {string}
         */
        $_plural = $this->plural;
        /**
         * A local variable for text domain of post type name
         * @var {string}
         */
        $text_domain = $this->text_domain;

        /**
         * Reassign arguments to be used locally
         * @var {array()}
         */
        $_arg = $this->arg;

        $labels = array(
            'name'                  => _x( $_plural, 'Post Type General Name', $text_domain ),
            'singular_name'         => _x( $_single, 'Post Type Singular Name', $text_domain ),
            'menu_name'             => __( $_plural, $text_domain ),
            'name_admin_bar'        => __( $_plural, $text_domain ),
            'archives'              => __( $_single.' Archives', $text_domain ),
            'parent_item_colon'     => __( 'Parent '.$_single.':', $text_domain ),
            'all_items'             => __( 'All '.$_plural, $text_domain ),
            'add_new_item'          => __( 'Add New '.$_single , $text_domain ),
            'add_new'               => __( 'Add New' , $text_domain ),
            'new_item'              => __( 'New '.$_single , $text_domain ),
            'edit_item'             => __( 'Edit '.$_single , $text_domain ),
            'update_item'           => __( 'Update '.$_single , $text_domain ),
            'view_item'             => __( 'View '.$_single , $text_domain ),
            'search_items'          => __( 'Search '.$_single , $text_domain ),
            'not_found'             => __( 'Not found', $text_domain ),
            'not_found_in_trash'    => __( 'Not found in Trash', $text_domain ),
            'featured_image'        => __( 'Featured Image', $text_domain ),
            'set_featured_image'    => __( 'Set featured image', $text_domain ),
            'remove_featured_image' => __( 'Remove featured image', $text_domain ),
            'use_featured_image'    => __( 'Use as featured image', $text_domain ),
            'insert_into_item'      => __( 'Insert into '.$_single , $text_domain ),
            'uploaded_to_this_item' => __( 'Uploaded to this '.$_single , $text_domain ),
            'items_list'            => __( 'Items list', $text_domain ),
            'items_list_navigation' => __( 'Items list navigation', $text_domain ),
            'filter_items_list'     => __( 'Filter items list', $text_domain ),
        );

        /**
         * Label Overwrite
         */
        if( isset( $_arg['labels']) && is_array( $_arg['labels'] ) ) {
            $labels = array_replace( $labels, $this->arg['labels'] );
        }

        $args = array(
            'label'                 => __( $_single, $text_domain ),
            'description'           => __( isset( $_arg['description'] ) ? $_arg['description'] : 'No description' , $text_domain ),
            'labels'                => $labels,
            /**
             * Supports
             * array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', )
             */
            'supports'              => isset($_arg['supports']) ? $_arg['supports'] : array(),
            'taxonomies'            => isset($_arg['taxonomies']) ? $_arg['taxonomies'] : array( 'category', 'post_tag' ),
            'hierarchical'          => isset($_arg['hierarchical']) ? $_arg['hierarchical'] : true,
            'public'                => isset($_arg['public']) ? $_arg['public'] : false,
            'show_ui'               => isset($_arg['show_ui']) ? $_arg['show_ui'] : true,
            'show_in_menu'          => isset($_arg['show_in_menu']) ? $_arg['show_in_menu'] : true,
            'menu_position'         => isset($_arg['menu_position']) ? $_arg['menu_position'] : 5,
            'menu_icon'             => isset($_arg['menu_icon']) ? $_arg['menu_icon'] : 'dashicons-admin-post',
            'show_in_admin_bar'     => isset($_arg['show_in_admin_bar']) ? $_arg['show_in_admin_bar'] : true,
            'show_in_nav_menus'     => isset($_arg['show_in_nav_menus']) ? $_arg['show_in_nav_menus'] : true,
            'can_export'            => isset($_arg['can_export']) ? $_arg['can_export'] : true,
            'has_archive'           => isset($_arg['has_archive']) ? $_arg['has_archive'] : true,
            'exclude_from_search'   => isset($_arg['exclude_from_search']) ? $_arg['exclude_from_search'] : false,
            'publicly_queryable'    => isset($_arg['publicly_queryable']) ? $_arg['publicly_queryable'] : true,
            'capability_type'       => isset($_arg['capability_type']) ? $_arg['capability_type'] :'page',
        );
        register_post_type( $_post_type , $args );
    }
}


text:
class ActivitiesController < ApplicationController
  respond_to :json
  def index
    @activities = Activity.list_of_activities(params.permit(:date_start, :date_end))
    render json: @activities
  end
end


text:
package org.kuali.rice.ken.postprocessor.kew;

import org.apache.log4j.Logger;
import org.kuali.rice.ken.bo.NotificationMessageDelivery;
import org.kuali.rice.ken.core.GlobalNotificationServiceLocator;
import org.kuali.rice.ken.deliverer.impl.KEWActionListMessageDeliverer;
import org.kuali.rice.ken.service.NotificationMessageDeliveryService;
import org.kuali.rice.ken.service.NotificationService;
import org.kuali.rice.ken.util.NotificationConstants;
import org.kuali.rice.ken.util.Util;
import org.kuali.rice.kew.api.KewApiConstants;
import org.kuali.rice.kew.api.WorkflowDocument;
import org.kuali.rice.kew.api.WorkflowDocumentFactory;
import org.kuali.rice.kew.api.action.ActionType;
import org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent;
import org.kuali.rice.kew.framework.postprocessor.AfterProcessEvent;
import org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent;
import org.kuali.rice.kew.framework.postprocessor.DeleteEvent;
import org.kuali.rice.kew.framework.postprocessor.DocumentLockingEvent;
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange;
import org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange;
import org.kuali.rice.kew.framework.postprocessor.PostProcessor;
import org.kuali.rice.kew.framework.postprocessor.ProcessDocReport;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.List;
import java.util.Properties;

/**
 * This class is the post processor that gets run when workflow state changes occur for the
 * underlying core NotificationDocumentType that all notifications go into KEW as.  This class is responsible for changing
 * the state of the associated notification message delivery record after someone FYIs or ACKs their notification
 * in the KEW Action List.
 * @author Kuali Rice Team (rice.collab@kuali.org)
 */
public class NotificationPostProcessor implements PostProcessor {
    private static final Logger LOG = Logger.getLogger(NotificationPostProcessor.class);

    NotificationService notificationService;
    NotificationMessageDeliveryService msgDeliverySvc;

    /**
     * Constructs a NotificationPostProcessor instance.
     */
    public NotificationPostProcessor() {
        this.msgDeliverySvc = GlobalNotificationServiceLocator.getInstance().getNotificationMessageDeliveryService();
        this.notificationService = GlobalNotificationServiceLocator.getInstance().getNotificationService();
    }

    /**
     * Need to intercept ACKNOWLEDGE or FYI actions taken on notification workflow documents and set the local state of the
     * Notification to REMOVED as well.
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doActionTaken(org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent)
     */
    public ProcessDocReport doActionTaken(ActionTakenEvent event) throws Exception {
        LOG.debug("ENTERING NotificationPostProcessor.doActionTaken() for Notification action item with document ID: " + event.getDocumentId());

        // NOTE: this action could be happening because the user initiated it via KEW, OR because a dismiss or autoremove action
        // has been invoked programmatically and the KEWActionListMessageDeliverer is taking an action...so there is a risk of being
        // invoked recursively (which will lead to locking issues and other problems).  We therefore mark the document in the KEWActionList
        // MessageDeliverer before performing an action, so that we can detect this scenario here, and avoid invoking KEN again.

        LOG.debug("ACTION TAKEN=" + event.getActionTaken().getActionTaken());

        String actionTakenCode = event.getActionTaken().getActionTaken().getCode();

        Properties p = new Properties();
        WorkflowDocument doc = WorkflowDocumentFactory.loadDocument(event.getActionTaken().getPrincipalId(), event.getDocumentId());
        try {
            p.load(new ByteArrayInputStream(doc.getAttributeContent().getBytes()));
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
        String internalCommand = p.getProperty(KEWActionListMessageDeliverer.INTERNAL_COMMAND_FLAG);

        if (Boolean.valueOf(internalCommand).booleanValue()) {
            LOG.info("Internal command detected by NotificationPostProcessor - will not invoke KEN");
            return new ProcessDocReport(true, "");
        }

        LOG.info("NotificationPostProcessor detected end-user action " + event.getActionTaken().getActionTaken() + " on document " + event.getActionTaken().getDocumentId());

        if(actionTakenCode.equals(KewApiConstants.ACTION_TAKEN_ACKNOWLEDGED_CD) || actionTakenCode.equals(KewApiConstants.ACTION_TAKEN_FYI_CD)) {
            LOG.debug("User has taken either acknowledge or fy action (action code=" + actionTakenCode +
                    ") for Notification action item with document ID: " + event.getDocumentId() +
            ".  We are now changing the status of the associated NotificationMessageDelivery to REMOVED.");

            try {
                NotificationMessageDelivery nmd = msgDeliverySvc.getNotificationMessageDeliveryByDelivererId(event.getDocumentId());

                if (nmd == null) {
                    throw new RuntimeException("Could not find message delivery from workflow document " + event.getDocumentId() + " to dismiss");
                }

                //get the id of the associated notification message delivery record
                String cause;
                if (KewApiConstants.ACTION_TAKEN_ACKNOWLEDGED_CD.equals(actionTakenCode)) {
                    cause = NotificationConstants.ACK_CAUSE;
                } else if (KewApiConstants.ACTION_TAKEN_FYI_CD.equals(actionTakenCode)) {
                    cause = NotificationConstants.FYI_CAUSE;
                } else {
                    cause = "unknown";
                }

                LOG.info("Dismissing message id " + nmd.getId() + " due to cause: " + cause);
                notificationService.dismissNotificationMessageDelivery(nmd.getId(),
                        Util.getNotificationSystemUser(),
                        cause);
            } catch(Exception e) {
                throw new RuntimeException("Error dismissing message", e);
            }
        }

        LOG.debug("LEAVING NotificationPostProcessor.doActionTaken() for Notification action item with document ID: " + event.getDocumentId());
        return new ProcessDocReport(true);
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#afterActionTaken(org.kuali.rice.kew.api.action.ActionType, org.kuali.rice.kew.framework.postprocessor.ActionTakenEvent)
     */
    @Override
    public ProcessDocReport afterActionTaken(ActionType performed, ActionTakenEvent event) throws Exception {
        return new ProcessDocReport(true, "");
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doDeleteRouteHeader(org.kuali.rice.kew.framework.postprocessor.DeleteEvent)
     */
    public ProcessDocReport doDeleteRouteHeader(DeleteEvent arg0) throws Exception {
        return new ProcessDocReport(true, "");
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doRouteLevelChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteLevelChange)
     */
    public ProcessDocReport doRouteLevelChange(DocumentRouteLevelChange arg0) throws Exception {
        return new ProcessDocReport(true, "");
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#doRouteStatusChange(org.kuali.rice.kew.framework.postprocessor.DocumentRouteStatusChange)
     */
    public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange arg0) throws Exception {
        return new ProcessDocReport(true, "");
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#beforeProcess(org.kuali.rice.kew.framework.postprocessor.BeforeProcessEvent)
     */
    public ProcessDocReport beforeProcess(BeforeProcessEvent beforeProcessEvent) throws Exception {
        return new ProcessDocReport(true, "");
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#afterProcess(org.kuali.rice.kew.framework.postprocessor.AfterProcessEvent)
     */
    public ProcessDocReport afterProcess(AfterProcessEvent afterProcessEvent) throws Exception {
        return new ProcessDocReport(true, "");
    }

    /**
     * @see org.kuali.rice.kew.framework.postprocessor.PostProcessor#getDocumentIdsToLock(org.kuali.rice.kew.framework.postprocessor.DocumentLockingEvent)
     */
	public List<String> getDocumentIdsToLock(DocumentLockingEvent documentLockingEvent) throws Exception {
		return null;
	}

}


text:
layout: default
modal-id: 2
date: 2014-07-17
img: vinyl.png
alt: image-alt
project-date: Sept 7 2014
client: Mytrax Inc
category: App Design
description: I created the logo, splash page, background for the play screen and colour scheme. App description - Do you miss the warm sound of vinyl music? The warmth, the organic texture? You can now get that feeling back directly on the music collection on your phone! With Vinyl!, you can get the warmth and the mechanical sounds of a real vinyl player. It is even possible to take it back decades earlier to simulate the quality of old jazz discs. Rediscover your music collection!

---


text:
#ifndef INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_
#define INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_

#include "perfetto/base/export.h"
#include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"

#include <stdint.h>

#include <memory>
#include <string>

namespace {
// std::underlying_type can't be used with non-enum types, so we need this
// indirection.
template <typename T, bool = std::is_enum<T>::value>
struct safe_underlying_type {
  using type = typename std::underlying_type<T>::type;
};

template <typename T>
struct safe_underlying_type<T, false> {
  using type = T;
};
}  // namespace

namespace perfetto {
namespace protos {
namespace pbzero {
class DebugAnnotation;
}  // namespace pbzero
}  // namespace protos

// A base class for custom track event debug annotations.
class PERFETTO_EXPORT DebugAnnotation {
 public:
  DebugAnnotation() = default;
  virtual ~DebugAnnotation();

  // Called to write the contents of the debug annotation into the trace.
  virtual void Add(protos::pbzero::DebugAnnotation*) const = 0;
};

namespace internal {
// Overloads for all the supported built in debug annotation types. Numeric
// types are handled with templates to avoid problems with overloading
// platform-specific types (e.g., size_t).
void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
                                          const char*);
void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
                                          const std::string&);
void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
                                          const void*);
void PERFETTO_EXPORT WriteDebugAnnotation(protos::pbzero::DebugAnnotation*,
                                          const DebugAnnotation&);

template <typename T>
void WriteDebugAnnotation(
    protos::pbzero::DebugAnnotation* annotation,
    T value,
    typename std::enable_if<std::is_floating_point<T>::value>::type* =
        nullptr) {
  annotation->set_double_value(static_cast<double>(value));
}

template <typename T>
void WriteDebugAnnotation(
    protos::pbzero::DebugAnnotation* annotation,
    T value,
    typename std::enable_if<std::is_integral<T>::value &&
                            !std::is_same<T, bool>::value &&
                            std::is_signed<T>::value>::type* = nullptr) {
  annotation->set_int_value(value);
}

template <typename T>
void WriteDebugAnnotation(
    protos::pbzero::DebugAnnotation* annotation,
    T value,
    typename std::enable_if<
        std::is_enum<T>::value &&
        std::is_signed<typename safe_underlying_type<T>::type>::value>::type* =
        nullptr) {
  annotation->set_int_value(value);
}

template <typename T>
void WriteDebugAnnotation(
    protos::pbzero::DebugAnnotation* annotation,
    T value,
    typename std::enable_if<std::is_enum<T>::value &&
                            std::is_unsigned<typename safe_underlying_type<
                                T>::type>::value>::type* = nullptr) {
  annotation->set_uint_value(value);
}

template <typename T>
void WriteDebugAnnotation(
    protos::pbzero::DebugAnnotation* annotation,
    T value,
    typename std::enable_if<std::is_integral<T>::value &&
                            !std::is_same<T, bool>::value &&
                            std::is_unsigned<T>::value>::type* = nullptr) {
  annotation->set_uint_value(value);
}

template <typename T>
void WriteDebugAnnotation(
    protos::pbzero::DebugAnnotation* annotation,
    T value,
    typename std::enable_if<std::is_same<T, bool>::value>::type* = nullptr) {
  annotation->set_bool_value(value);
}

template <typename T>
void WriteDebugAnnotation(protos::pbzero::DebugAnnotation* annotation,
                          const std::unique_ptr<T>& value) {
  WriteDebugAnnotation(annotation, *value);
}

}  // namespace internal
}  // namespace perfetto

#endif  // INCLUDE_PERFETTO_TRACING_DEBUG_ANNOTATION_H_


text:
import Vue from 'vue';
import { ExtendedVue } from 'vue/types/vue';
export interface FeatherIconProps {
  size: string;
}
export type FeatherIconComponent = ExtendedVue<
  Vue,
  {},
  {},
  {},
  FeatherIconProps
  >;
export const ActivityIcon: FeatherIconComponent;
export const AirplayIcon: FeatherIconComponent;
export const AlertCircleIcon: FeatherIconComponent;
export const AlertOctagonIcon: FeatherIconComponent;
export const AlertTriangleIcon: FeatherIconComponent;
export const AlignCenterIcon: FeatherIconComponent;
export const AlignJustifyIcon: FeatherIconComponent;
export const AlignLeftIcon: FeatherIconComponent;
export const AlignRightIcon: FeatherIconComponent;
export const AnchorIcon: FeatherIconComponent;
export const ApertureIcon: FeatherIconComponent;
export const ArchiveIcon: FeatherIconComponent;
export const ArrowDownCircleIcon: FeatherIconComponent;
export const ArrowDownLeftIcon: FeatherIconComponent;
export const ArrowDownRightIcon: FeatherIconComponent;
export const ArrowDownIcon: FeatherIconComponent;
export const ArrowLeftCircleIcon: FeatherIconComponent;
export const ArrowLeftIcon: FeatherIconComponent;
export const ArrowRightCircleIcon: FeatherIconComponent;
export const ArrowRightIcon: FeatherIconComponent;
export const ArrowUpCircleIcon: FeatherIconComponent;
export const ArrowUpLeftIcon: FeatherIconComponent;
export const ArrowUpRightIcon: FeatherIconComponent;
export const ArrowUpIcon: FeatherIconComponent;
export const AtSignIcon: FeatherIconComponent;
export const AwardIcon: FeatherIconComponent;
export const BarChart2Icon: FeatherIconComponent;
export const BarChartIcon: FeatherIconComponent;
export const BatteryChargingIcon: FeatherIconComponent;
export const BatteryIcon: FeatherIconComponent;
export const BellOffIcon: FeatherIconComponent;
export const BellIcon: FeatherIconComponent;
export const BluetoothIcon: FeatherIconComponent;
export const BoldIcon: FeatherIconComponent;
export const BookOpenIcon: FeatherIconComponent;
export const BookIcon: FeatherIconComponent;
export const BookmarkIcon: FeatherIconComponent;
export const BoxIcon: FeatherIconComponent;
export const BriefcaseIcon: FeatherIconComponent;
export const CalendarIcon: FeatherIconComponent;
export const CameraOffIcon: FeatherIconComponent;
export const CameraIcon: FeatherIconComponent;
export const CastIcon: FeatherIconComponent;
export const CheckCircleIcon: FeatherIconComponent;
export const CheckSquareIcon: FeatherIconComponent;
export const CheckIcon: FeatherIconComponent;
export const ChevronDownIcon: FeatherIconComponent;
export const ChevronLeftIcon: FeatherIconComponent;
export const ChevronRightIcon: FeatherIconComponent;
export const ChevronUpIcon: FeatherIconComponent;
export const ChevronsDownIcon: FeatherIconComponent;
export const ChevronsLeftIcon: FeatherIconComponent;
export const ChevronsRightIcon: FeatherIconComponent;
export const ChevronsUpIcon: FeatherIconComponent;
export const ChromeIcon: FeatherIconComponent;
export const CircleIcon: FeatherIconComponent;
export const ClipboardIcon: FeatherIconComponent;
export const ClockIcon: FeatherIconComponent;
export const CloudDrizzleIcon: FeatherIconComponent;
export const CloudLightningIcon: FeatherIconComponent;
export const CloudOffIcon: FeatherIconComponent;
export const CloudRainIcon: FeatherIconComponent;
export const CloudSnowIcon: FeatherIconComponent;
export const CloudIcon: FeatherIconComponent;
export const CodeIcon: FeatherIconComponent;
export const CodepenIcon: FeatherIconComponent;
export const CodesandboxIcon: FeatherIconComponent;
export const CoffeeIcon: FeatherIconComponent;
export const ColumnsIcon: FeatherIconComponent;
export const CommandIcon: FeatherIconComponent;
export const CompassIcon: FeatherIconComponent;
export const CopyIcon: FeatherIconComponent;
export const CornerDownLeftIcon: FeatherIconComponent;
export const CornerDownRightIcon: FeatherIconComponent;
export const CornerLeftDownIcon: FeatherIconComponent;
export const CornerLeftUpIcon: FeatherIconComponent;
export const CornerRightDownIcon: FeatherIconComponent;
export const CornerRightUpIcon: FeatherIconComponent;
export const CornerUpLeftIcon: FeatherIconComponent;
export const CornerUpRightIcon: FeatherIconComponent;
export const CpuIcon: FeatherIconComponent;
export const CreditCardIcon: FeatherIconComponent;
export const CropIcon: FeatherIconComponent;
export const CrosshairIcon: FeatherIconComponent;
export const DatabaseIcon: FeatherIconComponent;
export const DeleteIcon: FeatherIconComponent;
export const DiscIcon: FeatherIconComponent;
export const DollarSignIcon: FeatherIconComponent;
export const DownloadCloudIcon: FeatherIconComponent;
export const DownloadIcon: FeatherIconComponent;
export const DropletIcon: FeatherIconComponent;
export const Edit2Icon: FeatherIconComponent;
export const Edit3Icon: FeatherIconComponent;
export const EditIcon: FeatherIconComponent;
export const ExternalLinkIcon: FeatherIconComponent;
export const EyeOffIcon: FeatherIconComponent;
export const EyeIcon: FeatherIconComponent;
export const FacebookIcon: FeatherIconComponent;
export const FastForwardIcon: FeatherIconComponent;
export const FeatherIcon: FeatherIconComponent;
export const FigmaIcon: FeatherIconComponent;
export const FileMinusIcon: FeatherIconComponent;
export const FilePlusIcon: FeatherIconComponent;
export const FileTextIcon: FeatherIconComponent;
export const FileIcon: FeatherIconComponent;
export const FilmIcon: FeatherIconComponent;
export const FilterIcon: FeatherIconComponent;
export const FlagIcon: FeatherIconComponent;
export const FolderMinusIcon: FeatherIconComponent;
export const FolderPlusIcon: FeatherIconComponent;
export const FolderIcon: FeatherIconComponent;
export const FramerIcon: FeatherIconComponent;
export const FrownIcon: FeatherIconComponent;
export const GiftIcon: FeatherIconComponent;
export const GitBranchIcon: FeatherIconComponent;
export const GitCommitIcon: FeatherIconComponent;
export const GitMergeIcon: FeatherIconComponent;
export const GitPullRequestIcon: FeatherIconComponent;
export const GithubIcon: FeatherIconComponent;
export const GitlabIcon: FeatherIconComponent;
export const GlobeIcon: FeatherIconComponent;
export const GridIcon: FeatherIconComponent;
export const HardDriveIcon: FeatherIconComponent;
export const HashIcon: FeatherIconComponent;
export const HeadphonesIcon: FeatherIconComponent;
export const HeartIcon: FeatherIconComponent;
export const HelpCircleIcon: FeatherIconComponent;
export const HexagonIcon: FeatherIconComponent;
export const HomeIcon: FeatherIconComponent;
export const ImageIcon: FeatherIconComponent;
export const InboxIcon: FeatherIconComponent;
export const InfoIcon: FeatherIconComponent;
export const InstagramIcon: FeatherIconComponent;
export const ItalicIcon: FeatherIconComponent;
export const KeyIcon: FeatherIconComponent;
export const LayersIcon: FeatherIconComponent;
export const LayoutIcon: FeatherIconComponent;
export const LifeBuoyIcon: FeatherIconComponent;
export const Link2Icon: FeatherIconComponent;
export const LinkIcon: FeatherIconComponent;
export const LinkedinIcon: FeatherIconComponent;
export const ListIcon: FeatherIconComponent;
export const LoaderIcon: FeatherIconComponent;
export const LockIcon: FeatherIconComponent;
export const LogInIcon: FeatherIconComponent;
export const LogOutIcon: FeatherIconComponent;
export const MailIcon: FeatherIconComponent;
export const MapPinIcon: FeatherIconComponent;
export const MapIcon: FeatherIconComponent;
export const Maximize2Icon: FeatherIconComponent;
export const MaximizeIcon: FeatherIconComponent;
export const MehIcon: FeatherIconComponent;
export const MenuIcon: FeatherIconComponent;
export const MessageCircleIcon: FeatherIconComponent;
export const MessageSquareIcon: FeatherIconComponent;
export const MicOffIcon: FeatherIconComponent;
export const MicIcon: FeatherIconComponent;
export const Minimize2Icon: FeatherIconComponent;
export const MinimizeIcon: FeatherIconComponent;
export const MinusCircleIcon: FeatherIconComponent;
export const MinusSquareIcon: FeatherIconComponent;
export const MinusIcon: FeatherIconComponent;
export const MonitorIcon: FeatherIconComponent;
export const MoonIcon: FeatherIconComponent;
export const MoreHorizontalIcon: FeatherIconComponent;
export const MoreVerticalIcon: FeatherIconComponent;
export const MousePointerIcon: FeatherIconComponent;
export const MoveIcon: FeatherIconComponent;
export const MusicIcon: FeatherIconComponent;
export const Navigation2Icon: FeatherIconComponent;
export const NavigationIcon: FeatherIconComponent;
export const OctagonIcon: FeatherIconComponent;
export const PackageIcon: FeatherIconComponent;
export const PaperclipIcon: FeatherIconComponent;
export const PauseCircleIcon: FeatherIconComponent;
export const PauseIcon: FeatherIconComponent;
export const PenToolIcon: FeatherIconComponent;
export const PercentIcon: FeatherIconComponent;
export const PhoneCallIcon: FeatherIconComponent;
export const PhoneForwardedIcon: FeatherIconComponent;
export const PhoneIncomingIcon: FeatherIconComponent;
export const PhoneMissedIcon: FeatherIconComponent;
export const PhoneOffIcon: FeatherIconComponent;
export const PhoneOutgoingIcon: FeatherIconComponent;
export const PhoneIcon: FeatherIconComponent;
export const PieChartIcon: FeatherIconComponent;
export const PlayCircleIcon: FeatherIconComponent;
export const PlayIcon: FeatherIconComponent;
export const PlusCircleIcon: FeatherIconComponent;
export const PlusSquareIcon: FeatherIconComponent;
export const PlusIcon: FeatherIconComponent;
export const PocketIcon: FeatherIconComponent;
export const PowerIcon: FeatherIconComponent;
export const PrinterIcon: FeatherIconComponent;
export const RadioIcon: FeatherIconComponent;
export const RefreshCcwIcon: FeatherIconComponent;
export const RefreshCwIcon: FeatherIconComponent;
export const RepeatIcon: FeatherIconComponent;
export const RewindIcon: FeatherIconComponent;
export const RotateCcwIcon: FeatherIconComponent;
export const RotateCwIcon: FeatherIconComponent;
export const RssIcon: FeatherIconComponent;
export const SaveIcon: FeatherIconComponent;
export const ScissorsIcon: FeatherIconComponent;
export const SearchIcon: FeatherIconComponent;
export const SendIcon: FeatherIconComponent;
export const ServerIcon: FeatherIconComponent;
export const SettingsIcon: FeatherIconComponent;
export const Share2Icon: FeatherIconComponent;
export const ShareIcon: FeatherIconComponent;
export const ShieldOffIcon: FeatherIconComponent;
export const ShieldIcon: FeatherIconComponent;
export const ShoppingBagIcon: FeatherIconComponent;
export const ShoppingCartIcon: FeatherIconComponent;
export const ShuffleIcon: FeatherIconComponent;
export const SidebarIcon: FeatherIconComponent;
export const SkipBackIcon: FeatherIconComponent;
export const SkipForwardIcon: FeatherIconComponent;
export const SlackIcon: FeatherIconComponent;
export const SlashIcon: FeatherIconComponent;
export const SlidersIcon: FeatherIconComponent;
export const SmartphoneIcon: FeatherIconComponent;
export const SmileIcon: FeatherIconComponent;
export const SpeakerIcon: FeatherIconComponent;
export const SquareIcon: FeatherIconComponent;
export const StarIcon: FeatherIconComponent;
export const StopCircleIcon: FeatherIconComponent;
export const SunIcon: FeatherIconComponent;
export const SunriseIcon: FeatherIconComponent;
export const SunsetIcon: FeatherIconComponent;
export const TabletIcon: FeatherIconComponent;
export const TagIcon: FeatherIconComponent;
export const TargetIcon: FeatherIconComponent;
export const TerminalIcon: FeatherIconComponent;
export const ThermometerIcon: FeatherIconComponent;
export const ThumbsDownIcon: FeatherIconComponent;
export const ThumbsUpIcon: FeatherIconComponent;
export const ToggleLeftIcon: FeatherIconComponent;
export const ToggleRightIcon: FeatherIconComponent;
export const ToolIcon: FeatherIconComponent;
export const Trash2Icon: FeatherIconComponent;
export const TrashIcon: FeatherIconComponent;
export const TrelloIcon: FeatherIconComponent;
export const TrendingDownIcon: FeatherIconComponent;
export const TrendingUpIcon: FeatherIconComponent;
export const TriangleIcon: FeatherIconComponent;
export const TruckIcon: FeatherIconComponent;
export const TvIcon: FeatherIconComponent;
export const TwitchIcon: FeatherIconComponent;
export const TwitterIcon: FeatherIconComponent;
export const TypeIcon: FeatherIconComponent;
export const UmbrellaIcon: FeatherIconComponent;
export const UnderlineIcon: FeatherIconComponent;
export const UnlockIcon: FeatherIconComponent;
export const UploadCloudIcon: FeatherIconComponent;
export const UploadIcon: FeatherIconComponent;
export const UserCheckIcon: FeatherIconComponent;
export const UserMinusIcon: FeatherIconComponent;
export const UserPlusIcon: FeatherIconComponent;
export const UserXIcon: FeatherIconComponent;
export const UserIcon: FeatherIconComponent;
export const UsersIcon: FeatherIconComponent;
export const VideoOffIcon: FeatherIconComponent;
export const VideoIcon: FeatherIconComponent;
export const VoicemailIcon: FeatherIconComponent;
export const Volume1Icon: FeatherIconComponent;
export const Volume2Icon: FeatherIconComponent;
export const VolumeXIcon: FeatherIconComponent;
export const VolumeIcon: FeatherIconComponent;
export const WatchIcon: FeatherIconComponent;
export const WifiOffIcon: FeatherIconComponent;
export const WifiIcon: FeatherIconComponent;
export const WindIcon: FeatherIconComponent;
export const XCircleIcon: FeatherIconComponent;
export const XOctagonIcon: FeatherIconComponent;
export const XSquareIcon: FeatherIconComponent;
export const XIcon: FeatherIconComponent;
export const YoutubeIcon: FeatherIconComponent;
export const ZapOffIcon: FeatherIconComponent;
export const ZapIcon: FeatherIconComponent;
export const ZoomInIcon: FeatherIconComponent;
export const ZoomOutIcon: FeatherIconComponent;