text:
.class public Landroid/content/ContentProviderOperation$Builder;
.super Ljava/lang/Object;
.source "ContentProviderOperation.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/content/ContentProviderOperation;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "Builder"
.end annotation

# instance fields
.field private mExpectedCount:Ljava/lang/Integer;

.field private mSelection:Ljava/lang/String;

.field private mSelectionArgs:[Ljava/lang/String;

.field private mSelectionArgsBackReferences:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/Integer;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private final mType:I

.field private final mUri:Landroid/net/Uri;

.field private mValues:Landroid/content/ContentValues;

.field private mValuesBackReferences:Landroid/content/ContentValues;

.field private mYieldAllowed:Z

# direct methods
.method private constructor <init>(ILandroid/net/Uri;)V
    .locals 2
    .param p1, "type"    # I
    .param p2, "uri"    # Landroid/net/Uri;

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

    .line 414
    if-nez p2, :cond_0

    .line 415
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "uri must not be null"

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

    throw v0

    .line 417
    :cond_0
    iput p1, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    .line 418
    iput-object p2, p0, Landroid/content/ContentProviderOperation$Builder;->mUri:Landroid/net/Uri;

    .line 419
    return-void
.end method

.method synthetic constructor <init>(ILandroid/net/Uri;Landroid/content/ContentProviderOperation$1;)V
    .locals 0
    .param p1, "x0"    # I
    .param p2, "x1"    # Landroid/net/Uri;
    .param p3, "x2"    # Landroid/content/ContentProviderOperation$1;

    .prologue
    .line 401
    invoke-direct {p0, p1, p2}, Landroid/content/ContentProviderOperation$Builder;-><init>(ILandroid/net/Uri;)V

    return-void
.end method

.method static synthetic access$000(Landroid/content/ContentProviderOperation$Builder;)I
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    return v0
.end method

.method static synthetic access$100(Landroid/content/ContentProviderOperation$Builder;)Landroid/net/Uri;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mUri:Landroid/net/Uri;

    return-object v0
.end method

.method static synthetic access$200(Landroid/content/ContentProviderOperation$Builder;)Landroid/content/ContentValues;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    return-object v0
.end method

.method static synthetic access$300(Landroid/content/ContentProviderOperation$Builder;)Ljava/lang/String;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelection:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$400(Landroid/content/ContentProviderOperation$Builder;)[Ljava/lang/String;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgs:[Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$500(Landroid/content/ContentProviderOperation$Builder;)Ljava/lang/Integer;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mExpectedCount:Ljava/lang/Integer;

    return-object v0
.end method

.method static synthetic access$600(Landroid/content/ContentProviderOperation$Builder;)Ljava/util/Map;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgsBackReferences:Ljava/util/Map;

    return-object v0
.end method

.method static synthetic access$700(Landroid/content/ContentProviderOperation$Builder;)Landroid/content/ContentValues;
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    return-object v0
.end method

.method static synthetic access$800(Landroid/content/ContentProviderOperation$Builder;)Z
    .locals 1
    .param p0, "x0"    # Landroid/content/ContentProviderOperation$Builder;

    .prologue
    .line 401
    iget-boolean v0, p0, Landroid/content/ContentProviderOperation$Builder;->mYieldAllowed:Z

    return v0
.end method

# virtual methods
.method public build()Landroid/content/ContentProviderOperation;
    .locals 2

    .prologue
    .line 423
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_2

    .line 424
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    invoke-virtual {v0}, Landroid/content/ContentValues;->size()I

    move-result v0

    if-nez v0, :cond_2

    :cond_0
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    if-eqz v0, :cond_1

    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    invoke-virtual {v0}, Landroid/content/ContentValues;->size()I

    move-result v0

    if-nez v0, :cond_2

    .line 426
    :cond_1
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Empty values"

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

    throw v0

    .line 429
    :cond_2
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-ne v0, v1, :cond_5

    .line 430
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    if-eqz v0, :cond_3

    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    invoke-virtual {v0}, Landroid/content/ContentValues;->size()I

    move-result v0

    if-nez v0, :cond_5

    :cond_3
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    if-eqz v0, :cond_4

    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    invoke-virtual {v0}, Landroid/content/ContentValues;->size()I

    move-result v0

    if-nez v0, :cond_5

    :cond_4
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mExpectedCount:Ljava/lang/Integer;

    if-nez v0, :cond_5

    .line 433
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "Empty values"

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

    throw v0

    .line 436
    :cond_5
    new-instance v0, Landroid/content/ContentProviderOperation;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Landroid/content/ContentProviderOperation;-><init>(Landroid/content/ContentProviderOperation$Builder;Landroid/content/ContentProviderOperation$1;)V

    return-object v0
.end method

.method public withExpectedCount(I)Landroid/content/ContentProviderOperation$Builder;
    .locals 2
    .param p1, "count"    # I

    .prologue
    .line 585
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 586
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only updates, deletes, and asserts can have expected counts"

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

    throw v0

    .line 589
    :cond_0
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mExpectedCount:Ljava/lang/Integer;

    .line 590
    return-object p0
.end method

.method public withSelection(Ljava/lang/String;[Ljava/lang/String;)Landroid/content/ContentProviderOperation$Builder;
    .locals 3
    .param p1, "selection"    # Ljava/lang/String;
    .param p2, "selectionArgs"    # [Ljava/lang/String;

    .prologue
    const/4 v2, 0x0

    .line 564
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 565
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only updates, deletes, and asserts can have selections"

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

    throw v0

    .line 568
    :cond_0
    iput-object p1, p0, Landroid/content/ContentProviderOperation$Builder;->mSelection:Ljava/lang/String;

    .line 569
    if-nez p2, :cond_1

    .line 570
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgs:[Ljava/lang/String;

    .line 575
    :goto_0
    return-object p0

    .line 572
    :cond_1
    array-length v0, p2

    new-array v0, v0, [Ljava/lang/String;

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgs:[Ljava/lang/String;

    .line 573
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgs:[Ljava/lang/String;

    array-length v1, p2

    invoke-static {p2, v2, v0, v2, v1}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    goto :goto_0
.end method

.method public withSelectionBackReference(II)Landroid/content/ContentProviderOperation$Builder;
    .locals 3
    .param p1, "selectionArgIndex"    # I
    .param p2, "previousResult"    # I

    .prologue
    .line 483
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 484
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only updates, deletes, and asserts can have selection back-references"

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

    throw v0

    .line 487
    :cond_0
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgsBackReferences:Ljava/util/Map;

    if-nez v0, :cond_1

    .line 488
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgsBackReferences:Ljava/util/Map;

    .line 490
    :cond_1
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mSelectionArgsBackReferences:Ljava/util/Map;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-interface {v0, v1, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 491
    return-object p0
.end method

.method public withValue(Ljava/lang/String;Ljava/lang/Object;)Landroid/content/ContentProviderOperation$Builder;
    .locals 3
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "value"    # Ljava/lang/Object;

    .prologue
    .line 523
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 524
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only inserts and updates can have values"

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

    throw v0

    .line 526
    :cond_0
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    if-nez v0, :cond_1

    .line 527
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    .line 529
    :cond_1
    if-nez p2, :cond_2

    .line 530
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    invoke-virtual {v0, p1}, Landroid/content/ContentValues;->putNull(Ljava/lang/String;)V

    .line 552
    .end local p2    # "value":Ljava/lang/Object;
    :goto_0
    return-object p0

    .line 531
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_2
    instance-of v0, p2, Ljava/lang/String;

    if-eqz v0, :cond_3

    .line 532
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/String;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 533
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_3
    instance-of v0, p2, Ljava/lang/Byte;

    if-eqz v0, :cond_4

    .line 534
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Byte;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Byte;)V

    goto :goto_0

    .line 535
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_4
    instance-of v0, p2, Ljava/lang/Short;

    if-eqz v0, :cond_5

    .line 536
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Short;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Short;)V

    goto :goto_0

    .line 537
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_5
    instance-of v0, p2, Ljava/lang/Integer;

    if-eqz v0, :cond_6

    .line 538
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Integer;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_0

    .line 539
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_6
    instance-of v0, p2, Ljava/lang/Long;

    if-eqz v0, :cond_7

    .line 540
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Long;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    goto :goto_0

    .line 541
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_7
    instance-of v0, p2, Ljava/lang/Float;

    if-eqz v0, :cond_8

    .line 542
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Float;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Float;)V

    goto :goto_0

    .line 543
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_8
    instance-of v0, p2, Ljava/lang/Double;

    if-eqz v0, :cond_9

    .line 544
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Double;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Double;)V

    goto :goto_0

    .line 545
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_9
    instance-of v0, p2, Ljava/lang/Boolean;

    if-eqz v0, :cond_a

    .line 546
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, Ljava/lang/Boolean;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Boolean;)V

    goto :goto_0

    .line 547
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_a
    instance-of v0, p2, [B

    if-eqz v0, :cond_b

    .line 548
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    check-cast p2, [B

    .end local p2    # "value":Ljava/lang/Object;
    check-cast p2, [B

    invoke-virtual {v0, p1, p2}, Landroid/content/ContentValues;->put(Ljava/lang/String;[B)V

    goto :goto_0

    .line 550
    .restart local p2    # "value":Ljava/lang/Object;
    :cond_b
    new-instance v0, Ljava/lang/IllegalArgumentException;

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "bad value type: "

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

    move-result-object v1

    invoke-virtual {p2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v1

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

    move-result-object v1

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

    throw v0
.end method

.method public withValueBackReference(Ljava/lang/String;I)Landroid/content/ContentProviderOperation$Builder;
    .locals 2
    .param p1, "key"    # Ljava/lang/String;
    .param p2, "previousResult"    # I

    .prologue
    .line 465
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 466
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only inserts, updates, and asserts can have value back-references"

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

    throw v0

    .line 469
    :cond_0
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    if-nez v0, :cond_1

    .line 470
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    .line 472
    :cond_1
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    invoke-static {p2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 473
    return-object p0
.end method

.method public withValueBackReferences(Landroid/content/ContentValues;)Landroid/content/ContentProviderOperation$Builder;
    .locals 2
    .param p1, "backReferences"    # Landroid/content/ContentValues;

    .prologue
    .line 449
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 450
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only inserts, updates, and asserts can have value back-references"

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

    throw v0

    .line 453
    :cond_0
    iput-object p1, p0, Landroid/content/ContentProviderOperation$Builder;->mValuesBackReferences:Landroid/content/ContentValues;

    .line 454
    return-object p0
.end method

.method public withValues(Landroid/content/ContentValues;)Landroid/content/ContentProviderOperation$Builder;
    .locals 2
    .param p1, "values"    # Landroid/content/ContentValues;

    .prologue
    .line 502
    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x2

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/content/ContentProviderOperation$Builder;->mType:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 503
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v1, "only inserts, updates, and asserts can have values"

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

    throw v0

    .line 506
    :cond_0
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    if-nez v0, :cond_1

    .line 507
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    iput-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    .line 509
    :cond_1
    iget-object v0, p0, Landroid/content/ContentProviderOperation$Builder;->mValues:Landroid/content/ContentValues;

    invoke-virtual {v0, p1}, Landroid/content/ContentValues;->putAll(Landroid/content/ContentValues;)V

    .line 510
    return-object p0
.end method

.method public withYieldAllowed(Z)Landroid/content/ContentProviderOperation$Builder;
    .locals 0
    .param p1, "yieldAllowed"    # Z

    .prologue
    .line 594
    iput-boolean p1, p0, Landroid/content/ContentProviderOperation$Builder;->mYieldAllowed:Z

    .line 595
    return-object p0
.end method


text:
using System;
using System.Data;

using bv.common.db;

namespace EIDSS
{
    /// <summary>
    /// Summary description for ObjectTypeList_DB.
    /// </summary>
    public class ObjectTypeList_DB : BaseDbService
    {
        public string ParentID { get; set; }
        public const string ObjectTypeTreeTable = "ObjectTypeTree";

        public ObjectTypeList_DB()
        {
            ObjectName = "ObjectTypeTree";
        }

        public override DataSet GetDetail(object ID)
        {
            var dataSet = new DataSet { EnforceConstraints = false };
            var command = CreateSPCommand("spObjectTypeTree");
            AddParam(command, "@LangID", bv.model.Model.Core.ModelUserContext.CurrentLanguage, ref m_Error);
            FillDataset(command, dataSet, ObjectName);

            foreach (DataColumn col in dataSet.Tables[0].Columns)
                col.ReadOnly = false;

            m_IsNewObject = false;
            return (dataSet);
        }

        public override bool PostDetail(DataSet ds, int postType, IDbTransaction transaction = null)
        {
            DataTable dataTable = ds.Tables[ObjectTypeTreeTable];
            if (dataTable == null)
            {
                throw new ApplicationException("Invalid dataset");
            }
            foreach (DataRow row in dataTable.Rows)
            {
                /*				if(row["idfsBaseReferenceRelationType"].ToString()=="brrObjectTypeINACTIVE")
                                {
                                    row.Delete();
                                }*/
                if (row.RowState == DataRowState.Unchanged)
                {
                    continue;
                }

                IDbCommand command = CreateSPCommand("spObjectTypeTree_post");
                if (row.RowState == DataRowState.Deleted)
                {
                    AddParam(command, "@idfsParentObjectType", row["idfsParentObjectType", DataRowVersion.Original], ref m_Error);
                    AddParam(command, "@idfsRelatedObjectType", row["idfsRelatedObjectType", DataRowVersion.Original], ref m_Error);
                    AddParam(command, "@idfsStatus", 10107001, ref m_Error);//brrObjectTypeINACTIVE
                }
                else
                {
                    AddParam(command, "@idfsParentObjectType", row["idfsParentObjectType"], ref m_Error);
                    AddParam(command, "@idfsRelatedObjectType", row["idfsRelatedObjectType"], ref m_Error);
                    AddParam(command, "@idfsStatus", row["idfsStatus"], ref m_Error);
                }
                ExecCommand(command, Connection, transaction, true);
            }
            return (true);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
import os
import binascii
from git import Repo, Blob, Tree

def getLocalRepos(path):
    matches = []
    for root, dirnames, _ in os.walk(path):
        for dir in dirnames:
            if dir == ".git":
                matches.append(root)
    #some code for bare repositories
    return matches

def getRepoDetals(path):

    repo = Repo(path)
    results = {'name':'', 'local_path':path, 'branches':[], 'remotes':[], 'active_branch':'master'}
    results['name'] = path[path.rindex(os.sep)+1:]
    results['active_branch'] = repo.active_branch.name
    for b in repo.branches:
        results['branches'].append(b.name)
    for r in repo.remotes:
        results['remotes'].append(r.name)
    return results

def getFilesAndFoldersByTree(Tree):

    results = {'folders':[],'files':[]}

    results['folders'] = Tree.trees
    results['files'] = Tree.blobs

    #files = Tree.blobs
    #folders = Tree.trees
    #for entry in files: # intuitive iteration of tree members
    #        print(entry.path+" : "+str(entry))

    #for entry in folders: # intuitive iteration of tree members
    #        print("> "+entry.path+" : "+str(entry))
            #subfolders = entry.trees
            #print subfolders
            #subfiles = entry.blobs
            #print subfiles
    return results

def fetchRepo(path,branch):
    repo = Repo(path)

    RootTree = repo.heads[branch].commit.tree
    #RootTree = repo.tree()
    print "Root: "+ str(RootTree)
    firstLevel = getFilesAndFoldersByTree(RootTree)
    print firstLevel
    print "Second level"
    for folder in firstLevel['folders']:
        print getFilesAndFoldersByTree(folder)

def getContent(path,hash):
    #
    print str(Blob(Repo(path), binascii.a2b_hex(hash)).data_stream.read())
    pass

def getChilds(path,hash):
    #
    t = Tree(Repo(path), binascii.a2b_hex(hash),path="")
    return getFilesAndFoldersByTree(t)

#fetchRepo("/Users/lenchevsky/Projects/personal/organikos","master")
#print getRepoDetals("/Users/lenchevsky/Projects/personal/organikos")
#getContent("/Users/lenchevsky/Projects/personal/organikos","bf603e2414bce6f904da2675e8e9956ae47f3a14")
print getChilds("/Users/lenchevsky/Projects/personal/web_sites/lisa.ga","7a0e7db2abc56b4bdfd43a156f4b4a408a69012f")


text:
// Copyright 2015 Microsoft Corporation. All rights reserved.
// This code is governed by the license found in the LICENSE file.

/*---
description: Testing length property of Math.cbrt
es6id: 20.2.2.9
---*/

assert.sameValue(Math.cbrt.length, 1);


text:
package ceylon.interop.java.internal;

import ceylon.language.Array;
import ceylon.language.AssertionError;
import ceylon.language.SharedAnnotation$annotation$;

import com.redhat.ceylon.compiler.java.language.ByteArray;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Ignore;
import com.redhat.ceylon.compiler.java.metadata.Method;
import com.redhat.ceylon.compiler.java.metadata.Name;
import com.redhat.ceylon.compiler.java.metadata.TypeInfo;

@Ceylon(major = 7)
@Method
@SharedAnnotation$annotation$
public final class javaByteArray_ {

    @Ignore
    private javaByteArray_() {}

    /**
     * Cast a Ceylon Array<ceylon.language.Byte>
     * or Array<java.lang.Byte> to a Java
     * ByteArray, that is, to byte[],
     * preserving the identity of the given array.
     *
     * @see ByteArray
     */
    public static byte[] javaByteArray(@SuppressWarnings("rawtypes") @Name("array")
    @TypeInfo("ceylon.language::Array<ceylon.language::Byte>|ceylon.language::Array<java.lang::Byte>")
    Object array){
        @SuppressWarnings("rawtypes")
        Object a = ((Array) array).toArray();
        if (a instanceof byte[]){
            return (byte[]) a;
        }
        throw new AssertionError("Invalid source array type: "+a);
    }

}


text:
module.exports = function ({ $incremental, $lookup }) {
    return {
        object: function () {
            const twiddle = require('../../cycle/twiddle')

            return function () {
                return function ($buffer, $start, $end) {
                    let object = {
                        value: 0,
                        sentry: 0
                    }

                    if ($end - $start < 5) {
                        return $incremental.object(object, 1)($buffer, $start, $end)
                    }

                    object.value = (
                        $buffer[$start++] << 24 |
                        $buffer[$start++] << 16 |
                        $buffer[$start++] << 8 |
                        $buffer[$start++]
                    ) >>> 0

                    object.value = (value => twiddle(value))(object.value)

                    object.sentry = $buffer[$start++]

                    return { start: $start, object: object, parse: null }
                }
            } ()
        }
    }
}


text:
<?php

namespace frontend\modules\site\controllers;

use Yii;
use yii\filters\AccessControl;

use frontend\components\AppController;
use frontend\modules\site\models\forms\ContactForm;
use common\modules\users\models\User;

/**
 * Site controller
 */
class DefaultController extends AppController
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'actions' => ['error', 'index', 'contact', 'captcha', 'development', 'about'],
                        'allow' => true,
                        'roles' => ['?'],
                    ],
                    [
                        'allow' => true,
                        'roles' => [User::ROLE_USER],
                    ]
                ],
            ]
        ];
    }

    /**
     * @inheritdoc
     */
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
            'captcha' => [
                'class' => 'yii\captcha\CaptchaAction',
                'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null,
            ],
        ];
    }

    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionIndex()
    {
        $this->showMainSlider = true;
        return $this->render('index', []);
    }

    /**
     * Displays contact page.
     *
     * @return mixed
     */
    public function actionContact()
    {
        $model = new ContactForm();
        if ($model->load(Yii::$app->request->post()) && $model->validate()) {
            if ($model->sendEmail(Yii::$app->params['adminEmail'])) {
                Yii::$app->session->setFlash('success', Yii::t('app', 'Спасибо за ваш вопрос.'));
            } else {
                Yii::$app->session->setFlash('error', Yii::t('app', 'Ошибка отправки сообщения.'));
            }

            return $this->refresh();
        } else {
            return $this->render('contact', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Displays about page.
     *
     * @return mixed
     */
    public function actionAbout()
    {
        return $this->render('about');
    }
}


text:
using Sitecore.Collections;
using Sitecore.Data;
using Sitecore.Globalization;

namespace Synthesis.FieldTypes.Adapters
{
	public interface IDatabaseAdapter
	{
		/// <summary>
		/// Gets the name of the database.
		///
		/// </summary>
		///
		/// <value>
		/// The name.
		/// </value>
		string Name { get; }

		Database InnerDatabase { get; }

		/// <summary>
		/// Gets an item from a path.
		///
		/// </summary>
		/// <param name="itemId">The item id.</param>
		/// <returns/>
		IStandardTemplateItem GetItem(ID itemId);

		/// <summary>
		/// Gets an item from a path.
		///
		/// </summary>
		/// <param name="itemId">The item id.</param><param name="language">The language.</param>
		/// <returns/>
		IStandardTemplateItem GetItem(ID itemId, Language language);

		/// <summary>
		/// Gets an item from a path.
		///
		/// </summary>
		/// <param name="itemId">The item id.</param><param name="language">The language.</param><param name="version">The version.</param>
		/// <returns/>
		IStandardTemplateItem GetItem(ID itemId, Language language, Version version);

		/// <summary>
		/// Gets an item from a path.
		///
		/// </summary>
		/// <param name="path">The path.</param>
		/// <returns/>
		IStandardTemplateItem GetItem(string path);

		/// <summary>
		/// Gets an item from a path.
		///
		/// </summary>
		/// <param name="path">The path.</param><param name="language">The language.</param>
		/// <returns>
		/// The item.
		/// </returns>
		IStandardTemplateItem GetItem(string path, Language language);

		/// <summary>
		/// Gets an item from a path.
		///
		/// </summary>
		/// <param name="path">The path.</param><param name="language">The language.</param><param name="version">The version.</param>
		/// <returns>
		/// The item.
		/// </returns>
		IStandardTemplateItem GetItem(string path, Language language, Version version);

		/// <summary>
		/// Gets the item.
		///
		/// </summary>
		/// <param name="uri">The URI.</param>
		/// <returns/>
		IStandardTemplateItem GetItem(DataUri uri);

		/// <summary>
		/// Gets the languages defined in the database.
		///
		/// </summary>
		///
		/// <returns/>
		LanguageCollection GetLanguages();

		/// <summary>
		/// Gets the root item of the database.
		///
		/// </summary>
		///
		/// <returns/>
		IStandardTemplateItem GetRootItem();

		/// <summary>
		/// Gets the root item of a database.
		///
		/// </summary>
		/// <param name="language">The language.</param>
		/// <returns/>
		IStandardTemplateItem GetRootItem(Language language);

		/// <summary>
		/// Performs a Sitecore Xpath query in the database.
		///
		/// </summary>
		/// <param name="query">The query.</param>
		/// <returns/>
		IStandardTemplateItem[] SelectItems(string query);

		/// <summary>
		/// Performs a Sitecore Xpath query in the database.
		///
		/// </summary>
		/// <param name="query">The query.</param>
		/// <returns/>
		IStandardTemplateItem SelectSingleItem(string query);

	}
}


text:
#ifndef __BACKPORT_PROC_FS_H
#define __BACKPORT_PROC_FS_H
#include_next <linux/proc_fs.h>
#include <linux/version.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)

#ifdef CONFIG_PROC_FS
/*
 * backport of:
 * procfs: new helper - PDE_DATA(inode)
 */
static inline void *PDE_DATA(const struct inode *inode)
{
	return PROC_I(inode)->pde->data;
}
extern void proc_set_size(struct proc_dir_entry *, loff_t);
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
#else
static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
#endif /* CONFIG_PROC_FS */

#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) */

#endif /* __BACKPORT_PROC_FS_H */


text:
package kr.co.hs.view.hspatternlockview.sample;

import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.view.View;

import kr.co.hs.view.hspatternlockview.app.HsPatternLockActivity;

/**
 * 생성된 시간 2017-01-12, Bae 에 의해 생성됨
 * 프로젝트 이름 : HsPatternLockView
 * 패키지명 : kr.co.hs.view.hspatternlockview.sample
 */

public class MainActivity extends HsPatternLockActivity {

    @RequiresApi(api = Build.VERSION_CODES.M)
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_sample);

//        Toolbar toolbar = (Toolbar) findViewById(R.id.Toolbar);
//        setSupportActionBar(toolbar);
//
//        if(isAbleFingerPrint())
//            doFingerPrintLock();
//        else
            doPatternLock("1234");

    }

    @Override
    public String getLabelMessage(int messageType) {
        return "라벨";
    }

    @Override
    public void onClickUsePatternButton(View view) {
        doPatternLock("1234");
    }

    @Override
    public void onPatternCorrect() {
        doUnLock();
    }

    @Override
    public void onFingerCorrect() {
        doUnLock();
    }

    @Override
    public int getPatternSize() {
        return 4;
    }
}


text:
from cuisine import *
from fabric.api import *
from fabric.context_managers import *
from fabric.utils import puts
from fabric.colors import red, green

import simplejson
import os

GIT_REPO = 'git@github.com:Vossy/redacted-webapp.git'

def app_user(command):
    '''
    This helper method runs the given command as the webapp user.
    '''
    sudo(command, user='redacted_webapp')

def production():
    puts(red('Using PRODUCTION settings'))
    env.hosts = ['app.redacted.com']
    env.user = '***********'
    env.password = '***********'

def setup_packages():
    puts(green('Installing Ubuntu packages'))
    sudo('apt-get update')
    package_ensure('nginx')
    package_ensure('postgresql')
    package_ensure('supervisor')
    package_ensure('git-core')
    package_ensure('ufw') # may have to install by hand

    package_ensure('python-pip')
    package_ensure('python-psycopg2')
    package_ensure('python-imaging')

def setup_users():
    puts(green('Creating Ubuntu users'))

    user_ensure('redacted_webapp')

def configure_firewall():
    puts(green('Configuring server firewall'))

    sudo('ufw allow proto tcp from any to any port 22')
    sudo('ufw allow 80')
    sudo('ufw --force enable')

def configure_nginx():
    puts(green('Configuring Nginx web server'))

    config_template = text_strip_margin('''
    |
    |server {
    |   server_name app.redacted.com;
    |
    |   access_log /srv/redacted-webapp/logs/nginx_access.log;
    |
    |   location /static/ {
    |       alias /srv/redacted-webapp/src/media/;
    |       autoindex on;
    |   }
    |
    |   location /media/ {
    |       alias /srv/redacted-webapp/shortcuts/admin_media/;
    |   }
    |
    |   location / {
    |       proxy_pass http://127.0.0.1:9001/;
    |       proxy_redirect off;
    |       proxy_set_header Host $host;
    |       proxy_set_header   X-Real-IP        $remote_addr;
    |       proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    |   }
    |
    |}
    |
    ''')

    file_write('/etc/nginx/sites-available/redacted.conf', config_template)

    if not dir_exists('/srv/redacted-webapp/shortcuts/admin_media'):
        run('ln -s /usr/local/lib/python2.6/dist-packages/django/contrib/admin/media /srv/redacted-webapp/shortcuts/admin_media')

    if file_exists('/etc/nginx/sites-enabled/default'):
        sudo('rm /etc/nginx/sites-enabled/default')

    if not file_exists('/etc/nginx/sites-enabled/redacted.conf'):
        sudo('ln -s /etc/nginx/sites-available/redacted.conf /etc/nginx/sites-enabled/redacted.conf')

    sudo('service nginx reload')

def configure_postgresql():
    print red('''MANUAL STEP: create Postgres user 'redacted' with password '2011Superhero' ''')
    print red('''MANUAL STEP: create Postgres database 'redacted_webapp' owned by 'redacted' user''')

def configure_supervisor():
    puts(green('Configuring the supervisor process'))

    runner_script = text_strip_margin('''
    |#!/bin/bash
    |
    |cd /srv/redacted-webapp/src
    |exec gunicorn_django --bind=127.0.0.1:9001
    |
    ''')

    file_write('/srv/redacted-webapp/bin/runserver', runner_script, mode='a+rx')

    supervisor_conf = text_strip_margin('''
    |
    |[program:redacted-webapp]
    |command=/srv/redacted-webapp/bin/runserver
    |user=redacted_webapp
    |
    ''')

    file_write('/etc/supervisor/conf.d/redacted.conf', supervisor_conf)

def setup_folders():
    puts(green('Setting up on-disk folders'))

    dir_ensure('/srv/redacted-webapp', owner='redacted_webapp', group='redacted_webapp')
    dir_ensure('/srv/redacted-webapp/src/media', owner='redacted_webapp', group='redacted_webapp')
    dir_ensure('/srv/redacted-webapp/shortcuts', owner='redacted_webapp', group='redacted_webapp')
    dir_ensure('/srv/redacted-webapp/logs', owner='www-data', group='www-data')
    dir_ensure('/srv/redacted-webapp/bin', owner='www-data', group='www-data')

def clone_from_github():

    puts(green('Fetching latest code from GitHub'))

    with cd('/srv/redacted-webapp/'):

        if dir_exists('/srv/redacted-webapp/src'):
            with cd('/srv/redacted-webapp/src'):
                app_user('git checkout -- .')
                app_user('git pull')
        else:
            app_user('git clone %s src' % GIT_REPO)

    with cd('/srv/redacted-webapp/src'):

        puts(green('Installing app dependencies'))

        run('pip install -r requirements.txt')

        puts(green('Injecting database settings'))

        db_settings = text_strip_margin('''
        |
        |DATABASES = {
        |   'default': {
        |       'ENGINE': 'django.db.backends.postgresql_psycopg2',
        |       'NAME': 'redacted_webapp',
        |       'USER': '***********',
        |       'PASSWORD': '***********',
        |   }
        |}
        |
        ''')

        file_append('settings.py', db_settings)

        puts(green('Syncing database models'))

        run('python manage.py syncdb')
        run('python manage.py migrate')

def restart_web_server():
    puts(green('Reloading the supervisor process'))

    sudo('supervisorctl reload')

def deploy():
    puts(green('Starting deployment'))
    setup_packages()
    setup_users()
    setup_folders()

    configure_firewall()
    configure_nginx()
    configure_postgresql()
    configure_supervisor()

    clone_from_github()

    restart_web_server()__author__ = 'vmintam'


text:
package v1

import (
	"fmt"

	"github.com/dustin/go-humanize"
	"go.uber.org/zap"
	"k8s.io/apimachinery/pkg/runtime"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/webhook"

	ferror "github.com/fission/fission/pkg/error"
	"github.com/fission/fission/pkg/utils/loggerfactory"
)

// log is for logging in this package.
var packagelog = loggerfactory.GetLogger().Named("package-resource")

func (r *Package) SetupWebhookWithManager(mgr ctrl.Manager) error {
	return ctrl.NewWebhookManagedBy(mgr).
		For(r).
		Complete()
}

//+kubebuilder:webhook:path=/mutate-fission-io-v1-package,mutating=true,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=packages,verbs=create;update,versions=v1,name=mpackage.fission.io,admissionReviewVersions=v1

var _ webhook.Defaulter = &Package{}

// Default implements webhook.Defaulter so a webhook will be registered for the type
func (r *Package) Default() {
	packagelog.Debug("default", zap.String("name", r.Name))
	if r.Status.BuildStatus == "" {
		r.Status.BuildStatus = BuildStatusPending
	}
}

// user change verbs to "verbs=create;update;delete" if you want to enable deletion validation.
//+kubebuilder:webhook:path=/validate-fission-io-v1-package,mutating=false,failurePolicy=fail,sideEffects=None,groups=fission.io,resources=packages,verbs=create;update,versions=v1,name=vpackage.fission.io,admissionReviewVersions=v1

var _ webhook.Validator = &Package{}

// ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (r *Package) ValidateCreate() error {
	packagelog.Debug("validate create", zap.String("name", r.Name))
	err := r.Validate()
	if err != nil {
		err = AggregateValidationErrors("Package", err)
		return err
	}

	// Ensure size limits
	if len(r.Spec.Source.Literal) > int(ArchiveLiteralSizeLimit) {
		err := ferror.MakeError(ferror.ErrorInvalidArgument,
			fmt.Sprintf("Package literal larger than %s", humanize.Bytes(uint64(ArchiveLiteralSizeLimit))))
		return err
	}
	if len(r.Spec.Deployment.Literal) > int(ArchiveLiteralSizeLimit) {
		err := ferror.MakeError(ferror.ErrorInvalidArgument,
			fmt.Sprintf("Package literal larger than %s", humanize.Bytes(uint64(ArchiveLiteralSizeLimit))))
		return err
	}
	return nil
}

// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
func (r *Package) ValidateUpdate(old runtime.Object) error {
	packagelog.Debug("validate update", zap.String("name", r.Name))
	err := r.Validate()

	if err != nil {
		err = AggregateValidationErrors("Package", err)
		return err
	}

	return nil
}

// ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (r *Package) ValidateDelete() error {
	packagelog.Debug("validate delete", zap.String("name", r.Name))
	return nil
}


text:
$(document).ready(() => {
    $(".assignmentResultsGet").click(function() {
        const assignment = $(this).attr('assignment')
        const group = $(this).attr('group')
        const hasData = $(".assignmentResultsSet[assignment='" + assignment + "']").html().length > 0

        if(!hasData) socket.emit("getAssignmentResults", group, assignment)
    })

    socket.on("assignmentResultsGot", setAssignmentResults)
})

function setAssignmentResults(html: string, assignment: string) {
    const par = $(".assignmentResultsSet[assignment='" + assignment + "']")
    par.html(html)
    par.find(".timeline").each(function() {
        setupTimeline($(this))
    })
    setupTooltipIn(par)
    par.find(".card.hoverer").hover(function(){
        $(this).children().find("[hoverData]").each(function(){
            const hoverer = $(this)
            const data = hoverer.attr("hoverData")
            const text = hoverer.text()
            hoverer.text(data)
            hoverer.attr("hoverData", text)
        })
    })
}


text:
'use strict';

import stationSelectViewTemplate from './station-select-view.html!ng-template';

angular.module('myApp.stationSelectView', ['ngRoute'])
    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider.when('/station-select', {
            templateUrl: stationSelectViewTemplate.templateUrl,
            controller: 'StationSelectViewCtrl'
        });
    }])

    .controller('StationSelectViewCtrl', ['$rootScope', function ($rootScope) {
        $rootScope.titleString = "בחירת מסלול רכבת";
    }]);


text:
/**
 * @fileoverview Helper functions to implement the Scheduling stage of
 * Scheduled Deployments.
 */

'use strict';

const base64 = require('js-base64');
const constants = require('./constants');
const datastore = require('./datastore');
const logging = require('./logging');

/**
 * Extract details of a Scheduled Deployment from a JSON payload and
 * record details as a new Datastore entity.
 *
 * @param {string} name - Name of the Scheduled Deployment to create.
 * @param {!Object} deploymentDetails - Deployment details from HTTP request.
 * @param {!Object} res - HTTP response context.
 */
exports.create = (name, deploymentDetails, res) => {
  // validate format of JSON payload
  const requiredFields = ['user', 'description', 'triggers'];
  const missingFields =
      datastore.findMissingFields(requiredFields, deploymentDetails);
  if (missingFields.length > 0) {
    res.status(400).send(
        'Missing required fields in Scheduled Deployment config: ' +
        missingFields.join());
    return;
  }
  if (!Array.isArray(deploymentDetails.triggers)) {
    res.status(400).send(
        'Scheduled Deployment triggers must be input as an array.');
    return;
  }
  if (deploymentDetails.triggers.length === 0) {
    res.status(400).send(
        'A Scheduled Deployment must have at least one trigger.');
    return;
  }

  const parentKey = datastore.createEntityKey(constants.KIND);
  const parentData = [
    {name: 'name', value: name},
    {name: 'description', value: deploymentDetails.description},
    {name: 'user', value: deploymentDetails.user},
    {name: 'submitted', value: new Date()}
  ];

  // ensure no entity exists in Datastore with the same name
  exports.enforceUniqueDeploymentName(name)
      .then(() => {
        return datastore.insertEntity(parentKey, parentData);
      })
      .then(() => {
        return exports.putTriggerEntities(
            name, parentKey, deploymentDetails.triggers);
      })
      .then(() => {
        logging.logMessage(`Recorded the Scheduled Deployment '${name}'.`);
        res.status(200).end(`Recorded the Scheduled Deployment '${name}'.`);
      })
      .catch((err) => {
        logging.logError(
            `Unable to record Scheduled Deployment '${name}'.`, err);
        res.status(400).end(`Unable to record Scheduled Deployment '${name}'.`);
      });
};

/**
 * Return details of a Scheduled Deployment in the HTTP response.
 *
 * @param {string} name - Name of the Scheduled Deployment.
 * @param {!Object} entity - Scheduled Deployment entity from Datastore.
 * @param {!Object} res - HTTP response context.
 */
exports.read = (name, entity, res) => {
  logging.logWithJson(`The Scheduled Deployment ${name} is `, entity);
  res.json(entity);
  res.status(200).json();
};

/**
 * Update a Scheduled Deployment by inserting the new deployment details.
 *
 * @param {string} name - Name of the Scheduled Deployment.
 * @param {!Object} entity - Scheduled Deployment entity from Datastore.
 * @param {!Object} deploymentDetails - Deployment details from HTTP request.
 * @param {!Object} res - HTTP response context.
 */
exports.update = (name, entity, deploymentDetails, res) => {
  // delete existing Trigger entities
  const parentKey = datastore.getEntityKey(entity);
  datastore.deleteChildrenOfEntity(parentKey.path, constants.TRIGGER_KIND)
      .then(() => {
        // update Scheduled Deployment entity
        const data = [
          {name: 'name', value: name},
          {name: 'description', value: deploymentDetails.description},
          {name: 'user', value: deploymentDetails.user},
          {name: 'submitted', value: new Date()}
        ];
        return datastore.updateEntity(parentKey, data);
      })
      .then(() => {
        // insert new Trigger entities
        exports.putTriggerEntities(name, parentKey, deploymentDetails.triggers);

        logging.logMessage(`Updated the Scheduled Deployment '${name}'.`);
        res.status(200).end();
      })
      .catch((err) => {
        logging.logError(
            `Unable to update Scheduled Deployment '${name}'. `, err);
        res.status(500).end();
      });
};

/**
 * Delete a Scheduled Deployment by removing its details from Datastore.
 *
 * @param {string} name - Name of the Scheduled Deployment.
 * @param {!Object} entity - Scheduled Deployment entity from Datastore.
 * @param {!Object} res - HTTP response context.
 */
exports.delete = (name, entity, res) => {
  const key = datastore.getEntityKey(entity);

  // delete corresponding triggers and operations
  datastore.deleteChildrenOfEntity(key.path, constants.TRIGGER_KIND);
  datastore.deleteChildrenOfEntity(key.path, constants.OPERATION_KIND);

  datastore.deleteEntity(key)
      .then((data) => {
        logging.logMessage(`Deleted the Scheduled Deployment '${name}'.`);
        const apiResponse = data[0];
        res.json(apiResponse);
        res.status(200).end();
      })
      .catch((err) => {
        logging.logError(
            `Unable to delete Scheduled Deployment '${name}'.`, err);
        res.status(500).end();
        return;
      });
};

/**
 * Ensure the name of a new Scheduled Deployment does not conflict with
 * any existing entities in Datastore.
 *
 * @param {string} name - Proposed Scheduled Deployment name.
 * @returns {Promise<null>}
 */
exports.enforceUniqueDeploymentName = (name) => {
  return new Promise(function(resolve, reject) {
    datastore.getEntitiesWithFilter(constants.KIND, 'name', name)
        .then((results) => {
          if (results[0].length > 0) {
            reject(`A Scheduled Deployment already exists with the name '${
                                                                           name
                                                                         }'.`);
          }
          resolve();
        })
        .catch((err) => {
          reject(err);
        });
  });
};

/**
 * Extract details of a Scheduled Deployment trigger from a JSON payload
 * and record details as a new Datastore entity.
 *
 * @param {string} parentName - Name of Scheduled Deployment parent.
 * @param {{kind: string, id: number}} parentKey - Identifiers of the parent
 *     entity in Datastore.
 * @param {!Array<!Object>} triggers - Trigger entities from Datastore.
 * @returns {Promise<null>}
 */
exports.putTriggerEntities = (parentName, parentKey, triggers) => {
  return new Promise(function(resolve, reject) {
    for (let trigger of triggers) {
      exports.isTriggerFormatValid(trigger, parentName)
          .then(() => {
            const triggerPath =
                [parentKey.kind, parentKey.id, constants.TRIGGER_KIND];
            const triggerKey = datastore.createEntityKey(triggerPath);
            const triggerData = [
              {name: 'name', value: trigger.name},
              {name: 'type', value: trigger.type},
              {name: 'time', value: trigger.time},
              {name: 'action', value: trigger.action},
              {name: 'description', value: trigger.description},
              {name: 'submitted', value: (new Date()).toISOString()}
            ];

            if (trigger['action'] === 'CREATE_OR_UPDATE') {
              // these fields are not necessary for DELETE
              triggerData.push({name: 'config', value: trigger.config});
              if ('importName' in trigger && 'importContent' in trigger) {
                triggerData.push(
                    {name: 'importName', value: trigger.importName});
                triggerData.push(
                    {name: 'importContent', value: trigger.importContent});
              } else if (
                  'importName' in trigger || 'importContent' in trigger) {
                reject(new Error(
                    `Both 'importName' and 'importContent' are required to ` +
                    'import a template in a configuration.'));
              }
            }

            datastore.insertEntity(triggerKey, triggerData).catch((err) => {
              reject(err);
            });
          })
          .catch((err) => {
            reject(err);
          });
    }
    resolve();
  });
};

/**
 * Ensure a Trigger entity in Datastore has the correct format.
 *
 * @param {!Object<string>} trigger - Entity from Datastore.
 * @param {string} parentName - Name of Scheduled Deployment parent.
 * @returns {Promise<boolean>} Whether entity has the correct format.
 */
exports.isTriggerFormatValid = (trigger, parentName) => {
  return new Promise((resolve, reject) => {
    const requiredFields = ['action', 'name', 'type', 'time'];
    const missingFields = datastore.findMissingFields(requiredFields, trigger);
    if (missingFields.length > 0) {
      if ('name' in missingFields) {
        reject(new Error(
            'Missing required fields in Trigger entity of Scheduled ' +
            `Deployment ${parentName}': ` + missingFields.join()));
      } else {
        reject(new Error(
            `Missing required fields in Trigger entity '${trigger.name}' of` +
            `Scheduled Deployment '${parentName}': ` + missingFields.join()));
      }
    }
    if (trigger.action != 'DELETE' && trigger.action != 'CREATE_OR_UPDATE') {
      reject(new Error(
          'Trigger action must be either CREATE_OR_UPDATE or DELETE.'));
    }
    resolve(true);
  });
};

/**
 * Extract Scheduled Deployment name from provided URL path or query. The name
 * is provided as a query (?name=...) in the POST method and as a path (/...)
 * otherwise.
 *
 * @param {string} url - URL fragment of request as query or path.
 * @param {string} method - HTTP request method.
 * @returns {string} Name from URL fragment.
 */
exports.parseNameFromUrl = (url, method) => {
  if (method == 'POST') {
    const parsed = url.split('=');
    return parsed.slice(-1)[0];
  } else {
    return url.substr(1);
  }
};


text:
'use strict';

const common = require('../common');
if (!common.hasCrypto)
  common.skip('missing crypto');

const assert = require('assert');
const fs = require('fs');
const path = require('path');
const tls = require('tls');

const tick = require('./tick');
const initHooks = require('./init-hooks');
const { checkInvocations } = require('./hook-checks');

const hooks = initHooks();
hooks.enable();

//
// Creating server and listening on port
//
const server = tls
  .createServer({
    cert: fs.readFileSync(path.join(common.fixturesDir, 'test_cert.pem')),
    key: fs.readFileSync(path.join(common.fixturesDir, 'test_key.pem'))
  })
  .on('listening', common.mustCall(onlistening))
  .on('secureConnection', common.mustCall(onsecureConnection))
  .listen(common.PORT);

let svr, client;
function onlistening() {
  //
  // Creating client and connecting it to server
  //
  tls
    .connect(common.PORT, { rejectUnauthorized: false })
    .on('secureConnect', common.mustCall(onsecureConnect));

  const as = hooks.activitiesOfTypes('TLSWRAP');
  assert.strictEqual(as.length, 1);
  svr = as[0];

  assert.strictEqual(svr.type, 'TLSWRAP');
  assert.strictEqual(typeof svr.uid, 'number');
  assert.strictEqual(typeof svr.triggerAsyncId, 'number');
  checkInvocations(svr, { init: 1 }, 'server: when client connecting');
}

function onsecureConnection() {
  //
  // Server received client connection
  //
  const as = hooks.activitiesOfTypes('TLSWRAP');
  assert.strictEqual(as.length, 2);
  client = as[1];
  assert.strictEqual(client.type, 'TLSWRAP');
  assert.strictEqual(typeof client.uid, 'number');
  assert.strictEqual(typeof client.triggerAsyncId, 'number');

  // TODO(thlorenz) which callback did the server wrap execute that already
  // finished as well?
  checkInvocations(svr, { init: 1, before: 1, after: 1 },
                   'server: when server has secure connection');

  checkInvocations(client, { init: 1, before: 2, after: 1 },
                   'client: when server has secure connection');
}

function onsecureConnect() {
  //
  // Client connected to server
  //
  checkInvocations(svr, { init: 1, before: 2, after: 1 },
                   'server: when client connected');
  checkInvocations(client, { init: 1, before: 2, after: 2 },
                   'client: when client connected');

  //
  // Destroying client socket
  //
  this.destroy();
  checkInvocations(svr, { init: 1, before: 2, after: 1 },
                   'server: when destroying client');
  checkInvocations(client, { init: 1, before: 2, after: 2 },
                   'client: when destroying client');

  tick(5, tick1);
  function tick1() {
    checkInvocations(svr, { init: 1, before: 2, after: 2 },
                     'server: when client destroyed');
    // TODO: why is client not destroyed here even after 5 ticks?
    // or could it be that it isn't actually destroyed until
    // the server is closed?
    checkInvocations(client, { init: 1, before: 3, after: 3 },
                     'client: when client destroyed');
    //
    // Closing server
    //
    server.close(common.mustCall(onserverClosed));
    // No changes to invocations until server actually closed below
    checkInvocations(svr, { init: 1, before: 2, after: 2 },
                     'server: when closing server');
    checkInvocations(client, { init: 1, before: 3, after: 3 },
                     'client: when closing server');
  }
}

function onserverClosed() {
  //
  // Server closed
  //
  tick(1E4, common.mustCall(() => {
    checkInvocations(svr, { init: 1, before: 2, after: 2 },
                     'server: when server closed');
    checkInvocations(client, { init: 1, before: 3, after: 3 },
                     'client: when server closed');
  }));
}

process.on('exit', onexit);

function onexit() {
  hooks.disable();
  hooks.sanityCheck('TLSWRAP');

  checkInvocations(svr, { init: 1, before: 2, after: 2 },
                   'server: when process exits');
  checkInvocations(client, { init: 1, before: 3, after: 3 },
                   'client: when process exits');
}


text:
var rad = readAloudDoc
var prevBtn = document.getElementById("control_previous_page")
var nextBtn = document.getElementById("control_next_page")
var contentFrame = document.getElementById("section_iframe")
var currentIndex = 0

readAloudDoc = {
    getCurrentIndex: function() {
        return currentIndex = 0
    },
    getTexts: function(index) {
        var promise = Promise.resolve()
        var rewind = function() {
            var oldUrl = contentFrame.contentDocument.location.href
            $(prevBtn).click()
            return waitFrameChange(oldUrl)
        }
        var forward = function() {
            var oldUrl = contentFrame.contentDocument.location.href
            $(nextBtn).click()
            return waitFrameChange(oldUrl)
        }
        for (; currentIndex<index; currentIndex++) promise = promise.then(forward)
        for (; currentIndex>index; currentIndex--) promise = promise.then(rewind)
        return promise.then(function() {
            return rad.getTexts(rad.getCurrentIndex())
        })
    }
}

function waitFrameChange(oldUrl) {
    return repeat({
        action: function() {return contentFrame.contentDocument.location.href},
        until: function(url) {return url != oldUrl},
        max: 20,
        delay: 500
    })
    .then(function() {
        return new Promise(function(fulfill) {
            return $(contentFrame.contentDocument).ready(fulfill)
        })
    })
}


text:
module Game.Apollo.GameState where

import Control.Monad.State
import System.Console.ANSI
import Game.Apollo.Types
import System.IO

initialiseGame :: IO ()
initialiseGame = clearScreen >> hSetEcho stdin False >> hideCursor

runGame :: String -> a -> Game a () -> IO a
runGame t s f = setTitle t >> initialiseGame >> execStateT f (GameState (0,0) [] s) >>= (\(GameState _ _ v) -> return v)


text:
package sterling.lang.compiler;

import sterling.lang.expression.Expression;
import sterling.lang.SterlingException;
import sterling.lang.expression.*;

public class TailCallDetector implements ExpressionVisitor<Boolean, Reference> {

    public boolean isTailRecursive(Expression expression, Reference head) throws SterlingException {
        return test(expression, head);
    }

    @Override
    public Boolean visitAccessExpression(AccessedExpression expression, Reference head) throws SterlingException {
        return false;
    }

    @Override
    public Boolean visitApplyExpression(AppliedExpression expression, Reference head) throws SterlingException {
        if (expression.getExpression() instanceof Conditional) {
            return test(expression.getArgument(), head);
        } else {
            return test(expression.getExpression(), head);
        }
    }

    @Override
    public Boolean visitArgumentExpression(Argument expression, Reference head) throws SterlingException {
        return false;
    }

    @Override
    public Boolean visitBoundExpression(BoundExpression expression, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitBooleanConstant(BooleanConstant constant, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitCharacterConstant(CharacterConstant constant, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitConditional(Conditional conditional, Reference head) throws SterlingException {
        return test(conditional.getTruthy(), head) || test(conditional.getFalsy(), head);
    }

    @Override
    public Boolean visitConstantExpression(ConstantExpression expression, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitDefault(Expression expression, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitDictionaryExpression(DictionaryExpression dictionary, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitDoubleConstant(DoubleConstant constant, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitIdentityExpression(IdentityExpression expression, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitIntegerConstant(IntegerConstant constant, Reference head) throws SterlingException {
        return false;
    }

    @Override
    public Boolean visitInterpolation(Interpolation interpolation, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitLambda(Lambda lambda, Reference head) throws SterlingException {
        return test(lambda.getExpression(), head);
    }

    @Override
    public Boolean visitListExpression(ListExpression list, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitNullConstant(NothingConstant constant, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitObjectExpression(ObjectExpression object, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitRangeExpression(RangeExpression range, Reference state) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitSequence(Sequence sequence, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitSetExpression(SetExpression set, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitStrictApply(StrictApply apply, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitStringConstant(StringConstant constant, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitSymbol(Symbol symbol, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitTupleExpression(TupleExpression tuple, Reference head) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    @Override
    public Boolean visitVariable(Variable variable, Reference head) throws SterlingException {
        return false;
    }

    @Override
    public Boolean visitXRangeExpression(XRangeExpression xrange, Reference state) throws SterlingException {
        throw new UnsupportedOperationException(); // TODO
    }

    private boolean test(Expression expression, Reference head) throws SterlingException {
        return expression.equals(head) || expression.accept(this, head);
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>org.robolectric.junit.rules</title>
<meta name="date" content="2018-12-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.robolectric.junit.rules

Class Summary

Class
Description

ExpectedLogMessagesRule

Allows tests to assert about the presence of log messages, and turns logged errors that are not explicitly expected into test failures.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
Créer un fichier journal

Cette page sert à définir les paramètres pour la rotation d'un nouveau
fichier journal. Le champs le plus important est Chemin d'accès aux
fichiers journaux, pour définir l'emplacement du journal dont
il faut effectuer la rotation ou une expression du shell correspondant
à des journaux multiples. Parmi les autres champs utiles :

<include log>


text:
/* @flow */

'use strict';

var React           = require('react-native');
var globalStyles    = require('../lib/globalStyles');
var I18n            = require('../lib/I18n');
var log             = require('../lib/log').logForScope('component.event_past_rsvp');

var {
  StyleSheet,
  Text,
  View,
} = React;

class EventPastRsvpComponent extends React.Component {

  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    return (
      <View style={this.props.style}>
        <View style={styles.rsvpRow}>
          <Text style={[styles.rsvpType, styles.rsvpTypeGoing]}>
            <Text style={styles.rsvpTypeCount}>{this.props.event.yes_rsvp_count} </Text>
            {I18n.t('component.event_past_rsvp.going', {count: this.props.event.yes_rsvp_count})}
          </Text>
        </View>
      </View>
    );
  }
}

EventPastRsvpComponent.propTypes = {
  event: React.PropTypes.object.isRequired,
  style: View.propTypes.style,
};

var styles = StyleSheet.create({
  rsvpRow: {
    flexDirection: 'row',
  },
  rsvpType: {
    width: 110,
    fontSize: 10,
  },
  rsvpTypeCount: {
    fontSize: 10,
  },
  rsvpTypeGoing: {
    color: globalStyles.colors.green,
  },
});

module.exports = EventPastRsvpComponent;


text:
import React from 'react';
import { isNumber, isEqual, isString, findIndex, get } from 'lodash';
import memoize from 'memoize-one';
import {
  arrayOf,
  bool,
  string,
  number,
  shape,
  func,
  objectOf,
  any
} from 'prop-types';
import { branch, renderNothing } from 'recompose';
import { guid } from 'helpers/guid';

import { getMousePosition } from 'helpers/dom';
import withContextProps from 'helpers/withContextProps';
import { OverlayPositioningContext } from './OverlayPositioningProvider';
import OverlayConfirmMenu from './OverlayConfirmMenu';
import OverlayActionsMenu from './OverlayActionsMenu';
import RndBox from './RndBox';
import {
  percentagePolyToPixelXYWidthHeight,
  pixelXYWidthHeightToPercentagePoly
} from './helpers';

@withContextProps(OverlayPositioningContext.Consumer, context => ({
  overlayPositioningContext: context
}))
@branch(
  // do not render if we don't have a workable overlayPositioningContext
  props =>
    !(
      props.overlayPositioningContext.width &&
      props.overlayPositioningContext.height
    ),
  renderNothing
)
export default class Overlay extends React.Component {
  static propTypes = {
    confirmLabel: string,
    readOnly: bool,
    addOnly: bool,
    autoCommit: bool,
    overlayPositioningContext: shape({
      top: number.isRequired,
      left: number.isRequired,
      width: number.isRequired,
      height: number.isRequired
    }).isRequired,
    wrapperStyles: objectOf(any),
    defaultBoundingBoxStyles: objectOf(any),
    stagedBoundingBoxStyles: objectOf(any),
    stylesByObjectType: objectOf(objectOf(any)),
    toolBarOffset: number,
    onAddBoundingBox: func.isRequired,
    onDeleteBoundingBox: func.isRequired,
    onChangeBoundingBox: func.isRequired,
    initialBoundingBoxPolys: arrayOf(
      shape({
        // unique ID
        id: string.isRequired,
        // optional type for styles + future stuff maybe
        // (corresponds to props.stylesByObjectType)
        overlayObjectType: string,
        readOnly: bool,
        // vertices
        boundingPoly: arrayOf(
          shape({
            x: number.isRequired,
            y: number.isRequired
          }).isRequired
        ).isRequired
      })
    ),
    actionMenuItems: arrayOf(
      shape({
        label: string.isRequired,
        onClick: func.isRequired
      })
    ),
    autofocus: bool
  };

  static defaultProps = {
    confirmLabel: 'Add',
    readOnly: false,
    addOnly: false,
    initialBoundingBoxPolys: [],
    toolBarOffset: 0,
    stagedBoundingBoxStyles: {},
    stylesByObjectType: {},
    defaultBoundingBoxStyles: {
      backgroundColor: 'rgba(255,100,100, .5)',
      border: '1px solid #fff'
    }
  };

  // memoize so we don't update/render on every video frame
  /* eslint-disable-next-line react/sort-comp */
  static mapPolysToInternalFormat = memoize(
    (polys, width, height) =>
      polys.map(({ boundingPoly, ...rest }) => ({
        boundingPoly: percentagePolyToPixelXYWidthHeight(
          boundingPoly,
          width,
          height
        ),
        ...rest
      })),
    isEqual
  );

  state = {
    boundingBoxPositions: [], // set in getDerivedStateFromProps
    focusedBoundingBoxId: null,
    stagedBoundingBoxPosition: {},
    userMinimizedConfirmMenu: false,
    userActingOnBoundingBox: false,
    drawingInitialBoundingBox: false
  };

  static getDerivedStateFromProps(props) {
    return {
      boundingBoxPositions: Overlay.mapPolysToInternalFormat(
        props.initialBoundingBoxPolys,
        props.overlayPositioningContext.width,
        props.overlayPositioningContext.height
      )
    };
  }
  handleResizeExistingBox = (e, direction, ref, delta, position) => {
    this.removeStagedBoundingBox();

    this.setState(state => {
      const focusedId = ref.getAttribute('data-boxid');
      const focusedIndex = findIndex(state.boundingBoxPositions, {
        id: focusedId
      });

      state.boundingBoxPositions[focusedIndex].boundingPoly = {
        width: ref.offsetWidth,
        height: ref.offsetHeight,
        ...position
      };

      return {
        ...state,
        userActingOnBoundingBox: true
      };
    });
  };

  handleResizeStagedBox = (e, direction, ref, delta, position) => {
    this.setState(state => ({
      userActingOnBoundingBox: true,
      stagedBoundingBoxPosition: {
        ...state.stagedBoundingBoxPosition,
        width: ref.offsetWidth,
        height: ref.offsetHeight,
        ...position
      }
    }));
  };

  handleResizeStagedBoxStop = () => {
    this.setState({
      userActingOnBoundingBox: false,
      userMinimizedConfirmMenu: false
    });
  };

  handleResizeExistingBoxStop = (e, direction, ref, delta, position) => {
    const focusedId = ref.getAttribute('data-boxid');
    const focusedIndex = findIndex(this.state.boundingBoxPositions, {
      id: focusedId
    });

    this.props.onChangeBoundingBox({
      ...this.state.boundingBoxPositions[focusedIndex],
      boundingPoly: pixelXYWidthHeightToPercentagePoly(
        this.state.boundingBoxPositions[focusedIndex].boundingPoly,
        this.props.overlayPositioningContext.width,
        this.props.overlayPositioningContext.height
      )
    });

    this.setState({
      userActingOnBoundingBox: false,
      userMinimizedConfirmMenu: false
    });
  };

  handleDragStagedBox = (e, d) => {
    this.setState({ userActingOnBoundingBox: true });
  };

  handleDragExistingBox = () => {
    this.removeStagedBoundingBox();

    this.setState({ userActingOnBoundingBox: true });
  };

  handleDragExistingBoxStop = (e, { node, x, y }) => {
    const focusedId = node.getAttribute('data-boxid');
    const focusedIndex = findIndex(this.state.boundingBoxPositions, {
      id: focusedId
    });

    const draggedObject = {
      ...this.state.boundingBoxPositions[focusedIndex].boundingPoly,
      x,
      y
    };

    this.props.onChangeBoundingBox({
      ...this.state.boundingBoxPositions[focusedIndex],
      boundingPoly: pixelXYWidthHeightToPercentagePoly(
        draggedObject,
        this.props.overlayPositioningContext.width,
        this.props.overlayPositioningContext.height
      )
    });

    this.setState({
      userActingOnBoundingBox: false,
      userMinimizedConfirmMenu: false
    });
  };

  handleDragStagedBoxStop = (e, d) => {
    this.setState(state => ({
      stagedBoundingBoxPosition: {
        ...state.stagedBoundingBoxPosition,
        x: d.x,
        y: d.y
      },
      userActingOnBoundingBox: false,
      userMinimizedConfirmMenu: false
    }));
  };

  handleClickBox = e => {
    e.stopPropagation();

    // fixme: try to ignore clicks that are the result of mouseup after resize/drag
    const focusedId = e.target.getAttribute('data-boxid');

    // full read/add only
    if (this.props.readOnly || this.props.addOnly) {
      return;
    }

    // individual box marked as readonly
    const focusedIndex = findIndex(this.state.boundingBoxPositions, {
      id: focusedId
    });
    if (get(this.state.boundingBoxPositions[focusedIndex], 'readOnly')) {
      return;
    }

    this.removeStagedBoundingBox();

    this.setState(state => {
      return {
        focusedBoundingBoxId: focusedId ? focusedId : state.focusedBoundingBoxId
      };
    });
  };

  confirmStagedBoundingBox = () => {
    if (this.hasStagedBoundingBox()) {
      const id = guid();
      this.props.onAddBoundingBox({
        boundingPoly: pixelXYWidthHeightToPercentagePoly(
          this.state.stagedBoundingBoxPosition,
          this.props.overlayPositioningContext.width,
          this.props.overlayPositioningContext.height
        ),
        id: id
      });

      if (this.props.autofocus) {
        this.setState({ focusedBoundingBoxId: id });
      }

      this.removeStagedBoundingBox();
    }
  };

  removeStagedBoundingBox = () => {
    // delete staged box
    this.setState({
      stagedBoundingBoxPosition: {}
    });
  };

  minimizeConfirmMenu = () => {
    this.setState({ userMinimizedConfirmMenu: true });
  };

  handleBackgroundMouseDown = e => {
    if (this.props.readOnly) {
      return;
    }

    if (this.state.drawingInitialBoundingBox) {
      // click while drawing; finish drawing
      // fixme -- separate logic
      this.handleBackgroundMouseUp();
      return;
    }

    // deal with dragging out an initial box on a blank canvas
    const { x: mouseX, y: mouseY } = getMousePosition(e);

    const largerContextDimension = Math.max(
      this.props.overlayPositioningContext.width,
      this.props.overlayPositioningContext.height
    );

    this.setState({
      drawingInitialBoundingBox: true,
      userActingOnBoundingBox: true,
      stagedBoundingBoxPosition: {
        x: mouseX,
        y: mouseY,
        // "one-click" box size. 10% of the larger of content width/height.
        width: largerContextDimension * 0.1,
        height: largerContextDimension * 0.1
      }
    });
  };

  handleBackgroundMouseMove = e => {
    if (this.state.drawingInitialBoundingBox) {
      const { x: mouseX, y: mouseY } = getMousePosition(e);

      this.setState(state => {
        const width = mouseX - state.stagedBoundingBoxPosition.x;
        const height = mouseY - state.stagedBoundingBoxPosition.y;

        return {
          stagedBoundingBoxPosition: {
            // prevent weird behavior when box width is set to a negative value,
            // and don't allow boxes too small to interact with (~< 15px)
            width: width < 15 ? 15 : width,
            height: height < 15 ? 15 : height,
            x: state.stagedBoundingBoxPosition.x,
            y: state.stagedBoundingBoxPosition.y
          }
        };
      });
    }
  };

  handleBackgroundMouseUp = () => {
    if (this.state.drawingInitialBoundingBox) {
      if (this.props.autoCommit) {
        this.confirmStagedBoundingBox();
      }

      this.setState({
        drawingInitialBoundingBox: false,
        userActingOnBoundingBox: false,
        userMinimizedConfirmMenu: false
      });
    }
  };

  handleDelete = () => {
    this.props.onDeleteBoundingBox(this.state.focusedBoundingBoxId);

    this.setState({
      userActingOnBoundingBox: false,
      focusedBoundingBoxId: null
    });
  };

  hasStagedBoundingBox = () => {
    return (
      isNumber(this.state.stagedBoundingBoxPosition.x) &&
      isNumber(this.state.stagedBoundingBoxPosition.y) &&
      isNumber(this.state.stagedBoundingBoxPosition.width) &&
      isNumber(this.state.stagedBoundingBoxPosition.height)
    );
  };

  render() {
    const { top, left, height, width } = this.props.overlayPositioningContext;

    const showingConfirmMenu =
      this.hasStagedBoundingBox() &&
      !this.state.userActingOnBoundingBox &&
      !this.state.userMinimizedConfirmMenu;

    const showingActionsMenu =
      isString(this.state.focusedBoundingBoxId) &&
      !this.state.userActingOnBoundingBox &&
      !this.state.userMinimizedConfirmMenu &&
      this.state.boundingBoxPositions.some(
        el => el.id === this.state.focusedBoundingBoxId
      );

    const boundingBoxCommonStyles = {
      // this seems to fix some rendering jank
      // (half of overlay would not render sometimes)
      willChange: 'left, top, width, height'
    };

    return (
      <div
        style={{
          position: 'absolute',
          overflow: 'hidden',
          top,
          left,
          height,
          width,
          pointerEvents: this.props.readOnly ? 'none' : 'auto',
          ...this.props.wrapperStyles
        }}
      >
        {this.state.boundingBoxPositions.map(
          ({
            id,
            overlayObjectType,
            readOnly,
            boundingPoly: { x, y, width, height }
          }) => (
            <RndBox
              key={id}
              extendsProps={{
                'data-boxid': id,
                onClick: this.handleClickBox
              }}
              style={{
                ...boundingBoxCommonStyles,
                ...this.props.defaultBoundingBoxStyles,
                ...this.props.stylesByObjectType[overlayObjectType],
                // do not let this box interfere with mouse events as we draw out
                // the initial bounding box
                pointerEvents:
                  readOnly ||
                  this.props.readOnly ||
                  this.props.addOnly ||
                  this.state.drawingInitialBoundingBox
                    ? 'none'
                    : 'auto'
              }}
              size={{ width, height }}
              position={{ x, y }}
              onDragStop={this.handleDragExistingBoxStop}
              onDrag={this.handleDragExistingBox}
              onResize={this.handleResizeExistingBox}
              onResizeStop={this.handleResizeExistingBoxStop}
              disableDragging={
                readOnly || this.props.readOnly || this.props.addOnly
              }
              enableResizing={
                !readOnly &&
                !this.props.readOnly &&
                !this.props.addOnly &&
                this.state.focusedBoundingBoxId === id
                  ? undefined
                  : false
              }
            />
          )
        )}

        {this.hasStagedBoundingBox() &&
          !this.props.readOnly && (
            <RndBox
              style={{
                ...boundingBoxCommonStyles,
                ...this.props.defaultBoundingBoxStyles,
                ...this.props.stagedBoundingBoxStyles,
                // do not let this box interfere with mouse events as we draw it out
                pointerEvents: this.state.drawingInitialBoundingBox
                  ? 'none'
                  : 'auto'
              }}
              size={{
                width: this.state.stagedBoundingBoxPosition.width,
                height: this.state.stagedBoundingBoxPosition.height
              }}
              position={{
                x: this.state.stagedBoundingBoxPosition.x,
                y: this.state.stagedBoundingBoxPosition.y
              }}
              onDragStop={this.handleDragStagedBoxStop}
              onDrag={this.handleDragStagedBox}
              onResize={this.handleResizeStagedBox}
              onResizeStop={this.handleResizeStagedBoxStop}
              enableResizing={
                // don't show handles during initial drag placement
                this.state.drawingInitialBoundingBox ? false : undefined
              }
            />
          )}

        {showingConfirmMenu &&
          !this.props.readOnly && (
            <OverlayConfirmMenu
              visible={showingConfirmMenu}
              confirmLabel={this.props.confirmLabel}
              onConfirm={this.confirmStagedBoundingBox}
              onCancel={this.removeStagedBoundingBox}
              onMinimize={this.minimizeConfirmMenu}
              bottomOffset={this.props.toolBarOffset}
            />
          )}

        {showingActionsMenu &&
          !this.props.addOnly &&
          !this.props.readOnly && (
            <OverlayActionsMenu
              visible={showingActionsMenu}
              onMinimize={this.minimizeConfirmMenu}
              menuItems={this.props.actionMenuItems}
              onDelete={this.handleDelete}
              // onConfirm={this.handleConfirmChange}
              bottomOffset={this.props.toolBarOffset}
              focusedBoundingBoxId={this.state.focusedBoundingBoxId}
            />
          )}

        <div
          style={{
            width: '100%',
            height: '100%',
            cursor: this.props.readOnly ? 'auto' : 'crosshair'
          }}
          onMouseDown={this.handleBackgroundMouseDown}
          onMouseUp={this.handleBackgroundMouseUp}
          onMouseMove={this.handleBackgroundMouseMove}
        />
      </div>
    );
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">

<TITLE>
Spring Framework: Uses of Interface com.interface21.core.TimeStamped
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

Uses of Interface
com.interface21.core.TimeStamped

No usage of com.interface21.core.TimeStamped

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

Rod Johnson and Spring contributors 2001-2003.


text:
package org.leguan.config;

import org.leguan.filter.FilterInput;
import org.leguan.filter.FilterResult;
import org.leguan.filter.FilterUtil;

import javax.inject.Singleton;
import java.util.Collection;

@Singleton
public class FilterCollector {

  private FilterUtil filterUtil = new FilterUtil();

  /**
   * checks if all the given filters are ok or not (which means that the item is filtered
   * @param filters       list of filters
   * @param filterInput   input value
   * @return true: item should be filtered, false: item is ok
   */
  public FilterResult areFiltersOk (final Collection<FilterConf> filters, final FilterInput filterInput) {
    for (FilterConf next: filters) {

      FilterResult filterResultNext = filterUtil.isOk(next, filterInput);
      if (! filterResultNext.isOk())
        return filterResultNext;

    }

    return new FilterResult();
  }
}