text:
package com.izforge.izpack.panels.userinput.gui.file;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.io.File;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.logging.Logger;

import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;

import com.izforge.izpack.api.GuiId;
import com.izforge.izpack.api.resource.Messages;
import com.izforge.izpack.gui.ButtonFactory;
import com.izforge.izpack.installer.data.GUIInstallData;
import com.izforge.izpack.installer.gui.InstallerFrame;
import com.izforge.izpack.panels.userinput.field.ValidationStatus;
import com.izforge.izpack.panels.userinput.field.file.MultipleFileField;

public class MultipleFileInputField extends JPanel implements ActionListener, FocusListener
{
    private static final long serialVersionUID = 4673684743657328492L;

    private static final transient Logger logger = Logger.getLogger(MultipleFileInputField.class.getName());

    private final MultipleFileField field;
    boolean isDirectory;
    InstallerFrame parentFrame;

    DefaultListModel model;
    JList fileList;
    JButton browseBtn;
    JButton deleteBtn;

    String set;
    int size;
    GUIInstallData data;
    String fileExtension;
    String fileExtensionDescription;

    boolean allowEmpty;
    boolean createMultipleVariables;

    int visibleRows = 10;
    int preferredX = 200;
    int preferredY = 200;

    String labeltext;

    public MultipleFileInputField(MultipleFileField field, InstallerFrame parent, GUIInstallData data,
                                  boolean directory)
    {
        this.field = field;
        this.parentFrame = parent;
        this.data = data;
        this.set = field.getDefaultValue();
        this.size = field.getSize();
        if (size < 1)
        {
            size = 1;
        }
        this.fileExtension = field.getFileExtension();
        this.fileExtensionDescription = field.getFileExtensionDescription();
        this.isDirectory = directory;
        this.createMultipleVariables = field.getCreateMultipleVariables();
        this.visibleRows = field.getVisibleRows() > 0 ? field.getVisibleRows() : 10;
        this.preferredX = field.getPreferredWidth() > 0 ? field.getPreferredWidth() : 200;
        this.preferredY = field.getPreferredHeight() > 0 ? field.getPreferredHeight() : 200;
        this.labeltext = field.getLabel();
        this.allowEmpty = field.getAllowEmptyValue();
        this.initialize();
    }

    public void clearFiles()
    {
        this.model.clear();
    }

    public void addFile(String file)
    {
        this.model.addElement(file);
    }

    public void initialize()
    {
        JPanel main = new JPanel();

        main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));

        JPanel labelPanel = new JPanel();
        labelPanel.setLayout(new BoxLayout(labelPanel, BoxLayout.X_AXIS));
        JLabel label = new JLabel(this.labeltext);
        labelPanel.add(label);
        labelPanel.add(Box.createHorizontalGlue());
        main.add(labelPanel);

        model = new DefaultListModel();
        fileList = new JList(model);
        fileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        fileList.setVisibleRowCount(visibleRows);

        JPanel panel = new JPanel();
        panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));

        JPanel buttonPanel = new JPanel();
        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));

        Messages messages = data.getMessages();
        browseBtn = ButtonFactory.createButton(messages.get("UserInputPanel.search.browse"), data.buttonsHColor);
        browseBtn.setName(GuiId.BUTTON_BROWSE.id);
        browseBtn.addActionListener(this);

        deleteBtn = ButtonFactory.createButton(messages.get("UserInputPanel.search.delete"), data.buttonsHColor);
        deleteBtn.addActionListener(this);

        JScrollPane scroller = new JScrollPane(fileList);
        scroller.setPreferredSize(new Dimension(preferredX, preferredY));
        panel.add(scroller);

        buttonPanel.add(browseBtn);
        buttonPanel.add(deleteBtn);
        buttonPanel.add(Box.createVerticalGlue());
        panel.add(buttonPanel);
        main.add(panel);
        main.add(Box.createVerticalGlue());
        add(main);
    }

    @Override
    public void actionPerformed(ActionEvent arg0)
    {
        if (arg0.getSource() == browseBtn)
        {
            logger.fine("Show directory chooser");
            String initialPath = ".";
            if (fileList.getSelectedValue() != null)
            {
                initialPath = (String) fileList.getSelectedValue();
            }
            JFileChooser filechooser = new JFileChooser(initialPath);
            if (isDirectory)
            {
                filechooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            }
            else
            {
                filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                if ((fileExtension != null) && (fileExtensionDescription != null))
                {
                    UserInputFileFilter fileFilter = new UserInputFileFilter();
                    fileFilter.setFileExt(fileExtension);
                    fileFilter.setFileExtDesc(fileExtensionDescription);
                    filechooser.setFileFilter(fileFilter);
                }
            }

            if (filechooser.showOpenDialog(parentFrame) == JFileChooser.APPROVE_OPTION)
            {
                String selectedFile = filechooser.getSelectedFile().getAbsolutePath();
                model.addElement(selectedFile);
                logger.fine("Setting current file chooser directory to: " + selectedFile);
            }
        }
        if (arg0.getSource() == deleteBtn)
        {
            logger.fine("Delete selected file from list");
            if (fileList.getSelectedValue() != null)
            {
                model.removeElement(fileList.getSelectedValue());
            }
        }
    }

    public List<String> getSelectedFiles()
    {
        List<String> result = null;
        if (model.size() > 0)
        {
            result = new ArrayList<String>();

            Enumeration<?> elements = model.elements();
            for (; elements.hasMoreElements(); )
            {
                String element = (String) elements.nextElement();
                result.add(element);
            }
        }
        return result;
    }

    private void showMessage(String messageType)
    {
        JOptionPane.showMessageDialog(parentFrame,
                                      parentFrame.getMessages().get("UserInputPanel." + messageType + ".message"),
                                      parentFrame.getMessages().get("UserInputPanel." + messageType + ".caption"),
                                      JOptionPane.WARNING_MESSAGE);
    }

    private boolean validateFile(String input)
    {
        boolean result = false;
        if (allowEmpty && ((input == null) || (input.length() == 0)))
        {
            result = true;
        }
        else if (input != null)
        {
            File file = new File(input);

            if (isDirectory && !file.isDirectory())
            {
                result = false;
                showMessage("dir.notdirectory");
            }
            else if (!isDirectory && !file.isFile())
            {
                result = false;
                showMessage("file.notfile");
            }
            else
            {
                ValidationStatus status = field.validate(input);
                if (!status.isValid())
                {
                    JOptionPane.showMessageDialog(parentFrame, status.getMessage(),
                                                  parentFrame.getMessages().get("UserInputPanel.error.caption"),
                                                  JOptionPane.WARNING_MESSAGE);
                }
                else
                {
                    result = true;
                }
            }
        }
        else
        {
            if (isDirectory)
            {
                showMessage("dir.nodirectory");
            }
            else
            {
                showMessage("file.nofile");
            }
        }
        return result;
    }

    public boolean validateField()
    {
        boolean result = false;
        int fileCount = model.getSize();

        if (fileCount == 0 && allowEmpty)
        {
            return true;
        }
        else
        {
            for (int i = 0; i < fileCount; i++)
            {
                result = validateFile((String) model.getElementAt(i));
                if (!result)
                {
                    break;
                }
            }
        }

        return result;

    }

    @Override
    public void focusGained(FocusEvent e)
    {
    }

    @Override
    public void focusLost(FocusEvent e)
    {
    }

    public boolean isCreateMultipleVariables()
    {
        return createMultipleVariables;
    }

}


text:
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Sets this GameObject as inactive when it loses focus from the hand
//
//=============================================================================

using UnityEngine;
using System.Collections;

namespace Valve.VR.InteractionSystem
{
	//-------------------------------------------------------------------------
	public class HideOnHandFocusLost : MonoBehaviour
	{
		//-------------------------------------------------
		private void OnHandFocusLost( Hand hand )
		{
			gameObject.SetActive( false );
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
<?php

// autoload_namespaces.php @generated by Composer

$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);

return array(
    'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
    'Symfony\\Component\\EventDispatcher\\' => array($vendorDir . '/symfony/event-dispatcher'),
    'Mockery' => array($vendorDir . '/mockery/mockery/library'),
    'Guzzle\\Tests' => array($vendorDir . '/guzzle/guzzle/tests'),
    'Guzzle' => array($vendorDir . '/guzzle/guzzle/src'),
    'Doctrine\\Instantiator\\' => array($vendorDir . '/doctrine/instantiator/src'),
);


text:
trait Marker {
    const N: usize = 0;
    fn do_something() {}
}

struct OverrideConst;
impl Marker for OverrideConst {
//~^ ERROR impls for marker traits cannot contain items
    const N: usize = 1;
}

struct OverrideFn;
impl Marker for OverrideFn {
//~^ ERROR impls for marker traits cannot contain items
    fn do_something() {
        println!("Hello world!");
    }
}

fn main() {}


text:
#ifndef TypingCommand_h
#define TypingCommand_h

#include "core/editing/commands/TextInsertionBaseCommand.h"

namespace blink {

class TypingCommand final : public TextInsertionBaseCommand {
public:
    enum ETypingCommand {
        DeleteSelection,
        DeleteKey,
        ForwardDeleteKey,
        InsertText,
        InsertLineBreak,
        InsertParagraphSeparator,
        InsertParagraphSeparatorInQuotedContent
    };

    enum TextCompositionType {
        TextCompositionNone,
        TextCompositionUpdate,
        TextCompositionConfirm
    };

    enum Option {
        SelectInsertedText = 1 << 0,
        KillRing = 1 << 1,
        RetainAutocorrectionIndicator = 1 << 2,
        PreventSpellChecking = 1 << 3,
        SmartDelete = 1 << 4
    };
    typedef unsigned Options;

    static void deleteSelection(Document&, Options = 0);
    static void deleteKeyPressed(Document&, Options = 0, TextGranularity = CharacterGranularity);
    static void forwardDeleteKeyPressed(Document&, Options = 0, TextGranularity = CharacterGranularity);
    static void insertText(Document&, const String&, Options, TextCompositionType = TextCompositionNone);
    static void insertText(Document&, const String&, const VisibleSelection&, Options, TextCompositionType = TextCompositionNone);
    static void insertLineBreak(Document&, Options);
    static void insertParagraphSeparator(Document&, Options);
    static void insertParagraphSeparatorInQuotedContent(Document&);
    static void closeTyping(LocalFrame*);

    void insertText(const String &text, bool selectInsertedText);
    void insertTextRunWithoutNewlines(const String &text, bool selectInsertedText);
    void insertLineBreak();
    void insertParagraphSeparatorInQuotedContent();
    void insertParagraphSeparator();
    void deleteKeyPressed(TextGranularity, bool killRing);
    void forwardDeleteKeyPressed(TextGranularity, bool killRing);
    void deleteSelection(bool smartDelete);
    void setCompositionType(TextCompositionType type) { m_compositionType = type; }

private:
    static PassRefPtrWillBeRawPtr<TypingCommand> create(Document& document, ETypingCommand command, const String& text = "", Options options = 0, TextGranularity granularity = CharacterGranularity)
    {
        return adoptRefWillBeNoop(new TypingCommand(document, command, text, options, granularity, TextCompositionNone));
    }

    static PassRefPtrWillBeRawPtr<TypingCommand> create(Document& document, ETypingCommand command, const String& text, Options options, TextCompositionType compositionType)
    {
        return adoptRefWillBeNoop(new TypingCommand(document, command, text, options, CharacterGranularity, compositionType));
    }

    TypingCommand(Document&, ETypingCommand, const String& text, Options, TextGranularity, TextCompositionType);

    void setSmartDelete(bool smartDelete) { m_smartDelete = smartDelete; }
    bool isOpenForMoreTyping() const { return m_openForMoreTyping; }
    void closeTyping() { m_openForMoreTyping = false; }

    static PassRefPtrWillBeRawPtr<TypingCommand> lastTypingCommandIfStillOpenForTyping(LocalFrame*);

    void doApply() override;
    EditAction editingAction() const override;
    bool isTypingCommand() const override;
    bool preservesTypingStyle() const override { return m_preservesTypingStyle; }
    void setShouldRetainAutocorrectionIndicator(bool retain) override { m_shouldRetainAutocorrectionIndicator = retain; }
    bool shouldStopCaretBlinking() const override { return true; }
    void setShouldPreventSpellChecking(bool prevent) { m_shouldPreventSpellChecking = prevent; }

    static void updateSelectionIfDifferentFromCurrentSelection(TypingCommand*, LocalFrame*);

    void updatePreservesTypingStyle(ETypingCommand);
    void markMisspellingsAfterTyping(ETypingCommand);
    void typingAddedToOpenCommand(ETypingCommand);
    bool makeEditableRootEmpty();

    void updateCommandTypeOfOpenCommand(ETypingCommand typingCommand) { m_commandType = typingCommand; }
    ETypingCommand commandTypeOfOpenCommand() const { return m_commandType; }

    ETypingCommand m_commandType;
    String m_textToInsert;
    bool m_openForMoreTyping;
    bool m_selectInsertedText;
    bool m_smartDelete;
    TextGranularity m_granularity;
    TextCompositionType m_compositionType;
    bool m_killRing;
    bool m_preservesTypingStyle;

    // Undoing a series of backward deletes will restore a selection around all of the
    // characters that were deleted, but only if the typing command being undone
    // was opened with a backward delete.
    bool m_openedByBackwardDelete;

    bool m_shouldRetainAutocorrectionIndicator;
    bool m_shouldPreventSpellChecking;
};

} // namespace blink

#endif // TypingCommand_h


text:
using System;
using System.Linq;

namespace LeagueRecorder.Shared.Abstractions
{
    public abstract class Region : IEquatable<Region>
    {
        #region Values
        public static readonly Region NorthAmerica = new NorthAmericaRegion();
        public static readonly Region EuropeWest = new EuropeWestRegion();
        public static readonly Region EuropeNordicAndEast = new EuropeNordicAndEastRegion();
        public static readonly Region Korea = new KoreaRegion();
        public static readonly Region Oceanic = new OceanicRegion();
        public static readonly Region Brasil = new BrasilRegion();
        public static readonly Region LatinAmericaNorth = new LatinAmericaNorthRegion();
        public static readonly Region LatinAmericaSouth = new LatinAmericaSouthRegion();
        public static readonly Region Russia = new RussiaRegion();
        public static readonly Region Turkey = new TurkeyRegion();

        public static readonly Region[] All = new Region[]
        {
            NorthAmerica,
            EuropeWest,
            EuropeNordicAndEast,
            Korea,
            Oceanic,
            Brasil,
            LatinAmericaNorth,
            LatinAmericaSouth,
            Russia,
            Turkey
        };
        #endregion

        #region Constructors
        /// <summary>
        /// Prevents a outside user of this class to create instances of it.
        /// Only nested classes are valid.
        /// </summary>
        private Region()
        {

        }
        #endregion

        #region Properties
        /// <summary>
        /// Gets the spectator URL.
        /// </summary>
        public abstract string SpectatorUrl { get; }
        /// <summary>
        /// Gets the spectator port.
        /// </summary>
        public abstract int SpectatorPort { get; }
        /// <summary>
        /// Gets the spectator platform identifier.
        /// </summary>
        public abstract string SpectatorPlatformId { get; }
        /// <summary>
        /// Gets the riot API platform identifier.
        /// </summary>
        public abstract string RiotApiPlatformId { get; }
        #endregion

        #region Methods
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        public override string ToString()
        {
            return this.RiotApiPlatformId;
        }
        #endregion

        #region Equality Members
        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(Region other)
        {
            return this.RiotApiPlatformId == other.RiotApiPlatformId;
        }
        /// <summary>
        /// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != this.GetType()) return false;
            return Equals((Region)obj);
        }
        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        public override int GetHashCode()
        {
            return this.RiotApiPlatformId.GetHashCode();
        }
        /// <summary>
        /// Implements the operator ==.
        /// </summary>
        /// <param name="left">The left.</param>
        /// <param name="right">The right.</param>
        public static bool operator ==(Region left, Region right)
        {
            return Equals(left, right);
        }
        /// <summary>
        /// Implements the operator !=.
        /// </summary>
        /// <param name="left">The left.</param>
        /// <param name="right">The right.</param>
        public static bool operator !=(Region left, Region right)
        {
            return !Equals(left, right);
        }
        #endregion

        #region Static Methods
        /// <summary>
        /// Creates a region using the specified <paramref name="platformId"/> for the Riot Api.
        /// </summary>
        /// <param name="platformId">The platform identifier.</param>
        public static Region FromString(string platformId)
        {
            return Region.All.FirstOrDefault(f =>
                string.Equals(f.RiotApiPlatformId, platformId, StringComparison.InvariantCultureIgnoreCase) ||
                string.Equals(f.SpectatorPlatformId, platformId, StringComparison.InvariantCultureIgnoreCase));
        }
        #endregion

        #region Internal
        private class NorthAmericaRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.na.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "NA1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "na"; }
            }
        }
        private class EuropeWestRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.euw1.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "EUW1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "euw"; }
            }
        }
        private class EuropeNordicAndEastRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.eu.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 8088; }
            }

            public override string SpectatorPlatformId
            {
                get { return "EUN1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "eune"; }
            }
        }
        private class KoreaRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.kr.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "KR"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "kr"; }
            }
        }
        private class OceanicRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.oc1.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "OC1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "oce"; }
            }
        }
        private class BrasilRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.br.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "BR1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "br"; }
            }
        }
        private class LatinAmericaNorthRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.la1.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "LA1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "lan"; }
            }
        }
        private class LatinAmericaSouthRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.la2.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "LA2"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "las"; }
            }
        }
        private class RussiaRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.ru.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "RU"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "ru"; }
            }
        }
        private class TurkeyRegion : Region
        {
            public override string SpectatorUrl
            {
                get { return "spectator.tr.lol.riotgames.com"; }
            }

            public override int SpectatorPort
            {
                get { return 80; }
            }

            public override string SpectatorPlatformId
            {
                get { return "TR1"; }
            }

            public override string RiotApiPlatformId
            {
                get { return "tr"; }
            }
        }
        #endregion
    }
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>de.evosec</groupId>
    <artifactId>export-dependencies-maven-plugin</artifactId>
    <version>1.0.2-SNAPSHOT</version>

    <packaging>maven-plugin</packaging>

    <name>export-dependencies-maven-plugin</name>
    <description>Maven plugin that exports dependencies for e.g. BUCK</description>
    <url>https://github.com/evosec/export-dependencies-maven-plugin</url>

    <developers>
        <developer>
            <name>Arlo O'Keeffe</name>
            <email>a.okeeffe@evosec.de</email>
            <organization>Evosec GmbH & Co. KG</organization>
            <organizationUrl>https://www.evosec.de/</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:evosec/export-dependencies-maven-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:evosec/export-dependencies-maven-plugin.git</developerConnection>
        <url>git@github.com:evosec/export-dependencies-maven-plugin.git</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <properties>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <gpg.skip>true</gpg.skip>

    </properties>

    <profiles>
        <profile>
            <activation>
                <property>
                    <name>gpg.passphrase</name>
                </property>
            </activation>
            <properties>
                <gpg.skip>false</gpg.skip>
            </properties>
        </profile>
    </profiles>

    <dependencies>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.5.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.5.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-dependency-tree</artifactId>
            <version>3.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.5</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.5</version>
                <executions>
                    <execution>
                        <id>mojo-descriptor</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>help-goal</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <debug>true</debug>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <inherited>true</inherited>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <inherited>true</inherited>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <inherited>true</inherited>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <configuration>
                    <updateReleaseInfo>true</updateReleaseInfo>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m5.1</version>
                <configuration>
                    <noDeploy>true</noDeploy>
                </configuration>
            </plugin>

        </plugins>

    </build>

</project>


text:
'use strict;';

/**
 * Augment function.
 * @param {object} body - Provided body to augment object.
 */
Function.prototype.augment = function (body) {
    var fn;
    if (typeof(body) === 'object') {
        fn = function() {
            for (var attr in body) this[attr] = body[attr];
            if (!body.hasOwnProperty('constructor')) {
                this.constructor = function() {};
            };
        };
    } else {
        fn = body;
    };
    var base = this.prototype;
    var prototype = Object.create(base);
    fn.apply(prototype, Array.from(arguments, 1).concat(base));
    if (!Object.ownPropertyOf(prototype, 'constructor')) return prototype;
    var constructor = prototype.constructor;
    constructor.prototype = prototype;
    return constructor;
};

/**
 * Register augment function.
 */
(function funct() {
    var bind = funct.bind;
    var bindable = Function.bindable = bind.bind(bind);
    var callable = Function.callable = bindable(funct.call);
    Object.ownPropertyOf = callable(funct.hasOwnProperty);
    Array.from = callable([].slice);
}());


text:
namespace Umi.Protocol
{
    export interface IProtocol
    {
        // implementations of this interface are expected to have a constructor
        // with the following argument types:
        // - Context
        State(): number;
        Close(): void;
        Open(address: string): void;
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>How to move your lecture online &ndash; in little time</title>
  <meta name="description" content="I describe my solution for online lecturing amid the COVID-19 crisisusing youtube livestreams and PINGO.">

  <link rel="stylesheet" href="/fonts/pagella/stylesheet.css" type="text/css" charset="utf-8" />
  <link rel="stylesheet" href="/fonts/epigrafica/stylesheet.css" type="text/css" charset="utf-8" />
  <link rel="stylesheet" href="/fonts/fontawesome/fontawesome-all.min.css" type="text/css" charset="utf-8" />
  <link rel="stylesheet" href="/css/main.css">
  <link rel="canonical" href="https://www.wild-inter.net/posts/youtube-livestream-lectures">
  <link rel="alternate" type="application/rss+xml" title="Sebastian Wild's Site" href="https://www.wild-inter.net/feed.xml">

    Sebastian

        <svg viewBox="0 0 18 15">
          <path fill="#46433A" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
          <path fill="#46433A" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
          <path fill="#46433A" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
        </svg>

          Research

          Teaching

          Blog

          About

		<time datetime="2020-03-17T00:00:00+00:00" itemprop="datePublished">
			17 Mar 2020
		</time>

					teaching

					web

					linux

How to move your lecture online – in little time

I describe my solution for online lecturing amid the COVID-19 crisis
using youtube livestreams and PINGO.

Although I kind of saw it coming
after reading this excellent data analysis
(on March 12, before things got really crazy),
things did get hectic:
The official decision of University of Liverpool to move all
face-to-face classes online with immediate effect came
on Saturday evening (March 14), with my class due on Monday, March 16.
So what follows is not the well-thought out, technically sophisticated
and educationally up-to-date mode of online teaching I (and you) might dream of,
but it is what allowed me to deliver an (according to isolated feedback) effective
online lecture with less than one day of prep time.

Where I started: Good old screencasts …

I have been recording screencasts of my lectures for COMP526
and posting them on youtube all term.
The methodology for that (on Ubuntu) is basically still as described
here, only with an
update of my laptop (now an HP Elitebook x360) and Xournal++.

So a reasonable mic,
screencasting software (SimpleScreenRecorder)
and a website to post videos and lecture notes were already set up.

… and in-class formative assessments (aka clicker questions)

What I also came to like as an effective tool, is an in-class
response system to quickly ask for opinions, prior knowledge,
to recap definitions, and to test understanding.
(I have been using PINGO for that.)

So my initial contingency plan was to record the lectures at home
and upload them. But what was missing, was a way to
keep the clicker questions;
and – I know how these things go first hand –
I was afraid that had there been no incentive for students to keep
on track with watching the videos, it all too easily happens that some
fall behind.

I was determined to not let that happen (quite so easily).

Going live!

My solution was to use youtube livestreams for the lectures;
how to do that is explained below.
That way, we (the students and myself that is) would be seeing the same screen
(almost – more on that later) in real time, and I could simply continue
with the clicker questions.

Youtube also has a "live chat" that offers a (limited) backchannel for
students to ask questions (which quite a few did!), signal technical problems
(none yet, luckily!), or give a quick "hands" on who is still following.

Quick how-to for youtube livestreams

(Here is youtube's detailed manual on that;
you want the "encoder streaming".)

After signing into your youtube account, click on CREATE → Go Live (top right).
There you pick "Stream" (the middle tab at the top).
I did change the defaults, except for setting the stream latency to "ultra low".
In the top right, you can get a link that you can share with students even ahead of time.

Now, to stream your screen content (or part of it), you need an encoder.
I had good experiences with SimpleScreenRecorder, and indeed you can use it for this, too.
The screenshot below shows the settings I used; what goes into the "Save as" box
is shown in the youtube stream settings as "Stream URL" and "Stream key";
the entry simply is <Stream URL>/<Stream key>.

Selecting AAC as audio codec is vital! The mp3 encoder (selected by default) does
not work with youtube, but the error messages don't tell you that.

	Settings for streaming to youtube.

Then you click Continue and simple start your recording.
The youtube stream settings site should now show your screen content (with a few seconds delay).

Clicking on "GO LIVE" (top right) starts the actual livestream.

On my (fairly new) laptop, downscaling the 4K display to 1080p and encoding
as x264 did put considerable load on the machine,
but I did not experience severe problems, so I did not try to play with the
encoder settings at all.
Your mileage may vary.

As for all youtube videos, you can configure the visibility of the stream as "unlisted",
then only students with the link can view the video, but no-one can find it through search;
"public" videos appear in searches.
If you choose "private", people have to be signed in, and I did not want to force students to do that.

Phone for backchannel

During the lecture, I kept the youtube app on my Android open to see
messages coming on the live chat.
(This is also a great way to test if your stream works.)

Aftermath

For consistency, I split the recorded livestream into individual
videos for each subsection, using the youtube studio editor, but also
keep the livestream itself (as an unlisted video).
(Pretend to trim the live stream, but then instead of "SAVE" click the
three dots and "SAVE AS NEW").
The nicely cut videos are then linked to from my course website, e.g.,
here.

Cutting videos takes a few extra minutes that I did not need
when locally recording in class, where I could easily start a new recording
with one click. But it makes the recordings much easier to navigate and
use later on.

First impressions

After using this setup for 3 hours of lectures, I am overall fairly happy.
It does not cost much more preparation for me (although a bit extra time for cutting videos)
and is clearly superior to only uploading videos.
The livestream always had well below 10s of delay, which is totally fine
for the interactive questions, and sound and video quality are excellent.

Compared to (my experiences with) video conferencing solutions
Cisco WebEx, Skype, and Microsoft Teams, the stream is clearly superior
in quality and stability, and the resulting recordings are essentially
indistinguishable from the ones I recorded in face-to-face lectures.

A clear downside of my approach is the missing instant feedback
from looking around the audience's faces. (I usually have 30-50 students
in class, so this was very doable.)
I used to look around for this instant feedback very frequently –
I'm lecturing facing the audience in the lecture rooms –
so there is no way to replace this with the same number of PINGO questions.

Ideally, I'd like to have an additional (informal, anonymous)
"quick-emotions" backchannel with buzzers for "I'm lost", "I got it",
and "I need a break" (or so) that students could continuously push
(as opposed to questions I have to trigger).
So far, I have not found a service for that.

Sebastian Wild

Contact:

sebawild at gmail ⋅
            PGP

wild at liv.ac.uk ⋅
            PGP

wild at uwaterloo.ca ⋅
            PGP

wild at cs.uni-kl.de

Website at UoL

intranet site at UoL

TCS @ Liverpool

(Old) website TU KL

Elsewhere:

GitHub profile

LinkedIn profile

ORCID: 0000-0002-6061-9177

Google Scholar profile

DBLP publication list

Semantic Scholar Author Page

arXiv Author ID

Quick links:

my publications

my library


text: Curso de git y github by platzi


text:
<?php

namespace Telegram\Bot;

use Illuminate\Contracts\Container\Container;
use Telegram\Bot\Commands\CommandBus;
use Telegram\Bot\Events\EmitsEvents;
use Telegram\Bot\Events\UpdateWasReceived;
use Telegram\Bot\Exceptions\TelegramSDKException;
use Telegram\Bot\FileUpload\InputFile;
use Telegram\Bot\HttpClients\HttpClientInterface;
use Telegram\Bot\Objects\File;
use Telegram\Bot\Objects\Message;
use Telegram\Bot\Objects\UnknownObject;
use Telegram\Bot\Objects\Update;
use Telegram\Bot\Objects\User;
use Telegram\Bot\Objects\UserProfilePhotos;
use Telegram\Bot\Keyboard\Keyboard;

/**
 * Class Api.
 *
 * @mixin Commands\CommandBus
 */
class Api
{
    use EmitsEvents;

    /**
     * @var string Version number of the Telegram Bot PHP SDK.
     */
    const VERSION = '3.0.0';

    /**
     * @var string The name of the environment variable that contains the Telegram Bot API Access Token.
     */
    const BOT_TOKEN_ENV_NAME = 'TELEGRAM_BOT_TOKEN';

    /**
     * @var TelegramClient The Telegram client service.
     */
    protected $client;

    /**
     * @var string Telegram Bot API Access Token.
     */
    protected $accessToken = null;

    /**
     * @var TelegramResponse|null Stores the last request made to Telegram Bot API.
     */
    protected $lastResponse;

    /**
     * @var bool Indicates if the request to Telegram will be asynchronous (non-blocking).
     */
    protected $isAsyncRequest = false;

    /**
     * @var CommandBus|null Telegram Command Bus.
     */
    protected $commandBus = null;

    /**
     * @var Container IoC Container
     */
    protected static $container = null;

    /**
     * Timeout of the request in seconds.
     *
     * @var int
     */
    protected $timeOut = 60;

    /**
     * Connection timeout of the request in seconds.
     *
     * @var int
     */
    protected $connectTimeOut = 10;

    /**
     * Instantiates a new Telegram super-class object.
     *
     *
     * @param string              $token                      The Telegram Bot API Access Token.
     * @param bool                $async                      (Optional) Indicates if the request to Telegram
     *                                                        will be asynchronous (non-blocking).
     * @param HttpClientInterface $httpClientHandler          (Optional) Custom HTTP Client Handler.
     *
     * @throws TelegramSDKException
     */
    public function __construct($token = null, $async = false, $httpClientHandler = null)
    {
        $this->accessToken = isset($token) ? $token : getenv(static::BOT_TOKEN_ENV_NAME);
        if (!$this->accessToken) {
            throw new TelegramSDKException('Required "token" not supplied in config and could not find fallback environment variable "'.static::BOT_TOKEN_ENV_NAME.'"');
        }

        if (isset($async)) {
            $this->setAsyncRequest($async);
        }

        $this->client = new TelegramClient($httpClientHandler);
        $this->commandBus = new CommandBus($this);
    }

    /**
     * Invoke Bots Manager.
     *
     * @param $config
     *
     * @return BotsManager
     */
    public static function manager($config)
    {
        return new BotsManager($config);
    }

    /**
     * Returns the TelegramClient service.
     *
     * @return TelegramClient
     */
    public function getClient()
    {
        return $this->client;
    }

    /**
     * Returns Telegram Bot API Access Token.
     *
     * @return string
     */
    public function getAccessToken()
    {
        return $this->accessToken;
    }

    /**
     * Returns the last response returned from API request.
     *
     * @return TelegramResponse
     */
    public function getLastResponse()
    {
        return $this->lastResponse;
    }

    /**
     * Sets the bot access token to use with API requests.
     *
     * @param string $accessToken The bot access token to save.
     *
     * @throws \InvalidArgumentException
     *
     * @return Api
     */
    public function setAccessToken($accessToken)
    {
        if (is_string($accessToken)) {
            $this->accessToken = $accessToken;

            return $this;
        }

        throw new \InvalidArgumentException('The Telegram bot access token must be of type "string"');
    }

    /**
     * Make this request asynchronous (non-blocking).
     *
     * @param bool $isAsyncRequest
     *
     * @return Api
     */
    public function setAsyncRequest($isAsyncRequest)
    {
        $this->isAsyncRequest = $isAsyncRequest;

        return $this;
    }

    /**
     * Check if this is an asynchronous request (non-blocking).
     *
     * @return bool
     */
    public function isAsyncRequest()
    {
        return $this->isAsyncRequest;
    }

    /**
     * Returns SDK's Command Bus.
     *
     * @return CommandBus
     */
    public function getCommandBus()
    {
        return $this->commandBus;
    }

    /**
     * A simple method for testing your bot's auth token.
     * Returns basic information about the bot in form of a User object.
     *
     * @link https://core.telegram.org/bots/api#getme
     *
     * @return User
     */
    public function getMe()
    {
        $response = $this->post('getMe');

        return new User($response->getDecodedBody());
    }

    /**
     * Send text messages.
     *
     *
     * $params = [
     *   'chat_id'                  => '',
     *   'text'                     => '',
     *   'parse_mode'               => '',
     *   'disable_web_page_preview' => '',
     *   'disable_notification'     => '',
     *   'reply_to_message_id'      => '',
     *   'reply_markup'             => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendmessage
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['text']
     * @var string     $params ['parse_mode']
     * @var bool       $params ['disable_web_page_preview']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendMessage(array $params)
    {
        $response = $this->post('sendMessage', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Forward messages of any kind.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'from_chat_id'         => '',
     *   'disable_notification' => '',
     *   'message_id'           => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#forwardmessage
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var int        $params ['from_chat_id']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['message_id']
     *
     * @return Message
     */
    public function forwardMessage(array $params)
    {
        $response = $this->post('forwardMessage', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Send Photos.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'photo'                => '',
     *   'caption'              => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendphoto
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['photo']
     * @var string     $params ['caption']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendPhoto(array $params)
    {
        return $this->uploadFile('sendPhoto', $params);
    }

    /**
     * Send regular audio files.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'audio'                => '',
     *   'duration'             => '',
     *   'performer'            => '',
     *   'title'                => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendaudio
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['audio']
     * @var int        $params ['duration']
     * @var string     $params ['performer']
     * @var string     $params ['title']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendAudio(array $params)
    {
        return $this->uploadFile('sendAudio', $params);
    }

    /**
     * Send general files.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'document'             => '',
     *   'caption'              => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#senddocument
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['document']
     * @var string     $params ['caption']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendDocument(array $params)
    {
        return $this->uploadFile('sendDocument', $params);
    }

    /**
     * Send .webp stickers.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'sticker'              => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendsticker
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['sticker']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @throws TelegramSDKException
     *
     * @return Message
     */
    public function sendSticker(array $params)
    {
        if (is_file($params['sticker']) && (pathinfo($params['sticker'], PATHINFO_EXTENSION) !== 'webp')) {
            throw new TelegramSDKException('Invalid Sticker Provided. Supported Format: Webp');
        }

        return $this->uploadFile('sendSticker', $params);
    }

    /**
     * Send Video File, Telegram clients support mp4 videos (other formats may be sent as Document).
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'video'                => '',
     *   'duration'             => '',
     *   'width'                => '',
     *   'height'               => '',
     *   'caption'              => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @see  sendDocument
     * @link https://core.telegram.org/bots/api#sendvideo
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['video']
     * @var int        $params ['duration']
     * @var int        $params ['width']
     * @var int        $params ['height']
     * @var string     $params ['caption']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendVideo(array $params)
    {
        return $this->uploadFile('sendVideo', $params);
    }

    /**
     * Send voice audio files.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'voice'                => '',
     *   'duration'             => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendaudio
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['voice']
     * @var int        $params ['duration']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendVoice(array $params)
    {
        return $this->uploadFile('sendVoice', $params);
    }

    /**
     * Send point on the map.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'latitude'             => '',
     *   'longitude'            => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendlocation
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var float      $params ['latitude']
     * @var float      $params ['longitude']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendLocation(array $params)
    {
        $response = $this->post('sendLocation', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Send information about a venue.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'latitude'             => '',
     *   'longitude'            => '',
     *   'title'                => '',
     *   'address'              => '',
     *   'foursquare_id'        => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendvenue
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var float      $params ['latitude']
     * @var float      $params ['longitude']
     * @var string     $params ['title']
     * @var string     $params ['address']
     * @var string     $params ['foursquare_id']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendVenue(array $params)
    {
        $response = $this->post('sendVenue', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Send phone contacts.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'phone_number'         => '',
     *   'first_name'           => '',
     *   'last_name'            => '',
     *   'disable_notification' => '',
     *   'reply_to_message_id'  => '',
     *   'reply_markup'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendcontact
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['phone_number']
     * @var string     $params ['first_name']
     * @var string     $params ['last_name']
     * @var bool       $params ['disable_notification']
     * @var int        $params ['reply_to_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return Message
     */
    public function sendContact(array $params)
    {
        $response = $this->post('sendContact', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Broadcast a Chat Action.
     *
     *
     * $params = [
     *   'chat_id' => '',
     *   'action'  => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#sendchataction
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var string     $params ['action']
     *
     * @throws TelegramSDKException
     *
     * @return TelegramResponse
     */
    public function sendChatAction(array $params)
    {
        $validActions = [
            'typing',
            'upload_photo',
            'record_video',
            'upload_video',
            'record_audio',
            'upload_audio',
            'upload_document',
            'find_location',
        ];

        if (isset($params['action']) && in_array($params['action'], $validActions)) {
            return $this->post('sendChatAction', $params);
        }

        throw new TelegramSDKException('Invalid Action! Accepted value: '.implode(', ', $validActions));
    }

    /**
     * Returns a list of profile pictures for a user.
     *
     *
     * $params = [
     *   'user_id' => '',
     *   'offset'  => '',
     *   'limit'   => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#getuserprofilephotos
     *
     * @param array $params
     *
     * @var int     $params ['user_id']
     * @var int     $params ['offset']
     * @var int     $params ['limit']
     *
     * @return UserProfilePhotos
     */
    public function getUserProfilePhotos(array $params)
    {
        $response = $this->post('getUserProfilePhotos', $params);

        return new UserProfilePhotos($response->getDecodedBody());
    }

    /**
     * Returns basic info about a file and prepare it for downloading.
     *
     *
     * $params = [
     *   'file_id' => '',
     * ];
     *
     *
     * The file can then be downloaded via the link
     * https://api.telegram.org/file/bot<token>/<file_path>,
     * where <file_path> is taken from the response.
     *
     * @link https://core.telegram.org/bots/api#getFile
     *
     * @param array $params
     *
     * @var string  $params ['file_id']
     *
     * @return File
     */
    public function getFile(array $params)
    {
        $response = $this->post('getFile', $params);

        return new File($response->getDecodedBody());
    }

    /**
     * Kick a user from a group or a supergroup.
     *
     * In the case of supergroups, the user will not be able to return to the group on their own using
     * invite links etc., unless unbanned first.
     *
     * The bot must be an administrator in the group for this to work.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'user_id'              => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#kickchatmember
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var int        $params ['user_id']
     *
     * @return TelegramResponse
     */
    public function kickChatMember(array $params)
    {
        return $this->post('kickChatMember', $params);
    }

    /**
     * Unban a previously kicked user in a supergroup.
     *
     * The user will not return to the group automatically, but will be able to join via link, etc.
     *
     * The bot must be an administrator in the group for this to work.
     *
     *
     * $params = [
     *   'chat_id'              => '',
     *   'user_id'              => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#unbanchatmember
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var int        $params ['user_id']
     *
     * @return TelegramResponse
     */
    public function unbanChatMember(array $params)
    {
        return $this->post('unbanChatMember', $params);
    }

    /**
     * Send answers to callback queries sent from inline keyboards.
     *
     * he answer will be displayed to the user as a notification at the top of the chat screen or as an alert.
     *
     *
     * $params = [
     *   'callback_query_id'  => '',
     *   'text'               => '',
     *   'show_alert'         => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#answerCallbackQuery
     *
     * @param array $params
     *
     * @var string  $params ['callback_query_id']
     * @var string  $params ['text']
     * @var bool    $params ['show_alert']
     *
     * @return TelegramResponse
     */
    public function answerCallbackQuery(array $params)
    {
        return $this->post('answerCallbackQuery', $params);
    }

    /**
     * Edit text messages sent by the bot or via the bot (for inline bots).
     *
     *
     * $params = [
     *   'chat_id'                  => '',
     *   'message_id'               => '',
     *   'inline_message_id'        => '',
     *   'text'                     => '',
     *   'parse_mode'               => '',
     *   'disable_web_page_preview' => '',
     *   'reply_markup'             => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#editMessageText
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var int        $params ['message_id']
     * @var string     $params ['inline_message_id']
     * @var string     $params ['text']
     * @var string     $params ['parse_mode']
     * @var bool       $params ['disable_web_page_preview']
     * @var string     $params ['reply_markup']
     *
     * @return TelegramResponse
     */
    public function editMessageText(array $params)
    {
        $response = $this->post('editMessageText', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Edit captions of messages sent by the bot or via the bot (for inline bots).
     *
     *
     * $params = [
     *   'chat_id'                  => '',
     *   'message_id'               => '',
     *   'inline_message_id'        => '',
     *   'caption'                  => '',
     *   'reply_markup'             => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#editMessageCaption
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var int        $params ['message_id']
     * @var string     $params ['inline_message_id']
     * @var string     $params ['caption']
     * @var string     $params ['reply_markup']
     *
     * @return TelegramResponse
     */
    public function editMessageCaption(array $params)
    {
        $response = $this->post('editMessageCaption', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Edit only the reply markup of messages sent by the bot or via the bot (for inline bots).
     *
     *
     * $params = [
     *   'chat_id'                  => '',
     *   'message_id'               => '',
     *   'inline_message_id'        => '',
     *   'reply_markup'             => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#editMessageReplyMarkup
     *
     * @param array    $params
     *
     * @var int|string $params ['chat_id']
     * @var int        $params ['message_id']
     * @var string     $params ['inline_message_id']
     * @var string     $params ['reply_markup']
     *
     * @return TelegramResponse
     */
    public function editMessageReplyMarkup(array $params)
    {
        $response = $this->post('editMessageReplyMarkup', $params);

        return new Message($response->getDecodedBody());
    }

    /**
     * Use this method to send answers to an inline query.
     *
     *
     * $params = [
     *   'inline_query_id'      => '',
     *   'results'              => [],
     *   'cache_time'           => 0,
     *   'is_personal'          => false,
     *   'next_offset'          => '',
     *   'switch_pm_text'       => '',
     *   'switch_pm_parameter'  => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#answerinlinequery
     *
     * @param array     $params
     *
     * @var string      $params ['inline_query_id']
     * @var array       $params ['results']
     * @var int|null    $params ['cache_time']
     * @var bool|null   $params ['is_personal']
     * @var string|null $params ['next_offset']
     * @var string|null $params ['switch_pm_text']
     * @var string|null $params ['switch_pm_parameter']
     *
     * @return bool
     */
    public function answerInlineQuery(array $params = [])
    {
        if (is_array($params['results'])) {
            $params['results'] = json_encode($params['results']);
        }

        return $this->post('answerInlineQuery', $params);
    }

    /**
     * Set a Webhook to receive incoming updates via an outgoing webhook.
     *
     *
     * $params = [
     *   'url'         => '',
     *   'certificate' => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#setwebhook
     *
     * @param array $params
     *
     * @var string  $params ['url']         HTTPS url to send updates to.
     * @var string  $params ['certificate'] Upload your public key certificate so that the root certificate in
     *                                      use can be checked.
     *
     * @throws TelegramSDKException
     *
     * @return TelegramResponse
     */
    public function setWebhook(array $params)
    {
        if (filter_var($params['url'], FILTER_VALIDATE_URL) === false) {
            throw new TelegramSDKException('Invalid URL Provided');
        }

        if (parse_url($params['url'], PHP_URL_SCHEME) !== 'https') {
            throw new TelegramSDKException('Invalid URL, should be a HTTPS url.');
        }

        return $this->uploadFile('setWebhook', $params);
    }

    /**
     * Returns webhook updates sent by Telegram.
     * Works only if you set a webhook.
     *
     * @see setWebhook
     *
     * @return Update
     */
    public function getWebhookUpdates($emitUpdateWasReceivedEvent = true)
    {
        $body = json_decode(file_get_contents('php://input'), true);

        $update = new Update($body);

        if ($emitUpdateWasReceivedEvent) {
            $this->emitEvent(new UpdateWasReceived($update, $this));
        }

        return $update;
    }

    /**
     * Removes the outgoing webhook (if any).
     *
     * @return TelegramResponse
     */
    public function removeWebhook()
    {
        $url = '';

        return $this->post('setWebhook', compact('url'));
    }

    /**
     * Use this method to receive incoming updates using long polling.
     *
     *
     * $params = [
     *   'offset'  => '',
     *   'limit'   => '',
     *   'timeout' => '',
     * ];
     *
     *
     * @link https://core.telegram.org/bots/api#getupdates
     *
     * @param array  $params
     * @param bool  $emitUpdateWasReceivedEvents
     * @var int|null $params ['offset']
     * @var int|null $params ['limit']
     * @var int|null $params ['timeout']
     *
     * @return Update[]
     */
    public function getUpdates(array $params = [], $emitUpdateWasReceivedEvents = true)
    {
        $response = $this->post('getUpdates', $params);
        $updates = $response->getDecodedBody();

        /** @var Update[] $data */
        $data = [];
        if (isset($updates['result'])) {
            foreach ($updates['result'] as $body) {
                $update = new Update($body);

                if ($emitUpdateWasReceivedEvents) {
                    $this->emitEvent(new UpdateWasReceived($update, $this));
                }

                $data[] = $update;
            }
        }

        return $data;
    }

    /**
     * Builds a custom keyboard markup.
     *
     *
     * $params = [
     *   'keyboard'          => '',
     *   'resize_keyboard'   => '',
     *   'one_time_keyboard' => '',
     *   'selective'         => '',
     * ];
     *
     *
     * @deprecated Use Telegram\Bot\Keyboard\Keyboard::make(array $params = []) instead.
     *             To be removed in next major version.
     *
     * @link       https://core.telegram.org/bots/api#replykeyboardmarkup
     *
     * @param array $params
     *
     * @var array   $params ['keyboard']
     * @var bool    $params ['resize_keyboard']
     * @var bool    $params ['one_time_keyboard']
     * @var bool    $params ['selective']
     *
     * @return string
     */
    public function replyKeyboardMarkup(array $params)
    {
        return Keyboard::make($params);
    }

    /**
     * Hide the current custom keyboard and display the default letter-keyboard.
     *
     *
     * $params = [
     *   'hide_keyboard' => true,
     *   'selective'     => false,
     * ];
     *
     *
     * @deprecated Use Telegram\Bot\Keyboard\Keyboard::hide(array $params = []) instead.
     *             To be removed in next major version.
     *
     * @link       https://core.telegram.org/bots/api#replykeyboardhide
     *
     * @param array $params
     *
     * @var bool    $params ['hide_keyboard']
     * @var bool    $params ['selective']
     *
     * @return string
     */
    public static function replyKeyboardHide(array $params = [])
    {
        return Keyboard::hide($params);
    }

    /**
     * Display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply').
     *
     *
     * $params = [
     *   'force_reply' => true,
     *   'selective'   => false,
     * ];
     *
     *
     * @deprecated Use Telegram\Bot\Keyboard\Keyboard::forceReply(array $params = []) instead.
     *             To be removed in next major version.
     *
     * @link       https://core.telegram.org/bots/api#forcereply
     *
     * @param array $params
     *
     * @var bool    $params ['force_reply']
     * @var bool    $params ['selective']
     *
     * @return string
     */
    public static function forceReply(array $params = [])
    {
        return Keyboard::forceReply($params);
    }

    /**
     * Processes Inbound Commands.
     *
     * @param bool $webhook
     *
     * @return Update|Update[]
     */
    public function commandsHandler($webhook = false)
    {
        if ($webhook) {
            $update = $this->getWebhookUpdates();
            $this->processCommand($update);

            return $update;
        }

        $updates = $this->getUpdates();
        $highestId = -1;

        foreach ($updates as $update) {
            $highestId = $update->getUpdateId();
            $this->processCommand($update);
        }

        //An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id.
        if ($highestId != -1) {
            $params = [];
            $params['offset'] = $highestId + 1;
            $params['limit'] = 1;
            $this->getUpdates($params);
        }

        return $updates;
    }

    /**
     * Check update object for a command and process.
     *
     * @param Update $update
     */
    public function processCommand(Update $update)
    {
        $message = $update->getMessage();

        if ($message !== null && $message->has('text')) {
            $this->getCommandBus()->handler($message->getText(), $update);
        }
    }

    /**
     * Helper to Trigger Commands.
     *
     * @param string $name   Command Name
     * @param Update $update Update Object
     *
     * @return mixed
     */
    public function triggerCommand($name, Update $update)
    {
        return $this->getCommandBus()->execute($name, $update->getMessage()->getText(), $update);
    }

    /**
     * Determine if a given type is the message.
     *
     * @deprecated Call method isType directly on Message object
     *             To be removed in next major version.
     *
     * @param string         $type
     * @param Update|Message $object
     *
     * @throws \InvalidArgumentException
     *
     * @return bool
     */
    public function isMessageType($type, $object)
    {
        if ($object === null) {
            return null;
        }

        if ($object instanceof Update) {
            if ($object->has('message')) {
                $object = $object->getMessage();
            }else{
                throw new \InvalidArgumentException('The object must be or contain a message');
            }
        }

        return $object->isType($type);
    }

    /**
     * Detect Message Type Based on Update or Message Object.
     *
     * @deprecated Call method detectType directly on Message object
     *             To be removed in next major version.
     *
     * @param Update|Message $object
     *
     * @throws \InvalidArgumentException
     *
     * @return string|null
     */
    public function detectMessageType($object)
    {
        if ($object === null) {
            return null;
        }

        if ($object instanceof Update) {
            if ($object->has('message')) {
                $object = $object->getMessage();
            } else {
                throw new \InvalidArgumentException('The object must be or contain a message');
            }
        }

        return $object->detectType();
    }

    /**
     * Sends a GET request to Telegram Bot API and returns the result.
     *
     * @param string $endpoint
     * @param array  $params
     *
     * @throws TelegramSDKException
     *
     * @return TelegramResponse
     */
    protected function get($endpoint, $params = [])
    {
        if (array_key_exists('reply_markup', $params)) {
            $params['reply_markup'] = (string)$params['reply_markup'];
        }

        return $this->sendRequest(
            'GET',
            $endpoint,
            $params
        );
    }

    /**
     * Sends a POST request to Telegram Bot API and returns the result.
     *
     * @param string $endpoint
     * @param array  $params
     * @param bool   $fileUpload Set true if a file is being uploaded.
     *
     * @return TelegramResponse
     */
    protected function post($endpoint, array $params = [], $fileUpload = false)
    {
        if ($fileUpload) {
            $params = ['multipart' => $params];
        } else {

            if (array_key_exists('reply_markup', $params)) {
                $params['reply_markup'] = (string)$params['reply_markup'];
            }

            $params = ['form_params' => $params];
        }

        return $this->sendRequest(
            'POST',
            $endpoint,
            $params
        );
    }

    /**
     * Sends a multipart/form-data request to Telegram Bot API and returns the result.
     * Used primarily for file uploads.
     *
     * @param string $endpoint
     * @param array  $params
     *
     * @throws TelegramSDKException
     *
     * @return Message
     */
    protected function uploadFile($endpoint, array $params = [])
    {
        $i = 0;
        $multipart_params = [];
        foreach ($params as $name => $contents) {
            if (is_null($contents)) {
                continue;
            }

            if (!is_resource($contents) && $name !== 'url') {
                $validUrl = filter_var($contents, FILTER_VALIDATE_URL);
                $contents = (is_file($contents) || $validUrl) ? (new InputFile($contents))->open() : (string)$contents;
            }

            $multipart_params[$i]['name'] = $name;
            $multipart_params[$i]['contents'] = $contents;
            ++$i;
        }

        $response = $this->post($endpoint, $multipart_params, true);

        return new Message($response->getDecodedBody());
    }

    /**
     * Sends a request to Telegram Bot API and returns the result.
     *
     * @param string $method
     * @param string $endpoint
     * @param array  $params
     *
     * @throws TelegramSDKException
     *
     * @return TelegramResponse
     */
    protected function sendRequest(
        $method,
        $endpoint,
        array $params = []
    ) {
        $request = $this->request($method, $endpoint, $params);

        return $this->lastResponse = $this->client->sendRequest($request);
    }

    /**
     * Instantiates a new TelegramRequest entity.
     *
     * @param string $method
     * @param string $endpoint
     * @param array  $params
     *
     * @return TelegramRequest
     */
    protected function request(
        $method,
        $endpoint,
        array $params = []
    ) {
        return new TelegramRequest(
            $this->getAccessToken(),
            $method,
            $endpoint,
            $params,
            $this->isAsyncRequest(),
            $this->getTimeOut(),
            $this->getConnectTimeOut()
        );
    }

    /**
     * Magic method to process any "get" requests.
     *
     * @param $method
     * @param $arguments
     *
     * @return bool|TelegramResponse|UnknownObject
     */
    public function __call($method, $arguments)
    {
        if (preg_match('/^\w+Commands?/', $method, $matches)) {
            return call_user_func_array([$this->getCommandBus(), $matches[0]], $arguments);
        }

        $action = substr($method, 0, 3);
        if ($action === 'get') {
            /* @noinspection PhpUndefinedFunctionInspection */
            $class_name = studly_case(substr($method, 3));
            $class = 'Telegram\Bot\Objects\\'.$class_name;
            $response = $this->post($method, $arguments[0] ?: []);

            if (class_exists($class)) {
                return new $class($response->getDecodedBody());
            }

            return $response;
        }
        $response = $this->post($method, $arguments[0]);

        return new UnknownObject($response->getDecodedBody());
    }

    /**
     * Set the IoC Container.
     *
     * @param $container Container instance
     *
     * @return void
     */
    public static function setContainer(Container $container)
    {
        self::$container = $container;
    }

    /**
     * Get the IoC Container.
     *
     * @return Container
     */
    public function getContainer()
    {
        return self::$container;
    }

    /**
     * Check if IoC Container has been set.
     *
     * @return boolean
     */
    public function hasContainer()
    {
        return self::$container !== null;
    }

    /**
     * @return int
     */
    public function getTimeOut()
    {
        return $this->timeOut;
    }

    /**
     * @param int $timeOut
     *
     * @return $this
     */
    public function setTimeOut($timeOut)
    {
        $this->timeOut = $timeOut;

        return $this;
    }

    /**
     * @return int
     */
    public function getConnectTimeOut()
    {
        return $this->connectTimeOut;
    }

    /**
     * @param int $connectTimeOut
     *
     * @return $this
     */
    public function setConnectTimeOut($connectTimeOut)
    {
        $this->connectTimeOut = $connectTimeOut;

        return $this;
    }
}


text:
/* create database swm */
CREATE DATABASE `swm`CHARACTER SET utf8 COLLATE utf8_bin;

/* create table t_user */
CREATE TABLE `swm`.`t_user`( `id` INT(32) NOT NULL AUTO_INCREMENT, `username` VARCHAR(32), PRIMARY KEY (`id`) );

INSERT INTO `swm`.`t_user` (`id`, `username`) VALUES ('1', 'yang');
INSERT INTO `swm`.`t_user` (`id`, `username`) VALUES ('2', 'liu');


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Coccocarpia azurella Nyl.

### Remarks
null


text:
package com.trimc.blogger.jaxrs.mongo;

import static org.junit.Assert.assertNotNull;

import java.net.Socket;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.trimc.blogger.jaxrs.mongo.util.AppConfig;
import com.trimc.blogger.jaxrs.mongo.util.SpringMongoConfig;

public final class SystemUp {

	public static boolean check() throws Throwable {

		return serverListening(getConfig().getHost(), getConfig().getPort());
	}

	public static AppConfig getConfig() throws Throwable {
		ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringMongoConfig.class);
		assertNotNull(ctx);

		AppConfig appConfig = (AppConfig) ctx.getBean("appConfig");
		assertNotNull(appConfig);

		return appConfig;
	}

	/* dc:url <http://www.geekality.net/2013/04/30/java-simple-check-to-see-if-a-server-is-listening-on-a-port/> */
	private static boolean serverListening(String host, int port) {
		Socket s = null;
		try {
			s = new Socket(host, port);
			return true;
		} catch (Exception e) {
			return false;
		} finally {
			if (s != null) try {
				s.close();
			} catch (Exception e) {}
		}
	}
}


text:
namespace TelerikAcademy.Data
{
    using System;

    public partial class CustOrdersOrders_Result
    {
        public int OrderID { get; set; }
        public Nullable<System.DateTime> OrderDate { get; set; }
        public Nullable<System.DateTime> RequiredDate { get; set; }
        public Nullable<System.DateTime> ShippedDate { get; set; }
    }
}


text:
require 'rails_helper'

describe RevisionFeedbackController do
  describe '#index' do
    let!(:course) { create(:course, id: 1) }
    let(:assignment) { create(:assignment, id: 1, course_id: course.id) }
    let(:params) { { 'title': 'Quantum_Chemistry', 'assignment_id': assignment.id } }

    context 'When the article exists' do
      before do
        VCR.use_cassette 'ores_features' do
          get :index, params: params
        end
      end

      it 'renders without error' do
        expect(response.status).to eq(200)
      end

      it 'calls RevisionFeedbackService with features' do
        VCR.use_cassette 'ores_features' do
          # Checks if the RevisionFeedbackService is initialized with valid features
          expect_any_instance_of(RevisionFeedbackService).to receive(:initialize)
            .with(have_key('feature.enwiki.revision.cite_templates'))

          # Checks if a valid feedback is received from RevisionFeedbackService
          expect_any_instance_of(RevisionFeedbackService).to receive(:feedback)
            .and_return(have_at_least(1))
          get :index, params: params
        end
      end

      it 'assigns valid feedback' do
        feedback = assigns(:feedback)
        expect(feedback.length).to be >= 1
      end
    end
  end
end


text:
/**
 * \page asfdoc_sam0_system_interrupt_critsec_use_case Quick Start Guide for SYSTEM INTERRUPT - Critical Section Use Case
 *
 * In this case we perform a critical piece of code, disabling all interrupts
 * while a global shared flag is read. During the critical section, no interrupts
 * may occur.
 *
 * \section asfdoc_sam0_system_interrupt_critsec_use_case_setup Setup
 *
 * \subsection asfdoc_sam0_system_interrupt_critsec_use_case_setup_prereq Prerequisites
 * There are no special setup requirements for this use-case.
 *
 * \section asfdoc_sam0_system_interrupt_critsec_use_case_use_main Use Case
 *
 * \subsection asfdoc_sam0_system_interrupt_critsec_use_case_code Code
 * Copy-paste the following code to your user application:
 * \snippet qs_system_interrupt.c main_1
 *
 * \subsection asfdoc_sam0_system_interrupt_critsec_use_case_flow Workflow
 * -# Enter a critical section to disable global interrupts.
 *    \snippet qs_system_interrupt.c critical_section_start
 *    \note Critical sections may be nested if desired; if nested, global
 *          interrupts will only be re-enabled once the outer-most critical
 *          section has completed.
 *
 * -# Check a global shared flag and perform a response. This code may be any
 *    critical code that requires exclusive access to all resources without the
 *    possibility of interruption.
 *    \snippet qs_system_interrupt.c do_critical_code
 *
 * -# Exit the critical section to re-enable global interrupts.
 *    \snippet qs_system_interrupt.c critical_section_end
 */

/**
 * \page asfdoc_sam0_system_interrupt_enablemodint_use_case Quick Start Guide for SYSTEM INTERRUPT - Enable Module Interrupt Use Case
 *
 * In this case we enable interrupt handling for a specific module, as well as
 * enable interrupts globally for the device.
 *
 * \section asfdoc_sam0_system_interrupt_enablemodint_use_case_setup Setup
 *
 * \subsection asfdoc_sam0_system_interrupt_enablemodint_use_case_setup_prereq Prerequisites
 * There are no special setup requirements for this use-case.
 *
 * \section asfdoc_sam0_system_interrupt_enablemodint_use_case_use_main Use Case
 *
 * \subsection asfdoc_sam0_system_interrupt_enablemodint_use_case_code Code
 * Copy-paste the following code to your user application:
 * \snippet qs_system_interrupt.c main_2
 *
 * \subsection asfdoc_sam0_system_interrupt_enablemodint_use_case_flow Workflow
 * -# Enable interrupt handling for the device's RTC peripheral.
 *    \snippet qs_system_interrupt.c module_int_enable
 *
 * -# Enable global interrupts, so that any enabled and active interrupt sources
 *    can trigger their respective handler functions.
 *    \snippet qs_system_interrupt.c global_int_enable
 */
 /**
 * Support and FAQ: visit Atmel Support
 */


text:
<?php
/**
 * Created by PhpStorm.
 * User: nemo <335454250@qq.com>
 * Date: 9/17/15
 * Time: 20:19
 */

namespace Analytics\Service;

class AnalyticsService {

    public function get_date_range_by_input() {}

}


text:
var API_BASE='/autotrader';

var model = {};

require(["dojo/_base/declare", "dmodel/Model","dojo/topic" ], function(declare, Model, topic) {

    model.Currency = declare(Model, {
	schema: {
	    id: 'number',
	    code: 'string',
	    tickers: 'object',
	}
    });

    model.Market = declare(Model, {
	schema: {
	    id: 'number',
	    left: 'number',
	    right: 'number',
	    buy_prices: 'object',
	    sell_prices: 'object',
	    executions: 'object',
	    enabled: 'boolean',
	    orders: 'object',
	},
    });

    model.Order = declare(Model, {
	schema: {
	    id: 'number',
	    market: 'number',
	    trade: 'number',
	    side: 'string',
	    price: 'number',
	    quantity: 'number',
	    original_quantity: 'number',
	    state: 'string',
	    created: 'string',
	    ended: 'string',
	    external_id: 'number'
	}
    });

    model.Ticker = declare(Model, {
	schema: {
	    id: 'number',
	    usd_rate: 'number',
	    currency: 'string',
	}
    });

    model.Trade = declare(Model, {
	schema: {
	    id: 'number',
	    trade_type: 'string',
	    state: 'string',
	    strategy: 'number',
	    orders: 'object',
	}
    });

    model.Wallet = declare(Model, {
	schema: {
	    id: 'number',
	    available: 'number',
	    total: 'number',
	    reserved: 'number',
	    currency: 'number',
	    account: 'number',
	}
    });

    model.Strategy = declare(Model, {
	schema: {
	    id: 'number',
	    market: 'number',
	    name: 'string',
	    order: 'number',
	    enabled: 'boolean',
	    details: 'object',
	    trades: 'object',
	}
    });

    topic.publish("autotrader/model/ready");

});

var store = {};
require([ "dstore/Rest", "dojo/topic" ], function(Rest,topic) {
    newRest = function(base_url,pk, model) {
	var restDef = {
	    idProperty: pk,
	    target: base_url,
	    parse: function(raw_data) {
		return JSON.parse(raw_data);
	    }
	};
	if (model == undefined) {
	    return new Rest(restDef);
	} else {
	    restDef.Model = model;
	    return new Rest(restDef);
	}
    };

    store.Currency = newRest(API_BASE+'/currency', 'id', model.Currency);
    store.Market = newRest(API_BASE+'/market', 'id', model.Market);
    store.Order = newRest(API_BASE+'/order', 'id', model.Order);
    store.Ticker = newRest(API_BASE+'/ticker', 'id', model.Ticker);
    store.Trade = newRest(API_BASE+'/trade', 'id', model.Trade);
    store.Wallet = newRest(API_BASE+'/wallet', 'id', model.Wallet);
    store.Strategy = newRest(API_BASE+'/strategy','id',model.Strategy);

    topic.publish("autotrader/store/ready");
});

require([ "dojo/request/notify", "dojo/cookie" ], function(notify, Cookie) {
    notify("send", function(response, cancel) {
	response.xhr.setRequestHeader('X-CSRFToken', Cookie("csrftoken"));
    });
});


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Enum2862688501.h"
#include "UnityEngine_UnityEngine_AssetBundleCreateRequest_Co561206607.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// UnityEngine.AssetBundleCreateRequest/CompatibilityCheck
struct  CompatibilityCheck_t561206607
{
public:
	// System.Int32 UnityEngine.AssetBundleCreateRequest/CompatibilityCheck::value__
	int32_t ___value___1;

public:
	inline static int32_t get_offset_of_value___1() { return static_cast<int32_t>(offsetof(CompatibilityCheck_t561206607, ___value___1)); }
	inline int32_t get_value___1() const { return ___value___1; }
	inline int32_t* get_address_of_value___1() { return &___value___1; }
	inline void set_value___1(int32_t value)
	{
		___value___1 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
using CocosSharp;
using System;

namespace tests
{
    public class Effect1 : EffectAdvanceTextLayer
    {
        public override void OnEnter()
        {
            base.OnEnter();

            Window.IsUseDepthTesting = true;

            CCRect visibleBounds = VisibleBoundsWorldspace;

            // To reuse a grid the grid size and the grid type must be the same.
            // in this case:
            //     Lens3D is Grid3D and it's size is (15,10)
            //     Waves3D is Grid3D and it's size is (15,10)

            var lens = new CCLens3D(3.0f, new CCGridSize(15, 10), bgNode.ContentSize.Center, 200);
			var waves = new CCWaves3D(10, new CCGridSize(15, 10), 18, 30);

			var reuse = new CCReuseGrid(1);
			var delay = new CCDelayTime (8);

            bgNode.AnchorPoint = CCPoint.AnchorMiddle;
            var orbit = new CCOrbitCamera(5, 30.0f, 2, 20, 180, 0, -90);
			var orbit_back = orbit.Reverse();

			bgNode.RepeatForever(orbit, orbit_back);
			bgNode.RunActions(lens, delay, reuse, waves);
        }

        public override void OnExit()
        {
            base.OnExit();
        }

		public override string Title
		{
			get
			{
				return "Lens + Waves3d and OrbitCamera";
			}
		}
    }
}