text:
"""Test Dimmable Lighting Control devices."""

import asyncio
import logging

from insteonplm.constants import (COMMAND_LIGHT_OFF_0X13_0X00,
                                  COMMAND_LIGHT_ON_0X11_NONE,
                                  COMMAND_LIGHT_STATUS_REQUEST_0X19_0X00,
                                  COMMAND_LIGHT_STATUS_REQUEST_0X19_NONE,
                                  MESSAGE_ACK,
                                  MESSAGE_TYPE_ALL_LINK_BROADCAST,
                                  MESSAGE_TYPE_DIRECT_MESSAGE_ACK)
from insteonplm.messages.standardSend import StandardSend
from insteonplm.messages.standardReceive import StandardReceive
from insteonplm.messages.messageFlags import MessageFlags
from insteonplm.devices.dimmableLightingControl import (
    DimmableLightingControl, DimmableLightingControl_2475F)
from .mockPLM import MockPLM
from .mockCallbacks import MockCallbacks

_LOGGING = logging.getLogger(__name__)
_LOGGING.setLevel(logging.DEBUG)

def test_dimmableLightingControl():
    """Test generic Dimmable Lighting Control devices."""
    # pylint: disable=too-many-statements
    async def run_test(loop):
        """Asyncio test to run."""
        plm = MockPLM(loop)
        address = '1a2b3c'
        target = '4d5e6f'
        cat = 0x01
        subcat = 0x04
        product_key = None
        description = 'SwitchLinc Dimmer (1000W)'
        model = '2476DH'
        device = DimmableLightingControl(plm, address, cat, subcat,
                                         product_key, description, model)

        assert device.address.hex == address
        assert device.cat == cat
        assert device.subcat == subcat
        assert device.product_key == 0x00  # Product key should not be None
        assert device.description == description
        assert device.model == model
        assert device.id == address

        plm.devices[device.address.hex] = device

        callbacks = MockCallbacks()
        device.states[0x01].register_updates(callbacks.callbackmethod1)

        device.states[0x01].on()
        await asyncio.sleep(.1, loop=loop)
        plm.message_received(StandardSend(
            address, COMMAND_LIGHT_ON_0X11_NONE, cmd2=0xff,
            acknak=MESSAGE_ACK))
        await asyncio.sleep(.1, loop=loop)
        plm.message_received(StandardReceive(
            address, target, COMMAND_LIGHT_ON_0X11_NONE, cmd2=0xff,
            flags=MessageFlags.create(
                MESSAGE_TYPE_DIRECT_MESSAGE_ACK, 0, 2, 3)))
        await asyncio.sleep(.1, loop=loop)
        sentmsg = StandardSend(address, COMMAND_LIGHT_ON_0X11_NONE, cmd2=0xff)
        assert plm.sentmessage == sentmsg.hex
        assert callbacks.callbackvalue1 == 0xff

        device.states[0x01].off()
        await asyncio.sleep(.1, loop=loop)
        recievedmsg = StandardSend(address, COMMAND_LIGHT_OFF_0X13_0X00,
                                   acknak=MESSAGE_ACK)
        plm.message_received(recievedmsg)
        await asyncio.sleep(.1, loop=loop)
        recievedmsg = StandardReceive(
            address, target, COMMAND_LIGHT_OFF_0X13_0X00,
            flags=MessageFlags.create(MESSAGE_TYPE_DIRECT_MESSAGE_ACK,
                                      0, 2, 3))
        plm.message_received(recievedmsg)
        await asyncio.sleep(.1, loop=loop)
        sentmsg = StandardSend(address, COMMAND_LIGHT_OFF_0X13_0X00)
        assert plm.sentmessage == sentmsg.hex
        assert callbacks.callbackvalue1 == 0x00

        device.states[0x01].set_level(0x55)
        await asyncio.sleep(.1, loop=loop)
        recievedmsg = StandardSend(address, COMMAND_LIGHT_ON_0X11_NONE,
                                   cmd2=0x55, acknak=MESSAGE_ACK)
        plm.message_received(recievedmsg)
        await asyncio.sleep(.1, loop=loop)
        recievedmsg = StandardReceive(
            address, target, COMMAND_LIGHT_ON_0X11_NONE, cmd2=0x55,
            flags=MessageFlags.create(MESSAGE_TYPE_DIRECT_MESSAGE_ACK,
                                      0, 2, 3))
        plm.message_received(recievedmsg)
        await asyncio.sleep(.1, loop=loop)
        sentmsg = StandardSend(address, COMMAND_LIGHT_ON_0X11_NONE,
                               cmd2=0x55)
        assert plm.sentmessage == sentmsg.hex
        assert callbacks.callbackvalue1 == 0x55

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run_test(loop))
    open_tasks = asyncio.Task.all_tasks(loop=loop)

    for task in open_tasks:
        if hasattr(task, 'name'):
            _LOGGING.error('Device: %s Task: %s', task.name, task)
        else:
            _LOGGING.error('Task: %s', task)
        if not task.done():
            loop.run_until_complete(task)

def test_dimmableLightingControl_manual_changes():
    """Test manual changes to Dimmable Lighting Controls."""
    async def run_test(loop):
        """Asyncio test method."""
        plm = MockPLM(loop)
        address = '1a2b3c'
        cat = 0x01
        subcat = 0x04
        product_key = None
        description = 'SwitchLinc Dimmer (1000W)'
        model = '2476DH'
        device = DimmableLightingControl(plm, address, cat, subcat,
                                         product_key, description, model)

        assert device.address.hex == address
        assert device.cat == cat
        assert device.subcat == subcat
        assert device.product_key == 0x00  # Product key should not be None
        assert device.description == description
        assert device.model == model
        assert device.id == address

        plm.devices[device.address.hex] = device

        callbacks = MockCallbacks()
        device.states[0x01].register_updates(callbacks.callbackmethod1)

        receivedmsg = StandardReceive(
            address, '000001', COMMAND_LIGHT_ON_0X11_NONE, cmd2=0x66,
            flags=MessageFlags.create(MESSAGE_TYPE_ALL_LINK_BROADCAST,
                                      0, 2, 3))
        plm.message_received(receivedmsg)
        await asyncio.sleep(.1, loop=loop)
        assert callbacks.callbackvalue1 == 0x66

        receivedmsg = StandardReceive(
            address, '000001', COMMAND_LIGHT_OFF_0X13_0X00,
            flags=MessageFlags.create(MESSAGE_TYPE_ALL_LINK_BROADCAST,
                                      0, 2, 3))
        plm.message_received(receivedmsg)
        await asyncio.sleep(.1, loop=loop)
        assert callbacks.callbackvalue1 == 0x00

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run_test(loop))
    open_tasks = asyncio.Task.all_tasks(loop=loop)
    for task in open_tasks:
        if hasattr(task, 'name'):
            _LOGGING.error('Device: %s Task: %s', task.name, task)
        else:
            _LOGGING.error('Task: %s', task)
        if not task.done():
            loop.run_until_complete(task)

def test_dimmableLightingControl_status():
    """Test status updates for Dimmable Lighting Controls."""
    async def run_test(loop):
        """Asyncio test to run."""
        plm = MockPLM(loop)
        address = '1a2b3c'
        target = '4d5e6f'
        cat = 0x01
        subcat = 0x04
        product_key = None
        description = 'SwitchLinc Dimmer (1000W)'
        model = '2476DH'

        device = DimmableLightingControl(plm, address, cat, subcat,
                                         product_key, description, model)

        assert device.address.hex == address
        assert device.cat == cat
        assert device.subcat == subcat
        assert device.product_key == 0x00  # Product key should not be None
        assert device.description == description
        assert device.model == model
        assert device.id == address
        plm.devices[device.address.hex] = device

        callbacks = MockCallbacks()
        device.states[0x01].register_updates(callbacks.callbackmethod1)

        device.async_refresh_state()
        await asyncio.sleep(.1, loop=loop)
        receivedmsg = StandardSend(
            address, COMMAND_LIGHT_STATUS_REQUEST_0X19_0X00,
            acknak=MESSAGE_ACK)
        plm.message_received(receivedmsg)
        await asyncio.sleep(.1, loop=loop)
        receivedmsg = StandardReceive(
            address, target, {'cmd1': 0x08, 'cmd2': 0x27},
            flags=MessageFlags.create(MESSAGE_TYPE_DIRECT_MESSAGE_ACK,
                                      0, 2, 3))
        plm.message_received(receivedmsg)
        await asyncio.sleep(.1, loop=loop)
        sentmsg = StandardSend(address, COMMAND_LIGHT_STATUS_REQUEST_0X19_0X00)
        assert plm.sentmessage == sentmsg.hex
        assert callbacks.callbackvalue1 == 0x27

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run_test(loop))
    open_tasks = asyncio.Task.all_tasks(loop=loop)

    for task in open_tasks:
        if hasattr(task, 'name'):
            _LOGGING.error('Device: %s Task: %s', task.name, task)
        else:
            _LOGGING.error('Task: %s', task)
        if not task.done():
            loop.run_until_complete(task)

def test_switchedLightingControl_2475F():
    """Test device 2475F."""
    async def run_test(loop):
        """Asyncio test."""
        class fanLincStatus():
            """Callback class to capture sensor changes."""

            lightOnLevel = None
            fanOnLevel = None

            # pylint: disable=unused-argument
            def device_status_callback1(self, device_id, state, value):
                """Callback method to capture light changes."""
                self.lightOnLevel = value

            # pylint: disable=unused-argument
            def device_status_callback2(self, device_id, state, value):
                """Callback method to capture fan changes."""
                self.fanOnLevel = value

        mockPLM = MockPLM(loop)
        address = '1a2b3c'
        target = '4d5e6f'

        cat = 0x01
        subcat = 0x2e
        product_key = 0x00
        description = 'FanLinc Dual Band'
        model = '2475F'

        callbacks = fanLincStatus()

        device = DimmableLightingControl_2475F(mockPLM, address, cat, subcat,
                                               product_key, description, model)

        mockPLM.devices[device.address.hex] = device

        assert device.states[0x01].name == 'lightOnLevel'
        assert device.states[0x02].name == 'fanOnLevel'

        device.states[0x01].register_updates(callbacks.device_status_callback1)
        device.states[0x02].register_updates(callbacks.device_status_callback2)

        device.states[0x01].async_refresh_state()
        await asyncio.sleep(.1, loop=loop)
        ackmsg = StandardSend(address, COMMAND_LIGHT_STATUS_REQUEST_0X19_0X00,
                              acknak=MESSAGE_ACK)
        statusmsg = StandardReceive(
            address, target, {'cmd1': 0xdf, 'cmd2': 0x55},
            flags=MessageFlags.create(MESSAGE_TYPE_DIRECT_MESSAGE_ACK,
                                      0, 2, 3))
        mockPLM.message_received(ackmsg)
        await asyncio.sleep(.1, loop=loop)
        mockPLM.message_received(statusmsg)
        await asyncio.sleep(.1, loop=loop)

        assert callbacks.lightOnLevel == 0x55

        device.states[0x02].async_refresh_state()
        await asyncio.sleep(.1, loop=loop)
        ackmsg = StandardSend(address, {'cmd1': 0x19, 'cmd2': 0x03},
                              flags=0x00, acknak=MESSAGE_ACK)
        statusmsg = StandardReceive(
            address, target, {'cmd1': 0xab, 'cmd2': 0x77},
            flags=MessageFlags.create(MESSAGE_TYPE_DIRECT_MESSAGE_ACK,
                                      0, 2, 3))
        mockPLM.message_received(ackmsg)
        await asyncio.sleep(.1, loop=loop)
        mockPLM.message_received(statusmsg)
        await asyncio.sleep(.1, loop=loop)

        assert callbacks.lightOnLevel == 0x55
        assert callbacks.fanOnLevel == 0x77

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run_test(loop))
    open_tasks = asyncio.Task.all_tasks(loop=loop)

    for task in open_tasks:
        if hasattr(task, 'name'):
            _LOGGING.error('Device: %s Task: %s', task.name, task)
        else:
            _LOGGING.error('Task: %s', task)
        if not task.done():
            loop.run_until_complete(task)

def test_dimmableLightingControl_2475F_status():
    """Test device 2475F status updates."""
    async def run_test(loop):
        """Asyncio test."""
        plm = MockPLM(loop)
        address = '1a2b3c'
        target = '4d5e6f'

        cat = 0x01
        subcat = 0x2e
        product_key = 0x00
        description = 'FanLinc Dual Band'
        model = '2475F'

        device = DimmableLightingControl_2475F(plm, address, cat, subcat,
                                               product_key, description, model)

        plm.devices[device.address.hex] = device
        callbacks = MockCallbacks()
        device.states[0x02].register_updates(callbacks.callbackmethod1)

        device.states[0x02].async_refresh_state()
        await asyncio.sleep(.1, loop=loop)
        receivedmsg = StandardSend(
            address, COMMAND_LIGHT_STATUS_REQUEST_0X19_NONE, cmd2=0x03,
            acknak=MESSAGE_ACK)
        plm.message_received(receivedmsg)
        await asyncio.sleep(.1, loop=loop)
        receivedmsg = StandardReceive(
            address, target, {'cmd1': 0x08, 'cmd2': 0x27},
            flags=MessageFlags.create(MESSAGE_TYPE_DIRECT_MESSAGE_ACK,
                                      0, 2, 3))
        plm.message_received(receivedmsg)
        await asyncio.sleep(.1, loop=loop)
        sentmsg = StandardSend(
            address, COMMAND_LIGHT_STATUS_REQUEST_0X19_NONE, cmd2=0x03)
        assert plm.sentmessage == sentmsg.hex
        assert callbacks.callbackvalue1 == 0x27

    loop = asyncio.get_event_loop()
    loop.run_until_complete(run_test(loop))
    open_tasks = asyncio.Task.all_tasks(loop=loop)

    for task in open_tasks:
        if hasattr(task, 'name'):
            _LOGGING.error('Device: %s Task: %s', task.name, task)
        else:
            _LOGGING.error('Task: %s', task)
        if not task.done():
            loop.run_until_complete(task)


text:
namespace FluentAssertions.Equivalency
{
    /// <summary>
    /// Represents a rule that defines how to map the members from the subject-under-test with the members
    /// on the expectation object.
    /// </summary>
    public interface IMemberMatchingRule
    {
        /// <summary>
        /// Attempts to find a member on the expectation that should be compared with the
        /// <paramref name="subjectMember"/> during a structural equality.
        /// </summary>
        /// <remarks>
        /// Whether or not a match is required or optional is up to the specific rule. If no match is found and this is not an issue,
        /// simply return <c>null</c>.
        /// </remarks>
        /// <param name="subjectMember">
        /// The <see cref="FluentAssertions.Equivalency.SelectedMemberInfo"/> of the subject's member for which a match must be found. Can never
        /// be <c>null</c>.
        /// </param>
        /// <param name="expectation">
        /// The expectation object for which a matching member must be returned. Can never be <c>null</c>.
        /// </param>
        /// <param name="memberPath">
        /// The dotted path from the root object to the current member. Will never  be <c>null</c>.
        /// </param>
        /// <param name="config"></param>
        /// <returns>
        /// Returns the <see cref="FluentAssertions.Equivalency.SelectedMemberInfo"/> of the property with which to compare the subject with, or <c>null</c>
        /// if no match was found.
        /// </returns>
        SelectedMemberInfo Match(SelectedMemberInfo subjectMember, object expectation, string memberPath, IEquivalencyAssertionOptions config);
    }
}

redpajama_set_name: RedPajamaGithub


text:
TripleRush: A Fast Distributed Triple Pattern Matcher [![Build Status](https://travis-ci.org/uzh/triplerush.svg?branch=master)](https://travis-ci.org/uzh/triplerush/branches)
=====================================================

Important
---------

Version 6.0.0 has a much more efficient default dictionary implementation and a refactored loading API.

Version 5.0.0 has new dictionary interfaces and implementations. The new MapDB-based String->Int off-heap B-tree is very memory efficient compared to the previous implementation.

Version 4.0.0 allows for fast blocking triple additions that are interleaved with querying. Incrementally updating the cardinality statistics requires work that we deferred for now, which is why we removed the query optimizer in this version. This does affect performance: unless the patterns are arranged well, version 4.0.0 is not suitable for benchmarks. The last released version with the query optimizer is 3.1.0.

How to Compile the Project
--------------------------
Ensure Java 8 is available on the system, verify with "java -version" on the command line.

Install SBT: http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html

Go to the project folder and start SBT on the command line.

To generate an Eclipse project, use the "eclipse" command on the SBT prompt.

To generate a JAR file, use the "assembly" command on the SBT prompt.

Thanks a lot to
---------------
* [University of Zurich](http://www.ifi.uzh.ch/ddis.html) and the [Hasler Foundation](http://www.haslerstiftung.ch/en/home) have funded the research on graph processing.


text:
.class Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;
.super Ljava/lang/Object;
.source "AppCompatViewInflater.java"

# interfaces
.implements Landroid/view/View$OnClickListener;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/support/v7/app/AppCompatViewInflater;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "DeclaredOnClickListener"
.end annotation

# instance fields
.field private final mHostView:Landroid/view/View;

.field private final mMethodName:Ljava/lang/String;

.field private mResolvedContext:Landroid/content/Context;

.field private mResolvedMethod:Ljava/lang/reflect/Method;

# direct methods
.method public constructor <init>(Landroid/view/View;Ljava/lang/String;)V
    .registers 3
    .param p1, "hostView"    # Landroid/view/View;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param
    .param p2, "methodName"    # Ljava/lang/String;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param

    .prologue
    .line 276
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 277
    iput-object p1, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mHostView:Landroid/view/View;

    .line 278
    iput-object p2, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mMethodName:Ljava/lang/String;

    .line 279
    return-void
.end method

.method private resolveMethod(Landroid/content/Context;Ljava/lang/String;)V
    .registers 11
    .param p1, "context"    # Landroid/content/Context;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param
    .param p2, "name"    # Ljava/lang/String;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param
    .annotation build Landroid/support/annotation/NonNull;
    .end annotation

    .prologue
    .line 300
    :goto_0
    if-eqz p1, :cond_2f

    .line 302
    :try_start_2
    invoke-virtual {p1}, Landroid/content/Context;->isRestricted()Z

    move-result v3

    if-nez v3, :cond_22

    .line 303
    invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v3

    iget-object v4, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mMethodName:Ljava/lang/String;

    const/4 v5, 0x1

    new-array v5, v5, [Ljava/lang/Class;

    const/4 v6, 0x0

    const-class v7, Landroid/view/View;

    aput-object v7, v5, v6

    invoke-virtual {v3, v4, v5}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v2

    .line 304
    .local v2, "method":Ljava/lang/reflect/Method;
    if-eqz v2, :cond_22

    .line 305
    iput-object v2, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mResolvedMethod:Ljava/lang/reflect/Method;

    .line 306
    iput-object p1, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mResolvedContext:Landroid/content/Context;
    :try_end_20
    .catch Ljava/lang/NoSuchMethodException; {:try_start_2 .. :try_end_20} :catch_21

    .line 307
    return-void

    .line 310
    .end local v2    # "method":Ljava/lang/reflect/Method;
    :catch_21
    move-exception v3

    .line 314
    :cond_22
    instance-of v3, p1, Landroid/content/ContextWrapper;

    if-eqz v3, :cond_2d

    .line 315
    check-cast p1, Landroid/content/ContextWrapper;

    .end local p1    # "context":Landroid/content/Context;
    invoke-virtual {p1}, Landroid/content/ContextWrapper;->getBaseContext()Landroid/content/Context;

    move-result-object p1

    .restart local p1    # "context":Landroid/content/Context;
    goto :goto_0

    .line 318
    :cond_2d
    const/4 p1, 0x0

    goto :goto_0

    .line 322
    :cond_2f
    iget-object v3, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mHostView:Landroid/view/View;

    invoke-virtual {v3}, Landroid/view/View;->getId()I

    move-result v0

    .line 323
    .local v0, "id":I
    const/4 v3, -0x1

    if-ne v0, v3, :cond_6f

    const-string v1, ""

    .line 325
    .local v1, "idText":Ljava/lang/String;
    :goto_3a
    new-instance v3, Ljava/lang/IllegalStateException;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "Could not find method "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v5, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mMethodName:Ljava/lang/String;

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "(View) in a parent or ancestor Context for android:onClick "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, "attribute defined on view "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v5, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mHostView:Landroid/view/View;

    .line 327
    invoke-virtual {v5}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v3

    .line 323
    .end local v1    # "idText":Ljava/lang/String;
    :cond_6f
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, " with id \'"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v4, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mHostView:Landroid/view/View;

    .line 324
    invoke-virtual {v4}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v4

    invoke-virtual {v4}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    invoke-virtual {v4, v0}, Landroid/content/res/Resources;->getResourceEntryName(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "\'"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    goto :goto_3a
.end method

# virtual methods
.method public onClick(Landroid/view/View;)V
    .registers 7
    .param p1, "v"    # Landroid/view/View;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param

    .prologue
    .line 283
    iget-object v1, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mResolvedMethod:Ljava/lang/reflect/Method;

    if-nez v1, :cond_f

    .line 284
    iget-object v1, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mHostView:Landroid/view/View;

    invoke-virtual {v1}, Landroid/view/View;->getContext()Landroid/content/Context;

    move-result-object v1

    iget-object v2, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mMethodName:Ljava/lang/String;

    invoke-direct {p0, v1, v2}, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->resolveMethod(Landroid/content/Context;Ljava/lang/String;)V

    .line 288
    :cond_f
    :try_start_f
    iget-object v1, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mResolvedMethod:Ljava/lang/reflect/Method;

    iget-object v2, p0, Landroid/support/v7/app/AppCompatViewInflater$DeclaredOnClickListener;->mResolvedContext:Landroid/content/Context;

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    aput-object p1, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1c
    .catch Ljava/lang/IllegalAccessException; {:try_start_f .. :try_end_1c} :catch_1d
    .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_f .. :try_end_1c} :catch_26

    .line 296
    return-void

    .line 289
    :catch_1d
    move-exception v0

    .line 290
    .local v0, "e":Ljava/lang/IllegalAccessException;
    new-instance v1, Ljava/lang/IllegalStateException;

    const-string v2, "Could not execute non-public method for android:onClick"

    invoke-direct {v1, v2, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1

    .line 292
    .end local v0    # "e":Ljava/lang/IllegalAccessException;
    :catch_26
    move-exception v0

    .line 293
    .local v0, "e":Ljava/lang/reflect/InvocationTargetException;
    new-instance v1, Ljava/lang/IllegalStateException;

    const-string v2, "Could not execute method for android:onClick"

    invoke-direct {v1, v2, v0}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1
.end method


text:
package android.net;

public class DummyDataStateTracker
  implements NetworkStateTracker
{
  // Constructors

  public DummyDataStateTracker(int arg1, java.lang.String arg2){
  }
  // Methods

  public java.lang.String toString(){
    return (java.lang.String) null;
  }
  public boolean teardown(){
    return false;
  }
  public boolean reconnect(){
    return false;
  }
  public boolean isAvailable(){
    return false;
  }
  public LinkProperties getLinkProperties(){
    return (LinkProperties) null;
  }
  public LinkCapabilities getLinkCapabilities(){
    return (LinkCapabilities) null;
  }
  public void startMonitoring(android.content.Context arg1, android.os.Handler arg2){
  }
  public void releaseWakeLock(){
  }
  public boolean setRadio(boolean arg1){
    return false;
  }
  public boolean isPrivateDnsRouteSet(){
    return false;
  }
  public void privateDnsRouteSet(boolean arg1){
  }
  public NetworkInfo getNetworkInfo(){
    return (NetworkInfo) null;
  }
  public boolean isDefaultRouteSet(){
    return false;
  }
  public void defaultRouteSet(boolean arg1){
  }
  public java.lang.String getTcpBufferSizesPropName(){
    return (java.lang.String) null;
  }
  public void setTeardownRequested(boolean arg1){
  }
  public boolean isTeardownRequested(){
    return false;
  }
  public void setUserDataEnable(boolean arg1){
  }
  public void setPolicyDataEnable(boolean arg1){
  }
  public void setDependencyMet(boolean arg1){
  }
}


text:
package ilove.quark.us;

import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;

@QuarkusTest
public class GreetingControllerTest {

    @Test
    public void testHelloEndpoint() {
        given()
          .when().get("/greeting")
          .then()
             .statusCode(200)
             .body(is("Hello Spring"));
    }

}


text:
using System.Collections.Generic;
using System.Linq;
using SFA.DAS.Payments.AcceptanceTests.ReferenceDataModels;
using SFA.DAS.Payments.AcceptanceTests.ResultsDataModels;

namespace SFA.DAS.Payments.AcceptanceTests.Assertions.TransactionTypeRules
{
    public class ProviderEarnedForDisadvantageUpliftRule : ProviderTransationTypeRuleBase
    {
        protected override IEnumerable<PaymentResult> FilterPeriodPayments(IEnumerable<PaymentResult> periodPayments)
        {
            return periodPayments.Where(p => p.TransactionType == TransactionType.FirstDisadvantagePayment
                                          || p.TransactionType == TransactionType.SecondDisadvantagePayment);
        }

        protected override string FormatAssertionFailureMessage(PeriodValue period, decimal actualPaymentInPeriod)
        {
            var providerPeriod = (ProviderEarnedPeriodValue)period;
            var specPeriod = providerPeriod.PeriodName.ToPeriodDateTime().AddMonths(-1).ToPeriodName();
            return $"Expected {providerPeriod.ProviderId} to be paid {period.Value} in {specPeriod} for disadvantaged incentive but was actually paid {actualPaymentInPeriod}";
        }
    }
}


text:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';

import { AppComponent } from './app.component';
import { UsuariosComponent } from './usuarios/usuarios.component';
import { PerfilesComponent } from './perfiles/perfiles.component';
import { GraficoComponent } from './grafico/grafico.component';
import { NoencontradoComponent } from './noencontrado/noencontrado.component';
import { UsuariosService } from './usuarios.service';
import { PerfilesService } from './perfiles.service';
import { TiempoService } from './tiempo.service';
import { HttpClientModule } from '@angular/common/http';
import { HomeComponent } from './home/home.component';

@NgModule({
  declarations: [
    AppComponent,
    UsuariosComponent,
    PerfilesComponent,
    GraficoComponent,
    NoencontradoComponent,
    HomeComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    HttpClientModule
  ],
  providers: [UsuariosService, PerfilesService, TiempoService],
  bootstrap: [AppComponent]
})
export class AppModule { }


text:
import matplotlib.cm as cm
import numpy
import pylab
import operator, copy, os

from myternaryutility import TernaryPlot
from myquaternaryutility import QuaternaryPlot

from quaternary_FOM_stackedtern20 import *

axl, stpl=make20ternaxes()

gridi=20
comps_10full=[(a*1./gridi, b*1./gridi, c*1./gridi, (gridi-a-b-c)*1./gridi) for a in numpy.arange(0,1+gridi) for b in numpy.arange(0,1+gridi-a) for c in numpy.arange(0,1+gridi-a-b)]
comps_10full=list(set(comps_10full))
print len(comps_10full)
#plotpoints_cmyk
comps_10full=numpy.array(comps_10full)

pylab.figure()
stpquat=QuaternaryPlot(111)
cols=stpquat.rgb_comp(comps_10full)
stpquat.scatter(comps_10full, c=cols, s=20, edgecolors='none')
scatter_20axes(comps_10full, cols, stpl, s=20, edgecolors='none', cmap=cm.jet, norm=None, cb=True)
stpquat.label()

pylab.savefig('stackedtern_quat.png')
pylab.figure(axl[0].figure.number)
pylab.savefig('stackedtern.png')

pylab.show()


text:
<!DOCTYPE html>

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

    <title>Hello World</title>

    <link rel="stylesheet" href="assets/startbootstrap-creative/css/bootstrap.min.css" type="text/css">

    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='assets/text/css'>
    <link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='assets/text/css'>
    <link rel="stylesheet" href="assets/font-awesome/css/font-awesome.min.css" type="text/css">

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

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

                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Start Bootstrap

                        About

                        Services

                        Portfolio

                        Contact

Super Ninja Awesome Fun

Wow! Pow! Alakazam! Look at how much fun this is.

                Find Out More

Super Ninjas!

Super ninjas are awesome and fun. No strings attached!

                    Get Started!

At Your Service

Sturdy Templates

Our ninjas are updated regularly so they don't break.

Ready to Ship

You can use this super awesome fun as is, or you can make changes!

Up to Date

We update dependencies to keep things fresh.

Made with Love

You have to make your ninja awesome fun with love these days!

                                    Category

                                    Project Name

                                    Category

                                    Project Name

                                    Category

                                    Project Name

                                    Category

                                    Project Name

                                    Category

                                    Project Name

                                    Category

                                    Project Name

Free Download at Start Bootstrap!

                Download Now!

Let's Get In Touch!

Ready to start your next project with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!

123-456-6789

feedback@startbootstrap.com


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="spring-jndi-mybatis" version="2.5">

    <display-name>spring-jpa</display-name>

   <!--
		- Location of the XML file that defines the root application context.
		- Applied by ContextLoaderListener.
	-->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
        	classpath:ctx.xml
        	classpath:spring-db-mongo.xml
        </param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!--
		- Servlet that dispatches request to registered handlers (Controller implementations).
	-->
    <servlet>
        <servlet-name>dispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/mvc-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>dispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

</web-app>


text:
=head1 NAME
X<format> X<report> X<chart>

perlform - Perl formats

=head1 DESCRIPTION

Perl has a mechanism to help you generate simple reports and charts.  To
facilitate this, Perl helps you code up your output page close to how it
will look when it's printed.  It can keep track of things like how many
lines are on a page, what page you're on, when to print page headers,
etc.  Keywords are borrowed from FORTRAN: format() to declare and write()
to execute; see their entries in L<perlfunc>.  Fortunately, the layout is
much more legible, more like BASIC's PRINT USING statement.  Think of it
as a poor man's nroff(1).
X<nroff>

Formats, like packages and subroutines, are declared rather than
executed, so they may occur at any point in your program.  (Usually it's
best to keep them all together though.) They have their own namespace
apart from all the other "types" in Perl.  This means that if you have a
function named "Foo", it is not the same thing as having a format named
"Foo".  However, the default name for the format associated with a given
filehandle is the same as the name of the filehandle.  Thus, the default
format for STDOUT is named "STDOUT", and the default format for filehandle
TEMP is named "TEMP".  They just look the same.  They aren't.

Output record formats are declared as follows:

    format NAME =
    FORMLIST
    .

If the name is omitted, format "STDOUT" is defined. A single "." in
column 1 is used to terminate a format.  FORMLIST consists of a sequence
of lines, each of which may be one of three types:

=over 4

=item 1.

A comment, indicated by putting a '#' in the first column.

=item 2.

A "picture" line giving the format for one output line.

=item 3.

An argument line supplying values to plug into the previous picture line.

=back

Picture lines contain output field definitions, intermingled with
literal text. These lines do not undergo any kind of variable interpolation.
Field definitions are made up from a set of characters, for starting and
extending a field to its desired width. This is the complete set of
characters for field definitions:
X<format, picture line>
X<@> X<^> X<< < >> X<< | >> X<< > >> X<#> X<0> X<.> X<...>
X<@*> X<^*> X<~> X<~~>

   @    start of regular field
   ^    start of special field
   <    pad character for left justification
   |    pad character for centering
   >    pad character for right justification
   #    pad character for a right-justified numeric field
   0    instead of first #: pad number with leading zeroes
   .    decimal point within a numeric field
   ...  terminate a text field, show "..." as truncation evidence
   @*   variable width field for a multi-line value
   ^*   variable width field for next line of a multi-line value
   ~    suppress line with all fields empty
   ~~   repeat line until all fields are exhausted

Each field in a picture line starts with either "@" (at) or "^" (caret),
indicating what we'll call, respectively, a "regular" or "special" field.
The choice of pad characters determines whether a field is textual or
numeric. The tilde operators are not part of a field.  Let's look at
the various possibilities in detail.

=head2 Text Fields
X<format, text field>

The length of the field is supplied by padding out the field with multiple
"E<lt>", "E<gt>", or "|" characters to specify a non-numeric field with,
respectively, left justification, right justification, or centering.
For a regular field, the value (up to the first newline) is taken and
printed according to the selected justification, truncating excess characters.
If you terminate a text field with "...", three dots will be shown if
the value is truncated. A special text field may be used to do rudimentary
multi-line text block filling; see L</Using Fill Mode> for details.

   Example:
      format STDOUT =
      @<<<<<<   @||||||   @>>>>>>
      "left",   "middle", "right"
      .
   Output:
      left      middle    right

=head2 Numeric Fields
X<#> X<format, numeric field>

Using "#" as a padding character specifies a numeric field, with
right justification. An optional "." defines the position of the
decimal point. With a "0" (zero) instead of the first "#", the
formatted number will be padded with leading zeroes if necessary.
A special numeric field is blanked out if the value is undefined.
If the resulting value would exceed the width specified the field is
filled with "#" as overflow evidence.

   Example:
      format STDOUT =
      @###   @.###   @##.###  @###   @###   ^####
       42,   3.1415,  undef,    0, 10000,   undef
      .
   Output:
        42   3.142     0.000     0   ####

=head2 The Field @* for Variable-Width Multi-Line Text
X<@*>

The field "@*" can be used for printing multi-line, nontruncated
values; it should (but need not) appear by itself on a line. A final
line feed is chomped off, but all other characters are emitted verbatim.

=head2 The Field ^* for Variable-Width One-line-at-a-time Text
X<^*>

Like "@*", this is a variable-width field. The value supplied must be a
scalar variable. Perl puts the first line (up to the first "\n") of the
text into the field, and then chops off the front of the string so that
the next time the variable is referenced, more of the text can be printed.
The variable will I<not> be restored.

   Example:
      $text = "line 1\nline 2\nline 3";
      format STDOUT =
      Text: ^*
            $text
      ~~    ^*
            $text
      .
   Output:
      Text: line 1
            line 2
            line 3

=head2 Specifying Values
X<format, specifying values>

The values are specified on the following format line in the same order as
the picture fields.  The expressions providing the values must be
separated by commas.  They are all evaluated in a list context
before the line is processed, so a single list expression could produce
multiple list elements.  The expressions may be spread out to more than
one line if enclosed in braces.  If so, the opening brace must be the first
token on the first line.  If an expression evaluates to a number with a
decimal part, and if the corresponding picture specifies that the decimal
part should appear in the output (that is, any picture except multiple "#"
characters B<without> an embedded "."), the character used for the decimal
point is determined by the current LC_NUMERIC locale if C<use locale> is in
effect.  This means that, if, for example, the run-time environment happens
to specify a German locale, "," will be used instead of the default ".".  See
L<perllocale> and L<"WARNINGS"> for more information.

=head2 Using Fill Mode
X<format, fill mode>

On text fields the caret enables a kind of fill mode.  Instead of an
arbitrary expression, the value supplied must be a scalar variable
that contains a text string.  Perl puts the next portion of the text into
the field, and then chops off the front of the string so that the next time
the variable is referenced, more of the text can be printed.  (Yes, this
means that the variable itself is altered during execution of the write()
call, and is not restored.)  The next portion of text is determined by
a crude line-breaking algorithm. You may use the carriage return character
(C<\r>) to force a line break. You can change which characters are legal
to break on by changing the variable C<$:> (that's
$FORMAT_LINE_BREAK_CHARACTERS if you're using the English module) to a
list of the desired characters.

Normally you would use a sequence of fields in a vertical stack associated
with the same scalar variable to print out a block of text. You might wish
to end the final field with the text "...", which will appear in the output
if the text was too long to appear in its entirety.

=head2 Suppressing Lines Where All Fields Are Void
X<format, suppressing lines>

Using caret fields can produce lines where all fields are blank. You can
suppress such lines by putting a "~" (tilde) character anywhere in the
line.  The tilde will be translated to a space upon output.

=head2 Repeating Format Lines
X<format, repeating lines>

If you put two contiguous tilde characters "~~" anywhere into a line,
the line will be repeated until all the fields on the line are exhausted,
i.e. undefined. For special (caret) text fields this will occur sooner or
later, but if you use a text field of the at variety, the  expression you
supply had better not give the same value every time forever! (C<shift(@f)>
is a simple example that would work.)  Don't use a regular (at) numeric
field in such lines, because it will never go blank.

=head2 Top of Form Processing
X<format, top of form> X<top> X<header>

Top-of-form processing is by default handled by a format with the
same name as the current filehandle with "_TOP" concatenated to it.
It's triggered at the top of each page.  See L<perlfunc/write>.

Examples:

 # a report on the /etc/passwd file
 format STDOUT_TOP =
                         Passwd File
 Name                Login    Office   Uid   Gid Home
 ------------------------------------------------------------------
 .
 format STDOUT =
 @<<<<<<<<<<<<<<<<<< @||||||| @<<<<<<@>>>> @>>>> @<<<<<<<<<<<<<<<<<
 $name,              $login,  $office,$uid,$gid, $home
 .

 # a report from a bug report form
 format STDOUT_TOP =
                         Bug Reports
 @<<<<<<<<<<<<<<<<<<<<<<<     @|||         @>>>>>>>>>>>>>>>>>>>>>>>
 $system,                      $%,         $date
 ------------------------------------------------------------------
 .
 format STDOUT =
 Subject: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
          $subject
 Index: @<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        $index,                       $description
 Priority: @<<<<<<<<<< Date: @<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
           $priority,        $date,   $description
 From: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
       $from,                         $description
 Assigned to: @<<<<<<<<<<<<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              $programmer,            $description
 ~                                    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                      $description
 ~                                    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                      $description
 ~                                    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                      $description
 ~                                    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<
                                      $description
 ~                                    ^<<<<<<<<<<<<<<<<<<<<<<<...
                                      $description
 .

It is possible to intermix print()s with write()s on the same output
channel, but you'll have to handle C<$-> (C<$FORMAT_LINES_LEFT>)
yourself.

=head2 Format Variables
X<format variables>
X<format, variables>

The current format name is stored in the variable C<$~> (C<$FORMAT_NAME>),
and the current top of form format name is in C<$^> (C<$FORMAT_TOP_NAME>).
The current output page number is stored in C<$%> (C<$FORMAT_PAGE_NUMBER>),
and the number of lines on the page is in C<$=> (C<$FORMAT_LINES_PER_PAGE>).
Whether to autoflush output on this handle is stored in C<$|>
(C<$OUTPUT_AUTOFLUSH>).  The string output before each top of page (except
the first) is stored in C<$^L> (C<$FORMAT_FORMFEED>).  These variables are
set on a per-filehandle basis, so you'll need to select() into a different
one to affect them:

    select((select(OUTF),
	    $~ = "My_Other_Format",
	    $^ = "My_Top_Format"
	   )[0]);

Pretty ugly, eh?  It's a common idiom though, so don't be too surprised
when you see it.  You can at least use a temporary variable to hold
the previous filehandle: (this is a much better approach in general,
because not only does legibility improve, you now have an intermediary
stage in the expression to single-step the debugger through):

    $ofh = select(OUTF);
    $~ = "My_Other_Format";
    $^ = "My_Top_Format";
    select($ofh);

If you use the English module, you can even read the variable names:

    use English '-no_match_vars';
    $ofh = select(OUTF);
    $FORMAT_NAME     = "My_Other_Format";
    $FORMAT_TOP_NAME = "My_Top_Format";
    select($ofh);

But you still have those funny select()s.  So just use the FileHandle
module.  Now, you can access these special variables using lowercase
method names instead:

    use FileHandle;
    format_name     OUTF "My_Other_Format";
    format_top_name OUTF "My_Top_Format";

Much better!

=head1 NOTES

Because the values line may contain arbitrary expressions (for at fields,
not caret fields), you can farm out more sophisticated processing
to other functions, like sprintf() or one of your own.  For example:

    format Ident =
	@<<<<<<<<<<<<<<<
	&commify($n)
    .

To get a real at or caret into the field, do this:

    format Ident =
    I have an @ here.
	    "@"
    .

To center a whole line of text, do something like this:

    format Ident =
    @|||||||||||||||||||||||||||||||||||||||||||||||
	    "Some text line"
    .

There is no builtin way to say "float this to the right hand side
of the page, however wide it is."  You have to specify where it goes.
The truly desperate can generate their own format on the fly, based
on the current number of columns, and then eval() it:

    $format  = "format STDOUT = \n"
             . '^' . '<' x $cols . "\n"
             . '$entry' . "\n"
             . "\t^" . "<" x ($cols-8) . "~~\n"
             . '$entry' . "\n"
             . ".\n";
    print $format if $Debugging;
    eval $format;
    die $@ if $@;

Which would generate a format looking something like this:

 format STDOUT =
 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 $entry
         ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
 $entry
 .

Here's a little program that's somewhat like fmt(1):

 format =
 ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
 $_

 .

 $/ = '';
 while (<>) {
     s/\s*\n\s*/ /g;
     write;
 }

=head2 Footers
X<format, footer> X<footer>

While $FORMAT_TOP_NAME contains the name of the current header format,
there is no corresponding mechanism to automatically do the same thing
for a footer.  Not knowing how big a format is going to be until you
evaluate it is one of the major problems.  It's on the TODO list.

Here's one strategy:  If you have a fixed-size footer, you can get footers
by checking $FORMAT_LINES_LEFT before each write() and print the footer
yourself if necessary.

Here's another strategy: Open a pipe to yourself, using C<open(MYSELF, "|-")>
(see L<perlfunc/open>) and always write() to MYSELF instead of STDOUT.
Have your child process massage its STDIN to rearrange headers and footers
however you like.  Not very convenient, but doable.

=head2 Accessing Formatting Internals
X<format, internals>

For low-level access to the formatting mechanism.  you may use formline()
and access C<$^A> (the $ACCUMULATOR variable) directly.

For example:

    $str = formline <<'END', 1,2,3;
    @<<<  @|||  @>>>
    END

    print "Wow, I just stored '$^A' in the accumulator!\n";

Or to make an swrite() subroutine, which is to write() what sprintf()
is to printf(), do this:

    use Carp;
    sub swrite {
	croak "usage: swrite PICTURE ARGS" unless @_;
	my $format = shift;
	$^A = "";
	formline($format,@_);
	return $^A;
    }

    $string = swrite(<<'END', 1, 2, 3);
 Check me out
 @<<<  @|||  @>>>
 END
    print $string;

=head1 WARNINGS

The lone dot that ends a format can also prematurely end a mail
message passing through a misconfigured Internet mailer (and based on
experience, such misconfiguration is the rule, not the exception).  So
when sending format code through mail, you should indent it so that
the format-ending dot is not on the left margin; this will prevent
SMTP cutoff.

Lexical variables (declared with "my") are not visible within a
format unless the format is declared within the scope of the lexical
variable.  (They weren't visible at all before version 5.001.)

If a program's environment specifies an LC_NUMERIC locale and C<use
locale> is in effect when the format is declared, the locale is used
to specify the decimal point character in formatted output.  Formatted
output cannot be controlled by C<use locale> at the time when write()
is called. See L<perllocale> for further discussion of locale handling.

Within strings that are to be displayed in a fixed-length text field,
each control character is substituted by a space. (But remember the
special meaning of C<\r> when using fill mode.) This is done to avoid
misalignment when control characters "disappear" on some output media.


text:
title: Slack Stack Attack
author: Josh Habdas
date: 2015-06-08T16:44:53-05:00
author_profile: false
comments: false
share: false
categories: [reference]
tags: [stacks, cross-platoform, native, web]
link: https://github.com/atom/electron
---

Since the day I started using Slack at my last company I marveled at the composition of the application and how it ran both on Web and native desktop environments using a native wrapper around Web. I spent a little time trying to reverse-engineer the stack to understand what it was building on top of, deducing only it wasn't using [NW.js](https://github.com/nwjs/nw.js/). So, what then? I queried colleagues and Twitterverse only to come up empty-handed. And then, as things sometimes are in the world of discovery, I stumbled across a repo starred by [@sindresorhus](https://github.com/sindresorhus) and there it was: [Electron](http://electron.atom.io/).

Of course the search would've been much easier had I know about StackShare at the time when Slack posted [their tech stack](http://stackshare.io/slack/slack/details).


text:
<?php require_once('includes/header.php') ?>

  <?php require_once('includes/flash_box.php') ?>

Add an exam

    <form class="add-exam-form" method="post" action="/add_exam">
      <select name="subject_id">
        <option value="" selected disabled>Subject</option>
        <?php foreach ($subjects as $subject): ?>
          <option value="<?=$subject->id?>"><?=$subject->name?></option>
        <?php endforeach ?>
      </select>
      <select name="type_id">
        <option value="" selected disabled>Type</option>
        <?php foreach ($exam_types as $exam_type): ?>
          <option value="<?=$exam_type->id?>"><?=$exam_type->name?></option>
        <?php endforeach ?>
      </select>
      <input type="date" name="exam_date" id="exam-date" value="<?=$today?>">
      <select name="grade">
        <option value="" selected disabled>Grade</option>
        <option value="">No grade yet</option>
        <?php foreach($grades as $grade): ?>
          <option value="<?=$grade?>"><?=$grade?></option>
        <?php endforeach ?>
      </select>
      <input type="hidden" name="student_id" value="<?=$student->id?>" required>
      <input type="submit" class="btn add-btn" value="Add exam">
    </form>

Upcoming exams

      <?php if ($exams->upcoming): ?>
        <?php foreach ($exams->upcoming as $upcoming_exam): ?>

<?=$upcoming_exam->subject_name?>

<?=date_format(date_create($upcoming_exam->date), 'l, F \t\h\e jS');?>

<?=$upcoming_exam->type?>

              <a class="edit-btn" href="/edit_exam/<?=$upcoming_exam->id?>">Edit
              <form action="/delete_exam" class="inline-form" method="post">
                <input name="exam_id" type="hidden" value="<?=$upcoming_exam->id?>">
                <input name="student_id" type="hidden" value="<?=$student->id?>">
                <input class="inline-form-button delete-btn" type="submit" value="Delete"
                      onclick="return confirm('Are you sure?')">
              </form>

        <?php endforeach ?>
      <?php else: ?>

There are no exams here.

      <?php endif ?>

Past exams

      <?php if ($exams->past): ?>
        <?php foreach ($exams->past as $past_exam): ?>

<?=$past_exam->subject_name?>

<?=date_format(date_create($past_exam->date), 'l, F \t\h\e jS');?>

<?=$past_exam->type?>

              <a class="edit-btn" href="/edit_exam/<?=$past_exam->id?>">Edit
              <form action="/delete_exam" class="inline-form" method="post">
                <input name="exam_id" type="hidden" value="<?=$past_exam->id?>">
                <input name="student_id" type="hidden" value="<?=$student->id?>">
                <input class="inline-form-button delete-btn" type="submit" value="Delete"
                      onclick="return confirm('Are you sure?')">
              </form>

        <?php endforeach ?>
      <?php else: ?>

There are no exams here.

      <?php endif ?>

<?php require_once('includes/timer.php') ?>

<?php require_once('includes/footer.php') ?>


text:
package chord.analyses.logsite;

import java.util.List;

import joeq.Class.jq_Method;
import joeq.Compiler.Quad.BasicBlock;
import joeq.Compiler.Quad.ControlFlowGraph;
import joeq.Compiler.Quad.Operand.AConstOperand;
import joeq.Compiler.Quad.Operand.RegisterOperand;
import joeq.Compiler.Quad.Quad;
import joeq.Compiler.Quad.RegisterFactory.Register;
import lombok.Data;
import chord.project.Chord;
import chord.project.ClassicProject;
import chord.project.analyses.JavaAnalysis;
import chord.project.analyses.ProgramRel;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ListMultimap;
import com.google.common.collect.Lists;

/**
 * This implements a simple analysis that prints the call-site -> call target
 * information. The name of the analysis is "logsite-java".
 */
@Chord(name = "logsite-java", consumes = { "MLogInvkInst" })
public class LogsiteAnalysis extends JavaAnalysis {

	public void run() {

		ProgramRel relMLogInvkInst = (ProgramRel) ClassicProject.g().getTrgt("MLogInvkInst");
		relMLogInvkInst.load();

		for (Object[] tuple : relMLogInvkInst.getAryNValTuples()) {

			Quad q = (Quad) tuple[1]; // the call-site, in quad format
			jq_Method m_caller = q.getMethod(); // the callee method

			String file = m_caller.getDeclaringClass().getSourceFileName(); // file
//			System.out.println("Call site @" + q.getMethod() + " in file " + q.getMethod().getDeclaringClass().getSourceFileName() + " on line " + q.getLineNumber() + " " +  q);

			// TODO: better to filter with chord.ext.scope.exclude
			if (!file.startsWith("org/apache/hadoop")) {
				continue;
			}

			List<RegId> regIds = Lists.newArrayList();
			joeq.Util.Templates.List.RegisterOperand usedRegisters = q.getUsedRegisters();
			for (int i = 0; i < usedRegisters.size(); i++) {
				RegisterOperand reg = usedRegisters.getRegisterOperand(i);
				regIds.add(new RegId(reg.getRegister()));
			}
			final List<RegId> roots = Lists.newArrayList(regIds);

			ControlFlowGraph cfg = m_caller.getCFG();
			joeq.Util.Templates.ListIterator.BasicBlock reversePostOrderIterator = cfg.reversePostOrderIterator();
			List<BasicBlock> reverse = Lists.reverse(Lists.newArrayList(reversePostOrderIterator));
			ListMultimap<RegId, RegId> multimap = ArrayListMultimap.create();
			for (BasicBlock bb : reverse) {
				for (int i = bb.size() - 1; i >= 0; i--) {
					Quad quad = bb.getQuad(i);
					if (quad.toString().contains("PHI")) { // if its a phi function, just skip
						continue;
					}
					joeq.Util.Templates.List.RegisterOperand regs = quad.getDefinedRegisters();
					for (int j = 0; j < regs.size(); j++) {
						RegisterOperand reg = regs.getRegisterOperand(j);
						if (regIds.contains(new RegId(reg.getRegister()))) {
							final RegId regId = regIds.get(regIds.indexOf(new RegId(reg.getRegister())));

							regId.setDefinitionQuad(quad);
							regIds.remove(regId);
							joeq.Util.Templates.List.RegisterOperand usedRegs = quad.getUsedRegisters();
							for (int k = 0; k < usedRegs.size(); k++) {
								RegId newRegId = new RegId(usedRegs.getRegisterOperand(k).getRegister());
								multimap.put(regId, newRegId);
								regIds.add(newRegId);
							}
						}
					}
				}
			}

			final int line = q.getLineNumber(); // line number
			System.out.println("LogSiteAnalysis: call instruction at line: " + line + "@" + file + " is from: " + m_caller);

			for (RegId root : roots) {
				final String regex = makeRegex(new StringBuilder(), root, multimap);
				if (!regex.isEmpty()) {
					System.out.println(regex);
				}
			}
		}

	}

	private String makeRegex(StringBuilder sb, RegId curNode, ListMultimap<RegId, RegId> multimap) {
		final Quad definitionQuad = curNode.getDefinitionQuad();
		if (definitionQuad == null) {
			sb.append(".*");
		} else if (definitionQuad.getOp2() instanceof AConstOperand) {
			// TODO: fix for NPE on Server.java (ipc) line 979 - 0 arg functions
			final String value = (((AConstOperand) definitionQuad.getOp2()).getValue()).toString();
			sb.append(value);
		}
		for (RegId reg : multimap.get(curNode)) {
			sb.append(makeRegex(new StringBuilder(), reg, multimap));
		}
		return sb.toString();
	}

	@Data
	public static class RegId {
		final int number;
		final boolean isTemp;
		Quad definitionQuad;

		public RegId(Register r) {
			this.number = r.getNumber();
			this.isTemp = r.isTemp();
		}

		// @Override
		// public String toString() {
		// return (isTemp ? "T" : "R") + number;
		// }
	}

}


text:
package main

import (
	"net/http"
	"net/http/httptest"
	"strings"
	"testing"
)

func TestHomePageGet(t *testing.T) {
	req, err := http.NewRequest("GET", "http://localhost:4000/", nil)
	if err != nil {
		t.Error("GET did not work as expected.")
		t.Log(err)
	}

	w := httptest.NewRecorder()
	homeHandler(w, req)

	if w.Code != 200 && w.Code != 202 {
		t.Error("GET did not work as expected. the status was not ", http.StatusOK, ", it was ", w.Code)
	}

	if !strings.Contains(w.Body.String(), "home") {
		t.Error("GET homepage did not return correct content ", w.Body.String(), " I expected to see some reference to home")
	}

	t.Log("status:", w.Code, "body:", w.Body.String())
}

func TestAboutUsGet(t *testing.T) {
	req, err := http.NewRequest("GET", "http://localhost:4000/aboutus/", nil)
	if err != nil {
		t.Error("GET did not work as expected.")
		t.Log(err)
	}

	w := httptest.NewRecorder()
	aboutUsHandler(w, req)

	if w.Code != 200 && w.Code != 202 {
		t.Error("GET did not work as expected. the status was not ", http.StatusOK, ", it was ", w.Code)
	}

	if !strings.Contains(w.Body.String(), "about") {
		t.Error("GET homepage did not return correct content ", w.Body.String(), " I expected to see some reference to \"about\"")
	}

	t.Log("status:", w.Code, "body:", w.Body.String())
}

func TestContactGet(t *testing.T) {
	req, err := http.NewRequest("GET", "http://localhost:4000/contact/", nil)
	if err != nil {
		t.Error("GET did not work as expected.")
		t.Log(err)
	}

	w := httptest.NewRecorder()
	contactSimpleServeHTTP(w, req)

	if w.Code != 200 && w.Code != 202 {
		t.Error("GET did not work as expected. the status was not ", http.StatusOK, ", it was ", w.Code)
	}

	if !strings.Contains(w.Body.String(), "robot") {
		t.Error("GET homepage did not return correct content ", w.Body.String(), " I expected to see some reference to \"about\"")
	}

	t.Log("status:", w.Code, "body:", w.Body.String())
}


text:
from optparse import OptionParser
from set_ports import rpc_port
import os

def set_tag(container, key, value):
  print "Setting tag '%s' on container '%s' to '%s'" % (key, container, value)
  print os.popen('serf tags -set "%s"="%s" -rpc-addr=%s' % (key, value, '0.0.0.0:%s' % rpc_port(container)))

def check_container_count(container):
  output = os.popen('docker ps | grep %s' % container).read().strip()
  count = len(output.splitlines())
  if count != 1: raise RuntimeError('Must be exactly one container of this type running but found %s' % count)

if __name__ == "__main__":
  parser = OptionParser(usage="usage: %prog container tag_key tag_value")
  (options, args) = parser.parse_args()

  if len(args) != 3: parser.print_help(); exit(1)

  (container, tag, value) = (args[0], args[1], args[2])
  check_container_count(container)

  set_tag(container, tag, value)


text:
package de.idrinth.waraddonclient.gui;

import de.idrinth.waraddonclient.Utils;
import de.idrinth.waraddonclient.service.Config;
import de.idrinth.waraddonclient.service.Request;
import java.io.IOException;
import java.net.URISyntaxException;
import de.idrinth.waraddonclient.service.logger.BaseLogger;
import de.idrinth.waraddonclient.service.Restarter;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.util.concurrent.atomic.AtomicReference;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JScrollPane;
import javax.swing.LayoutStyle;
import javax.swing.WindowConstants;

public class Start extends BaseFrame implements MainWindow
{
    private final AtomicReference<BaseLogger> logger = new AtomicReference<>();

    private final AtomicReference<Restarter> restarter = new AtomicReference<>();

    private final MainWindowMap map;

    public Start(MainWindowMap map, BaseLogger logger, Config config, Restarter restarter, Request client) {
        super(config);
        this.map = map;
        this.restarter.set(restarter);
        this.logger.set(logger);
        initComponents();
        setTitle("Start");
        welcome.setText("
Welcome to the Warhammer Online Addon Client!

You are running version "+config.getVersion()+".

Choose the tool to use below!
");
        new Thread(() -> {
            Utils.sleep(1000, logger);//This fixes a weird bug
            welcome.setText("
Welcome to the Warhammer Online Addon Client!

You are running version "+config.getVersion()+".

The current Version is "+client.getVersion()+".

Choose the tool to use below!
");
        }).start();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JButton addons = new JButton();
        JButton settings = new JButton();
        JButton backups = new JButton();
        JScrollPane welcomePane = new JScrollPane();
        welcome = new JEditorPane();
        JMenuBar mainMenu = new JMenuBar();
        JMenu menuFile = new JMenu();
        JMenuItem menuAbout = new JMenuItem();
        JMenuItem menuRestart = new JMenuItem();
        JMenuItem menuQuit = new JMenuItem();
        JMenu menuLinks = new JMenu();
        JMenuItem menuGuilded = new JMenuItem();
        JMenuItem menuBuyMeACoffee = new JMenuItem();
        JMenuItem menuSource = new JMenuItem();
        JMenuItem menuWebpage = new JMenuItem();

        setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

        addons.setText("Addon Management");
        addons.addActionListener(this::addonsActionPerformed);

        settings.setText("Settings");
        settings.addActionListener(this::settingsActionPerformed);

        backups.setText("Backups");
        backups.addActionListener(this::backupsActionPerformed);

        welcome.setEditable(false);
        welcome.setContentType("text/html"); // NOI18N
        welcomePane.setViewportView(welcome);

        menuFile.setText("Main");

        menuAbout.setText("About");
        menuAbout.setToolTipText("");
        menuAbout.addActionListener(this::menuAboutActionPerformed);
        menuFile.add(menuAbout);

        menuRestart.setText("Restart");
        menuRestart.addActionListener(this::menuRestartActionPerformed);
        menuFile.add(menuRestart);

        menuQuit.setText("Quit");
        menuQuit.addActionListener(this::menuQuitActionPerformed);
        menuFile.add(menuQuit);

        mainMenu.add(menuFile);

        menuLinks.setText("Links");

        menuGuilded.setText("Guilded: Idrinth's Addons");
        menuGuilded.addActionListener(this::menuGuildedActionPerformed);
        menuLinks.add(menuGuilded);

        menuBuyMeACoffee.setText("BuyMeACoffee");
        menuBuyMeACoffee.addActionListener(this::menuBuyMeACoffeeActionPerformed);
        menuLinks.add(menuBuyMeACoffee);

        menuSource.setText("GitHub: WARAddonClient");
        menuSource.addActionListener(this::menuSourceActionPerformed);
        menuLinks.add(menuSource);

        menuWebpage.setText("Web-Version: Idrinth's Tools");
        menuWebpage.addActionListener(this::menuWebpageActionPerformed);
        menuLinks.add(menuWebpage);

        mainMenu.add(menuLinks);

        setJMenuBar(mainMenu);

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(addons)
                .addGap(18, 18, 18)
                .addComponent(backups)
                .addGap(18, 18, 18)
                .addComponent(settings)
                .addContainerGap(566, Short.MAX_VALUE))
            .addComponent(welcomePane)
        );
        layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(welcomePane, GroupLayout.PREFERRED_SIZE, 313, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(addons)
                    .addComponent(settings)
                    .addComponent(backups))
                .addGap(0, 86, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param evt
     */
    private void menuAboutActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuAboutActionPerformed
        javax.swing.JOptionPane.showMessageDialog(this, "This software is provided for free by Björn Büttner.\n"
                + "If you have ideas or bugs please add them to the issues at GitHub:WARAddonClient.\n"
                + "If you want to buy me a coffee you can do so at Buy me a coffee.\n"
                + "If you need support, go to Guilded:Idrinth's Addons", "About", javax.swing.JOptionPane.INFORMATION_MESSAGE);
    }//GEN-LAST:event_menuAboutActionPerformed

    private void menuSourceActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuSourceActionPerformed
        try {
            Desktop.getDesktop().browse(new java.net.URI("https://github.com/Idrinth/WARAddonClient/"));
        } catch (URISyntaxException | IOException ex) {
            logger.get().error(ex);
        }
    }//GEN-LAST:event_menuSourceActionPerformed

    private void menuBuyMeACoffeeActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuBuyMeACoffeeActionPerformed
        try {
            Desktop.getDesktop().browse(new java.net.URI("https://buymeacoffee.com/idrinth"));
        } catch (URISyntaxException | IOException ex) {
            logger.get().error(ex);
        }
    }//GEN-LAST:event_menuBuyMeACoffeeActionPerformed

    private void menuGuildedActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuGuildedActionPerformed
        try {
            Desktop.getDesktop().browse(new java.net.URI("https://guilded.gg/Idrinths-Addons/"));
        } catch (URISyntaxException | IOException ex) {
            logger.get().error(ex);
        }
    }//GEN-LAST:event_menuGuildedActionPerformed

    private void menuQuitActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuQuitActionPerformed
        this.dispose();
        Runtime.getRuntime().exit(0);
    }//GEN-LAST:event_menuQuitActionPerformed

    private void menuRestartActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuRestartActionPerformed
        try {
            restarter.get().restart();
        } catch (IOException ex) {
            logger.get().error(ex);
        }
    }//GEN-LAST:event_menuRestartActionPerformed

    private void menuWebpageActionPerformed(ActionEvent evt) {//GEN-FIRST:event_menuWebpageActionPerformed
        try {
            Desktop.getDesktop().browse(new java.net.URI("https://tools.idrinth.de/"));
        } catch (URISyntaxException | IOException ex) {
            logger.get().error(ex);
        }
    }//GEN-LAST:event_menuWebpageActionPerformed

    private void addonsActionPerformed(ActionEvent evt) {//GEN-FIRST:event_addonsActionPerformed
         map.exchange(MainWindowMap.START, MainWindowMap.ADDONS);
    }//GEN-LAST:event_addonsActionPerformed

    private void settingsActionPerformed(ActionEvent evt) {//GEN-FIRST:event_settingsActionPerformed
        map.exchange(MainWindowMap.START, MainWindowMap.SETTINGS);
    }//GEN-LAST:event_settingsActionPerformed

    private void backupsActionPerformed(ActionEvent evt) {//GEN-FIRST:event_backupsActionPerformed
        map.exchange(MainWindowMap.START, MainWindowMap.BACKUPS);
    }//GEN-LAST:event_backupsActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private JEditorPane welcome;
    // End of variables declaration//GEN-END:variables
}


text:
require 'spec_helper'

RSpec.describe Salesforce::UserSkillRatingsRepository do
  it_behaves_like "generic salesforce repository" do
    let(:local_resource) do
      UserSkillRate.new(
        id: 42,
        user: User.new(salesforce_id: "foo"),
        skill: Skill.new(salesforce_id: "bar"),
        favorite: false,
        note: "A few words",
        rate: 4,
      )
    end
    let(:salesforce_resource_name) { "SkillRating__c" }
    let(:expected_salesforce_create_attributes) do
      {
        Contact__c: "foo",
        Skill__c: "bar",
        IDD__c: 42,
        Favorite__c: false,
        Note__c: "A few words",
        Rate__c: 4,
      }
    end
    let(:expected_salesforce_update_attributes) do
      {
        IDD__c: 42,
        Favorite__c: false,
        Note__c: "A few words",
        Rate__c: 4,
      }
    end
  end
end


text:
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.Enums;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace GoldensMisc.Tiles
{
	public class Autofisher : ModTile
	{
		public override bool IsLoadingEnabled (Mod mod)
		{
			return ModContent.GetInstance<ServerConfig>().Autofisher;
		}

		public override void SetStaticDefaults()
		{
			Main.tileFrameImportant[Type] = true;
			Main.tileNoAttach[Type] = true;
			TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
			TileObjectData.newTile.CoordinateHeights = new[] { 16, 18 };
			TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight;
			TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 2, 0);
			//TileObjectData.newTile.StyleWrapLimit = 2;
			//TileObjectData.newTile.StyleMultiplier = 2;
			//TileObjectData.newTile.StyleHorizontal = true;
			TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(ModContent.GetInstance<AutofisherTE>().Hook_AfterPlacement, -1, 0, false);
			TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile);
			TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft;
			TileObjectData.newAlternate.AnchorBottom = new AnchorData(AnchorType.SolidTile, 2, 1);
			TileObjectData.addAlternate(1);
			TileObjectData.addTile(Type);
			AddMapEntry(Color.Gray, CreateMapEntryName());
		}

		public override void KillMultiTile(int i, int j, int TileFrameX, int TileFrameY)
		{
			Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType<Items.Placeable.Autofisher>());
            ModContent.GetInstance<AutofisherTE>().Kill(i, j);
		}

		public override void MouseOver(int i, int j)
		{
			Main.LocalPlayer.noThrow = 2;
			Main.LocalPlayer.cursorItemIconEnabled = true;
			Main.LocalPlayer.cursorItemIconID = ModContent.ItemType<Items.Placeable.Autofisher>();
		}

		public override bool RightClick(int i, int j)
		{
			//Top left tile
			int x = i - Main.tile[i, j].TileFrameX % 54 / 18;
			int y = j - Main.tile[i, j].TileFrameY % 38 / 18;

			try
			{
				var te = (AutofisherTE)TileEntity.ByPosition[new Point16(x, y)];
				if(Main.netMode == NetmodeID.MultiplayerClient)
				{
					var message = Mod.GetPacket();
					message.Write((byte)MiscMessageType.PrintAutofisherInfo);
					message.Write(te.ID);
					message.Send();
				}
				else
				{
					if(te.DisplayedFishingInfo != null)
						Main.NewText(te.DisplayedFishingInfo);
				}
			}
			catch(Exception e)
			{
				GoldensMisc.Log(e);
				Main.NewText("Error! Report this error and send the Terraria/Modloader/Logs/Client.log file!");
			}
            return true;
		}
	}
}


text:
namespace app_list {
class AppListView;
}

namespace gfx {
class Display;
class Point;
class Size;
}  // namespace gfx

// Responsible for positioning, hiding and showing an AppListView on Linux.
// This includes watching window activation/deactivation messages to determine
// if the user has clicked away from it.
class AppListLinux : public AppList,
                     public app_list::AppListViewObserver {
 public:
  AppListLinux(app_list::AppListView* view,
               const base::Closure& on_should_dismiss);
  virtual ~AppListLinux();

  // Finds the position for a window to anchor it to the shelf. This chooses the
  // most appropriate position for the window based on whether the shelf exists,
  // the position of the shelf, and the mouse cursor. Returns the intended
  // coordinates for the center of the window. If |shelf_rect| is empty, assumes
  // there is no shelf on the given display.
  static gfx::Point FindAnchorPoint(const gfx::Size& view_size,
                                    const gfx::Display& display,
                                    const gfx::Point& cursor,
                                    AppListPositioner::ScreenEdge edge);

  // AppList:
  virtual void Show() OVERRIDE;
  virtual void Hide() OVERRIDE;
  virtual void MoveNearCursor() OVERRIDE;
  virtual bool IsVisible() OVERRIDE;
  virtual void Prerender() OVERRIDE;
  virtual void ReactivateOnNextFocusLoss() OVERRIDE;
  virtual gfx::NativeWindow GetWindow() OVERRIDE;
  virtual void SetProfile(Profile* profile) OVERRIDE;

  // app_list::AppListViewObserver:
  virtual void OnActivationChanged(views::Widget* widget, bool active) OVERRIDE;

 private:
  // Weak pointer. The view manages its own lifetime.
  app_list::AppListView* view_;
  bool window_icon_updated_;

  // Called to request |view_| be closed.
  base::Closure on_should_dismiss_;

  DISALLOW_COPY_AND_ASSIGN(AppListLinux);
};

#endif  // CHROME_BROWSER_UI_VIEWS_APP_LIST_LINUX_APP_LIST_LINUX_H_