text:
.class abstract Landroid/graphics/drawable/RippleComponent;
.super Ljava/lang/Object;
.source "RippleComponent.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;
    }
.end annotation

# instance fields
.field protected final mBounds:Landroid/graphics/Rect;

.field protected mDensityScale:F

.field private final mForceSoftware:Z

.field private mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

.field private mHasDisplayListCanvas:Z

.field private mHasMaxRadius:Z

.field private mHasPendingHardwareAnimator:Z

.field private final mOwner:Landroid/graphics/drawable/RippleDrawable;

.field private mSoftwareAnimator:Landroid/animation/Animator;

.field protected mTargetRadius:F

# direct methods
.method public constructor <init>(Landroid/graphics/drawable/RippleDrawable;Landroid/graphics/Rect;Z)V
    .locals 0

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

    iput-object p1, p0, Landroid/graphics/drawable/RippleComponent;->mOwner:Landroid/graphics/drawable/RippleDrawable;

    iput-object p2, p0, Landroid/graphics/drawable/RippleComponent;->mBounds:Landroid/graphics/Rect;

    iput-boolean p3, p0, Landroid/graphics/drawable/RippleComponent;->mForceSoftware:Z

    return-void
.end method

.method private cancelSoftwareAnimations()V
    .locals 2

    const/4 v1, 0x0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->cancel()V

    iput-object v1, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    :cond_0
    return-void
.end method

.method private endHardwareAnimations()V
    .locals 2

    const/4 v1, 0x0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    invoke-virtual {v0}, Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;->end()V

    iput-object v1, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    :cond_0
    iget-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasPendingHardwareAnimator:Z

    if-eqz v0, :cond_1

    const/4 v0, 0x0

    iput-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasPendingHardwareAnimator:Z

    invoke-virtual {p0}, Landroid/graphics/drawable/RippleComponent;->jumpValuesToExit()V

    :cond_1
    return-void
.end method

.method private endSoftwareAnimations()V
    .locals 2

    const/4 v1, 0x0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->end()V

    iput-object v1, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    :cond_0
    return-void
.end method

.method private static getTargetRadius(Landroid/graphics/Rect;)F
    .locals 4

    const/high16 v3, 0x40000000    # 2.0f

    invoke-virtual {p0}, Landroid/graphics/Rect;->width()I

    move-result v2

    int-to-float v2, v2

    div-float v1, v2, v3

    invoke-virtual {p0}, Landroid/graphics/Rect;->height()I

    move-result v2

    int-to-float v2, v2

    div-float v0, v2, v3

    mul-float v2, v1, v1

    mul-float v3, v0, v0

    add-float/2addr v2, v3

    float-to-double v2, v2

    invoke-static {v2, v3}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v2

    double-to-float v2, v2

    return v2
.end method

.method private startPendingAnimation(Landroid/view/DisplayListCanvas;Landroid/graphics/Paint;)V
    .locals 1

    iget-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasPendingHardwareAnimator:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    iput-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasPendingHardwareAnimator:Z

    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0, p2}, Landroid/graphics/Paint;-><init>(Landroid/graphics/Paint;)V

    invoke-virtual {p0, v0}, Landroid/graphics/drawable/RippleComponent;->createHardwareExit(Landroid/graphics/Paint;)Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    move-result-object v0

    iput-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    invoke-virtual {v0, p1}, Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;->start(Landroid/view/DisplayListCanvas;)V

    invoke-virtual {p0}, Landroid/graphics/drawable/RippleComponent;->jumpValuesToExit()V

    :cond_0
    return-void
.end method

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

    invoke-direct {p0}, Landroid/graphics/drawable/RippleComponent;->cancelSoftwareAnimations()V

    invoke-direct {p0}, Landroid/graphics/drawable/RippleComponent;->endHardwareAnimations()V

    return-void
.end method

.method protected abstract createHardwareExit(Landroid/graphics/Paint;)Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;
.end method

.method protected abstract createSoftwareEnter(Z)Landroid/animation/Animator;
.end method

.method protected abstract createSoftwareExit()Landroid/animation/Animator;
.end method

.method public draw(Landroid/graphics/Canvas;Landroid/graphics/Paint;)Z
    .locals 3

    iget-boolean v2, p0, Landroid/graphics/drawable/RippleComponent;->mForceSoftware:Z

    if-nez v2, :cond_1

    invoke-virtual {p1}, Landroid/graphics/Canvas;->isHardwareAccelerated()Z

    move-result v2

    if-eqz v2, :cond_1

    instance-of v0, p1, Landroid/view/DisplayListCanvas;

    :goto_0
    iget-boolean v2, p0, Landroid/graphics/drawable/RippleComponent;->mHasDisplayListCanvas:Z

    if-eq v2, v0, :cond_0

    iput-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasDisplayListCanvas:Z

    if-nez v0, :cond_0

    invoke-direct {p0}, Landroid/graphics/drawable/RippleComponent;->endHardwareAnimations()V

    :cond_0
    if-eqz v0, :cond_2

    move-object v1, p1

    check-cast v1, Landroid/view/DisplayListCanvas;

    invoke-direct {p0, v1, p2}, Landroid/graphics/drawable/RippleComponent;->startPendingAnimation(Landroid/view/DisplayListCanvas;Landroid/graphics/Paint;)V

    iget-object v2, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    if-eqz v2, :cond_2

    invoke-virtual {p0, v1}, Landroid/graphics/drawable/RippleComponent;->drawHardware(Landroid/view/DisplayListCanvas;)Z

    move-result v2

    return v2

    :cond_1
    const/4 v0, 0x0

    goto :goto_0

    :cond_2
    invoke-virtual {p0, p1, p2}, Landroid/graphics/drawable/RippleComponent;->drawSoftware(Landroid/graphics/Canvas;Landroid/graphics/Paint;)Z

    move-result v2

    return v2
.end method

.method protected abstract drawHardware(Landroid/view/DisplayListCanvas;)Z
.end method

.method protected abstract drawSoftware(Landroid/graphics/Canvas;Landroid/graphics/Paint;)Z
.end method

.method public end()V
    .locals 0

    invoke-direct {p0}, Landroid/graphics/drawable/RippleComponent;->endSoftwareAnimations()V

    invoke-direct {p0}, Landroid/graphics/drawable/RippleComponent;->endHardwareAnimations()V

    return-void
.end method

.method public final enter(Z)V
    .locals 1

    invoke-virtual {p0}, Landroid/graphics/drawable/RippleComponent;->cancel()V

    invoke-virtual {p0, p1}, Landroid/graphics/drawable/RippleComponent;->createSoftwareEnter(Z)Landroid/animation/Animator;

    move-result-object v0

    iput-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->start()V

    :cond_0
    return-void
.end method

.method public final exit()V
    .locals 1

    invoke-virtual {p0}, Landroid/graphics/drawable/RippleComponent;->cancel()V

    iget-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasDisplayListCanvas:Z

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasPendingHardwareAnimator:Z

    invoke-virtual {p0}, Landroid/graphics/drawable/RippleComponent;->invalidateSelf()V

    :goto_0
    return-void

    :cond_0
    invoke-virtual {p0}, Landroid/graphics/drawable/RippleComponent;->createSoftwareExit()Landroid/animation/Animator;

    move-result-object v0

    iput-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mSoftwareAnimator:Landroid/animation/Animator;

    invoke-virtual {v0}, Landroid/animation/Animator;->start()V

    goto :goto_0
.end method

.method public getBounds(Landroid/graphics/Rect;)V
    .locals 4

    iget v1, p0, Landroid/graphics/drawable/RippleComponent;->mTargetRadius:F

    float-to-double v2, v1

    invoke-static {v2, v3}, Ljava/lang/Math;->ceil(D)D

    move-result-wide v2

    double-to-int v0, v2

    neg-int v1, v0

    neg-int v2, v0

    invoke-virtual {p1, v1, v2, v0, v0}, Landroid/graphics/Rect;->set(IIII)V

    return-void
.end method

.method protected final invalidateSelf()V
    .locals 2

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mOwner:Landroid/graphics/drawable/RippleDrawable;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/graphics/drawable/RippleDrawable;->invalidateSelf(Z)V

    return-void
.end method

.method protected final isHardwareAnimating()Z
    .locals 1

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mHardwareAnimator:Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;

    invoke-virtual {v0}, Landroid/graphics/drawable/RippleComponent$RenderNodeAnimatorSet;->isRunning()Z

    move-result v0

    if-nez v0, :cond_1

    :cond_0
    iget-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasPendingHardwareAnimator:Z

    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x1

    goto :goto_0
.end method

.method protected abstract jumpValuesToExit()V
.end method

.method public onBoundsChange()V
    .locals 1

    iget-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasMaxRadius:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mBounds:Landroid/graphics/Rect;

    invoke-static {v0}, Landroid/graphics/drawable/RippleComponent;->getTargetRadius(Landroid/graphics/Rect;)F

    move-result v0

    iput v0, p0, Landroid/graphics/drawable/RippleComponent;->mTargetRadius:F

    iget v0, p0, Landroid/graphics/drawable/RippleComponent;->mTargetRadius:F

    invoke-virtual {p0, v0}, Landroid/graphics/drawable/RippleComponent;->onTargetRadiusChanged(F)V

    :cond_0
    return-void
.end method

.method protected final onHotspotBoundsChanged()V
    .locals 6

    const/high16 v4, 0x40000000    # 2.0f

    iget-boolean v3, p0, Landroid/graphics/drawable/RippleComponent;->mHasMaxRadius:Z

    if-nez v3, :cond_0

    iget-object v3, p0, Landroid/graphics/drawable/RippleComponent;->mBounds:Landroid/graphics/Rect;

    invoke-virtual {v3}, Landroid/graphics/Rect;->width()I

    move-result v3

    int-to-float v3, v3

    div-float v1, v3, v4

    iget-object v3, p0, Landroid/graphics/drawable/RippleComponent;->mBounds:Landroid/graphics/Rect;

    invoke-virtual {v3}, Landroid/graphics/Rect;->height()I

    move-result v3

    int-to-float v3, v3

    div-float v0, v3, v4

    mul-float v3, v1, v1

    mul-float v4, v0, v0

    add-float/2addr v3, v4

    float-to-double v4, v3

    invoke-static {v4, v5}, Ljava/lang/Math;->sqrt(D)D

    move-result-wide v4

    double-to-float v2, v4

    invoke-virtual {p0, v2}, Landroid/graphics/drawable/RippleComponent;->onTargetRadiusChanged(F)V

    :cond_0
    return-void
.end method

.method protected onTargetRadiusChanged(F)V
    .locals 0

    return-void
.end method

.method public final setup(FI)V
    .locals 2

    const/4 v0, 0x0

    cmpl-float v0, p1, v0

    if-ltz v0, :cond_0

    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/graphics/drawable/RippleComponent;->mHasMaxRadius:Z

    iput p1, p0, Landroid/graphics/drawable/RippleComponent;->mTargetRadius:F

    :goto_0
    int-to-float v0, p2

    const v1, 0x3bcccccd    # 0.00625f

    mul-float/2addr v0, v1

    iput v0, p0, Landroid/graphics/drawable/RippleComponent;->mDensityScale:F

    iget v0, p0, Landroid/graphics/drawable/RippleComponent;->mTargetRadius:F

    invoke-virtual {p0, v0}, Landroid/graphics/drawable/RippleComponent;->onTargetRadiusChanged(F)V

    return-void

    :cond_0
    iget-object v0, p0, Landroid/graphics/drawable/RippleComponent;->mBounds:Landroid/graphics/Rect;

    invoke-static {v0}, Landroid/graphics/drawable/RippleComponent;->getTargetRadius(Landroid/graphics/Rect;)F

    move-result v0

    iput v0, p0, Landroid/graphics/drawable/RippleComponent;->mTargetRadius:F

    goto :goto_0
.end method


text:
'use strict';

const path = require('path');
const express = require('express');
const bodyParser = require('body-parser');
const expvue = require('vue');

module.exports = (a) => {

    const app = express();

    app.set('views', path.join(a.root, 'views'));
    app.set('vue', {
        componentsDir: path.join(a.root, 'views', 'layouts'),
        defaultLayout: 'landing'
    });
    app.engine('vue', expvue);
    app.set('view engine', 'vue');
    app.use(express.static('public'));
    app.use(bodyParser.urlencoded({ extended: true }));

    return app;
};

redpajama_set_name: RedPajamaGithub


text:
package org.apache.asterix.lang.common.visitor.base;

import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.lang.common.clause.UpdateClause;
import org.apache.asterix.lang.common.expression.OrderedListTypeDefinition;
import org.apache.asterix.lang.common.expression.RecordTypeDefinition;
import org.apache.asterix.lang.common.expression.TypeReferenceExpression;
import org.apache.asterix.lang.common.expression.UnorderedListTypeDefinition;
import org.apache.asterix.lang.common.statement.CompactStatement;
import org.apache.asterix.lang.common.statement.ConnectFeedStatement;
import org.apache.asterix.lang.common.statement.CreateDataverseStatement;
import org.apache.asterix.lang.common.statement.CreateFeedPolicyStatement;
import org.apache.asterix.lang.common.statement.CreateFeedStatement;
import org.apache.asterix.lang.common.statement.CreateFunctionStatement;
import org.apache.asterix.lang.common.statement.CreateIndexStatement;
import org.apache.asterix.lang.common.statement.DatasetDecl;
import org.apache.asterix.lang.common.statement.DataverseDecl;
import org.apache.asterix.lang.common.statement.DataverseDropStatement;
import org.apache.asterix.lang.common.statement.DeleteStatement;
import org.apache.asterix.lang.common.statement.DisconnectFeedStatement;
import org.apache.asterix.lang.common.statement.DropDatasetStatement;
import org.apache.asterix.lang.common.statement.FeedDropStatement;
import org.apache.asterix.lang.common.statement.FeedPolicyDropStatement;
import org.apache.asterix.lang.common.statement.FunctionDropStatement;
import org.apache.asterix.lang.common.statement.IndexDropStatement;
import org.apache.asterix.lang.common.statement.InsertStatement;
import org.apache.asterix.lang.common.statement.LoadStatement;
import org.apache.asterix.lang.common.statement.NodeGroupDropStatement;
import org.apache.asterix.lang.common.statement.NodegroupDecl;
import org.apache.asterix.lang.common.statement.SetStatement;
import org.apache.asterix.lang.common.statement.StartFeedStatement;
import org.apache.asterix.lang.common.statement.StopFeedStatement;
import org.apache.asterix.lang.common.statement.TypeDecl;
import org.apache.asterix.lang.common.statement.TypeDropStatement;
import org.apache.asterix.lang.common.statement.UpdateStatement;
import org.apache.asterix.lang.common.statement.WriteStatement;

public abstract class AbstractQueryExpressionVisitor<R, T> implements ILangVisitor<R, T> {

    @Override
    public R visit(CreateIndexStatement cis, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(DataverseDecl dv, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(DeleteStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(DropDatasetStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(DatasetDecl dd, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(InsertStatement insert, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(LoadStatement stmtLoad, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(NodegroupDecl ngd, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(OrderedListTypeDefinition olte, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(RecordTypeDefinition tre, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(SetStatement ss, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(TypeDecl td, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(TypeReferenceExpression tre, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(UnorderedListTypeDefinition ulte, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(UpdateClause del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(UpdateStatement update, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(WriteStatement ws, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(CreateDataverseStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(IndexDropStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(NodeGroupDropStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(DataverseDropStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(TypeDropStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(DisconnectFeedStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(CreateFunctionStatement cfs, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(FunctionDropStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(CreateFeedStatement cfs, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(StartFeedStatement sfs, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(StopFeedStatement sfs, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(ConnectFeedStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(FeedDropStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(CompactStatement del, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(CreateFeedPolicyStatement cfps, T arg) throws CompilationException {
        return null;
    }

    @Override
    public R visit(FeedPolicyDropStatement dfs, T arg) throws CompilationException {
        return null;
    }
}


text:
package org.innovateuk.ifs.organisation.viewmodel;

import java.util.Optional;

public class ConfirmResearchOrganisationEligibilityViewModel {

    private long competitionId;
    private String organisationName;
    private String hash;

    public ConfirmResearchOrganisationEligibilityViewModel(long competitionId, String organisationName, String hash) {
        this.competitionId = competitionId;
        this.organisationName = organisationName;
        this.hash = hash;
    }

    public long getCompetitionId() {
        return competitionId;
    }

    public void setCompetitionId(long competitionId) {
        this.competitionId = competitionId;
    }

    public Optional<String> getOrganisationName() {
        return Optional.ofNullable(organisationName);
    }

    public void setOrganisationName(String organisationName) {
        this.organisationName = organisationName;
    }

    public String getHash() {
        return hash;
    }
}


text:
Mutations
=========

Most APIs don't just allow you to read data, they also allow you to
write.

In GraphQL, this is done using mutations. Just like queries,
Relay puts some additional requirements on mutations, but Graphene
nicely manages that for you. All you need to do is make your mutation a
subclass of ``relay.ClientIDMutation``.

.. code:: python

    class IntroduceShip(relay.ClientIDMutation):

        class Input:
            ship_name = graphene.String(required=True)
            faction_id = graphene.String(required=True)

        ship = graphene.Field(Ship)
        faction = graphene.Field(Faction)

        @classmethod
        def mutate_and_get_payload(cls, input, context, info):
            ship_name = input.get('ship_name')
            faction_id = input.get('faction_id')
            ship = create_ship(ship_name, faction_id)
            faction = get_faction(faction_id)
            return IntroduceShip(ship=ship, faction=faction)


text:
<?php

$top_message = '
FUCK WITH THE BEST DIE LIKE THE REST
';

function printHead() {

    $style = 'cyber';

    if($_GET['style']) {
        $style = $_GET['style'];
        setcookie('style', $style, time()+3600, '/');
    }
    else if($_COOKIE["style"])
        $style = $_COOKIE["style"];

    echo '<link rel="stylesheet" type="text/css" href="/themes/base.css?v=' . time() . '">';

    echo '<link rel="stylesheet" type="text/css" href="/themes/' . $style . '.css?v=' . time() . '">';

    echo '<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

        ';
}

function printPost($con, $isMod, $rowReplies) {

    //prepare variables
                $rowImage = "/thumbnails/" . htmlspecialchars($rowReplies['image']);
                $imageID = 'img' . $rowReplies['ID'];
                $urlID = 'url' . $rowReplies['ID'];
                $rowName = htmlspecialchars($rowReplies['name']);
                $rowComment = htmlspecialchars($rowReplies['commento']);
                $rowSubject = htmlspecialchars($rowReplies['subject']);
                $rowImageUrl = htmlspecialchars(addslashes($rowReplies['imageUrl']));  //protection against xss attack
                $rowImageUrl = str_replace(" ","", $rowImageUrl);  //protection against xss attack
                $rowImageUrl = str_replace("onerror","whatnow", $rowImageUrl);  //protection against xss attack
                $rowFileName = htmlspecialchars($rowReplies['fileName']);
                $id = $rowReplies['ID'];

                /*
                //santa hat
                if($rowReplies['image'])
                    echo '';
                */
                /*
                //valentines day
                if($rowReplies['image'])
                    echo '';
                */
                /*
                //halloween
                if($rowReplies['image'])
                    echo '';
                */
                //display posts
                if($rowReplies['replyTo'])
                    echo '
';
                else
                    echo '
';

                //show picture if present (URL)
                if($rowReplies['imageUrl'])
                    echo "";

                //show picture if present
                if($rowReplies['image']) {
                    if (strpos($rowReplies['image'], 'mp3'))
                        echo '<audio controls><source src="/uploads/'.$rowReplies['image'].'" type="audio/mpeg"></audio>';
                    else if (strpos($rowReplies['image'], 'webm'))
                        echo '<video width="320" height="240" preload="metadata" controls><source src="/uploads/'.$rowReplies['image'].'" type="video/webm"></video>';
                    else if (strpos($rowReplies['image'], 'pdf'))
                        echo '';
                    else
                        echo "";
                }

                //PRINT POST INFO
                echo "<form action='#' method='post' style='vertical-align:top; display: inline-block';>";
                echo "
";

                //print subject
                echo "{$rowSubject}";

                //print user logo
                if($rowReplies['isMod'] == 1)
                    echo " ☯ ";
                else if($rowReplies['isMod'] == 2)
                    echo " ☯ ";
                else if($rowReplies['loggedIn'] == 1)
                    echo " &#9733 ";

                //print name
                echo " ";

                if(!$rowReplies['name'])
                    echo("Anonymous");
/*
                if($rowReplies['loggedIn'] == 1)
                    echo $rowName;
                else
                    echo nl2br("$rowName");
*/

                if($rowReplies['loggedIn'] == 1) {
                        echo $rowName;
                }
                else {
                    $rowName = wordFilter($rowName);
                    echo nl2br("$rowName");
                }

                echo "";

                //print date and time
                echo " {$rowReplies['dateTime']}";

                //print post number
                if($rowReplies['replyTo'])
                    echo " {$rowReplies['ID']}";
                else
                    echo " {$rowReplies['ID']}";
/*
                //thumbs up/downs
                echo ' ▲ ';
                echo '▼ ';
*/
                //print sticky logo
                if($rowReplies['sticky'])
                    echo " ";
/*
                //print blue arrow
                $hiddenButton = (string)$rowReplies['ID'] . 'btn';
                echo " ▶";

                //print red arrow
                echo " ▶";

                //show delete button if user is a mod, else show report button
                if($isMod)
                    echo " <button id='$hiddenButton' style='display:none;' type='submit' name='delete' value='{$rowReplies['ID']}'>Delete</button>";
                else
                    echo " <button id='$hiddenButton' style='display:none;' type='submit' name='report' value='{$rowReplies['ID']}'>Report</button>";
*/

                //links to post replies
                echo '';

                if($rowReplies['bump'])
                    $x = $rowReplies['ID'];
                else
                    $x = $rowReplies['replyTo'];
                $ltrsql = "SELECT * FROM posts WHERE replyTo = " . $x . " ORDER BY ID ASC";
                $ltrres = mysqli_query($con, $ltrsql);

                while($ltrrow = mysqli_fetch_assoc($ltrres)) {
                    $y = $ltrrow['commento'];
                    $z = $rowReplies['ID'];
                    if(strpos($y, $z) !== false)
                        //echo ">>{$ltrrow['ID']} ";
                        echo   ">>".$ltrrow['ID']." ";
                }
                echo '';

                //print url info
                if($rowReplies['imageUrl'])
                    echo '
Url: ' . $rowImageUrl . '';

                //print image info
                if($rowReplies['image']) {
                    //fileSize
                    $fileSize = filesize('uploads/' . $rowReplies['image']);
                    if($fileSize > 1000000)
                        $fileSize = round($fileSize / 1000000, 2) . ' MB';
                    else
                        $fileSize = round($fileSize / 1000, 2) . ' KB';
                    //dimensions
                    list($width, $height) = getimagesize('uploads/' . $rowReplies['image']);
                    $dimensions = $width . 'x' . $height;
                    echo '
File: ' . $rowFileName . ' (' . $fileSize . ', ' . $dimensions . ')';
                }

                //check if post is banned and echo message
                $sql2 = "SELECT * FROM bannedPosts";
                $res2 = mysqli_query($con, $sql2);
                while($row2 = mysqli_fetch_assoc($res2))
                    if($rowReplies['ID'] == $row2['post']) {
                        echo "(User was banned for this post)";
                        break;
                    }

                echo "

";

                //fortune
                if($rowReplies['fortune']) {
                    fortune($rowReplies['fortune']);
                    echo "

";
                }

                echo '
';

                //PRINT COMMENT

                echo "
";

                //divide comment into lines
                $lines = explode("\n", $rowComment);

                //apply redtext
                foreach ($lines as $line) {
                    //check for redtext
                    $checkRed = htmlspecialchars_decode($line);
                    if($checkRed[0] == '>')
                        echo nl2br("");
                    else
                        echo nl2br("");

                    //divide line into words
                    $words = explode(" ", $line);
                    foreach ($words as $word) {

                       $word = checkYoutube($word);
                       $word = wordFilter($word);

                        //if word is a link to a post, show post preview
                        $checkLink = htmlspecialchars_decode($word);
                        if($checkLink[0] == '>' && $checkLink[1] == '>') {
                            $postLink =  preg_replace("/[^0-9]/","", basename($word));
                            echo nl2br("$word");
                        }

                        //print original word
                        else
                            echo nl2br("$word ");
                    }
                    echo nl2br("");
                }

                echo '
</form>

';
}

function compareDates($older, $newer) {
    $older = str_replace('/', '-', $older);
    $newer = str_replace('/', '-', $newer);
    return strtotime($newer) - strtotime($older);
}

function fortune($num) {

    switch ($num) {
        case 0:
            echo 'Your fortune: Reply hazy, try again';
            break;
        case 1:
            echo 'Your fortune: Excellent Luck';
            break;
        case 2:
            echo 'Your fortune: Good Luck';
            break;
        case 3:
            echo 'Your fortune: Average Luck';
            break;
        case 4:
            echo 'Your fortune: Bad Luck';
            break;
        case 5:
            echo 'Your fortune: Good news will come to you by mail';
            break;
        case 6:
            echo 'Your fortune: ( ´_ゝ`)フーン ';
            break;
        case 7:
            echo 'Your fortune: キタ━━━━━━(゚∀゚)━━━━━━ !!!!';
            break;
        case 8:
            echo 'Your fortune: You will meet a dark handsome stranger';
            break;
        case 9:
            echo 'Your fortune: Better not tell you now';
            break;
        case 10:
            echo 'Your fortune: Outlook good';
            break;
        case 11:
            echo 'Your fortune: Very Bad Luck';
            break;
        case 12:
            echo 'Your fortune: Godly Luck';
            break;
    }
}

function banner() {
    $banner = "";
    echo $banner;
}

function makePwd($length = 8) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}

function makeSalt($length = 8) {
    $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}

function makeFileName($length = 13) {
    $characters = '0123456789';
    $charactersLength = strlen($characters);
    $randomString = '';
    for ($i = 0; $i < $length; $i++) {
        $randomString .= $characters[rand(0, $charactersLength - 1)];
    }
    return $randomString;
}

function checkYoutube($word) {

    if(strpos(strtok($word,'?'), 'www.youtube.com/watch') !== false) {
        $idSpan = rand(0, 999999);
        $idVideo= rand(0, 999999);
        //print link and embed button
        echo ''.$word.'';
        echo " [embed]
";
        //return iframe
        $word = "";
    }

    if(strpos(strtok($word,'?'), 'https://youtu.be') !== false) {
        $idSpan = rand(0, 999999);
        $idVideo= rand(0, 999999);
        //print link and embed button
        echo ''.$word.'';
        echo " [embed]
";
        //return iframe
        $word = "";
    }

    return $word;
}

function wordFilter($word) {
    /*
    if(strpos(strtolower($word), 'fuck') !== false)
        $word = str_replace("fuck","FUARK",strtolower($word));
    if(strpos(strtolower($word), 'shit') !== false)
        $word = str_replace("shit","soykaf",strtolower($word));
    if(strpos(strtolower($word), 'nigger') !== false)
        $word = str_replace("nigger","brony",strtolower($word));
    if(strpos(strtolower($word), 'faggot') !== false)
        $word = str_replace("faggot","juggalo",strtolower($word));
    */
    if(strpos(strtolower($word), '[spoiler]') !== false)
        $word = str_replace("[spoiler]","",strtolower($word));
    if(strpos(strtolower($word), '[/spoiler]') !== false)
        $word = str_replace("[/spoiler]","",strtolower($word));
    if(strpos(strtolower($word), 'trap') !== false)
        $word = str_replace("trap","fag",strtolower($word));
    /*
    if(strpos(strtolower($word), '[code]') !== false)
        $word = str_replace("[code]","
",strtolower($word));
    if(strpos(strtolower($word), '[/code]') !== false)
        $word = str_replace("[/code]","
",strtolower($word));
    */
    return $word;
}

function activeUsers($con) {
    $ipAddr = $_SERVER['REMOTE_ADDR'];
    date_default_timezone_set('Europe/Paris');
    $date = date('d/m/Y H:i:s', time());

    //delete old user log
    $sql = "DELETE FROM activeUsers WHERE ipAddress = '$ipAddr';";
    $res = mysqli_query($con, $sql);

    //insert new user log
    $sql = "INSERT INTO activeUsers (ipAddress, dateTime) VALUES ('$ipAddr','$date')";
    $res = mysqli_query($con, $sql);

    //delete logs older than x minutes
    $sql = "SELECT * FROM activeUsers";
    $res = mysqli_query($con, $sql);
    $activeUsers = 0;
    while($row = mysqli_fetch_assoc($res)) {
        if(compareDates($row['dateTime'], $date) > 86400) {
            $sql2 = "DELETE FROM activeUsers WHERE ipAddress = '".$row['ipAddress']."'";
            $res2 = mysqli_query($con, $sql2);
        }
        else $activeUsers++;
    }
    return $activeUsers;
}

function onlineUsers($con) {
    $ipAddr = $_SERVER['REMOTE_ADDR'];
    date_default_timezone_set('Europe/Paris');
    $date = date('d/m/Y H:i:s', time());

    //delete old user log
    $sql = "DELETE FROM onlineUsers WHERE ipAddress = '$ipAddr';";
    $res = mysqli_query($con, $sql);

    //insert new user log
    $sql = "INSERT INTO onlineUsers (ipAddress, dateTime) VALUES ('$ipAddr','$date')";
    $res = mysqli_query($con, $sql);

    //delete logs older than x minutes
    $sql = "SELECT * FROM onlineUsers";
    $res = mysqli_query($con, $sql);
    $onlineUsers = 0;
    while($row = mysqli_fetch_assoc($res)) {
        if(compareDates($row['dateTime'], $date) > 600) {
            $sql2 = "DELETE FROM onlineUsers WHERE ipAddress = '".$row['ipAddress']."'";
            $res2 = mysqli_query($con, $sql2);
        }
        else $onlineUsers++;
    }
    return $onlineUsers;
}

function searchForm($con) {
    echo "

        <form action='/search.php' method='post'>
            <input type='text' name='search' placeholder='Search'>

            <button type='submit' style='display:none'></button>
        </form>

    ";

}

function loginForm($con, $query) {
    if(!isset($_SESSION['ID']))
        echo '
        <button id="showLogin" style="text-align:center; height:30px;" onclick="showLogin()">Log In</button>

        <form action= "/login.php?op=' . $query . '&board=' . $query . '&x=' . $_SERVER['PHP_SELF'] . '" method="post" onsubmit="myButton.disabled = true; return true;">
        <input type="text" name="email" placeholder="Email" />

        <input type="password" name="pwd" placeholder="Password" />

        <button type="submit" name="myButton" style="text-align:center; height:30px; width:150px">Log In</button>
        </form>
';
    else {
        $sql = "SELECT * FROM users WHERE ID = " . $_SESSION['ID'];
            $res = mysqli_query($con, $sql);
            while($row = mysqli_fetch_assoc( $res ))
                 echo '

Logged in as ' . $row["name"] . '

                    <form action= "/logout.php?op=' . $query . '&board=' . $query . '&x=' . $_SERVER['PHP_SELF'] . '" method="post" style="display:inline;">
                    <button style="text-align:center; height:30px; width:150px">Log Out</button>
                    </form>

';
    }
}

function boardList($con, $query) {

echo '

';

echo '
';

//BOARDS
$boardList = array('random', 'anime', 'cyberpunk', 'design', 'development', 'feels', 'music', 'technology', 'meta');
foreach($boardList as $boardName)
    echo '
 ' . ucfirst($boardName) . '
';
    echo '
 Home
';

echo '
';
}

function footer($con) {
    echo '
';

    //OTHERS
    $sql = "SELECT * FROM hitCounter";
    $res = mysqli_query($con, $sql);
    while($row = mysqli_fetch_assoc($res))
        $count = $row['count'];

    echo '

        Users online: '.onlineUsers($con).'
         | Users last 24h: '.activeUsers($con).'
         | Visits: '.$count.'
         | Statistics
         | Rules
         | GitHub
         | Cyber
         | Windows95
         | Stålenhag
         | 4kev@protonmail.com

';

    echo '
';
/*
    //THEMES
    echo '

        Cyber
        Normie

';
*/
    echo '
';
}
/*
        Tomorrow
        Insomnia
        Yotsuba
        Yotsuba-B
        Photon
*/
function my_hash_equals($str1, $str2) {
    if(strlen($str1) != strlen($str2)) {
      return false;
    } else {
      $res = $str1 ^ $str2;
      $ret = 0;
      for($i = strlen($res) - 1; $i >= 0; $i--) $ret |= ord($res[$i]);
      return !$ret;
    }
}

function foo($n) {
    if($n==0)
        return 3;
    else
        return 1 + foo($n - 1);
}

?>


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Container, Header, Title, Content, Button, Icon, Left, Right, Body, Text, H3 } from 'native-base';
import { Actions } from 'react-native-router-flux';

import { actions } from 'react-native-navigation-redux-helpers';
import { openDrawer } from '../../actions/drawer';
import styles from './styles';

const {
    popRoute,
  } = actions;

class Outline extends Component {  // eslint-disable-line

  static propTypes = {
    openDrawer: React.PropTypes.func,
    popRoute: React.PropTypes.func,
    navigation: React.PropTypes.shape({
      key: React.PropTypes.string,
    }),
  }

  popRoute() {
    this.props.popRoute(this.props.navigation.key);
  }
  render() {
    return (
      <Container style={styles.container}>
        <Header>
          <Left>
          <Button transparent onPress={() => Actions.pop()}>
            <Icon name="arrow-back" />
          </Button>
          </Left>
          <Body>
            <Title>Outline</Title>
          </Body>
          <Right />

        </Header>

        <Content padder style={{ backgroundColor: '#fff', padding: 20 }}>
          <Button bordered light style={styles.mb15}><Text>Light</Text></Button>
          <Button bordered info style={styles.mb15}><Text>Info</Text></Button>
          <Button bordered danger style={styles.mb15}><Text>Danger</Text></Button>
          <Button bordered primary style={styles.mb15}><Text>Primary</Text></Button>
          <Button bordered warning style={styles.mb15}><Text>Warning</Text></Button>
          <Button bordered success style={styles.mb15}><Text>Success</Text></Button>
          <Button bordered dark style={styles.mb15}><Text>Dark</Text></Button>
        </Content>
      </Container>
    );
  }
}

function bindAction(dispatch) {
  return {
    openDrawer: () => dispatch(openDrawer()),
    popRoute: key => dispatch(popRoute(key)),
  };
}

const mapStateToProps = state => ({
  navigation: state.cardNavigation,
  themeState: state.drawer.themeState,
});

export default connect(mapStateToProps, bindAction)(Outline);


text:
package org.gradle.api.internal.file.archive;

import org.apache.tools.tar.TarEntry;
import org.apache.tools.tar.TarInputStream;
import org.gradle.api.GradleException;
import org.gradle.api.InvalidUserDataException;
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.file.RelativePath;
import org.gradle.api.internal.file.AbstractFileTreeElement;
import org.gradle.api.internal.file.DefaultFileVisitDetails;
import org.gradle.api.internal.file.FileSystemSubset;
import org.gradle.api.internal.file.collections.DirectoryFileTree;
import org.gradle.api.internal.file.collections.DirectoryFileTreeFactory;
import org.gradle.api.internal.file.collections.FileSystemMirroringFileTree;
import org.gradle.api.internal.file.collections.MinimalFileTree;
import org.gradle.api.internal.file.collections.SingletonFileTree;
import org.gradle.api.resources.ResourceException;
import org.gradle.api.resources.internal.ReadableResourceInternal;
import org.gradle.internal.IoActions;
import org.gradle.internal.hash.FileHasher;
import org.gradle.internal.hash.HashCode;
import org.gradle.internal.hash.StreamHasher;
import org.gradle.internal.nativeintegration.filesystem.Chmod;
import org.gradle.internal.nativeintegration.filesystem.Stat;
import org.gradle.util.GFileUtils;

import javax.annotation.Nullable;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.atomic.AtomicBoolean;

public class TarFileTree implements MinimalFileTree, FileSystemMirroringFileTree {
    private final File tarFile;
    private final ReadableResourceInternal resource;
    private final Chmod chmod;
    private final Stat stat;
    private final DirectoryFileTreeFactory directoryFileTreeFactory;
    private final File tmpDir;
    private final StreamHasher streamHasher;
    private final FileHasher fileHasher;

    public TarFileTree(@Nullable File tarFile, ReadableResourceInternal resource, File tmpDir, Chmod chmod, Stat stat, DirectoryFileTreeFactory directoryFileTreeFactory, StreamHasher streamHasher, FileHasher fileHasher) {
        this.tarFile = tarFile;
        this.resource = resource;
        this.chmod = chmod;
        this.stat = stat;
        this.directoryFileTreeFactory = directoryFileTreeFactory;
        this.tmpDir = tmpDir;
        this.streamHasher = streamHasher;
        this.fileHasher = fileHasher;
    }

    public String getDisplayName() {
        return String.format("TAR '%s'", resource.getDisplayName());
    }

    public DirectoryFileTree getMirror() {
        return directoryFileTreeFactory.create(getExpandedDir());
    }

    public void visit(FileVisitor visitor) {
        InputStream inputStream;
        try {
            inputStream = new BufferedInputStream(resource.read());
        } catch (ResourceException e) {
            throw cannotExpand(e);
        }

        try {
            try {
                visitImpl(visitor, inputStream);
            } finally {
                inputStream.close();
            }
        } catch (Exception e) {
            String message = "Unable to expand " + getDisplayName() + "\n"
                + "  The tar might be corrupted or it is compressed in an unexpected way.\n"
                + "  By default the tar tree tries to guess the compression based on the file extension.\n"
                + "  If you need to specify the compression explicitly please refer to the DSL reference.";
            throw new GradleException(message, e);
        }
    }

    private void visitImpl(FileVisitor visitor, InputStream inputStream) throws IOException {
        AtomicBoolean stopFlag = new AtomicBoolean();
        NoCloseTarInputStream tar = new NoCloseTarInputStream(inputStream);
        TarEntry entry;
        File expandedDir = getExpandedDir();
        while (!stopFlag.get() && (entry = tar.getNextEntry()) != null) {
            if (entry.isDirectory()) {
                visitor.visitDir(new DetailsImpl(resource, expandedDir, entry, tar, stopFlag, chmod));
            } else {
                visitor.visitFile(new DetailsImpl(resource, expandedDir, entry, tar, stopFlag, chmod));
            }
        }
    }

    private File getBackingFile() {
        if (tarFile != null) {
            return tarFile;
        }
        return resource.getBackingFile();
    }

    private File getExpandedDir() {
        HashCode fileHash = tarFile != null ? hashFile(tarFile) : hashResource(resource);
        String expandedDirName = resource.getBaseName() + "_" + fileHash;
        return new File(tmpDir, expandedDirName);
    }

    private HashCode hashFile(File tarFile) {
        try {
            return fileHasher.hash(tarFile);
        } catch (Exception e) {
            throw cannotExpand(e);
        }
    }

    private HashCode hashResource(ReadableResourceInternal resource) {
        InputStream inputStream = null;
        try {
            inputStream = new BufferedInputStream(resource.read());
            return streamHasher.hash(inputStream);
        } catch (ResourceException e) {
            throw cannotExpand(e);
        } finally {
            IoActions.closeQuietly(inputStream);
        }
    }

    private RuntimeException cannotExpand(Exception e) {
        throw new InvalidUserDataException(String.format("Cannot expand %s.", getDisplayName()), e);
    }

    @Override
    public void registerWatchPoints(FileSystemSubset.Builder builder) {
        File backingFile = getBackingFile();
        if (backingFile != null) {
            builder.add(backingFile);
        }
    }

    @Override
    public void visitTreeOrBackingFile(final FileVisitor visitor) {
        File backingFile = getBackingFile();
        if (backingFile != null) {
            new SingletonFileTree(backingFile).visit(visitor);
        } else {
            // We need to wrap the visitor so that the file seen by the visitor has already
            // been extracted from the archive and we do not try to extract it again.
            // It's unsafe to keep the FileVisitDetails provided by TarFileTree directly
            // because we do not expect to visit the same paths again (after extracting everything).
            visit(new FileVisitor() {
                private final AtomicBoolean stopFlag = new AtomicBoolean();

                @Override
                public void visitDir(FileVisitDetails dirDetails) {
                    visitor.visitDir(new DefaultFileVisitDetails(dirDetails.getFile(), dirDetails.getRelativePath(), stopFlag, chmod, stat));
                }

                @Override
                public void visitFile(FileVisitDetails fileDetails) {
                    visitor.visitFile(new DefaultFileVisitDetails(fileDetails.getFile(), fileDetails.getRelativePath(), stopFlag, chmod, stat));
                }
            });
        }
    }

    private static class DetailsImpl extends AbstractFileTreeElement implements FileVisitDetails {
        private final TarEntry entry;
        private final NoCloseTarInputStream tar;
        private final AtomicBoolean stopFlag;
        private final ReadableResourceInternal resource;
        private final File expandedDir;
        private File file;
        private boolean read;

        public DetailsImpl(ReadableResourceInternal resource, File expandedDir, TarEntry entry, NoCloseTarInputStream tar, AtomicBoolean stopFlag, Chmod chmod) {
            super(chmod);
            this.resource = resource;
            this.expandedDir = expandedDir;
            this.entry = entry;
            this.tar = tar;
            this.stopFlag = stopFlag;
        }

        public String getDisplayName() {
            return String.format("tar entry %s!%s", resource.getDisplayName(), entry.getName());
        }

        public void stopVisiting() {
            stopFlag.set(true);
        }

        public File getFile() {
            if (file == null) {
                file = new File(expandedDir, entry.getName());
                if (!file.exists()) {
                    copyTo(file);
                }
            }
            return file;
        }

        public long getLastModified() {
            return entry.getModTime().getTime();
        }

        public boolean isDirectory() {
            return entry.isDirectory();
        }

        public long getSize() {
            return entry.getSize();
        }

        public InputStream open() {
            if (read && file != null) {
                return GFileUtils.openInputStream(file);
            }
            if (read || tar.getCurrent() != entry) {
                throw new UnsupportedOperationException(String.format("The contents of %s has already been read.", this));
            }
            read = true;
            return tar;
        }

        public RelativePath getRelativePath() {
            return new RelativePath(!entry.isDirectory(), entry.getName().split("/"));
        }

        public int getMode() {
            return entry.getMode() & 0777;
        }
    }

    private static class NoCloseTarInputStream extends TarInputStream {
        public NoCloseTarInputStream(InputStream is) {
            super(is);
        }

        @Override
        public void close() throws IOException {
        }

        public TarEntry getCurrent() {
            return currEntry;
        }
    }
}


text:
#include <funtional>
#include <queue>
#include <vector>
using namespace std;

/*
Solution: see comments.

Time complexity: O(d * (a * log(a))) [where d is the total number of diagonals and a is the average number of integers per diagonal]
Space complexity: O(rows * columns) [where rows is the number of rows in the matrix and columns is the number of columns in the matrix]
*/

class Solution
{
    public:
        vector<vector<int>> diagonalSort(vector<vector<int>> & mat)
        {
            int rows=mat.size();

            int columns=mat[0].size();

            //Iterate through all the diagonals starting with the first number in each row
            for(int row=rows-1;row>=0;row--)
            {
                int r=row;

                int column=0;

                //Use a minimum heap to store the values from each diagonal in sorted order
                priority_queue<int, vector<int>, greater<int>> minHeap;

                //Iterate over the diagonal and add all values to the minHeap
                while(r < rows and column < columns)
                {
                    minHeap.emplace(mat[r][column]);

                    r+=1;

                    column+=1;
                }

                r=row;

                column=0;

                //Iterate back through the diagonal and replace each number with the correct sorted value from the minHeap
                while(r < rows and column < columns and !minHeap.empty())
                {
                    mat[r][column]=minHeap.top();

                    minHeap.pop();

                    r+=1;

                    column+=1;
                }

            }

            //Iterate through all the digonals that start with the first number in each column beginning with the second column
            for(int column=1;column<columns;column++)
            {
                int row=0;

                int c=column;

                //Use a minimum heap to sort the elements from the diagonal
                priority_queue<int, vector<int>, greater<int>> minHeap;

                //Loop through the diagonal and add all elements to the minimum heap
                while(row < rows and c < columns)
                {
                    minHeap.emplace(mat[row][c]);

                    row+=1;

                    c+=1;
                }

                row=0;

                c=column;

                //Loop back through the diagonal and replace each number with the correct sorted value
                while(row < rows and c < columns and !minHeap.empty())
                {
                    mat[row][c]=minHeap.top();

                    minHeap.pop();

                    row+=1;

                    c+=1;
                }
            }

            return mat;
        }
};


text:
(function() {
  'use strict';

  angular.module('sensors')
    .controller('ProximityController', ProximityController);

  function ProximityController($scope, $rootScope, $window, $log) {

    $scope.title = 'Proximity';
    $scope.proximity = {
      user: 'far',
      device: 5
    }

    ////////////

    $scope.$on('$ionicView.beforeEnter', function() {
      $log.debug('Proximity:beforeEnter');
      $window.addEventListener('userproximity', handleUserProximity);
      $window.addEventListener('deviceproximity', handleDeviceProximity);
    });

    $scope.$on('$ionicView.beforeLeave', function() {
      $log.debug('Proximity:beforeLeave');
      $window.removeEventListener('userproximity', handleUserProximity);
      $window.removeEventListener('deviceproximity', handleDeviceProximity);
    });

    function handleUserProximity(e) {
      $log.debug('Proximity(user):' + e.near);
      $scope.proximity.user = e.near ? 'near' : 'far';
      $rootScope.$apply();
    }

    function handleDeviceProximity(e) {
      $log.debug('Proximity(device):' + e.value);
      $scope.proximity.device = e.value;
      $rootScope.$apply();
    }

  }

})();


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#4CAF50</color>
    <color name="colorPrimaryDark">#388E3C</color>
    <color name="colorAccent">#09e0bf</color>
</resources>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GlobalcachingApplication.Plugins.Browser
{
    public class BrowserScriptPocketQueries : BrowserScript
    {
        public const string STR_SAVE = "Save settings";
        public const string STR_RESTORE = "Restore settings...";
        public const string STR_CREATE = "Create series...";
        public const string STR_SETTINGSSAVED = "Pocket Query settings has been saved";
        public const string STR_ERROR = "Error";
        public const string STR_DELETE = "Delete _gcpqgen_";

        private Button saveButton = null;
        private Button resoreButton = null;
        private Button createButton = null;
        private Button deleteButton = null;
        private string _settingsFileName = null;
        private string _seriesFileName = null;

        public BrowserScriptPocketQueries(WebbrowserForm.BrowserTab browserTab, Utils.BasePlugin.Plugin ownerPlugin, WebBrowser webBrowser, Framework.Interfaces.ICore core)
            : base(browserTab, ownerPlugin, "Pocket Queries", webBrowser, core, true)
        {
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SAVE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_RESTORE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_CREATE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SETTINGSSAVED));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_DELETE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_OK));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_REMOVE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_SAVE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSettingForm.STR_TITLE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_AUTODATERANGES));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_AUTOMATIC));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_BELGIUM));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_CANCEL));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_CREATEPQ));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_DATE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_DELAY));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_END));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_ERROR));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_FROMSELECTION));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_ITALY));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_MARGIN));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_MAXINLASTPQ));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_MAXINPQ));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_NAME));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_NETHERLANDS));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_NEW));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_REMOVE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_RENAME));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_SAVE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_SERIE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_SETTINGS));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_START));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_TEMPLATE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_TITLE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_AUTOMATICACTIVATE));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesForm.STR_FROMGCPROJECT));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesGCProjectForm.STR_DESCRIPTION));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesGCProjectForm.STR_OK));
            core.LanguageItems.Add(new Framework.Data.LanguageItem(BrowserScriptPocketQueriesPQSeriesGCProjectForm.STR_TITLE));

            webBrowser.Navigating += new WebBrowserNavigatingEventHandler(webBrowser_Navigating);
            webBrowser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser_DocumentCompleted);

            try
            {
                string p = core.PluginDataPath;
                _settingsFileName = System.IO.Path.Combine(new string[] { p, "pqsettings.xml" });
                _seriesFileName = System.IO.Path.Combine(new string[] { p, "pqseries.xml" });
            }
            catch
            {
            }
        }

        public override void LanguageChanged()
        {
            if (saveButton != null)
            {
                saveButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE);
                resoreButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_RESTORE);
                createButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATE);
                deleteButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DELETE);
            }
        }

        void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (saveButton != null)
            {
                saveButton.Enabled = !string.IsNullOrEmpty(_settingsFileName) && Browser.Url != null && Browser.Url.OriginalString.ToLower().IndexOf("geocaching.com/pocket/gcquery.aspx") >= 0;
                resoreButton.Enabled = saveButton.Enabled;
                createButton.Enabled = !string.IsNullOrEmpty(_settingsFileName) && Browser.Url != null && Browser.Url.OriginalString.ToLower().IndexOf("geocaching.com/pocket/") >= 0 && Browser.Document != null && Browser.Document.GetElementById("ctl00_ContentBody_PQListControl1_btnScheduleNow") != null;
                deleteButton.Enabled = createButton.Enabled;
            }
        }

        void webBrowser_Navigating(object sender, WebBrowserNavigatingEventArgs e)
        {
            if (saveButton != null)
            {
                saveButton.Enabled = false;
                resoreButton.Enabled = false;
                createButton.Enabled = false;
                deleteButton.Enabled = false;
            }
        }

        public override void CreateControls(Control.ControlCollection collection)
        {
            Panel p = new Panel();
            p.Width = 240;
            p.Height = 110;

            saveButton = new Button();
            saveButton.Width = 190;
            saveButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SAVE);
            saveButton.Enabled = false;
            saveButton.Click += new EventHandler(saveButton_Click);
            p.Controls.Add(saveButton);

            resoreButton = new Button();
            resoreButton.Location = new System.Drawing.Point(saveButton.Left, saveButton.Bottom + 5);
            resoreButton.Width = saveButton.Width;
            resoreButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_RESTORE);
            resoreButton.Enabled = false;
            resoreButton.Click += new EventHandler(resoreButton_Click);
            p.Controls.Add(resoreButton);

            createButton = new Button();
            createButton.Location = new System.Drawing.Point(resoreButton.Left, resoreButton.Bottom + 5);
            createButton.Width = saveButton.Width;
            createButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATE);
            createButton.Enabled = false;
            createButton.Click += new EventHandler(createButton_Click);
            p.Controls.Add(createButton);

            deleteButton = new Button();
            deleteButton.Location = new System.Drawing.Point(createButton.Left, createButton.Bottom + 5);
            deleteButton.Width = saveButton.Width;
            deleteButton.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DELETE);
            deleteButton.Enabled = false;
            deleteButton.Click += new EventHandler(deleteButton_Click);
            p.Controls.Add(deleteButton);

            collection.Add(p);
        }

        void saveButton_Click(object sender, EventArgs e)
        {
            BrowserScriptPocketQueriesPQSetting pq = BrowserScriptPocketQueriesPQSetting.FromPQPage(Core, this.OwnerPlugin, Browser);
            if (pq != null)
            {
                try
                {
                    List<BrowserScriptPocketQueriesPQSetting> l = BrowserScriptPocketQueriesPQSetting.Load(_settingsFileName);
                    BrowserScriptPocketQueriesPQSetting pqs = (from p in l where p.Name == pq.Name select p).FirstOrDefault();
                    if (pqs != null)
                    {
                        pq.ID = pqs.ID;
                        l.Remove(pqs);
                    }
                    l.Add(pq);
                    BrowserScriptPocketQueriesPQSetting.Save(_settingsFileName, l);
                    MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_SETTINGSSAVED));
                }
                catch
                {
                    MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR));
                }
            }
            else
            {
                MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR));
            }
        }

        void resoreButton_Click(object sender, EventArgs e)
        {
            using (BrowserScriptPocketQueriesPQSettingForm dlg = new BrowserScriptPocketQueriesPQSettingForm(_settingsFileName))
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (dlg.SelectedSetting != null)
                    {
                        if (!dlg.SelectedSetting.SetPQPage(Browser))
                        {
                            MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR));
                        }
                    }
                }
            }
        }

        void createButton_Click(object sender, EventArgs e)
        {
            using (BrowserScriptPocketQueriesPQSeriesForm dlg = new BrowserScriptPocketQueriesPQSeriesForm(Core, this.OwnerPlugin, _settingsFileName, _seriesFileName, Browser))
            {
                dlg.ShowDialog();
            }
        }

        void deleteButton_Click(object sender, EventArgs e)
        {
            try
            {
                bool autoQueriesFound = false;
                //ok, now we need to check the checkboxes where the name starts with _gcpqgen_
                bool usedQuotes = true;
                string docText = Browser.Document.Body.InnerHtml;
                int pos;
                pos = docText.IndexOf("id=\"chk", StringComparison.OrdinalIgnoreCase);
                if (pos < 0)
                {
                    pos = docText.IndexOf("id=chk", StringComparison.OrdinalIgnoreCase);
                    usedQuotes = false;
                }
                while (pos > 0)
                {
                    int pos2;
                    string elementId;

                    if (usedQuotes)
                    {
                        pos = docText.IndexOf("\"", pos, StringComparison.OrdinalIgnoreCase)+1;
                        pos2 = docText.IndexOf("\"", pos, StringComparison.OrdinalIgnoreCase);
                        elementId = docText.Substring(pos, pos2 - pos);
                    }
                    else
                    {
                        pos += 3;
                        pos2 = docText.IndexOf(" ", pos + 1, StringComparison.OrdinalIgnoreCase);
                        elementId = docText.Substring(pos, pos2 - pos);
                    }

                    //now get the name of the PQ
                    //first look for "(500)" ALERT! tricky!
                    int namePos;
                    int namePos1 = docText.IndexOf("(500)", pos, StringComparison.OrdinalIgnoreCase);
                    int namePos2 = docText.IndexOf("(1000)", pos, StringComparison.OrdinalIgnoreCase);
                    if (namePos1 > 0 && (namePos2 < 0 || namePos1 < namePos2))
                    {
                        namePos = namePos1;
                    }
                    else
                    {
                        namePos = namePos2;
                    }

                    pos = docText.IndexOf("id=\"chk", pos2, StringComparison.OrdinalIgnoreCase);
                    if (pos < 0)
                    {
                        pos = docText.IndexOf("id=chk", pos2, StringComparison.OrdinalIgnoreCase);
                        usedQuotes = false;
                    }
                    else
                    {
                        usedQuotes = true;
                    }

                    if (namePos > 0 && (namePos < pos || pos < 0))
                    {
                        //this means that the (500) belongs to current PQ
                        //now look for the name;
                        namePos = docText.IndexOf(">", namePos, StringComparison.OrdinalIgnoreCase);
                        pos2 = docText.IndexOf("<", namePos, StringComparison.OrdinalIgnoreCase);
                        string theName = docText.Substring(namePos + 1, pos2 - namePos - 1).Trim();

                        if (theName.IndexOf("_gcpqgen_") >= 0)
                        {
                            autoQueriesFound = true;
                            Browser.Document.GetElementById(elementId).InvokeMember("Click");
                        }
                    }
                }
                if (autoQueriesFound)
                {
                    pos = docText.IndexOf("lnkDeleteSelected", StringComparison.OrdinalIgnoreCase);
                    string elId = string.Format("ctl00_ContentBody_PQListControl1_PQRepeater_ctl{0}_lnkDeleteSelected", docText.Substring(pos - 3, 2));
                    HtmlElement he = Browser.Document.GetElementById(elId);
                    he.InvokeMember("Click");
                }
            }
            catch
            {
            }
        }

    }
}


text:
namespace Common.WpfControls
{
	using System;
	using System.Windows;
	using System.Windows.Controls;
	using System.Windows.Data;

	using Common.Resources.Converters;

	// TODO: (PS) Comment this.
	[TemplatePart(Type = typeof(Button), Name = DialogWindow.PartNames.OkButton)]
	[TemplatePart(Type = typeof(Button), Name = DialogWindow.PartNames.CancelButton)]
	[TemplatePart(Type = typeof(Button), Name = DialogWindow.PartNames.ApplyButton)]
	public class DialogWindow : Window
	{
		#region static constructor

		static DialogWindow()
		{
			ContentProperty.OverrideMetadata(typeof(DialogWindow), new PropertyMetadata(OnContentChanged));
		}

		#endregion static constructor

		#region dependency properties

		/// <summary>
		/// Registration of CanApply Dependency Property.
		/// </summary>
		public static readonly DependencyProperty CanApplyProperty =
			DependencyProperty.Register("CanApply", typeof(bool), typeof(DialogWindow));

		/// <summary>
		/// Registration of ShowApplyButton Dependency Property.
		/// </summary>
		public static readonly DependencyProperty ShowApplyButtonProperty =
			DependencyProperty.Register("ShowApplyButton", typeof(bool), typeof(DialogWindow));

		#endregion dependency properties

		#region dependency property callbacks

		/// <summary>
		/// Property Changed Callback method of the Content Dependency Property.
		/// </summary>
		/// <param name="sender">The instance of the class that had the Content property changed.</param>
		/// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
		private static void OnContentChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
		{
			DialogWindow subject = (DialogWindow)sender;

			DependencyObject oldValue = e.OldValue as DependencyObject;
			if (oldValue != null)
			{
				oldValue.SetDialogWindow(null);
			}
			DependencyObject newValue = e.NewValue as DependencyObject;
			if (newValue != null)
			{
				newValue.SetDialogWindow(subject);
			}
		}

		#endregion dependency property callbacks

		#region fields

		private Button btnApply = null;
		private Button btnCancel = null;
		private Button btnOk = null;

		#endregion fields

		#region events

		/// <summary>
		/// TODO: (PS) Comment this.
		/// </summary>
		public event EventHandler Applied;

		#endregion events

		#region properties

		/// <summary>
		/// Gets or sets the value of the CanApply property.
		/// TODO: (PS) Comment this.
		/// This is a Dependency Property.
		/// </summary>
		public bool CanApply
		{
			get { return (bool)this.GetValue(CanApplyProperty); }
			set { this.SetValue(CanApplyProperty, value); }
		}

		/// <summary>
		/// Gets or sets the value of the ShowApplyButton property.
		/// TODO: (PS) Comment this.
		/// This is a Dependency Property.
		/// </summary>
		public bool ShowApplyButton
		{
			get { return (bool)this.GetValue(ShowApplyButtonProperty); }
			set { this.SetValue(ShowApplyButtonProperty, value); }
		}

		#endregion properties

		#region overrideable methods

		public override void OnApplyTemplate()
		{
			base.OnApplyTemplate();
			if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this) && this.Template != null)
			{
				try
				{
					this.btnOk = (Button)this.Template.FindName(PartNames.OkButton, this);
					this.btnOk.IsDefault = true;
					this.btnOk.Click += this.btnOk_Click;
					this.btnCancel = (Button)this.Template.FindName(PartNames.CancelButton, this);
					this.btnCancel.IsCancel = true;
					this.btnApply = (Button)this.Template.FindName(PartNames.ApplyButton, this);
					this.btnApply.Click += this.btnApply_Click;
					BindingOperations.SetBinding(this.btnApply, Button.VisibilityProperty, new Binding("ShowApplyButton")
					{
						Source = this,
						Converter = Singleton<VisibilityAsBooleanConverter>.Instance
					});
					BindingOperations.SetBinding(this.btnApply, Button.IsEnabledProperty, new Binding("CanApply")
					{
						Source = this
					});
				}
				catch (Exception ex)
				{
					throw new InvalidOperationException("Template could not be applied.", ex);
				}
			}
		}

		#endregion overrideable methods

		#region methods

		/// <summary>
		/// Raises the <see cref="E:Applied"/> event.
		/// </summary>
		private void OnApplied()
		{
			if (this.Applied != null)
			{
				this.Applied(this, null);
			}
		}

		#endregion methods

		#region event handlers

		private void btnApply_Click(object sender, RoutedEventArgs e)
		{
			this.OnApplied();
		}

		private void btnOk_Click(object sender, RoutedEventArgs e)
		{
			this.DialogResult = true;
		}

		#endregion event handlers

		#region nested types

		public static class PartNames
		{
			#region constants

			public const string ApplyButton = "PART_ApplyButton";
			public const string CancelButton = "PART_CancelButton";
			public const string OkButton = "PART_OkButton";

			#endregion constants
		}

		#endregion nested types
	}

	public static class DialogWindowHelper
	{
		#region extension methods

		/// <summary>
		/// Property getter method of DialogWindow Dependency Property.
		/// TODO: (PS) Comment this.
		/// </summary>
		/// <param name="subject">The subject.</param>
		/// <returns>The current value of the DialogWindow property.</returns>
		public static DialogWindow GetDialogWindow(this DependencyObject subject)
		{
			return (DialogWindow)subject.GetValue(DialogWindowProperty);
		}

		/// <summary>
		/// Property setter method of DialogWindow Dependency Property.
		/// TODO: (PS) Comment this.
		/// </summary>
		/// <param name="subject">The subject.</param>
		/// <param name="value">The supposed value of the DialogWindow property.</param>
		public static void SetDialogWindow(this DependencyObject subject, DialogWindow value)
		{
			subject.SetValue(DialogWindowProperty, value);
		}

		#endregion extension methods

		#region dependency properties

		/// <summary>
		/// Registration of DialogWindow Dependency Property.
		/// </summary>
		public static readonly DependencyProperty DialogWindowProperty =
			DependencyProperty.RegisterAttached("DialogWindow", typeof(DialogWindow), typeof(DialogWindowHelper), new FrameworkPropertyMetadata(null));

		#endregion dependency properties
	}
}


text:
import { useApolloClient } from '@apollo/client'
import { IsAdminQueryHook } from '__generated__/IsAdminQueryHook'
import useSerializedMe from '../useSerializedMe'
import ADMIN_SLUGS_QUERY from './queries/adminSlugs'

export default function() {
  const serializedMe = useSerializedMe()
  const client = useApolloClient()

  try {
    const cache = client.readQuery<IsAdminQueryHook>({
      query: ADMIN_SLUGS_QUERY,
    })

    const {
      sharify: { adminSlugs },
    } = cache

    return adminSlugs.includes(serializedMe.slug)
  } catch {
    return false
  }
}


text:
package org.librairy.boot.storage.system.column.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.librairy.boot.model.domain.relations.Contains;
import org.springframework.data.cassandra.mapping.Table;

/**
 * Created on 15/04/16:
 *
 * @author cbadenes
 */
@Table(value = "contains")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ContainColumn extends Contains {

}


text:
#pragma once

#include "envoy/api/v2/core/grpc_service.pb.h"
#include "envoy/grpc/async_client.h"
#include "envoy/stats/stats.h"

namespace Envoy {
namespace Grpc {

// Per-service factory for Grpc::AsyncClients. This factory is thread aware and will instantiate
// with thread local state. Clients will use ThreadLocal::Instance::dispatcher() for event handling.
class AsyncClientFactory {
public:
  virtual ~AsyncClientFactory() {}

  /**
   * Create a gRPC::AsyncClient.
   * @return AsyncClientPtr async client.
   */
  virtual AsyncClientPtr create() PURE;
};

typedef std::unique_ptr<AsyncClientFactory> AsyncClientFactoryPtr;

// Singleton gRPC client manager. Grpc::AsyncClientManager can be used to create per-service
// Grpc::AsyncClientFactory instances. All manufactured Grpc::AsyncClients must
// be destroyed before the AsyncClientManager can be safely destructed.
class AsyncClientManager {
public:
  virtual ~AsyncClientManager() {}

  /**
   * Create a Grpc::AsyncClients factory for a service. Validation of the service is performed and
   * will raise an exception on failure.
   * @param grpc_service envoy::api::v2::core::GrpcService configuration.
   * @param scope stats scope.
   * @param skip_cluster_check if set to true skips checks for cluster presence and being statically
   * configured.
   * @return AsyncClientFactoryPtr factory for grpc_service.
   * @throws EnvoyException when grpc_service validation fails.
   */
  virtual AsyncClientFactoryPtr
  factoryForGrpcService(const envoy::api::v2::core::GrpcService& grpc_service, Stats::Scope& scope,
                        bool skip_cluster_check) PURE;
};

typedef std::unique_ptr<AsyncClientManager> AsyncClientManagerPtr;

} // namespace Grpc
} // namespace Envoy


text:
drop table if exists target, source, trigger_actions;

create table target(a int, b char(10));
insert into target values(1, 'aaa');
insert into target values(2, 'bbb');
insert into target values(3, 'ccc');

create table source(a int, b varchar(10));
insert into source values(1, 'AAA');
insert into source values(2, 'BBB');
insert into source values(3, 'CCC');
insert into source values(4, 'DDD');
insert into source values(5, 'EEE');
insert into source values(6, 'FFF');

create table trigger_actions(id smallint auto_increment, info varchar);
create trigger trigg1 before update on target execute insert into trigger_actions(info) values ('updated');
create trigger trigg2 after insert on target execute insert into trigger_actions(info) values ('inserted');

--error should occur
merge into target t
using source s
on (s.a > t.a)
when matched then
update
set t.b=s.b
when not matched then
insert(t.a, t.b)
values(s.a, s.b);

select * from target order by 1;
select * from trigger_actions order by 1;

drop table target, source, trigger_actions;

--server side
create table target(a int, b char(10));
insert into target values(1, 'aaa');
insert into target values(2, 'bbb');
insert into target values(3, 'ccc');

create table source(a int, b varchar(10));
insert into source values(1, 'AAA');
insert into source values(2, 'BBB');
insert into source values(3, 'CCC');
insert into source values(4, 'DDD');
insert into source values(5, 'EEE');
insert into source values(6, 'FFF');

merge into target t
using source s
on (s.a > t.a)
when matched then
update
set t.b=s.b
when not matched then
insert(t.a, t.b)
values(s.a, s.b);

merge into target t
using source s
on (s.a <= t.a)
when matched then
update
set t.b=s.b
when not matched then
insert(t.a, t.b)
values(s.a, s.b);

select * from target order by 1;

drop table target, source;