text:
.class public Landroid/view/RenderNodeAnimator;
.super Landroid/animation/Animator;
.source "RenderNodeAnimator.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;,
        Landroid/view/RenderNodeAnimator$1;
    }
.end annotation

# static fields
.field public static final ALPHA:I = 0xb

.field public static final LAST_VALUE:I = 0xb

.field public static final PAINT_ALPHA:I = 0x1

.field public static final PAINT_STROKE_WIDTH:I = 0x0

.field public static final ROTATION:I = 0x5

.field public static final ROTATION_X:I = 0x6

.field public static final ROTATION_Y:I = 0x7

.field public static final SCALE_X:I = 0x3

.field public static final SCALE_Y:I = 0x4

.field private static final STATE_DELAYED:I = 0x1

.field private static final STATE_FINISHED:I = 0x3

.field private static final STATE_PREPARE:I = 0x0

.field private static final STATE_RUNNING:I = 0x2

.field public static final TRANSLATION_X:I = 0x0

.field public static final TRANSLATION_Y:I = 0x1

.field public static final TRANSLATION_Z:I = 0x2

.field public static final X:I = 0x8

.field public static final Y:I = 0x9

.field public static final Z:I = 0xa

.field private static sAnimationHelper:Ljava/lang/ThreadLocal;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ThreadLocal",
            "<",
            "Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;",
            ">;"
        }
    .end annotation
.end field

.field private static final sViewPropertyAnimatorMap:Landroid/util/SparseIntArray;

# instance fields
.field private mFinalValue:F

.field private mInterpolator:Landroid/animation/TimeInterpolator;

.field private mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

.field private mRenderProperty:I

.field private mStartDelay:J

.field private mStartTime:J

.field private mState:I

.field private mTarget:Landroid/view/RenderNode;

.field private final mUiThreadHandlesDelay:Z

.field private mUnscaledDuration:J

.field private mUnscaledStartDelay:J

.field private mViewTarget:Landroid/view/View;

# direct methods
.method static synthetic -wrap0(Landroid/view/RenderNodeAnimator;J)Z
    .locals 1
    .param p1, "frameTimeMs"    # J

    .prologue
    invoke-direct {p0, p1, p2}, Landroid/view/RenderNodeAnimator;->processDelayed(J)Z

    move-result v0

    return v0
.end method

.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 67
    new-instance v0, Landroid/view/RenderNodeAnimator$1;

    const/16 v1, 0xf

    invoke-direct {v0, v1}, Landroid/view/RenderNodeAnimator$1;-><init>(I)V

    sput-object v0, Landroid/view/RenderNodeAnimator;->sViewPropertyAnimatorMap:Landroid/util/SparseIntArray;

    .line 428
    new-instance v0, Ljava/lang/ThreadLocal;

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

    .line 427
    sput-object v0, Landroid/view/RenderNodeAnimator;->sAnimationHelper:Ljava/lang/ThreadLocal;

    .line 37
    return-void
.end method

.method public constructor <init>(IF)V
    .locals 4
    .param p1, "property"    # I
    .param p2, "finalValue"    # F

    .prologue
    const-wide/16 v2, 0x0

    .line 111
    invoke-direct {p0}, Landroid/animation/Animator;-><init>()V

    .line 86
    const/4 v0, -0x1

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mRenderProperty:I

    .line 94
    const/4 v0, 0x0

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 96
    const-wide/16 v0, 0x12c

    iput-wide v0, p0, Landroid/view/RenderNodeAnimator;->mUnscaledDuration:J

    .line 97
    iput-wide v2, p0, Landroid/view/RenderNodeAnimator;->mUnscaledStartDelay:J

    .line 104
    iput-wide v2, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    .line 112
    iput p1, p0, Landroid/view/RenderNodeAnimator;->mRenderProperty:I

    .line 113
    iput p2, p0, Landroid/view/RenderNodeAnimator;->mFinalValue:F

    .line 114
    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/view/RenderNodeAnimator;->mUiThreadHandlesDelay:Z

    .line 115
    invoke-static {p1, p2}, Landroid/view/RenderNodeAnimator;->nCreateAnimator(IF)J

    move-result-wide v0

    invoke-direct {p0, v0, v1}, Landroid/view/RenderNodeAnimator;->init(J)V

    .line 111
    return-void
.end method

.method public constructor <init>(IIFF)V
    .locals 4
    .param p1, "x"    # I
    .param p2, "y"    # I
    .param p3, "startRadius"    # F
    .param p4, "endRadius"    # F

    .prologue
    const-wide/16 v2, 0x0

    .line 138
    invoke-direct {p0}, Landroid/animation/Animator;-><init>()V

    .line 86
    const/4 v0, -0x1

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mRenderProperty:I

    .line 94
    const/4 v0, 0x0

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 96
    const-wide/16 v0, 0x12c

    iput-wide v0, p0, Landroid/view/RenderNodeAnimator;->mUnscaledDuration:J

    .line 97
    iput-wide v2, p0, Landroid/view/RenderNodeAnimator;->mUnscaledStartDelay:J

    .line 104
    iput-wide v2, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    .line 139
    invoke-static {p1, p2, p3, p4}, Landroid/view/RenderNodeAnimator;->nCreateRevealAnimator(IIFF)J

    move-result-wide v0

    invoke-direct {p0, v0, v1}, Landroid/view/RenderNodeAnimator;->init(J)V

    .line 140
    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/view/RenderNodeAnimator;->mUiThreadHandlesDelay:Z

    .line 138
    return-void
.end method

.method public constructor <init>(Landroid/graphics/CanvasProperty;F)V
    .locals 6
    .param p2, "finalValue"    # F
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/graphics/CanvasProperty",
            "<",
            "Ljava/lang/Float;",
            ">;F)V"
        }
    .end annotation

    .prologue
    .local p1, "property":Landroid/graphics/CanvasProperty;, "Landroid/graphics/CanvasProperty<Ljava/lang/Float;>;"
    const-wide/16 v4, 0x0

    const/4 v2, 0x0

    .line 118
    invoke-direct {p0}, Landroid/animation/Animator;-><init>()V

    .line 86
    const/4 v0, -0x1

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mRenderProperty:I

    .line 94
    iput v2, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 96
    const-wide/16 v0, 0x12c

    iput-wide v0, p0, Landroid/view/RenderNodeAnimator;->mUnscaledDuration:J

    .line 97
    iput-wide v4, p0, Landroid/view/RenderNodeAnimator;->mUnscaledStartDelay:J

    .line 104
    iput-wide v4, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    .line 120
    invoke-virtual {p1}, Landroid/graphics/CanvasProperty;->getNativeContainer()J

    move-result-wide v0

    .line 119
    invoke-static {v0, v1, p2}, Landroid/view/RenderNodeAnimator;->nCreateCanvasPropertyFloatAnimator(JF)J

    move-result-wide v0

    invoke-direct {p0, v0, v1}, Landroid/view/RenderNodeAnimator;->init(J)V

    .line 121
    iput-boolean v2, p0, Landroid/view/RenderNodeAnimator;->mUiThreadHandlesDelay:Z

    .line 118
    return-void
.end method

.method public constructor <init>(Landroid/graphics/CanvasProperty;IF)V
    .locals 6
    .param p2, "paintField"    # I
    .param p3, "finalValue"    # F
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/graphics/CanvasProperty",
            "<",
            "Landroid/graphics/Paint;",
            ">;IF)V"
        }
    .end annotation

    .prologue
    .local p1, "property":Landroid/graphics/CanvasProperty;, "Landroid/graphics/CanvasProperty<Landroid/graphics/Paint;>;"
    const-wide/16 v4, 0x0

    const/4 v2, 0x0

    .line 132
    invoke-direct {p0}, Landroid/animation/Animator;-><init>()V

    .line 86
    const/4 v0, -0x1

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mRenderProperty:I

    .line 94
    iput v2, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 96
    const-wide/16 v0, 0x12c

    iput-wide v0, p0, Landroid/view/RenderNodeAnimator;->mUnscaledDuration:J

    .line 97
    iput-wide v4, p0, Landroid/view/RenderNodeAnimator;->mUnscaledStartDelay:J

    .line 104
    iput-wide v4, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    .line 134
    invoke-virtual {p1}, Landroid/graphics/CanvasProperty;->getNativeContainer()J

    move-result-wide v0

    .line 133
    invoke-static {v0, v1, p2, p3}, Landroid/view/RenderNodeAnimator;->nCreateCanvasPropertyPaintAnimator(JIF)J

    move-result-wide v0

    invoke-direct {p0, v0, v1}, Landroid/view/RenderNodeAnimator;->init(J)V

    .line 135
    iput-boolean v2, p0, Landroid/view/RenderNodeAnimator;->mUiThreadHandlesDelay:Z

    .line 132
    return-void
.end method

.method private applyInterpolator()V
    .locals 6

    .prologue
    .line 162
    iget-object v4, p0, Landroid/view/RenderNodeAnimator;->mInterpolator:Landroid/animation/TimeInterpolator;

    if-nez v4, :cond_0

    return-void

    .line 165
    :cond_0
    iget-object v4, p0, Landroid/view/RenderNodeAnimator;->mInterpolator:Landroid/animation/TimeInterpolator;

    invoke-static {v4}, Landroid/view/RenderNodeAnimator;->isNativeInterpolator(Landroid/animation/TimeInterpolator;)Z

    move-result v4

    if-eqz v4, :cond_1

    .line 166
    iget-object v4, p0, Landroid/view/RenderNodeAnimator;->mInterpolator:Landroid/animation/TimeInterpolator;

    check-cast v4, Lcom/android/internal/view/animation/NativeInterpolatorFactory;

    invoke-interface {v4}, Lcom/android/internal/view/animation/NativeInterpolatorFactory;->createNativeInterpolator()J

    move-result-wide v2

    .line 171
    .local v2, "ni":J
    :goto_0
    iget-object v4, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v4}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v4

    invoke-static {v4, v5, v2, v3}, Landroid/view/RenderNodeAnimator;->nSetInterpolator(JJ)V

    .line 161
    return-void

    .line 168
    .end local v2    # "ni":J
    :cond_1
    iget-object v4, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v4}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v4

    invoke-static {v4, v5}, Landroid/view/RenderNodeAnimator;->nGetDuration(J)J

    move-result-wide v0

    .line 169
    .local v0, "duration":J
    iget-object v4, p0, Landroid/view/RenderNodeAnimator;->mInterpolator:Landroid/animation/TimeInterpolator;

    invoke-static {v4, v0, v1}, Lcom/android/internal/view/animation/FallbackLUTInterpolator;->createNativeInterpolator(Landroid/animation/TimeInterpolator;J)J

    move-result-wide v2

    .restart local v2    # "ni":J
    goto :goto_0
.end method

.method private static callOnFinished(Landroid/view/RenderNodeAnimator;)V
    .locals 0
    .param p0, "animator"    # Landroid/view/RenderNodeAnimator;

    .prologue
    .line 483
    invoke-virtual {p0}, Landroid/view/RenderNodeAnimator;->onFinished()V

    .line 482
    return-void
.end method

.method private checkMutable()V
    .locals 2

    .prologue
    .line 148
    iget v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    if-eqz v0, :cond_0

    .line 149
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Animator has already started, cannot change it now!"

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

    throw v0

    .line 151
    :cond_0
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    if-nez v0, :cond_1

    .line 152
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Animator\'s target has been destroyed (trying to modify an animation after activity destroy?)"

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

    throw v0

    .line 147
    :cond_1
    return-void
.end method

.method private cloneListeners()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Landroid/animation/Animator$AnimatorListener;",
            ">;"
        }
    .end annotation

    .prologue
    .line 394
    invoke-virtual {p0}, Landroid/view/RenderNodeAnimator;->getListeners()Ljava/util/ArrayList;

    move-result-object v0

    .line 395
    .local v0, "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    if-eqz v0, :cond_0

    .line 396
    invoke-virtual {v0}, Ljava/util/ArrayList;->clone()Ljava/lang/Object;

    move-result-object v0

    .end local v0    # "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    check-cast v0, Ljava/util/ArrayList;

    .line 398
    .restart local v0    # "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    :cond_0
    return-object v0
.end method

.method private doStart()V
    .locals 3

    .prologue
    .line 202
    iget v0, p0, Landroid/view/RenderNodeAnimator;->mRenderProperty:I

    const/16 v1, 0xb

    if-ne v0, v1, :cond_0

    .line 205
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    iget-object v0, v0, Landroid/view/View;->mTransformationInfo:Landroid/view/View$TransformationInfo;

    iget v1, p0, Landroid/view/RenderNodeAnimator;->mFinalValue:F

    iput v1, v0, Landroid/view/View$TransformationInfo;->mAlpha:F

    .line 208
    :cond_0
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->moveToRunningState()V

    .line 210
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    if-eqz v0, :cond_1

    .line 212
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/View;->invalidateViewProperty(ZZ)V

    .line 198
    :cond_1
    return-void
.end method

.method private static getHelper()Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;
    .locals 2

    .prologue
    .line 419
    sget-object v1, Landroid/view/RenderNodeAnimator;->sAnimationHelper:Ljava/lang/ThreadLocal;

    invoke-virtual {v1}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;

    .line 420
    .local v0, "helper":Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;
    if-nez v0, :cond_0

    .line 421
    new-instance v0, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;

    .end local v0    # "helper":Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;
    invoke-direct {v0}, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;-><init>()V

    .line 422
    .restart local v0    # "helper":Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;
    sget-object v1, Landroid/view/RenderNodeAnimator;->sAnimationHelper:Ljava/lang/ThreadLocal;

    invoke-virtual {v1, v0}, Ljava/lang/ThreadLocal;->set(Ljava/lang/Object;)V

    .line 424
    :cond_0
    return-object v0
.end method

.method private init(J)V
    .locals 1
    .param p1, "ptr"    # J

    .prologue
    .line 144
    new-instance v0, Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-direct {v0, p1, p2}, Lcom/android/internal/util/VirtualRefBasePtr;-><init>(J)V

    iput-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    .line 143
    return-void
.end method

.method static isNativeInterpolator(Landroid/animation/TimeInterpolator;)Z
    .locals 2
    .param p0, "interpolator"    # Landroid/animation/TimeInterpolator;

    .prologue
    .line 158
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v0

    const-class v1, Lcom/android/internal/view/animation/HasNativeInterpolator;

    invoke-virtual {v0, v1}, Ljava/lang/Class;->isAnnotationPresent(Ljava/lang/Class;)Z

    move-result v0

    return v0
.end method

.method public static mapViewPropertyToRenderProperty(I)I
    .locals 1
    .param p0, "viewProperty"    # I

    .prologue
    .line 108
    sget-object v0, Landroid/view/RenderNodeAnimator;->sViewPropertyAnimatorMap:Landroid/util/SparseIntArray;

    invoke-virtual {v0, p0}, Landroid/util/SparseIntArray;->get(I)I

    move-result v0

    return v0
.end method

.method private moveToRunningState()V
    .locals 2

    .prologue
    .line 217
    const/4 v0, 0x2

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 218
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    if-eqz v0, :cond_0

    .line 219
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    invoke-static {v0, v1}, Landroid/view/RenderNodeAnimator;->nStart(J)V

    .line 221
    :cond_0
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->notifyStartListeners()V

    .line 216
    return-void
.end method

.method private static native nCreateAnimator(IF)J
.end method

.method private static native nCreateCanvasPropertyFloatAnimator(JF)J
.end method

.method private static native nCreateCanvasPropertyPaintAnimator(JIF)J
.end method

.method private static native nCreateRevealAnimator(IIFF)J
.end method

.method private static native nEnd(J)V
.end method

.method private static native nGetDuration(J)J
.end method

.method private static native nSetAllowRunningAsync(JZ)V
.end method

.method private static native nSetDuration(JJ)V
.end method

.method private static native nSetInterpolator(JJ)V
.end method

.method private static native nSetListener(JLandroid/view/RenderNodeAnimator;)V
.end method

.method private static native nSetStartDelay(JJ)V
.end method

.method private static native nSetStartValue(JF)V
.end method

.method private static native nStart(J)V
.end method

.method private notifyStartListeners()V
    .locals 4

    .prologue
    .line 225
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->cloneListeners()Ljava/util/ArrayList;

    move-result-object v1

    .line 226
    .local v1, "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    if-nez v1, :cond_0

    const/4 v2, 0x0

    .line 227
    .local v2, "numListeners":I
    :goto_0
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_1
    if-ge v0, v2, :cond_1

    .line 228
    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/animation/Animator$AnimatorListener;

    invoke-interface {v3, p0}, Landroid/animation/Animator$AnimatorListener;->onAnimationStart(Landroid/animation/Animator;)V

    .line 227
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 226
    .end local v0    # "i":I
    .end local v2    # "numListeners":I
    :cond_0
    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v2

    .restart local v2    # "numListeners":I
    goto :goto_0

    .line 224
    .restart local v0    # "i":I
    :cond_1
    return-void
.end method

.method private processDelayed(J)Z
    .locals 5
    .param p1, "frameTimeMs"    # J

    .prologue
    .line 409
    iget-wide v0, p0, Landroid/view/RenderNodeAnimator;->mStartTime:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-nez v0, :cond_1

    .line 410
    iput-wide p1, p0, Landroid/view/RenderNodeAnimator;->mStartTime:J

    .line 415
    :cond_0
    const/4 v0, 0x0

    return v0

    .line 411
    :cond_1
    iget-wide v0, p0, Landroid/view/RenderNodeAnimator;->mStartTime:J

    sub-long v0, p1, v0

    iget-wide v2, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    cmp-long v0, v0, v2

    if-ltz v0, :cond_0

    .line 412
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->doStart()V

    .line 413
    const/4 v0, 0x1

    return v0
.end method

.method private releaseNativePtr()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 386
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    if-eqz v0, :cond_0

    .line 387
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->release()V

    .line 388
    iput-object v1, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    .line 385
    :cond_0
    return-void
.end method

.method private setTarget(Landroid/view/RenderNode;)V
    .locals 2
    .param p1, "node"    # Landroid/view/RenderNode;

    .prologue
    .line 294
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->checkMutable()V

    .line 295
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mTarget:Landroid/view/RenderNode;

    if-eqz v0, :cond_0

    .line 296
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Target already set!"

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

    throw v0

    .line 298
    :cond_0
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    invoke-static {v0, v1, p0}, Landroid/view/RenderNodeAnimator;->nSetListener(JLandroid/view/RenderNodeAnimator;)V

    .line 299
    iput-object p1, p0, Landroid/view/RenderNodeAnimator;->mTarget:Landroid/view/RenderNode;

    .line 300
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mTarget:Landroid/view/RenderNode;

    invoke-virtual {v0, p0}, Landroid/view/RenderNode;->addAnimator(Landroid/view/RenderNodeAnimator;)V

    .line 293
    return-void
.end method

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

    .prologue
    .line 234
    iget v3, p0, Landroid/view/RenderNodeAnimator;->mState:I

    if-eqz v3, :cond_3

    iget v3, p0, Landroid/view/RenderNodeAnimator;->mState:I

    const/4 v4, 0x3

    if-eq v3, v4, :cond_3

    .line 235
    iget v3, p0, Landroid/view/RenderNodeAnimator;->mState:I

    const/4 v4, 0x1

    if-ne v3, v4, :cond_0

    .line 236
    invoke-static {}, Landroid/view/RenderNodeAnimator;->getHelper()Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;

    move-result-object v3

    invoke-virtual {v3, p0}, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;->removeDelayedAnimation(Landroid/view/RenderNodeAnimator;)V

    .line 237
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->moveToRunningState()V

    .line 240
    :cond_0
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->cloneListeners()Ljava/util/ArrayList;

    move-result-object v1

    .line 241
    .local v1, "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    if-nez v1, :cond_1

    const/4 v2, 0x0

    .line 242
    .local v2, "numListeners":I
    :goto_0
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_1
    if-ge v0, v2, :cond_2

    .line 243
    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/animation/Animator$AnimatorListener;

    invoke-interface {v3, p0}, Landroid/animation/Animator$AnimatorListener;->onAnimationCancel(Landroid/animation/Animator;)V

    .line 242
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 241
    .end local v0    # "i":I
    .end local v2    # "numListeners":I
    :cond_1
    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v2

    .restart local v2    # "numListeners":I
    goto :goto_0

    .line 246
    .restart local v0    # "i":I
    :cond_2
    invoke-virtual {p0}, Landroid/view/RenderNodeAnimator;->end()V

    .line 233
    .end local v0    # "i":I
    .end local v1    # "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    .end local v2    # "numListeners":I
    :cond_3
    return-void
.end method

.method public clone()Landroid/animation/Animator;
    .locals 2

    .prologue
    .line 488
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Cannot clone this animator"

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

    throw v0
.end method

.method public end()V
    .locals 3

    .prologue
    .line 252
    iget v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    const/4 v1, 0x3

    if-eq v0, v1, :cond_1

    .line 253
    iget v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    const/4 v1, 0x2

    if-ge v0, v1, :cond_0

    .line 254
    invoke-static {}, Landroid/view/RenderNodeAnimator;->getHelper()Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;->removeDelayedAnimation(Landroid/view/RenderNodeAnimator;)V

    .line 255
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->doStart()V

    .line 257
    :cond_0
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    if-eqz v0, :cond_2

    .line 258
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    invoke-static {v0, v1}, Landroid/view/RenderNodeAnimator;->nEnd(J)V

    .line 259
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    if-eqz v0, :cond_1

    .line 261
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/View;->invalidateViewProperty(ZZ)V

    .line 251
    :cond_1
    :goto_0
    return-void

    .line 265
    :cond_2
    invoke-virtual {p0}, Landroid/view/RenderNodeAnimator;->onFinished()V

    goto :goto_0
.end method

.method public getDuration()J
    .locals 2

    .prologue
    .line 336
    iget-wide v0, p0, Landroid/view/RenderNodeAnimator;->mUnscaledDuration:J

    return-wide v0
.end method

.method public getInterpolator()Landroid/animation/TimeInterpolator;
    .locals 1

    .prologue
    .line 357
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mInterpolator:Landroid/animation/TimeInterpolator;

    return-object v0
.end method

.method getNativeAnimator()J
    .locals 2

    .prologue
    .line 402
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    return-wide v0
.end method

.method public getStartDelay()J
    .locals 2

    .prologue
    .line 320
    iget-wide v0, p0, Landroid/view/RenderNodeAnimator;->mUnscaledStartDelay:J

    return-wide v0
.end method

.method public isRunning()Z
    .locals 3

    .prologue
    const/4 v0, 0x1

    .line 341
    iget v1, p0, Landroid/view/RenderNodeAnimator;->mState:I

    if-eq v1, v0, :cond_0

    iget v1, p0, Landroid/view/RenderNodeAnimator;->mState:I

    const/4 v2, 0x2

    if-ne v1, v2, :cond_1

    :cond_0
    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public isStarted()Z
    .locals 2

    .prologue
    const/4 v0, 0x0

    .line 346
    iget v1, p0, Landroid/view/RenderNodeAnimator;->mState:I

    if-eqz v1, :cond_0

    const/4 v0, 0x1

    :cond_0
    return v0
.end method

.method protected onFinished()V
    .locals 5

    .prologue
    .line 361
    iget v3, p0, Landroid/view/RenderNodeAnimator;->mState:I

    if-nez v3, :cond_0

    .line 364
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->releaseNativePtr()V

    .line 365
    return-void

    .line 367
    :cond_0
    iget v3, p0, Landroid/view/RenderNodeAnimator;->mState:I

    const/4 v4, 0x1

    if-ne v3, v4, :cond_1

    .line 368
    invoke-static {}, Landroid/view/RenderNodeAnimator;->getHelper()Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;

    move-result-object v3

    invoke-virtual {v3, p0}, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;->removeDelayedAnimation(Landroid/view/RenderNodeAnimator;)V

    .line 369
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->notifyStartListeners()V

    .line 371
    :cond_1
    const/4 v3, 0x3

    iput v3, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 373
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->cloneListeners()Ljava/util/ArrayList;

    move-result-object v1

    .line 374
    .local v1, "listeners":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/animation/Animator$AnimatorListener;>;"
    if-nez v1, :cond_2

    const/4 v2, 0x0

    .line 375
    .local v2, "numListeners":I
    :goto_0
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_1
    if-ge v0, v2, :cond_3

    .line 376
    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Landroid/animation/Animator$AnimatorListener;

    invoke-interface {v3, p0}, Landroid/animation/Animator$AnimatorListener;->onAnimationEnd(Landroid/animation/Animator;)V

    .line 375
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 374
    .end local v0    # "i":I
    .end local v2    # "numListeners":I
    :cond_2
    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v2

    .restart local v2    # "numListeners":I
    goto :goto_0

    .line 382
    .restart local v0    # "i":I
    :cond_3
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->releaseNativePtr()V

    .line 360
    return-void
.end method

.method public pause()V
    .locals 1

    .prologue
    .line 272
    new-instance v0, Ljava/lang/UnsupportedOperationException;

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

    throw v0
.end method

.method public resume()V
    .locals 1

    .prologue
    .line 277
    new-instance v0, Ljava/lang/UnsupportedOperationException;

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

    throw v0
.end method

.method public setAllowRunningAsynchronously(Z)V
    .locals 2
    .param p1, "mayRunAsync"    # Z

    .prologue
    .line 493
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->checkMutable()V

    .line 494
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    invoke-static {v0, v1, p1}, Landroid/view/RenderNodeAnimator;->nSetAllowRunningAsync(JZ)V

    .line 492
    return-void
.end method

.method public bridge synthetic setDuration(J)Landroid/animation/Animator;
    .locals 1
    .param p1, "duration"    # J

    .prologue
    .line 324
    invoke-virtual {p0, p1, p2}, Landroid/view/RenderNodeAnimator;->setDuration(J)Landroid/view/RenderNodeAnimator;

    move-result-object v0

    return-object v0
.end method

.method public setDuration(J)Landroid/view/RenderNodeAnimator;
    .locals 5
    .param p1, "duration"    # J

    .prologue
    .line 325
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->checkMutable()V

    .line 326
    const-wide/16 v0, 0x0

    cmp-long v0, p1, v0

    if-gez v0, :cond_0

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

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string/jumbo v2, "duration must be positive; "

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

    move-result-object v1

    invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)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

    .line 329
    :cond_0
    iput-wide p1, p0, Landroid/view/RenderNodeAnimator;->mUnscaledDuration:J

    .line 330
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    long-to-float v2, p1

    invoke-static {}, Landroid/animation/ValueAnimator;->getDurationScale()F

    move-result v3

    mul-float/2addr v2, v3

    float-to-long v2, v2

    invoke-static {v0, v1, v2, v3}, Landroid/view/RenderNodeAnimator;->nSetDuration(JJ)V

    .line 331
    return-object p0
.end method

.method public setInterpolator(Landroid/animation/TimeInterpolator;)V
    .locals 0
    .param p1, "interpolator"    # Landroid/animation/TimeInterpolator;

    .prologue
    .line 351
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->checkMutable()V

    .line 352
    iput-object p1, p0, Landroid/view/RenderNodeAnimator;->mInterpolator:Landroid/animation/TimeInterpolator;

    .line 350
    return-void
.end method

.method public setStartDelay(J)V
    .locals 3
    .param p1, "startDelay"    # J

    .prologue
    .line 310
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->checkMutable()V

    .line 311
    const-wide/16 v0, 0x0

    cmp-long v0, p1, v0

    if-gez v0, :cond_0

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

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string/jumbo v2, "startDelay must be positive; "

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

    move-result-object v1

    invoke-virtual {v1, p1, p2}, Ljava/lang/StringBuilder;->append(J)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

    .line 314
    :cond_0
    iput-wide p1, p0, Landroid/view/RenderNodeAnimator;->mUnscaledStartDelay:J

    .line 315
    invoke-static {}, Landroid/animation/ValueAnimator;->getDurationScale()F

    move-result v0

    long-to-float v1, p1

    mul-float/2addr v0, v1

    float-to-long v0, v0

    iput-wide v0, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    .line 309
    return-void
.end method

.method public setStartValue(F)V
    .locals 2
    .param p1, "startValue"    # F

    .prologue
    .line 304
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->checkMutable()V

    .line 305
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    invoke-static {v0, v1, p1}, Landroid/view/RenderNodeAnimator;->nSetStartValue(JF)V

    .line 303
    return-void
.end method

.method public setTarget(Landroid/graphics/Canvas;)V
    .locals 3
    .param p1, "canvas"    # Landroid/graphics/Canvas;

    .prologue
    .line 286
    instance-of v1, p1, Landroid/view/DisplayListCanvas;

    if-nez v1, :cond_0

    .line 287
    new-instance v1, Ljava/lang/IllegalArgumentException;

    const-string/jumbo v2, "Not a GLES20RecordingCanvas"

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

    throw v1

    :cond_0
    move-object v0, p1

    .line 289
    check-cast v0, Landroid/view/DisplayListCanvas;

    .line 290
    .local v0, "recordingCanvas":Landroid/view/DisplayListCanvas;
    iget-object v1, v0, Landroid/view/DisplayListCanvas;->mNode:Landroid/view/RenderNode;

    invoke-direct {p0, v1}, Landroid/view/RenderNodeAnimator;->setTarget(Landroid/view/RenderNode;)V

    .line 285
    return-void
.end method

.method public setTarget(Landroid/view/View;)V
    .locals 1
    .param p1, "view"    # Landroid/view/View;

    .prologue
    .line 281
    iput-object p1, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    .line 282
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mViewTarget:Landroid/view/View;

    iget-object v0, v0, Landroid/view/View;->mRenderNode:Landroid/view/RenderNode;

    invoke-direct {p0, v0}, Landroid/view/RenderNodeAnimator;->setTarget(Landroid/view/RenderNode;)V

    .line 280
    return-void
.end method

.method public start()V
    .locals 4

    .prologue
    .line 176
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mTarget:Landroid/view/RenderNode;

    if-nez v0, :cond_0

    .line 177
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Missing target!"

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

    throw v0

    .line 180
    :cond_0
    iget v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    if-eqz v0, :cond_1

    .line 181
    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Already started!"

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

    throw v0

    .line 184
    :cond_1
    const/4 v0, 0x1

    iput v0, p0, Landroid/view/RenderNodeAnimator;->mState:I

    .line 185
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->applyInterpolator()V

    .line 187
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    if-nez v0, :cond_2

    .line 189
    invoke-virtual {p0}, Landroid/view/RenderNodeAnimator;->cancel()V

    .line 175
    :goto_0
    return-void

    .line 190
    :cond_2
    iget-wide v0, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-lez v0, :cond_3

    iget-boolean v0, p0, Landroid/view/RenderNodeAnimator;->mUiThreadHandlesDelay:Z

    if-eqz v0, :cond_3

    .line 194
    invoke-static {}, Landroid/view/RenderNodeAnimator;->getHelper()Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/view/RenderNodeAnimator$DelayedAnimationHelper;->addDelayedAnimation(Landroid/view/RenderNodeAnimator;)V

    goto :goto_0

    .line 191
    :cond_3
    iget-object v0, p0, Landroid/view/RenderNodeAnimator;->mNativePtr:Lcom/android/internal/util/VirtualRefBasePtr;

    invoke-virtual {v0}, Lcom/android/internal/util/VirtualRefBasePtr;->get()J

    move-result-wide v0

    iget-wide v2, p0, Landroid/view/RenderNodeAnimator;->mStartDelay:J

    invoke-static {v0, v1, v2, v3}, Landroid/view/RenderNodeAnimator;->nSetStartDelay(JJ)V

    .line 192
    invoke-direct {p0}, Landroid/view/RenderNodeAnimator;->doStart()V

    goto :goto_0
.end method


text:
require 'test_helper'
require 'crm/entities/address'

module CRM

  describe Address do
    it "creates" do
      a = Address.new(street: "Haraldstr 12", zip: '12345')
      a.street.must_equal "Haraldstr 12"
      a.zip.must_equal '12345'
    end

    it "should have a string zip" do
      a = Address.new(street: "Haraldstr 12", zip: 12345)
      a.zip.must_equal "12345"
    end

    it "is a value object so it should not be possible to change the values after" do
      proc {
        a = Address.new(street: "Haraldstr 12", zip: '12345')
        a.street = 'other'
      }.must_raise NoMethodError
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
const plugin = require('eslint-plugin-react');

module.exports = plugin.configs.recommended;


text:
<?php

namespace Migraine\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Reset command
 */
class ResetCommand extends FactoryAwareCommand
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('reset')
            ->setDescription('Reset migraine')
        ;
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if ($input->getOption('no-interaction') === false) {
            $dialog = $this->getHelperSet()->get('dialog');
            if (!$dialog->askConfirmation(
                    $output,
                    '<question>This action will erase entire lock information. Are you sure you want to continue? (y/N)</question>',
                    false
                )) {

                return $output->writeln('<comment>Command aborted by user</comment>');
            }
        }

        foreach ($this->getFactory()->getTypes() as $type) {
            $type->setVersion(0);
        }
        $output->writeln('<info>Lock cleared successfully</info>');
    }
}


text:
package com.aceshub.portal.attendance;

import android.support.v4.content.ContextCompat;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.aceshub.portal.R;

import java.util.List;

public class MisAdapter extends RecyclerView.Adapter<MisAdapter.DataHolder> {

    MisListItem misListItem;
    private List<MisListItem> data;

    public MisAdapter(List<MisListItem> data) {
        this.data = data;
    }

    @Override
    public DataHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.mis_listitem, parent, false);
        return new DataHolder(view);
    }

    @Override
    public void onBindViewHolder(DataHolder holder, int position) {
        misListItem = data.get(position);
        int isPresent = misListItem.isPresent();
        if (isPresent == 1) {
            holder.setPresent(holder.itemView);
        } else {
            holder.setAbsent(holder.itemView);
        }
        holder.isPresent = isPresent;
        holder.misTv.setText(misListItem.getMis());
        holder.nameTv.setText(misListItem.getName());
    }

    @Override
    public int getItemCount() {
        return data.size();
    }

    class DataHolder extends RecyclerView.ViewHolder implements RecyclerView.OnClickListener {

        private TextView misTv;
        private TextView nameTv;
        private CardView card;
        private int isPresent;
        private TextView paText;

        DataHolder(View itemView) {
            super(itemView);

            misTv = (TextView) itemView.findViewById(R.id.attendance_mis_tv);

            nameTv = (TextView) itemView.findViewById(R.id.attendance_name_tv);

            card = (CardView) itemView.findViewById(R.id.mis_listitem_layout);
            card.setOnClickListener(this);

            paText = (TextView) itemView.findViewById(R.id.mis_p_a_text);
        }

        @Override
        public void onClick(View v) {
            if (isPresent == 1) {
                setAbsent(v);
                MisData.addAbsent(1);
                AttendanceActivity.calculate();
            } else {
                setPresent(v);
                MisData.addAbsent(-1);
                AttendanceActivity.calculate();
            }
        }

        public void setPresent(View v) {
            card.setBackground(ResourcesCompat.getDrawable(v.getResources(), R.drawable.mis_text_present, null));
            paText.setText("P");
            paText.setBackground(ContextCompat.getDrawable(v.getContext(), R.drawable.green_circle_background));
            misTv.setTextColor(ResourcesCompat.getColor(v.getResources(), R.color.green500, null));
            nameTv.setTextColor(ResourcesCompat.getColor(v.getResources(), R.color.green300, null));
            MisData.getData().get(getAdapterPosition()).setPresent(1);
            isPresent = 1;
        }

        public void setAbsent(View v) {
            card.setBackground(ResourcesCompat.getDrawable(v.getResources(), R.drawable.mis_text_absent, null));
            paText.setText("A");
            paText.setBackground(ContextCompat.getDrawable(v.getContext(), R.drawable.red_circle_background));
            misTv.setTextColor(ResourcesCompat.getColor(v.getResources(), R.color.red500, null));
            nameTv.setTextColor(ResourcesCompat.getColor(v.getResources(), R.color.red300, null));
            MisData.getData().get(getAdapterPosition()).setPresent(0);
            isPresent = 0;
        }
    }
}


text:
using System;
using System.Collections.Generic;
using Android.Runtime;
using System.Threading.Tasks;

namespace Square.OkHttp3
{
    public static class CallExtensions
    {
        public static Task<Response> ExecuteAsync(this ICall call)
        {
            var tcs = new TaskCompletionSource<Response>();

            call.Enqueue(
                (c, response) =>
                {
                    tcs.SetResult(response);
                },
                (c, exception) =>
                {
                    if (call.IsCanceled)
                    {
                        tcs.SetCanceled();
                    }
                    else
                    {
                        tcs.SetException(exception);
                    }
                });

            return tcs.Task;
        }

        public static void Enqueue(this ICall call, Action<ICall, Response> onResponse, Action<ICall, Java.IO.IOException> onFailure)
        {
            call.Enqueue(new ActionCallback(onResponse, onFailure));
        }

        private class ActionCallback : Java.Lang.Object, global::Square.OkHttp3.ICallback
        {
            private readonly Action<ICall, Response> onResponse;
            private readonly Action<ICall, Java.IO.IOException> onFailure;

            public ActionCallback(Action<ICall, Response> onResponse, Action<ICall, Java.IO.IOException> onFailure)
            {
                this.onResponse = onResponse;
                this.onFailure = onFailure;
            }

            public void OnResponse(ICall call, Response response)
            {
                if (onResponse != null)
                {
                    onResponse(call, response);
                }
            }

            public void OnFailure(ICall call, Java.IO.IOException exception)
            {
                if (onFailure != null)
                {
                    onFailure(call, exception);
                }
            }
        }
    }
}


text:
/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */

/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */
@import url("menu.css");

html,
button,
input,
select,
textarea {
    color: #222;
}

html {
    font-size: 1em;
    line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight: h5bp.com/i
 * These selection rule sets have to be separate.
 * Customize the background color to match your design.
 */

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #ccc;
    margin: 1em 0;
    padding: 0;
}

/*
 * Remove the gap between images, videos, audio and canvas and the bottom of
 * their containers: h5bp.com/i/440
 */

audio,
canvas,
img,
video {
    vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
    resize: vertical;
}

/* ==========================================================================
   Browse Happy prompt
   ========================================================================== */

.browsehappy {
    margin: 0.2em 0;
    background: #ccc;
    color: #000;
    padding: 0.2em 0;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

.header {
    height: 50px;
}

.body {
    position: absolute;
    top: 53px;
    right: 0;
    bottom: 0;
    left: 0;

    display: flex;
}

.sidebar {
    width: 140px;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    display: flex;
    overflow: auto;
}

.column {
    padding: 200px;
    border-right: 1px solid #999;
}

.column > div {
    height: 2000px;
    background: red;
}

.column:nth-child(2) > div {
    height: auto;
}

.properties {
    width: 275px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #eee;
}

body {
    font-family: sans-serif;
    font-size: 10px;
    line-height: 20px;
}

.header {
    font-size: 20px;
    font-weight: bold;
    line-height: 50px;
    color: #fff;
    background: #444;

}

/* navigation bar */
ul.navbar {
    float: left;

    margin-top: 0px;
    padding-left: 10px;
    height: 50px;
    width: auto;
    margin-bottom: 0px;

}

ul.navbar li {
    list-style: none;
    margin: 0;
    flex-direction: row;
    display: flex;
    float: left;

    padding: 0px 10px;
    width: auto;
    height: 50px;
}

ul.navbar span {
    display: block;
    float: left;
    line-height: 1.9;
}

ul.navbar span#titlename {
    text-transform: uppercase;
}

ul#navbar-right {
    float: right;
    padding-right: 20px;
}

#navtab > a {
    color: #666;
    line-height: 1.9;
}
#navmenu > a {
    color: #666;
    line-height: 1.9;
}

/* don't work */
.ui-icon-white {
    background-image: url(images/ui-icons_ffffff_256x240.png);
}

.ui-icon {
    zoom: 1.4;
}
/* End navigation bar*/

.sidebar {
    background: #666;
    padding: 4px 20px;
    color: #fff;
}

.page-hdr {
    padding: 0px 0px;
    background: #ddd;
    color: #000000;
    /*font-size: .8em;*/
    text-align: center;
    font-size: 10px;
    font-weight: bold;
    height: 30px;
    min-height: 30px;
    max-height: 30px;
}

/* little navigation bar*/
#navbar-left-little {
    padding: 0px 0px;
    display: block;
    height: 30px;
    width: auto;
}
#navbar-left-little > li{
    padding: 0px 9px;
    display: block;
    height: 30px;
}
#navbar-right-little {
    float: right;
    padding: 0px 0px;
    display: block;
    height: 30px;
    width: auto;
}
#navbar-right-little > li{
    padding: 0px 10px;
    display: block;
    height: 30px;
}

#navadd {
    background: #ddd;
    cursor: pointer;
    color: #666;
}
#navbar-middle-little {
    width: 30px;
    height: 200px;
    float: left;
    padding: 10px 10px;
    padding-left: 13px;
    list-style: none;
    margin-top: 7px;
}
/* End little navigation bar */

.content {
    background: #ffffff;
}

#tabs > ul {
    position: fixed;
    width: 250px;
}

.tab{
    background: #1fa0e4;
    color: #1fa0e4;
    overflow-y: auto;
    margin-top: 60px;
}

.btns {
    position: absolute;
}

#btn-menu {
    left: auto;
}

#icon-plus {
    padding: 10px;
}

#icon-menu {
    padding: 10px;
    left: auto;
}

.pm-content {
    font-size: 14px;
}

/* checkbox */
.cbox {
    border-color: #e5e5e5;
    border-style: solid;
    border-width: 1px;
    border-radius: 4px;
    padding: 0px 10px;
    background-color: whitesmoke;
}

/* make objects visible */
.invis {
    display: none;
}
.invis.vis {
    display: block;
}
/* End make objects visible */

/* name of the current szenario in little header*/
#lname {
    font-size: 1.5em;
    margin-bottom: 0px;
    /*background: #48c9b0;
    color: white;*/
    padding: 0 10px;
    font-size: 15px;
}
#lname:hover {
    cursor: pointer;
}

/* modal window */
/* set label color */
.label-modal {
    color: #000000!important;
}

/* additional bootstrap modal window header design */
.modal-header {
    background: #1abc9c;
    border-radius: 4px 4px 0 0;
    text-align: center;
    color: whitesmoke;
}

/* set color of the deletion select bar in "delete scenarios" */
#s2id_selectSzenarioDeletion2 {
    border-color: #e74c3c;
}

/* set label color */
#hrefPW {
    cursor:pointer;
    color: #16a085;
    margin-top: 10px;
}
/* END modal window*/

/* flat ui */
/* don't see dropdown in multi selections*/
.select2-drop-multi .select2-results {
    /*display: none!important;*/
}
/* deactivate inputs in multi selections*/
.select2-search-field {
    /*display: none!important;*/
}
/* end flat ui */

/* multi selection object with edit function */
.select2-search-choice .select2-search-choice-edit {
    position: absolute;
    top: 0;
    right: 20px;
    bottom: 0;
    z-index: 2;
    /*width: 100%;*/
    padding-right: 10px;
    font-size: 12px;
    color: #fff;
    text-align: right;
    text-decoration: none;
    cursor: pointer;
    filter: alpha(opacity=0);
    opacity: 0;
    -webkit-transition: opacity .25s linear;
    transition: opacity .25s linear;
}
.select2-search-choice:hover .select2-search-choice-edit {
    color: inherit;
    filter: none;
    opacity: 1;
    -webkit-filter: none;
}
.select2-search-choice .select2-search-choice-edit:after {
    font-family: "Flat-UI-Icons";
    line-height: 27px;
    content: "\e628";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.select2-search-choice .select2-search-choice-close {
    width: 20px!important;
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Image replacement
 */

.ir {
    background-color: transparent;
    border: 0;
    overflow: hidden;
    /* IE 6/7 fallback */
    *text-indent: -9999px;
}

.ir:before {
    content: "";
    display: block;
    width: 0;
    height: 150%;
}

/*
 * Hide from both screenreaders and browsers: h5bp.com/u
 */

.hidden {
    display: none !important;
    visibility: hidden;
}

/*
 * Hide only visually, but have it available for screenreaders: h5bp.com/v
 */

.visuallyhidden {
    border: 0;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
}

/*
 * Extends the .visuallyhidden class to allow the element to be focusable
 * when navigated to via the keyboard: h5bp.com/p
 */

.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
    clip: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    position: static;
    width: auto;
}

/*
 * Hide visually and from screenreaders, but maintain layout
 */

.invisible {
    visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * For modern browsers
 * 1. The space content is one way to avoid an Opera bug when the
 *    `contenteditable` attribute is included anywhere else in the document.
 *    Otherwise it causes space to appear at the top and bottom of elements
 *    that receive the `clearfix` class.
 * 2. The use of `table` rather than `block` is only necessary if using
 *    `:before` to contain the top-margins of child elements.
 */

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
    /* Style adjustments for viewports that meet the condition */
}

@media print,
       (-o-min-device-pixel-ratio: 5/4),
       (-webkit-min-device-pixel-ratio: 1.25),
       (min-resolution: 120dpi) {
    /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid required HTTP connection: h5bp.com/r
   ========================================================================== */

@media print {
    * {
        background: transparent !important;
        color: #000 !important; /* Black prints faster: h5bp.com/s */
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]:after {
        content: " (" attr(href) ")";
    }

    abbr[title]:after {
        content: " (" attr(title) ")";
    }

    /*
     * Don't show links for images, or javascript/internal links
     */

    .ir a:after,
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }

    pre,
    blockquote {
        border: 1px solid #999;
        page-break-inside: avoid;
    }

    thead {
        display: table-header-group; /* h5bp.com/t */
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 0.5cm;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}


text:
package instruments

type Instrument interface {
	Send()
}


text:
#import "IDEIndexCompletionItem.h"

@class NSImage;

@interface IDEIndexCompletionItem (IDEKitExtensions)
- (void)infoViewControllerWithWidth:(double)arg1 context:(id)arg2 completionBlock:(id)arg3;
@property(readonly) NSImage *icon;
@end


text:
def arithmetic_mean(x, *l):
    """ The function calculates the arithmetic mean of a non-empty
        arbitrary number of numbers """
    sum = x
    for i in l:
        sum += i

    return sum / (1.0 + len(l))
print arithmetic_mean(4, 7, 9)


text:
import hoistVariables from "babel-helper-hoist-variables";
import template from "babel-template";

let buildTemplate = template(`
  System.register(MODULE_NAME, [SOURCES], function (EXPORT_IDENTIFIER, CONTEXT_IDENTIFIER) {
    BEFORE_BODY;
    return {
      setters: [SETTERS],
      execute: function () {
        BODY;
      }
    };
  });
`);

let buildExportAll = template(`
  for (var KEY in TARGET) {
    if (KEY !== "default") EXPORT_OBJ[KEY] = TARGET[KEY];
  }
`);

export default function ({ types: t }) {
  let IGNORE_REASSIGNMENT_SYMBOL = Symbol();

  let reassignmentVisitor = {
    "AssignmentExpression|UpdateExpression"(path) {
      if (path.node[IGNORE_REASSIGNMENT_SYMBOL]) return;
      path.node[IGNORE_REASSIGNMENT_SYMBOL] = true;

      let arg = path.get(path.isAssignmentExpression() ? "left" : "argument");
      if (!arg.isIdentifier()) return;

      let name = arg.node.name;

      // redeclared in this scope
      if (this.scope.getBinding(name) !== path.scope.getBinding(name)) return;

      let exportedNames = this.exports[name];
      if (!exportedNames) return;

      let node = path.node;

      for (let exportedName of exportedNames) {
        node = this.buildCall(exportedName, node).expression;
      }

      path.replaceWith(node);
    }
  };

  return {
    inherits: require("babel-plugin-transform-strict-mode"),

    visitor: {
      ReferencedIdentifier(path, state) {
        if (path.node.name == "__moduleName" && !path.scope.hasBinding("__moduleName")) {
          path.replaceWith(t.memberExpression(state.contextIdent, t.identifier("id")));
        }
      },

      Program: {
        enter(path, state) {
          state.contextIdent = path.scope.generateUidIdentifier("context");
        },
        exit(path, state) {
          let exportIdent = path.scope.generateUidIdentifier("export");
          let contextIdent = state.contextIdent;

          let exportNames = Object.create(null);
          let modules = Object.create(null);

          let beforeBody = [];
          let setters = [];
          let sources = [];
          let variableIds = [];

          function addExportName(key, val) {
            exportNames[key] = exportNames[key] || [];
            exportNames[key].push(val);
          }

          function pushModule(source, key, specifiers) {
            let _modules = modules[source] = modules[source] || { imports: [], exports: [] };
            _modules[key] = _modules[key].concat(specifiers);
          }

          function buildExportCall(name, val) {
            return t.expressionStatement(
              t.callExpression(exportIdent, [t.stringLiteral(name), val])
            );
          }

          let body: Array<Object> = path.get("body");

          let canHoist = true;
          for (let path of body) {
            if (path.isExportDeclaration()) path = path.get("declaration");
            if (path.isVariableDeclaration() && path.node.kind !== "var") {
              canHoist = false;
              break;
            }
          }

          for (let path of body) {
            if (canHoist && path.isFunctionDeclaration()) {
              beforeBody.push(path.node);
              path.remove();
            } else if (path.isImportDeclaration()) {
              let source = path.node.source.value;
              pushModule(source, "imports", path.node.specifiers);
              for (let name in path.getBindingIdentifiers()) {
                path.scope.removeBinding(name);
                variableIds.push(t.identifier(name));
              }
              path.remove();
            } else if (path.isExportAllDeclaration()) {
              pushModule(path.node.source.value, "exports", path.node);
              path.remove();
            } else if (path.isExportDefaultDeclaration()) {
              let declar = path.get("declaration");
              if (declar.isClassDeclaration() || declar.isFunctionDeclaration()) {
                let id = declar.node.id;
                let nodes = [];

                if (id) {
                  nodes.push(declar.node);
                  nodes.push(buildExportCall("default", id));
                  addExportName(id.name, "default");
                } else {
                  nodes.push(buildExportCall("default", t.toExpression(declar.node)));
                }

                if (!canHoist || declar.isClassDeclaration()) {
                  path.replaceWithMultiple(nodes);
                } else {
                  beforeBody = beforeBody.concat(nodes);
                  path.remove();
                }
              } else {
                path.replaceWith(buildExportCall("default", declar.node));
              }
            } else if (path.isExportNamedDeclaration()) {
              let declar = path.get("declaration");

              if (declar.node) {
                path.replaceWith(declar);

                let nodes = [];
                let bindingIdentifiers;
                if (path.isFunction()) {
                  bindingIdentifiers = { [declar.node.id.name]: declar.node.id };
                } else {
                  bindingIdentifiers = declar.getBindingIdentifiers();
                }
                for (let name in bindingIdentifiers) {
                  addExportName(name, name);
                  nodes.push(buildExportCall(name, t.identifier(name)));
                }
                path.insertAfter(nodes);
              }

              let specifiers = path.node.specifiers;
              if (specifiers && specifiers.length) {
                if (path.node.source) {
                  pushModule(path.node.source.value, "exports", specifiers);
                  path.remove();
                } else {
                  let nodes = [];

                  for (let specifier of specifiers) {
                    nodes.push(buildExportCall(specifier.exported.name, specifier.local));
                    addExportName(specifier.local.name, specifier.exported.name);
                  }

                  path.replaceWithMultiple(nodes);
                }
              }
            }
          }

          for (let source in modules) {
            let specifiers = modules[source];

            let setterBody = [];
            let target = path.scope.generateUidIdentifier(source);

            for (let specifier of specifiers.imports) {
              if (t.isImportNamespaceSpecifier(specifier)) {
                setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, target)));
              } else if (t.isImportDefaultSpecifier(specifier)) {
                specifier = t.importSpecifier(specifier.local, t.identifier("default"));
              }

              if (t.isImportSpecifier(specifier)) {
                setterBody.push(t.expressionStatement(t.assignmentExpression("=", specifier.local, t.memberExpression(target, specifier.imported))));
              }
            }

            if (specifiers.exports.length) {
              let exportObjRef = path.scope.generateUidIdentifier("exportObj");

              setterBody.push(t.variableDeclaration("var", [
                t.variableDeclarator(exportObjRef, t.objectExpression([]))
              ]));

              for (let node of specifiers.exports) {
                if (t.isExportAllDeclaration(node)) {
                  setterBody.push(buildExportAll({
                    KEY: path.scope.generateUidIdentifier("key"),
                    EXPORT_OBJ: exportObjRef,
                    TARGET: target
                  }));
                } else if (t.isExportSpecifier(node)) {
                  setterBody.push(t.expressionStatement(
                    t.assignmentExpression("=", t.memberExpression(exportObjRef, node.exported), t.memberExpression(target, node.local))
                  ));
                } else {
                  // todo
                }
              }

              setterBody.push(t.expressionStatement(t.callExpression(exportIdent, [exportObjRef])));
            }

            sources.push(t.stringLiteral(source));
            setters.push(t.functionExpression(null, [target], t.blockStatement(setterBody)));
          }

          let moduleName = this.getModuleName();
          if (moduleName) moduleName = t.stringLiteral(moduleName);

          if (canHoist) {
            hoistVariables(path, id => variableIds.push(id));
          }

          if (variableIds.length) {
            beforeBody.unshift(t.variableDeclaration("var", variableIds.map(id => t.variableDeclarator(id))));
          }

          path.traverse(reassignmentVisitor, {
            exports: exportNames,
            buildCall: buildExportCall,
            scope: path.scope
          });

          path.node.body = [
            buildTemplate({
              BEFORE_BODY: beforeBody,
              MODULE_NAME: moduleName,
              SETTERS: setters,
              SOURCES: sources,
              BODY: path.node.body,
              EXPORT_IDENTIFIER: exportIdent,
              CONTEXT_IDENTIFIER: contextIdent
            })
          ];
        }
      }
    }
  };
}


text:
/* Automatically generated nanopb constant definitions */
/* Generated by nanopb-0.3.7-dev */

#include "src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.h"

/* @@protoc_insertion_point(includes) */
#if PB_PROTO_HEADER_VERSION != 30
#error Regenerate this file with the current version of nanopb generator.
#endif

const pb_field_t grpc_lb_v1_Duration_fields[3] = {
    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_Duration, seconds, seconds, 0),
    PB_FIELD(  2, INT32   , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_Duration, nanos, seconds, 0),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_LoadBalanceRequest_fields[3] = {
    PB_FIELD(  1, MESSAGE , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_LoadBalanceRequest, initial_request, initial_request, &grpc_lb_v1_InitialLoadBalanceRequest_fields),
    PB_FIELD(  2, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_LoadBalanceRequest, client_stats, initial_request, &grpc_lb_v1_ClientStats_fields),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_InitialLoadBalanceRequest_fields[2] = {
    PB_FIELD(  1, STRING  , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_InitialLoadBalanceRequest, name, name, 0),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_ClientStats_fields[4] = {
    PB_FIELD(  1, INT64   , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_ClientStats, total_requests, total_requests, 0),
    PB_FIELD(  2, INT64   , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_ClientStats, client_rpc_errors, total_requests, 0),
    PB_FIELD(  3, INT64   , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_ClientStats, dropped_requests, client_rpc_errors, 0),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_LoadBalanceResponse_fields[3] = {
    PB_FIELD(  1, MESSAGE , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_LoadBalanceResponse, initial_response, initial_response, &grpc_lb_v1_InitialLoadBalanceResponse_fields),
    PB_FIELD(  2, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_LoadBalanceResponse, server_list, initial_response, &grpc_lb_v1_ServerList_fields),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_InitialLoadBalanceResponse_fields[3] = {
    PB_FIELD(  1, STRING  , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_InitialLoadBalanceResponse, load_balancer_delegate, load_balancer_delegate, 0),
    PB_FIELD(  2, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval, load_balancer_delegate, &grpc_lb_v1_Duration_fields),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_ServerList_fields[3] = {
    PB_FIELD(  1, MESSAGE , REPEATED, CALLBACK, FIRST, grpc_lb_v1_ServerList, servers, servers, &grpc_lb_v1_Server_fields),
    PB_FIELD(  3, MESSAGE , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_ServerList, expiration_interval, servers, &grpc_lb_v1_Duration_fields),
    PB_LAST_FIELD
};

const pb_field_t grpc_lb_v1_Server_fields[5] = {
    PB_FIELD(  1, BYTES   , OPTIONAL, STATIC  , FIRST, grpc_lb_v1_Server, ip_address, ip_address, 0),
    PB_FIELD(  2, INT32   , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_Server, port, ip_address, 0),
    PB_FIELD(  3, STRING  , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_Server, load_balance_token, port, 0),
    PB_FIELD(  4, BOOL    , OPTIONAL, STATIC  , OTHER, grpc_lb_v1_Server, drop_request, load_balance_token, 0),
    PB_LAST_FIELD
};

/* Check that field information fits in pb_field_t */
#if !defined(PB_FIELD_32BIT)
/* If you get an error here, it means that you need to define PB_FIELD_32BIT
 * compile-time option. You can do that in pb.h or on compiler command line.
 *
 * The reason you need to do this is that some of your messages contain tag
 * numbers or field sizes that are larger than what can fit in 8 or 16 bit
 * field descriptors.
 */
PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 65536 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 65536 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 65536 && pb_membersize(grpc_lb_v1_ServerList, servers) < 65536 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server)
#endif

#if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT)
/* If you get an error here, it means that you need to define PB_FIELD_16BIT
 * compile-time option. You can do that in pb.h or on compiler command line.
 *
 * The reason you need to do this is that some of your messages contain tag
 * numbers or field sizes that are larger than what can fit in the default
 * 8 bit descriptors.
 */
PB_STATIC_ASSERT((pb_membersize(grpc_lb_v1_LoadBalanceRequest, initial_request) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceRequest, client_stats) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, initial_response) < 256 && pb_membersize(grpc_lb_v1_LoadBalanceResponse, server_list) < 256 && pb_membersize(grpc_lb_v1_InitialLoadBalanceResponse, client_stats_report_interval) < 256 && pb_membersize(grpc_lb_v1_ServerList, servers) < 256 && pb_membersize(grpc_lb_v1_ServerList, expiration_interval) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_grpc_lb_v1_Duration_grpc_lb_v1_LoadBalanceRequest_grpc_lb_v1_InitialLoadBalanceRequest_grpc_lb_v1_ClientStats_grpc_lb_v1_LoadBalanceResponse_grpc_lb_v1_InitialLoadBalanceResponse_grpc_lb_v1_ServerList_grpc_lb_v1_Server)
#endif

/* @@protoc_insertion_point(eof) */


text:
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.db.models import Count
from django.utils.translation import ugettext_lazy as _
from collections import OrderedDict
from .models import SponsorLevel, Speaker

def default(request):
    title = None
    url = request.path
    if settings.FORCE_SCRIPT_NAME:
        url = url[len(settings.FORCE_SCRIPT_NAME):]
    base_content = FlatPage.objects.filter(url=url).first()

    menu = OrderedDict([
        ('about', {
            'title': _('About'),
            'icon': 'python',
            'dropdown': OrderedDict([
                ('pyconkr', {'title': _('About PyCon Korea 2015')}),
                ('coc', {'title': _('Code of Conduct')}),
                ('announcements', {'title': _('Announcements')}),
                ('sponsors', {'title': _('Sponsors')}),
                ('staff', {'title': _('Staff')}),
                ('contact', {'title': _('Contact')}),
            ]),
        }),
        ('programs', {
            'title': _('Programs'),
            'icon': 'calendar',
            'dropdown': OrderedDict([
                ('cfp', {'title': _('Call for proposals')}),
                ('schedule', {'title': _('Schedule')}),
                ('list', {'title': _('Program list')}),
                ('speakers', {'title': _('Speakers')}),
                ('ost', {'title': _('Open Spaces')}),
            ]),
        }),
        ('venue', {
            'title': _('Getting here'),
            'icon': 'map-marker',
            'dropdown': OrderedDict([
                ('map', {'title': _('Venue Map')}),
                ('transportation', {'title': _('Transportation')}),
                ('hotels', {'title': _('Hotels')}),
                ('restaurants', {'title': _('Restaurants')}),
            ]),
        }),
        ('registration', {
            'title': _('Registration'),
            'icon': 'pencil',
        }),
    ])

    for k, v in menu.iteritems():
        path = '/{}/'.format(k)

        if request.path.endswith(path):
            v['active'] = True
            title = v['title']

        if 'dropdown' in v:
            for sk, sv in v['dropdown'].iteritems():
                subpath = '{}{}/'.format(path, sk)

                if request.path.endswith(subpath):
                    sv['active'] = True
                    title = sv['title']

    return {
        'menu': menu,
        'title': title,
        'domain': settings.DOMAIN,
        'base_content': base_content.content if base_content else '',
    }

def profile(request):
    speaker = None
    programs = None

    if request.user.is_authenticated():
        speaker = Speaker.objects.filter(email=request.user.email).first()
        if speaker:
            programs = speaker.program_set.all()

    return {
        'my_speaker': speaker,
        'my_programs': programs,
    }

def sponsors(request):
    levels = SponsorLevel.objects.annotate(
        num_sponsors=Count('sponsor')).filter(num_sponsors__gt=0)

    return {
        'levels': levels,
    }


text:
// Package keepalive defines configurable parameters for point-to-point
// healthcheck.
package keepalive

import (
	"time"
)

// ClientParameters is used to set keepalive parameters on the client-side.
// These configure how the client will actively probe to notice when a
// connection is broken and send pings so intermediaries will be aware of the
// liveness of the connection. Make sure these parameters are set in
// coordination with the keepalive policy on the server, as incompatible
// settings can result in closing of connection.
type ClientParameters struct {
	// After a duration of this time if the client doesn't see any activity it
	// pings the server to see if the transport is still alive.
	Time time.Duration // The current default value is infinity.
	// After having pinged for keepalive check, the client waits for a duration
	// of Timeout and if no activity is seen even after that the connection is
	// closed.
	Timeout time.Duration // The current default value is 20 seconds.
	// If true, client sends keepalive pings even with no active RPCs. If false,
	// when there are no active RPCs, Time and Timeout will be ignored and no
	// keepalive pings will be sent.
	PermitWithoutStream bool // false by default.
}

// ServerParameters is used to set keepalive and max-age parameters on the
// server-side.
type ServerParameters struct {
	// MaxConnectionIdle is a duration for the amount of time after which an
	// idle connection would be closed by sending a GoAway. Idleness duration is
	// defined since the most recent time the number of outstanding RPCs became
	// zero or the connection establishment.
	MaxConnectionIdle time.Duration // The current default value is infinity.
	// MaxConnectionAge is a duration for the maximum amount of time a
	// connection may exist before it will be closed by sending a GoAway. A
	// random jitter of +/-10% will be added to MaxConnectionAge to spread out
	// connection storms.
	MaxConnectionAge time.Duration // The current default value is infinity.
	// MaxConnectionAgeGrace is an additive period after MaxConnectionAge after
	// which the connection will be forcibly closed.
	MaxConnectionAgeGrace time.Duration // The current default value is infinity.
	// After a duration of this time if the server doesn't see any activity it
	// pings the client to see if the transport is still alive.
	Time time.Duration // The current default value is 2 hours.
	// After having pinged for keepalive check, the server waits for a duration
	// of Timeout and if no activity is seen even after that the connection is
	// closed.
	Timeout time.Duration // The current default value is 20 seconds.
}

// EnforcementPolicy is used to set keepalive enforcement policy on the
// server-side. Server will close connection with a client that violates this
// policy.
type EnforcementPolicy struct {
	// MinTime is the minimum amount of time a client should wait before sending
	// a keepalive ping.
	MinTime time.Duration // The current default value is 5 minutes.
	// If true, server allows keepalive pings even when there are no active
	// streams(RPCs). If false, and client sends ping when there are no active
	// streams, server will send GOAWAY and close the connection.
	PermitWithoutStream bool // false by default.
}


text:
import re

from .document import InselectDocument
from .inselect_error import InselectError
from .utils import debug_print

# Supported image formats
IMAGE_SUFFIXES = ('.bmp', '.jpeg', '.jpg', '.png', '.tif', '.tiff',)

# A case-insensitive regular expression that matches each suffix
IMAGE_SUFFIXES_RE = '|'.join(p[1:] for p in IMAGE_SUFFIXES)
IMAGE_SUFFIXES_RE = '^.*\\.({0})$'.format(IMAGE_SUFFIXES_RE)
IMAGE_SUFFIXES_RE = re.compile(IMAGE_SUFFIXES_RE, re.IGNORECASE)

# Patterns in the form *.bmp, *.jpeg etc
IMAGE_PATTERNS = tuple(['*{0}'.format(s) for s in IMAGE_SUFFIXES])

def ingest_image(source, dest_dir,
                 thumbnail_width_pixels=InselectDocument.THUMBNAIL_DEFAULT_WIDTH,
                 default_metadata_items=None,
                 cookie_cutter=None):
    """Copies the image in the path source to the directory in the path
    dest_dir. Creates an returns a new instance of InselectDocument for the
    copied image.

    default_metadata_items should be either None or a list of dicts.
    cookie_cutter should be either None or an instance of lib.CookieCutter.

    Default metadata takes precedence - cookie cutter items are applied only if
    default_metadata_items is None.

    An exception is raised if the destination image exists.
    An exception is raised if the Inselect document already exists.
    """
    dest = dest_dir / source.name
    if source != dest and dest.is_file():
        raise InselectError('Destination image [{0}] exists'.format(dest))
    else:
        debug_print('Ingesting [{0}] to [{1}]'.format(source, dest))

        if source != dest:
            source.rename(dest)

        # Raises if the document already exists
        doc = InselectDocument.new_from_scan(dest, thumbnail_width_pixels)

        if default_metadata_items:
            debug_print('Adding [{0}] default metadata items'.format(
                len(default_metadata_items)
            ))
            doc.set_items(default_metadata_items)
            doc.save()
        elif cookie_cutter:
            debug_print('Adding cookie cutter items')
            cookie_cutter.apply(doc)
            doc.save()

        # TODO LH Copy EXIF tags?
        debug_print('Ingested [{0}] to [{1}]'.format(source, dest))

        return doc


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fresco="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/sdvUserProfileImage"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_marginLeft="14dp"
        android:layout_marginBottom="6dp"
        android:layout_marginTop="6dp"
        fresco:placeholderImage="@drawable/gray_oval"
        fresco:roundAsCircle="true"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Medium Text"
        android:id="@+id/tvUserName"
        android:fontFamily="san-serif-medium"
        android:textColor="@color/blue_text"
        android:textSize="14sp"
        android:layout_toRightOf="@+id/sdvUserProfileImage"
        android:layout_toEndOf="@+id/sdvUserProfileImage"
        android:layout_marginLeft="8dp"
        android:gravity="center_vertical"
        android:layout_alignParentTop="true"
        android:layout_above="@+id/sdvPostImage" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="14dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Medium Text"
        android:id="@+id/tvPostDate"
        android:textColor="@color/light_gray_text"
        android:textSize="14sp"
        android:fontFamily="san-serif"
        android:layout_alignParentTop="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:layout_above="@+id/sdvPostImage"
        android:enabled="true"
        android:gravity="center_vertical" />

    <com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/sdvPostImage"
        android:layout_width="150dp"
        android:layout_height="300dp"
        fresco:placeholderImage="@drawable/gray_rectangle"
        fresco:viewAspectRatio="1.0"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/sdvUserProfileImage"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="14dp"
        android:layout_marginBottom="4dp"
        android:layout_marginTop="10dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Medium Text"
        android:id="@+id/tvLikeCount"
        android:layout_below="@+id/sdvPostImage"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:drawableLeft="@drawable/ic_small_heart_filled"
        android:fontFamily="san-serif-medium"
        android:textColor="@color/blue_text"
        android:textSize="14sp"
        android:enabled="true"
        android:drawablePadding="5dp"
        android:gravity="center_horizontal" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="14dp"
        android:layout_marginRight="14dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Medium Text"
        android:id="@+id/tvCaption"
        android:fontFamily="san-serif-medium"
        android:textSize="14sp"
        android:singleLine="false"
        android:lineSpacingMultiplier="1.2"
        android:layout_below="@+id/tvLikeCount"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginBottom="24dp" />

</RelativeLayout>


text:
#pragma once
#include "util/sexpr/format.h"
#include "library/vm/vm.h"

namespace lean {
bool is_format(vm_obj const & o);
format const & to_format(vm_obj const & o);
vm_obj to_obj(format const & fmt);

/* Return an object of type (unit -> format) */
vm_obj mk_vm_format_thunk(std::function<format()> const & fn);

void initialize_vm_format();
void finalize_vm_format();
void initialize_vm_format_builtin_idxs();
}


text:
require "spec_helper"
require "hamster/hash"

describe Hamster::Hash do
  describe "#key" do
    let(:hash) { Hamster.hash(a: 1, b: 1, c: 2, d: 3) }

    it "returns a key associated with the given value, if there is one" do
      [:a, :b].include?(hash.key(1)).should == true
      hash.key(2).should be(:c)
      hash.key(3).should be(:d)
    end

    it "returns nil if there is no key associated with the given value" do
      hash.key(5).should be_nil
      hash.key(0).should be_nil
    end

    it "uses #== to compare values for equality" do
      hash.key(EqualNotEql.new).should_not be_nil
      hash.key(EqlNotEqual.new).should be_nil
    end

    it "doesn't use default block if value is not found" do
      Hamster.hash(a: 1) { fail }.key(2).should be_nil
    end
  end
end


text:
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using DevExpress.CodeRush.Core;
using DevExpress.CodeRush.PlugInCore;
using DevExpress.CodeRush.StructuralParser;
using DevExpress.Refactor;

namespace CR_UseExtensionMethod
{
    public partial class PlugIn1 : StandardPlugIn
    {
        // DXCore-generated code...
        #region InitializePlugIn
        public override void InitializePlugIn()
        {
            base.InitializePlugIn();
            registerUseExtensionMethod();
            registerUseExtensionMethodCP();
        }
        #endregion
        #region FinalizePlugIn
        public override void FinalizePlugIn()
        {
            //
            // TODO: Add your finalization code here.
            //

            base.FinalizePlugIn();
        }
        #endregion

        private void registerUseExtensionMethod()
        {
            DevExpress.Refactor.Core.RefactoringProvider UseExtensionMethod = new DevExpress.Refactor.Core.RefactoringProvider(components);
            ((System.ComponentModel.ISupportInitialize)(UseExtensionMethod)).BeginInit();
            UseExtensionMethod.ProviderName = "UseExtensionMethod"; // Should be Unique
            UseExtensionMethod.DisplayName = "Use Extension Method";
            UseExtensionMethod.CheckAvailability += UseExtensionMethod_CheckAvailability;
            UseExtensionMethod.Apply += UseExtensionMethod_Apply;
            ((System.ComponentModel.ISupportInitialize)(UseExtensionMethod)).EndInit();
        }
        private void UseExtensionMethod_CheckAvailability(Object sender, CheckContentAvailabilityEventArgs ea)
        {
            // On Method Call
            MethodReferenceExpression MethodReference = ea.Element as MethodReferenceExpression;

            if (MethodReference == null)
                return; // Method does not exist;

            Method MethodDeclaration = (Method)MethodReference.GetDeclaration();
            if (MethodDeclaration == null)
                return; // Method not declared

            // Existing Method is recognised as Extension Method
            if (!CodeRush.Language.IsExtensionMethod(MethodDeclaration))
                return;

            // Method IS NOT CALLED with Namespace qualified
            if (QualifiedWithNamespace(MethodReference))
                return;
            ea.Available = true;
        }
        private void UseExtensionMethod_Apply(Object sender, ApplyContentEventArgs ea)
        {
            // The method in question is assumed to already be in scope.

            // Rewrite call from
            // ... Method(Param1, OtherParams)
            // to
            // ...Param1.Method(OtherParams)

            ConvertToExtensionMethodCall(ea.Element);
        }

        private void registerUseExtensionMethodCP()
        {
            DevExpress.CodeRush.Core.CodeProvider UseExtensionMethodCP = new DevExpress.CodeRush.Core.CodeProvider(components);
            ((System.ComponentModel.ISupportInitialize)(UseExtensionMethodCP)).BeginInit();
            UseExtensionMethodCP.ProviderName = "UseExtensionMethodCP"; // Should be Unique
            UseExtensionMethodCP.DisplayName = "Use Extension Method";
            UseExtensionMethodCP.CheckAvailability += UseExtensionMethodCP_CheckAvailability;
            UseExtensionMethodCP.Apply += UseExtensionMethodCP_Apply;
            ((System.ComponentModel.ISupportInitialize)(UseExtensionMethodCP)).EndInit();
        }
        private void UseExtensionMethodCP_CheckAvailability(Object sender, CheckContentAvailabilityEventArgs ea)
        {
            // On Method Call
            MethodReferenceExpression MethodReference = ea.Element as MethodReferenceExpression;

            if (MethodReference == null)
                return; // Method does not exist;

            Method MethodDeclaration = (Method)MethodReference.GetDeclaration();
            if (MethodDeclaration == null)
                return; // Method not declared

            // Existing Method is recognised as Extension Method
            if (!CodeRush.Language.IsExtensionMethod(MethodDeclaration))
                return;

            // Method IS CALLED with Namespace qualified
            if (!QualifiedWithNamespace(MethodReference))
                return;

            ea.Available = true; // Change this to return true, only when your Code should be available.
        }
        private void UseExtensionMethodCP_Apply(Object sender, ApplyContentEventArgs ea)
        {
            // Convert
            // ... SomeNamespace.Method(Param1, OtherParams)
            // to
            // using SomeNamespace
            // ......
            // ...Param1.Method(OtherParams)

            AddReferenceToNewNamespace(GetNamespaceReference(ea.Element), ea.TextDocument);

            ConvertToExtensionMethodCall(ea.Element);
        }

        private bool QualifiedWithNamespace(MethodReferenceExpression methodReference)
        {
            LanguageElement ClassReference = (LanguageElement)methodReference.Nodes[0];
            return (ClassReference.Nodes.Count > 0);
        }
        private ElementReferenceExpression GetNamespaceReference(LanguageElement element)
        {
            MethodReferenceExpression methodReference = element as MethodReferenceExpression;
            MethodCall methodCall = methodReference.Parent as MethodCall;
            ElementReferenceExpression classReference = methodReference.Nodes[0] as ElementReferenceExpression;
            ElementReferenceExpression namespaceReference = classReference.Nodes[0] as ElementReferenceExpression;
            return namespaceReference;
        }
        private void AddReferenceToNewNamespace(ElementReferenceExpression namespaceReferenceExpression, TextDocument Doc)
        {
            var NamespaceReference = new NamespaceReference(namespaceReferenceExpression.FullSignature);
            var Code = CodeRush.CodeMod.GenerateCode(NamespaceReference, false);
            var LastNamespaceReference = CodeRush.Refactoring.FindAllNamespaceReferences(Doc.FileNode).LastOrDefault();
            if (LastNamespaceReference != null)
            {
                Doc.QueueInsert(LastNamespaceReference.Range.Start.OffsetPoint(1, 0), Code);
            }
            else
            {
                var FirstNamespace = Doc.FileNode.FindChildByElementType(LanguageElementType.Namespace);
                Doc.QueueInsert(FirstNamespace.Range.Start, Code);
            }
        }
        private void ConvertToExtensionMethodCall(LanguageElement element)
        {
            MethodReferenceExpression methodReference = element as MethodReferenceExpression;
            LanguageElement Parent = methodReference.Parent;
            SourceRange methodCallRange = methodReference.Parent.Range; //Range to overwrite with new code

            ElementReferenceExpression classReference = methodReference.Nodes[0] as ElementReferenceExpression;
            SourceRange classReferenceRange = classReference.Range;

            var firstParam = ((IHasArguments)Parent).Arguments[0];
            ((IHasArguments)Parent).Arguments.Remove(firstParam);

            //Rewrite MethodCall
            TextDocument ActiveDoc = CodeRush.Documents.ActiveTextDocument;
            ActiveDoc.QueueReplace(methodCallRange, CodeRush.Language.GenerateElement(Parent));

            // Overwrite ClassQualifier with FirstParam
            ActiveDoc.QueueReplace(classReferenceRange, CodeRush.Language.GenerateElement(firstParam));
            ActiveDoc.ApplyQueuedEdits("Referenced Extension Method");
        }
    }
}


text:
title: Telerik.Web.UI.SchedulerViewType
description: Telerik.Web.UI.SchedulerViewType
slug: Telerik.Web.UI.SchedulerViewType
---

# enum Telerik.Web.UI.SchedulerViewType

## Inheritance Hierarchy

* *[Telerik.Web.UI.SchedulerViewType]({%slug Telerik.Web.UI.SchedulerViewType%})*

## Fields

### DayView `0`

### WeekView `1`

### MonthView `2`

### ResourceView `3`

### TimelineView `4`

### MultiDayView `5`

### AgendaView `6`


text:
CREATE TABLE custom_versions (value INTEGER);
INSERT INTO custom_versions (value) VALUES (1);