text:
"""Tests for the Heos Media Player platform."""
import asyncio

from pyheos import const, CommandError

from homeassistant.components.heos import media_player
from homeassistant.components.heos.const import (
    DATA_SOURCE_MANAGER, DOMAIN, SIGNAL_HEOS_SOURCES_UPDATED)
from homeassistant.components.media_player.const import (
    ATTR_INPUT_SOURCE, ATTR_INPUT_SOURCE_LIST, ATTR_MEDIA_ALBUM_NAME,
    ATTR_MEDIA_ARTIST, ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE,
    ATTR_MEDIA_DURATION, ATTR_MEDIA_POSITION, ATTR_MEDIA_POSITION_UPDATED_AT,
    ATTR_MEDIA_SHUFFLE, ATTR_MEDIA_TITLE, ATTR_MEDIA_VOLUME_LEVEL,
    ATTR_MEDIA_VOLUME_MUTED, DOMAIN as MEDIA_PLAYER_DOMAIN, MEDIA_TYPE_MUSIC,
    SERVICE_CLEAR_PLAYLIST, SERVICE_SELECT_SOURCE, SUPPORT_NEXT_TRACK,
    SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_PREVIOUS_TRACK, SUPPORT_STOP)
from homeassistant.const import (
    ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, ATTR_SUPPORTED_FEATURES,
    SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PAUSE, SERVICE_MEDIA_PLAY,
    SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_MEDIA_STOP, SERVICE_SHUFFLE_SET,
    SERVICE_VOLUME_MUTE, SERVICE_VOLUME_SET, STATE_IDLE, STATE_PLAYING,
    STATE_UNAVAILABLE)
from homeassistant.setup import async_setup_component

async def setup_platform(hass, config_entry, config):
    """Set up the media player platform for testing."""
    config_entry.add_to_hass(hass)
    assert await async_setup_component(hass, DOMAIN, config)
    await hass.async_block_till_done()

async def test_async_setup_platform():
    """Test setup platform does nothing (it uses config entries)."""
    await media_player.async_setup_platform(None, None, None)

async def test_state_attributes(hass, config_entry, config, controller):
    """Tests the state attributes."""
    await setup_platform(hass, config_entry, config)
    state = hass.states.get('media_player.test_player')
    assert state.state == STATE_IDLE
    assert state.attributes[ATTR_MEDIA_VOLUME_LEVEL] == 0.25
    assert not state.attributes[ATTR_MEDIA_VOLUME_MUTED]
    assert state.attributes[ATTR_MEDIA_CONTENT_ID] == "1"
    assert state.attributes[ATTR_MEDIA_CONTENT_TYPE] == MEDIA_TYPE_MUSIC
    assert ATTR_MEDIA_DURATION not in state.attributes
    assert ATTR_MEDIA_POSITION not in state.attributes
    assert state.attributes[ATTR_MEDIA_TITLE] == "Song"
    assert state.attributes[ATTR_MEDIA_ARTIST] == "Artist"
    assert state.attributes[ATTR_MEDIA_ALBUM_NAME] == "Album"
    assert not state.attributes[ATTR_MEDIA_SHUFFLE]
    assert state.attributes['media_album_id'] == 1
    assert state.attributes['media_queue_id'] == 1
    assert state.attributes['media_source_id'] == 1
    assert state.attributes['media_station'] == "Station Name"
    assert state.attributes['media_type'] == "Station"
    assert state.attributes[ATTR_FRIENDLY_NAME] == "Test Player"
    assert state.attributes[ATTR_SUPPORTED_FEATURES] == \
        SUPPORT_PLAY | SUPPORT_PAUSE | SUPPORT_STOP | SUPPORT_NEXT_TRACK | \
        SUPPORT_PREVIOUS_TRACK | media_player.BASE_SUPPORTED_FEATURES
    assert ATTR_INPUT_SOURCE not in state.attributes
    assert state.attributes[ATTR_INPUT_SOURCE_LIST] == \
        hass.data[DOMAIN][DATA_SOURCE_MANAGER].source_list

async def test_updates_start_from_signals(
        hass, config_entry, config, controller, favorites):
    """Tests dispatched signals update player."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]

    # Test player does not update for other players
    player.state = const.PLAY_STATE_PLAY
    player.heos.dispatcher.send(
        const.SIGNAL_PLAYER_EVENT, 2,
        const.EVENT_PLAYER_STATE_CHANGED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.state == STATE_IDLE

    # Test player_update standard events
    player.state = const.PLAY_STATE_PLAY
    player.heos.dispatcher.send(
        const.SIGNAL_PLAYER_EVENT, player.player_id,
        const.EVENT_PLAYER_STATE_CHANGED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.state == STATE_PLAYING

    # Test player_update progress events
    player.now_playing_media.duration = 360000
    player.now_playing_media.current_position = 1000
    player.heos.dispatcher.send(
        const.SIGNAL_PLAYER_EVENT, player.player_id,
        const.EVENT_PLAYER_NOW_PLAYING_PROGRESS)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.attributes[ATTR_MEDIA_POSITION_UPDATED_AT] is not None
    assert state.attributes[ATTR_MEDIA_DURATION] == 360
    assert state.attributes[ATTR_MEDIA_POSITION] == 1

    # Test controller player change updates
    player.available = False
    player.heos.dispatcher.send(
        const.SIGNAL_CONTROLLER_EVENT, const.EVENT_PLAYERS_CHANGED, {})
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.state == STATE_UNAVAILABLE

async def test_updates_from_connection_event(
        hass, config_entry, config, controller, input_sources, caplog):
    """Tests player updates from connection event after connection failure."""
    # Connected
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    player.available = True
    player.heos.dispatcher.send(
        const.SIGNAL_HEOS_EVENT, const.EVENT_CONNECTED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.state == STATE_IDLE
    assert player.refresh.call_count == 1

    # Connected handles refresh failure
    player.reset_mock()
    player.refresh.side_effect = CommandError(None, "Failure", 1)
    player.heos.dispatcher.send(
        const.SIGNAL_HEOS_EVENT, const.EVENT_CONNECTED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert player.refresh.call_count == 1
    assert "Unable to refresh player" in caplog.text

    # Disconnected
    player.reset_mock()
    player.available = False
    player.heos.dispatcher.send(
        const.SIGNAL_HEOS_EVENT, const.EVENT_DISCONNECTED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.state == STATE_UNAVAILABLE
    assert player.refresh.call_count == 0

async def test_updates_from_sources_updated(
        hass, config_entry, config, controller, input_sources):
    """Tests player updates from changes in sources list."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    event = asyncio.Event()

    async def set_signal():
        event.set()
    hass.helpers.dispatcher.async_dispatcher_connect(
        SIGNAL_HEOS_SOURCES_UPDATED, set_signal)

    input_sources.clear()
    player.heos.dispatcher.send(
        const.SIGNAL_CONTROLLER_EVENT, const.EVENT_SOURCES_CHANGED, {})
    await event.wait()
    source_list = hass.data[DOMAIN][DATA_SOURCE_MANAGER].source_list
    assert len(source_list) == 2
    state = hass.states.get('media_player.test_player')
    assert state.attributes[ATTR_INPUT_SOURCE_LIST] == source_list

async def test_updates_from_user_changed(
        hass, config_entry, config, controller):
    """Tests player updates from changes in user."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    event = asyncio.Event()

    async def set_signal():
        event.set()
    hass.helpers.dispatcher.async_dispatcher_connect(
        SIGNAL_HEOS_SOURCES_UPDATED, set_signal)

    controller.is_signed_in = False
    controller.signed_in_username = None
    player.heos.dispatcher.send(
        const.SIGNAL_CONTROLLER_EVENT, const.EVENT_USER_CHANGED, None)
    await event.wait()
    source_list = hass.data[DOMAIN][DATA_SOURCE_MANAGER].source_list
    assert len(source_list) == 1
    state = hass.states.get('media_player.test_player')
    assert state.attributes[ATTR_INPUT_SOURCE_LIST] == source_list

async def test_clear_playlist(hass, config_entry, config, controller, caplog):
    """Test the clear playlist service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_CLEAR_PLAYLIST,
            {ATTR_ENTITY_ID: 'media_player.test_player'}, blocking=True)
        assert player.clear_queue.call_count == 1
        player.clear_queue.reset_mock()
        player.clear_queue.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to clear playlist: Failure (1)" in caplog.text

async def test_pause(hass, config_entry, config, controller, caplog):
    """Test the pause service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_MEDIA_PAUSE,
            {ATTR_ENTITY_ID: 'media_player.test_player'}, blocking=True)
        assert player.pause.call_count == 1
        player.pause.reset_mock()
        player.pause.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to pause: Failure (1)" in caplog.text

async def test_play(hass, config_entry, config, controller, caplog):
    """Test the play service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_MEDIA_PLAY,
            {ATTR_ENTITY_ID: 'media_player.test_player'}, blocking=True)
        assert player.play.call_count == 1
        player.play.reset_mock()
        player.play.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to play: Failure (1)" in caplog.text

async def test_previous_track(hass, config_entry, config, controller, caplog):
    """Test the previous track service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_MEDIA_PREVIOUS_TRACK,
            {ATTR_ENTITY_ID: 'media_player.test_player'}, blocking=True)
        assert player.play_previous.call_count == 1
        player.play_previous.reset_mock()
        player.play_previous.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to move to previous track: Failure (1)" in caplog.text

async def test_next_track(hass, config_entry, config, controller, caplog):
    """Test the next track service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_MEDIA_NEXT_TRACK,
            {ATTR_ENTITY_ID: 'media_player.test_player'}, blocking=True)
        assert player.play_next.call_count == 1
        player.play_next.reset_mock()
        player.play_next.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to move to next track: Failure (1)" in caplog.text

async def test_stop(hass, config_entry, config, controller, caplog):
    """Test the stop service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_MEDIA_STOP,
            {ATTR_ENTITY_ID: 'media_player.test_player'}, blocking=True)
        assert player.stop.call_count == 1
        player.stop.reset_mock()
        player.stop.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to stop: Failure (1)" in caplog.text

async def test_volume_mute(hass, config_entry, config, controller, caplog):
    """Test the volume mute service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_VOLUME_MUTE,
            {ATTR_ENTITY_ID: 'media_player.test_player',
             ATTR_MEDIA_VOLUME_MUTED: True}, blocking=True)
        assert player.set_mute.call_count == 1
        player.set_mute.reset_mock()
        player.set_mute.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to set mute: Failure (1)" in caplog.text

async def test_shuffle_set(hass, config_entry, config, controller, caplog):
    """Test the shuffle set service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_SHUFFLE_SET,
            {ATTR_ENTITY_ID: 'media_player.test_player',
             ATTR_MEDIA_SHUFFLE: True}, blocking=True)
        player.set_play_mode.assert_called_once_with(player.repeat, True)
        player.set_play_mode.reset_mock()
        player.set_play_mode.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to set shuffle: Failure (1)" in caplog.text

async def test_volume_set(hass, config_entry, config, controller, caplog):
    """Test the volume set service."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # First pass completes successfully, second pass raises command error
    for _ in range(2):
        await hass.services.async_call(
            MEDIA_PLAYER_DOMAIN, SERVICE_VOLUME_SET,
            {ATTR_ENTITY_ID: 'media_player.test_player',
             ATTR_MEDIA_VOLUME_LEVEL: 1}, blocking=True)
        player.set_volume.assert_called_once_with(100)
        player.set_volume.reset_mock()
        player.set_volume.side_effect = CommandError(None, "Failure", 1)
    assert "Unable to set volume level: Failure (1)" in caplog.text

async def test_select_favorite(
        hass, config_entry, config, controller, favorites):
    """Tests selecting a music service favorite and state."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # Test set music service preset
    favorite = favorites[1]
    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN, SERVICE_SELECT_SOURCE,
        {ATTR_ENTITY_ID: 'media_player.test_player',
         ATTR_INPUT_SOURCE: favorite.name}, blocking=True)
    player.play_favorite.assert_called_once_with(1)
    # Test state is matched by station name
    player.now_playing_media.station = favorite.name
    player.heos.dispatcher.send(
        const.SIGNAL_PLAYER_EVENT, player.player_id,
        const.EVENT_PLAYER_STATE_CHANGED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.attributes[ATTR_INPUT_SOURCE] == favorite.name

async def test_select_radio_favorite(
        hass, config_entry, config, controller, favorites):
    """Tests selecting a radio favorite and state."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # Test set radio preset
    favorite = favorites[2]
    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN, SERVICE_SELECT_SOURCE,
        {ATTR_ENTITY_ID: 'media_player.test_player',
         ATTR_INPUT_SOURCE: favorite.name}, blocking=True)
    player.play_favorite.assert_called_once_with(2)
    # Test state is matched by album id
    player.now_playing_media.station = "Classical"
    player.now_playing_media.album_id = favorite.media_id
    player.heos.dispatcher.send(
        const.SIGNAL_PLAYER_EVENT, player.player_id,
        const.EVENT_PLAYER_STATE_CHANGED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.attributes[ATTR_INPUT_SOURCE] == favorite.name

async def test_select_radio_favorite_command_error(
        hass, config_entry, config, controller, favorites, caplog):
    """Tests command error loged when playing favorite."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # Test set radio preset
    favorite = favorites[2]
    player.play_favorite.side_effect = CommandError(None, "Failure", 1)
    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN, SERVICE_SELECT_SOURCE,
        {ATTR_ENTITY_ID: 'media_player.test_player',
         ATTR_INPUT_SOURCE: favorite.name}, blocking=True)
    player.play_favorite.assert_called_once_with(2)
    assert "Unable to select source: Failure (1)" in caplog.text

async def test_select_input_source(
        hass, config_entry, config, controller, input_sources):
    """Tests selecting input source and state."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    # Test proper service called
    input_source = input_sources[0]
    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN, SERVICE_SELECT_SOURCE,
        {ATTR_ENTITY_ID: 'media_player.test_player',
         ATTR_INPUT_SOURCE: input_source.name}, blocking=True)
    player.play_input_source.assert_called_once_with(input_source)
    # Test state is matched by media id
    player.now_playing_media.source_id = const.MUSIC_SOURCE_AUX_INPUT
    player.now_playing_media.media_id = const.INPUT_AUX_IN_1
    player.heos.dispatcher.send(
        const.SIGNAL_PLAYER_EVENT, player.player_id,
        const.EVENT_PLAYER_STATE_CHANGED)
    await hass.async_block_till_done()
    state = hass.states.get('media_player.test_player')
    assert state.attributes[ATTR_INPUT_SOURCE] == input_source.name

async def test_select_input_unknown(
        hass, config_entry, config, controller, caplog):
    """Tests selecting an unknown input."""
    await setup_platform(hass, config_entry, config)
    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN, SERVICE_SELECT_SOURCE,
        {ATTR_ENTITY_ID: 'media_player.test_player',
         ATTR_INPUT_SOURCE: "Unknown"}, blocking=True)
    assert "Unknown source: Unknown" in caplog.text

async def test_select_input_command_error(
        hass, config_entry, config, controller, caplog, input_sources):
    """Tests selecting an unknown input."""
    await setup_platform(hass, config_entry, config)
    player = controller.players[1]
    input_source = input_sources[0]
    player.play_input_source.side_effect = CommandError(None, "Failure", 1)
    await hass.services.async_call(
        MEDIA_PLAYER_DOMAIN, SERVICE_SELECT_SOURCE,
        {ATTR_ENTITY_ID: 'media_player.test_player',
         ATTR_INPUT_SOURCE: input_source.name}, blocking=True)
    player.play_input_source.assert_called_once_with(input_source)
    assert "Unable to select source: Failure (1)" in caplog.text

async def test_unload_config_entry(hass, config_entry, config, controller):
    """Test the player is removed when the config entry is unloaded."""
    await setup_platform(hass, config_entry, config)
    await config_entry.async_unload(hass)
    assert not hass.states.get('media_player.test_player')


text:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { HttpClientInMemoryWebApiModule } from 'angular-in-memory-web-api';

import { AppComponent } from './app.component';
import { HeroesComponent } from './heroes/heroes.component';
import { HeroDetailComponent } from './hero-detail/hero-detail.component';
import { MessageComponent } from './message/message.component';
import { AppRoutingModule } from './app-routing.module';
import { DashboardComponent } from './dashboard/dashboard.component';
import { InMemoryDataService }  from './in-memory-data.service';

@NgModule({
  declarations: [
    AppComponent,
    HeroesComponent,
    HeroDetailComponent,
    MessageComponent,
    DashboardComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule,
    HttpClientModule,

  // The HttpClientInMemoryWebApiModule module intercepts HTTP requests
  // and returns simulated server responses.
  // Remove it when a real server is ready to receive requests.
    HttpClientInMemoryWebApiModule.forRoot(
      InMemoryDataService, { dataEncapsulation: false }
    ),
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

redpajama_set_name: RedPajamaGithub


text:
#ifndef _CARTO_POLYGON3DRENDERER_H_
#define _CARTO_POLYGON3DRENDERER_H_

#include "renderers/utils/GLContext.h"

#include <deque>
#include <memory>
#include <mutex>
#include <vector>

#include <cglib/ray.h>

namespace carto {
    class Polygon3D;
    class Polygon3DDrawData;
    class Options;
    class MapRenderer;
    class Shader;
    class RayIntersectedElement;
    class VectorLayer;
    class ViewState;

    class Polygon3DRenderer {
    public:
        Polygon3DRenderer();
        virtual ~Polygon3DRenderer();

        void setComponents(const std::weak_ptr<Options>& options, const std::weak_ptr<MapRenderer>& mapRenderer);

        void offsetLayerHorizontally(double offset);

        void onDrawFrame(float deltaSeconds, const ViewState& viewState);

        void addElement(const std::shared_ptr<Polygon3D>& element);
        void refreshElements();
        void updateElement(const std::shared_ptr<Polygon3D>& element);
        void removeElement(const std::shared_ptr<Polygon3D>& element);

        void calculateRayIntersectedElements(const std::shared_ptr<VectorLayer>& layer, const cglib::ray3<double>& ray, const ViewState& viewState, std::vector<RayIntersectedElement>& results) const;

    private:
        static void BuildAndDrawBuffers(GLuint a_color,
                                        GLuint a_attrib,
                                        GLuint a_coord,
                                        GLuint a_normal,
                                        std::vector<unsigned char>& colorBuf,
                                        std::vector<unsigned char>& attribBuf,
                                        std::vector<float>& coordBuf,
                                        std::vector<float>& normalBuf,
                                        std::vector<std::shared_ptr<Polygon3DDrawData> >& drawDataBuffer,
                                        const ViewState& viewState);

        bool initializeRenderer();
        void drawBatch(const ViewState& viewState);

        static const std::string POLYGON3D_VERTEX_SHADER;
        static const std::string POLYGON3D_FRAGMENT_SHADER;

        std::weak_ptr<Options> _options;
        std::weak_ptr<MapRenderer> _mapRenderer;

        std::vector<std::shared_ptr<Polygon3D> > _elements;
        std::vector<std::shared_ptr<Polygon3D> > _tempElements;

        std::vector<std::shared_ptr<Polygon3DDrawData> > _drawDataBuffer;

        std::vector<unsigned char> _colorBuf;
        std::vector<unsigned char> _attribBuf;
        std::vector<float> _coordBuf;
        std::vector<float> _normalBuf;

        std::shared_ptr<Shader> _shader;
        GLuint _a_color;
        GLuint _a_attrib;
        GLuint _a_coord;
        GLuint _a_normal;
        GLuint _u_ambientColor;
        GLuint _u_lightColor;
        GLuint _u_lightDir;
        GLuint _u_mvpMat;

        mutable std::mutex _mutex;
    };

}

#endif


text:
package com.ned.admitone.domain.api.purchase;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.ned.admitone.domain.api.ResponseInterface;
import com.ned.admitone.domain.api.purchase.request.PurchaseRequestInterface;
import com.ned.admitone.domain.api.purchase.response.PurchaseResponseInterface;
import com.ned.admitone.domain.event.Event;
import com.ned.admitone.domain.ticket.Ticket;
import com.ned.admitone.domain.user.User;

import java.util.List;

public class PurchaseMixIns {

    private PurchaseMixIns() {
    }

    @JsonTypeInfo(use = JsonTypeInfo.Id.NONE)
    public abstract static class PurchaseRequestMixIn implements PurchaseRequestInterface {
        @Override
        @JsonProperty
        public abstract String getUsername();

        @Override
        @JsonProperty
        public abstract Long getSourceEventId();

        @Override
        @JsonProperty
        public abstract int getNumberOfTickets();
    }

    @JsonTypeInfo(use = JsonTypeInfo.Id.NONE)
    public abstract static class PurchaseResponseMixIn implements PurchaseResponseInterface {
        @Override
        @JsonProperty
        public abstract User getUser();

        @Override
        @JsonProperty
        public abstract Event getEvent();

        @Override
        @JsonProperty
        public abstract boolean isSuccess();

        @Override
        @JsonProperty
        public abstract List<Ticket> getTickets();

        @Override
        @JsonProperty
        public abstract List<ResponseInterface.DETAILS> getMessages();
    }
}


text:
void inline GetProductVersionNumber(SString &szFullPath, DWORD * pdwVersionMS, DWORD * pdwVersionLS)
{
    WRAPPER_NO_CONTRACT;
#ifndef FEATURE_PAL

    DWORD dwDummy = 0;
    DWORD dwFileInfoSize = 0;

    // Get the size of all of the file version information.
    dwFileInfoSize = GetFileVersionInfoSize(szFullPath, &dwDummy);
    if (dwFileInfoSize == 0)
    {
        ThrowLastError();
    }

    // Create the buffer to store the file information.
    NewHolder<BYTE> pbFileInfo(new BYTE[dwFileInfoSize]);

    // Actually retrieve the file version information.
    if (!GetFileVersionInfo(szFullPath, NULL, dwFileInfoSize, pbFileInfo))
    {
        ThrowLastError();
    }

    // Now retrieve only the relevant version information, which will be returned in a VS_FIXEDFILEINFO.
    UINT uVersionInfoSize = 0;
    VS_FIXEDFILEINFO * pVersionInfo = NULL;

    if (!VerQueryValue(pbFileInfo, W("\\"), reinterpret_cast<LPVOID *>(&pVersionInfo), &uVersionInfoSize))
    {
        ThrowLastError();
    }
    _ASSERTE(uVersionInfoSize == sizeof(VS_FIXEDFILEINFO));

    *pdwVersionMS = pVersionInfo->dwProductVersionMS;
    *pdwVersionLS = pVersionInfo->dwProductVersionLS;
#else
    *pdwVersionMS = 0;
    *pdwVersionLS = 0;
#endif // FEATURE_PAL
}

#endif // __GetProductVersionNumber_h__


text:
require_relative '../slide'

module Parade
  module Parsers

    #
    # As multiple slides are contained within a markdown file, this parser
    # will split the markdown along the specified slide marker.
    #
    # @todo this currently does too much at the moment. It should simply split
    #   the markdown file along the slide markers and allow another parser
    #   perform the work of creating the actual slide objects.
    #
    class MarkdownSlideSplitter

      #
      # Splits the markdown content into separate slide files based on the
      # separator defined by this class.
      #
      # @param [String] content content that is markdown format
      # @return [Array] slides parsed from the markdown content
      def self.parse(content,options = {})

        # if there are no !SLIDE markers, then make every H1 define a new slide
        unless content =~ /^\<?!SLIDE/m
          content = content.gsub(/^# /m, "<!SLIDE>\n# ")
        end

        lines = content.split("\n")

        # Break the markdown apart into separate markdown files based on the
        # separator

        slides = []
        current_slide = Slide.new
        slides << current_slide

        until lines.empty?
          line = lines.shift

          if line =~ /^<?!SLIDE(.*)>?/

            # Remove the trailing > from the metadata
            metadata_string = Regexp.last_match(1).gsub(/>$/,'')

            metadata = Metadata.parse metadata_string

            current_slide = Slide.new(:metadata => metadata)
            slides << current_slide
          else
            current_slide << line
          end

        end

        slides.delete_if {|slide| slide.empty? }
        slides.each_with_index {|slide,index| slide.sequence = (index + 1) }

      end
    end

  end
end


text:
package br.com.jsn.noleggio.main.pattern.producer;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;

@ApplicationScoped
public class BeanValidationProducer {

	@Produces
	public ValidatorFactory createValidatorFactory() {
		ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
		return validatorFactory;
	}

	@Produces
	public Validator createValidator(ValidatorFactory factory) {
		return factory.getValidator();
	}
}


text:
export const ASC = 'ASC';
export const DESC = 'DESC';


text:
This lexicon defines standard platform property names and values that servers
MAY support in the `Platform` message to facilitate interoperability.

The following standard property `name`s are defined:

* `OSFamily`: This describes the operating system family. Multiple values
  are not allowed and an exact match is required.

  The following standard values are defined:

    - `aix`
    - `freebsd`
    - `linux`
    - `macos`
    - `sunos`
    - `windows`

  Additional values may be defined by the server. For other POSIX systems
  the recommendation is to use the output of `uname -s` in lower case.

* `ISA`: This describes the instruction set architecture including
  instruction set extensions and versions. Multiple values are allowed. If
  multiple values are specified, they are AND-ed together: the worker is
  required to support all of the listed values.

  The following standard instruction set architecture values are defined:

    - `arm-a32` (little endian)
    - `arm-a32-be` (big endian)
    - `arm-a64` (little endian)
    - `arm-a64-be` (big endian)
    - `arm-t32` (little endian)
    - `arm-t32-be` (big endian)
    - `power-isa-be` (big endian)
    - `power-isa-le` (little endian)
    - `rv32g` (little endian)
    - `rv64g` (little endian)
    - `sparc-v9` (big endian)
    - `x86-32`
    - `x86-64`

  The following standard instruction set extension and version values are
  defined:

    - `arm-neon`
    - `arm-sve`
    - `arm-vfpv3`
    - `arm-vfpv4`
    - `armv6`
    - `armv7`
    - `armv8`
    - `x86-avx`
    - `x86-avx2`
    - `x86-avx-512`
    - `x86-sse4.1`
    - `x86-sse4.2`

  Additional values may be defined by the server. Vendor-neutral names are
  recommended.

  Clients SHOULD NOT request instruction set extensions or versions without
  requesting an instruction set architecture.

  Examples with multiple values:

  ```json
  // (Platform proto)
  {
    "properties": [
      {
        "name": "ISA",
        "value": "x86-64"
      },
      {
        "name": "ISA",
        "value": "x86-avx2"
      }
    ]
  }
  ```

  ```json
  // (Platform proto)
  {
    "properties": [
      {
        "name": "ISA",
        "value": "arm-a64"
      },
      {
        "name": "ISA",
        "value": "armv8"
      },
      {
        "name": "ISA",
        "value": "arm-sve"
      }
    ]
  }
  ```

  ```json
  // (Platform proto)
  {
    "properties": [
      {
        "name": "ISA",
        "value": "arm-a32"
      },
      {
        "name": "ISA",
        "value": "armv7"
      },
      {
        "name": "ISA",
        "value": "arm-vfpv4"
      }
    ]
  }
  ```


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
	<!-- custom light theme: -->
    <color name="primary">#3C4655</color>
    <color name="primary_dark">#0E0E0E</color>
    <color name="accent">#F4982E</color>

    <!-- custom jayne's hat dialog theme: -->
    <color name="jayne_text_primary_light">#e8ffb300</color>
    <color name="jayne_text_secondary_light">#e9b65b00</color>
    <color name="jayne_divider_light">#1fff002b</color>
    <color name="jayne_pressed_light">#c74e2c00</color>
    <color name="jayne_accent">#f42e35</color>
</resources>


text:
cask 'lingo' do
  version '10.5,111'
  sha256 'a92fa560723151dbb6a9a2450e6c73dcca43c4b1103153c519d2a258c2608197'

  # rink.hockeyapp.net/api/2/apps/ was verified as official when first introduced to the cask
  url "https://rink.hockeyapp.net/api/2/apps/7d71478daf6447bda4094e216e97b0cf/app_versions/#{version.after_comma}?format=zip"
  appcast 'https://www.lingoapp.com/mac/appcast'
  name 'Lingo'
  homepage 'https://www.lingoapp.com/'

  app 'Lingo.app'

  zap trash: [
               '~/Library/Preferences/com.lingoapp.Lingo.plist',
               '~/Library/Application Support/com.lingoapp.Lingo',
               '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.lingoapp.lingo.sfl*',
             ]
end


text:
{
  "Insert/edit horizontal rule": "Horizontale lijn invoegen/bewerken",
  "Horizontal Rule": "Horizontale lijn",
  "Layout": "Weergave",
  "Width:": "Breedte:",
  "percent": "procent",
  "pixels": "pixels",
  "Height:": "Hoogte:",
  "Alignment:": "Uitvulling:",
  "Left": "Links",
  "Center": "Midden",
  "Right": "Rechts",
  "Style": "Style",
  "Color:": "kleur",
  "No shading": "Geen schaduw",
  "Note:": "Notitie",
  "To select an existing horizontal rule, a double-click may be needed.": "Om een bestaande horizontale lijn te selecteren moet je mogelijk dubbel klikken."
};


text:
/*!
  \file abstract_xag.hpp
  \brief Abstract XAG logic network implementation

  This network type is (for now) only meant for experimental use cases.

  \author Mathias Soeken
*/

#pragma once

#include <memory>
#include <optional>
#include <stack>
#include <string>

#include <fmt/format.h>
#include <kitty/dynamic_truth_table.hpp>
#include <kitty/operators.hpp>
#include <parallel_hashmap/phmap.h>

#include "../traits.hpp"
#include "../utils/algorithm.hpp"
#include "detail/foreach.hpp"

namespace mockturtle
{

struct abstract_xag_storage
{
  struct node_type
  {
    uint32_t* fanin{};
    uint32_t fanin_size{};
    uint32_t fanout_size{};
    uint32_t value{};
    uint32_t visited{};
    uint32_t level{};
  };

  abstract_xag_storage()
  {
    /* constant 0 node */
    nodes.emplace_back();

    // nodes.reserve( 10000u );
  }

  ~abstract_xag_storage()
  {
    for ( auto& n : nodes )
    {
      if ( n.fanin )
      {
        delete[] n.fanin;
      }
    }
  }

  struct abstract_xag_node_eq
  {
    bool operator()( abstract_xag_storage::node_type const& a, abstract_xag_storage::node_type const& b ) const
    {
      return a.fanin_size == b.fanin_size && std::equal( a.fanin, a.fanin + a.fanin_size, b.fanin );
    }
  };

  struct abstract_xag_node_hash
  {
    uint64_t operator()( abstract_xag_storage::node_type const& n ) const
    {
      return std::accumulate( n.fanin, n.fanin + n.fanin_size, UINT64_C( 0 ), [&]( auto accu, auto c ) { return accu + std::hash<uint32_t>{}( c ); } );
    }
  };

  std::vector<node_type> nodes;
  std::vector<uint32_t> children;
  std::vector<uint32_t> inputs;
  std::vector<std::pair<uint32_t, bool>> outputs;
  phmap::flat_hash_map<node_type, uint32_t, abstract_xag_node_hash, abstract_xag_node_eq> hash;

  uint32_t trav_id = 0u;
  uint32_t depth = 0u;
};

class abstract_xag_network
{
public:
#pragma region Types and constructors
  static constexpr auto min_fanin_size = 1u;
  static constexpr auto max_fanin_size = std::numeric_limits<uint32_t>::max();

  using base_type = abstract_xag_network;
  using storage_type = abstract_xag_storage;
  using storage = std::shared_ptr<storage_type>;
  using node = uint32_t;

  struct signal
  {
    signal() = default;
    signal( uint32_t index, bool complement = false ) : index( index ), complement( complement ) {}

    uint32_t index;
    bool complement;

    signal operator!() const
    {
      return { index, !complement };
    }

    signal operator+() const
    {
      return { index, false };
    }

    signal operator-() const
    {
      return { index, true };
    }

    signal operator^( bool complement ) const
    {
      return { index, this->complement != complement };
    }

    bool operator==( signal const& other ) const
    {
      return index == other.index && complement == other.complement;
    }

    bool operator!=( signal const& other ) const
    {
      return index != other.index || complement != other.complement;
    }

    bool operator<( signal const& other ) const
    {
      return index < other.index || ( index == other.index && !complement && other.complement );
    }
  };

  abstract_xag_network()
      : _storage( std::make_shared<storage_type>() )
  {
  }

  abstract_xag_network( std::shared_ptr<storage_type> storage )
      : _storage( storage )
  {
  }
#pragma endregion

#pragma region Primary I / O and constants
  signal get_constant( bool value ) const
  {
    return { 0, value };
  }

  signal create_pi()
  {
    const auto index = static_cast<uint32_t>( _storage->nodes.size() );
    _storage->nodes.emplace_back();
    _storage->inputs.emplace_back( index );
    return { index, 0 };
  }

  uint32_t create_po( signal const& f )
  {
    /* increase ref-count to children */
    _storage->nodes[f.index].fanout_size++;
    auto const po_index = static_cast<uint32_t>( _storage->outputs.size() );
    _storage->outputs.emplace_back( f.index, f.complement );
    _storage->depth = std::max( _storage->depth, level( f.index ) );
    return po_index;
  }

  bool is_combinational() const
  {
    return true;
  }

  bool is_constant( node const& n ) const
  {
    return n == 0;
  }

  bool is_pi( node const& n ) const
  {
    return n > 0 && _storage->nodes[n].fanin_size == 0u;
  }

  bool is_ci( node const& n ) const
  {
    return n > 0 && _storage->nodes[n].fanin_size == 0u;
  }

  bool constant_value( node const& n ) const
  {
    (void)n;
    return false;
  }
#pragma endregion

#pragma region Create unary functions
  signal create_buf( signal const& a )
  {
    return a;
  }

  signal create_not( signal const& a )
  {
    return !a;
  }
#pragma endregion

#pragma region Create binary functions
  signal _create_node( std::vector<uint32_t> const& fanin, uint32_t level_offset )
  {
    storage::element_type::node_type node;
    node.fanin = new uint32_t[fanin.size()];
    node.fanin_size = fanin.size();
    std::copy( fanin.begin(), fanin.end(), node.fanin );

    /* structural hashing */
    if ( const auto it = _storage->hash.find( node ); it != _storage->hash.end() )
    {
      delete[] node.fanin;
      return { it->second, 0 };
    }

    const auto index = static_cast<uint32_t>( _storage->nodes.size() );
    _storage->nodes.push_back( node );
    _storage->hash.emplace( node, index );

    /* increase ref-count to children */
    uint32_t _level = 0u;
    for ( auto const& f : fanin )
    {
      _storage->nodes[f].fanout_size++;
      _level = std::max( _level, level( f ) );
    }
    _storage->nodes[index].level = _level + level_offset;

    return { index, 0u };
  }

  signal create_and( signal a, signal b )
  {
    /* order inputs a > b it is a AND */
    if ( a.index < b.index )
    {
      std::swap( a, b );
    }
    /* trivial cases */
    if ( a.index == b.index )
    {
      return a.complement == b.complement ? a : get_constant( false );
    }
    else if ( b.index == 0 )
    {
      return b.complement == false ? get_constant( false ) : a;
    }
    /* constant propagation */
    else if ( a.complement && b.complement )
    {
      return !create_nary_xor( { +a, +b, create_and( +a, +b ) } );
    }
    else if ( a.complement )
    {
      return create_xor( create_and( +a, b ), b );
    }
    else if ( b.complement )
    {
      return create_xor( create_and( a, +b ), a );
    }

    /* subset resolution */
    const auto& anode = _storage->nodes[a.index];
    const auto& bnode = _storage->nodes[b.index];

    const auto a_begin = is_nary_xor( a.index ) ? anode.fanin : &a.index;
    const auto a_end = is_nary_xor( a.index ) ? anode.fanin + anode.fanin_size : &a.index + 1;
    const auto b_begin = is_nary_xor( b.index ) ? bnode.fanin : &b.index;
    const auto b_end = is_nary_xor( b.index ) ? bnode.fanin + bnode.fanin_size : &b.index + 1;

    if ( std::includes( a_begin, a_end, b_begin, b_end ) )
    {
      std::vector<uint32_t> set_anew;
      std::set_difference( a_begin, a_end, b_begin, b_end, std::back_inserter( set_anew ) );
      return create_xor( b, create_and( b, _create_nary_xor( set_anew ) ) );
    }
    else if ( std::includes( b_begin, b_end, a_begin, a_end ) )
    {
      std::vector<uint32_t> set_bnew;
      std::set_difference( b_begin, b_end, a_begin, a_end, std::back_inserter( set_bnew ) );
      return create_xor( a, create_and( a, _create_nary_xor( set_bnew ) ) );
    }

    return _create_node( std::vector<uint32_t>{ { a.index, b.index } }, 1u );
  }

  signal create_nand( signal const& a, signal const& b )
  {
    return !create_and( a, b );
  }

  signal create_or( signal const& a, signal const& b )
  {
    return !create_and( !a, !b );
  }

  signal create_nor( signal const& a, signal const& b )
  {
    return create_and( !a, !b );
  }

  signal create_lt( signal const& a, signal const& b )
  {
    return create_and( !a, b );
  }

  signal create_le( signal const& a, signal const& b )
  {
    return !create_and( a, !b );
  }

  signal create_xor( signal const& a, signal const& b )
  {
    return create_nary_xor( { a, b } );
  }

  signal create_xnor( signal const& a, signal const& b )
  {
    return !create_xor( a, b );
  }
#pragma endregion

#pragma region Create ternary functions
  signal create_ite( signal cond, signal f_then, signal f_else )
  {
    bool f_compl{ false };
    if ( f_then.index < f_else.index )
    {
      std::swap( f_then, f_else );
      cond.complement ^= 1;
    }
    if ( f_then.complement )
    {
      f_then.complement = 0;
      f_else.complement ^= 1;
      f_compl = true;
    }

    return create_xor( create_and( !cond, create_xor( f_then, f_else ) ), f_then ) ^ f_compl;
  }

  signal create_maj( signal const& a, signal const& b, signal const& c )
  {
    auto c1 = create_xor( a, b );
    auto c2 = create_xor( a, c );
    auto c3 = create_and( c1, c2 );
    return create_xor( a, c3 );
  }

  signal create_xor3( signal const& a, signal const& b, signal const& c )
  {
    return create_nary_xor( { a, b, c } );
  }
#pragma endregion

#pragma region Create nary functions
  signal create_nary_and( std::vector<signal> const& fs )
  {
    return tree_reduce( fs.begin(), fs.end(), get_constant( true ), [this]( auto const& a, auto const& b ) { return create_and( a, b ); } );
  }

  signal create_nary_or( std::vector<signal> const& fs )
  {
    return tree_reduce( fs.begin(), fs.end(), get_constant( false ), [this]( auto const& a, auto const& b ) { return create_or( a, b ); } );
  }

  signal _create_nary_xor( std::vector<uint32_t> const& fs )
  {
    std::vector<uint32_t> _fs;

    const auto merge_one = [&]( uint32_t f ) {
      const auto it = std::lower_bound( _fs.begin(), _fs.end(), f );
      if ( it != _fs.end() && *it == f )
      {
        _fs.erase( it );
      }
      else
      {
        _fs.insert( it, f );
      }
    };

    const auto merge_many = [&]( uint32_t* begin, uint32_t* end ) {
      std::vector<uint32_t> tmp;
      std::set_symmetric_difference( _fs.begin(), _fs.end(), begin, end, std::back_inserter( tmp ) );
      _fs = std::move( tmp );
    };

    for ( auto const& f : fs )
    {
      auto const& node = _storage->nodes[f];
      if ( node.fanin_size == 0u )
      {
        merge_one( f );
      }
      else if ( node.fanin[0] > node.fanin[1] )
      {
        merge_one( f );
      }
      else
      {
        merge_many( node.fanin, node.fanin + node.fanin_size );
      }
    }

    if ( _fs.empty() )
    {
      return get_constant( false );
    }
    else if ( _fs.size() == 1u )
    {
      return { _fs.front(), false };
    }
    else
    {
      return _create_node( _fs, 0u );
    }
  }

  signal create_nary_xor( std::vector<signal> const& fs )
  {
    std::vector<uint32_t> _fs;

    const auto merge_one = [&]( uint32_t f ) {
      const auto it = std::lower_bound( _fs.begin(), _fs.end(), f );
      if ( it != _fs.end() && *it == f )
      {
        _fs.erase( it );
      }
      else
      {
        _fs.insert( it, f );
      }
    };

    const auto merge_many = [&]( uint32_t* begin, uint32_t* end ) {
      std::vector<uint32_t> tmp;
      std::set_symmetric_difference( _fs.begin(), _fs.end(), begin, end, std::back_inserter( tmp ) );
      _fs = std::move( tmp );
    };

    bool complement{ false };
    for ( auto const& f : fs )
    {
      complement ^= f.complement;
      auto const& node = _storage->nodes[f.index];
      if ( f.index == 0 )
      {
        // do nothing
      }
      else if ( node.fanin_size == 0u )
      {
        merge_one( f.index );
      }
      else if ( node.fanin[0] > node.fanin[1] )
      {
        merge_one( f.index );
      }
      else
      {
        merge_many( node.fanin, node.fanin + node.fanin_size );
      }
    }

    if ( _fs.empty() )
    {
      return get_constant( complement );
    }
    else if ( _fs.size() == 1u )
    {
      return { _fs.front(), complement };
    }
    else
    {
      return _create_node( _fs, 0u ) ^ complement;
    }
  }
#pragma endregion

#pragma region Create arbitrary functions
  signal clone_node( abstract_xag_network const& other, node const& source, std::vector<signal> const& children )
  {
    if ( other.is_and( source ) )
    {
      return create_and( children[0u], children[1u] );
    }
    else
    {
      return create_nary_xor( children );
    }
  }
#pragma endregion

#pragma region Nodes and signals
  node get_node( signal const& f ) const
  {
    return f.index;
  }

  signal make_signal( node const& n ) const
  {
    return { n, false };
  }

  bool is_complemented( signal const& f ) const
  {
    return f.complement;
  }

  uint32_t node_to_index( node const& n ) const
  {
    return n;
  }

  node index_to_node( uint32_t index ) const
  {
    return index;
  }

  node pi_at( uint32_t index ) const
  {
    assert( index < _storage->inputs.size() );
    return _storage->inputs[index];
  }

  signal po_at( uint32_t index ) const
  {
    assert( index < _storage->outputs.size() );
    const auto po = _storage->outputs[index];
    return { po.first, po.second };
  }
#pragma endregion

#pragma region Node and signal iterators
  template<typename Fn>
  void foreach_node( Fn&& fn ) const
  {
    auto r = range<uint32_t>( _storage->nodes.size() );
    detail::foreach_element( r.begin(), r.end(), fn );
  }

  template<typename Fn>
  void foreach_ci( Fn&& fn ) const
  {
    detail::foreach_element( _storage->inputs.begin(), _storage->inputs.end(), fn );
  }

  template<typename Fn>
  void foreach_pi( Fn&& fn ) const
  {
    detail::foreach_element( _storage->inputs.begin(), _storage->inputs.end(), fn );
  }

  template<typename Fn>
  void foreach_co( Fn&& fn ) const
  {
    using Iterator = decltype( _storage->outputs.begin() );
    using ElementType = signal;
    detail::foreach_element_transform<Iterator, ElementType>(
        _storage->outputs.begin(), _storage->outputs.end(), []( auto const& po ) -> signal { return { po.first, po.second }; }, fn );
  }

  template<typename Fn>
  void foreach_po( Fn&& fn ) const
  {
    using Iterator = decltype( _storage->outputs.begin() );
    detail::foreach_element_transform<Iterator, signal>(
        _storage->outputs.begin(), _storage->outputs.end(), []( auto const& po ) -> signal { return { po.first, po.second }; }, fn );
  }

  template<typename Fn>
  void foreach_gate( Fn&& fn ) const
  {
    auto r = range<uint32_t>( 1u, _storage->nodes.size() ); /* start from 1 to avoid constants */
    detail::foreach_element_if(
        r.begin(), r.end(),
        [this]( auto n ) { return !is_pi( n ); },
        fn );
  }

  template<typename Fn>
  void foreach_fanin( node const& n, Fn&& fn ) const
  {
    if ( n == 0 || is_pi( n ) )
      return;

    const auto& node = _storage->nodes[n];
    detail::foreach_element_transform<uint32_t*, signal>(
        node.fanin, node.fanin + node.fanin_size, []( auto c ) -> signal { return { c, false }; }, fn );
  }
#pragma endregion

#pragma region Structural properties
  uint32_t size() const
  {
    return num_gates() + num_pis() + 1u;
  }

  uint32_t num_pis() const
  {
    return static_cast<uint32_t>( _storage->inputs.size() );
  }

  uint32_t num_pos() const
  {
    return static_cast<uint32_t>( _storage->outputs.size() );
  }

  uint32_t num_gates() const
  {
    return static_cast<uint32_t>( _storage->hash.size() );
  }

  uint32_t fanin_size( node const& n ) const
  {
    return _storage->nodes[n].fanin_size;
  }

  uint32_t fanout_size( node const& n ) const
  {
    return _storage->nodes[n].fanout_size;
  }

  uint32_t incr_fanout_size( node const& n ) const
  {
    return _storage->nodes[n].fanout_size++;
  }

  uint32_t decr_fanout_size( node const& n ) const
  {
    return --_storage->nodes[n].fanout_size;
  }

  uint32_t depth() const
  {
    return _storage->depth;
  }

  uint32_t level( node const& n ) const
  {
    return _storage->nodes[n].level;
  }

  bool is_and( node const& n ) const
  {
    const auto& node = _storage->nodes[n];
    return node.fanin_size == 2 && ( node.fanin[0] > node.fanin[1] );
  }

  bool is_or( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_xor( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_maj( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_ite( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_xor3( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_nary_and( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_nary_or( node const& n ) const
  {
    (void)n;
    return false;
  }

  bool is_nary_xor( node const& n ) const
  {
    const auto& node = _storage->nodes[n];
    return node.fanin_size != 0u && ( node.fanin[0] < node.fanin[1] );
  }
#pragma endregion

#pragma region Value simulation
  template<typename Iterator>
  iterates_over_t<Iterator, bool>
  compute( node const& n, Iterator begin, Iterator end ) const
  {
    assert( n != 0 && !is_pi( n ) );

    const auto& node = _storage->nodes[n];

    if ( node.fanin[0] > node.fanin[1] )
    {
      auto v1 = *begin++;
      auto v2 = *begin++;
      return v1 && v2;
    }
    else
    {
      auto v = *begin++;
      while ( begin != end )
      {
        v ^= *begin++;
      }
      return v;
    }
  }

  template<typename Iterator>
  iterates_over_truth_table_t<Iterator>
  compute( node const& n, Iterator begin, Iterator end ) const
  {
    (void)end;

    assert( n != 0 && !is_pi( n ) );

    const auto& node = _storage->nodes[n];

    if ( node.fanin[0] > node.fanin[1] )
    {
      auto v1 = *begin++;
      auto v2 = *begin++;
      return v1 & v2;
    }
    else
    {
      auto v = *begin++;
      while ( begin != end )
      {
        v ^= *begin++;
      }
      return v;
    }
  }
#pragma endregion

#pragma region Custom node values
  void clear_values() const
  {
    std::for_each( _storage->nodes.begin(), _storage->nodes.end(), []( auto& n ) { n.value = 0; } );
  }

  auto value( node const& n ) const
  {
    return _storage->nodes[n].value;
  }

  void set_value( node const& n, uint32_t v ) const
  {
    _storage->nodes[n].value = v;
  }

  auto incr_value( node const& n ) const
  {
    return _storage->nodes[n].value++;
  }

  auto decr_value( node const& n ) const
  {
    return --_storage->nodes[n].value;
  }
#pragma endregion

#pragma region Visited flags
  void clear_visited() const
  {
    std::for_each( _storage->nodes.begin(), _storage->nodes.end(), []( auto& n ) { n.visited = 0; } );
  }

  auto visited( node const& n ) const
  {
    return _storage->nodes[n].visited;
  }

  void set_visited( node const& n, uint32_t v ) const
  {
    _storage->nodes[n].visited = v;
  }

  uint32_t trav_id() const
  {
    return _storage->trav_id;
  }

  void incr_trav_id() const
  {
    ++_storage->trav_id;
  }
#pragma endregion

public:
  storage _storage;
};

} // namespace mockturtle

template<>
struct fmt::formatter<mockturtle::abstract_xag_network::signal>
{
  constexpr auto parse( format_parse_context& ctx )
  {
    auto it = ctx.begin(), end = ctx.end();
    if ( it != end && *it != '}' )
    {
      throw format_error( "invalid format" );
    }
    return it;
  }

  template<typename FormatContext>
  auto format( const mockturtle::abstract_xag_network::signal& f, FormatContext& ctx )
  {
    return format_to( ctx.out(), "{}{}", f.complement ? "~" : "", f.index );
  }
};

namespace std
{

template<>
struct hash<mockturtle::abstract_xag_network::signal>
{
  uint64_t operator()( mockturtle::abstract_xag_network::signal const& s ) const noexcept
  {
    uint64_t k = s.index;
    k ^= k >> 33;
    k *= 0xff51afd7ed558ccd;
    k ^= k >> 33;
    k *= 0xc4ceb9fe1a85ec53;
    k ^= k >> 33;
    k ^= s.complement;
    return k;
  }
}; /* hash */

} // namespace std


text:
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (sh/kaOS[ELF])", stderr);


text:
package com.cezarykluczynski.stapi.model.element.dto;

import com.cezarykluczynski.stapi.model.common.dto.RequestSortDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode
public class ElementRequestDTO {

	private String uid;

	private String name;

	private String symbol;

	private Boolean transuranium;

	private Boolean gammaSeries;

	private Boolean hypersonicSeries;

	private Boolean megaSeries;

	private Boolean omegaSeries;

	private Boolean transonicSeries;

	private Boolean worldSeries;

	private RequestSortDTO sort;

}


text:
require "rubysl/jcode/jcode"
require "rubysl/jcode/version"


text:
package com.hourlyweather.appwidget;

import android.content.DialogInterface;
import android.location.Location;

import com.hourlyweather.ForecastFetcherTask;
import com.hourlyweather.forecast.HourlyForecast;
import com.hourlyweather.location.LocationResolver;
import com.hourlyweather.util.NotificationUtil;

/**
 * Pull an hourly forecast for a given location and populates the passed in
 * Alerts the widgets configuration activity when completed
 *
 * @author dhgonsalves
 */
public class WidgetForecastFetcherTask extends
	ForecastFetcherTask {
    private HourlyWidgetConfigure configActivity;

    public WidgetForecastFetcherTask(HourlyWidgetConfigure configActivity) {
	super(configActivity);
	this.configActivity = configActivity;
    }

    public WidgetForecastFetcherTask(HourlyWidgetConfigure configActivity,
	    Location location) {
	super(configActivity, location);
	this.configActivity = configActivity;
    }

    @Override
    protected void onPostExecute(HourlyForecast forecast) {
	loadingDialog.dismiss();
	if (location == null) {
	    NotificationUtil.popErrorDialog(configActivity,
		    "Location not avaliable",
		    "Press ok to try and refresh your current position",
		    new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int which) {
			    new LocationResolver(configActivity).execute();
			}
		    });
	} else if (forecast == null) {
	    // error has occured, alert the user
	    NotificationUtil.popNetworkErrorDialog(configActivity);
	} else {
	    configActivity.forecastLoaded(forecast);
	}
    }

    @Override
    protected void onProgressUpdate(String... msgs) {
	loadingDialog.setMessage(msgs[0]);
    }
}


text:
(function() {
  var calculateCounts, _;

  _ = require('underscore');

  calculateCounts = function(tree) {
    var id, synset, _fn;
    _fn = function(synset) {};
    for (id in tree) {
      synset = tree[id];
      _fn(synset);
      synset.docCount = synset.docs.length;
      synset.wordCount = synset.words.length;
      synset.words = _.countBy(synset.words);
    }
    return tree;
  };

  module.exports = calculateCounts;

}).call(this);


text:
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2015 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/list_navigation_menu_item"
        android:icon="@drawable/logo"
        android:title="敬请期待" />
    <item
        android:id="@+id/statistics_navigation_menu_item"
        android:icon="@drawable/logo"
        android:title="敬请期待" />
</menu>


text:
namespace falken {
namespace core {

// Parses JSON into a Flexbuffer and returns a reference to the root.
class FlexBufferParser {
 public:
  bool Parse(const char* json) {
    flatbuffers::Parser parser;
    builder_.Clear();
    return parser.ParseFlexBuffer(json, nullptr, &builder_);
  }

  flexbuffers::Map GetRootMap() {
    return flexbuffers::GetRoot(builder_.GetBuffer()).AsMap();
  }

 private:
  flexbuffers::Builder builder_;
};

class OptionAccessorTest : public testing::Test {
 protected:
  struct NestedTestObject {
    std::string value1;
  };

  // Used to get / set values using options.
  struct TestObject {
    std::string value1;
    int value2;
    std::string group_value1;
    std::string group_value2;
    NestedTestObject nested;
  };

  OptionAccessorTest()
      : value1_accessor_(
            "value1",
            [](TestObject* storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, const flexbuffers::Reference& value) {
              if (!value.IsString()) {
                printf("%s must be a string\n", path.c_str());
                return false;
              }
              storage_object->value1 = value.As<std::string>();
              return true;
            },
            [](const TestObject& storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, flexbuffers::Builder* builder) {
              builder->String(accessor.name().c_str(), storage_object.value1);
            }),
        value2_accessor_(
            "value2",
            [](TestObject* storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, const flexbuffers::Reference& value) {
              if (!value.IsInt()) {
                printf("%s must be an integer\n", path.c_str());
                return false;
              }
              storage_object->value2 = value.AsInt32();
              return true;
            },
            [](const TestObject& storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, flexbuffers::Builder* builder) {
              builder->Int(accessor.name().c_str(), storage_object.value2);
            }),
        group_value1_accessor_(
            "value1",
            [](TestObject* storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, const flexbuffers::Reference& value) {
              if (!value.IsString()) {
                printf("%s must be a string\n", path.c_str());
                return false;
              }
              storage_object->group_value1 = value.As<std::string>();
              return true;
            },
            [](const TestObject& storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, flexbuffers::Builder* builder) {
              builder->String(accessor.name().c_str(),
                              storage_object.group_value1);
            }),
        group_value2_accessor_(
            "value2",
            [](TestObject* storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, const flexbuffers::Reference& value) {
              if (!value.IsString()) {
                printf("%s must be a string\n", path.c_str());
                return false;
              }
              storage_object->group_value2 = value.As<std::string>();
              return true;
            },
            [](const TestObject& storage_object,
               const OptionAccessor<TestObject>& accessor,
               const std::string& path, flexbuffers::Builder* builder) {
              builder->String(accessor.name().c_str(),
                              storage_object.group_value2);
            }),
        flat_accessors_({value1_accessor_, value2_accessor_}),
        nested_accessors_({
            OptionAccessor<NestedTestObject>(
                "value1",
                [](NestedTestObject* storage_object,
                   const OptionAccessor<NestedTestObject>& accessor,
                   const std::string& path,
                   const flexbuffers::Reference& value) {
                  if (!value.IsString()) {
                    printf("%s must be a string\n", path.c_str());
                    return false;
                  }
                  storage_object->value1 = value.As<std::string>();
                  return true;
                },
                [](const NestedTestObject& storage_object,
                   const OptionAccessor<NestedTestObject>& accessor,
                   const std::string& path, flexbuffers::Builder* builder) {
                  builder->String(accessor.name().c_str(),
                                  storage_object.value1);
                }),
        }),
        all_accessors_({
            value1_accessor_,
            value2_accessor_,
            OptionAccessor<TestObject>("group",
                                       std::vector<OptionAccessor<TestObject>>({
                                           group_value1_accessor_,
                                           group_value2_accessor_,
                                       })),
            OptionAccessor<TestObject>(
                "nested",
                [this](TestObject* storage_object,
                       const OptionAccessor<TestObject>& accessor,
                       const std::string& path,
                       const flexbuffers::Reference& value) {
                  return OptionAccessor<NestedTestObject>::SetOptions(
                      &storage_object->nested, nested_accessors_,
                      value.AsMap());
                },
                [this](const TestObject& storage_object,
                       const OptionAccessor<TestObject>& accessor,
                       const std::string& path, flexbuffers::Builder* builder) {
                  OptionAccessor<NestedTestObject>::GetOptions(
                      builder, storage_object.nested, nested_accessors_,
                      &accessor.name(), &path);
                }),
        }) {}

 protected:
  OptionAccessor<TestObject> value1_accessor_;
  OptionAccessor<TestObject> value2_accessor_;
  OptionAccessor<TestObject> group_value1_accessor_;
  OptionAccessor<TestObject> group_value2_accessor_;
  std::vector<OptionAccessor<TestObject>> flat_accessors_;
  std::vector<OptionAccessor<NestedTestObject>> nested_accessors_;
  std::vector<OptionAccessor<TestObject>> all_accessors_;
};

TEST_F(OptionAccessorTest, SetOne) {
  TestObject storage;
  FlexBufferParser parser;
  ASSERT_TRUE(parser.Parse("{ \"value1\": \"hello\" }"));
  EXPECT_TRUE(value1_accessor_.Set(&storage, parser.GetRootMap()["value1"]));
  EXPECT_EQ(storage.value1, "hello");
}

TEST_F(OptionAccessorTest, SetOneFail) {
  TestObject storage;
  storage.value1 = "hello";
  FlexBufferParser parser;
  // Set should fail due to the wrong data type.
  ASSERT_TRUE(parser.Parse("{ \"value1\": [ \"goodbye\" ] }"));
  EXPECT_FALSE(value1_accessor_.Set(&storage, parser.GetRootMap()["value1"]));
  EXPECT_EQ(storage.value1, "hello");
}

TEST_F(OptionAccessorTest, GetOne) {
  TestObject storage;
  storage.value1 = "hello";
  flexbuffers::Builder builder;
  builder.Map(
      [this, &storage, &builder] { value1_accessor_.Get(storage, &builder); });
  builder.Finish();
  EXPECT_EQ(flexbuffers::GetRoot(builder.GetBuffer())
                .AsMap()["value1"]
                .As<std::string>(),
            "hello");
}

TEST_F(OptionAccessorTest, SetMultiple) {
  TestObject storage;
  FlexBufferParser parser;
  ASSERT_TRUE(parser.Parse("{ \"value1\": \"hello\", \"value2\": 42 }"));
  EXPECT_TRUE(OptionAccessor<TestObject>::SetOptions(&storage, flat_accessors_,
                                                     parser.GetRootMap()));
  EXPECT_EQ(storage.value1, "hello");
  EXPECT_EQ(storage.value2, 42);
}

TEST_F(OptionAccessorTest, SetMultipleFail) {
  TestObject storage;
  storage.value1 = "hello";
  storage.value2 = 10;
  FlexBufferParser parser;
  ASSERT_TRUE(parser.Parse("{ \"value1\": \"hello\", \"value2\": \"bob\" }"));
  EXPECT_FALSE(OptionAccessor<TestObject>::SetOptions(&storage, flat_accessors_,
                                                      parser.GetRootMap()));
  EXPECT_EQ(storage.value1, "hello");
  EXPECT_EQ(storage.value2, 10);
}

TEST_F(OptionAccessorTest, GetMultiple) {
  TestObject storage;
  storage.value1 = "hello";
  storage.value2 = 42;
  flexbuffers::Builder builder;
  OptionAccessor<TestObject>::GetOptions(&builder, storage, flat_accessors_);
  builder.Finish();
  auto root = flexbuffers::GetRoot(builder.GetBuffer()).AsMap();
  EXPECT_EQ(root["value1"].As<std::string>(), "hello");
  EXPECT_EQ(root["value2"].AsInt32(), 42);
}

TEST_F(OptionAccessorTest, SetNested) {
  TestObject storage;
  FlexBufferParser parser;
  ASSERT_TRUE(
      parser.Parse("{ "
                   "  \"value1\": \"hello\", "
                   "  \"value2\": 42, "
                   "  \"group\": { "
                   "    \"value1\": \"goodbye\", "
                   "    \"value2\": \"gill\" "
                   "  }, "
                   "  \"nested\": { "
                   "    \"value1\": \"ian\" "
                   "  } "
                   "}"));
  EXPECT_TRUE(OptionAccessor<TestObject>::SetOptions(&storage, all_accessors_,
                                                     parser.GetRootMap()));
  EXPECT_EQ(storage.value1, "hello");
  EXPECT_EQ(storage.value2, 42);
  EXPECT_EQ(storage.group_value1, "goodbye");
  EXPECT_EQ(storage.group_value2, "gill");
  EXPECT_EQ(storage.nested.value1, "ian");
}

TEST_F(OptionAccessorTest, SetNestedFail) {
  TestObject storage;
  storage.value1 = "hello";
  storage.value2 = 42;
  storage.group_value1 = "goodbye";
  storage.group_value2 = "nance";
  storage.nested.value1 = "ian";
  FlexBufferParser parser;
  ASSERT_TRUE(
      parser.Parse("{ "
                   "  \"value1\": \"salut\", "
                   "  \"value2\": [ 10 ], "
                   "  \"group\": \"do not set\" "
                   "}"));
  EXPECT_FALSE(OptionAccessor<TestObject>::SetOptions(&storage, all_accessors_,
                                                      parser.GetRootMap()));
  EXPECT_EQ(storage.value1, "salut");
  EXPECT_EQ(storage.value2, 42);
  EXPECT_EQ(storage.group_value1, "goodbye");
  EXPECT_EQ(storage.group_value2, "nance");
  EXPECT_EQ(storage.nested.value1, "ian");
}

TEST_F(OptionAccessorTest, GetNested) {
  TestObject storage;
  storage.value1 = "hello";
  storage.value2 = 42;
  storage.group_value1 = "goodbye";
  storage.group_value2 = "gill";
  storage.nested.value1 = "ian";
  flexbuffers::Builder builder;
  OptionAccessor<TestObject>::GetOptions(&builder, storage, all_accessors_);
  builder.Finish();
  auto root = flexbuffers::GetRoot(builder.GetBuffer()).AsMap();
  EXPECT_EQ(root["value1"].As<std::string>(), "hello");
  EXPECT_EQ(root["value2"].AsInt32(), 42);
  EXPECT_EQ(root["group"].AsMap()["value1"].As<std::string>(), "goodbye");
  EXPECT_EQ(root["group"].AsMap()["value2"].As<std::string>(), "gill");
  EXPECT_EQ(root["nested"].AsMap()["value1"].As<std::string>(), "ian");
}

TEST_F(OptionAccessorTest, SetFromJson) {
  TestObject storage;
  EXPECT_TRUE(OptionAccessor<TestObject>::SetOptionsFromJson(
      &storage, all_accessors_,
      "{ "
      "  \"value1\": \"hello\", "
      "  \"value2\": 42, "
      "  \"group\": { "
      "    \"value1\": \"goodbye\", "
      "    \"value2\": \"gill\" "
      "  }, "
      "  \"nested\": { "
      "    \"value1\": \"ian\" "
      "  } "
      "}"));
  EXPECT_EQ(storage.value1, "hello");
  EXPECT_EQ(storage.value2, 42);
  EXPECT_EQ(storage.group_value1, "goodbye");
  EXPECT_EQ(storage.group_value2, "gill");
  EXPECT_EQ(storage.nested.value1, "ian");
}

TEST_F(OptionAccessorTest, GetAsJson) {
  TestObject storage;
  storage.value1 = "hello";
  storage.value2 = 42;
  storage.group_value1 = "goodbye";
  storage.group_value2 = "gill";
  storage.nested.value1 = "ian";
  EXPECT_EQ(
      OptionAccessor<TestObject>::GetOptionsAsJson(storage, all_accessors_),
      "{ group: { value1: \"goodbye\", value2: \"gill\" }, "
      "nested: { value1: \"ian\" }, value1: \"hello\", value2: 42 }");
}

TEST(FlexbuffersStringListToStringTest, FlexbuffersStringListToString) {
  FlexBufferParser parser;
  ASSERT_TRUE(
      parser.Parse("{ "
                   "  \"item1\": [ "
                   "    \"value\", "
                   "    \"in a\", "
                   "    \"list\" "
                   "  ], "
                   "  \"item2\": \"value in a string\" "
                   "}"));
  EXPECT_EQ(FlexbuffersStringListToString(parser.GetRootMap()["item1"]),
            "value\nin a\nlist\n");
  EXPECT_EQ(FlexbuffersStringListToString(parser.GetRootMap()["item2"]),
            "value in a string");
}

}  // namespace core
}  // namespace falken


text:
const { SET_WINNER } = require('./constants');

const setWinner = (playerId, roomId) => ({
  type: SET_WINNER,
  playerId,
  roomId
})

module.exports = { setWinner };


text:
package com.intellij.util.io;

import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.NonNls;

import java.io.FileNotFoundException;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public class URLUtil {
  private URLUtil() {
  }

  /**
   * Opens a url stream. The semantics is the sames as {@link java.net.URL#openStream()}. The
   * separate method is needed, since jar URLs open jars via JarFactory and thus keep them
   * mapped into memory.
   */
  @NotNull
  public static InputStream openStream(final URL url) throws IOException {
    @NonNls final String protocol = url.getProtocol();
    if (protocol.equals("jar")) {
      return openJarStream(url);
    }

    return url.openStream();
  }

  @NotNull
  public static InputStream openResourceStream(final URL url) throws IOException {
    try {
      return openStream(url);
    }
    catch(FileNotFoundException ex) {
      @NonNls final String protocol = url.getProtocol();
      String file = null;
      if (protocol.equals("file")) {
        file = url.getFile();
      }
      else if (protocol.equals("jar")) {
        int pos = url.getFile().indexOf("!");
        if (pos >= 0) {
          file = url.getFile().substring(pos+1);
        }
      }
      if (file != null && file.startsWith("/")) {
        InputStream resourceStream = URLUtil.class.getResourceAsStream(file);
        if (resourceStream != null) return resourceStream;
      }
      throw ex;
    }
  }

  @NotNull
  private static InputStream openJarStream(final URL url) throws IOException {
    String file = url.getFile();
    assert file.startsWith("file:");
    file = file.substring("file:".length());
    assert file.indexOf("!/") > 0;

    String resource = file.substring(file.indexOf("!/") + 2);
    file = file.substring(0, file.indexOf("!"));
    final ZipFile zipFile = new ZipFile(FileUtil.unquote(file));
    final ZipEntry zipEntry = zipFile.getEntry(resource);
    if (zipEntry == null) throw new FileNotFoundException("Entry " + resource + " not found in " + file);
    return new FilterInputStream(zipFile.getInputStream(zipEntry)) {
        public void close() throws IOException {
          super.close();
          zipFile.close();
        }
      };
  }
}


text:
{{set . "title" "Register"}}
{{template "Auth/header.html" .}}

                <form action="" method="POST">

Register

                        {{with $field := field "user.Username" .}}
                            {{if $field.Error}}

                            {{else}}

                            {{end}}
                                Username
                                <input type="text" name="user.Username" class="form-control" placeholder="Username" value="{{$field.Flash}}" autofocus>
                                {{if $field.Error}}

{{$field.Error}}

                                {{end}}

                        {{end}}
                        {{with $field := field "user.Email" .}}
                            {{if $field.Error}}

                            {{else}}

                            {{end}}
                                Email Address
                                <input type="text" name="user.Email" class="form-control" placeholder="Email Address" value="{{$field.Flash}}">
                                {{if $field.Error}}

{{$field.Error}}

                                {{end}}

                        {{end}}
                        {{with $field := field "user.Password" .}}
                            {{if $field.Error}}

                            {{else}}

                            {{end}}
                                Password
                                <input type="password" name="user.Password" class="form-control" placeholder="Password" value="{{$field.Flash}}">
                                {{if $field.Error}}

{{$field.Error}}

                                {{end}}

                        {{end}}
                        {{with $field := field "user.PasswordConfirm" .}}
                            {{if $field.Error}}

                            {{else}}

                            {{end}}
                                Repeat Password
                                <input type="password" name="user.PasswordConfirm" class="form-control" placeholder="Repeat Password" value="{{$field.Flash}}">
                                {{if $field.Error}}

{{$field.Error}}

                                {{end}}

                        {{end}}

                        <button class="btn btn-primary pull-right" type="submit">Register</button>

                </form>

{{template "Auth/footer.html" .}}


text:
<!DOCTYPE html>
<title>Credential Manager: Call get() across browsing contexts.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<body>
<script type="module">
import {ACCEPTABLE_CREDENTIAL, ACCEPTABLE_CREDENTIAL_ID, deepCopy, encloseInScriptTag, GET_CREDENTIAL, GET_CREDENTIAL_OPTIONS, MAKE_CREDENTIAL_OPTIONS, PUBLIC_KEY_USER} from './resources/test-inputs.js';
import {TestAuthenticatorManager} from './resources/virtual-navigator-credentials.js';

if (document.location.host != "subdomain.example.test:8443") {
  document.location = "https://subdomain.example.test:8443/credentialmanagement/credentialscontainer-get-from-nested-frame.html";
  promise_test(_ => new Promise(_ => {}), "Stall tests on the wrong host.");
}

const manager = new TestAuthenticatorManager;

promise_test(async _ => {
  let authenticators = await manager.authenticators();
  assert_equals(authenticators.length, 0);
  let testAuthenticator = await manager.createAuthenticator();
  assert_true(await testAuthenticator.generateAndRegisterKey(ACCEPTABLE_CREDENTIAL_ID, "subdomain.example.test"));
}, "Set up the testing environment.");

promise_test(t => {
  let PROBE_CREDENTIALS = "window.parent.postMessage(String(navigator.credentials), '*');";

  let frame = document.createElement("iframe");
  frame.src = "data:text/html," + encloseInScriptTag(PROBE_CREDENTIALS);
  window.setTimeout(_ => document.body.append(frame));

  let eventWatcher = new EventWatcher(t, window, "message");
  return eventWatcher.wait_for("message").then(message => {
    assert_equals(message.data, "undefined");
  });
}, "navigator.credentials should be undefined in documents generated from `data:` URLs.");

promise_test(t => {
  let frame = document.createElement("iframe");
  frame.src = "resources/nested-document.html";
  window.setTimeout(_ => document.body.append(frame));

  let loadWatcher = new EventWatcher(t, frame, "load");
  loadWatcher.wait_for("load").then(_ =>
      frame.contentWindow.location = "javascript:" + GET_CREDENTIAL);

  let messageWatcher = new EventWatcher(t, window, "message");
  return messageWatcher.wait_for("message").then(message => {
    assert_equals(message.data, "[object PublicKeyCredential]");
  });
}, "navigator.credentials.get({publicKey}) in a javascript url should should succeed.");

promise_test(t => {
  let frame = document.createElement("iframe");
  frame.srcdoc = '';
  window.setTimeout(_ => document.body.append(frame));

  let loadWatcher = new EventWatcher(t, frame, "load");
  loadWatcher.wait_for("load").then(_ => {
    frame.contentWindow.eval(GET_CREDENTIAL);
  });

  let eventWatcher = new EventWatcher(t, window, "message");
  return eventWatcher.wait_for("message").then(message => {
    assert_equals(message.data, "[object PublicKeyCredential]");
  });
}, "navigator.credentials.get({publicKey}) in srcdoc should succeed.");

promise_test(t => {
  let frame = document.createElement("iframe");
  frame.src = "about:blank";
  window.setTimeout(_ => document.body.append(frame));

  let loadWatcher = new EventWatcher(t, frame, "load");
  loadWatcher.wait_for("load").then(_ => {
    frame.contentDocument.write(encloseInScriptTag(GET_CREDENTIAL));
  });

  let eventWatcher = new EventWatcher(t, window, "message");
  return eventWatcher.wait_for("message").then(message => {
    assert_equals(message.data, "[object PublicKeyCredential]");
  });
}, "navigator.credentials.get({publicKey}) in about:blank embedded in a secure context should succeed.");

promise_test(t => {
  let frame = document.createElement("iframe");
  frame.src = "about:blank";
  window.setTimeout(_ => document.body.append(frame));

  let loadWatcher = new EventWatcher(t, frame, "load");
  loadWatcher.wait_for("load").then(_ => {
    frame.contentWindow.eval(GET_CREDENTIAL);
  });

  let eventWatcher = new EventWatcher(t, window, "message");
  return eventWatcher.wait_for("message").then(message => {
    assert_equals(message.data, "[object PublicKeyCredential]");
  });
}, "navigator.credentials.get({publicKey}) in an about:blank page embedded in a secure context should pass rpID checks.");

promise_test(async t => {
  let testAuthenticator = await manager.createAuthenticator();
  t.add_cleanup(async () => {
    let id = await testAuthenticator.id();
    return manager.removeAuthenticator(id);
  });
  assert_true(await testAuthenticator.generateAndRegisterKey(ACCEPTABLE_CREDENTIAL_ID, "subdomain.example.test"));
  let keys = await testAuthenticator.registeredKeys();
  assert_equals(keys.length, 1);
  var customGetAssertionOptions = deepCopy(GET_CREDENTIAL_OPTIONS);
  var someOtherCredential = deepCopy(ACCEPTABLE_CREDENTIAL);
  someOtherCredential.id = new TextEncoder().encode("someOtherCredential");
  customGetAssertionOptions.allowCredentials = [someOtherCredential];

  return promise_rejects_dom(t, "NotAllowedError",
    navigator.credentials.get({ publicKey : customGetAssertionOptions}));
}, "navigator.credentials.get() for unregistered device returns NotAllowedError");

promise_test(async t => {
  // Injecting resident credentials through the mojo virtual authenticator
  // interface (i.e |generateAndRegisterKey|) is not supported. Use
  // |navigator.credentials.create({})| instead.
  var customMakeCredOptions = deepCopy(MAKE_CREDENTIAL_OPTIONS);
  customMakeCredOptions.authenticatorSelection.requireResidentKey = true;
  var residentCredential =
    await navigator.credentials.create({ publicKey : customMakeCredOptions });

  var customGetAssertionOptions = deepCopy(GET_CREDENTIAL_OPTIONS);
  delete customGetAssertionOptions.allowCredentials;
  customGetAssertionOptions.user = PUBLIC_KEY_USER;
  return navigator.credentials.get({ publicKey : customGetAssertionOptions })
    .then(credential => assert_equals(credential.id, residentCredential.id));
}, "navigator.credentials.get() with empty allowCredentials returns a resident credential");

promise_test(t => {
  return manager.clearAuthenticators();
}, "Clean up testing environment.");

</script>


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>JHotDraw 7 Tutorial</title>

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

JHotDraw 7 Tutorial

This tutorial gives information about how things can be done using JHotDraw.

A structural overview is given in the JavaDoc documentation.

JHotDraw © 1996-2010 by the original authors and all contributors.


text:
angular.module('app', [])
  .controller('ParentCtrl', function ($scope) {
    $scope.variable = 1
  })
  .controller('ChildCtrl', function ($scope) {
    $scope.variable = 2;
  });


text:
describe('angular-egg', function () {

    'use strict';

    var suite = this,
        keyCode = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];

    function triggerKeyCode(keyCode) {
        var event = document.createEvent('Event');
        event.which = keyCode;
        event.initEvent('keyup');
        document.dispatchEvent(event);
    }

    beforeEach(module('ngEgg'));

    beforeEach(inject(function ($injector) {
        suite.compile = $injector.get('$compile');
        suite.scope = $injector.get('$rootScope').$new();
        suite.document = $injector.get('$document');
        suite.scope.vm = {};
    }));

    describe('with default keycode', function () {

        beforeEach(function () {
            suite.scope.vm.eggActivated = false;
            suite.element = suite.compile(angular.element('<section data-ng-egg data-ng-model="vm.eggActivated" data-ng-class="{ \'hidden\': vm.eggActivated }">'))(suite.scope);
            suite.scope.$digest();
        });

        it('should activate the Easter Egg upon correct default key sequence', function () {

            angular.forEach(keyCode, function (key) {
                triggerKeyCode(key);
            });

            suite.scope.$digest();
            expect(suite.scope.vm.eggActivated).toBeTrue();
            expect(suite.element.hasClass('hidden')).toBeTrue();
        });

        it('should NOT activate the Easter Egg upon incorrect key sequence', function () {

            angular.forEach(keyCode, function (key) {
                triggerKeyCode(key);
                triggerKeyCode(20);
            });

            suite.scope.$digest();
            expect(suite.scope.vm.eggActivated).toBeFalse();
            expect(suite.element.hasClass('hidden')).toBeFalse();
        });

    });

    describe('with custom keycode', function () {

        beforeEach(function () {
            suite.scope.vm.eggActivated = false;
            suite.element = suite.compile(angular.element('<section data-ng-egg data-ng-model="vm.eggActivated" data-keycode="up,down,up,down" data-ng-class="{ \'hidden\': vm.eggActivated }">'))(suite.scope);
            suite.scope.$digest();
        });

        it('should use the specified custom key sequence', function () {

            var customKeyCode = [38, 40, 38, 40];

            angular.forEach(customKeyCode, function (key) {
                triggerKeyCode(key);
            });

            suite.scope.$digest();
            expect(suite.scope.vm.eggActivated).toBeTrue();
            expect(suite.element.hasClass('hidden')).toBeTrue();
        });

    });

});


text:
#ifndef BOOST_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H
#define BOOST_PREDEF_HARDWARE_SIMD_PPC_VERSIONS_H

#include <boost/predef/version_number.h>

/*`
 Those defines represent Power PC SIMD extensions versions.

 [note You *MUST* compare them with the predef `BOOST_HW_SIMD_PPC`.]
 */

// ---------------------------------

/*`
 [heading `BOOST_HW_SIMD_PPC_VMX_VERSION`]

 The [@https://en.wikipedia.org/wiki/AltiVec#VMX128 VMX] powerpc extension
 version number.

 Version number is: *1.0.0*.
 */
#define BOOST_HW_SIMD_PPC_VMX_VERSION BOOST_VERSION_NUMBER(1, 0, 0)

/*`
 [heading `BOOST_HW_SIMD_PPC_VSX_VERSION`]

 The [@https://en.wikipedia.org/wiki/AltiVec#VSX VSX] powerpc extension version
 number.

 Version number is: *1.1.0*.
 */
#define BOOST_HW_SIMD_PPC_VSX_VERSION BOOST_VERSION_NUMBER(1, 1, 0)

/*`
 [heading `BOOST_HW_SIMD_PPC_QPX_VERSION`]

 The QPX powerpc extension version number.

 Version number is: *2.0.0*.
 */
#define BOOST_HW_SIMD_PPC_QPX_VERSION BOOST_VERSION_NUMBER(2, 0, 0)

#endif


text:
@implementation STRSubmitController

- (id)initWithSession:(STRSession*)session
{
	if( self = [super initWithNibName:@"STRSubmitController" bundle:nil] )
	{
		sesh = session;
		self.title = @"Posting...";
		self.navigationItem.hidesBackButton = YES;
	}
    return self;
}

- (ShareToRedditController*)rootCon
{
	return (ShareToRedditController*)self.navigationController;
}

- (void)userDone:(UIBarButtonItem*)sender
{
	[self.rootCon closeWithError:nil];
}

- (void)success
{
	self.captchaLabel.hidden = YES;
	self.captchaInput.hidden = YES;
	self.captchaView.hidden = YES;

	[self.progress setProgress:1 animated:YES];
	self.title = @"Success";
	dispatch_after(
		dispatch_time(DISPATCH_TIME_NOW,2*NSEC_PER_SEC),
		dispatch_get_main_queue(),
		^{ [self userDone:nil]; }
	);
}

- (void)fatalError:(NSError*)err
{
	self.captchaLabel.hidden = YES;
	self.captchaInput.hidden = YES;
	self.captchaView.hidden = YES;

	if( err )
	{
		self.errorLabel.text = err.localizedDescription;
		self.errorLabel.hidden = NO;
		self.progress.hidden = YES;
		self.captchaView.hidden = YES;
		self.captchaInput.hidden = YES;
	}
//	[self.navigationItem setHidesBackButton:NO animated:YES];
	self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(userDone:)];
}

- (void)flagNSFW:(NSString*)fullName
{
	[sesh
		requestJSON: @"https://ssl.reddit.com/api/marknsfw"
		post: @{ @"id" : fullName }
		completion: ^( NSDictionary *json, NSError *err )
		{
			//not that we're actually checking if it was a success, but eh, whatever.
			[self success];
		}
	];
}

- (void)fetchCaptcha:(NSString*)iden
{
	[sesh
		requestData: [@"http://reddit.com/captcha/" stringByAppendingString:iden]
		post: nil
		completion: ^( int statusCode, NSData *data, NSError *err )
		{
			if( data )
			{
				UIImage *img = [UIImage imageWithData:data];
				if( img )
				{
					if( !self.captchaView.hidden )
					{
						self.captchaLabel.text = @"Sorry, try again";
					}
					captchaIden = iden;
					self.captchaView.image = img;
					self.captchaInput.text = @"";
					self.captchaLabel.hidden = NO;
					self.captchaInput.hidden = NO;
					self.captchaView.hidden = NO;

					self.captchaInput.enabled = YES;
					[self.captchaInput becomeFirstResponder];
					return;
				}
			}
		}
	];
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
	if( textField.text.length > 0 )
	{
		self.captchaInput.enabled = NO;
		[self submitLink];
	}

	return YES;
}

- (void)submitLink
{
	NSDictionary *query =
	@{
		@"api_type" : @"json",
		@"title" : self.postTitle,
		@"kind" : @"link",
		@"sr" : self.subreddit,
		@"url" : self.postURL.absoluteString
	};

	if( captchaIden )
	{
		NSMutableDictionary *q2 = [NSMutableDictionary dictionaryWithDictionary:query];
		q2[@"iden"] = captchaIden;
		q2[@"captcha"] = self.captchaInput.text;
		query = q2;
	}

	[sesh
		requestJSON: @"https://ssl.reddit.com/api/submit"
		post: query
		completion:^( NSDictionary *json, NSError *err )
		{
			if( !json )
			{
				self.title = @"Post failed";
				[self fatalError:err];
				return;
			}

			if( err )
			{
				if( err.domain==kSTRErrorDomain )
				{
					if( [err.userInfo[kSTRRedditErrorKey] isEqualToString:@"BAD_CAPTCHA"] && json[@"json"][@"captcha"] )
					{
						[self.progress setProgress:0.8f animated:YES];
						[self fetchCaptcha:json[@"json"][@"captcha"]];
						return;
					}
				}
				self.title = @"Post failed";
				[self fatalError:err];
				return;
			}

			NSString *name = json[@"json"][@"data"][@"name"];
			if( self.nsfw && name )
			{
				[self.progress setProgress:0.9f animated:YES];
				[self flagNSFW:name];
			}
			else
			{
				[self success];
			}
		}
	];
}

- (void)uploadImage
{
	[STRImgur uploadImage:self.postImage
	progress:^( float fraction )
	{
		dispatch_async( dispatch_get_main_queue(), ^{ [self.progress setProgress:0.1f+(fraction*0.6f) animated:YES]; } );
	}
	completion:^( NSURL *url, NSError *err )
	{
		if( url )
		{
			self.postURL = url;
			[self submitLink];
		}
		else
		{
			self.title = @"Upload Failed";
			[self fatalError:err];
		}
	}];
}

- (void)viewDidAppear:(BOOL)animated
{
	[super viewDidAppear:animated];

	[self.progress setProgress:0 animated:NO];

	if( self.postURL )
	{
		[self.progress setProgress:0.5f animated:YES];
		[self submitLink];
	}
	else if( self.postImage )
	{
		[self.progress setProgress:0.1f animated:YES];
		[self uploadImage];
	}
}

@end


text:
package org.daisy.common.transform;

import java.util.Map;

import javax.xml.namespace.QName;

/**
 * {@link XMLTransformer} with one XML input (named "source"), one XML output (named "result"), and
 * a "parameters" port with QName/String pairs.
 */
public abstract class SingleInSingleOutXMLTransformer implements XMLTransformer {

	public Runnable transform(Map<QName,InputValue<?>> input, Map<QName,OutputValue<?>> output) {
		QName _source = new QName("source");
		QName _result = new QName("result");
		QName _parameters = new QName("parameters");
		for (QName n : input.keySet())
			if (!n.equals(_source) && !n.equals(_parameters))
				throw new IllegalArgumentException("unexpected value on input port " + n);
		for (QName n : output.keySet())
			if (!n.equals(_result))
				throw new IllegalArgumentException("unexpected value on output port " + n);
		InputValue<?> source = input.get(_source);
		if (source != null && !(source instanceof XMLInputValue))
			throw new IllegalArgumentException("input on 'source' port is not XML");
		InputValue<?> params = input.get(_parameters);
		OutputValue<?> result = output.get(_result);
		if (result != null && !(result instanceof XMLOutputValue))
			throw new IllegalArgumentException("output on 'result' port is not XML");
		return transform((XMLInputValue<?>)source, (XMLOutputValue<?>)result, params);
	}

	public abstract Runnable transform(XMLInputValue<?> source, XMLOutputValue<?> result, InputValue<?> params);

	/**
	 * Returns a composed transformer that runs this transformation with as input the output of the
	 * before transformation, and the parameters being passed to both.
	 *
	 * @param buffer The {@link Buffer} instance to use for connecting the transformers.
	 * @param concurrent Whether to run the transformations concurrently, or to run the
	 *     after transformation only when this transformation has completed.
	 */
	public SingleInSingleOutXMLTransformer andThen(SingleInSingleOutXMLTransformer after, Buffer<?,?> buffer, boolean concurrent) {
		SingleInSingleOutXMLTransformer thiz = this;
		return new SingleInSingleOutXMLTransformer() {
			public Runnable transform(XMLInputValue<?> source, XMLOutputValue<?> result, InputValue<?> params) {
				if (concurrent)
					return () -> {
						Thread afterThread = new Thread(after.transform(buffer.asInput(), result, params));
						afterThread.setUncaughtExceptionHandler(
							(_t, e) -> buffer.error(TransformerException.wrap(e)));
						afterThread.start();
						thiz.transform(source, buffer.asOutput(), params).run();
						buffer.done();
					};
				else
					return () -> {
						thiz.transform(source, buffer.asOutput(), params).run();
						buffer.done();
						after.transform(buffer.asInput(), result, params).run();
					};
			}
		};
	}
}


text:
/**
@file   MessageLog.cpp
@author Lime Microsystems (www.limemicro.com)
@brief  Global message and event logging
*/

#include "MessageLog.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <time.h>
using namespace std;

const char g_sesionLogFilename[] = "LMS_SessionLog.txt";
const unsigned int g_logMessageLimit = 100;
MessageLog* MessageLog::m_pInstance = NULL;

/** @brief Handles incoming messages
    @param msg message about event
*/
void MessageLog::HandleMessage(const LMS_Message &msg)
{
}

/** @brief Creates one instance of message log
    @return Message log
*/
MessageLog* MessageLog::getInstance()
{
    if(m_pInstance == NULL)
    {
        m_pInstance = new MessageLog();
    }
    return m_pInstance;
}

/** @brief Destroys message log
*/
MessageLog::~MessageLog()
{
    if(m_pInstance != NULL)
        delete m_pInstance;
    m_pInstance = NULL;
}

/** @brief writes message to log
    @param msg message to write
    @param type message type: info, warning, error...
*/
void MessageLog::write(const string msg, eMessageType type)
{
    if(!m_enableLogging)
        return;

    stringstream ss;

    time_t rawtime;
    struct tm * timeinfo;
    char buffer [80];

    //add time stamp
    time (&rawtime);
    timeinfo = localtime (&rawtime);
    strftime (buffer,80,"%H:%M:%S",timeinfo);
    ss << "[" << buffer << "] ";

    //add prefix by message type
    switch(type)
    {
    case LOG_INFO:

        break;
    case LOG_WARNING:
        ss << "WARNING: ";
        break;
    case LOG_ERROR:
        ss << "ERROR: ";
        break;
    case LOG_DATA:
        ss << "DATA: ";
        break;
    default:
        ss << "UNDEFIEND TYPE: ";
        break;
    }
    ss << msg;

    if(type & m_logFilter)
    {
        fstream fileout;
        fileout.open(g_sesionLogFilename, ios::out | ios::app);
        fileout << ss.str();
        fileout.close();
        if(m_messages.size() > g_logMessageLimit)
            m_messages.pop_front();
        m_messages.push_back(ss.str());
        Notify(LMS_Message(MSG_INFO, ss.str().c_str(), 0, 0));
    }
    else
        return;
    if(m_printToConsole)
    {
        if( type & m_consoleFilter )
            cout << ss.str();
    }
}

/** @brief Saves log messages to text file
    @param filename file to create
*/
void MessageLog::saveToFile(const string filename)
{
    fstream fout;
    fout.open(filename.c_str(), ios::out);
    for(list<string>::iterator iter = m_messages.begin(); iter!=m_messages.end(); ++iter)
        fout << *iter;
    fout.close();
}

/** @brief clears all messages
*/
void MessageLog::clear()
{
    m_messages.clear();
}

/** @brief Creates message log, initializes filters.
*/
MessageLog::MessageLog() : m_printToConsole(false), m_enableLogging(true)
{
    //create or clear session log file
    fstream fileout;
    fileout.open(g_sesionLogFilename, ios::out);
    fileout.close();

    m_logFilter = LOG_INFO | LOG_WARNING | LOG_ERROR;
    m_consoleFilter = LOG_INFO | LOG_WARNING | LOG_ERROR;
    time_t rawtime;
    struct tm * timeinfo;
    char buffer [80];

    time (&rawtime);
    timeinfo = localtime (&rawtime);
    strftime (buffer,80,"Log started: %Y-%m-%d %H:%M:%S\n",timeinfo);
    write(buffer, LOG_INFO);
}

/** @brief Sets which messages should be logged
    @param messageTypes messages to be logged
*/
void MessageLog::SetLogFilter(unsigned int messageTypes)
{
    m_logFilter = messageTypes;
}

/** @brief Sets which messages should be printed to console
    @param messagesTypes messages types to be printed
    @param printToConsole enable printing to console
*/
void MessageLog::SetConsoleFilter(unsigned int messageTypes, bool printToConsole)
{
    m_consoleFilter = messageTypes;
    m_printToConsole = printToConsole;
}

/** @brief Returns all log messages
    @return vector of log messages
*/
list<string> MessageLog::getLogMessages() const
{
    return m_messages;
}

/** @brief returns printing to console filter
*/
unsigned int MessageLog::GetConsoleFilter() const
{
    return m_consoleFilter;
}

/** @brief returns log filter
*/
unsigned int MessageLog::GetLogFilter() const
{
    return m_logFilter;
}

/** @brief Enables or disables message logging
    @param enabled message logging enabled
*/
void MessageLog::enableLogging(bool enabled)
{
    m_enableLogging = enabled;
}