text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Microsoft.DocAsCode.Tests
{
    using System;
    using System.IO;

    using Microsoft.DocAsCode.Plugins;
    using Microsoft.DocAsCode.SubCommands;

    using Xunit;
    using Newtonsoft.Json;

    [Collection("docfx STA")]
    public class ArgsParserTest
    {
        [Fact]
        [Trait("Related", "docfx")]
        public void TestCompositeCommandParser()
        {
            var args = new string[0];
            var controller = ArgsParser.Instance.Parse(args);
            ISubCommandCreator creator;
            var result = controller.TryGetCommandCreator("metadata", out creator);
            Assert.True(result);
            result = controller.TryGetCommandCreator("build", out creator);
            Assert.True(result);

            Assert.Throws<FileNotFoundException>(() => controller.Create());
            args = new string[] { "-h", "other", "parameters" };

            controller = ArgsParser.Instance.Parse(args);
            var command = controller.Create();
            Assert.Equal(typeof(HelpCommand), command.GetType());

            args = new string[] { "Assets/docfx.json_metadata_build/docfx.json", "-f", "--invalid", "InvalidInput" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(CompositeCommand), command.GetType());
            var commands = ((CompositeCommand)command).Commands;
            Assert.Equal(2, commands.Count);
            Assert.Equal(typeof(MetadataCommand), commands[0].GetType());
            var metadataCommand = (MetadataCommand)commands[0];
            Assert.Equal(2, metadataCommand.Config.Count);
            Assert.Equal(true, metadataCommand.Config[0].Force);
            Assert.Equal(true, metadataCommand.Config[1].Force);
            Assert.Equal(@"Assets\docfx.json_metadata_build", metadataCommand.BaseDirectory);
            Assert.Equal(typeof(BuildCommand), commands[1].GetType());
            var buildCommand = (BuildCommand)commands[1];
            Assert.Equal(true, buildCommand.Config.Force);
            Assert.Equal(@"Assets\docfx.json_metadata_build", buildCommand.Config.BaseDirectory);

            args = new string[] { "Assets/docfx.json_empty/docfx.json" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(CompositeCommand), command.GetType());
            commands = ((CompositeCommand)command).Commands;
            Assert.Equal(0, commands.Count);

            args = new string[] { "Assets/docfx.json_invalid_key/docfx.json" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(CompositeCommand), command.GetType());
            commands = ((CompositeCommand)command).Commands;
            Assert.Equal(0, commands.Count);

            args = new string[] { "Assets/docfx.json_invalid_format/docfx.json" };
            controller = ArgsParser.Instance.Parse(args);
            Assert.Throws<JsonSerializationException>(() => controller.Create());
        }

        [Fact]
        [Trait("Related", "docfx")]
        public void TestMetadataCommandParser()
        {
            var args = new string[] { "metadata", "--help" };
            var controller = ArgsParser.Instance.Parse(args);
            var command = controller.Create();
            Assert.Equal(typeof(HelpCommand), command.GetType());

            args = new string[] { "metadata" };
            controller = ArgsParser.Instance.Parse(args);
            Assert.Throws<OptionParserException>(() => controller.Create());

            args = new string[] { "metadata", "Assets/docfx.json_metadata_build/docfx.json", "-f" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(MetadataCommand), command.GetType());
            var metadataCommand = (MetadataCommand)command;
            Assert.Equal(2, metadataCommand.Config.Count);
            Assert.Equal(true, metadataCommand.Config[0].Force);
            Assert.Equal(true, metadataCommand.Config[1].Force);
            Assert.Equal(@"Assets\docfx.json_metadata_build",  metadataCommand.BaseDirectory);
            Assert.Null(metadataCommand.OutputFolder);

            args = new string[] { "metadata", "Assets/docfx.json_empty/docfx.json", "A.csproj" };
            controller = ArgsParser.Instance.Parse(args);
            Assert.Throws<DocumentException>(() => controller.Create());

            args = new string[] { "metadata", "A.csproj", "-f" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(MetadataCommand), command.GetType());
            metadataCommand = (MetadataCommand)command;
            Assert.Equal(1, metadataCommand.Config.Count);
            Assert.Equal(true, metadataCommand.Config[0].Force);
            Assert.Equal(true, metadataCommand.Config[0].Source.Expanded);
            Assert.Equal("A.csproj", metadataCommand.Config[0].Source.Items[0].Files[0]);
        }

        [Fact]
        [Trait("Related", "docfx")]
        public void TestBuildCommandParser()
        {
            var args = new string[] { "build", "--help" };
            var controller = ArgsParser.Instance.Parse(args);
            var command = controller.Create();
            Assert.Equal(typeof(HelpCommand), command.GetType());

            args = new string[] { "build" };
            controller = ArgsParser.Instance.Parse(args);
            Assert.Throws<OptionParserException>(() => controller.Create());

            args = new string[] { "build", "Assets/docfx.json_metadata_build/docfx.json", "-f", "-o", "output" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(BuildCommand), command.GetType());
            var buildCommand = (BuildCommand)command;
            Assert.Equal(true, buildCommand.Config.Force);
            Assert.Equal(true, buildCommand.Config.ForcePostProcess);
            Assert.Equal(@"Assets\docfx.json_metadata_build", buildCommand.Config.BaseDirectory);
            Assert.Equal(@"output", buildCommand.Config.OutputFolder);

            args = new string[] { "build", "Assets/docfx.json_empty/docfx.json" };
            controller = ArgsParser.Instance.Parse(args);
            Assert.Throws<DocumentException>(() => controller.Create());

            args = new string[] { "build", "Assets/docfx.json_metadata_build/docfx.json", "-f", "--forcePostProcess" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(BuildCommand), command.GetType());
            buildCommand = (BuildCommand)command;
            Assert.Equal(true, buildCommand.Config.Force);
            Assert.Equal(true, buildCommand.Config.ForcePostProcess);

            args = new string[] { "build", "Assets/docfx.json_metadata_build/docfx.json", "--forcePostProcess" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(BuildCommand), command.GetType());
            buildCommand = (BuildCommand)command;
            Assert.Null(buildCommand.Config.Force);
            Assert.Equal(true, buildCommand.Config.ForcePostProcess);

            args = new string[] { "build", "Assets/docfx.json_metadata_build/docfx.json" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(BuildCommand), command.GetType());
            buildCommand = (BuildCommand)command;
            Assert.Null(buildCommand.Config.Force);
            Assert.Null(buildCommand.Config.ForcePostProcess);
        }

        [Fact]
        [Trait("Related", "docfx")]
        public void TestInitCommandParser()
        {
            var args = new string[] { "init" };
            var controller = ArgsParser.Instance.Parse(args);
            var command = controller.Create();
            Assert.Equal(typeof(InitCommand), command.GetType());

            args = new string[] { "init", "--help" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(HelpCommand), command.GetType());
        }

        [Fact]
        [Trait("Related", "docfx")]
        public void TestHelpCommandParser()
        {
            var args = new string[] { "help" };
            var controller = ArgsParser.Instance.Parse(args);
            var command = controller.Create();
            Assert.Equal(typeof(HelpCommand), command.GetType());
        }

        [Fact]
        [Trait("Related", "docfx")]
        public void TestServeCommandParser()
        {
            var args = new string[] { "serve" };
            var controller = ArgsParser.Instance.Parse(args);
            var command = controller.Create();
            Assert.Equal(typeof(ServeCommand), command.GetType());

            args = new string[] { "serve", "-h" };
            controller = ArgsParser.Instance.Parse(args);
            command = controller.Create();
            Assert.Equal(typeof(HelpCommand), command.GetType());

            args = new string[] { "serve", "--invalid" };
            controller = ArgsParser.Instance.Parse(args);
            Assert.Throws<OptionParserException>(() => controller.Create());
        }
    }
}


text:
package org.pac4j.saml.sso;

import org.opensaml.saml.common.SAMLObject;
import org.pac4j.saml.context.SAML2MessageContext;

/**
 * Builds an authentication request for the idp.
 *
 * @author Misagh Moayyed
 * @since 1.7
 */
public interface SAML2ObjectBuilder<T extends SAMLObject> {

    <T> T build(final SAML2MessageContext context);
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;

namespace HoloToolkit.Unity.InputModule
{
    /// <summary>
    /// Controller axis and button types.
    /// </summary>
    [Flags]
    public enum XboxControllerMappingTypes
    {
        None = 0,
        XboxLeftStickHorizontal = 1,
        XboxLeftStickVertical = 2,
        XboxRightStickHorizontal = 3,
        XboxRightStickVertical = 4,
        XboxDpadHorizontal = 5,
        XboxDpadVertical = 6,
        XboxLeftTrigger = 7,
        XboxRightTrigger = 8,
        XboxSharedTrigger = 9,
        XboxA = 10,
        XboxB = 11,
        XboxX = 12,
        XboxY = 13,
        XboxView = 14,
        XboxMenu = 15,
        XboxLeftBumper = 16,
        XboxRightBumper = 17,
        XboxLeftStickClick = 18,
        XboxRightStickClick = 19
    }
}


text:
layout: page
title: Sobre o tema Aurora
permalink: /sobre/
---
Este é um tema para o Jekyll. Você pode obter mais informações sobre como
customizar seu tema, assim como detalhes de uso e documentação no site [jekyllrb.com]

Para gerar um tema novo do Jekyll você pode usar o comando
`jekyll new novo-blog` ou baixar do seguinte repositório: [github.com/jglovier/jekyll-new]

[jekyllrb.com]: http://jekyllrb.com/ "jekyllrb.com"
[github.com/jglovier/jekyll-new]: https://github.com/jglovier/jekyll-new "github.com/jglovier/jekyll-new"


text:
package com.yammer.collections.transforming;

import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ImmutableTable;
import com.google.common.collect.Table;
import com.google.common.collect.Tables;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import java.util.Collections;
import java.util.Map;
import java.util.Set;

import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

@SuppressWarnings({"InstanceVariableMayNotBeInitialized", "ClassWithTooManyMethods"})
@RunWith(MockitoJUnitRunner.class)
public class TransformingTableTest {
    private static final Float ROW_KEY_1 = 0.5f;
    private static final Float ROW_KEY_2 = 0.95f;
    private static final Long COLUMN_KEY_1 = 23l;
    private static final Long COLUMN_KEY_2 = 2343l;
    private static final Integer VALUE_1 = 1;
    private static final Integer VALUE_2 = 11;
    private static final String STRING_ROW_KEY_1 = ROW_KEY_1.toString();
    private static final String STRING_COLUMN_KEY_1 = COLUMN_KEY_1.toString();
    private static final String STRING_VALUE_1 = VALUE_1.toString();
    private static final String STRING_ROW_KEY_2 = ROW_KEY_2.toString();
    private static final String STRING_COLUMN_KEY_2 = COLUMN_KEY_2.toString();
    private static final String STRING_VALUE_2 = VALUE_2.toString();
    private static final Function<Float, String> TO_ROW_FUNCTION = new Function<Float, String>() {
        @Override
        public String apply(Float aFloat) {
            return aFloat.toString();
        }
    };
    private static final Function<Long, String> TO_COLUMN_FUNCTION = new Function<Long, String>() {
        @Override
        public String apply(Long aLong) {
            return aLong.toString();
        }
    };
    private static final Function<Integer, String> TO_VALUE_FUNCTION = new Function<Integer, String>() {
        @Override
        public String apply(Integer anInteger) {
            return anInteger.toString();
        }
    };
    private static final Function<String, Float> FROM_ROW_FUNCTION = new Function<String, Float>() {
        @Override
        public Float apply(String aFloat) {
            return Float.valueOf(aFloat);
        }
    };
    private static final Function<String, Long> FROM_COLUMN_FUNCTION = new Function<String, Long>() {
        @Override
        public Long apply(String aLong) {
            return Long.valueOf(aLong);
        }
    };
    private static final Function<String, Integer> FROM_VALUE_FUNCTION = new Function<String, Integer>() {
        @Override
        public Integer apply(String anInteger) {
            return Integer.valueOf(anInteger);
        }
    };
    private Table<Float, Long, Integer> transformingTable;
    @Mock
    private Table<String, String, String> backingTableMock;

    @Before
    public void setUp() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                TO_ROW_FUNCTION, FROM_ROW_FUNCTION,
                TO_COLUMN_FUNCTION, FROM_COLUMN_FUNCTION,
                TO_VALUE_FUNCTION, FROM_VALUE_FUNCTION);
    }

    // Constructor checks

    @Test(expected = NullPointerException.class)
    public void backingTable_cannot_be_null() {
        transformingTable = TransformingTable.create(
                null,
                TO_ROW_FUNCTION, FROM_ROW_FUNCTION,
                TO_COLUMN_FUNCTION, FROM_COLUMN_FUNCTION,
                TO_VALUE_FUNCTION, FROM_VALUE_FUNCTION
        );
    }

    @Test(expected = NullPointerException.class)
    public void toRowFunction_cannot_be_null() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                null, FROM_ROW_FUNCTION,
                TO_COLUMN_FUNCTION, FROM_COLUMN_FUNCTION,
                TO_VALUE_FUNCTION, FROM_VALUE_FUNCTION
        );
    }

    @Test(expected = NullPointerException.class)
    public void fromRowFunction_cannot_be_null() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                TO_ROW_FUNCTION, null,
                TO_COLUMN_FUNCTION, FROM_COLUMN_FUNCTION,
                TO_VALUE_FUNCTION, FROM_VALUE_FUNCTION
        );
    }

    @Test(expected = NullPointerException.class)
    public void toColumnFunction_cannot_be_null() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                TO_ROW_FUNCTION, FROM_ROW_FUNCTION,
                null, FROM_COLUMN_FUNCTION,
                TO_VALUE_FUNCTION, FROM_VALUE_FUNCTION
        );
    }

    @Test(expected = NullPointerException.class)
    public void fromColumnFunction_cannot_be_null() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                TO_ROW_FUNCTION, FROM_ROW_FUNCTION,
                TO_COLUMN_FUNCTION, null,
                TO_VALUE_FUNCTION, FROM_VALUE_FUNCTION
        );
    }

    @Test(expected = NullPointerException.class)
    public void toValueFunction_cannot_be_null() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                TO_ROW_FUNCTION, FROM_ROW_FUNCTION,
                TO_COLUMN_FUNCTION, FROM_COLUMN_FUNCTION,
                null, FROM_VALUE_FUNCTION
        );
    }

    @Test(expected = NullPointerException.class)
    public void fromValueFunction_cannot_be_null() {
        transformingTable = TransformingTable.create(
                backingTableMock,
                TO_ROW_FUNCTION, FROM_ROW_FUNCTION,
                TO_COLUMN_FUNCTION, FROM_COLUMN_FUNCTION,
                TO_VALUE_FUNCTION, null
        );
    }

    // contains

    @Test
    public void when_contains_and_row_key_null_then_false_returned() {
        assertThat(transformingTable.contains(null, COLUMN_KEY_1), is(equalTo(false)));
    }

    @Test
    public void when_contains_and_column_key_null_then_false_returned() {
        assertThat(transformingTable.contains(ROW_KEY_1, null), is(equalTo(false)));
    }

    @Test
    public void when_contains_and_row_key_of_wrong_class_then_false() {
        assertThat(transformingTable.contains(new Object(), COLUMN_KEY_1), is(equalTo(false)));
    }

    @Test
    public void when_contains_and_column_key_of_wrong_class_then_false() {
        assertThat(transformingTable.contains(ROW_KEY_1, new Object()), is(equalTo(false)));
    }

    @Test
    public void contains_delegates_to_backing_table() {
        when(backingTableMock.contains(STRING_ROW_KEY_1, STRING_COLUMN_KEY_1)).thenReturn(true);

        assertThat(transformingTable.contains(ROW_KEY_1, COLUMN_KEY_1), is(equalTo(true)));
    }

    // containsRow

    @Test
    public void when_containsRow_and_row_key_null_then_false_returned() {
        assertThat(transformingTable.containsRow(null), is(equalTo(false)));
    }

    @Test
    public void when_containsRow_and_row_key_of_wrong_class_then_false() {
        assertThat(transformingTable.containsRow(new Object()), is(equalTo(false)));
    }

    @Test
    public void containsRow_delegates_to_backing_table() {
        when(backingTableMock.containsRow(STRING_ROW_KEY_1)).thenReturn(true);

        assertThat(transformingTable.containsRow(ROW_KEY_1), is(equalTo(true)));
    }

    // contains column

    @Test
    public void when_containsColumn_and_column_key_null_then_false_returned() {
        assertThat(transformingTable.containsColumn(null), is(equalTo(false)));
    }

    @Test
    public void when_containsColumn_and_column_key_of_wrong_class_then_false() {
        assertThat(transformingTable.containsRow(new Object()), is(equalTo(false)));
    }

    @Test
    public void containsColumn_delegates_to_backing_table() {
        when(backingTableMock.containsColumn(STRING_COLUMN_KEY_1)).thenReturn(true);

        assertThat(transformingTable.containsColumn(COLUMN_KEY_1), is(equalTo(true)));
    }

    // contains value

    @Test
    public void when_containsValue_and_value_is_null_then_false_returned() {
        assertThat(transformingTable.containsValue(null), is(equalTo(false)));
    }

    @Test
    public void when_containsValue_and_value_of_wrong_class_then_false() {
        assertThat(transformingTable.containsValue(new Object()), is(equalTo(false)));
    }

    @Test
    public void containsValue_delegates_to_backing_table() {
        when(backingTableMock.containsValue(STRING_VALUE_1)).thenReturn(true);

        assertThat(transformingTable.containsValue(VALUE_1), is(equalTo(true)));
    }

    // get

    @Test
    public void when_get_and_row_key_null_then_null_returned() {
        assertThat(transformingTable.get(null, COLUMN_KEY_1), is(nullValue()));
    }

    @Test
    public void when_get_and_column_key_null_then_null_returned() {
        assertThat(transformingTable.get(ROW_KEY_1, null), is(nullValue()));
    }

    @Test
    public void when_get_and_row_key_of_wrong_class_then_null() {
        assertThat(transformingTable.get(new Object(), COLUMN_KEY_1), is(nullValue()));
    }

    @Test
    public void when_get_and_column_key_of_wrong_class_then_null() {
        assertThat(transformingTable.get(ROW_KEY_1, new Object()), is(nullValue()));
    }

    @Test
    public void get_delegates_to_backing_table() {
        when(backingTableMock.get(STRING_ROW_KEY_1, STRING_COLUMN_KEY_1)).thenReturn(STRING_VALUE_1);

        assertThat(transformingTable.get(ROW_KEY_1, COLUMN_KEY_1), is(equalTo(VALUE_1)));
    }

    // isEmpty

    public void isEmpty_delegates() {
        when(backingTableMock.isEmpty()).thenReturn(true);

        assertThat(transformingTable.isEmpty(), is(equalTo(true)));
    }

    // size

    public void size_delegates() {
        when(backingTableMock.size()).thenReturn(10);

        assertThat(transformingTable.size(), is(equalTo(10)));
    }

    // clear

    public void clear_delegates() {
        transformingTable.clear();

        verify(backingTableMock).clear();
    }

    // put

    @Test(expected = NullPointerException.class)
    public void when_put_and_row_key_null_thenError() {
        transformingTable.put(null, COLUMN_KEY_1, VALUE_1);
    }

    @Test(expected = NullPointerException.class)
    public void when_put_and_column_key_null_thenError() {
        transformingTable.put(ROW_KEY_1, null, VALUE_1);
    }

    @Test(expected = NullPointerException.class)
    public void when_put_and_value_null_thenError() {
        transformingTable.put(ROW_KEY_1, COLUMN_KEY_1, null);
    }

    @Test
    public void put_delegates_to_backing_table() {
        when(backingTableMock.put(STRING_ROW_KEY_1, STRING_COLUMN_KEY_1, STRING_VALUE_1)).thenReturn(STRING_VALUE_1);

        assertThat(transformingTable.put(ROW_KEY_1, COLUMN_KEY_1, VALUE_1), is(equalTo(VALUE_1)));
    }

    // remove

    @Test
    public void when_remove_and_row_key_null_then_null_returned() {
        assertThat(transformingTable.remove(null, COLUMN_KEY_1), is(nullValue()));
    }

    @Test
    public void when_remove_and_column_key_null_then_null_returned() {
        assertThat(transformingTable.remove(ROW_KEY_1, null), is(nullValue()));
    }

    @Test
    public void when_remove_and_row_key_of_wrong_class_then_null() {
        assertThat(transformingTable.remove(new Object(), COLUMN_KEY_1), is(nullValue()));
    }

    @Test
    public void when_remove_and_column_key_of_wrong_class_then_null() {
        assertThat(transformingTable.remove(ROW_KEY_1, new Object()), is(nullValue()));
    }

    @Test
    public void remove_delegates_to_backing_table() {
        when(backingTableMock.remove(STRING_ROW_KEY_1, STRING_COLUMN_KEY_1)).thenReturn(STRING_VALUE_1);

        assertThat(transformingTable.remove(ROW_KEY_1, COLUMN_KEY_1), is(equalTo(VALUE_1)));
    }

    // cell set
    public void cellSet_delegates_to_backing_table() {
        Set<Table.Cell<String, String, String>> cellSet = Collections.singleton(Tables.immutableCell(STRING_ROW_KEY_1, STRING_COLUMN_KEY_1, STRING_VALUE_1));
        when(backingTableMock.cellSet()).thenReturn(cellSet);

        Table.Cell<Float, Long, Integer> expectedCell = Tables.immutableCell(ROW_KEY_1, COLUMN_KEY_1, VALUE_1);

        //noinspection unchecked
        assertThat(transformingTable.cellSet(), containsInAnyOrder(expectedCell));
    }

    // column key set

    @Test
    public void columnKeySet_delegates_to_backing_table() {
        when(backingTableMock.columnKeySet()).thenReturn(ImmutableSet.of(STRING_COLUMN_KEY_1, STRING_COLUMN_KEY_2));

        assertThat(transformingTable.columnKeySet(), containsInAnyOrder(COLUMN_KEY_1, COLUMN_KEY_2));
    }

    // row key set

    @Test
    public void rowKeySet_delegates_to_backing_table() {
        when(backingTableMock.rowKeySet()).thenReturn(ImmutableSet.of(STRING_ROW_KEY_1, STRING_ROW_KEY_2));

        assertThat(transformingTable.rowKeySet(), containsInAnyOrder(ROW_KEY_1, ROW_KEY_2));
    }

    // values

    @Test
    public void value_delegates_to_backing_table() {
        when(backingTableMock.values()).thenReturn(ImmutableSet.of(STRING_VALUE_1, STRING_VALUE_2));

        assertThat(transformingTable.values(), containsInAnyOrder(VALUE_1, VALUE_2));
    }

    // put all delegates
    @Test
    public void put_all_delegates() {
        Table<Float, Long, Integer> tableToPut = new ImmutableTable.Builder<Float, Long, Integer>().
                put(ROW_KEY_1, COLUMN_KEY_1, VALUE_1).
                put(ROW_KEY_2, COLUMN_KEY_2, VALUE_2).build();

        transformingTable.putAll(tableToPut);

        verify(backingTableMock).put(STRING_ROW_KEY_1, STRING_COLUMN_KEY_1, STRING_VALUE_1);
        verify(backingTableMock).put(STRING_ROW_KEY_2, STRING_COLUMN_KEY_2, STRING_VALUE_2);
    }

    @Test(expected = NullPointerException.class)
    public void put_all_errors_on_null() {
        transformingTable.putAll(null);
    }

    // row map
    @Test
    public void rowMap_delegates() {
        Map<String, Map<String, String>> backingRowMap = ImmutableMap.of(
                STRING_ROW_KEY_1, (Map<String, String>) ImmutableMap.of(STRING_COLUMN_KEY_1, STRING_VALUE_1),
                STRING_ROW_KEY_2, ImmutableMap.of(STRING_COLUMN_KEY_1, STRING_VALUE_2)
        );

        when(backingTableMock.rowMap()).thenReturn(backingRowMap);

        assertThat(transformingTable.rowMap(), is(equalTo(
                (Map<Float, Map<Long, Integer>>) ImmutableMap.of(
                        ROW_KEY_1, (Map<Long, Integer>) ImmutableMap.of(COLUMN_KEY_1, VALUE_1),
                        ROW_KEY_2, ImmutableMap.of(COLUMN_KEY_1, VALUE_2))
        )));
    }

    // column map
    @Test
    public void columnMap_delegates() {
        Map<String, Map<String, String>> backingColumnMap = ImmutableMap.of(
                STRING_COLUMN_KEY_1, (Map<String, String>) ImmutableMap.of(STRING_ROW_KEY_1, STRING_VALUE_1),
                STRING_COLUMN_KEY_2, ImmutableMap.of(STRING_ROW_KEY_1, STRING_VALUE_2)
        );

        when(backingTableMock.columnMap()).thenReturn(backingColumnMap);

        assertThat(transformingTable.columnMap(), is(equalTo(
                (Map<Long, Map<Float, Integer>>) ImmutableMap.of(
                        COLUMN_KEY_1, (Map<Float, Integer>) ImmutableMap.of(ROW_KEY_1, VALUE_1),
                        COLUMN_KEY_2, ImmutableMap.of(ROW_KEY_1, VALUE_2))
        )));
    }

    @Test
    public void row_delegates() {
        when(backingTableMock.row(STRING_ROW_KEY_1)).thenReturn(ImmutableMap.of(STRING_COLUMN_KEY_1, STRING_VALUE_1));

        assertThat(transformingTable.row(ROW_KEY_1), is(equalTo(
                (Map<Long, Integer>) ImmutableMap.of(COLUMN_KEY_1, VALUE_1)
        )));
    }

    @Test(expected = NullPointerException.class)
    public void when_row_null_then_error() {
        transformingTable.row(null);
    }

    @Test
    public void column_delegates() {
        when(backingTableMock.column(STRING_COLUMN_KEY_1)).thenReturn(ImmutableMap.of(STRING_ROW_KEY_1, STRING_VALUE_1));

        assertThat(transformingTable.column(COLUMN_KEY_1), is(equalTo(
                (Map<Float, Integer>) ImmutableMap.of(ROW_KEY_1, VALUE_1)
        )));
    }

    @Test(expected = NullPointerException.class)
    public void when_column_null_then_error() {
        transformingTable.column(null);
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- invalid - unknown feature designation -->
<tt xml:lang="" xmlns="http://www.w3.org/ns/ttml"
    xmlns:ttva="http://skynav.com/ns/ttv/annotations" ttva:warnOn="all" ttva:expectedErrors="1" ttva:expectedWarnings="0" ttva:model="ttml1">
  <head>
    <profile xmlns="http://www.w3.org/ns/ttml#parameter">
      <features>
        <feature value="optional">#unknown</feature>
      </features>
    </profile>
  </head>
</tt>


text:
        <img class="d-block mx-auto mb-4" src="<?= base_url('assets/templateV2/img/bonequinho-120.png'); ?>" alt="" width="72" height="72">

Mister Salgadinho agradece a confiança que nos deu tornando-se um Representante.

Para finalizar a compra precisamos que informe para nós alguns dados importantes. E então tornará membro da equipe Mister.

Realizar Cadastro

          <?= form_open('representante/cadastrar'); ?>
            <input type="hidden" name="situacao" value="a">
            <input type="hidden" name="tipo" value="s">
            <input type="hidden" name="ativo" value="0">

              Nome (*)
              <input type="text" class="form-control mb-0 bg-white" id="nome" name="nome" placeholder="Ex.: Nome Completo " value="<?= set_value('nome'); ?>" required>
              <div class="invalid-feedback <?= form_error('nome') !== null ? "d-block":""; ?>">
                <?= form_error('nome'); ?>

              CPF ou CNPJ (*)
              <input type="number" class="form-control mb-0 bg-white" id="cpf_cnpj" name="cpf_cnpj" placeholder="Ex.: 35849945809 ou 43165888000125 " value="<?= set_value('cpf_cnpj'); ?>" maxlength="14" required>
              <div class="invalid-feedback <?= form_error('cpf_cnpj') !== null ? "d-block":""; ?>">
                <?= form_error('cpf_cnpj'); ?>

              Email (*)
              <input type="text" class="form-control mb-0 bg-white" id="email" name="email" placeholder="Ex.: seu@Email.com" value="<?= set_value('email'); ?>" required>
              <div class="invalid-feedback <?= form_error('email') !== null ? "d-block":""; ?>">
                <?= form_error('email'); ?>

              Senha (* Minimo 8 Caracteres)
              <input type="password" class="form-control mb-0 bg-white" id="senha" name="senha" placeholder="Ex.: Password" value="<?= set_value('senha'); ?>" required>
              <div class="invalid-feedback <?= form_error('senha') !== null ? "d-block":""; ?>">
                <?= form_error('senha'); ?>

                Endereço (*)
                <input type="text" class="form-control mb-0 bg-white" name="endereco" id="endereco" placeholder="Ex.: Rua. Prudente de Morais" value="<?= set_value('endereco'); ?>" required>
                <div class="invalid-feedback <?= form_error('endereco') !== null ? "d-block":""; ?>">
                  <?= form_error('endereco'); ?>

                Numero (*)
                <input type="text" class="form-control mb-0 bg-white" name="numero" id="numero" placeholder="Ex.: 532" value="<?= set_value('numero'); ?>" required>
                <div class="invalid-feedback <?= form_error('numero') !== null ? "d-block":""; ?>">
                  <?= form_error('numero'); ?>

                Bairro (*)
                <input type="text" class="form-control mb-0 bg-white" name="bairro" id="bairro" placeholder="Ex.: Centro" value="<?= set_value('bairro'); ?>" required>
                <div class="invalid-feedback <?= form_error('bairro') !== null ? "d-block":""; ?>">
                  <?= form_error('bairro'); ?>

              Complemento
                <input type="text" class="form-control mb-0 bg-white" name="complemento" id="complemento" placeholder="Ex.: Apto 100, BL 1A" value="<?= set_value('complemento'); ?>">
                <div class="invalid-feedback <?= form_error('complemento') !== null ? "d-block":""; ?>">
                  <?= form_error('complemento'); ?>

              Telefone/Celular (*)
              <input type="text" class="form-control mb-0 bg-white" name="telefone" id="telefone" placeholder="Ex.: (16) 99999-9999" value="<?= set_value('telefone'); ?>" required>
              <div class="invalid-feedback <?= form_error('telefone') !== null ? "d-block":""; ?>">
                <?= form_error('telefone'); ?>

            <button class="btn btn-warning btn-lg btn-block" type="submit">Cadastrar</button>
          </form>


text:
import * as _api from './api'
export const api = _api


text:
import * as ng from 'angular';

import { BitmovinPlayerController } from './bitmovin-player.controller';
import { BitmovinPlayerApi, BitmovinUIManager, DirectiveScope, IWindow, PlayerApiReadyEvent, PlayerPlugin } from './models';
import { PlayerApi } from './player-api';
import { PlayerPlaybackType } from './player-playback.type';
import { AnalyticsPlugin, SubtitlesPlugin } from './plugins';

export const deps = {
  SubtitlesPlugin,
  PlayerApi,
};

BitmovinPlayerDirective.$inject = ['$window', '$log', 'ksdn', 'YouboraLib', 'YouboraAdapter', 'HiveBitmovin'];

export function BitmovinPlayerDirective($window: IWindow, $log: ng.ILogService,
                                        ksdn: any, youboraLib: any, youboraAdapter: any,
                                        HiveBitmovin: any): ng.IDirective {
  return {
    controller: 'MiBitdashController',
    controllerAs: 'bitdashVm',
    replace: true,
    restrict: 'EA',
    scope: {
      config: '=',
      options: '=?',
      playerApiReady: '&?',
      webcast: '=',
    },
    template: `<div id="mi-bitdash-player" width="100%" height="auto"></div>`,

    link(scope: DirectiveScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, controller: BitmovinPlayerController): void {
      const playerId = 'mi-bitdash-player';
      const webcast = scope.webcast;
      const playerConfig = scope.config;
      const recoverState = (scope.options && scope.options.recoverState) ? scope.options.recoverState : null;
      const youboraConfig = (scope.options && scope.options.youbora) ? scope.options.youbora : null;
      let playerApi: PlayerApi;

      init();

      function init(): void {
        if (!controller.vm.playerConfig) {
          return;
        }
        const playerType = controller.vm.playerConfig.type;

        switch (playerType) {
          case PlayerPlaybackType.KSDN:
            createKollectivePlayer();
            break;
          case PlayerPlaybackType.HIVE:
            createHivePlayer();
            break;
          default:
            createDefaultPlayer();
        }
      }

      function createPlayer(): BitmovinPlayerApi {
        return $window.window.bitmovin.player(playerId);
      }

      function createDefaultPlayer(): void {
        const source = { hls: controller.vm.playerConfig.hlsUrl };
        playerConfig.source = {}; // we don't want to load sources on setup

        const bitmovinPlayer = createPlayer();

        setupPlayer(bitmovinPlayer)
          .then(() => {
            return playerApi.load(source)
              .then(() => playerReady())
              .catch(() => playerLoadSourceErrorHandler());
          })
          .catch((err) => playerErrorHandler(err));
      }

      function createKollectivePlayer(): void {
        const bitmovinPlayer = createPlayer();

        playerConfig.source = {}; // we want to set the source by the plugin
        const auth = controller.vm.playerConfig.p2p.token;
        const urn = controller.vm.playerConfig.p2p.urn;
        const host = controller.vm.playerConfig.p2p.host;
        const fallbackSrc = controller.vm.playerConfig.hlsUrl;

        setupPlayer(bitmovinPlayer)
          .then((bitmovinPlayerInstance) => {
            const ksdnPlugin = new ksdn.Players.Bitmovin({ auth, host, fallbackSrc });
            const livecycleHooks = getKollectiveLivecyleHooks();

            ksdnPlugin.play(bitmovinPlayerInstance, urn, livecycleHooks);
          })
          .catch((err) => playerErrorHandler(err));
      }

      function getKollectiveLivecyleHooks(): any {
        const errorPrefix = 'Kollective plugin error: ';

        return {
          onAgentNotDetected: (plugin: any, reasons: any) => {
            $log.error(`${errorPrefix} Machine does not have a Kollective Agent installed. Reason:`, reasons);
          },
          onAgentRejected: (plugin: any, criteria: any) => {
            if (!criteria.provisionedForCurrentUrn) {
              $log.error(`${errorPrefix} Agent detected but not provisioned for URN`);
            }
            if (!criteria.notBlackedOut) {
              $log.error(`${errorPrefix} Agent detected but is currently blacked out`);
            }
          },
          onPlaybackRequestFailure: (plugin: any, request: any) => {
            $log.error(`${errorPrefix}  Failure to retrieve playback info for the provided URN:`, request);
            return true;
          },
          onPrimingFailure: (plugin: any) => {
            $log.error(`${errorPrefix}  Agent fails to start priming the stream through the Kollective ECDN`);
          },
          onSessionFailure: () => {
            $log.error(`${errorPrefix} Failure to start a session with the agent`);
          },
          setSource: (player: BitmovinPlayerApi, src: string) => {
            player.load({ hls: src })
              .then(() => playerReady())
              .catch((err) => playerErrorHandler(err));
          },
        };
      }

      function createHivePlayer(): void {
        const hiveTicket = controller.vm.playerConfig.p2p.url;
        const hiveTechOrder = controller.vm.playerConfig.tech || ['HiveJava', 'HiveStats'];

        const pluginConfig = {
          debugLevel: 'off', // 'debug', 'off'
          hiveTechOrder,
          HiveJS: {
            renderStatsCallback: (stats) => ($window.window.hiveRenderStatsCallback || ng.noop)(stats),
          },
        };

        HiveBitmovin.initHiveSDN();
        const bitmovinPlayer = createPlayer();
        const plugin = new HiveBitmovin(bitmovinPlayer, pluginConfig);

        setupPlayer(bitmovinPlayer)
          .then((player) => initHiveSession(plugin, hiveTicket, player))
          .catch((err: any) => {
            playerErrorHandler(err);
          });
      }

      function initHiveSession(hivePlugin: any, hiveTicket: string, playerInstance: BitmovinPlayerApi): BitmovinPlayerApi {
        const successHandler = (hiveSession) => {
          return playerInstance.load({ hls: hiveSession.manifest })
            .then(() => playerReady())
            .catch((reason) => errorHandler(reason));
        };

        const errorHandler = (error) => {
          // Partner-specific implementation on how to handle Hive ticket resolution failure
          $log.warn(`Hive plugin failed, fallback to default player. Error:`, error);

          playerInstance.destroy();

          setTimeout(() => {
            createDefaultPlayer();
          }, 60);
        };

        return hivePlugin.initSession(hiveTicket)
          .then(successHandler)
          .catch(errorHandler);
      }

      function playerErrorHandler(error: any): void {
        $log.error('player error:', error);
      }

      function setupPlayerUi(bitmovinPlayer: BitmovinPlayerApi): void {
        const isAudioOnly = webcast.layout.layout === 'audio-only' || webcast.layout.layout === 'audio-only-compact';
        const bitmovinUIManager: BitmovinUIManager = $window.window.miBitmovinUi.playerui.UIManager.Factory;

        if (isAudioOnly) {
          bitmovinUIManager.buildAudioOnlyUI(bitmovinPlayer, controller.getAudioOnlyPlayerConfig());
        } else {
          bitmovinUIManager.buildAudioVideoUI(bitmovinPlayer);
        }

        const bitmovinControlbar = getElementsByClassName('bitmovinplayer-container');
        if (bitmovinControlbar) {
          bitmovinControlbar.style.minWidth = '175px';
          bitmovinControlbar.style.minHeight = '101px';
          $window.document.getElementById('bitmovinplayer-video-mi-bitdash-player').setAttribute('title', webcast.name);
        }
      }

      function getElementsByClassName(className: string): HTMLElement {
        return $window.document.getElementsByClassName(className)[0] as HTMLElement;
      }

      function setupPlayer(bitmovinPlayer: BitmovinPlayerApi): Promise<BitmovinPlayerApi> {
        const playerPlugins = createPlugins();
        const youboraPlugin = youboraConfig ? createYouboraPlugin() : null;

        // TODO: set it in the app and not here
        playerConfig.style = { ux: false };
        return bitmovinPlayer.setup(playerConfig).then((bitmovinPlayerApi) => {
          setupPlayerUi(bitmovinPlayerApi);

          playerApi = new deps.PlayerApi(bitmovinPlayerApi);
          playerApi.setupPlugins(playerPlugins, recoverState);

          if (youboraPlugin) {
            const youboraBitmovinAdapter = new youboraAdapter(bitmovinPlayerApi);
            youboraPlugin.setAdapter(youboraBitmovinAdapter);
          }

          return bitmovinPlayerApi;
        });
      }

      function createYouboraPlugin(): any {
        return new youboraLib.Plugin(youboraConfig);
      }

      function createPlugins(): PlayerPlugin[] {
        const plugins = [];

        if (controller.vm.playerConfig.videoId) {
          const miAnalytics = new AnalyticsPlugin(controller.vm.playerConfig.videoId, $log);
          plugins.push(miAnalytics);
        }

        if (controller.vm.playerConfig.videoTracks) {
          const subtitlePlugin = new deps.SubtitlesPlugin(controller.vm.playerConfig.videoTracks);
          plugins.push(subtitlePlugin);
        }

        return plugins;
      }

      function playerReady(): void {
        if (recoverState) {
          playerApi.setVolume(recoverState.volume);

          if (recoverState.seekTo) {
            playerApi.seek(recoverState.seekTo);
          }

          if (recoverState.isMuted) {
            playerApi.mute();
          }
        }

        dispatchReadyEvent();
      }

      function playerLoadSourceErrorHandler(): void {
        dispatchReadyEvent();
      }

      function dispatchReadyEvent(): void {
        const $event: PlayerApiReadyEvent = {
          playerApi: playerApi.getPublicApi(),
        };

        (scope.playerApiReady || ng.noop)({ $event });
      }

      function cleanup(): void {
        if (playerApi) {
          playerApi.destroy();
          playerApi = null;
        }
      }

      scope.$on('$destroy', () => {
        cleanup();
      });
    },
  };
}


text:
 Once again we return to `render()`. Now that our `props` and `state` are all updated[^1] we can apply them to our content and children. Just like the initial render,[ all the same rules and conditions apply](../birth/component_render.md).

 Unlike our first render, React performs different management when it comes to the generated Elements. The main difference is around the initialization phase and children Elements of the Component.

 ![](react-tree-update.png)

 React compares the current Element tree structure returned from the `render()` method. React uses the generated keys (or assigned keys) to match each Element to a Component instance. React determines if we have new instances (**A.3**), removing instances (**A.0.1**) or are updating existing instances (**A**, **A.0**, **A.0.0**).

 If the keys are the same, then React will pass the `props` to the existing instance, kicking off its Update life cycle. If we have added new Components or changed keys, React will create new instances from the Element data. These new Components then enter the Birth/Mounting phase.

 ***Up Next:*** [Post-Render with `componentDidUpdate()`](postrender_with_componentdidupdate.md)

 ---

 [^1] As mentioned earlier, the asynchronicity nature of state is now fully applied and can be accessed safely.


text:
static NSString *const kRCHRequestPlacementDelimiter = @".";

@interface RCHRequestPlacement ()

@end

@implementation RCHRequestPlacement

- (instancetype)initWithListeningPageType:(RCHPlacementPageType)pageType
{
    if (pageType == RCHPlacementPageTypeNotSet) {
        [RCHLog logError:@"Invalid input, you must provide a valid pageType"];
        return nil;
    }

    self = [super init];
    if (self) {
        _pageType = pageType;
        _name = nil;
    }

    return self;
}

- (instancetype)initWithPageType:(RCHPlacementPageType)pageType name:(NSString *)name;
{
    if (pageType == RCHPlacementPageTypeNotSet || name == nil || name.length == 0) {
        [RCHLog logError:@"Invalid input, you must provide a valid pageType and name"];
        return nil;
    }

    self = [super init];
    if (self) {
        _pageType = pageType;
        _name = name;
    }
    return self;
}

- (NSString *)stringRepresentation
{
    if (self.name == nil || self.name.length == 0) {
        return [RCHEnumMappings stringFromPageType:self.pageType];
    }

    return [NSString stringWithFormat:@"%@%@%@", [RCHEnumMappings stringFromPageType:self.pageType],
                                      kRCHRequestPlacementDelimiter,
                                      self.name];
}

@end

@interface RCHRequestProduct ()

@end

@implementation RCHRequestProduct

- (instancetype)initWithIdentifier:(NSString *)identifier quantity:(NSNumber *)quantity priceCents:(NSNumber *)priceCents
{
    if (identifier == nil || identifier.length == 0 || quantity == nil || priceCents == nil) {
        [RCHLog logError:@"You must provide a valid product identifier, quantity, and price when creating an instance of %@", NSStringFromClass([self class])];
        return nil;
    }

    self = [super init];
    if (self) {
        _identifier = identifier;
        _quantity = quantity;
        _priceCents = priceCents;
    }
    return self;
}

- (instancetype)initWithIdentifier:(NSString *)identifier quantity:(NSNumber *)quantity priceDollars:(NSNumber *)priceDollars;
{
    if (identifier == nil || identifier.length == 0 || quantity == nil || priceDollars == nil) {
        [RCHLog logError:@"You must provide a valid product identifier, quantity, and price when creating an instance of %@", NSStringFromClass([self class])];
        return nil;
    }

    self = [super init];
    if (self) {
        _identifier = identifier;
        _quantity = quantity;
        _priceDollars = priceDollars;
    }
    return self;
}

@end

@implementation RCHPlacementsBuilder

- (instancetype)initWithAPIPath:(NSString *)APIPath
{
    self = [super initWithAPIPath:APIPath];
    if (self) {
        [self setExcludeHTML:YES];
    }
    return self;
}

- (instancetype)addPlacement:(RCHRequestPlacement *)placement
{
    if (placement != nil) {
        NSString *placementString = [placement stringRepresentation];
        NSArray *currentPlacements = [[self valueForKey:kRCHAPIRequestParamRecommendationsPlacements] componentsSeparatedByString:@"|"];
        NSString *placementPageType = [[placementString componentsSeparatedByString:@"."] firstObject];
        for (NSString *placementName in currentPlacements) {
            if ([placementName isEqualToString:placementString]) {
                [RCHLog logError:@"Invalid parameter passed to %@. Placement %@ has already been added. This placement call will be ignored", NSStringFromSelector(_cmd), placementName];
                return self;
            }

            NSString *pageType = [[placementName componentsSeparatedByString:@"."] firstObject];
            if (![placementPageType isEqualToString:pageType]) {
                [RCHLog logError:@"Invalid parameter passed to %@. You are passing a placement of type %@ on a %@ request. Placement types must be all of the same type. This placement call will be ignored.", NSStringFromSelector(_cmd), placementPageType, pageType];
                return self;
            }
        }

        [self addValue:placementString toArrayForKey:kRCHAPIRequestParamRecommendationsPlacements];
    }
    else {
        [RCHLog logError:@"Invalid parameter, nil placement passed to %@", NSStringFromSelector(_cmd)];
    }

    return self;
}

- (instancetype)setFeaturedPageBrand:(NSString *)featuredPageBrand
{
    return [self setValue:featuredPageBrand forKey:kRCHAPIRequestParamRecommendationsFeaturedPageBrand];
}

- (instancetype)setExcludeHTML:(BOOL)excludeHTML
{
    return [self setValue:@(excludeHTML) forKey:kRCHAPIRequestParamRecommendationsExcludeHtml];
}

- (instancetype)setIncludeCategoryData:(BOOL)includeCategoryData
{
    return [self setValue:@(includeCategoryData) forKey:kRCHAPIRequestParamRecommendationsIncludeCategoryData];
}

- (instancetype)setUserAttributes:(NSDictionary *)userAttributes
{
    return [self setDictionaryValue:userAttributes forKey:kRCHAPIRequestParamRecommendationsUserAttribute flattenKeys:NO];
}

- (instancetype)setShopperReferrer:(NSString *)shopperReferrer
{
    return [self setValue:shopperReferrer forKey:kRCHAPIRequestParamRecommendationsShopperReferrer];
}

- (instancetype)setCategoryHintIDs:(NSArray *)categoryHintIDs
{
    return [self setArrayValue:categoryHintIDs forKey:kRCHAPIRequestParamRecommendationsCategoryHintID];
}

- (instancetype)setUserSegments:(NSDictionary *)userSegments
{
    return [self setDictionaryValue:userSegments forKey:kRCHAPIRequestParamRecommendationsUserSegments flattenKeys:YES];
}

- (instancetype)setRegionID:(NSString *)regionID
{
    return [self setValue:regionID forKey:kRCHAPIRequestParamRecommendationsRegionID];
}

- (instancetype)setViewedProducts:(NSDictionary *)viewdProducts
{
    return [self setDictionaryValue:[self convertDatesToStringTimestampsForDictionary:viewdProducts] forKey:kRCHAPIRequestParamRecommendationsViewedProducts flattenKeys:NO];
}

- (instancetype)setPurchasedProducts:(NSDictionary *)purchasedProducts
{
    return [self setDictionaryValue:[self convertDatesToStringTimestampsForDictionary:purchasedProducts] forKey:kRCHAPIRequestParamRecommendationsPurchasedProducts flattenKeys:NO];
}

#pragma mark - Helper

- (NSDictionary *)convertDatesToStringTimestampsForDictionary:(NSDictionary *)dict
{
    NSMutableDictionary *newDict = [NSMutableDictionary dictionary];
    [dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
        if ([obj isKindOfClass:[NSDate class]]) {
            newDict[key] = [self millisecondsStringFromDate:obj];
        }
        else if ([obj isKindOfClass:[NSArray class]]) {
            NSMutableArray *newTimestamps = [NSMutableArray array];
            for (id subObj in obj) {
                if ([subObj isKindOfClass:[NSDate class]]) {
                    [newTimestamps addObject:[self millisecondsStringFromDate:subObj]];
                }
                else {
                    [RCHLog logError:@"Encountered bad product timestamp value: %@, only instances of NSDate or NSArray are allowed.", subObj];
                }
            }
            newDict[key] = [newTimestamps copy];
        }
        else {
            [RCHLog logError:@"Encountered bad product teimstamp value: %@, only instances of NSDate or NSArray are allowed.", obj];
        }
    }];

    return [newDict copy];
}

- (NSString *)millisecondsStringFromDate:(NSDate *)date
{
    NSTimeInterval ms = [date timeIntervalSince1970] * 1000.0;
    return [NSString stringWithFormat:@"%0.f", ms];
}

@end


text:
<?php

declare(strict_types=1);

namespace Eelly\SDK;

use ErrorException;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\MultipartStream;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken;
use Psr\Http\Message\UploadedFileInterface;
use Shadon\OAuth2\Client\Provider\ShadonProvider;

/**
 * Class ShadonSDKClient.
 *
 * @author hehui<hehui@eelly.net>
 */
class ShadonSDKClient
{
    /**
     * 默认服务.
     */
    private const DEFAULT_SERVICE = 'https://api.eelly.com';

    /**
     * service map.
     *
     * @var array
     */
    protected $serviceMap = [];

    /**
     * @var AbstractProvider
     */
    private $provider;

    /**
     * @var string
     */
    private $grant;

    /**
     * @var array
     */
    private $requestOptions;

    /**
     * @var static
     */
    private static $self;

    /**
     * @var \League\OAuth2\Client\Token\AccessToken
     */
    private $accessToken;

    /**
     * @var HandlerStack
     */
    private $handlerStack;

    /**
     * @var bool
     */
    private $debug = false;

    /**
     * ShadonSDKClient constructor.
     *
     * @param ShadonProvider $provider
     * @param array          $serviceMap
     * @param string         $grant
     * @param array          $requestOptions
     */
    private function __construct(ShadonProvider $provider, array $serviceMap, $grant = 'client_credentials', array $requestOptions = [])
    {
        $this->provider = $provider;
        $this->serviceMap = array_replace($this->serviceMap, $serviceMap);
        $this->grant = $grant;
        $this->requestOptions = $requestOptions;
        $this->handlerStack = HandlerStack::create();
    }

    /**
     * @param ShadonProvider $provider
     * @param array          $serviceMap
     * @param string         $grant
     * @param array          $requestOptions
     *
     * @return ShadonSDKClient
     */
    public static function fromProvider(ShadonProvider $provider, array $serviceMap, $grant = 'client_credentials', array $requestOptions = []): self
    {
        if (null === self::$self) {
            self::$self = new static($provider, $serviceMap, $grant, $requestOptions);
        }

        return self::$self;
    }

    /**
     * @return ShadonProvider
     */
    public function getProvider()
    {
        return $this->provider;
    }

    /**
     * @param AccessToken $accessToken
     */
    public function setAccessToken(AccessToken $accessToken): void
    {
        $this->accessToken = $accessToken;
    }

    /**
     * @return AccessToken
     */
    public function getAccessToken()
    {
        return $this->provider->getAccessToken($this->grant, $this->requestOptions);
    }

    /**
     * @return HandlerStack
     */
    public function getHandlerStack(): HandlerStack
    {
        return $this->handlerStack;
    }

    /**
     * @param bool $debug
     */
    public function debug($debug = true): void
    {
        $this->debug = $debug;
    }

    /**
     * @param string $uri
     * @param array  ...$args
     *
     * @return mixed
     *
     * @deprecated
     */
    public function request(string $uri, ...$args)
    {
        $promise = $this->requestAsync($uri, $args);
        $response = $promise->wait();

        return $response;
    }

    /**
     * @param string $uri
     * @param array  ...$args
     *
     * @throws ErrorException
     *
     * @return \GuzzleHttp\Promise\PromiseInterface
     *
     * @deprecated
     */
    public function requestAsync(string $uri, ...$args)
    {
        if (null === $this->accessToken || $this->accessToken->hasExpired()) {
            $this->accessToken = $this->getAccessToken();
        }
        $elements = $this->paramsToMultipart($args);
        $stream = new MultipartStream($elements);
        $options = [
            'body' => $stream,
        ];
        $serviceName = explode('/', $uri)[0];
        if (!\array_key_exists($serviceName, $this->serviceMap)) {
            $this->serviceMap[$serviceName] = self::DEFAULT_SERVICE;
        }
        $token = $this->accessToken->getToken();
        $request = $this->provider->getAuthenticatedRequest('POST', $this->serviceMap[$serviceName].'/'.$uri.'?tpl=0', $token, $options);
        $promise = $this->provider->getHttpClient()->sendAsync($request, [
            'handler' => $this->handlerStack,
            'debug'   => $this->debug,
        ]);

        return $promise;
    }

    /**
     * @param string $uri
     * @param $args
     *
     * @throws ErrorException
     *
     * @return \GuzzleHttp\Promise\PromiseInterface
     */
    public function requestAsyncJson(string $uri, $args)
    {
        if (null === $this->accessToken || $this->accessToken->hasExpired()) {
            $this->accessToken = $this->getAccessToken();
        }
        $serviceName = explode('/', $uri)[0];
        if (!\array_key_exists($serviceName, $this->serviceMap)) {
            $this->serviceMap[$serviceName] = self::DEFAULT_SERVICE;
        }
        $options = [
            'headers' => [
                'content-type' => 'application/json',
                'Accept'       => 'application/json',
            ],
            'body' => json_encode($args),
        ];
        $token = $this->accessToken->getToken();
        $request = $this->provider->getAuthenticatedRequest('POST', $this->serviceMap[$serviceName].'/'.$uri.'?tpl=1', $token, $options);
        $promise = $this->provider->getHttpClient()->sendAsync($request, [
            'handler' => $this->handlerStack,
            'debug'   => $this->debug,
        ]);

        return $promise;
    }

    /**
     * @param $params
     * @param null $prefix
     *
     * @return array
     */
    private function paramsToMultipart($params, $prefix = null)
    {
        $multipart = [];
        foreach ($params as $key => $value) {
            $p = null === $prefix ? $key : $prefix.'['.$key.']';
            $p = (string) $p;
            if ($value instanceof UploadedFileInterface) {
                $multipart[] = [
                    'name'     => $p,
                    'contents' => $value->getStream(),
                ];
            } elseif (\is_array($value)) {
                if (empty($value)) {
                    $multipart[] = [
                        'name'     => $p,
                        'contents' => '/*_EMPTY_ARRAY_*/',
                    ];
                    continue;
                }
                $parentMultipart = $this->paramsToMultipart($value, $p);
                foreach ($parentMultipart as $part) {
                    $multipart[] = $part;
                }
            } elseif (null !== $value) {
                $multipart[] = [
                    'name'     => $p,
                    'contents' => $value,
                ];
            }
        }

        return $multipart;
    }
}


text:
 (function() {
      function SongPlayer($rootScope, Fixtures) {
         var SongPlayer = {};

         var currentAlbum = Fixtures.getAlbum();

  /**
  * @desc Buzz object audio file
  * @type {Object}
  */

         var currentBuzzObject = null;

  /**
  * @function setSong
  * @desc Stops currently playing song and loads new audio file as currentBuzzObject
  * @param {Object} song
  */

         var setSong = function(song) {
           if (currentBuzzObject) {
               stopSong(song);
           }
             currentBuzzObject = new buzz.sound(song.audioUrl, {
                formats: ['mp3'],
                preload: true
             });

             currentBuzzObject.bind('timeupdate', function() {   //creates a custom event that other parts of the Angular application can "listen" to.
                 $rootScope.$apply(function() {                 // To update the song's playback progress from anywhere - timeupdate is one of a number of HTML5 audio events we can use with Buzz's bind() method
                     SongPlayer.currentTime = currentBuzzObject.getTime(); // Using  $apply, we apply the time update change to the $rootScope
                 });
             });

             currentBuzzObject.bind('ended', function() {  //move to next song after prev one ends
                 $rootScope.$apply(function() {
                       SongPlayer.next();
                 });
             });

             SongPlayer.currentSong = song;

         };

         var playSong = function(song) {
            currentBuzzObject.play();
            song.playing = true;
         };

         var stopSong = function(song) {
               currentBuzzObject.stop();
               SongPlayer.currentSong.playing = null;
          };

         var getSongIndex = function(song) {
             return currentAlbum.songs.indexOf(song);
         };

         SongPlayer.currentSong = null;  //turn 'var currentSong' into a public attribute so that we can use it within PlayerBarCtrl

          /**
           * @desc Current playback time (in seconds) of currently playing song
           * @type {Number}
           */

         SongPlayer.currentTime = null;

          /**
          * @desc Volume level of audio
          * @type {Number}
          */

         SongPlayer.volume = 65;

         SongPlayer.play = function(song) {
             song = song || SongPlayer.currentSong;
             //song occurs when we call the methods from the Album view's song rows, and SongPlayer.currentSong occurs when we call the methods from the player bar
             if (SongPlayer.currentSong !== song) {
                 setSong(song);
                //  currentBuzzObject.play();
                //  song.playing = true;
                 playSong(song);
             } else if (SongPlayer.currentSong === song) {
                 if (currentBuzzObject.isPaused()) {
                    //  currentBuzzObject.play();
                    playSong(song);
                     }
                 }
             };

         SongPlayer.pause = function(song) {
             song = song || SongPlayer.currentSong;
             currentBuzzObject.pause();
             song.playing = false;
         };

         SongPlayer.previous = function() {
             var currentSongIndex = getSongIndex(SongPlayer.currentSong);
             currentSongIndex--;

             if (currentSongIndex < 0) {
                 stopSong(song);
             } else {
               var song = currentAlbum.songs[currentSongIndex];
               setSong(song);
               playSong(song);
           }
         };

          SongPlayer.next = function() {
            var currentSongIndex = getSongIndex(SongPlayer.currentSong);
            currentSongIndex++;

            if (currentSongIndex > currentAlbum.songs.length - 1) {
                //set songs array back to index 0 if on last song
                var song = currentAlbum.songs[0];
                setSong(song);
                playSong(song);
            } else {
                var song = currentAlbum.songs[currentSongIndex];
                setSong(song);
                playSong(song);
            }
          };

         /**
         * @function setCurrentTime
         * @desc Set current time (in seconds) of currently playing song
         * @param {Number} time
         */
         SongPlayer.setCurrentTime = function(time) {
             if (currentBuzzObject) {
                 currentBuzzObject.setTime(time);
             }
         };

        SongPlayer.setVolume = function(level) {
            if (currentBuzzObject) {
                currentBuzzObject.setVolume(level);
            };
         };

         return SongPlayer;
      }

      angular
          .module('blocJams')
          .factory('SongPlayer', ['$rootScope', 'Fixtures', SongPlayer]);
  })();

 //The play method takes an argument, song, which we'll get from the Album view when
 //a user clicks the play button; the ngRepeat directive used in the Album view template will
 //dictate which song to pass into the function. The play method creates a new Buzz object
 //using the song's audioUrl property and then calls Buzz's own  play method on the object.


text:
package io.github.kexanie.mathviewtest;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
Extending Cortana with Voice Commands
Quick Start Challenge – //Build 2015
Overview
Windows 10 allows developers to extend Cortana's functionality to enable users to input a one-utterance command directed at an app. Cortana enables applications to handle voice commands by launching the application in either the foreground or the background. Voice commands that require additional context or user input are best handled in the foreground, whereas commands that are simple enough can be handled in the background.
What You'll Learn
•	How to enable voice commands that launch your application from Cortana
•	How to enable voice commands that interact with the user on Cortana's canvas
The Challenge
We will start by creating a new project in Visual Studio 2015 CTP – launch Visual Studio from the task bar or the Start Menu.

Make a New Project

From the File Menu, select New Project.

Using the New Project window, create a Blank Universal App from the provided project templates.
Expand the template tree on the left-hand side of the menu to get to the Windows Universal templates for C#. They are located under Installed → Templates → Visual C# → Windows Universal.
Then select a Blank Application. A blank UAP application is a project for the simplest UAP appFor the purpose of this lab, name the project VoiceCommandsQuickStart.

Creating the Voice Command Definition File
From within the Solution Explorer, right click on the project, VoiceCommandsQuickStart (unless you named it differently). From the Add menu, select New Item.

In the left hand pane, click Data and select XML file. For the purpose of this lab, name the file VoiceCommandsQuickStart.xml. Click the Add button.

In the Solution Explorer, click on the VoiceCommandsQuickStart.xml. In the Properties pane, set Copy to Output Directory to Copy Always. This will assure that the XML file is part of the application package.

Edit the VoiceCommandsQuickStart.xml to define the commands the application will handle. For the purpose of this lab, the app will define a command that recognizes this input: "How many states are in the US?".
<?xml version="1.0" encoding="utf-8"?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.2">
	<CommandSet xml:lang="en-us" Name="CommandSet_en-us">
		<CommandPrefix> Quick Start, </CommandPrefix>
		<Example> Ask me something </Example>

      <Command Name="HowManyStates">
      <Example> How many states in the US? </Example>
      <ListenFor> How many states [are] in [the] US </ListenFor>
      <ListenFor> How many states [are] in the United States </ListenFor>
      <Feedback> Looking for an answer </Feedback>
      <Navigate/>
    </Command>

  </CommandSet>

</VoiceCommands>
Notice that the XML sets a CommandPrefix , in this case it is Quick Start. This is the prefix that the user needs to use when invoking the voice command. When invoking the voice command, the user needs to say to Cortana "Quick Start, How many states are in US?". Notice that the language for this command is set to en-us.
Press Ctrl+S to save the VoiceCommandsQuickStart.xml file once you copy the XML snippet provided above.

Register the Voice Command Definition file

In the Solution Explorer, click on the App.xaml and expand. Click on the App.xaml.cs to open the file.

Add this namespace at the top of the file.
using Windows.ApplicationModel.VoiceCommands;
using Windows.Media.SpeechRecognition;

Find the OnLaunched method that was added for you when the Project was created. At the very end of the method, add the code that registers the VoiceCommandsQuickStart.xml with the System. Make sure to declare OnLauched method as async as shown below.
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{

    // add this at the very end of the method
    var storageFile = await
    Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(
    new Uri("ms-appx:///VoiceCommandsQuickStart.xml"));

    await
    VoiceCommandDefinitionManager.InstallCommandDefinitionsFromStorageFileAsync
                                                                    (storageFile);
 }

Press Ctrl+S to save the App.xaml.cs file.
Create a new page
From within the Solution Explorer, right click on the project, VoiceCommandQuickStart (unless you named it differently). From the Add menu, select New Item.
Find the BlankPage template under Installed -> Visual C# -> Blank Page a name it AnswersPage.xaml.

Handle the activation-by-voice-command
In the App.xaml.cs file, override the OnActivated method. This method is called when the application is launched through voice from Cortana.
Add this code snippet to the file. Notice how the code checks that the activation kind is 'voice' , it casts the event arguments to VoiceCommandActivatedEventArgs to get access to the recognized command. It then inspects the name of the recognized command and it navigates to the Details page.
protected override void OnActivated(IActivatedEventArgs e)
{

    Frame rootFrame = Window.Current.Content as Frame;

    if (rootFrame == null)
    {
        rootFrame = new Frame();
        rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

        rootFrame.NavigationFailed += OnNavigationFailed;

        Window.Current.Content = rootFrame;
    }

    if (e.Kind == Windows.ApplicationModel.Activation.ActivationKind.VoiceCommand)
    {
        var commandArgs = e as
        Windows.ApplicationModel.Activation.VoiceCommandActivatedEventArgs;
        SpeechRecognitionResult speechRecognitionResult = commandArgs.Result;

        string voiceCommandName = speechRecognitionResult.RulePath[0];

        if (voiceCommandName == "HowManyStates")
        {
            rootFrame.Navigate(typeof(AnswersPage), speechRecognitionResult);
        }
    }

    if (rootFrame.Content == null)
    {
        rootFrame.Navigate(typeof(MainPage), null);
    }

    Window.Current.Activate();
}

Press Ctrl+S to save the App.xaml.cs file.
Show and speak an answer to the voice command
In the Solution Explorer, click on the AnswersPage.xaml to open and copy this snippet. This will add two text boxes that will show the voice command and the answer and a MediaElement used to speak the answer.
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

<TextBlock x:Name="pageTitle" Text="Answer Page" Style="{StaticResource HeaderTextBlockStyle}" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,1830"/>

<TextBox x:Name="questionTextBox" HorizontalAlignment="Left" Height="72" Margin="10,239,0,0" TextWrapping="Wrap" Text="Question:" VerticalAlignment="Top" Width="485"/>

<TextBox x:Name="answerTextBox" HorizontalAlignment="Left" Height="72" Margin="10,136,0,0" TextWrapping="Wrap" Text="Answer:" VerticalAlignment="Top" Width="485"/>

<MediaElement x:Name="media" AutoPlay="False"/>
</Grid>
Press Ctrl+S to save.

In the Solution Explorer, click on the AnswersPage.xaml.cs to open.
Copy this snippet to add these namespaces at the top of the file.
using Windows.Media.SpeechRecognition;
using Windows.Media.SpeechSynthesis;
Copy
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
    SpeechRecognitionResult speechResult = e.Parameter as SpeechRecognitionResult;

    questionTextBox.Text = speechResult.Text;
    answerTextBox.Text = "There are 50 states and one federal district in US.";

    var synthesizer = new SpeechSynthesizer();
    SpeechSynthesisStream synthesisStream = await
                          synthesizer.SynthesizeTextToStreamAsync(answerTextBox.Text);

    // Set the source and start playing the synthesized audio stream.
    media.AutoPlay = true;
    media.SetSource(synthesisStream, synthesisStream.ContentType);
    media.Play();

}
Press Ctrl+S to save.

Try it out
Lastly, we need to run the project. Using the debug menu pictured below, you can use the chevron to change your target platforms. Try running this same binary on your Windows 10 Technical Preview machine along with the Windows Phone 10 Technical Preview device.

Run the application at least once to register the voice command. Minimize or close the application.
Open Cortana and press the microphone button.
Say: "Quick Start, how many states are in US?"
You should see this screen in Cortana:

The app should launch on the AnswersPage and you should see and hear:
"There are 50 states and one federal district in US".
Great, you now enabled a voice command that launches an app in the foreground. The app presents UI with the answer and uses Speech Synthesis to speak the answer.
Let change the voice command to be handled by the app in the background and use Cortana's canvas and screen to present the answer to the user.

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.


text:
<?php

namespace Frozensheep\Synthesize\Tests\Type\Fixtures;

use Frozensheep\Synthesize\Synthesizer;

class NumberFixture implements \JsonSerializable {

	//include the Sythesizer trait
	use Synthesizer;

	//set the synthesized variables
	protected $arrSynthesize = array(
		'num' => array('type' => 'number'),
		'num1' => array('type' => 'number'),
		'num2' => array('type' => 'number', 'default' => 15),
		'num3' => array('type' => 'number', 'min' => 0, 'max' => 10),
		'num4' => array('type' => 'number', 'jsonnull' => true),
		'num5' => array('type' => 'number', 'json' => false)
	);
}


text:
<?php
	if (isset($_POST['TieuDe'])==true){
		$qly_pages ->ThemPA();
	}

?>

 Quản Trị

Thêm Giới Thiệu

<?php if (isset($_POST['TieuDe'])==true){ ?>

    <button data-dismiss="alert" class="close close-sm" type="button">

    </button>
    Thành Công !  Bạn đã thêm thành công .

<?php } ?>

                Thêm Giới Thiệu Mới

                    <form class="cmxform form-horizontal " id="commentForm" method="post" action="">

                            Tiêu Đề

                                <input class=" form-control" id="TieuDe" name="TieuDe" type="text" required />

                            Nội Dung

                                <textarea class="form-control" id="NoiDung" name="NoiDung" ></textarea>

                            Title

                                <input class="form-control " id="Title" type="text" name="Title"  />

                            Description

                                <textarea class="form-control " id="Des" name="Des" rows="4" ></textarea>

                            Keyword

                                <input class="form-control " id="Keyword" type="text" name="Keyword"  />

                                <button class="btn btn-primary" type="submit">Thêm</button>
                                <button class="btn btn-default" type="reset">Hủy</button>
                                <input type="hidden" name="idGroup" value="1" />

                    </form>


text:
/*==================================================
 * Exhibit styles
 *
 * Note that almost all CSS code is in themes.
 *==================================================
 */
.exhibit-ui-protection div {
    margin:     0;
    padding:    0;
}
.exhibit-ui-protection table {
	font-size: 100%;
}
.exhibit-ui-protection tr {
	vertical-align: top;
}
a img {
    border: none;
}

a.exhibit-action,
a.exhibit-action:link,
a.exhibit-action:active,
a.exhibit-action:visited {
	text-decoration:    none;
	border-bottom:      1px dotted;
	cursor:             pointer;
}
a.exhibit-action:hover {
	border-bottom:  1px solid;
	cursor:         pointer;
}

a.exhibit-action-disabled,
a.exhibit-action-disabled:link,
a.exhibit-action-disabled:active,
a.exhibit-action-disabled:visited {
	text-decoration:    none;
	border-bottom:      1px dotted;
	cursor:             pointer;
    opacity:            0.5;
}
a.exhibit-action-disabled:hover {
	border-bottom:  1px solid;
	cursor:         pointer;
}

a.exhibit-item,
a.exhibit-item:link,
a.exhibit-item:active,
a.exhibit-item:visited {
	text-decoration:    none;
	border-bottom:      1px dotted red;
	cursor:             pointer;
}
a.exhibit-item:hover {
	border-bottom:  1px solid;
	cursor:         pointer;
}

span.exhibit-value {
}

/*
 *  Menu Popup
 */
div.exhibit-menu-popup {
    position:       absolute;
    width:          15em;
    z-index:        1000;
    background:     #FFFFE0;
    border:         1px solid #aaa;
}

a.exhibit-menu-item {
    text-decoration:    none;
}

a.exhibit-menu-item > div {
    padding:            2px 2px 2px 20px;
    text-indent:        -18px;
}

a:hover.exhibit-menu-item > div {
    background:         #DFDFC8;
}

a.exhibit-menu-item div img {
    vertical-align:     middle;
    margin-right:       2px;
}

div.exhibit-menu-section {
    padding:            2px;
    font-weight:        bold;
}

/*
 *  Copy Button and Dialog Box
 */
button.exhibit-copyButton, button.exhibit-button {
    border: 1px dashed;
    cursor: pointer;
    margin: 2px;
}
button:hover.exhibit-copyButton, button.exhibit-button:hover {
    background: white;
    border:     1px dashed blue;
    color:      blue;
    cursor:     pointer;
}

div.exhibit-copyDialog {
    position:       absolute;
    z-index:        1000;
    background:     #B2E8FF;
    border:         1px solid #aaa;
    padding:        2em;
    left:           25%;
    right:          25%;
}

div.exhibit-copyDialog textarea {
    width:          100%;
    font-size:      90%;
    color:          #888;
}

div.exhibit-copyDialog button {
    float:          right;
}

/*
 *  Focus Dialog Box
 */
div.exhibit-focusDialog {
    position:       absolute;
    z-index:        1000;
    background:     #B2E8FF;
    border:         1px solid #aaa;
    padding:        2em;
    left:           25%;
    right:          25%;
}

div.exhibit-focusDialog-lensContainer {
}

div.exhibit-focusDialog-controls {
    margin:         1em;
    text-align:     center;
}

/*
 *  Busy indicator
 */
.exhibit-busyIndicator {
    position:   absolute;
    left:       35%;
    width:      30%;
    z-index:    1000;
}
.exhibit-busyIndicator-content {
    font-size:      120%;
    font-weight:    bold;
    text-align:     center;
}
.exhibit-busyIndicator-content img {
    vertical-align: middle;
}


text:
from django import forms
from django.conf import settings
from paypal.standard.forms import PayPalPaymentsForm

class ScapeForm(PayPalPaymentsForm):
    amount = forms.ChoiceField(
        choices=[(x[0], str(x[1])+" days") for x in settings.DONATION_AMOUNTS]
    )