text:
The gold standard is composed by a set of 5 short videos from the [BBC One Minute World News Website ](http://www.bbc.com/news/video_and_audio/) which have been annotated with a list of Named Entities that illustrate the different facts depicted in them. Each named entity has an associated score normalized from _-1_ to _1_ in order to indicate its importance of that entity inside the whole context of the video.

+ Entities and scores per video are available in folder [data](https://github.com/jluisred/NewsEntities/tree/master/data)
+ Metodology is explained in Section [Metodology](https://github.com/jluisred/NewsEntities#methodology-for-groundtruth-generation) below
+ [Videos](https://github.com/jluisred/NewsEntities/tree/master/videos) and [transcripts](https://github.com/jluisred/NewsEntities/tree/master/transcripts) are included in corresponding folders.
+ You can read our [paper](https://github.com/jluisred/NewsEntities/tree/master/papers/icwe2015) in how to automatically recreate those entities by relying on a Web document expansion approach.
+ Gold Standard data is also shown [below](https://github.com/jluisred/NewsEntities#gold-standard-data).

# Methodology for GroundTruth Generation

We selected 5 short videos from the [BBC One Minute World News Website ](http://www.bbc.com/news/video_and_audio/). Each video lasted from 1 to 3 minutes. The selection covered a wide range of subjects specifically: politics, armed conflicts, environmental events, legal disputes, and social news. The intention behind this topic choice was to fit international audiences, since we planned to perform a user study with international participants.
Subtitles of the videos were not available; therefore, a member of the team manually transcribed the speech in the videos.  After obtaining the transcriptions, the following steps were performed in order to obtain a set of unbiased candidate entities. We chose to focus only on entities of the types person, organisation and location because they can directly translate or answer three questions: Who is involved? What happened? Where did it take place? These questions are a subset taken from a well known concept in journalism known as the 5Ws (_who_, _what_, _when_, _where_ and _why_), which emphasizes the fundamental dimensions that an informative journalistic text should report on. Regarding the questions _when_ and _why_, there where discarded because in order to acquire meaningfulness they need to be modeled not only by single entities but also by more complex relations between them that are out of the scope of the current paper.

## Subtitles
All entities of the type person, organisation and location were manually extracted from each one of the video subtitles and added to the unfiltered list of entities (candidate set).

## Image in the video
The video image was visually analysed by a researcher and every time a recognisable person, organisation or location was portrayed this was also added as an entity to the candidate set.

## Text in the video image
The video was analysed for text appearing in the image. Whenever text appeared in the video image, for example in the form of nametag overlays, the named entities appearing in such tags were added to the candidate set.

## Related entities
In order to complement the candidate set with entities that might be interesting for the user, but are not necessarily found in the videos, we used the following two strategies:

## Suggestions of an expert
We collaborated with a journalist with more than 6 years of experience as a writer/editor for important American newspapers and websites.  We configured an online survey to retrieve the expert's feedback. In the survey we explained what named entities are and which types of named entities we needed. After this introduction we presented the videos to the expert. Following each one we asked him to list the named entities that, according to his criteria, would better serve the objective of showing interesting additional information to the users. The expert didn't have access to the candidate set, and was completely free to suggest any named entity he wanted.

## Related articles
We used Google custom search to look for articles related to the video in three news sources: The Guardian, New York Times, and Al Jazeera online (English). We performed this search using the main terms in the videos' title, for example, for _Fugitive Edward Snowden applies for asylum in Russia_ we searched for  _Edward_ + _Snowden_ + _asylum_ + _Russia_. We limited the results to + - 3 days from the day when the video was published. We chose one document from each source, the one closest in topic and time to the video. We then extracted all named entities of the types person, organisation and location from the resulting documents. In order to keep the entities within a reasonable number for inclusion in a survey, we kept only the named entities that appeared in at least 2 related articles and dropped all the ones that only appeared in one.  The selected entities were added to the candidate set.

## Refining the candidate set
We refined the candidate set  comprised of all found entities by eliminating all duplicated named entities and standardising names. For example, when we had ``Barack Obama'' as an entity and ``Obama'' as another entity we eliminated the shorter one and left the complete name.

A total of 99 entities were obtained from all videos. For a distribution of entities among types and videos please see next Table :

Newscast Title  | Date  | Person  | Organization  | Location  | Total
------------- | ------------- | ------------- | ------------- | ------------- | -------------
Fugitive Edward Snowden applies for asylum in Russia  | 2013-07-03  | 11  | 7  | 10  | 28
Egypt's Morsi Vows to Stay in Power | 2013-07-23  | 4  | 5  | 4  | 17
Fukushima leak causes Japan concern | 2013-07-24  | 7  | 5  | 5  | 13
Rallies in US after Zimmerman Verdict | 2013-07-17  | 9  | 2  | 8  | 19
Royal Baby Prince Named George  | 2013-07-15  | 15  | 2  | 6  | 22
Total  |    | 46  | 20  | 33  | 99

## Online Survey
We created an online survey with the aim of gathering information about the degree of interestingness of the entities in the candidate set. Based in \cite{vonBrzeski:2007:LCU:1321440.1321537} we define interestingness as to whether an entity is interesting, useful or compelling enough to tear the user away from the main thread of the document.

Fifty international subjects participated in this online study. They responded an online call distributed via email and social networks. Their age range was between 25 and 54 years with an average age of 30.3 (standard deviation 7.3 years). 18 participants were female and 32 were male. Most of the participants were highly educated and 48 of them had either a university bachelor degree or a postgraduate degree. The main requisite for participation was that they were interested in the news and followed the news regularly, preferably through means that include newscasts.
During the interview participants were asked to choose at least 3 out of 5 videos according to their preferences. Then they were shown each one of the videos. After each video, they were asked to rate whether they would be interested in receiving more information about the named entities in the context of the news video and on a second screen or similar application. All the named entities from the candidate set related to the last seen video were shown in a list with ratio buttons arranged in a similar way to a three-point Likert-scale. The possible answers were _Yes_ _Maybe_ and _No_.

## Further details on the online survey

The number of respondents per video were: _Snowden_ 49, _Morsi_ 34, _Fukushima_ 42, _Zimmerman_ 27, and _Royal baby_ 15.

In order to calculate the interestingness scores from the users' responses, we gave every answer a numerical value: _Yes_ = 1, _Maybe_ = 0 and _No_ = -1.  We then obtained an average score for each entity using the number of participants that rated an entity and the score that each participant gave to that particular entity.  This average was used to obtain a ranking of all the entities in the candidate set according to user preferences.

With the objective of finding out users preferences regarding the three analysed entity types: _person_, _organization_ and _location_, we calculated an average rating for each one of the entity types. The results in descending order were: organisation = -0,05, person = -0,24  and location = -0,52. These results clearly show a preference from users for the entities of the type organisation and person over those of the type location.
\end{document}

# Gold Standard Data

Here the different entities that compose the

## Video 1: Fugitive Edward Snowden applies for asylum in Russia
Entity Label  | Score
------------- | -------------
Edward Snowden | 0.5555556
National Security Agency | 0.3777778
Central Intelligence Agency | 0.0666667
Glenn Greenwald | 0.0666667
Foreign Intelligence Surveillance Court | 0
Booz Allen Hamilton | -0.1333333
Laura Poitras | -0.2666667
Barton Gellman | -0.3111111
Verizon Wireless | -0.3333333
Angela Merkel | -0.3777778
Anatoly Kucherena | -0.4
Federal Migration Service | -0.4444444
US State Department | -0.4444444
Vladimir Putin | -0.4666667
Sheremetyevo International Airport | -0.4666667
Nicaragua | -0.4888889
Evo Morales | -0.4888889
Patrick Ventrell | -0.5111111
Moscow | -0.5555556
Bolivia | -0.5777778
Kremlin | -0.6
Russia | -0.6222222
Venezuela | -0.6222222
United States of America | -0.6666667
Latin America | -0.7333333
Barack Obama | -0.7555556
Jay Carney | -0.7555556
South America | -0.8

## Video 2: Egypt's Morsi Vows to Stay in Power.
URL: http://www.bbc.com/news/world-middle-east-23156103

Entity Label  | Score
------------- | -------------
Muslim Brotherhood | 0.441176471
Mohamed Morsi | 0.352941176
Islamist Nour Party | 0.323529412
Arab Spring | 0.264705882
Egypt opposition alliance | 0.235294118
Abdul Fattah Sisi | 0.088235294
Hosni Mubarak | -0.029411765
Adly Mansour | -0.176470588
Tahrir Square | -0.235294118
Mohamed ElBaradei | -0.235294118
Supreme Constitutional Court | -0.294117647
Egypt | -0.352941176
Cairo | -0.470588235
Cairo University | -0.470588235
Nasr | -0.529411765
Jeremy Bowen | -0.705882353
Nisha Pilla | -0.882352941

## Video 3: Fukushima leak causes Japan concern
URL: http://www.bbc.com/news/world-asia-pacific-23425570

Entity Label  | Score
------------- | -------------
Fukushima Daiichi | 0.5
Tokyo Electric Power Company | 0.476190476
Reactor building no 3 | 0.404761905
Nuclear Regulation Authority | 0.142857143
Pacific Ocean | -0.357142857
Nuclear Regulatory Commission | -0.357142857
Japan | -0.380952381
Naomi Hirose | -0.476190476
Tokyo | -0.5
Shunichi Tanaka | -0.523809524
Shinzo Abe | -0.547619048
Rupert Wingfield Hayes | -0.785714286
TV Tokyo | -0.880952381

## Video 4: Rallies in US after Zimmerman Verdict
URL: http://www.bbc.com/news/world-us-canada-23312559

Entity Label  | Score
------------- | -------------
George Zimmerman | 0.444444444
Trayvon Martin | 0.407407407
National Association for the Advancement of Colored People (NAACP) | -0.037037037
Rachel Jeantel | -0.185185185
General Eric Holder | -0.222222222
Rev. Lowman Oliver | -0.259259259
Mark O'Mara | -0.259259259
Sanford | -0.333333333
Angela Corey | -0.37037037
United States Department of Justice | -0.407407407
Matt Gutman | -0.555555556
Barack Obama | -0.592592593
New York | -0.666666667
Florida | -0.666666667
Los Angeles | -0.703703704
San Francisco | -0.740740741
Times Square | -0.740740741
Washington DC. | -0.814814815
United States of America | -0.851851852

## Video 5: Royal Baby Prince Named George
URL: http://www.bbc.com/news/uk-23429644

Entity Label  | Score
------------- | -------------
Kate Middleton Duchess of Cambridge | 0.357142857
King George the VI Bertie | 0.357142857
Prince George of Cambridge George Alexander Louis | 0.285714286
Prince William Duke of Cambridge | 0.285714286
King George V | 0.142857143
Queen Elizabeth | 0.071428571
Earl Louis Mountbatten | -0.142857143
Prince Harry of Wales | -0.214285714
Charles Prince of Wales | -0.285714286
Queen Victoria | -0.285714286
Balmoral Castle | -0.285714286
Princess Margaret | -0.357142857
Cambridge | -0.357142857
Queen Mary of Teck | -0.357142857
Kensington Palace | -0.428571429
The Queen Mother Elizabeth Angela Marguerite Bowes-Lyon | -0.428571429
Irish Republican Army | -0.428571429
St Mary's Hospital | -0.5
England Country | -0.5
Great Britain | -0.5
Suzannah Lipscomb | -0.571428571


text:
package org.elasticsearch.example.realm;

import org.elasticsearch.xpack.core.security.authc.Realm;
import org.elasticsearch.xpack.core.security.authc.RealmConfig;

/**
 * The factory class for the {@link CustomRealm}. This factory class is responsible for properly constructing the realm
 * when called by the X-Pack framework.
 */
public class CustomRealmFactory implements Realm.Factory {

    /**
     * Create a {@link CustomRealm} based on the given configuration
     * @param config the configuration to create the realm with
     * @return the realm
     */
    @Override
    public CustomRealm create(RealmConfig config) {
        return new CustomRealm(config);
    }
}

redpajama_set_name: RedPajamaGithub


text:
.class Landroid/net/DhcpStateMachine$WaitBeforeStartState;
.super Lcom/android/internal/util/State;
.source "DhcpStateMachine.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/net/DhcpStateMachine;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "WaitBeforeStartState"
.end annotation

# instance fields
.field final synthetic this$0:Landroid/net/DhcpStateMachine;

# direct methods
.method constructor <init>(Landroid/net/DhcpStateMachine;)V
    .locals 0
    .param p1, "this$0"    # Landroid/net/DhcpStateMachine;

    .prologue
    .line 242
    iput-object p1, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    invoke-direct {p0}, Lcom/android/internal/util/State;-><init>()V

    return-void
.end method

# virtual methods
.method public enter()V
    .locals 0

    .prologue
    .line 244
    return-void
.end method

.method public processMessage(Landroid/os/Message;)Z
    .locals 3
    .param p1, "message"    # Landroid/os/Message;

    .prologue
    .line 250
    const/4 v0, 0x1

    .line 252
    .local v0, "retValue":Z
    iget v1, p1, Landroid/os/Message;->what:I

    sparse-switch v1, :sswitch_data_0

    .line 267
    const/4 v0, 0x0

    .line 270
    :goto_0
    :sswitch_0
    return v0

    .line 254
    :sswitch_1
    iget-object v1, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    invoke-static {v1}, Landroid/net/DhcpStateMachine;->-wrap2(Landroid/net/DhcpStateMachine;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 255
    iget-object v1, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    iget-object v2, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    invoke-static {v2}, Landroid/net/DhcpStateMachine;->-get9(Landroid/net/DhcpStateMachine;)Lcom/android/internal/util/State;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/net/DhcpStateMachine;->-wrap4(Landroid/net/DhcpStateMachine;Lcom/android/internal/util/IState;)V

    goto :goto_0

    .line 257
    :cond_0
    iget-object v1, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    iget-object v2, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    invoke-static {v2}, Landroid/net/DhcpStateMachine;->-get7(Landroid/net/DhcpStateMachine;)Lcom/android/internal/util/State;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/net/DhcpStateMachine;->-wrap4(Landroid/net/DhcpStateMachine;Lcom/android/internal/util/IState;)V

    goto :goto_0

    .line 261
    :sswitch_2
    iget-object v1, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    iget-object v2, p0, Landroid/net/DhcpStateMachine$WaitBeforeStartState;->this$0:Landroid/net/DhcpStateMachine;

    invoke-static {v2}, Landroid/net/DhcpStateMachine;->-get10(Landroid/net/DhcpStateMachine;)Lcom/android/internal/util/State;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/net/DhcpStateMachine;->-wrap4(Landroid/net/DhcpStateMachine;Lcom/android/internal/util/IState;)V

    goto :goto_0

    .line 252
    :sswitch_data_0
    .sparse-switch
        0x30001 -> :sswitch_0
        0x30002 -> :sswitch_2
        0x30007 -> :sswitch_1
    .end sparse-switch
.end method


text:
using System;
using System.Net;

namespace Stratis.Bitcoin.Features.RPC
{
    ///
    /// The class of an object representing a block of ip addresses.
    /// See https://www.mediawiki.org/wiki/Help:Range_blocks.
    ///
    public class IPAddressBlock
    {
        /// The CIDR suffix determines the number of significant bits in the <see cref="BlockAddress"/>.
        public int CIDRSuffix { get; private set; }

        /// The block address which is the same as the first ip address in the block.
        public IPAddress BlockAddress { get; private set; }

        /// The maximum length of the CIDR suffix.
        public int CIDRMaxSuffix => 8 * this.BlockAddress.GetAddressBytes().Length;

        ///
        /// Constructs an object representing a block of ip addresses.
        ///
        /// <param name="blockAddress">The block address.</param>
        /// <param name="suffix">The suffix determines the number of significant bits of the block address.</param>
        /// <exception cref="FormatException">If the block format is incorrect.</exception>
        public IPAddressBlock(IPAddress blockAddress, int? suffix = null)
        {
            // Normalize address.
            if (blockAddress.IsIPv4MappedToIPv6)
            {
                blockAddress = blockAddress.MapToIPv4();
                if (suffix != null)
                    suffix -= 96;
            }

            this.BlockAddress = blockAddress;

            if (suffix != null && (suffix < 0 || suffix > this.CIDRMaxSuffix))
                throw new FormatException("Invalid IPAddressBlock format");

            this.CIDRSuffix = suffix ?? this.CIDRMaxSuffix;
        }

        ///
        /// Allow implicit cast from IPAddress to IPAddressBlock for convenience.
        ///
        /// <param name="address">The IPAddress to cast to an IPAddressBlock.</param>
        public static implicit operator IPAddressBlock(IPAddress address)
        {
            return new IPAddressBlock(address);
        }

        ///
        /// Parses the string representation of a block of ip addresses and creates a corresponding object.
        ///
        /// <param name="value">The string representation of a block of ip addresses.</param>
        /// <returns>An object representing a block of ip addresses.</returns>
        public static IPAddressBlock Parse(string value)
        {
            string[] parts = value.Split('/');
            return new IPAddressBlock(IPAddress.Parse(parts[0]), (parts.Length < 2) ? (int?)null : int.Parse(parts[1]));
        }

        ///
        /// Determines if the passed ip address occurs in the CIDR range defined by this object.
        ///
        /// <param name="address">The ip adddress.</param>
        /// <returns><c>True</c> if the ip address occurs in this range and <c>false</c> otherwise.</returns>
        /// <remarks>
        /// As per https://www.mediawiki.org/wiki/Help:Range_blocks - "Technical Explanation":
        ///
        /// CIDR notation is written as the IP address, a slash, and the CIDR suffix (for example, the
        /// IPv4 "10.2.3.41/24" or IPv6 "a3:bc00::/24").  The CIDR suffix is the number of starting digits
        /// every IP address in the range have in common when written in binary.
        ///
        /// For example: "10.10.1.32" is binary "00001010.00001010.00000001.00100000",  so 10.10.1.32/27
        /// will match the first 27 digits("00001010.00001010.00000001.00100000"). The IP addresses
        /// 10.10.1.32–10.10.1.63, when converted to binary, all have the same 27 first digits and will be blocked
        /// if 10.10.1.32 / 27 is blocked.
        /// </remarks>
        public bool Contains(IPAddress address)
        {
            if (address.IsIPv4MappedToIPv6)
                address = address.MapToIPv4();

            if (this.BlockAddress.AddressFamily != address.AddressFamily)
                return false;

            byte[] blockAddrBytes = this.BlockAddress.GetAddressBytes();
            if (this.CIDRSuffix == (blockAddrBytes.Length * 8))
                return this.BlockAddress.Equals(address);

            // Determine the number of initial bytes in the block address that should match the ip address.
            int maskBytesLength = this.CIDRSuffix / 8;
            byte[] addressBytes = address.GetAddressBytes();
            for (int i = 0; i < maskBytesLength; i++)
                if (addressBytes[i] != blockAddrBytes[i])
                    return false;

            // Deal with CIDR suffixes that are mot a multiple of 8.
            if ((this.CIDRSuffix % 8) != 0)
            {
                // Determines the number of remaining bits of the CIDR suffix to compare.
                // Computes a byte mask as follows: 1 -> 0x80, 2 -> 0xC0, 3 -> 0xE0 .. 7 -> 0xFE.
                byte byteMask = (byte)~(0xff >> (this.CIDRSuffix % 8));

                if (((addressBytes[maskBytesLength] ^ blockAddrBytes[maskBytesLength]) & byteMask) != 0)
                    return false;
            }

            // We don't care about mismatches in the rest of the bytes.
            return true;
        }

        ///
        /// Returns the block of ip addresses defined by this object as a string.
        ///
        /// <returns>The block of ip addresses defined by this object as a string.</returns>
        public override string ToString()
        {
            if (this.CIDRSuffix == this.CIDRMaxSuffix)
                return this.BlockAddress.ToString();

            return $"{ this.BlockAddress }/{ this.CIDRSuffix }";
        }
    }
}


text:
static sf::Window* s_window = NULL;
static sf::RenderTarget* s_renderTarget = NULL;
static sf::Texture* s_fontTexture = NULL;
static bool s_windowHasFocus = true;

static bool s_mousePressed[5] = { false, false, false, false, false };

namespace
{

ImVec2 getDisplaySize()
{
    assert(s_renderTarget);
    sf::Vector2f size = static_cast<sf::Vector2f>(s_renderTarget->getSize());
    return ImVec2(size);
}

ImVec2 getTopLeftAbsolute(const sf::FloatRect& rect);
ImVec2 getDownRightAbsolute(const sf::FloatRect& rect);

void RenderDrawLists(ImDrawData* draw_data); // rendering callback function prototype

// Implementation of ImageButton overload
bool imageButtonImpl(const sf::Texture& texture, const sf::FloatRect& textureRect, const sf::Vector2f& size, const int framePadding,
                     const sf::Color& bgColor, const sf::Color& tintColor);

} // anonymous namespace for helper / "private" functions

namespace ImGui
{
namespace SFML
{

void Init(sf::Window& window, sf::RenderTarget& target)
{
    s_window = &window;

    ImGuiIO& io = ImGui::GetIO();

    // init keyboard mapping
    io.KeyMap[ImGuiKey_Tab] = sf::Keyboard::Tab;
    io.KeyMap[ImGuiKey_LeftArrow] = sf::Keyboard::Left;
    io.KeyMap[ImGuiKey_RightArrow] = sf::Keyboard::Right;
    io.KeyMap[ImGuiKey_UpArrow] = sf::Keyboard::Up;
    io.KeyMap[ImGuiKey_DownArrow] = sf::Keyboard::Down;
    io.KeyMap[ImGuiKey_Home] = sf::Keyboard::Home;
    io.KeyMap[ImGuiKey_End] = sf::Keyboard::End;
    io.KeyMap[ImGuiKey_Delete] = sf::Keyboard::Delete;
    io.KeyMap[ImGuiKey_Backspace] = sf::Keyboard::BackSpace;
    io.KeyMap[ImGuiKey_Enter] = sf::Keyboard::Return;
    io.KeyMap[ImGuiKey_Escape] = sf::Keyboard::Escape;
    io.KeyMap[ImGuiKey_A] = sf::Keyboard::A;
    io.KeyMap[ImGuiKey_C] = sf::Keyboard::C;
    io.KeyMap[ImGuiKey_V] = sf::Keyboard::V;
    io.KeyMap[ImGuiKey_X] = sf::Keyboard::X;
    io.KeyMap[ImGuiKey_Y] = sf::Keyboard::Y;
    io.KeyMap[ImGuiKey_Z] = sf::Keyboard::Z;

    // init rendering
    s_renderTarget = ⌖
    io.DisplaySize = getDisplaySize();
    io.RenderDrawListsFn = RenderDrawLists; // set render callback

    // create font texture
    unsigned char* pixels;
    int width, height;
    io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);

    if (s_fontTexture) { // was already created, delete it
        delete s_fontTexture;
        s_fontTexture = NULL;
    }

    s_fontTexture = new sf::Texture;
    s_fontTexture->create(width, height);
    s_fontTexture->update(pixels);
    io.Fonts->TexID = (void*)s_fontTexture;

    io.Fonts->ClearInputData();
    io.Fonts->ClearTexData();
}

void Init(sf::RenderWindow& window)
{
    Init(window, window);
}

void ProcessEvent(const sf::Event& event)
{
    ImGuiIO& io = ImGui::GetIO();
    if (s_windowHasFocus) {
        switch (event.type)
        {
            case sf::Event::MouseButtonPressed: // fall-through
            case sf::Event::MouseButtonReleased:
                s_mousePressed[event.mouseButton.button] = (event.type == sf::Event::MouseButtonPressed);
                break;
            case sf::Event::MouseWheelMoved:
                io.MouseWheel += static_cast<float>(event.mouseWheel.delta);
                break;
            case sf::Event::KeyPressed: // fall-through
            case sf::Event::KeyReleased:
                io.KeysDown[event.key.code] = (event.type == sf::Event::KeyPressed);
                io.KeyCtrl = event.key.control;
                io.KeyShift = event.key.shift;
                io.KeyAlt = event.key.alt;
                break;
            case sf::Event::TextEntered:
                if (event.text.unicode > 0 && event.text.unicode < 0x10000) {
                    io.AddInputCharacter(event.text.unicode);
                }
                break;
            default:
                break;
        }
    }

    switch (event.type)
    {
        case sf::Event::LostFocus:
            s_windowHasFocus = false;
            break;
        case sf::Event::GainedFocus:
            s_windowHasFocus = true;
            break;
        default:
            break;
    }
}

void Update(const float dt)
{
    ImGuiIO& io = ImGui::GetIO();
    io.DisplaySize = getDisplaySize();
    io.DeltaTime = dt;
    s_window->setMouseCursorVisible(!io.MouseDrawCursor); // don't draw mouse cursor if ImGui draws it

    // update mouse
    assert(s_window);
    if (s_window->hasFocus()) {
        io.MousePos = sf::Mouse::getPosition(*s_window);
        io.MouseDown[0] = s_mousePressed[0] || sf::Mouse::isButtonPressed(sf::Mouse::Left);
        io.MouseDown[1] = s_mousePressed[1] || sf::Mouse::isButtonPressed(sf::Mouse::Right);
        io.MouseDown[2] = s_mousePressed[2] || sf::Mouse::isButtonPressed(sf::Mouse::Middle);
        s_mousePressed[0] = s_mousePressed[1] = s_mousePressed[2] = false;
    }

    ImGui::NewFrame();
}

void Shutdown()
{
    ImGuiIO& io = ImGui::GetIO();
    io.Fonts->TexID = NULL;
    delete s_fontTexture;
    s_fontTexture = NULL;

    s_renderTarget = NULL;
    s_window = NULL;
    ImGui::Shutdown(); // need to specify namespace here, because compiler will call ImGui::SFML::Shutdown here!
}

void SetWindow(sf::Window& window)
{
    s_window = &window;
}

void SetRenderTarget(sf::RenderTarget& target)
{
    s_renderTarget = ⌖
}

} // end of namespace SFML

/////////////// Image Overloads

void Image(const sf::Texture& texture,
    const sf::Color& tintColor, const sf::Color& borderColor)
{
    Image(texture, static_cast<sf::Vector2f>(texture.getSize()), tintColor, borderColor);
}

void Image(const sf::Texture& texture, const sf::Vector2f& size,
    const sf::Color& tintColor, const sf::Color& borderColor)
{
    ImGui::Image((void*)&texture, size, ImVec2(0, 0), ImVec2(1, 1), tintColor, borderColor);
}

void Image(const sf::Texture& texture, const sf::FloatRect& textureRect,
    const sf::Color& tintColor, const sf::Color& borderColor)
{
    Image(texture, sf::Vector2f(textureRect.width, textureRect.height), textureRect, tintColor, borderColor);
}

void Image(const sf::Texture& texture, const sf::Vector2f& size, const sf::FloatRect& textureRect,
    const sf::Color& tintColor, const sf::Color& borderColor)
{
    sf::Vector2f textureSize = static_cast<sf::Vector2f>(texture.getSize());
    ImVec2 uv0(textureRect.left / textureSize.x, textureRect.top / textureSize.y);
    ImVec2 uv1((textureRect.left + textureRect.width) / textureSize.x,
        (textureRect.top + textureRect.height) / textureSize.y);
    ImGui::Image((void*)&texture, size, uv0, uv1, tintColor, borderColor);
}

void Image(const sf::Sprite& sprite,
    const sf::Color& tintColor, const sf::Color& borderColor)
{
    sf::FloatRect bounds = sprite.getGlobalBounds();
    Image(sprite, sf::Vector2f(bounds.width, bounds.height), tintColor, borderColor);
}

void Image(const sf::Sprite& sprite, const sf::Vector2f& size,
    const sf::Color& tintColor, const sf::Color& borderColor)
{
    const sf::Texture* texturePtr = sprite.getTexture();
	const sf::FloatRect textureRect = static_cast<sf::FloatRect>(sprite.getTextureRect());
    // sprite without texture cannot be drawn
    if (!texturePtr) { return; }

    Image(*texturePtr, size, textureRect, tintColor, borderColor);
}

/////////////// Image Button Overloads

bool ImageButton(const sf::Texture& texture,
    const int framePadding, const sf::Color& bgColor, const sf::Color& tintColor)
{
    return ImageButton(texture, static_cast<sf::Vector2f>(texture.getSize()), framePadding, bgColor, tintColor);
}

bool ImageButton(const sf::Texture& texture, const sf::Vector2f& size,
    const int framePadding, const sf::Color& bgColor, const sf::Color& tintColor)
{
    sf::Vector2f textureSize = static_cast<sf::Vector2f>(texture.getSize());
    return ::imageButtonImpl(texture, sf::FloatRect(0.f, 0.f, textureSize.x, textureSize.y), size, framePadding, bgColor, tintColor);
}

bool ImageButton(const sf::Sprite& sprite,
    const int framePadding, const sf::Color& bgColor, const sf::Color& tintColor)
{
    sf::FloatRect spriteSize = sprite.getGlobalBounds();
    return ImageButton(sprite, sf::Vector2f(spriteSize.width, spriteSize.height), framePadding, bgColor, tintColor);
}

bool ImageButton(const sf::Sprite& sprite, const sf::Vector2f& size,
    const int framePadding, const sf::Color& bgColor, const sf::Color& tintColor)
{
    const sf::Texture* texturePtr = sprite.getTexture();
    if (!texturePtr) { return false; }
    return ::imageButtonImpl(*texturePtr, static_cast<sf::FloatRect>(sprite.getTextureRect()), size, framePadding, bgColor, tintColor);
}

/////////////// Draw_list Overloads

void DrawLine(const sf::Vector2f& a, const sf::Vector2f& b, const sf::Color& color,
    float thickness)
{
    ImDrawList* draw_list = ImGui::GetWindowDrawList();
    sf::Vector2f pos = ImGui::GetCursorScreenPos();
    draw_list->AddLine(a + pos, b + pos, ColorConvertFloat4ToU32(color), thickness);
}

void DrawRect(const sf::FloatRect& rect, const sf::Color& color,
    float rounding, int rounding_corners, float thickness)
{
    ImDrawList* draw_list = ImGui::GetWindowDrawList();
    draw_list->AddRect(
        getTopLeftAbsolute(rect),
        getDownRightAbsolute(rect),
        ColorConvertFloat4ToU32(color), rounding, rounding_corners, thickness);
}

void DrawRectFilled(const sf::FloatRect& rect, const sf::Color& color,
    float rounding, int rounding_corners)
{
    ImDrawList* draw_list = ImGui::GetWindowDrawList();
    draw_list->AddRect(
        getTopLeftAbsolute(rect),
        getDownRightAbsolute(rect),
        ColorConvertFloat4ToU32(color), rounding, rounding_corners);
}

} // end of namespace ImGui

namespace
{
ImVec2 getTopLeftAbsolute(const sf::FloatRect & rect)
{
    ImVec2 pos = ImGui::GetCursorScreenPos();
    return ImVec2(rect.left + pos.x, rect.top + pos.y);
}
ImVec2 getDownRightAbsolute(const sf::FloatRect & rect)
{
    ImVec2 pos = ImGui::GetCursorScreenPos();
    return ImVec2(rect.left + rect.width + pos.x, rect.top + rect.height + pos.y);
}

// Rendering callback
void RenderDrawLists(ImDrawData* draw_data)
{
    assert(s_renderTarget);
    if (draw_data->CmdListsCount == 0) {
        return;
    }

    // scale stuff (needed for proper handling of window resize)
    ImGuiIO& io = ImGui::GetIO();
    int fb_width = static_cast<int>(io.DisplaySize.x * io.DisplayFramebufferScale.x);
    int fb_height = static_cast<int>(io.DisplaySize.y * io.DisplayFramebufferScale.y);
    if (fb_width == 0 || fb_height == 0) { return; }
    draw_data->ScaleClipRects(io.DisplayFramebufferScale);

    s_renderTarget->pushGLStates();

    // save state
    GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport);
    GLint last_texture;
    glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);

    // do GL stuff
    glPushAttrib(GL_ENABLE_BIT | GL_COLOR_BUFFER_BIT | GL_TRANSFORM_BIT);
    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glDisable(GL_CULL_FACE);
    glDisable(GL_DEPTH_TEST);
    glEnable(GL_SCISSOR_TEST);
    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
    glEnableClientState(GL_COLOR_ARRAY);
    glEnable(GL_TEXTURE_2D);

    glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height);
    glMatrixMode(GL_PROJECTION);
    glPushMatrix();
    glLoadIdentity();
    glOrtho(0.0f, io.DisplaySize.x, io.DisplaySize.y, 0.0f, -1.0f, +1.0f);
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    glLoadIdentity();

    for (int n = 0; n < draw_data->CmdListsCount; ++n) {
        const ImDrawList* cmd_list = draw_data->CmdLists[n];
        const unsigned char* vtx_buffer = (const unsigned char*)&cmd_list->VtxBuffer.front();
        const ImDrawIdx* idx_buffer = &cmd_list->IdxBuffer.front();

        glVertexPointer(2, GL_FLOAT, sizeof(ImDrawVert), (void*)(vtx_buffer + offsetof(ImDrawVert, pos)));
        glTexCoordPointer(2, GL_FLOAT, sizeof(ImDrawVert), (void*)(vtx_buffer + offsetof(ImDrawVert, uv)));
        glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(ImDrawVert), (void*)(vtx_buffer + offsetof(ImDrawVert, col)));

        for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.size(); ++cmd_i) {
            const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
            if (pcmd->UserCallback) {
                pcmd->UserCallback(cmd_list, pcmd);
            } else {
                sf::Texture* texture = (sf::Texture*)pcmd->TextureId;
                sf::Vector2u win_size = s_renderTarget->getSize();
                sf::Texture::bind(texture);
                glScissor((int)pcmd->ClipRect.x, (int)(win_size.y - pcmd->ClipRect.w),
                    (int)(pcmd->ClipRect.z - pcmd->ClipRect.x), (int)(pcmd->ClipRect.w - pcmd->ClipRect.y));
                glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, GL_UNSIGNED_SHORT, idx_buffer);
            }
            idx_buffer += pcmd->ElemCount;
        }
    }

    // Restore modified state
    glDisableClientState(GL_COLOR_ARRAY);
    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
    glDisableClientState(GL_VERTEX_ARRAY);
    glBindTexture(GL_TEXTURE_2D, last_texture);
    glMatrixMode(GL_MODELVIEW);
    glPopMatrix();
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();
    glPopAttrib();
    glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]);

    s_renderTarget->popGLStates();
    s_renderTarget->resetGLStates();
}

bool imageButtonImpl(const sf::Texture& texture, const sf::FloatRect& textureRect, const sf::Vector2f& size, const int framePadding,
                     const sf::Color& bgColor, const sf::Color& tintColor)
{
    sf::Vector2f textureSize = static_cast<sf::Vector2f>(texture.getSize());

    ImVec2 uv0(textureRect.left / textureSize.x, textureRect.top / textureSize.y);
    ImVec2 uv1((textureRect.left + textureRect.width)  / textureSize.x,
               (textureRect.top  + textureRect.height) / textureSize.y);

    return ImGui::ImageButton((void*)&texture, size, uv0, uv1, framePadding, bgColor, tintColor);
}

} // end of anonymous namespace


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Trans. Linn. Soc. London 27: 180 (1869)

#### Original name
Platygrapha stictoides Leight.

### Remarks
null


text:
using System;
using System.Linq;
using System.Reflection;

namespace Zyan.Communication.Toolbox
{
	/// <summary>
	/// Helper class for duck typing support.
	/// </summary>
	/// <typeparam name="I">Interface type</typeparam>
	/// <typeparam name="T">Component type</typeparam>
	internal class TypeComparer<I, T>
	{
		public void Validate()
		{
			if (!MatchAllMethods())
			{
				var msg = String.Format(LanguageResource.MissingMethodException_MethodNotFound, MissingMethodSignature);
				throw new MissingMethodException(msg);
			}
		}

		string MissingMethodSignature { get; set; }

		private bool MatchAllMethods()
		{
			var interfaceType = typeof(I);
			var componentType = typeof(T);

			// check if componentType actually implements interfaceType
			if (interfaceType.IsAssignableFrom(componentType))
			{
				return true;
			}

			// check if every interface method is implemented by the component type
			var interfaceMethods = interfaceType.GetMethods(BindingFlags.Instance | BindingFlags.Public);
			var componentMethods = componentType.GetMethods(BindingFlags.Instance | BindingFlags.Public);
			return interfaceMethods.All(im =>
			{
				var match = componentMethods.Any(cm => MethodsAreEqual(im, cm));
				if (!match)
				{
					var paramTypes = im.GetParameters().Select(pi => pi.ParameterType).ToArray();
					MissingMethodSignature = MessageHelpers.GetMethodSignature(componentType, im.Name, paramTypes);
				}

				return match;
			});
		}

		private bool MethodsAreEqual(MethodInfo im, MethodInfo cm)
		{
			// compare name and return type
			if (im.Name != cm.Name ||
				im.ReturnType != cm.ReturnType ||
				im.IsGenericMethod != cm.IsGenericMethod ||
				im.IsGenericMethodDefinition != cm.IsGenericMethodDefinition)
				return false;

			// compare parameter count
			var imParams = im.GetParameters();
			var cmParams = cm.GetParameters();
			if (imParams.Length != cmParams.Length)
				return false;

			// compare parameter types
			return imParams.Zip(cmParams, (ip, cp) => ip.ParameterType == cp.ParameterType).All(p => p);
		}
	}
}


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.rebuild = exports.installOrRebuild = undefined;

var _bluebirdLst;

function _load_bluebirdLst() {
    return _bluebirdLst = require("bluebird-lst");
}

var _bluebirdLst2;

function _load_bluebirdLst2() {
    return _bluebirdLst2 = _interopRequireDefault(require("bluebird-lst"));
}

let installOrRebuild = exports.installOrRebuild = (() => {
    var _ref = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (config, appDir, frameworkInfo, platform, arch) {
        let forceInstall = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;

        const args = (0, (_electronBuilderUtil || _load_electronBuilderUtil()).asArray)(config.npmArgs);
        if (forceInstall || !(yield (0, (_fs || _load_fs()).exists)(_path.join(appDir, "node_modules")))) {
            yield installDependencies(appDir, frameworkInfo, platform, arch, args, !config.npmSkipBuildFromSource);
        } else {
            yield rebuild(appDir, frameworkInfo, platform, arch, args, !config.npmSkipBuildFromSource);
        }
    });

    return function installOrRebuild(_x, _x2, _x3, _x4, _x5) {
        return _ref.apply(this, arguments);
    };
})();

let rebuild = exports.rebuild = (() => {
    var _ref2 = (0, (_bluebirdLst || _load_bluebirdLst()).coroutine)(function* (appDir, frameworkInfo) {
        let platform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : process.platform;
        let arch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : process.arch;
        let additionalArgs = arguments[4];
        let buildFromSource = arguments[5];

        const pathToDep = yield (0, (_readInstalled || _load_readInstalled()).readInstalled)(appDir);
        const nativeDeps = yield (_bluebirdLst2 || _load_bluebirdLst2()).default.filter(pathToDep.values(), function (it) {
            return it.extraneous ? false : (0, (_fs || _load_fs()).exists)(_path.join(it.path, "binding.gyp"));
        }, { concurrency: 8 });
        if (nativeDeps.length === 0) {
            (0, (_log || _load_log()).log)(`No native production dependencies`);
            return;
        }
        (0, (_log || _load_log()).log)(`Rebuilding native production dependencies for ${platform}:${arch}`);
        let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS;
        const isYarn = isYarnPath(execPath);
        const execArgs = [];
        if (execPath == null) {
            execPath = getPackageToolPath();
        } else {
            execArgs.push(execPath);
            execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node";
        }
        const env = getGypEnv(frameworkInfo, platform, arch, buildFromSource);
        if (isYarn) {
            execArgs.push("run", "install", "--");
            execArgs.push.apply(execArgs, _toConsumableArray(additionalArgs));
            yield (_bluebirdLst2 || _load_bluebirdLst2()).default.each(nativeDeps, function (dep) {
                (0, (_log || _load_log()).log)(`Rebuilding native dependency ${dep.name}`);
                return (0, (_electronBuilderUtil || _load_electronBuilderUtil()).spawn)(execPath, execArgs, {
                    cwd: dep.path,
                    env: env
                }).catch(function (error) {
                    if (dep.optional) {
                        (0, (_log || _load_log()).warn)(`Cannot build optional native dep ${dep.name}`);
                    } else {
                        throw error;
                    }
                });
            });
        } else {
            execArgs.push("rebuild");
            execArgs.push.apply(execArgs, _toConsumableArray(additionalArgs));
            execArgs.push.apply(execArgs, _toConsumableArray(nativeDeps.map(function (it) {
                return it.name;
            })));
            yield (0, (_electronBuilderUtil || _load_electronBuilderUtil()).spawn)(execPath, execArgs, {
                cwd: appDir,
                env: env
            });
        }
    });

    return function rebuild(_x9, _x10) {
        return _ref2.apply(this, arguments);
    };
})();
//# sourceMappingURL=yarn.js.map

exports.getGypEnv = getGypEnv;

var _electronBuilderUtil;

function _load_electronBuilderUtil() {
    return _electronBuilderUtil = require("electron-builder-util");
}

var _fs;

function _load_fs() {
    return _fs = require("electron-builder-util/out/fs");
}

var _log;

function _load_log() {
    return _log = require("electron-builder-util/out/log");
}

var _os;

function _load_os() {
    return _os = require("os");
}

var _path = _interopRequireWildcard(require("path"));

var _readInstalled;

function _load_readInstalled() {
    return _readInstalled = require("./readInstalled");
}

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }

function getGypEnv(frameworkInfo, platform, arch, buildFromSource) {
    if (!frameworkInfo.useCustomDist) {
        return Object.assign({}, process.env, {
            npm_config_arch: arch,
            npm_config_target_arch: arch,
            npm_config_platform: platform,
            npm_config_build_from_source: buildFromSource
        });
    }
    const gypHome = _path.join((0, (_os || _load_os()).homedir)(), ".electron-gyp");
    return Object.assign({}, process.env, {
        npm_config_disturl: "https://atom.io/download/electron",
        npm_config_target: frameworkInfo.version,
        npm_config_runtime: "electron",
        npm_config_arch: arch,
        npm_config_target_arch: arch,
        npm_config_platform: platform,
        npm_config_build_from_source: buildFromSource,
        HOME: gypHome,
        USERPROFILE: gypHome
    });
}
function installDependencies(appDir, frameworkInfo) {
    let platform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : process.platform;
    let arch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : process.arch;
    let additionalArgs = arguments[4];
    let buildFromSource = arguments[5];

    (0, (_log || _load_log()).log)(`Installing app dependencies for arch ${arch} to ${appDir}`);
    let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS;
    const execArgs = ["install", "--production"];
    const isYarn = isYarnPath(execPath);
    if (!isYarn) {
        if (process.env.NPM_NO_BIN_LINKS === "true") {
            execArgs.push("--no-bin-links");
        }
        execArgs.push("--cache-min", "999999999");
    }
    if (execPath == null) {
        execPath = getPackageToolPath();
    } else {
        execArgs.unshift(execPath);
        execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node";
    }
    execArgs.push.apply(execArgs, _toConsumableArray(additionalArgs));
    return (0, (_electronBuilderUtil || _load_electronBuilderUtil()).spawn)(execPath, execArgs, {
        cwd: appDir,
        env: getGypEnv(frameworkInfo, platform, arch, buildFromSource)
    });
}
function getPackageToolPath() {
    if (process.env.FORCE_YARN === "true") {
        return process.platform === "win32" ? "yarn.cmd" : "yarn";
    } else {
        return process.platform === "win32" ? "npm.cmd" : "npm";
    }
}
function isYarnPath(execPath) {
    return process.env.FORCE_YARN === "true" || execPath != null && _path.basename(execPath).startsWith("yarn");
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>arena</artifactId>
        <groupId>org.genesis</groupId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>elk-app</artifactId>

    <dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
    </dependencies>

    <build>
        <finalName>elk-app</finalName>
    </build>
</project>


text:
import unittest

from ogbot.scraping import general

class TestGeneral(unittest.TestCase):
    def test_parse_coordinates(self):
        self.assertEquals(general.parse_coordinates("[1:213:1]"), "1:213:1")


text:
<?php

namespace React\MySQL\Commands;

/**
 * @internal
 */
class PingCommand extends AbstractCommand
{
    public function getId()
    {
        return self::PING;
    }

    public function getSql()
    {
        return '';
    }
}


text:
PHPconomic
==========

The purpose of this project is to be an API wrapper for the e-conomic api.

More details about their API at http://www.e-conomic.com/developer.


text:
package org.apache.camel.test.blueprint;

import org.apache.camel.EndpointInject;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.Test;

public class IsMockEndpointJUnit4Test extends CamelBlueprintTestSupport {

    @EndpointInject (value = "mock:seda:result", context = "IsMockEndpoints")
    private MockEndpoint mockSeda;

    @EndpointInject (value = "mock:bar", context = "IsMockEndpoints")
    private MockEndpoint mockBar;

    @EndpointInject (value = "mock:baz", context = "IsMockEndpoints")
    private MockEndpoint mockBaz;

    @Override
    protected String getBlueprintDescriptor() {
        return "org/apache/camel/test/blueprint/IsMockEndpoints.xml";
    }

    @Override
    public String isMockEndpoints() {
        return "*";
    }

    @Test
    public void testMockAllEndpoints() throws Exception {
        mockSeda.expectedBodiesReceived("bar");
        mockBar.expectedBodiesReceived("bar");

        template.sendBody("direct:foo", "Hello World");

        assertNotNull(context.hasEndpoint("mock:seda:result"));
        assertNotNull(context.hasEndpoint("mock:baz"));
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testMockBar() throws Exception {
        mockBar.expectedBodiesReceived("bar");

        template.sendBody("direct:foo", "Hello World");

        assertNotNull(context.hasEndpoint("mock:bar"));
        assertMockEndpointsSatisfied();
    }

    @Test
    public void testMockBaz() throws Exception {
        mockBaz.expectedBodiesReceived("baz");

        template.sendBody("direct:foo", "Hello World");

        assertNotNull(context.hasEndpoint("mock:baz"));
        assertMockEndpointsSatisfied();
    }
}


text:
                			Creatorul de echipe

A fost introdus creatorul de echipe

                			Echipa lui Graves

Aceasta este echipa lui Graves

        			Title goes here

        				Posted <time datetime="8:26:35">1 minute ago</time>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tellus lectus, euismod sit
        			amet purus in, sollicitudin lacinia lorem. Etiam varius urna justo, ut sodales turpis
        			ultricies sed. Curabitur eu velit sapien. Aliquam tempus, nisl in vehicula iaculis,
        			urna arcu cursus ante, a pharetra justo metus a libero. Curabitur eleifend quam sodales
        			est adipiscing, at sollicitudin nunc mollis. Proin pretium fringilla varius. Nulla urna
        			dolor, auctor sit amet nibh at, convallis ultricies augue. Etiam vel ipsum convallis,
        			commodo enim a, vehicula enim. Integer sit amet tellus commodo sem malesuada malesuada.

        		3 comments

        			Title goes here

        				Posted <time datetime="8:26:35">1 minute ago</time>

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla tellus lectus, euismod sit
        			amet purus in, sollicitudin lacinia lorem. Etiam varius urna justo, ut sodales turpis
        			ultricies sed. Curabitur eu velit sapien. Aliquam tempus, nisl in vehicula iaculis,
        			urna arcu cursus ante, a pharetra justo metus a libero. Curabitur eleifend quam sodales
        			est adipiscing, at sollicitudin nunc mollis. Proin pretium fringilla varius. Nulla urna
        			dolor, auctor sit amet nibh at, convallis ultricies augue. Etiam vel ipsum convallis,
        			commodo enim a, vehicula enim. Integer sit amet tellus commodo sem malesuada malesuada.
        			[Read more]

        		3 comments

Social media

Here goes social media features


text:
package com.azavea.pointcloud.ingest

import com.azavea.pointcloud.ingest.conf.IngestConf

import io.pdal._
import geotrellis.pointcloud.spark.io._
import geotrellis.pointcloud.spark.tiling.Implicits.{withTilerMethods => withPCTilerMethods}
import geotrellis.proj4.CRS
import geotrellis.raster._
import geotrellis.spark._
import geotrellis.spark.io._
import geotrellis.spark.io.index.ZCurveKeyIndexMethod
import geotrellis.spark.io.kryo.KryoRegistrator
import geotrellis.spark.tiling._
import geotrellis.util._
import geotrellis.vector._

import org.apache.spark.serializer.KryoSerializer
import org.apache.spark.{SparkConf, SparkContext}

object IngestPC extends Ingest {
  def main(args: Array[String]): Unit = {
    implicit val opts = IngestConf.parse(args)
    // val chunkPath = System.getProperty("user.dir") + "/chunks/"

    val conf = new SparkConf()
      .setIfMissing("spark.master", "local[*]")
      .setAppName("PointCloudCount")
      .set("spark.local.dir", "/data/spark")
      .set("spark.serializer", classOf[KryoSerializer].getName)
      .set("spark.kryo.registrator", classOf[KryoRegistrator].getName)

    implicit val sc = new SparkContext(conf)

    try {
      val source = getSource

      val (extent, crs) =
        source
          .map { case (header, _) => (header.projectedExtent3D.extent3d.toExtent, header.crs) }
          .reduce { case ((e1, c), (e2, _)) => (e1.combine(e2), c) }

      val targetCrs = CRS.fromName(opts.destCrs)

      val targetExtent =
        opts.extent match {
          case Some(e) => if (crs.epsgCode != targetCrs.epsgCode) e.reproject(crs, targetCrs) else e
          case _ =>  if (crs.epsgCode != targetCrs.epsgCode) extent.reproject(crs, targetCrs) else extent
        }

      val layoutScheme = if (opts.pyramid || opts.zoomed) ZoomedLayoutScheme(targetCrs) else FloatingLayoutScheme(512)

      val LayoutLevel(zoom, layout) = layoutScheme.levelFor(targetExtent, opts.cellSize)
      val kb = KeyBounds(layout.mapTransform(targetExtent))
      val md = TileLayerMetadata[SpatialKey](FloatConstantNoDataCellType, layout, targetExtent, targetCrs, kb)

      val rdd = source.flatMap(_._2)
      val tiled = withPCTilerMethods(rdd).tileToLayout(layout)
      val layer = ContextRDD(tiled, md)

      layer.cache()

      if(opts.persist) {
        val writer = getWriter

        writer
          .write[SpatialKey, PointCloud, TileLayerMetadata[SpatialKey]](
            LayerId(opts.layerName, 0),
            layer,
            ZCurveKeyIndexMethod
          )
      } else layer.count()

      layer.unpersist(blocking = false)
      source.unpersist(blocking = false)

    } finally sc.stop()
  }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Dr. Eric's Psychedelic Wonderland: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

Dr. Eric's Psychedelic Wonderland

Dr. Eric is a scientist that was cleaning up his lab after an accidental mishap causes him to ingest some experimental chemicals. As he tries to go home his body pulls off Dr Eric's head and begins to run into a psychedelic wonderland. Now you have to help Dr. Eric explore this new world and find his body before he is stuck as a head forever.

Main Page

Related Pages

Packages

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

All

Functions

Variables

CrossPlatformInitialize()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

Disable()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

DisableValidate()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

Enable()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

EnableValidate()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

Fling()
: FlingObject

GetDefinesList()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

GetRandomColor()
: RandomColorLerper

OnCollisionEnter2D()
: BallController
, VictoryController

SetEnabled()
: UnityStandardAssets.CrossPlatformInput.Inspector.CrossPlatformInitialize

Start()
: BallController
, FadeUI
, FlingObject
, RandomColorLerper

Update()
: FadeUI
, FlingObject
, RandomColorLerper
, RandomRotations

<address class="footer">
Generated on Mon Aug 3 2015 21:05:40 for Dr. Eric's Psychedelic Wonderland by

 1.8.9.1
</address>


text:
package com.bitalino.bitalinodroid;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

import com.bitalino.comm.BITalinoDevice;
import com.bitalino.comm.BITalinoFrame;

import java.io.InputStream;
import java.io.OutputStream;
import java.util.UUID;

import roboguice.activity.RoboActivity;
import roboguice.inject.InjectView;

public class MainActivity extends RoboActivity {

  private static final String TAG = "MainActivity";
  private static final boolean UPLOAD = false;
  /*
   * http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html
   * #createRfcommSocketToServiceRecord(java.util.UUID)
   *
   * "Hint: If you are connecting to a Bluetooth serial board then try using the
   * well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB. However if you
   * are connecting to an Android peer then please generate your own unique
   * UUID."
   */
  private static final UUID MY_UUID = UUID
      .fromString("00001101-0000-1000-8000-00805F9B34FB");
  @InjectView(R.id.log)
  private TextView tvLog;
  private boolean testInitiated = false;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // execute
    if (!testInitiated)
      new TestAsyncTask().execute();
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
  }

  private class TestAsyncTask extends AsyncTask<Void, String, Void> {
    private TextView tvLog = (TextView) findViewById(R.id.log);
    private BluetoothDevice dev = null;
    private BluetoothSocket sock = null;
    private InputStream is = null;
    private OutputStream os = null;
    private BITalinoDevice bitalino;

    @Override
    protected Void doInBackground(Void... paramses) {
      try {
        // Let's get the remote Bluetooth device
        final String remoteDevice = "98:D3:31:B2:C1:B4";

        final BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter();
        dev = btAdapter.getRemoteDevice(remoteDevice);

    /*
     * Establish Bluetooth connection
     *
     * Because discovery is a heavyweight procedure for the Bluetooth adapter,
     * this method should always be called before attempting to connect to a
     * remote device with connect(). Discovery is not managed by the Activity,
     * but is run as a system service, so an application should always call
     * cancel discovery even if it did not directly request a discovery, just to
     * be sure. If Bluetooth state is not STATE_ON, this API will return false.
     *
     * see
     * http://developer.android.com/reference/android/bluetooth/BluetoothAdapter
     * .html#cancelDiscovery()
     */
        Log.d(TAG, "Stopping Bluetooth discovery.");
        btAdapter.cancelDiscovery();

        sock = dev.createRfcommSocketToServiceRecord(MY_UUID);
        sock.connect();
        testInitiated = true;

        bitalino = new BITalinoDevice(1000, new int[]{0, 1, 2, 3, 4, 5});
        publishProgress("Connecting to BITalino [" + remoteDevice + "]..");
        bitalino.open(sock.getInputStream(), sock.getOutputStream());
        publishProgress("Connected.");

        // get BITalino version
        publishProgress("Version: " + bitalino.version());

        // start acquisition on predefined analog channels
        bitalino.start();

        // read until task is stopped

        while (true) {
          final int numberOfSamplesToRead = 1000;
          publishProgress("Reading " + numberOfSamplesToRead + " samples..");
          BITalinoFrame[] frames = bitalino.read(numberOfSamplesToRead);

        //  if (UPLOAD) {
            // prepare reading for upload
        //    BITalinoReading reading = new BITalinoReading();
         //   reading.setTimestamp(System.currentTimeMillis());
         //   reading.setFrames(frames);
         //   // instantiate reading service client
         //   RestAdapter restAdapter = new RestAdapter.Builder()
         //       .setEndpoint("http://server_ip:8080/bitalino")
         //       .build();
         //   ReadingService service = restAdapter.create(ReadingService.class);
         ///   // upload reading
          //  Response response = service.uploadReading(reading);
         //   assert response.getStatus() == 200;
         // }

         //    Variable Frames contains 1000 samples
         //    First, take each Frame and look for sample coming from A3 channel.
         //    Then, convert it to voltage in mV.
         //
            int ecgRaw;
            int port = 2;
            Double ecgmVolt;
            Double ecgmtoll = 0.1;
            int beatCount = 0;
            Double samplePeriod = 1.0/numberOfSamplesToRead;
            int beatPeriod=0;
            int bpm;

            for (BITalinoFrame frame : frames) {

                ecgRaw = frame.getAnalog(2);
                ecgmVolt = SensorDataConverter.scaleECG(port, ecgRaw);
                Log.v("temp",ecgmVolt.toString());
                //Log.v("value1",String.valueOf(ecgRaw));

                publishProgress(String.valueOf(ecgmVolt));

                // present data in screen

                // Check if the ecgmVolt is within thresh hold
             /*   if ((ecgmVolt >= 1.5 - ecgmtoll) && (ecgmVolt <= 1.5 + ecgmtoll)) {
                    beatCount++;
                    beatPeriod++;
                } else {
                    beatPeriod++;
                }
                if(beatCount >= 3)
                {
                    break;
                }
                    */
            }

            //  Now, we have the beatPeriod for 3 beats
            //  Calculate the beats per second and display on screen
            //
            publishProgress(String.valueOf(beatPeriod));
              bpm = (int)((3*1000*60)/beatPeriod);
             publishProgress(String.valueOf(bpm));

            //reset

           // publishProgress(frame.toString());
            //publishProgress(String.valueOf(ecgRaw));
         // counter++;
        }

        // trigger digital outputs
        // int[] digital = { 1, 1, 1, 1 };
        // device.trigger(digital);
      } catch (Exception e) {
        Log.e(TAG, "There was an error.", e);
      }

      return null;
    }

    @Override
    protected void onProgressUpdate(String... values) {
      tvLog.append("\n".concat(values[0]));
    }

    @Override
    protected void onCancelled() {
      // stop acquisition and close bluetooth connection
      try {
        bitalino.stop();
        publishProgress("BITalino is stopped");

        sock.close();
        publishProgress("And we're done! :-)");
      } catch (Exception e) {
        Log.e(TAG, "There was an error.", e);
      }
    }

  }

}


text:
<?php
/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class Version128 extends Doctrine_Migration_Base
{
    public function up()
    {
        $this->addColumn('files', 'lastdownload', 'timestamp', '25', array(
             ));
    }

    public function down()
    {
        $this->removeColumn('files', 'lastdownload');
    }
}


text:
import collections

import numpy
import six

import chainer
from chainer import backend
from chainer import cuda

def _sum_sqnorm(arr):
    sq_sum = collections.defaultdict(float)
    for x in arr:
        with cuda.get_device_from_array(x) as dev:
            x = x.ravel()
            s = x.dot(x)
            sq_sum[int(dev)] += s
    # If only a single device is used, aggregate square norms on it.
    if len(sq_sum) == 1:
        with cuda.get_device_from_array(arr[0]):
            return sum(six.itervalues(sq_sum))
    else:
        return sum([float(i) for i in six.itervalues(sq_sum)])

class GradientClipping(object):
    """Optimizer hook function for gradient clipping.

    This hook function scales all gradient arrays to fit to the defined L2 norm
    threshold.

    Args:
        threshold (float): L2 norm threshold.

    Attributes:
        ~optimizer_hooks.GradientClipping.threshold (float): L2
                         norm threshold of gradient norm.
        ~optimizer_hooks.GradientClipping.timing (string): Specifies
                         when this hook should be
                         called by the Optimizer/UpdateRule. Valid values are
                         'pre' (before any updates) and 'post' (after any
                         updates).

    .. versionadded:: 4.0.0
       The *timing* parameter.

    """
    name = 'GradientClipping'
    timing = 'pre'

    def __init__(self, threshold):
        self.threshold = threshold

    def __call__(self, opt):
        sqnorm = _sum_sqnorm([p.grad for p in opt.target.params(False)])
        device = backend.get_device_from_array(sqnorm)
        with chainer.using_device(device):
            norm = device.xp.sqrt(sqnorm)
            rate = self.threshold / norm
            # When no clipping is needed, skip the clipping on CPU and
            # multiply 1.0 on the device otherwise.
            if device.xp is numpy:
                if rate >= 1:
                    return
            else:
                rate = rate.clip(None, 1)
        for param in opt.target.params(False):
            grad = param.grad
            with cuda.get_device_from_array(grad):
                grad *= rate


text:
class RenameNewMergeStatusToMergeStatusInMilestone < ActiveRecord::Migration
  def change
    rename_column :merge_requests, :new_merge_status, :merge_status
  end
end


text:
package org.assertj.core.api.atomic.longadder;

import static org.assertj.core.data.Offset.offset;
import static org.mockito.Mockito.verify;

import org.assertj.core.api.LongAdderAssert;
import org.assertj.core.api.LongAdderAssertBaseTest;
import org.assertj.core.data.Offset;

/**
 * Tests for <code>{@link LongAdderAssert#isCloseTo(Long, Offset)}</code>.
 *
 * @author Grzegorz Piwowarek
 */
class LongAdderAssert_isCloseTo_primitive_long_Test extends LongAdderAssertBaseTest {

  private final Offset<Long> offset = offset(5L);
  private final long value = 8L;

  @Override
  protected LongAdderAssert invoke_api_method() {
    return assertions.isCloseTo(value, offset);
  }

  @Override
  protected void verify_internal_effects() {
    verify(longs).assertIsCloseTo(getInfo(assertions), getActual(assertions).longValue(), value, offset);
  }

}


text:
package org.umlgraph.doclet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;

import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.Doc;
import com.sun.javadoc.LanguageVersion;
import com.sun.javadoc.RootDoc;

/**
 * Properties of node shapes
 *
 * @version $Revision$
 * @author Diomidis Spinellis
 */
public class Shape {

    /** Shape's UMLGraph name */
    private String name;

    /** Construct a default (class) Shape */
    public Shape() {
	name = "class";
    }

    /** Construct a Shape through the specified UMLGraph name */
    public Shape(String n) {
	name = n;
	if (graphvizAttribute() == null) {
	    System.err.println("Ignoring invalid shape " + n);
	    name = "class";
	}
    }

    /**
     * Return the GraphViz shape name corresponding to the shape
     */
    public String graphvizAttribute() {
	if (name.equals("class"))
	    return "";		// Default; plaintext
	else if (name.equals("note"))
	    return ", shape=note";
	else if (name.equals("node"))
	    return ", shape=box3d";
	else if (name.equals("component"))
	    return ", shape=component";
	else if (name.equals("package"))
	    return ", shape=tab";
	else if (name.equals("collaboration"))
	    return ", shape=ellipse, style=dashed";
	else if (name.equals("usecase"))
	    return ", shape=ellipse";
	else if (name.equals("activeclass"))
	    return "";		// Default; plaintext
	else
	    return null;
    }

    /** Return the shape's GraphViz landing port */
    String landingPort() {
	if (name.equals("class") || name.equals("activeclass"))
	    return ":p";
	else
	    return "";
    }

    /** Return the table border required for the shape */
    String extraColumn(int nRows) {
	return name.equals("activeclass") ? ("	") : "";
    }

    /** Return the cell border required for the shape */
    String cellBorder() {
	return (name.equals("class") || name.equals("activeclass")) ? "1" : "0";
    }
}


text:
jLight
======

Lightweight jQuery replacement compatible with Backbone.js. Current size: 7.3k minified, 1.6K gzipped.

Objectives
----------

- Provide a lightweight jQuery alternative.
- Ensure Backbone.js compatibility by running Backbone's own tests.
- Use as much native JS code as possible to make this library lightweight.

Principles
----------

- Completeness: strive to implement all or most of jQuery methods.
- Efficiency: 99% of developers only make use of 10% of jQuery's functionalities. jLight is about concentrating only that 10%.
- Lightweight: favor lightweight, performant and intuitive code. If a feature is not likely to be used, then don't add it.
- Robust and well documented: all methods must be well tested and documented.

Supported jQuery methods
------------------------

- _add_
- *append*
- *appendTo*
- *attr*
- *css*
- *data*
- *empty*
- *eq*
- *find*
- *get*
- *has*
- *html*
- *is*
- *off*
- *on*
- *one*
- *parent*
- *remove*
- *toArray*
- *trigger*
- *val*

_Currently being implemented and/or not fully tested_
*Required by Backbone.js*

Supported Backbone version
--------------------------

- In progress

TODO
----

- Add backbone tests.
- Review which methods are strictly required by Backbone.
- Implement and test remaining jQuery methods.
- Documentation.
- GitHub project page.

Credit
------

- [kupriyanenko](https://github.com/kupriyanenko/jbone) for his wonderful repo which I used as boilerplate.
- [HubSpot](https://github.com/HubSpot/YouMightNotNeedjQuery) for inspiration on how to implement jQuery methods in a concise way.


text:
udvi-sockjs-netty
=================

Sockjs server side implementation for Netty 4.x


text:
package org.cicatiello.interview_exercise.ui.impl;

import org.cicatiello.interview_exercise.model.Product;
import org.cicatiello.interview_exercise.ui.ParserService;
import org.cicatiello.interview_exercise.ui.exception.ParseException;
import org.springframework.stereotype.Service;

@Service
public class DefaultParserService implements ParserService {

	@Override
	public Integer parseQuantityFromString(String line) throws ParseException {
		throw new UnsupportedOperationException("This class cannot be implemented until a proper cli is developed");
	}

	@Override
	public Product parseProductFromString(String line) throws ParseException {
		throw new UnsupportedOperationException("This class cannot be implemented until a proper cli is developed");
	}

}


text:
using sdmap.Functional;
using sdmap.Compiler;

namespace sdmap.Macros
{
    public delegate Result<string> MacroDelegate(OneCallContext context,
        string ns, object self, object[] arguments);
}


text:
layout: page
title: Using Open Tree of Life web-services
permalink: /use
---

# Workshops and Materials
## Most up to date tutorials

### R tutorials
See Luna Luisa Sanchez-Reyes' [Open Tree with R tutorial](https://mctavishlab.github.io/R_OpenTree_tutorials/index.html) for a very nice
introduction of how to efficiently use the
 [rotl](https://github.com/ropensci/rotl) package and [DateLife](https://www.biorxiv.org/content/10.1101/782094v1) for interacting with Open Tree's web services.

### Python and Jupyter tutorials
[Install instructions](https://opentree.readthedocs.io/en/latest/notebooks.html)
[Getting a tree of all bird families](https://github.com/OpenTreeOfLife/python-opentree/blob/main/docs/notebooks/bird_families/TreeOfBirdFamilies.ipynb)
[Getting a tree for GBIF records](https://github.com/OpenTreeOfLife/python-opentree/blob/main/docs/notebooks/gbif/GBIF_to_OpenTree.ipynb)
[Dating synthetic trees](https://github.com/OpenTreeOfLife/ChronoSynth/blob/main/examples/Custom_synth_dating.ipynb)

### Looking for conflicting phylogenetic claims
Our tree curation tool has a [conflict viewer](https://tree.opentreeoflife.org/curator/study/view/ot_1843/?tab=trees&tree=Tr112663&conflict=ott) that allows you to compare
a tree to the Open Tree Taxonomy or the Open Tree Synthetic tree.
We are in the process of generalizing this feature so that biologists can
    compare any tree to any other tree.
These trees will need to be mapped to the Open Tree Taxonomy.

### API Docs
Our current API is documented at [here](https://github.com/OpenTreeOfLife/germinator/wiki/Open-Tree-of-Life-Web-APIs)

## Older materials

### Previous workshops
[SSB 2020](SSBworkshop/)
[Berkeley Feb 2020](AWworkshop)

### Integrating Open Tree and GBIF
Emily Jane McTavish wrote a tutorial
    [here](https://mctavishlab.github.io/BIO144/labs/rotl-rgbif.html)
covering some ways to use trees from Open Tree with
    geographic range data from GBIF.


text:
My solutions to the problems of URI Online Judge. <br>
Choose problem and write solution on your own: https://www.urionlinejudge.com.br/judge/en/categories


text:
var apiKey    = '45369152';
var sessionId = '1_MX40NTM2OTE1Mn5-MTQ0NDM5MDc5NDExOH5PRjNMK2ZjRktaS29mTTE1SWpnc1gzb3V-UH4';
var token     = 'T1==cGFydG5lcl9pZD00NTM2OTE1MiZzaWc9ZjU1YjI4YzNiNTMzOGExOWMyOTI4M2YxYjI0YmVjYmU4YjQyM2UyYjpyb2xlPXB1Ymxpc2hlciZzZXNzaW9uX2lkPTFfTVg0ME5UTTJPVEUxTW41LU1UUTBORE01TURjNU5ERXhPSDVQUmpOTUsyWmpSa3RhUzI5bVRURTFTV3BuYzFnemIzVi1VSDQmY3JlYXRlX3RpbWU9MTQ0NDM5MDgxOCZub25jZT0wLjUxODAwNDg2ODU3NTI3NiZleHBpcmVfdGltZT0xNDQ0NDc3MTY0JmNvbm5lY3Rpb25fZGF0YT0=';
var extensionId = 'bibaekpncanjnbnkpichhjhmgkemiflb';
var session = OT.initSession(apiKey, sessionId);

function initBody() {
    initShareScreen();
    //initFullScreen();
}

function initShareScreen() {
    var button = document.getElementById("shareScreen");
    button.addEventListener('click', function (event) {
        screenshare();
    });
}

session.connect(token, function(error) {
    //document.getElementById('shareScreen').disabled = false;
    //document.getElementById('fullScreen').disabled = false;
});

session.on('streamCreated', function(event) {
    if (event.stream.videoType === 'screen') {
        // This is a screen-sharing stream published by another client
        var subOptions = {
            width: event.stream.videoDimensions.width / 2,
            height: event.stream.videoDimensions.height /2
        };
        session.subscribe(event.stream, 'screen-subscriber', subOptions);
    }
});

// For Google Chrome only, register your extension by ID,
// You can find it at chrome://extensions once the extension is installed
OT.registerScreenSharingExtension('chrome', extensionId);

function screenshare() {

    OT.checkScreenSharingCapability(function(response) {
        if (!response.supported || response.extensionRegistered === false) {
            alert('This browser does not support screen sharing.');
        } else if (response.extensionInstalled === false) {
            alert('Please install the screen sharing extension and load this page over HTTPS.');
        } else {
            // Screen sharing is available. Publish the screen.
            // Create an element, but do not display it in the HTML DOM:
            // var screenContainerElement = document.createElement('div');
            var screenContainerElement = document.getElementById("shareScreen");
            var screenSharingPublisher = OT.initPublisher(screenContainerElement,
                { videoSource : 'screen',width:1280,height:720 },
                function(error) {
                    if (error) {
                        alert('Something went wrong: ' + error.message);
                    } else {
                        session.publish(screenSharingPublisher, function(error) {
                            if (error) {
                                alert('Something went wrong: ' + error.message);
                            }
                        });
                    }
                });
        }
    });
}


text:
package ${package}.presentermodules.devops.homecard;

import com.google.inject.Inject;
import ${package}.presentermodules.home.cards.BaseHomeCardView;
import ${package}.utils.Icons;

public class HomeCardView extends BaseHomeCardView<MyUiHandlers> implements
		HomeCardPresenter.MyView {

	@Inject
	public HomeCardView() {
		setTitle("DevOps", Icons.helpIcon());
	}
}


text:
namespace YAF.Types.Interfaces
{
    /// <summary>
    /// The i have localization extensions.
    /// </summary>
    public static class IHaveLocalizationExtensions
    {
        #region Public Methods

        /// <summary>
        /// Gets a text localization using the page and tag name.
        /// </summary>
        /// <param name="haveLocalization">
        /// The have localization.
        /// </param>
        /// <param name="page">
        /// The page.
        /// </param>
        /// <param name="tag">
        /// The tag.
        /// </param>
        /// <returns>
        /// The get text.
        /// </returns>
        public static string GetText(
            [NotNull] this IHaveLocalization haveLocalization,
            [NotNull] string page,
            [NotNull] string tag)
        {
            CodeContracts.VerifyNotNull(haveLocalization, "haveLocalization");
            CodeContracts.VerifyNotNull(page, "page");
            CodeContracts.VerifyNotNull(tag, "tag");

            return haveLocalization.Localization.GetText(page, tag);
        }

        /// <summary>
        /// Gets a text localization.
        /// </summary>
        /// <param name="haveLocalization">
        /// The have localization.
        /// </param>
        /// <param name="tag">
        /// The tag.
        /// </param>
        /// <returns>
        /// The get text.
        /// </returns>
        public static string GetText([NotNull] this IHaveLocalization haveLocalization, [NotNull] string tag)
        {
            CodeContracts.VerifyNotNull(haveLocalization, "haveLocalization");
            CodeContracts.VerifyNotNull(tag, "tag");

            return haveLocalization.Localization.GetText(tag);
        }

        /// <summary>
        /// Gets a text localization using formatting.
        /// </summary>
        /// <param name="haveLocalization">
        /// The have localization.
        /// </param>
        /// <param name="tag">
        /// The tag.
        /// </param>
        /// <param name="args">
        /// The args.
        /// </param>
        /// <returns>
        /// The get text formatted.
        /// </returns>
        public static string GetTextFormatted(
            [NotNull] this IHaveLocalization haveLocalization,
            [NotNull] string tag,
            [CanBeNull] params object[] args)
        {
            CodeContracts.VerifyNotNull(haveLocalization, "haveLocalization");
            CodeContracts.VerifyNotNull(tag, "tag");

            return haveLocalization.Localization.GetTextFormatted(tag, args);
        }

        #endregion
    }
}


text:
/*
 * DO NOT EDIT THIS FILE - it is generated by Glade.
 */

GtkWidget* create_lshw (void);
GtkWidget* create_aboutlshw (void);


text:
package mastodon4j.internal;

import mastodon4j.entity.Status;
import mastodon4j.streaming.PublicStream;
import mastodon4j.streaming.PublicStreamListener;
import org.glassfish.jersey.media.sse.EventSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author hecateball
 */
final class _PublicStream implements PublicStream {

    private static final Logger LOGGER = LoggerFactory.getLogger(_PublicStream.class);
    private final EventSource eventSource;

    public _PublicStream(EventSource eventSource) {
        this.eventSource = eventSource;
    }

    @Override
    public PublicStream register(PublicStreamListener listener) {
        this.eventSource.register(event -> {
            switch (event.getName()) {
                case "update":
                    listener.onUpdate(event.readData(Status.class));
                    break;
                case "notification":
                    // Public stream might not receive notification
                    break;
                case "delete":
                    listener.onDelete(event.readData(Long.class));
                    break;
                default:
                    LOGGER.trace("Unexpected event name: {}", event.getName());
            }
        });
        return this;
    }

    @Override
    public void open() {
        if (!this.eventSource.isOpen()) {
            this.eventSource.open();
        }
    }

    @Override
    public void close() {
        if (this.eventSource.isOpen()) {
            this.eventSource.close();
        }
    }

}


text:
module Cachematrix.WeatherApp.Models {

    export class WeatherData
    {
        public currentConditions: CurrentConditions = new CurrentConditions();
        public days: Array<DayData>
    }

}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$this->lc->save_a_cookie('calendarCallbackUrl', 'settings');
$data['header_title'] = __('Settings');
$data['page_features'] = array(
	'new' => array(
		'action' => '',
		'text' => array(
			'title' => __('Setting')
		),
		'disabled'=> TRUE,
		'invisible'=> TRUE
	)
);
$all_settings = _settings();
$setting_titles = array();
foreach($all_settings as $all_setting){
	$setting_titles[] = $all_setting['title'];
}
$atts_form = array(
	'class' => 'obj-form-action',
	'data-is' => 'tracking',
	'data-update' => 'user'
);
$form_wrap_open = form_open('settings/edit/', $atts_form);
$form_wrap_close = form_close();
?>

	<?php $this->load->view('./header/default', $data);?>

	<?= $form_wrap_open; ?>

				<?php $c = 1; foreach($setting_titles as $setting_title):
					$setting_title_name = _sanitize_title_with_dashes($setting_title);?>
					<li role="presentation" class="nav-item obj-li obj-li-<?= $c; $c++; ?>">
						<a href="#<?= $setting_title_name; ?>" aria-controls="<?= $setting_title_name; ?>" role="tab" data-toggle="tab"><?= $setting_title; ?>

				<?php endforeach; ?>

					<?php $row = 1; foreach($all_settings as $key => $setting):
						$setting['skip'] = 'form-action';
						$setting_title_name = _sanitize_title_with_dashes($setting['title']);
						$setting['title'] = '';
					?>
			    <div role="tabpanel" id="<?= $setting_title_name; ?>" class="tab-pane"><?php $this->load->view('content_setting_li', ['setting' => $setting])?>

					<?php endforeach; ?>

						<button value="submit" class="btn btn-primary btn-lg active btn-block btn-center-align" type="submit" id="submit"><?= __('Save Changes'); ?></button>

	<?= $form_wrap_close; ?>


text:
RSpec.configure do |config|
  config.include FactoryBot::Syntax::Methods
end
FactoryBot.find_definitions


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _panel = require('./panel');

var _panel2 = _interopRequireDefault(_panel);

var _sharedStyle = require('../../shared-style');

var SharedStyle = _interopRequireWildcard(_sharedStyle);

var _export = require('../style/export');

var _immutable = require('immutable');

var _fa = require('react-icons/fa');

var _constants = require('../../constants');

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var VISIBILITY_MODE = {
  MODE_IDLE: _constants.MODE_IDLE, MODE_2D_ZOOM_IN: _constants.MODE_2D_ZOOM_IN, MODE_2D_ZOOM_OUT: _constants.MODE_2D_ZOOM_OUT, MODE_2D_PAN: _constants.MODE_2D_PAN, MODE_3D_VIEW: _constants.MODE_3D_VIEW, MODE_3D_FIRST_PERSON: _constants.MODE_3D_FIRST_PERSON,
  MODE_WAITING_DRAWING_LINE: _constants.MODE_WAITING_DRAWING_LINE, MODE_DRAWING_LINE: _constants.MODE_DRAWING_LINE, MODE_DRAWING_HOLE: _constants.MODE_DRAWING_HOLE, MODE_DRAWING_ITEM: _constants.MODE_DRAWING_ITEM, MODE_DRAGGING_LINE: _constants.MODE_DRAGGING_LINE,
  MODE_DRAGGING_VERTEX: _constants.MODE_DRAGGING_VERTEX, MODE_DRAGGING_ITEM: _constants.MODE_DRAGGING_ITEM, MODE_DRAGGING_HOLE: _constants.MODE_DRAGGING_HOLE, MODE_FITTING_IMAGE: _constants.MODE_FITTING_IMAGE, MODE_UPLOADING_IMAGE: _constants.MODE_UPLOADING_IMAGE,
  MODE_ROTATING_ITEM: _constants.MODE_ROTATING_ITEM
};

var tableStyle = { width: '100%' };
var firstTdStyle = { width: '6em' };
var inputStyle = { textAlign: 'left' };
var styleEditButton = {
  marginLeft: '5px',
  border: '0px',
  background: 'none',
  color: SharedStyle.COLORS.white,
  fontSize: '14px',
  outline: '0px'
};

var tablegroupStyle = {
  width: '100%',
  cursor: 'pointer',
  maxHeight: '20em',
  marginLeft: '1px',
  marginTop: '1em'
};

var iconColStyle = { width: '2em' };

var PanelGroupEditor = function (_Component) {
  _inherits(PanelGroupEditor, _Component);

  function PanelGroupEditor(props, context) {
    _classCallCheck(this, PanelGroupEditor);

    var _this = _possibleConstructorReturn(this, (PanelGroupEditor.__proto__ || Object.getPrototypeOf(PanelGroupEditor)).call(this, props, context));

    _this.state = {};
    return _this;
  }

  _createClass(PanelGroupEditor, [{
    key: 'shouldComponentUpdate',
    value: function shouldComponentUpdate(nextProps, nextState) {
      return true;
    }
  }, {
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(nextProps, nextContext) {}
  }, {
    key: 'render',
    value: function render() {
      var _this2 = this;

      if (!this.props.groupID || !VISIBILITY_MODE[this.props.state.mode]) return null;

      var group = this.props.state.getIn(['scene', 'groups', this.props.groupID]);
      var elements = group.get('elements');

      return _react2.default.createElement(
        _panel2.default,
        { name: this.context.translator.t('Group [{0}]', group.get('name')), opened: true },
        _react2.default.createElement(
          'div',
          { style: { padding: '5px 15px' } },
          _react2.default.createElement(
            'table',
            { style: tableStyle },
            _react2.default.createElement(
              'tbody',
              null,
              _react2.default.createElement(
                'tr',
                null,
                _react2.default.createElement(
                  'td',
                  { style: firstTdStyle },
                  this.context.translator.t('Name')
                ),
                _react2.default.createElement(
                  'td',
                  null,
                  _react2.default.createElement(_export.FormTextInput, {
                    value: group.get('name'),
                    onChange: function onChange(e) {
                      return _this2.context.groupsActions.setGroupAttributes(_this2.props.groupID, new _immutable.Map({ 'name': e.target.value }));
                    },
                    style: inputStyle
                  })
                )
              ),
              _react2.default.createElement(
                'tr',
                null,
                _react2.default.createElement(
                  'td',
                  { style: firstTdStyle },
                  'X'
                ),
                _react2.default.createElement(
                  'td',
                  null,
                  _react2.default.createElement(_export.FormNumberInput, {
                    value: group.get('x'),
                    onChange: function onChange(e) {
                      return _this2.context.groupsActions.groupTranslate(_this2.props.groupID, e.target.value, group.get('y'));
                    },
                    style: inputStyle,
                    state: this.props.state,
                    precision: 2
                  })
                )
              ),
              _react2.default.createElement(
                'tr',
                null,
                _react2.default.createElement(
                  'td',
                  { style: firstTdStyle },
                  'Y'
                ),
                _react2.default.createElement(
                  'td',
                  null,
                  _react2.default.createElement(_export.FormNumberInput, {
                    value: group.get('y'),
                    onChange: function onChange(e) {
                      return _this2.context.groupsActions.groupTranslate(_this2.props.groupID, group.get('x'), e.target.value);
                    },
                    style: inputStyle,
                    state: this.props.state,
                    precision: 2
                  })
                )
              ),
              _react2.default.createElement(
                'tr',
                null,
                _react2.default.createElement(
                  'td',
                  { style: firstTdStyle },
                  this.context.translator.t('Rotation')
                ),
                _react2.default.createElement(
                  'td',
                  null,
                  _react2.default.createElement(_export.FormNumberInput, {
                    value: group.get('rotation'),
                    onChange: function onChange(e) {
                      return _this2.context.groupsActions.groupRotate(_this2.props.groupID, e.target.value);
                    },
                    style: inputStyle,
                    state: this.props.state,
                    precision: 2
                  })
                )
              )
            )
          ),
          elements.size ? _react2.default.createElement(
            'div',
            null,
            _react2.default.createElement(
              'p',
              { style: { textAlign: 'center', borderBottom: SharedStyle.PRIMARY_COLOR.border, paddingBottom: '1em' } },
              this.context.translator.t('Group\'s Elements')
            ),
            _react2.default.createElement(
              'table',
              { style: tablegroupStyle },
              _react2.default.createElement(
                'thead',
                null,
                _react2.default.createElement(
                  'tr',
                  null,
                  _react2.default.createElement('th', { style: iconColStyle }),
                  _react2.default.createElement(
                    'th',
                    null,
                    this.context.translator.t('Layer')
                  ),
                  _react2.default.createElement(
                    'th',
                    null,
                    this.context.translator.t('Prototype')
                  ),
                  _react2.default.createElement(
                    'th',
                    null,
                    this.context.translator.t('Name')
                  )
                )
              ),
              _react2.default.createElement(
                'tbody',
                null,
                elements.entrySeq().map(function (_ref) {
                  var _ref2 = _slicedToArray(_ref, 2),
                      layerID = _ref2[0],
                      layerElements = _ref2[1];

                  return layerElements.entrySeq().map(function (_ref3) {
                    var _ref4 = _slicedToArray(_ref3, 2),
                        elementPrototype = _ref4[0],
                        ElementList = _ref4[1];

                    return ElementList.valueSeq().map(function (elementID) {
                      var element = _this2.props.state.getIn(['scene', 'layers', layerID, elementPrototype, elementID]);

                      return _react2.default.createElement(
                        'tr',
                        {
                          key: elementID
                        },
                        _react2.default.createElement(
                          'td',
                          { style: iconColStyle, title: _this2.context.translator.t('Un-chain Element from Group') },
                          _react2.default.createElement(_fa.FaUnlink, {
                            onClick: function onClick(e) {
                              return _this2.context.groupsActions.removeFromGroup(_this2.props.groupID, layerID, elementPrototype, elementID);
                            },
                            style: styleEditButton
                          })
                        ),
                        _react2.default.createElement(
                          'td',
                          { style: { textAlign: 'center' } },
                          layerID
                        ),
                        _react2.default.createElement(
                          'td',
                          { style: { textAlign: 'center', textTransform: 'capitalize' } },
                          elementPrototype
                        ),
                        _react2.default.createElement(
                          'td',
                          { style: { textAlign: 'center' } },
                          element.name
                        )
                      );
                    });
                  });
                })
              )
            )
          ) : null
        )
      );
    }
  }]);

  return PanelGroupEditor;
}(_react.Component);

exports.default = PanelGroupEditor;

PanelGroupEditor.propTypes = {
  state: _propTypes2.default.object.isRequired,
  groupID: _propTypes2.default.string
};

PanelGroupEditor.contextTypes = {
  catalog: _propTypes2.default.object.isRequired,
  translator: _propTypes2.default.object.isRequired,
  itemsActions: _propTypes2.default.object.isRequired,
  linesActions: _propTypes2.default.object.isRequired,
  holesActions: _propTypes2.default.object.isRequired,
  groupsActions: _propTypes2.default.object.isRequired,
  projectActions: _propTypes2.default.object.isRequired
};


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">

	<title>SVP-client</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="bower_components/html5-boilerplate/css/normalize.css">
	<link rel="stylesheet" href="bower_components/html5-boilerplate/css/main.css">
	<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="css/app.css">
	<link rel="stylesheet" href="css/plugins/modal_reveal/reveal.css">
	<link rel='stylesheet' href='css/plugins/spectrum.css'>